fern-api 0.66.26 → 0.66.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +4 -4
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -1629,7 +1629,7 @@ ${a}`;break;case"retry":vqw(a)&&(r[n]=a);break;case"id":bqw(a)&&(r[n]=a);break;c
|
|
|
1629
1629
|
${r?e:" ".repeat(i)}`)}`}function So(e){throw new Error("Unexpected value: "+JSON.stringify(e))}function MWs(e){return new Promise(t=>setTimeout(()=>t(),e))}var Ch={};Po(Ch,{BASE64:()=>bmS,BIG_INTEGER:()=>AmS,BOOLEAN:()=>gmS,DATE:()=>OmS,DATE_TIME:()=>mmS,DOUBLE:()=>PmS,FLOAT:()=>jmS,INT:()=>wmS,INT64:()=>SmS,SAMPLE_STRINGS:()=>qmS,STRING:()=>vmS,UINT:()=>DmS,UINT64:()=>EmS,UUID:()=>MmS});var vmS="string",bmS="SGVsbG8gd29ybGQh",gmS=!0,OmS="2023-01-15",mmS="2024-01-15T09:30:00Z",PmS=1.1,jmS=1.1,wmS=1,SmS=1e6,DmS=1,EmS=1e6,MmS="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",AmS="123456789123456789",qmS=["x","xy","foo","buzz","alpha","banana","apricot","mandarin","nectarine","strawberry","pomegranate","blackcurrant"];function AWs(e){let t=new Set,r=new Set,i=[];for(let n of e)t.has(n)&&!r.has(n)&&(r.add(n),i.push(n)),t.add(n);return i}function iv(e){return e!=null}var Qzd=si(CWs(),1),hq=class e{type;subtype;essence;parameters;mimeType;input;constructor(t,r,i,n,a,u){this.type=t,this.subtype=r,this.essence=i,this.parameters=n,this.mimeType=a,this.input=u}static APPLICATION_JSON="application/json";static APPLICATION_OCTET_STREAM="application/octet-stream";static MULTIPART_FORM_DATA="multipart/form-data";static TEXT_PLAIN="text/plain";static TEXT_HTML="text/html";static TEXT_XML="text/xml";static APPLICATION_XML="application/xml";static APPLICATION_FORM_URLENCODED="application/x-www-form-urlencoded";static parse(t){if(t==null||t.trim()==="")return null;let r=t.trim(),i=Qzd.default.parse(r);return i==null?null:new e(i.type,i.subtype,i.essence,i.parameters,i,r)}toString(){return this.input}getCharset(){return this.parameters.get("charset")??null}getBoundary(){return this.parameters.get("boundary")??null}isText(){return this.type==="text"}isImage(){return this.type==="image"}isAudio(){return this.type==="audio"}isVideo(){return this.type==="video"}isFont(){return this.type==="font"}isMultipart(){return this.type==="multipart"}isApplication(){return this.type==="application"}isMessage(){return this.type==="message"}isModel(){return this.type==="model"}isCSS(){return this.isText()&&this.subtype==="css"}isCSV(){return(this.isText()||this.isApplication())&&this.subtype==="csv"}isMarkdown(){return this.isText()&&(this.subtype==="markdown"||this.subtype==="x-markdown")}isPlainText(){return this.isText()&&this.subtype==="plain"}isRichText(){return this.isText()&&this.subtype==="richtext"}isDNS(){return this.isText()&&this.subtype==="dns"}isApplicationText(){return this.isApplication()&&this.subtype==="text"}isMultiPartFormData(){return this.isMultipart()&&this.subtype==="form-data"}isMultiPartMixed(){return this.isMultipart()&&this.subtype==="mixed"}isMultiPartAlternative(){return this.isMultipart()&&this.subtype==="alternative"}isMultiPartRelated(){return this.isMultipart()&&this.subtype==="related"}isJSON(){return this.isApplication()&&this.subtype.includes("json")}isURLEncoded(){return this.isApplication()&&this.subtype==="x-www-form-urlencoded"}isOctetStream(){return this.isApplication()&&this.subtype==="octet-stream"}isPDF(){return this.isApplication()&&this.subtype==="pdf"}isZip(){return this.isApplication()&&(this.subtype==="zip"||this.subtype==="x-zip-compressed")}isGzip(){return this.isApplication()&&(this.subtype==="gzip"||this.subtype==="x-gzip")}isTar(){return this.isApplication()&&(this.subtype==="tar"||this.subtype==="x-tar")}isBrotli(){return this.isApplication()&&this.subtype==="br"}isDeflate(){return this.isApplication()&&this.subtype==="deflate"}isProtobuf(){return this.isApplication()&&(this.subtype==="protobuf"||this.subtype==="x-protobuf")}isExcel(){return this.isApplication()&&(this.subtype==="vnd.ms-excel"||this.subtype==="vnd.openxmlformats-officedocument.spreadsheetml.sheet")}isWord(){return this.isApplication()&&(this.subtype==="msword"||this.subtype==="vnd.openxmlformats-officedocument.wordprocessingml.document")}isPowerPoint(){return this.isApplication()&&(this.subtype==="vnd.ms-powerpoint"||this.subtype==="vnd.openxmlformats-officedocument.presentationml.presentation")}isAvif(){return this.isImage()&&this.subtype==="avif"}isWebP(){return this.isImage()&&this.subtype==="webp"}isSVG(){return this.isImage()&&this.subtype==="svg+xml"}isPNG(){return this.isImage()&&this.subtype==="png"}isJPEG(){return this.isImage()&&(this.subtype==="jpeg"||this.subtype==="jpg")}isGIF(){return this.isImage()&&this.subtype==="gif"}isBMP(){return this.isImage()&&this.subtype==="bmp"}isTIFF(){return this.isImage()&&(this.subtype==="tiff"||this.subtype==="tif")}isICO(){return this.isImage()&&(this.subtype==="x-icon"||this.subtype==="vnd.microsoft.icon")}isMPEG(){return this.isAudio()&&(this.subtype==="mpeg"||this.subtype==="mp3")}isWAV(){return this.isAudio()&&(this.subtype==="wav"||this.subtype==="wave")}isOGG(){return this.isAudio()&&this.subtype==="ogg"}isAAC(){return this.isAudio()&&this.subtype==="aac"}isFLAC(){return this.isAudio()&&this.subtype==="flac"}isMP4(){return this.isVideo()&&this.subtype==="mp4"}isWebM(){return this.isVideo()&&this.subtype==="webm"}isAVI(){return this.isVideo()&&this.subtype==="x-msvideo"}isMOV(){return this.isVideo()&&this.subtype==="quicktime"}isHTML(){return this.mimeType.isHTML()}isXML(){return this.mimeType.isXML()||this.isApplication()&&this.subtype.endsWith("+xml")}isJavaScript(){return this.mimeType.isJavaScript()}isBinary(){return this.isImage()||this.isAudio()||this.isVideo()||this.isFont()||this.isOctetStream()||this.isPDF()||this.isZip()||this.isGzip()||this.isTar()||this.isBrotli()}isTextBased(){return this.isText()||this.isJSON()||this.isXML()||this.isHTML()||this.isJavaScript()||this.isCSS()||this.isCSV()||this.isMarkdown()||this.isSVG()||this.isDNS()||this.isApplicationText()}isStructuredData(){return this.isJSON()||this.isXML()||this.isCSV()||this.isHTML()}isFormData(){return this.isURLEncoded()||this.isMultiPartFormData()}isCompressed(){return this.isGzip()||this.isBrotli()||this.isDeflate()||this.isZip()||this.isTar()}};var UmS=typeof global=="object"&&global&&global.Object===Object&&global,cAo=UmS;var VmS=typeof self=="object"&&self&&self.Object===Object&&self,WmS=cAo||VmS||Function("return this")(),l4=WmS;var HmS=l4.Symbol,uk=HmS;var Jzd=Object.prototype,$mS=Jzd.hasOwnProperty,GmS=Jzd.toString,bza=uk?uk.toStringTag:void 0;function QmS(e){var t=$mS.call(e,bza),r=e[bza];try{e[bza]=void 0;var i=!0}catch{}var n=GmS.call(e);return i&&(t?e[bza]=r:delete e[bza]),n}var Kzd=QmS;var JmS=Object.prototype,KmS=JmS.toString;function YmS(e){return KmS.call(e)}var Yzd=YmS;var XmS="[object Null]",ZmS="[object Undefined]",Xzd=uk?uk.toStringTag:void 0;function kmS(e){return e==null?e===void 0?ZmS:XmS:Xzd&&Xzd in Object(e)?Kzd(e):Yzd(e)}var sk=kmS;function ePS(e){return e!=null&&typeof e=="object"}var GW=ePS;var tPS="[object Symbol]";function rPS(e){return typeof e=="symbol"||GW(e)&&sk(e)==tPS}var wer=rPS;function iPS(e,t){for(var r=-1,i=e==null?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}var s8n=iPS;var nPS=Array.isArray,QC=nPS;var aPS=1/0,Zzd=uk?uk.prototype:void 0,kzd=Zzd?Zzd.toString:void 0;function eRd(e){if(typeof e=="string")return e;if(QC(e))return s8n(e,eRd)+"";if(wer(e))return kzd?kzd.call(e):"";var t=e+"";return t=="0"&&1/e==-aPS?"-0":t}var tRd=eRd;var oPS=/\s/;function uPS(e){for(var t=e.length;t--&&oPS.test(e.charAt(t)););return t}var rRd=uPS;var sPS=/^\s+/;function cPS(e){return e&&e.slice(0,rRd(e)+1).replace(sPS,"")}var iRd=cPS;function lPS(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var bF=lPS;var nRd=NaN,fPS=/^[-+]0x[0-9a-f]+$/i,dPS=/^0b[01]+$/i,pPS=/^0o[0-7]+$/i,_PS=parseInt;function hPS(e){if(typeof e=="number")return e;if(wer(e))return nRd;if(bF(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=bF(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=iRd(e);var r=dPS.test(e);return r||pPS.test(e)?_PS(e.slice(2),r?2:8):fPS.test(e)?nRd:+e}var aRd=hPS;var oRd=1/0,yPS=17976931348623157e292;function vPS(e){if(!e)return e===0?e:0;if(e=aRd(e),e===oRd||e===-oRd){var t=e<0?-1:1;return t*yPS}return e===e?e:0}var uRd=vPS;function bPS(e){var t=uRd(e),r=t%1;return t===t?r?t-r:t:0}var sRd=bPS;function gPS(e){return e}var c8n=gPS;var OPS="[object AsyncFunction]",mPS="[object Function]",PPS="[object GeneratorFunction]",jPS="[object Proxy]";function wPS(e){if(!bF(e))return!1;var t=sk(e);return t==mPS||t==PPS||t==OPS||t==jPS}var l8n=wPS;var SPS=l4["__core-js_shared__"],lAo=SPS;var cRd=function(){var e=/[^.]+$/.exec(lAo&&lAo.keys&&lAo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function DPS(e){return!!cRd&&cRd in e}var lRd=DPS;var EPS=Function.prototype,MPS=EPS.toString;function APS(e){if(e!=null){try{return MPS.call(e)}catch{}try{return e+""}catch{}}return""}var ygi=APS;var qPS=/[\\^$.*+?()[\]{}|]/g,TPS=/^\[object .+?Constructor\]$/,CPS=Function.prototype,BPS=Object.prototype,IPS=CPS.toString,zPS=BPS.hasOwnProperty,RPS=RegExp("^"+IPS.call(zPS).replace(qPS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xPS(e){if(!bF(e)||lRd(e))return!1;var t=l8n(e)?RPS:TPS;return t.test(ygi(e))}var fRd=xPS;function NPS(e,t){return e?.[t]}var dRd=NPS;function FPS(e,t){var r=dRd(e,t);return fRd(r)?r:void 0}var iae=FPS;var LPS=iae(l4,"WeakMap"),fAo=LPS;var pRd=Object.create,UPS=function(){function e(){}return function(t){if(!bF(t))return{};if(pRd)return pRd(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),_Rd=UPS;function VPS(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var hRd=VPS;function WPS(){}var $xe=WPS;function HPS(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}var yRd=HPS;var $PS=800,GPS=16,QPS=Date.now;function JPS(e){var t=0,r=0;return function(){var i=QPS(),n=GPS-(i-r);if(r=i,n>0){if(++t>=$PS)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var vRd=JPS;function KPS(e){return function(){return e}}var bRd=KPS;var YPS=function(){try{var e=iae(Object,"defineProperty");return e({},"",{}),e}catch{}}(),f8n=YPS;var XPS=f8n?function(e,t){return f8n(e,"toString",{configurable:!0,enumerable:!1,value:bRd(t),writable:!0})}:c8n,gRd=XPS;var ZPS=vRd(gRd),ORd=ZPS;function kPS(e,t,r,i){for(var n=e.length,a=r+(i?1:-1);i?a--:++a<n;)if(t(e[a],a,e))return a;return-1}var mRd=kPS;function ejS(e){return e!==e}var PRd=ejS;function tjS(e,t,r){for(var i=r-1,n=e.length;++i<n;)if(e[i]===t)return i;return-1}var jRd=tjS;function rjS(e,t,r){return t===t?jRd(e,t,r):mRd(e,PRd,r)}var wRd=rjS;function ijS(e,t){var r=e==null?0:e.length;return!!r&&wRd(e,t,0)>-1}var SRd=ijS;var njS=9007199254740991,ajS=/^(?:0|[1-9]\d*)$/;function ojS(e,t){var r=typeof e;return t=t??njS,!!t&&(r=="number"||r!="symbol"&&ajS.test(e))&&e>-1&&e%1==0&&e<t}var eBi=ojS;function ujS(e,t,r){t=="__proto__"&&f8n?f8n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var nae=ujS;function sjS(e,t){return e===t||e!==e&&t!==t}var HMe=sjS;var cjS=Object.prototype,ljS=cjS.hasOwnProperty;function fjS(e,t,r){var i=e[t];(!(ljS.call(e,t)&&HMe(i,r))||r===void 0&&!(t in e))&&nae(e,t,r)}var dAo=fjS;function djS(e,t,r,i){var n=!r;r||(r={});for(var a=-1,u=t.length;++a<u;){var l=t[a],d=i?i(r[l],e[l],l,r,e):void 0;d===void 0&&(d=e[l]),n?nae(r,l,d):dAo(r,l,d)}return r}var DRd=djS;var ERd=Math.max;function pjS(e,t,r){return t=ERd(t===void 0?e.length-1:t,0),function(){for(var i=arguments,n=-1,a=ERd(i.length-t,0),u=Array(a);++n<a;)u[n]=i[t+n];n=-1;for(var l=Array(t+1);++n<t;)l[n]=i[n];return l[t]=r(u),hRd(e,this,l)}}var MRd=pjS;function _jS(e,t){return ORd(MRd(e,t,c8n),e+"")}var pAo=_jS;var hjS=9007199254740991;function yjS(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hjS}var d8n=yjS;function vjS(e){return e!=null&&d8n(e.length)&&!l8n(e)}var aae=vjS;function bjS(e,t,r){if(!bF(r))return!1;var i=typeof t;return(i=="number"?aae(r)&&eBi(t,r.length):i=="string"&&t in r)?HMe(r[t],e):!1}var _Ao=bjS;function gjS(e){return pAo(function(t,r){var i=-1,n=r.length,a=n>1?r[n-1]:void 0,u=n>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(n--,a):void 0,u&&_Ao(r[0],r[1],u)&&(a=n<3?void 0:a,n=1),t=Object(t);++i<n;){var l=r[i];l&&e(t,l,i,a)}return t})}var hAo=gjS;var OjS=Object.prototype;function mjS(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||OjS;return e===r}var tBi=mjS;function PjS(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var ARd=PjS;var jjS="[object Arguments]";function wjS(e){return GW(e)&&sk(e)==jjS}var BWs=wjS;var qRd=Object.prototype,SjS=qRd.hasOwnProperty,DjS=qRd.propertyIsEnumerable,EjS=BWs(function(){return arguments}())?BWs:function(e){return GW(e)&&SjS.call(e,"callee")&&!DjS.call(e,"callee")},u$t=EjS;function MjS(){return!1}var TRd=MjS;var IRd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,CRd=IRd&&typeof module=="object"&&module&&!module.nodeType&&module,AjS=CRd&&CRd.exports===IRd,BRd=AjS?l4.Buffer:void 0,qjS=BRd?BRd.isBuffer:void 0,TjS=qjS||TRd,vgi=TjS;var CjS="[object Arguments]",BjS="[object Array]",IjS="[object Boolean]",zjS="[object Date]",RjS="[object Error]",xjS="[object Function]",NjS="[object Map]",FjS="[object Number]",LjS="[object Object]",UjS="[object RegExp]",VjS="[object Set]",WjS="[object String]",HjS="[object WeakMap]",$jS="[object ArrayBuffer]",GjS="[object DataView]",QjS="[object Float32Array]",JjS="[object Float64Array]",KjS="[object Int8Array]",YjS="[object Int16Array]",XjS="[object Int32Array]",ZjS="[object Uint8Array]",kjS="[object Uint8ClampedArray]",ewS="[object Uint16Array]",twS="[object Uint32Array]",Nz={};Nz[QjS]=Nz[JjS]=Nz[KjS]=Nz[YjS]=Nz[XjS]=Nz[ZjS]=Nz[kjS]=Nz[ewS]=Nz[twS]=!0;Nz[CjS]=Nz[BjS]=Nz[$jS]=Nz[IjS]=Nz[GjS]=Nz[zjS]=Nz[RjS]=Nz[xjS]=Nz[NjS]=Nz[FjS]=Nz[LjS]=Nz[UjS]=Nz[VjS]=Nz[WjS]=Nz[HjS]=!1;function rwS(e){return GW(e)&&d8n(e.length)&&!!Nz[sk(e)]}var zRd=rwS;function iwS(e){return function(t){return e(t)}}var yAo=iwS;var RRd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gza=RRd&&typeof module=="object"&&module&&!module.nodeType&&module,nwS=gza&&gza.exports===RRd,IWs=nwS&&cAo.process,awS=function(){try{var e=gza&&gza.require&&gza.require("util").types;return e||IWs&&IWs.binding&&IWs.binding("util")}catch{}}(),zWs=awS;var xRd=zWs&&zWs.isTypedArray,owS=xRd?yAo(xRd):zRd,rBi=owS;var uwS=Object.prototype,swS=uwS.hasOwnProperty;function cwS(e,t){var r=QC(e),i=!r&&u$t(e),n=!r&&!i&&vgi(e),a=!r&&!i&&!n&&rBi(e),u=r||i||n||a,l=u?ARd(e.length,String):[],d=l.length;for(var s in e)(t||swS.call(e,s))&&!(u&&(s=="length"||n&&(s=="offset"||s=="parent")||a&&(s=="buffer"||s=="byteLength"||s=="byteOffset")||eBi(s,d)))&&l.push(s);return l}var vAo=cwS;function lwS(e,t){return function(r){return e(t(r))}}var bAo=lwS;var fwS=bAo(Object.keys,Object),NRd=fwS;var dwS=Object.prototype,pwS=dwS.hasOwnProperty;function _wS(e){if(!tBi(e))return NRd(e);var t=[];for(var r in Object(e))pwS.call(e,r)&&r!="constructor"&&t.push(r);return t}var p8n=_wS;function hwS(e){return aae(e)?vAo(e):p8n(e)}var _8n=hwS;function ywS(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var FRd=ywS;var vwS=Object.prototype,bwS=vwS.hasOwnProperty;function gwS(e){if(!bF(e))return FRd(e);var t=tBi(e),r=[];for(var i in e)i=="constructor"&&(t||!bwS.call(e,i))||r.push(i);return r}var LRd=gwS;function OwS(e){return aae(e)?vAo(e,!0):LRd(e)}var h8n=OwS;var mwS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,PwS=/^\w*$/;function jwS(e,t){if(QC(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||wer(e)?!0:PwS.test(e)||!mwS.test(e)||t!=null&&e in Object(t)}var y8n=jwS;var wwS=iae(Object,"create"),bgi=wwS;function SwS(){this.__data__=bgi?bgi(null):{},this.size=0}var URd=SwS;function DwS(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VRd=DwS;var EwS="__lodash_hash_undefined__",MwS=Object.prototype,AwS=MwS.hasOwnProperty;function qwS(e){var t=this.__data__;if(bgi){var r=t[e];return r===EwS?void 0:r}return AwS.call(t,e)?t[e]:void 0}var WRd=qwS;var TwS=Object.prototype,CwS=TwS.hasOwnProperty;function BwS(e){var t=this.__data__;return bgi?t[e]!==void 0:CwS.call(t,e)}var HRd=BwS;var IwS="__lodash_hash_undefined__";function zwS(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=bgi&&t===void 0?IwS:t,this}var $Rd=zwS;function v8n(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}v8n.prototype.clear=URd;v8n.prototype.delete=VRd;v8n.prototype.get=WRd;v8n.prototype.has=HRd;v8n.prototype.set=$Rd;var RWs=v8n;function RwS(){this.__data__=[],this.size=0}var GRd=RwS;function xwS(e,t){for(var r=e.length;r--;)if(HMe(e[r][0],t))return r;return-1}var iBi=xwS;var NwS=Array.prototype,FwS=NwS.splice;function LwS(e){var t=this.__data__,r=iBi(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():FwS.call(t,r,1),--this.size,!0}var QRd=LwS;function UwS(e){var t=this.__data__,r=iBi(t,e);return r<0?void 0:t[r][1]}var JRd=UwS;function VwS(e){return iBi(this.__data__,e)>-1}var KRd=VwS;function WwS(e,t){var r=this.__data__,i=iBi(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var YRd=WwS;function b8n(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}b8n.prototype.clear=GRd;b8n.prototype.delete=QRd;b8n.prototype.get=JRd;b8n.prototype.has=KRd;b8n.prototype.set=YRd;var nBi=b8n;var HwS=iae(l4,"Map"),aBi=HwS;function $wS(){this.size=0,this.__data__={hash:new RWs,map:new(aBi||nBi),string:new RWs}}var XRd=$wS;function GwS(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ZRd=GwS;function QwS(e,t){var r=e.__data__;return ZRd(t)?r[typeof t=="string"?"string":"hash"]:r.map}var oBi=QwS;function JwS(e){var t=oBi(this,e).delete(e);return this.size-=t?1:0,t}var kRd=JwS;function KwS(e){return oBi(this,e).get(e)}var exd=KwS;function YwS(e){return oBi(this,e).has(e)}var txd=YwS;function XwS(e,t){var r=oBi(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var rxd=XwS;function g8n(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}g8n.prototype.clear=XRd;g8n.prototype.delete=kRd;g8n.prototype.get=exd;g8n.prototype.has=txd;g8n.prototype.set=rxd;var DZi=g8n;var ZwS="Expected a function";function xWs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ZwS);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],a=r.cache;if(a.has(n))return a.get(n);var u=e.apply(this,i);return r.cache=a.set(n,u)||a,u};return r.cache=new(xWs.Cache||DZi),r}xWs.Cache=DZi;var ixd=xWs;var kwS=500;function e1S(e){var t=ixd(e,function(i){return r.size===kwS&&r.clear(),i}),r=t.cache;return t}var nxd=e1S;var t1S=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r1S=/\\(\\)?/g,i1S=nxd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(t1S,function(r,i,n,a){t.push(n?a.replace(r1S,"$1"):i||r)}),t}),axd=i1S;function n1S(e){return e==null?"":tRd(e)}var Ser=n1S;function a1S(e,t){return QC(e)?e:y8n(e,t)?[e]:axd(Ser(e))}var uBi=a1S;var o1S=1/0;function u1S(e){if(typeof e=="string"||wer(e))return e;var t=e+"";return t=="0"&&1/e==-o1S?"-0":t}var Der=u1S;function s1S(e,t){t=uBi(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[Der(t[r++])];return r&&r==i?e:void 0}var O8n=s1S;function c1S(e,t,r){var i=e==null?void 0:O8n(e,t);return i===void 0?r:i}var oxd=c1S;function l1S(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}var m8n=l1S;var uxd=uk?uk.isConcatSpreadable:void 0;function f1S(e){return QC(e)||u$t(e)||!!(uxd&&e&&e[uxd])}var sxd=f1S;function cxd(e,t,r,i,n){var a=-1,u=e.length;for(r||(r=sxd),n||(n=[]);++a<u;){var l=e[a];t>0&&r(l)?t>1?cxd(l,t-1,r,i,n):m8n(n,l):i||(n[n.length]=l)}return n}var lxd=cxd;var d1S=bAo(Object.getPrototypeOf,Object),P8n=d1S;var p1S="[object Object]",_1S=Function.prototype,h1S=Object.prototype,fxd=_1S.toString,y1S=h1S.hasOwnProperty,v1S=fxd.call(Object);function b1S(e){if(!GW(e)||sk(e)!=p1S)return!1;var t=P8n(e);if(t===null)return!0;var r=y1S.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&fxd.call(r)==v1S}var Oza=b1S;function g1S(e,t,r){var i=-1,n=e.length;t<0&&(t=-t>n?0:n+t),r=r>n?n:r,r<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(n);++i<n;)a[i]=e[i+t];return a}var gAo=g1S;function O1S(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:gAo(e,t,r)}var dxd=O1S;var m1S="\\ud800-\\udfff",P1S="\\u0300-\\u036f",j1S="\\ufe20-\\ufe2f",w1S="\\u20d0-\\u20ff",S1S=P1S+j1S+w1S,D1S="\\ufe0e\\ufe0f",E1S="\\u200d",M1S=RegExp("["+E1S+m1S+S1S+D1S+"]");function A1S(e){return M1S.test(e)}var j8n=A1S;function q1S(e){return e.split("")}var pxd=q1S;var _xd="\\ud800-\\udfff",T1S="\\u0300-\\u036f",C1S="\\ufe20-\\ufe2f",B1S="\\u20d0-\\u20ff",I1S=T1S+C1S+B1S,z1S="\\ufe0e\\ufe0f",R1S="["+_xd+"]",NWs="["+I1S+"]",FWs="\\ud83c[\\udffb-\\udfff]",x1S="(?:"+NWs+"|"+FWs+")",hxd="[^"+_xd+"]",yxd="(?:\\ud83c[\\udde6-\\uddff]){2}",vxd="[\\ud800-\\udbff][\\udc00-\\udfff]",N1S="\\u200d",bxd=x1S+"?",gxd="["+z1S+"]?",F1S="(?:"+N1S+"(?:"+[hxd,yxd,vxd].join("|")+")"+gxd+bxd+")*",L1S=gxd+bxd+F1S,U1S="(?:"+[hxd+NWs+"?",NWs,yxd,vxd,R1S].join("|")+")",V1S=RegExp(FWs+"(?="+FWs+")|"+U1S+L1S,"g");function W1S(e){return e.match(V1S)||[]}var Oxd=W1S;function H1S(e){return j8n(e)?Oxd(e):pxd(e)}var mxd=H1S;function $1S(e){return function(t){t=Ser(t);var r=j8n(t)?mxd(t):void 0,i=r?r[0]:t.charAt(0),n=r?dxd(r,1).join(""):t.slice(1);return i[e]()+n}}var Pxd=$1S;var G1S=Pxd("toUpperCase"),qB=G1S;function Q1S(e){return qB(Ser(e).toLowerCase())}var mza=Q1S;function J1S(e,t,r,i){var n=-1,a=e==null?0:e.length;for(i&&a&&(r=e[++n]);++n<a;)r=t(r,e[n],n,e);return r}var jxd=J1S;function K1S(e){return function(t){return e?.[t]}}var wxd=K1S;var Y1S={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},X1S=wxd(Y1S),Sxd=X1S;var Z1S=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,k1S="\\u0300-\\u036f",eSS="\\ufe20-\\ufe2f",tSS="\\u20d0-\\u20ff",rSS=k1S+eSS+tSS,iSS="["+rSS+"]",nSS=RegExp(iSS,"g");function aSS(e){return e=Ser(e),e&&e.replace(Z1S,Sxd).replace(nSS,"")}var Dxd=aSS;var oSS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function uSS(e){return e.match(oSS)||[]}var Exd=uSS;var sSS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cSS(e){return sSS.test(e)}var Mxd=cSS;var Bxd="\\ud800-\\udfff",lSS="\\u0300-\\u036f",fSS="\\ufe20-\\ufe2f",dSS="\\u20d0-\\u20ff",pSS=lSS+fSS+dSS,Ixd="\\u2700-\\u27bf",zxd="a-z\\xdf-\\xf6\\xf8-\\xff",_SS="\\xac\\xb1\\xd7\\xf7",hSS="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ySS="\\u2000-\\u206f",vSS=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rxd="A-Z\\xc0-\\xd6\\xd8-\\xde",bSS="\\ufe0e\\ufe0f",xxd=_SS+hSS+ySS+vSS,Nxd="['\u2019]",Axd="["+xxd+"]",gSS="["+pSS+"]",Fxd="\\d+",OSS="["+Ixd+"]",Lxd="["+zxd+"]",Uxd="[^"+Bxd+xxd+Fxd+Ixd+zxd+Rxd+"]",mSS="\\ud83c[\\udffb-\\udfff]",PSS="(?:"+gSS+"|"+mSS+")",jSS="[^"+Bxd+"]",Vxd="(?:\\ud83c[\\udde6-\\uddff]){2}",Wxd="[\\ud800-\\udbff][\\udc00-\\udfff]",w8n="["+Rxd+"]",wSS="\\u200d",qxd="(?:"+Lxd+"|"+Uxd+")",SSS="(?:"+w8n+"|"+Uxd+")",Txd="(?:"+Nxd+"(?:d|ll|m|re|s|t|ve))?",Cxd="(?:"+Nxd+"(?:D|LL|M|RE|S|T|VE))?",Hxd=PSS+"?",$xd="["+bSS+"]?",DSS="(?:"+wSS+"(?:"+[jSS,Vxd,Wxd].join("|")+")"+$xd+Hxd+")*",ESS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MSS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ASS=$xd+Hxd+DSS,qSS="(?:"+[OSS,Vxd,Wxd].join("|")+")"+ASS,TSS=RegExp([w8n+"?"+Lxd+"+"+Txd+"(?="+[Axd,w8n,"$"].join("|")+")",SSS+"+"+Cxd+"(?="+[Axd,w8n+qxd,"$"].join("|")+")",w8n+"?"+qxd+"+"+Txd,w8n+"+"+Cxd,MSS,ESS,Fxd,qSS].join("|"),"g");function CSS(e){return e.match(TSS)||[]}var Gxd=CSS;function BSS(e,t,r){return e=Ser(e),t=r?void 0:t,t===void 0?Mxd(e)?Gxd(e):Exd(e):e.match(t)||[]}var EZi=BSS;var ISS="['\u2019]",zSS=RegExp(ISS,"g");function RSS(e){return function(t){return jxd(EZi(Dxd(t).replace(zSS,"")),e,"")}}var sBi=RSS;var xSS=sBi(function(e,t,r){return t=t.toLowerCase(),e+(r?mza(t):t)}),S_=xSS;var NSS=Math.ceil,FSS=Math.max;function LSS(e,t,r){(r?_Ao(e,t,r):t===void 0)?t=1:t=FSS(sRd(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var n=0,a=0,u=Array(NSS(i/t));n<i;)u[a++]=gAo(e,n,n+=t);return u}var Pza=LSS;function USS(){this.__data__=new nBi,this.size=0}var Qxd=USS;function VSS(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Jxd=VSS;function WSS(e){return this.__data__.get(e)}var Kxd=WSS;function HSS(e){return this.__data__.has(e)}var Yxd=HSS;var $SS=200;function GSS(e,t){var r=this.__data__;if(r instanceof nBi){var i=r.__data__;if(!aBi||i.length<$SS-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new DZi(i)}return r.set(e,t),this.size=r.size,this}var Xxd=GSS;function S8n(e){var t=this.__data__=new nBi(e);this.size=t.size}S8n.prototype.clear=Qxd;S8n.prototype.delete=Jxd;S8n.prototype.get=Kxd;S8n.prototype.has=Yxd;S8n.prototype.set=Xxd;var cBi=S8n;var tNd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zxd=tNd&&typeof module=="object"&&module&&!module.nodeType&&module,QSS=Zxd&&Zxd.exports===tNd,kxd=QSS?l4.Buffer:void 0,eNd=kxd?kxd.allocUnsafe:void 0;function JSS(e,t){if(t)return e.slice();var r=e.length,i=eNd?eNd(r):new e.constructor(r);return e.copy(i),i}var rNd=JSS;function KSS(e,t){for(var r=-1,i=e==null?0:e.length,n=0,a=[];++r<i;){var u=e[r];t(u,r,e)&&(a[n++]=u)}return a}var iNd=KSS;function YSS(){return[]}var OAo=YSS;var XSS=Object.prototype,ZSS=XSS.propertyIsEnumerable,nNd=Object.getOwnPropertySymbols,kSS=nNd?function(e){return e==null?[]:(e=Object(e),iNd(nNd(e),function(t){return ZSS.call(e,t)}))}:OAo,mAo=kSS;var eDS=Object.getOwnPropertySymbols,tDS=eDS?function(e){for(var t=[];e;)m8n(t,mAo(e)),e=P8n(e);return t}:OAo,aNd=tDS;function rDS(e,t,r){var i=t(e);return QC(e)?i:m8n(i,r(e))}var PAo=rDS;function iDS(e){return PAo(e,_8n,mAo)}var LWs=iDS;function nDS(e){return PAo(e,h8n,aNd)}var oNd=nDS;var aDS=iae(l4,"DataView"),jAo=aDS;var oDS=iae(l4,"Promise"),wAo=oDS;var uDS=iae(l4,"Set"),SAo=uDS;var uNd="[object Map]",sDS="[object Object]",sNd="[object Promise]",cNd="[object Set]",lNd="[object WeakMap]",fNd="[object DataView]",cDS=ygi(jAo),lDS=ygi(aBi),fDS=ygi(wAo),dDS=ygi(SAo),pDS=ygi(fAo),MZi=sk;(jAo&&MZi(new jAo(new ArrayBuffer(1)))!=fNd||aBi&&MZi(new aBi)!=uNd||wAo&&MZi(wAo.resolve())!=sNd||SAo&&MZi(new SAo)!=cNd||fAo&&MZi(new fAo)!=lNd)&&(MZi=function(e){var t=sk(e),r=t==sDS?e.constructor:void 0,i=r?ygi(r):"";if(i)switch(i){case cDS:return fNd;case lDS:return uNd;case fDS:return sNd;case dDS:return cNd;case pDS:return lNd}return t});var AZi=MZi;var _DS=l4.Uint8Array,D8n=_DS;function hDS(e){var t=new e.constructor(e.byteLength);return new D8n(t).set(new D8n(e)),t}var dNd=hDS;function yDS(e,t){var r=t?dNd(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var pNd=yDS;function vDS(e){return typeof e.constructor=="function"&&!tBi(e)?_Rd(P8n(e)):{}}var _Nd=vDS;function bDS(e){for(var t=-1,r=e==null?0:e.length,i=0,n=[];++t<r;){var a=e[t];a&&(n[i++]=a)}return n}var Gxe=bDS;var gDS="__lodash_hash_undefined__";function ODS(e){return this.__data__.set(e,gDS),this}var hNd=ODS;function mDS(e){return this.__data__.has(e)}var yNd=mDS;function DAo(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new DZi;++t<r;)this.add(e[t])}DAo.prototype.add=DAo.prototype.push=hNd;DAo.prototype.has=yNd;var EAo=DAo;function PDS(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var vNd=PDS;function jDS(e,t){return e.has(t)}var MAo=jDS;var wDS=1,SDS=2;function DDS(e,t,r,i,n,a){var u=r&wDS,l=e.length,d=t.length;if(l!=d&&!(u&&d>l))return!1;var s=a.get(e),o=a.get(t);if(s&&o)return s==t&&o==e;var c=-1,b=!0,g=r&SDS?new EAo:void 0;for(a.set(e,t),a.set(t,e);++c<l;){var O=e[c],m=t[c];if(i)var w=u?i(m,O,c,t,e,a):i(O,m,c,e,t,a);if(w!==void 0){if(w)continue;b=!1;break}if(g){if(!vNd(t,function(E,q){if(!MAo(g,q)&&(O===E||n(O,E,r,i,a)))return g.push(q)})){b=!1;break}}else if(!(O===m||n(O,m,r,i,a))){b=!1;break}}return a.delete(e),a.delete(t),b}var AAo=DDS;function EDS(e){var t=-1,r=Array(e.size);return e.forEach(function(i,n){r[++t]=[n,i]}),r}var bNd=EDS;function MDS(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var gNd=MDS;var ADS=1,qDS=2,TDS="[object Boolean]",CDS="[object Date]",BDS="[object Error]",IDS="[object Map]",zDS="[object Number]",RDS="[object RegExp]",xDS="[object Set]",NDS="[object String]",FDS="[object Symbol]",LDS="[object ArrayBuffer]",UDS="[object DataView]",ONd=uk?uk.prototype:void 0,UWs=ONd?ONd.valueOf:void 0;function VDS(e,t,r,i,n,a,u){switch(r){case UDS:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case LDS:return!(e.byteLength!=t.byteLength||!a(new D8n(e),new D8n(t)));case TDS:case CDS:case zDS:return HMe(+e,+t);case BDS:return e.name==t.name&&e.message==t.message;case RDS:case NDS:return e==t+"";case IDS:var l=bNd;case xDS:var d=i&ADS;if(l||(l=gNd),e.size!=t.size&&!d)return!1;var s=u.get(e);if(s)return s==t;i|=qDS,u.set(e,t);var o=AAo(l(e),l(t),i,n,a,u);return u.delete(e),o;case FDS:if(UWs)return UWs.call(e)==UWs.call(t)}return!1}var mNd=VDS;var WDS=1,HDS=Object.prototype,$DS=HDS.hasOwnProperty;function GDS(e,t,r,i,n,a){var u=r&WDS,l=LWs(e),d=l.length,s=LWs(t),o=s.length;if(d!=o&&!u)return!1;for(var c=d;c--;){var b=l[c];if(!(u?b in t:$DS.call(t,b)))return!1}var g=a.get(e),O=a.get(t);if(g&&O)return g==t&&O==e;var m=!0;a.set(e,t),a.set(t,e);for(var w=u;++c<d;){b=l[c];var E=e[b],q=t[b];if(i)var M=u?i(q,E,b,t,e,a):i(E,q,b,e,t,a);if(!(M===void 0?E===q||n(E,q,r,i,a):M)){m=!1;break}w||(w=b=="constructor")}if(m&&!w){var D=e.constructor,C=t.constructor;D!=C&&"constructor"in e&&"constructor"in t&&!(typeof D=="function"&&D instanceof D&&typeof C=="function"&&C instanceof C)&&(m=!1)}return a.delete(e),a.delete(t),m}var PNd=GDS;var QDS=1,jNd="[object Arguments]",wNd="[object Array]",qAo="[object Object]",JDS=Object.prototype,SNd=JDS.hasOwnProperty;function KDS(e,t,r,i,n,a){var u=QC(e),l=QC(t),d=u?wNd:AZi(e),s=l?wNd:AZi(t);d=d==jNd?qAo:d,s=s==jNd?qAo:s;var o=d==qAo,c=s==qAo,b=d==s;if(b&&vgi(e)){if(!vgi(t))return!1;u=!0,o=!1}if(b&&!o)return a||(a=new cBi),u||rBi(e)?AAo(e,t,r,i,n,a):mNd(e,t,d,r,i,n,a);if(!(r&QDS)){var g=o&&SNd.call(e,"__wrapped__"),O=c&&SNd.call(t,"__wrapped__");if(g||O){var m=g?e.value():e,w=O?t.value():t;return a||(a=new cBi),n(m,w,r,i,a)}}return b?(a||(a=new cBi),PNd(e,t,r,i,n,a)):!1}var DNd=KDS;function ENd(e,t,r,i,n){return e===t?!0:e==null||t==null||!GW(e)&&!GW(t)?e!==e&&t!==t:DNd(e,t,r,i,ENd,n)}var lBi=ENd;var YDS=1,XDS=2;function ZDS(e,t,r,i){var n=r.length,a=n,u=!i;if(e==null)return!a;for(e=Object(e);n--;){var l=r[n];if(u&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++n<a;){l=r[n];var d=l[0],s=e[d],o=l[1];if(u&&l[2]){if(s===void 0&&!(d in e))return!1}else{var c=new cBi;if(i)var b=i(s,o,d,e,t,c);if(!(b===void 0?lBi(o,s,YDS|XDS,i,c):b))return!1}}return!0}var MNd=ZDS;function kDS(e){return e===e&&!bF(e)}var TAo=kDS;function eES(e){for(var t=_8n(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,TAo(n)]}return t}var ANd=eES;function tES(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var CAo=tES;function rES(e){var t=ANd(e);return t.length==1&&t[0][2]?CAo(t[0][0],t[0][1]):function(r){return r===e||MNd(r,e,t)}}var qNd=rES;function iES(e,t){return e!=null&&t in Object(e)}var TNd=iES;function nES(e,t,r){t=uBi(t,e);for(var i=-1,n=t.length,a=!1;++i<n;){var u=Der(t[i]);if(!(a=e!=null&&r(e,u)))break;e=e[u]}return a||++i!=n?a:(n=e==null?0:e.length,!!n&&d8n(n)&&eBi(u,n)&&(QC(e)||u$t(e)))}var CNd=nES;function aES(e,t){return e!=null&&CNd(e,t,TNd)}var BNd=aES;var oES=1,uES=2;function sES(e,t){return y8n(e)&&TAo(t)?CAo(Der(e),t):function(r){var i=oxd(r,e);return i===void 0&&i===t?BNd(r,e):lBi(t,i,oES|uES)}}var INd=sES;function cES(e){return function(t){return t?.[e]}}var BAo=cES;function lES(e){return function(t){return O8n(t,e)}}var zNd=lES;function fES(e){return y8n(e)?BAo(Der(e)):zNd(e)}var RNd=fES;function dES(e){return typeof e=="function"?e:e==null?c8n:typeof e=="object"?QC(e)?INd(e[0],e[1]):qNd(e):RNd(e)}var Qxe=dES;function pES(e,t,r,i){for(var n=-1,a=e==null?0:e.length;++n<a;){var u=e[n];t(i,u,r(u),e)}return i}var xNd=pES;function _ES(e){return function(t,r,i){for(var n=-1,a=Object(t),u=i(t),l=u.length;l--;){var d=u[e?l:++n];if(r(a[d],d,a)===!1)break}return t}}var NNd=_ES;var hES=NNd(),IAo=hES;function yES(e,t){return e&&IAo(e,t,_8n)}var E8n=yES;function vES(e,t){return function(r,i){if(r==null)return r;if(!aae(r))return e(r,i);for(var n=r.length,a=t?n:-1,u=Object(r);(t?a--:++a<n)&&i(u[a],a,u)!==!1;);return r}}var FNd=vES;var bES=FNd(E8n),LNd=bES;function gES(e,t,r,i){return LNd(e,function(n,a,u){t(i,n,r(n),u)}),i}var UNd=gES;function OES(e,t){return function(r,i){var n=QC(r)?xNd:UNd,a=t?t():{};return n(r,e,Qxe(i,2),a)}}var zAo=OES;function mES(e,t,r){(r!==void 0&&!HMe(e[t],r)||r===void 0&&!(t in e))&&nae(e,t,r)}var jza=mES;function PES(e){return GW(e)&&aae(e)}var wza=PES;function jES(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Sza=jES;function wES(e){return DRd(e,h8n(e))}var VNd=wES;function SES(e,t,r,i,n,a,u){var l=Sza(e,r),d=Sza(t,r),s=u.get(d);if(s){jza(e,r,s);return}var o=a?a(l,d,r+"",e,t,u):void 0,c=o===void 0;if(c){var b=QC(d),g=!b&&vgi(d),O=!b&&!g&&rBi(d);o=d,b||g||O?QC(l)?o=l:wza(l)?o=yRd(l):g?(c=!1,o=rNd(d,!0)):O?(c=!1,o=pNd(d,!0)):o=[]:Oza(d)||u$t(d)?(o=l,u$t(l)?o=VNd(l):(!bF(l)||l8n(l))&&(o=_Nd(d))):c=!1}c&&(u.set(d,o),n(o,d,i,a,u),u.delete(d)),jza(e,r,o)}var WNd=SES;function HNd(e,t,r,i,n){e!==t&&IAo(t,function(a,u){if(n||(n=new cBi),bF(a))WNd(e,t,u,r,HNd,i,n);else{var l=i?i(Sza(e,u),a,u+"",e,t,n):void 0;l===void 0&&(l=a),jza(e,u,l)}},h8n)}var RAo=HNd;var DES=hAo(function(e,t,r,i){RAo(e,t,r,i)}),M8n=DES;function EES(e,t,r){for(var i=-1,n=e==null?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}var $Nd=EES;var MES=200;function AES(e,t,r,i){var n=-1,a=SRd,u=!0,l=e.length,d=[],s=t.length;if(!l)return d;r&&(t=s8n(t,yAo(r))),i?(a=$Nd,u=!1):t.length>=MES&&(a=MAo,u=!1,t=new EAo(t));e:for(;++n<l;){var o=e[n],c=r==null?o:r(o);if(o=i||o!==0?o:0,u&&c===c){for(var b=s;b--;)if(t[b]===c)continue e;d.push(o)}else a(t,c,i)||d.push(o)}return d}var GNd=AES;var qES=pAo(function(e,t){return wza(e)?GNd(e,lxd(t,1,wza,!0)):[]}),xAo=qES;function TES(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var VWs=TES;var CES=Object.prototype,BES=CES.hasOwnProperty,IES=zAo(function(e,t,r){BES.call(e,r)?e[r].push(t):nae(e,r,[t])}),WWs=IES;function zES(e,t){return e>t}var QNd=zES;var RES="[object String]";function xES(e){return typeof e=="string"||!QC(e)&&GW(e)&&sk(e)==RES}var JNd=xES;var NES="[object Map]",FES="[object Set]",LES=Object.prototype,UES=LES.hasOwnProperty;function VES(e){if(e==null)return!0;if(aae(e)&&(QC(e)||typeof e=="string"||typeof e.splice=="function"||vgi(e)||rBi(e)||u$t(e)))return!e.length;var t=AZi(e);if(t==NES||t==FES)return!e.size;if(tBi(e))return!p8n(e).length;for(var r in e)if(UES.call(e,r))return!1;return!0}var HWs=VES;function WES(e,t){return lBi(e,t)}var g8=WES;function HES(e,t,r){r=typeof r=="function"?r:void 0;var i=r?r(e,t):void 0;return i===void 0?lBi(e,t,void 0,r):!!i}var Eer=HES;function $ES(e){return e===null}var $Ws=$ES;var GES=sBi(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),_T=GES;var QES=zAo(function(e,t,r){nae(e,r,t)}),GWs=QES;function JES(e,t){var r={};return t=Qxe(t,3),E8n(e,function(i,n,a){nae(r,t(i,n,a),i)}),r}var Dza=JES;function KES(e,t){var r={};return t=Qxe(t,3),E8n(e,function(i,n,a){nae(r,n,t(i,n,a))}),r}var _d=KES;function YES(e,t,r){for(var i=-1,n=e.length;++i<n;){var a=e[i],u=t(a);if(u!=null&&(l===void 0?u===u&&!wer(u):r(u,l)))var l=u,d=a}return d}var KNd=YES;function XES(e,t){return e&&e.length?KNd(e,Qxe(t,2),QNd):void 0}var QWs=XES;var ZES=hAo(function(e,t,r){RAo(e,t,r)}),JWs=ZES;var kES="Expected a function";function eMS(e){if(typeof e!="function")throw new TypeError(kES);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var YNd=eMS;function tMS(e,t,r,i){if(!bF(e))return e;t=uBi(t,e);for(var n=-1,a=t.length,u=a-1,l=e;l!=null&&++n<a;){var d=Der(t[n]),s=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(n!=u){var o=l[d];s=i?i(o,d,l):void 0,s===void 0&&(s=bF(o)?o:eBi(t[n+1])?[]:{})}dAo(l,d,s),l=l[d]}return e}var XNd=tMS;function rMS(e,t,r){for(var i=-1,n=t.length,a={};++i<n;){var u=t[i],l=O8n(e,u);r(l,u)&&XNd(a,uBi(u,e),l)}return a}var ZNd=rMS;function iMS(e,t){if(e==null)return{};var r=s8n(oNd(e),function(i){return[i]});return t=Qxe(t),ZNd(e,r,function(i,n){return t(i,n[0])})}var qZi=iMS;function nMS(e,t){return qZi(e,YNd(Qxe(t)))}var KWs=nMS;var aMS=BAo("length"),kNd=aMS;var tFd="\\ud800-\\udfff",oMS="\\u0300-\\u036f",uMS="\\ufe20-\\ufe2f",sMS="\\u20d0-\\u20ff",cMS=oMS+uMS+sMS,lMS="\\ufe0e\\ufe0f",fMS="["+tFd+"]",YWs="["+cMS+"]",XWs="\\ud83c[\\udffb-\\udfff]",dMS="(?:"+YWs+"|"+XWs+")",rFd="[^"+tFd+"]",iFd="(?:\\ud83c[\\udde6-\\uddff]){2}",nFd="[\\ud800-\\udbff][\\udc00-\\udfff]",pMS="\\u200d",aFd=dMS+"?",oFd="["+lMS+"]?",_MS="(?:"+pMS+"(?:"+[rFd,iFd,nFd].join("|")+")"+oFd+aFd+")*",hMS=oFd+aFd+_MS,yMS="(?:"+[rFd+YWs+"?",YWs,iFd,nFd,fMS].join("|")+")",eFd=RegExp(XWs+"(?="+XWs+")|"+yMS+hMS,"g");function vMS(e){for(var t=eFd.lastIndex=0;eFd.test(e);)++t;return t}var uFd=vMS;function bMS(e){return j8n(e)?uFd(e):kNd(e)}var sFd=bMS;var gMS="[object Map]",OMS="[object Set]";function mMS(e){if(e==null)return 0;if(aae(e))return JNd(e)?sFd(e):e.length;var t=AZi(e);return t==gMS||t==OMS?e.size:p8n(e).length}var yq=mMS;var PMS=sBi(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),TZi=PMS;var jMS=sBi(function(e,t,r){return e+(r?" ":"")+qB(t)}),CZi=jMS;function kWs({data:e,overrides:t,allowNullKeys:r}){let i=M8n(e,M8n,t,(a,u)=>Array.isArray(a)&&Array.isArray(u)?u.every(l=>typeof l=="object")&&a.every(l=>typeof l=="object")?void 0:[...u]:void 0);return ZWs(i,$Ws,{ancestorKeys:r??[],allowOmissionCursor:!1})}var ZWs=(e,t,r)=>{function i(n){if(Array.isArray(n))return n.map(a=>ZWs(a,t,r));if(Oza(n)){let a={};for(let[u,l]of Object.entries(n))a[u]=ZWs(l,t,r!=null&&(r.allowOmissionCursor||r.ancestorKeys.includes(u))?{...r,allowOmissionCursor:!0}:r);return r==null||!r?.allowOmissionCursor?KWs(a,t):a}return n}return i(e)};function $o(){}function s$t(e){return Object.keys(e)}function a1(e,t){for(let r of s$t(t))t[r](e[r])}async function Mer(e,t){for(let r of s$t(t))await t[r](e[r])}function I3(e){return Object.entries(e)}function vw(e){if(!wMS(e)||toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)==null)return!0;let t=e;for(;Object.getPrototypeOf(t)!=null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function wMS(e){return typeof e=="object"&&e!=null}function cFd(e,t){e=Object(e);let r={};return Object.keys(e).forEach(i=>{r[i]=t(e[i],i,e)}),r}function eHs(e){let[t,r]=e.split(" ");if(!t||!["POST","GET","PUT","PATCH","DELETE"].includes(t))return{type:"failure",message:`${e} contains invalid method ${t}`};if(!r)return{type:"failure",message:`${e} contains no path ${r}`};let i=new Set,n=/{([^}]+)}/g,a;for(;(a=n.exec(r))!=null;){let u=a[1];u!=null&&i.add(u)}return{type:"success",method:t,path:r,pathParameters:i}}function NAo({value:e,suffix:t}){return e.endsWith(t)?e.substring(0,e.length-t.length):e}var SMS=/\$\{(\w+)\}/g;function fBi(e,t,r={}){return typeof e=="string"?e.replace(SMS,(a,u)=>{if(r.substituteAsEmpty)return"";let l=process.env[u];return l==null&&t.onError(`Environment variable ${u} is not defined.`),l??""}):vw(e)?cFd(e,n=>fBi(n,t,r)):e}function nJ(e){return e?.replace(/^\/+/,"")}var hFd=si(A8n(),1);function LAo(e){return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.replace(/_/g," "),e=e.replace(/-/g," "),(0,hFd.default)(e,{special:zMS}).replace(/V\s(\d)/g,"V$1")}var zMS=["PII","PHI","PCI","GDPR","CCPA","HIPAA","COPPA","FERPA","GLBA","SOX","FISMA","NIST","CIS","ISO","IEC","ITAR","EAR","CMMC","CUI","CDI","FTC","FCC","SEC","FINRA","XSS","CSRF","SSRF","XSRF","TLS","SSL","SSH","API","OAuth","OAuth1","OAuth1.0","OAuth2","OAuth2.0","SAML","OpenID","OpenID Connect","CAPTCHA","reCAPTCHA","2FA","MFA","OTP","TOTP","HOTP","U2F","FIDO","FIDO2","PKI","HMAC","AES","RSA","SHA","MD5","BCrypt","PBKDF2","Argon2","SCrypt","JWT","JWE","JWS","JWK","JWA","JOSE","SKU","SKUs","UPC","EAN","ISBN","ASIN","MPN","MSRP","MAP","RRP","MSRP","AM","PM","UTC","GMT","PST","PDT","EST","EDT","CST","CDT","MST","MDT","USA","UK","EU","UAE","APAC","EMEA","LATAM","ANZ","SEA","MEA","MENA","NATO","NA","SA","CA","EU","AU","NZ","JP","KR","CN","HK","TW","SG","MY","TH","ID","PH","VN","IN","PK","BD","LK","NP","MM","KH","LA","MM","BT","MV","USD","EUR","GBP","JPY","CNY","RUB","INR","AUD","CAD","CHF","SGD","MYR","THB","IDR","KRW","PHP","VND","HKD","TWD","MXN","BRL","ARS","CLP","COP","PEN","ZAR","NGN","EGP","AED","SAR","ILS","TRY","SEK","NOK","DKK","ISK","HUF","PLN","CZK","RON","BGN","API","APIs","SDK","SDKs","AI","OCR","REST","SOAP","JSON","XML","HTTP","HTTPS","URI","URL","CRUD","RESTful","KYB","KYC","AML","HTML","CSS","JS","SQL","DB","UI","UX","SaaS","PaaS","IaaS","IP","TCP","UDP","DNS","FTP","SMTP","IMAP","POP3","CSV","MVC","MVP","MVVM","DOM","SPA","SSR","CSR","DDoS","CDN","IoT","ML","DL","NLP","CLI","GUI","BI","ETL","RDBMS","NoSQL","IDE","CMS","CCPA","POSIX","ABI","API","AST","COBOL","DDL","DML","NN","CNN","RNN","LSTM","GRU","ANN","GAN","RL","DL","ML","NLP","NLG","NLU","BERT","GPT","SVM","PCA","AI","CV","TF","TTS","ASR","HMM","DNN","MLP","RBM","CRF","PDF","PDFs","RTF","TXT","XLS","XLSX","PPT","JPG","JPEG","PNG","GIF","GIFs","SVG","TIFF","BMP","ICO","PSD","WebP","AVIF","HEIF","HEIC","EPS","MP3","WAV","AIFF","FLAC","WMA","AAC","OGG","AVI","WMV","MOV","M4V","MP4","MPG","MPEG","FLV","SWF","MKV","WebM","GCP","AWS","VM","VPC","S3","EC2","DynamoDB","CosmosDB","BigQuery","CI/CD","SOC1","SOC2","SOC3","PCI DSS","WAF","IAM","SDN","MPLS","BGP","Vue.js","Node.js",".NET"];var J7d=si(Q7d(),1);function p$t(e,t){let i=new J7d.default({allErrors:!0,allowUnionTypes:!0}).compile(t);if(i(e))return{success:!0,data:e};if(i.errors?.[0]!=null)try{let a=i.errors[0];for(let u of i.errors??[]){let l=u.keyword==="oneOf"||u.keyword==="anyOf",d=a.keyword==="oneOf"||a.keyword==="anyOf";(!l&&d||l===d&&u.instancePath.length>a.instancePath.length)&&(a=u)}if(a.keyword==="additionalProperties"){let u=a.params.additionalProperty;return{success:!1,error:{...a,message:`Encountered unexpected property ${u}`},allErrors:i.errors??[]}}else if(a.keyword==="required"){let u=a.params.missingProperty;return{success:!1,error:{...a,message:`Missing required property '${u}'`},allErrors:i.errors??[]}}else{if(a.keyword==="enum")return{success:!1,error:{...a,message:`Invalid value: must be one of [${a.params.allowedValues.join(", ")}]`},allErrors:i.errors??[]};if(a.keyword==="format")return{success:!1,error:{...a,message:`Invalid format: must be a valid ${a.params.format}`},allErrors:i.errors??[]};if(a.keyword==="pattern")return{success:!1,error:{...a,message:`Invalid format: must match pattern ${a.params.pattern}`},allErrors:i.errors??[]};if(a.keyword==="maximum")return{success:!1,error:{...a,message:`Value must be less than or equal to ${a.params.limit}`},allErrors:i.errors??[]};if(a.keyword==="minimum")return{success:!1,error:{...a,message:`Value must be greater than or equal to ${a.params.limit}`},allErrors:i.errors??[]};if(a.keyword==="maxLength")return{success:!1,error:{...a,message:`Must be no longer than ${a.params.limit} characters`},allErrors:i.errors??[]};if(a.keyword==="minLength")return{success:!1,error:{...a,message:`Must be at least ${a.params.limit} characters`},allErrors:i.errors??[]}}return{success:!1,error:{...a,message:"Failed to parse because JSON schema validation failed"},allErrors:i.errors??[]}}catch{return{success:!1,error:{message:"Failed to parse because JSON schema validation failed",...i.errors[0]},allErrors:i.errors??[]}}else return{success:!1,error:void 0,allErrors:[]}}function $8n(e,t="type"){return{_visit:r=>{let i=r[e[t]];return i!=null?i(e):(r._other==null&&So(e),r._other(e))}}}var KW="fern",rL="definition",mqo="openapi",K7d="changelog",Y7d="asyncapi",R3="api.yml",WZi="__package__",fS=`${WZi}.yml`,Pqo="dependencies.yml",f4="generators.yml",X7d="dependencies.yml",_$t="docs.yml",lae="fern.config.json",N$s="api",jqo=".fernignore";var Z7d="snippet-templates.json";var wqo="default-group";var gBi="apis",tRa="local";var Su={};Po(Su,{BRAND:()=>CIS,DIRTY:()=>HZi,EMPTY_PATH:()=>lIS,INVALID:()=>L0,NEVER:()=>yzS,OK:()=>sJ,ParseStatus:()=>YW,Schema:()=>bw,ZodAny:()=>PBi,ZodArray:()=>Egi,ZodBigInt:()=>GZi,ZodBoolean:()=>QZi,ZodBranded:()=>iRa,ZodCatch:()=>nki,ZodDate:()=>JZi,ZodDefault:()=>iki,ZodDiscriminatedUnion:()=>Eqo,ZodEffects:()=>eNe,ZodEnum:()=>tki,ZodError:()=>fae,ZodFirstPartyTypeKind:()=>cg,ZodFunction:()=>Aqo,ZodIntersection:()=>ZZi,ZodIssueCode:()=>Bl,ZodLazy:()=>kZi,ZodLiteral:()=>eki,ZodMap:()=>X8n,ZodNaN:()=>k8n,ZodNativeEnum:()=>rki,ZodNever:()=>h$t,ZodNull:()=>YZi,ZodNullable:()=>zer,ZodNumber:()=>$Zi,ZodObject:()=>dae,ZodOptional:()=>Zxe,ZodParsedType:()=>N_,ZodPipeline:()=>nRa,ZodPromise:()=>jBi,ZodReadonly:()=>aki,ZodRecord:()=>Mqo,ZodSchema:()=>bw,ZodSet:()=>Z8n,ZodString:()=>mBi,ZodSymbol:()=>K8n,ZodTransformer:()=>eNe,ZodTuple:()=>Ier,ZodType:()=>bw,ZodUndefined:()=>KZi,ZodUnion:()=>XZi,ZodUnknown:()=>Dgi,ZodVoid:()=>Y8n,addIssueToContext:()=>zp,any:()=>UIS,array:()=>$IS,bigint:()=>RIS,boolean:()=>c6d,coerce:()=>hzS,custom:()=>o6d,date:()=>xIS,datetimeRegex:()=>n6d,defaultErrorMap:()=>wgi,discriminatedUnion:()=>KIS,effect:()=>uzS,enum:()=>nzS,function:()=>tzS,getErrorMap:()=>G8n,getParsedType:()=>Ber,instanceof:()=>IIS,intersection:()=>YIS,isAborted:()=>Sqo,isAsync:()=>Q8n,isDirty:()=>Dqo,isValid:()=>OBi,late:()=>BIS,lazy:()=>rzS,literal:()=>izS,makeIssue:()=>rRa,map:()=>kIS,nan:()=>zIS,nativeEnum:()=>azS,never:()=>WIS,null:()=>LIS,nullable:()=>czS,number:()=>s6d,object:()=>GIS,objectUtil:()=>F$s,oboolean:()=>_zS,onumber:()=>pzS,optional:()=>szS,ostring:()=>dzS,pipeline:()=>fzS,preprocess:()=>lzS,promise:()=>ozS,quotelessJson:()=>uIS,record:()=>ZIS,set:()=>ezS,setErrorMap:()=>cIS,strictObject:()=>QIS,string:()=>u6d,symbol:()=>NIS,transformer:()=>uzS,tuple:()=>XIS,undefined:()=>FIS,union:()=>JIS,unknown:()=>VIS,util:()=>aD,void:()=>HIS});var aD;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let a={};for(let u of n)a[u]=u;return a},e.getValidEnumValues=n=>{let a=e.objectKeys(n).filter(l=>typeof n[n[l]]!="number"),u={};for(let l of a)u[l]=n[l];return e.objectValues(u)},e.objectValues=n=>e.objectKeys(n).map(function(a){return n[a]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&a.push(u);return a},e.find=(n,a)=>{for(let u of n)if(a(u))return u},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,a=" | "){return n.map(u=>typeof u=="string"?`'${u}'`:u).join(a)}e.joinValues=i,e.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(aD||(aD={}));var F$s;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(F$s||(F$s={}));var N_=aD.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ber=e=>{switch(typeof e){case"undefined":return N_.undefined;case"string":return N_.string;case"number":return Number.isNaN(e)?N_.nan:N_.number;case"boolean":return N_.boolean;case"function":return N_.function;case"bigint":return N_.bigint;case"symbol":return N_.symbol;case"object":return Array.isArray(e)?N_.array:e===null?N_.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?N_.promise:typeof Map<"u"&&e instanceof Map?N_.map:typeof Set<"u"&&e instanceof Set?N_.set:typeof Date<"u"&&e instanceof Date?N_.date:N_.object;default:return N_.unknown}};var Bl=aD.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"]),uIS=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),fae=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},i={_errors:[]},n=a=>{for(let u of a.issues)if(u.code==="invalid_union")u.unionErrors.map(n);else if(u.code==="invalid_return_type")n(u.returnTypeError);else if(u.code==="invalid_arguments")n(u.argumentsError);else if(u.path.length===0)i._errors.push(r(u));else{let l=i,d=0;for(;d<u.path.length;){let s=u.path[d];d===u.path.length-1?(l[s]=l[s]||{_errors:[]},l[s]._errors.push(r(u))):l[s]=l[s]||{_errors:[]},l=l[s],d++}}};return n(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,aD.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};fae.create=e=>new fae(e);var sIS=(e,t)=>{let r;switch(e.code){case Bl.invalid_type:e.received===N_.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Bl.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,aD.jsonStringifyReplacer)}`;break;case Bl.unrecognized_keys:r=`Unrecognized key(s) in object: ${aD.joinValues(e.keys,", ")}`;break;case Bl.invalid_union:r="Invalid input";break;case Bl.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${aD.joinValues(e.options)}`;break;case Bl.invalid_enum_value:r=`Invalid enum value. Expected ${aD.joinValues(e.options)}, received '${e.received}'`;break;case Bl.invalid_arguments:r="Invalid function arguments";break;case Bl.invalid_return_type:r="Invalid function return type";break;case Bl.invalid_date:r="Invalid date";break;case Bl.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:aD.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Bl.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Bl.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Bl.custom:r="Invalid input";break;case Bl.invalid_intersection_types:r="Intersection results could not be merged";break;case Bl.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Bl.not_finite:r="Number must be finite";break;default:r=t.defaultError,aD.assertNever(e)}return{message:r}},wgi=sIS;var k7d=wgi;function cIS(e){k7d=e}function G8n(){return k7d}var rRa=e=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,a=[...r,...n.path||[]],u={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let l="",d=i.filter(s=>!!s).slice().reverse();for(let s of d)l=s(u,{data:t,defaultError:l}).message;return{...n,path:a,message:l}},lIS=[];function zp(e,t){let r=G8n(),i=rRa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wgi?void 0:wgi].filter(n=>!!n)});e.common.issues.push(i)}var YW=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let i=[];for(let n of r){if(n.status==="aborted")return L0;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,r){let i=[];for(let n of r){let a=await n.key,u=await n.value;i.push({key:a,value:u})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,r){let i={};for(let n of r){let{key:a,value:u}=n;if(a.status==="aborted"||u.status==="aborted")return L0;a.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof u.value<"u"||n.alwaysSet)&&(i[a.value]=u.value)}return{status:t.value,value:i}}},L0=Object.freeze({status:"aborted"}),HZi=e=>({status:"dirty",value:e}),sJ=e=>({status:"valid",value:e}),Sqo=e=>e.status==="aborted",Dqo=e=>e.status==="dirty",OBi=e=>e.status==="valid",Q8n=e=>typeof Promise<"u"&&e instanceof Promise;var nv;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(nv||(nv={}));var kxe=class{constructor(t,r,i,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=n}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}},e6d=(e,t)=>{if(OBi(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new fae(e.common.issues);return this._error=r,this._error}}};function KP(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(u,l)=>{let{message:d}=e;return u.code==="invalid_enum_value"?{message:d??l.defaultError}:typeof l.data>"u"?{message:d??i??l.defaultError}:u.code!=="invalid_type"?{message:l.defaultError}:{message:d??r??l.defaultError}},description:n}}var bw=class{get description(){return this._def.description}_getType(t){return Ber(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ber(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new YW,ctx:{common:t.parent.common,data:t.data,parsedType:Ber(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Q8n(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ber(t)},n=this._parseSync({data:t,path:i.path,parent:i});return e6d(i,n)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ber(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:r});return OBi(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>OBi(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){let i=await this.safeParseAsync(t,r);if(i.success)return i.data;throw i.error}async safeParseAsync(t,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ber(t)},n=this._parse({data:t,path:i.path,parent:i}),a=await(Q8n(n)?n:Promise.resolve(n));return e6d(i,a)}refine(t,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{let u=t(n),l=()=>a.addIssue({code:Bl.custom,...i(n)});return typeof Promise<"u"&&u instanceof Promise?u.then(d=>d?!0:(l(),!1)):u?!0:(l(),!1)})}refinement(t,r){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(t){return new eNe({schema:this,typeName:cg.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Zxe.create(this,this._def)}nullable(){return zer.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Egi.create(this)}promise(){return jBi.create(this,this._def)}or(t){return XZi.create([this,t],this._def)}and(t){return ZZi.create(this,t,this._def)}transform(t){return new eNe({...KP(this._def),schema:this,typeName:cg.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new iki({...KP(this._def),innerType:this,defaultValue:r,typeName:cg.ZodDefault})}brand(){return new iRa({typeName:cg.ZodBranded,type:this,...KP(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new nki({...KP(this._def),innerType:this,catchValue:r,typeName:cg.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return nRa.create(this,t)}readonly(){return aki.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fIS=/^c[^\s-]{8,}$/i,dIS=/^[0-9a-z]+$/,pIS=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_IS=/^[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,hIS=/^[a-z0-9_-]{21}$/i,yIS=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vIS=/^[-+]?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)?)??$/,bIS=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gIS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",L$s,OIS=/^(?:(?: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])$/,mIS=/^(?:(?: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])$/,PIS=/^(([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]))$/,jIS=/^(([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])$/,wIS=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,SIS=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,r6d="((\\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])))",DIS=new RegExp(`^${r6d}$`);function i6d(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function EIS(e){return new RegExp(`^${i6d(e)}$`)}function n6d(e){let t=`${r6d}T${i6d(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function MIS(e,t){return!!((t==="v4"||!t)&&OIS.test(e)||(t==="v6"||!t)&&PIS.test(e))}function AIS(e,t){if(!yIS.test(e))return!1;try{let[r]=e.split("."),i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||t&&n.alg!==t)}catch{return!1}}function qIS(e,t){return!!((t==="v4"||!t)&&mIS.test(e)||(t==="v6"||!t)&&jIS.test(e))}var mBi=class e extends bw{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N_.string){let a=this._getOrReturnCtx(t);return zp(a,{code:Bl.invalid_type,expected:N_.string,received:a.parsedType}),L0}let i=new YW,n;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="max")t.data.length>a.value&&(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if(a.kind==="length"){let u=t.data.length>a.value,l=t.data.length<a.value;(u||l)&&(n=this._getOrReturnCtx(t,n),u?zp(n,{code:Bl.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&zp(n,{code:Bl.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),i.dirty())}else if(a.kind==="email")bIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"email",code:Bl.invalid_string,message:a.message}),i.dirty());else if(a.kind==="emoji")L$s||(L$s=new RegExp(gIS,"u")),L$s.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"emoji",code:Bl.invalid_string,message:a.message}),i.dirty());else if(a.kind==="uuid")_IS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"uuid",code:Bl.invalid_string,message:a.message}),i.dirty());else if(a.kind==="nanoid")hIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"nanoid",code:Bl.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid")fIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"cuid",code:Bl.invalid_string,message:a.message}),i.dirty());else if(a.kind==="cuid2")dIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"cuid2",code:Bl.invalid_string,message:a.message}),i.dirty());else if(a.kind==="ulid")pIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"ulid",code:Bl.invalid_string,message:a.message}),i.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),zp(n,{validation:"url",code:Bl.invalid_string,message:a.message}),i.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"regex",code:Bl.invalid_string,message:a.message}),i.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),i.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.invalid_string,validation:{startsWith:a.value},message:a.message}),i.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.invalid_string,validation:{endsWith:a.value},message:a.message}),i.dirty()):a.kind==="datetime"?n6d(a).test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.invalid_string,validation:"datetime",message:a.message}),i.dirty()):a.kind==="date"?DIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.invalid_string,validation:"date",message:a.message}),i.dirty()):a.kind==="time"?EIS(a).test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.invalid_string,validation:"time",message:a.message}),i.dirty()):a.kind==="duration"?vIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"duration",code:Bl.invalid_string,message:a.message}),i.dirty()):a.kind==="ip"?MIS(t.data,a.version)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"ip",code:Bl.invalid_string,message:a.message}),i.dirty()):a.kind==="jwt"?AIS(t.data,a.alg)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"jwt",code:Bl.invalid_string,message:a.message}),i.dirty()):a.kind==="cidr"?qIS(t.data,a.version)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"cidr",code:Bl.invalid_string,message:a.message}),i.dirty()):a.kind==="base64"?wIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"base64",code:Bl.invalid_string,message:a.message}),i.dirty()):a.kind==="base64url"?SIS.test(t.data)||(n=this._getOrReturnCtx(t,n),zp(n,{validation:"base64url",code:Bl.invalid_string,message:a.message}),i.dirty()):aD.assertNever(a);return{status:i.value,value:t.data}}_regex(t,r,i){return this.refinement(n=>t.test(n),{validation:r,code:Bl.invalid_string,...nv.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...nv.errToObj(t)})}url(t){return this._addCheck({kind:"url",...nv.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...nv.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...nv.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...nv.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...nv.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...nv.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...nv.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...nv.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...nv.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...nv.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...nv.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...nv.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...nv.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...nv.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...nv.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...nv.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...nv.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...nv.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...nv.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...nv.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...nv.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...nv.errToObj(r)})}nonempty(t){return this.min(1,nv.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};mBi.create=e=>new mBi({checks:[],typeName:cg.ZodString,coerce:e?.coerce??!1,...KP(e)});function TIS(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,a=Number.parseInt(e.toFixed(n).replace(".","")),u=Number.parseInt(t.toFixed(n).replace(".",""));return a%u/10**n}var $Zi=class e extends bw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==N_.number){let a=this._getOrReturnCtx(t);return zp(a,{code:Bl.invalid_type,expected:N_.number,received:a.parsedType}),L0}let i,n=new YW;for(let a of this._def.checks)a.kind==="int"?aD.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?TIS(t.data,a.value)!==0&&(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.not_finite,message:a.message}),n.dirty()):aD.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,nv.toString(r))}gt(t,r){return this.setLimit("min",t,!1,nv.toString(r))}lte(t,r){return this.setLimit("max",t,!0,nv.toString(r))}lt(t,r){return this.setLimit("max",t,!1,nv.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:nv.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:nv.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:nv.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:nv.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:nv.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:nv.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:nv.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:nv.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:nv.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:nv.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&aD.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(r)&&Number.isFinite(t)}};$Zi.create=e=>new $Zi({checks:[],typeName:cg.ZodNumber,coerce:e?.coerce||!1,...KP(e)});var GZi=class e extends bw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==N_.bigint)return this._getInvalidInput(t);let i,n=new YW;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),zp(i,{code:Bl.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):aD.assertNever(a);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return zp(r,{code:Bl.invalid_type,expected:N_.bigint,received:r.parsedType}),L0}gte(t,r){return this.setLimit("min",t,!0,nv.toString(r))}gt(t,r){return this.setLimit("min",t,!1,nv.toString(r))}lte(t,r){return this.setLimit("max",t,!0,nv.toString(r))}lt(t,r){return this.setLimit("max",t,!1,nv.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:nv.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:nv.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:nv.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:nv.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:nv.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:nv.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};GZi.create=e=>new GZi({checks:[],typeName:cg.ZodBigInt,coerce:e?.coerce??!1,...KP(e)});var QZi=class extends bw{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==N_.boolean){let i=this._getOrReturnCtx(t);return zp(i,{code:Bl.invalid_type,expected:N_.boolean,received:i.parsedType}),L0}return sJ(t.data)}};QZi.create=e=>new QZi({typeName:cg.ZodBoolean,coerce:e?.coerce||!1,...KP(e)});var JZi=class e extends bw{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==N_.date){let a=this._getOrReturnCtx(t);return zp(a,{code:Bl.invalid_type,expected:N_.date,received:a.parsedType}),L0}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return zp(a,{code:Bl.invalid_date}),L0}let i=new YW,n;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(n=this._getOrReturnCtx(t,n),zp(n,{code:Bl.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):aD.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:nv.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:nv.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};JZi.create=e=>new JZi({checks:[],coerce:e?.coerce||!1,typeName:cg.ZodDate,...KP(e)});var K8n=class extends bw{_parse(t){if(this._getType(t)!==N_.symbol){let i=this._getOrReturnCtx(t);return zp(i,{code:Bl.invalid_type,expected:N_.symbol,received:i.parsedType}),L0}return sJ(t.data)}};K8n.create=e=>new K8n({typeName:cg.ZodSymbol,...KP(e)});var KZi=class extends bw{_parse(t){if(this._getType(t)!==N_.undefined){let i=this._getOrReturnCtx(t);return zp(i,{code:Bl.invalid_type,expected:N_.undefined,received:i.parsedType}),L0}return sJ(t.data)}};KZi.create=e=>new KZi({typeName:cg.ZodUndefined,...KP(e)});var YZi=class extends bw{_parse(t){if(this._getType(t)!==N_.null){let i=this._getOrReturnCtx(t);return zp(i,{code:Bl.invalid_type,expected:N_.null,received:i.parsedType}),L0}return sJ(t.data)}};YZi.create=e=>new YZi({typeName:cg.ZodNull,...KP(e)});var PBi=class extends bw{constructor(){super(...arguments),this._any=!0}_parse(t){return sJ(t.data)}};PBi.create=e=>new PBi({typeName:cg.ZodAny,...KP(e)});var Dgi=class extends bw{constructor(){super(...arguments),this._unknown=!0}_parse(t){return sJ(t.data)}};Dgi.create=e=>new Dgi({typeName:cg.ZodUnknown,...KP(e)});var h$t=class extends bw{_parse(t){let r=this._getOrReturnCtx(t);return zp(r,{code:Bl.invalid_type,expected:N_.never,received:r.parsedType}),L0}};h$t.create=e=>new h$t({typeName:cg.ZodNever,...KP(e)});var Y8n=class extends bw{_parse(t){if(this._getType(t)!==N_.undefined){let i=this._getOrReturnCtx(t);return zp(i,{code:Bl.invalid_type,expected:N_.void,received:i.parsedType}),L0}return sJ(t.data)}};Y8n.create=e=>new Y8n({typeName:cg.ZodVoid,...KP(e)});var Egi=class e extends bw{_parse(t){let{ctx:r,status:i}=this._processInputParams(t),n=this._def;if(r.parsedType!==N_.array)return zp(r,{code:Bl.invalid_type,expected:N_.array,received:r.parsedType}),L0;if(n.exactLength!==null){let u=r.data.length>n.exactLength.value,l=r.data.length<n.exactLength.value;(u||l)&&(zp(r,{code:u?Bl.too_big:Bl.too_small,minimum:l?n.exactLength.value:void 0,maximum:u?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(zp(r,{code:Bl.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(zp(r,{code:Bl.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((u,l)=>n.type._parseAsync(new kxe(r,u,r.path,l)))).then(u=>YW.mergeArray(i,u));let a=[...r.data].map((u,l)=>n.type._parseSync(new kxe(r,u,r.path,l)));return YW.mergeArray(i,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:nv.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:nv.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:nv.toString(r)}})}nonempty(t){return this.min(1,t)}};Egi.create=(e,t)=>new Egi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:cg.ZodArray,...KP(t)});function J8n(e){if(e instanceof dae){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=Zxe.create(J8n(i))}return new dae({...e._def,shape:()=>t})}else return e instanceof Egi?new Egi({...e._def,type:J8n(e.element)}):e instanceof Zxe?Zxe.create(J8n(e.unwrap())):e instanceof zer?zer.create(J8n(e.unwrap())):e instanceof Ier?Ier.create(e.items.map(t=>J8n(t))):e}var dae=class e extends bw{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=aD.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==N_.object){let s=this._getOrReturnCtx(t);return zp(s,{code:Bl.invalid_type,expected:N_.object,received:s.parsedType}),L0}let{status:i,ctx:n}=this._processInputParams(t),{shape:a,keys:u}=this._getCached(),l=[];if(!(this._def.catchall instanceof h$t&&this._def.unknownKeys==="strip"))for(let s in n.data)u.includes(s)||l.push(s);let d=[];for(let s of u){let o=a[s],c=n.data[s];d.push({key:{status:"valid",value:s},value:o._parse(new kxe(n,c,n.path,s)),alwaysSet:s in n.data})}if(this._def.catchall instanceof h$t){let s=this._def.unknownKeys;if(s==="passthrough")for(let o of l)d.push({key:{status:"valid",value:o},value:{status:"valid",value:n.data[o]}});else if(s==="strict")l.length>0&&(zp(n,{code:Bl.unrecognized_keys,keys:l}),i.dirty());else if(s!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let s=this._def.catchall;for(let o of l){let c=n.data[o];d.push({key:{status:"valid",value:o},value:s._parse(new kxe(n,c,n.path,o)),alwaysSet:o in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let s=[];for(let o of d){let c=await o.key,b=await o.value;s.push({key:c,value:b,alwaysSet:o.alwaysSet})}return s}).then(s=>YW.mergeObjectSync(i,s)):YW.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(t){return nv.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,i)=>{let n=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:nv.errToObj(t).message??n}:{message:n}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:cg.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let i of aD.objectKeys(t))t[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let i of aD.objectKeys(this.shape))t[i]||(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}deepPartial(){return J8n(this)}partial(t){let r={};for(let i of aD.objectKeys(this.shape)){let n=this.shape[i];t&&!t[i]?r[i]=n:r[i]=n.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let i of aD.objectKeys(this.shape))if(t&&!t[i])r[i]=this.shape[i];else{let a=this.shape[i];for(;a instanceof Zxe;)a=a._def.innerType;r[i]=a}return new e({...this._def,shape:()=>r})}keyof(){return a6d(aD.objectKeys(this.shape))}};dae.create=(e,t)=>new dae({shape:()=>e,unknownKeys:"strip",catchall:h$t.create(),typeName:cg.ZodObject,...KP(t)});dae.strictCreate=(e,t)=>new dae({shape:()=>e,unknownKeys:"strict",catchall:h$t.create(),typeName:cg.ZodObject,...KP(t)});dae.lazycreate=(e,t)=>new dae({shape:e,unknownKeys:"strip",catchall:h$t.create(),typeName:cg.ZodObject,...KP(t)});var XZi=class extends bw{_parse(t){let{ctx:r}=this._processInputParams(t),i=this._def.options;function n(a){for(let l of a)if(l.result.status==="valid")return l.result;for(let l of a)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let u=a.map(l=>new fae(l.ctx.common.issues));return zp(r,{code:Bl.invalid_union,unionErrors:u}),L0}if(r.common.async)return Promise.all(i.map(async a=>{let u={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:u}),ctx:u}})).then(n);{let a,u=[];for(let d of i){let s={...r,common:{...r.common,issues:[]},parent:null},o=d._parseSync({data:r.data,path:r.path,parent:s});if(o.status==="valid")return o;o.status==="dirty"&&!a&&(a={result:o,ctx:s}),s.common.issues.length&&u.push(s.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let l=u.map(d=>new fae(d));return zp(r,{code:Bl.invalid_union,unionErrors:l}),L0}}get options(){return this._def.options}};XZi.create=(e,t)=>new XZi({options:e,typeName:cg.ZodUnion,...KP(t)});var Sgi=e=>e instanceof kZi?Sgi(e.schema):e instanceof eNe?Sgi(e.innerType()):e instanceof eki?[e.value]:e instanceof tki?e.options:e instanceof rki?aD.objectValues(e.enum):e instanceof iki?Sgi(e._def.innerType):e instanceof KZi?[void 0]:e instanceof YZi?[null]:e instanceof Zxe?[void 0,...Sgi(e.unwrap())]:e instanceof zer?[null,...Sgi(e.unwrap())]:e instanceof iRa||e instanceof aki?Sgi(e.unwrap()):e instanceof nki?Sgi(e._def.innerType):[],Eqo=class e extends bw{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N_.object)return zp(r,{code:Bl.invalid_type,expected:N_.object,received:r.parsedType}),L0;let i=this.discriminator,n=r.data[i],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(zp(r,{code:Bl.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),L0)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){let n=new Map;for(let a of r){let u=Sgi(a.shape[t]);if(!u.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of u){if(n.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);n.set(l,a)}}return new e({typeName:cg.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...KP(i)})}};function U$s(e,t){let r=Ber(e),i=Ber(t);if(e===t)return{valid:!0,data:e};if(r===N_.object&&i===N_.object){let n=aD.objectKeys(t),a=aD.objectKeys(e).filter(l=>n.indexOf(l)!==-1),u={...e,...t};for(let l of a){let d=U$s(e[l],t[l]);if(!d.valid)return{valid:!1};u[l]=d.data}return{valid:!0,data:u}}else if(r===N_.array&&i===N_.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let a=0;a<e.length;a++){let u=e[a],l=t[a],d=U$s(u,l);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return r===N_.date&&i===N_.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ZZi=class extends bw{_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=(a,u)=>{if(Sqo(a)||Sqo(u))return L0;let l=U$s(a.value,u.value);return l.valid?((Dqo(a)||Dqo(u))&&r.dirty(),{status:r.value,value:l.data}):(zp(i,{code:Bl.invalid_intersection_types}),L0)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([a,u])=>n(a,u)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ZZi.create=(e,t,r)=>new ZZi({left:e,right:t,typeName:cg.ZodIntersection,...KP(r)});var Ier=class e extends bw{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==N_.array)return zp(i,{code:Bl.invalid_type,expected:N_.array,received:i.parsedType}),L0;if(i.data.length<this._def.items.length)return zp(i,{code:Bl.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L0;!this._def.rest&&i.data.length>this._def.items.length&&(zp(i,{code:Bl.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...i.data].map((u,l)=>{let d=this._def.items[l]||this._def.rest;return d?d._parse(new kxe(i,u,i.path,l)):null}).filter(u=>!!u);return i.common.async?Promise.all(a).then(u=>YW.mergeArray(r,u)):YW.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ier.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ier({items:e,typeName:cg.ZodTuple,rest:null,...KP(t)})};var Mqo=class e extends bw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==N_.object)return zp(i,{code:Bl.invalid_type,expected:N_.object,received:i.parsedType}),L0;let n=[],a=this._def.keyType,u=this._def.valueType;for(let l in i.data)n.push({key:a._parse(new kxe(i,l,i.path,l)),value:u._parse(new kxe(i,i.data[l],i.path,l)),alwaysSet:l in i.data});return i.common.async?YW.mergeObjectAsync(r,n):YW.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,i){return r instanceof bw?new e({keyType:t,valueType:r,typeName:cg.ZodRecord,...KP(i)}):new e({keyType:mBi.create(),valueType:t,typeName:cg.ZodRecord,...KP(r)})}},X8n=class extends bw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==N_.map)return zp(i,{code:Bl.invalid_type,expected:N_.map,received:i.parsedType}),L0;let n=this._def.keyType,a=this._def.valueType,u=[...i.data.entries()].map(([l,d],s)=>({key:n._parse(new kxe(i,l,i.path,[s,"key"])),value:a._parse(new kxe(i,d,i.path,[s,"value"]))}));if(i.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let d of u){let s=await d.key,o=await d.value;if(s.status==="aborted"||o.status==="aborted")return L0;(s.status==="dirty"||o.status==="dirty")&&r.dirty(),l.set(s.value,o.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let d of u){let s=d.key,o=d.value;if(s.status==="aborted"||o.status==="aborted")return L0;(s.status==="dirty"||o.status==="dirty")&&r.dirty(),l.set(s.value,o.value)}return{status:r.value,value:l}}}};X8n.create=(e,t,r)=>new X8n({valueType:t,keyType:e,typeName:cg.ZodMap,...KP(r)});var Z8n=class e extends bw{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==N_.set)return zp(i,{code:Bl.invalid_type,expected:N_.set,received:i.parsedType}),L0;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(zp(i,{code:Bl.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(zp(i,{code:Bl.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let a=this._def.valueType;function u(d){let s=new Set;for(let o of d){if(o.status==="aborted")return L0;o.status==="dirty"&&r.dirty(),s.add(o.value)}return{status:r.value,value:s}}let l=[...i.data.values()].map((d,s)=>a._parse(new kxe(i,d,i.path,s)));return i.common.async?Promise.all(l).then(d=>u(d)):u(l)}min(t,r){return new e({...this._def,minSize:{value:t,message:nv.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:nv.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Z8n.create=(e,t)=>new Z8n({valueType:e,minSize:null,maxSize:null,typeName:cg.ZodSet,...KP(t)});var Aqo=class e extends bw{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N_.function)return zp(r,{code:Bl.invalid_type,expected:N_.function,received:r.parsedType}),L0;function i(l,d){return rRa({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G8n(),wgi].filter(s=>!!s),issueData:{code:Bl.invalid_arguments,argumentsError:d}})}function n(l,d){return rRa({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,G8n(),wgi].filter(s=>!!s),issueData:{code:Bl.invalid_return_type,returnTypeError:d}})}let a={errorMap:r.common.contextualErrorMap},u=r.data;if(this._def.returns instanceof jBi){let l=this;return sJ(async function(...d){let s=new fae([]),o=await l._def.args.parseAsync(d,a).catch(g=>{throw s.addIssue(i(d,g)),s}),c=await Reflect.apply(u,this,o);return await l._def.returns._def.type.parseAsync(c,a).catch(g=>{throw s.addIssue(n(c,g)),s})})}else{let l=this;return sJ(function(...d){let s=l._def.args.safeParse(d,a);if(!s.success)throw new fae([i(d,s.error)]);let o=Reflect.apply(u,this,s.data),c=l._def.returns.safeParse(o,a);if(!c.success)throw new fae([n(o,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ier.create(t).rest(Dgi.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new e({args:t||Ier.create([]).rest(Dgi.create()),returns:r||Dgi.create(),typeName:cg.ZodFunction,...KP(i)})}},kZi=class extends bw{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};kZi.create=(e,t)=>new kZi({getter:e,typeName:cg.ZodLazy,...KP(t)});var eki=class extends bw{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return zp(r,{received:r.data,code:Bl.invalid_literal,expected:this._def.value}),L0}return{status:"valid",value:t.data}}get value(){return this._def.value}};eki.create=(e,t)=>new eki({value:e,typeName:cg.ZodLiteral,...KP(t)});function a6d(e,t){return new tki({values:e,typeName:cg.ZodEnum,...KP(t)})}var tki=class e extends bw{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),i=this._def.values;return zp(r,{expected:aD.joinValues(i),received:r.parsedType,code:Bl.invalid_type}),L0}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),i=this._def.values;return zp(r,{received:r.data,code:Bl.invalid_enum_value,options:i}),L0}return sJ(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}};tki.create=a6d;var rki=class extends bw{_parse(t){let r=aD.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==N_.string&&i.parsedType!==N_.number){let n=aD.objectValues(r);return zp(i,{expected:aD.joinValues(n),received:i.parsedType,code:Bl.invalid_type}),L0}if(this._cache||(this._cache=new Set(aD.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let n=aD.objectValues(r);return zp(i,{received:i.data,code:Bl.invalid_enum_value,options:n}),L0}return sJ(t.data)}get enum(){return this._def.values}};rki.create=(e,t)=>new rki({values:e,typeName:cg.ZodNativeEnum,...KP(t)});var jBi=class extends bw{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N_.promise&&r.common.async===!1)return zp(r,{code:Bl.invalid_type,expected:N_.promise,received:r.parsedType}),L0;let i=r.parsedType===N_.promise?r.data:Promise.resolve(r.data);return sJ(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};jBi.create=(e,t)=>new jBi({type:e,typeName:cg.ZodPromise,...KP(t)});var eNe=class extends bw{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===cg.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=this._def.effect||null,a={addIssue:u=>{zp(i,u),u.fatal?r.abort():r.dirty()},get path(){return i.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let u=n.transform(i.data,a);if(i.common.async)return Promise.resolve(u).then(async l=>{if(r.value==="aborted")return L0;let d=await this._def.schema._parseAsync({data:l,path:i.path,parent:i});return d.status==="aborted"?L0:d.status==="dirty"?HZi(d.value):r.value==="dirty"?HZi(d.value):d});{if(r.value==="aborted")return L0;let l=this._def.schema._parseSync({data:u,path:i.path,parent:i});return l.status==="aborted"?L0:l.status==="dirty"?HZi(l.value):r.value==="dirty"?HZi(l.value):l}}if(n.type==="refinement"){let u=l=>{let d=n.refinement(l,a);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(i.common.async===!1){let l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?L0:(l.status==="dirty"&&r.dirty(),u(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>l.status==="aborted"?L0:(l.status==="dirty"&&r.dirty(),u(l.value).then(()=>({status:r.value,value:l.value}))))}if(n.type==="transform")if(i.common.async===!1){let u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!OBi(u))return L0;let l=n.transform(u.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>OBi(u)?Promise.resolve(n.transform(u.value,a)).then(l=>({status:r.value,value:l})):L0);aD.assertNever(n)}};eNe.create=(e,t,r)=>new eNe({schema:e,typeName:cg.ZodEffects,effect:t,...KP(r)});eNe.createWithPreprocess=(e,t,r)=>new eNe({schema:t,effect:{type:"preprocess",transform:e},typeName:cg.ZodEffects,...KP(r)});var Zxe=class extends bw{_parse(t){return this._getType(t)===N_.undefined?sJ(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Zxe.create=(e,t)=>new Zxe({innerType:e,typeName:cg.ZodOptional,...KP(t)});var zer=class extends bw{_parse(t){return this._getType(t)===N_.null?sJ(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};zer.create=(e,t)=>new zer({innerType:e,typeName:cg.ZodNullable,...KP(t)});var iki=class extends bw{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return r.parsedType===N_.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};iki.create=(e,t)=>new iki({innerType:e,typeName:cg.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...KP(t)});var nki=class extends bw{_parse(t){let{ctx:r}=this._processInputParams(t),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Q8n(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new fae(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new fae(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};nki.create=(e,t)=>new nki({innerType:e,typeName:cg.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...KP(t)});var k8n=class extends bw{_parse(t){if(this._getType(t)!==N_.nan){let i=this._getOrReturnCtx(t);return zp(i,{code:Bl.invalid_type,expected:N_.nan,received:i.parsedType}),L0}return{status:"valid",value:t.data}}};k8n.create=e=>new k8n({typeName:cg.ZodNaN,...KP(e)});var CIS=Symbol("zod_brand"),iRa=class extends bw{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},nRa=class e extends bw{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?L0:a.status==="dirty"?(r.dirty(),HZi(a.value)):this._def.out._parseAsync({data:a.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?L0:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,r){return new e({in:t,out:r,typeName:cg.ZodPipeline})}},aki=class extends bw{_parse(t){let r=this._def.innerType._parse(t),i=n=>(OBi(n)&&(n.value=Object.freeze(n.value)),n);return Q8n(r)?r.then(n=>i(n)):i(r)}unwrap(){return this._def.innerType}};aki.create=(e,t)=>new aki({innerType:e,typeName:cg.ZodReadonly,...KP(t)});function t6d(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function o6d(e,t={},r){return e?PBi.create().superRefine((i,n)=>{let a=e(i);if(a instanceof Promise)return a.then(u=>{if(!u){let l=t6d(t,i),d=l.fatal??r??!0;n.addIssue({code:"custom",...l,fatal:d})}});if(!a){let u=t6d(t,i),l=u.fatal??r??!0;n.addIssue({code:"custom",...u,fatal:l})}}):PBi.create()}var BIS={object:dae.lazycreate},cg;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(cg||(cg={}));var IIS=(e,t={message:`Input not instance of ${e.name}`})=>o6d(r=>r instanceof e,t),u6d=mBi.create,s6d=$Zi.create,zIS=k8n.create,RIS=GZi.create,c6d=QZi.create,xIS=JZi.create,NIS=K8n.create,FIS=KZi.create,LIS=YZi.create,UIS=PBi.create,VIS=Dgi.create,WIS=h$t.create,HIS=Y8n.create,$IS=Egi.create,GIS=dae.create,QIS=dae.strictCreate,JIS=XZi.create,KIS=Eqo.create,YIS=ZZi.create,XIS=Ier.create,ZIS=Mqo.create,kIS=X8n.create,ezS=Z8n.create,tzS=Aqo.create,rzS=kZi.create,izS=eki.create,nzS=tki.create,azS=rki.create,ozS=jBi.create,uzS=eNe.create,szS=Zxe.create,czS=zer.create,lzS=eNe.createWithPreprocess,fzS=nRa.create,dzS=()=>u6d().optional(),pzS=()=>s6d().optional(),_zS=()=>c6d().optional(),hzS={string:e=>mBi.create({...e,coerce:!0}),number:e=>$Zi.create({...e,coerce:!0}),boolean:e=>QZi.create({...e,coerce:!0}),bigint:e=>GZi.create({...e,coerce:!0}),date:e=>JZi.create({...e,coerce:!0})};var yzS=L0;var pae={};Po(pae,{RawSchemas:()=>aGs});var aGs={};Po(aGs,{AiChatModel:()=>W$s,ContentAlignment:()=>Q$s,FernDocsConfig:()=>k$s,FernDocsConfigError:()=>aRa,FernDocsConfigTimeoutError:()=>oRa,FontDisplay:()=>Y$s,FontStyle:()=>K$s,HeaderPosition:()=>J$s,JsScriptStrategy:()=>X$s,ProgrammingLanguage:()=>V$s,SearchbarPlacement:()=>$$s,Serializer:()=>rNe,TabsPlacement:()=>G$s,TwitterCardSetting:()=>Z$s,VersionAvailability:()=>H$s,docs:()=>qqo,serialization:()=>Ci});var k$s={};Po(k$s,{AiChatModel:()=>W$s,ContentAlignment:()=>Q$s,FontDisplay:()=>Y$s,FontStyle:()=>K$s,HeaderPosition:()=>J$s,JsScriptStrategy:()=>X$s,ProgrammingLanguage:()=>V$s,SearchbarPlacement:()=>$$s,TabsPlacement:()=>G$s,TwitterCardSetting:()=>Z$s,VersionAvailability:()=>H$s,docs:()=>qqo});var qqo={};Po(qqo,{AiChatModel:()=>W$s,ContentAlignment:()=>Q$s,FontDisplay:()=>Y$s,FontStyle:()=>K$s,HeaderPosition:()=>J$s,JsScriptStrategy:()=>X$s,ProgrammingLanguage:()=>V$s,SearchbarPlacement:()=>$$s,TabsPlacement:()=>G$s,TwitterCardSetting:()=>Z$s,VersionAvailability:()=>H$s});var V$s={Typescript:"typescript",Javascript:"javascript",Python:"python",Java:"java",Go:"go",Ruby:"ruby",Csharp:"csharp",Nodets:"nodets",Nodejs:"nodejs",Dotnet:"dotnet",Curl:"curl",Jvm:"jvm",Ts:"ts",Js:"js"};var W$s={Claude35:"claude-3.5",Claude37:"claude-3.7",Claude4:"claude-4",CommandA:"command-a"};var H$s={Deprecated:"deprecated",Ga:"ga",Stable:"stable",Beta:"beta"};var $$s={Header:"header",HeaderTabs:"header-tabs",Sidebar:"sidebar"};var G$s={Header:"header",Sidebar:"sidebar"};var Q$s={Center:"center",Left:"left"};var J$s={Fixed:"fixed",Static:"static"};var K$s={Normal:"normal",Italic:"italic"};var Y$s={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"};var X$s={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"};var Z$s={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"};var aRa=class e extends Error{statusCode;body;constructor({message:t,statusCode:r,body:i}){super(vzS({message:t,statusCode:r,body:i})),Object.setPrototypeOf(this,e.prototype),r!=null&&(this.statusCode=r),i!==void 0&&(this.body=i)}};function vzS({message:e,statusCode:t,body:r}){let i=[];return e!=null&&i.push(e),t!=null&&i.push(`Status code: ${t.toString()}`),r!=null&&i.push(`Body: ${JSON.stringify(r,void 0,2)}`),i.join(`
|
|
1630
1630
|
`)}var oRa=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};var Ci={};Po(Ci,{JsonError:()=>e5n,ParseError:()=>t5n,any:()=>w6d,bigint:()=>f6d,boolean:()=>S6d,booleanLiteral:()=>j6d,date:()=>d6d,discriminant:()=>I6d,enum_:()=>Cqo,getObjectLikeUtils:()=>y$t,getObjectUtils:()=>oki,getSchemaUtils:()=>hT,isProperty:()=>SBi,lazy:()=>p6d,lazyObject:()=>O6d,list:()=>Iqo,number:()=>D6d,object:()=>Bqo,objectWithoutOptionalProperties:()=>g6d,optional:()=>eGs,property:()=>h6d,record:()=>q6d,set:()=>T6d,string:()=>E6d,stringLiteral:()=>P6d,transform:()=>tGs,undiscriminatedUnion:()=>B6d,union:()=>R6d,unknown:()=>M6d,withParsedProperties:()=>iGs});var Gj={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function EA(e,t){return`Expected ${t}. Received ${bzS(e)}.`}function bzS(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function iL(e){return{...e,json:l6d(e.json),parse:l6d(e.parse)}}function l6d(e){return(t,r)=>{let i=e(t,r),{skipValidation:n=!1}=r??{};return!i.ok&&n?(console.warn(["Failed to validate.",...i.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
1631
1631
|
`)),{ok:!0,value:t}):i}}function Tqo(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var e5n=class e extends Error{errors;constructor(t){super(t.map(Tqo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var t5n=class e extends Error{errors;constructor(t){super(t.map(Tqo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function hT(e){return{optional:()=>eGs(e),transform:t=>tGs(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new t5n(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new e5n(i.errors)}}}function eGs(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>Gj.OPTIONAL};return{...t,...hT(t)}}function tGs(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(i,n)=>{let a=t.untransform(i);return e.json(a,n)},getType:()=>e.getType()};return{...r,...hT(r)}}function f6d(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:EA(t,"string")}]}:{ok:!0,value:BigInt(t)},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t.toString()}:{ok:!1,errors:[{path:r,message:EA(t,"bigint")}]},getType:()=>Gj.BIGINT};return{...iL(e),...hT(e)}}var gzS=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function d6d(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:EA(t,"string")}]}:gzS.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:EA(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:EA(t,"Date object")}]},getType:()=>Gj.DATE};return{...iL(e),...hT(e)}}function cJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...iL(r),...hT(r)}}}function Cqo(e){let t=new Set(e);return cJ(Gj.ENUM,(i,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:a=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:a,message:EA(i,"string")}]}:!t.has(i)&&!n?{ok:!1,errors:[{path:a,message:EA(i,"enum")}]}:{ok:!0,value:i})()}function p6d(e){let t=rGs(e);return{...t,...hT(t)}}function rGs(e){return{parse:(t,r)=>r5n(e).parse(t,r),json:(t,r)=>r5n(e).json(t,r),getType:()=>r5n(e).getType()}}function r5n(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function uRa(e){return Object.entries(e)}function sRa(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[n,a])=>(r.has(n)&&(i[n]=a),i),{})}function wBi(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function cRa(e){return Object.keys(e)}function _6d(e,t){let r=[],i=[];for(let n of e)t(n)?r.push(n):i.push(n);return[r,i]}function y$t(e){return{withParsedProperties:t=>iGs(e,t)}}function iGs(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);if(!a.ok)return a;let u=Object.entries(t).reduce((l,[d,s])=>({...l,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(i,n)=>{if(!wBi(i))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:EA(i,"object")}]};let a=new Set(Object.keys(t)),u=sRa(i,Object.keys(i).filter(l=>!a.has(l)));return e.json(u,n)},getType:()=>e.getType()};return{...r,...hT(r),...y$t(r)}}function h6d(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function SBi(e){return e.isProperty}function Bqo(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,i])=>SBi(i)?i.rawKey:r),_getParsedProperties:()=>cRa(e),parse:(r,i)=>{let n={},a=[];for(let[u,l]of uRa(e)){let d=SBi(l)?l.rawKey:u,s=SBi(l)?l.valueSchema:l,o={rawKey:d,parsedKey:u,valueSchema:s};n[d]=o,b6d(s)&&a.push(d)}return y6d({value:r,requiredKeys:a,getProperty:u=>{let l=n[u];if(l!=null)return{transformedKey:l.parsedKey,transform:d=>l.valueSchema.parse(d,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},json:(r,i)=>{let n=[];for(let[a,u]of uRa(e)){let l=SBi(u)?u.valueSchema:u;b6d(l)&&n.push(a)}return y6d({value:r,requiredKeys:n,getProperty:a=>{let u=e[a];if(u!=null)return SBi(u)?{transformedKey:u.rawKey,transform:l=>u.valueSchema.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:l=>u.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},getType:()=>Gj.OBJECT};return{...iL(t),...hT(t),...y$t(t),...oki(t)}}function y6d({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:i="fail",skipValidation:n=!1,breadcrumbsPrefix:a=[]}){if(!wBi(e))return{ok:!1,errors:[{path:a,message:EA(e,"object")}]};let u=new Set(t),l=[],d={};for(let[s,o]of Object.entries(e)){let c=r(s);if(c!=null){u.delete(s);let b=c.transform(o);b.ok?d[c.transformedKey]=b.value:(d[s]=o,l.push(...b.errors))}else switch(i){case"fail":l.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=o;break}}return l.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),l.length===0||n?{ok:!0,value:d}:{ok:!1,errors:l}}function oki(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,n)=>v6d({extensionKeys:t._getRawProperties(),value:i,transformBase:a=>e.parse(a,n),transformExtension:a=>t.parse(a,n)}),json:(i,n)=>v6d({extensionKeys:t._getParsedProperties(),value:i,transformBase:a=>e.json(a,n),transformExtension:a=>t.json(a,n)}),getType:()=>Gj.OBJECT};return{...r,...hT(r),...y$t(r),...oki(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,i)=>{let n=e.parse(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},json:(r,i)=>{let n=e.json(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},getType:()=>Gj.OBJECT};return{...t,...hT(t),...y$t(t),...oki(t)}}}}function v6d({extensionKeys:e,value:t,transformBase:r,transformExtension:i}){let n=new Set(e),[a,u]=_6d(cRa(t),s=>n.has(s)),l=r(sRa(t,u)),d=i(sRa(t,a));return l.ok&&d.ok?{ok:!0,value:{...l.value,...d.value}}:{ok:!1,errors:[...l.ok?[]:l.errors,...d.ok?[]:d.errors]}}function b6d(e){return!OzS(e)}function OzS(e){switch(e.getType()){case Gj.ANY:case Gj.UNKNOWN:case Gj.OPTIONAL:return!0;default:return!1}}function g6d(e){return Bqo(e)}function O6d(e){let t={...rGs(e),_getRawProperties:()=>r5n(e)._getRawProperties(),_getParsedProperties:()=>r5n(e)._getParsedProperties()};return{...t,...hT(t),...y$t(t),...oki(t)}}function Iqo(e){let t={parse:(r,i)=>m6d(r,(n,a)=>e.parse(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,i)=>m6d(r,(n,a)=>e.json(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>Gj.LIST};return{...iL(t),...hT(t)}}function m6d(e,t){return Array.isArray(e)?e.map((i,n)=>t(i,n)).reduce((i,n)=>{if(i.ok&&n.ok)return{ok:!0,value:[...i.value,n.value]};let a=[];return i.ok||a.push(...i.errors),n.ok||a.push(...n.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:EA(e,"list"),path:[]}]}}function P6d(e){return cJ(Gj.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:EA(r,`"${e}"`)}]})()}function j6d(e){return cJ(Gj.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:EA(r,`${e.toString()}`)}]})()}var w6d=cJ(Gj.ANY,e=>({ok:!0,value:e}));var S6d=cJ(Gj.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:EA(e,"boolean")}]});var D6d=cJ(Gj.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:EA(e,"number")}]});var E6d=cJ(Gj.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:EA(e,"string")}]});var M6d=cJ(Gj.UNKNOWN,e=>({ok:!0,value:e}));function q6d(e,t){let r={parse:(i,n)=>A6d({value:i,isKeyNumeric:e.getType()===Gj.NUMBER,transformKey:a=>e.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(i,n)=>A6d({value:i,isKeyNumeric:e.getType()===Gj.NUMBER,transformKey:a=>e.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>Gj.RECORD};return{...iL(r),...hT(r)}}function A6d({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:n=[]}){return wBi(e)?uRa(e).reduce((a,[u,l])=>{if(l==null)return a;let d=a,s=u;if(t){let g=u.length>0?Number(u):NaN;isNaN(g)||(s=g)}let o=r(s),c=i(l,s);if(d.ok&&o.ok&&c.ok)return{ok:!0,value:{...d.value,[o.value]:c.value}};let b=[];return d.ok||b.push(...d.errors),o.ok||b.push(...o.errors),c.ok||b.push(...c.errors),{ok:!1,errors:b}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:EA(e,"object")}]}}function T6d(e){let t=Iqo(e),r={parse:(i,n)=>{let a=t.parse(i,n);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(i,n)=>i instanceof Set?t.json([...i],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:EA(i,"Set")}]},getType:()=>Gj.SET};return{...iL(r),...hT(r)}}function B6d(e){let t={parse:(r,i)=>C6d((n,a)=>n.parse(r,a),e,i),json:(r,i)=>C6d((n,a)=>n.json(r,a),e,i),getType:()=>Gj.UNDISCRIMINATED_UNION};return{...iL(t),...hT(t)}}function C6d(e,t,r){let i=[];for(let[n,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let l of u.errors)i.push({path:l.path,message:`[Variant ${n}] ${l.message}`})}return{ok:!1,errors:i}}function I6d(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function R6d(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,n=Cqo(cRa(t)),a={parse:(u,l)=>z6d({value:u,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:d=>n.parse(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),json:(u,l)=>z6d({value:u,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:d=>n.json(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),getType:()=>Gj.UNION};return{...iL(a),...hT(a),...y$t(a)}}function z6d({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:l=[]}){if(!wBi(e))return{ok:!1,errors:[{path:l,message:EA(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:l,message:`Missing discriminant ("${t}")`}]};let o=i(d);if(!o.ok)return{ok:!1,errors:o.errors};let c=n(o.value);if(c==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...l,t],message:"Unexpected discriminant value"}]};let b=u(s,c);return b.ok?{ok:!0,value:{[r]:d,...b.value}}:b}var rNe={};Po(rNe,{AiChatConfig:()=>fRa,AiChatModel:()=>aTo,AnalyticsConfig:()=>Vqo,AnnouncementConfig:()=>Qqo,ApiReferenceConfiguration:()=>BTo,ApiReferenceEndpointConfiguration:()=>RTo,ApiReferenceLayoutItem:()=>Fer,ApiReferencePackageConfiguration:()=>NTo,ApiReferencePackageConfigurationWithOptions:()=>FTo,ApiReferenceSectionConfiguration:()=>xTo,AudienceId:()=>ATo,BackgroundImageConfiguration:()=>fTo,BackgroundImageThemedConfig:()=>lTo,ChangelogConfiguration:()=>ITo,ChangelogFolderRelativePath:()=>i5n,ColorConfig:()=>xer,ColorThemedConfig:()=>dTo,ColorsConfiguration:()=>pTo,ContentAlignment:()=>OTo,CssConfig:()=>wTo,CustomDomain:()=>Wqo,DocsConfiguration:()=>x6d,DocsInstance:()=>Gqo,DocsTypographyConfig:()=>vTo,EditThisPageConfig:()=>$qo,ExperimentalConfig:()=>nTo,FeatureFlag:()=>lRa,FeatureFlagConfiguration:()=>Kqo,FontConfig:()=>u5n,FontConfigPath:()=>hTo,FontConfigVariant:()=>_To,FontDisplay:()=>yTo,FontStyle:()=>o5n,FontWeight:()=>a5n,FooterLinksConfig:()=>iTo,FullStoryAnalyticsConfig:()=>xqo,GithubEditThisPageConfig:()=>Hqo,GoogleAnalytics4Config:()=>Uqo,GtmConfig:()=>Lqo,HeaderPosition:()=>mTo,IntegrationsConfig:()=>jTo,IntercomConfig:()=>Nqo,JsConfig:()=>MTo,JsConfigOptions:()=>dRa,JsFileConfig:()=>ETo,JsFileConfigSettings:()=>DTo,JsRemoteConfig:()=>STo,JsScriptStrategy:()=>s5n,LayoutConfig:()=>PTo,LinkConfiguration:()=>c5n,LogoConfiguration:()=>cTo,MetadataConfig:()=>uTo,NavbarGithubConfig:()=>tTo,NavbarLink:()=>rTo,NavbarLinkConfig:()=>ABi,NavigationConfig:()=>MBi,NavigationItem:()=>EBi,PageConfiguration:()=>tNe,PlaygroundButtonSettings:()=>CTo,PlaygroundSettings:()=>Ner,PostHogConfig:()=>Fqo,ProductConfig:()=>Xqo,ProductFileConfig:()=>F6d,ProgrammingLanguage:()=>zqo,RedirectConfig:()=>sTo,Role:()=>Jqo,RoleId:()=>uki,SearchbarPlacement:()=>bTo,SectionConfiguration:()=>zTo,SegmentConfig:()=>Rqo,SnippetLanguageConfiguration:()=>Mgi,SnippetsConfiguration:()=>TTo,TabConfig:()=>DBi,TabId:()=>Rer,TabbedNavigationConfig:()=>eTo,TabbedNavigationItem:()=>kqo,TabsPlacement:()=>gTo,TwitterCardSetting:()=>oTo,UntabbedNavigationConfig:()=>Zqo,VersionAvailability:()=>Yqo,VersionConfig:()=>n5n,VersionFileConfig:()=>N6d,VersionedSnippetLanguageConfiguration:()=>qTo,WithFeatureFlags:()=>OF,WithPermissions:()=>gF,docs:()=>nGs});var nGs={};Po(nGs,{AiChatConfig:()=>fRa,AiChatModel:()=>aTo,AnalyticsConfig:()=>Vqo,AnnouncementConfig:()=>Qqo,ApiReferenceConfiguration:()=>BTo,ApiReferenceEndpointConfiguration:()=>RTo,ApiReferenceLayoutItem:()=>Fer,ApiReferencePackageConfiguration:()=>NTo,ApiReferencePackageConfigurationWithOptions:()=>FTo,ApiReferenceSectionConfiguration:()=>xTo,AudienceId:()=>ATo,BackgroundImageConfiguration:()=>fTo,BackgroundImageThemedConfig:()=>lTo,ChangelogConfiguration:()=>ITo,ChangelogFolderRelativePath:()=>i5n,ColorConfig:()=>xer,ColorThemedConfig:()=>dTo,ColorsConfiguration:()=>pTo,ContentAlignment:()=>OTo,CssConfig:()=>wTo,CustomDomain:()=>Wqo,DocsConfiguration:()=>x6d,DocsInstance:()=>Gqo,DocsTypographyConfig:()=>vTo,EditThisPageConfig:()=>$qo,ExperimentalConfig:()=>nTo,FeatureFlag:()=>lRa,FeatureFlagConfiguration:()=>Kqo,FontConfig:()=>u5n,FontConfigPath:()=>hTo,FontConfigVariant:()=>_To,FontDisplay:()=>yTo,FontStyle:()=>o5n,FontWeight:()=>a5n,FooterLinksConfig:()=>iTo,FullStoryAnalyticsConfig:()=>xqo,GithubEditThisPageConfig:()=>Hqo,GoogleAnalytics4Config:()=>Uqo,GtmConfig:()=>Lqo,HeaderPosition:()=>mTo,IntegrationsConfig:()=>jTo,IntercomConfig:()=>Nqo,JsConfig:()=>MTo,JsConfigOptions:()=>dRa,JsFileConfig:()=>ETo,JsFileConfigSettings:()=>DTo,JsRemoteConfig:()=>STo,JsScriptStrategy:()=>s5n,LayoutConfig:()=>PTo,LinkConfiguration:()=>c5n,LogoConfiguration:()=>cTo,MetadataConfig:()=>uTo,NavbarGithubConfig:()=>tTo,NavbarLink:()=>rTo,NavbarLinkConfig:()=>ABi,NavigationConfig:()=>MBi,NavigationItem:()=>EBi,PageConfiguration:()=>tNe,PlaygroundButtonSettings:()=>CTo,PlaygroundSettings:()=>Ner,PostHogConfig:()=>Fqo,ProductConfig:()=>Xqo,ProductFileConfig:()=>F6d,ProgrammingLanguage:()=>zqo,RedirectConfig:()=>sTo,Role:()=>Jqo,RoleId:()=>uki,SearchbarPlacement:()=>bTo,SectionConfiguration:()=>zTo,SegmentConfig:()=>Rqo,SnippetLanguageConfiguration:()=>Mgi,SnippetsConfiguration:()=>TTo,TabConfig:()=>DBi,TabId:()=>Rer,TabbedNavigationConfig:()=>eTo,TabbedNavigationItem:()=>kqo,TabsPlacement:()=>gTo,TwitterCardSetting:()=>oTo,UntabbedNavigationConfig:()=>Zqo,VersionAvailability:()=>Yqo,VersionConfig:()=>n5n,VersionFileConfig:()=>N6d,VersionedSnippetLanguageConfiguration:()=>qTo,WithFeatureFlags:()=>OF,WithPermissions:()=>gF});var zqo=Ci.enum_(["typescript","javascript","python","java","go","ruby","csharp","nodets","nodejs","dotnet","curl","jvm","ts","js"]);var Rqo=Ci.object({writeKey:Ci.property("write-key",Ci.string())});var xqo=Ci.object({orgId:Ci.property("org-id",Ci.string())});var Nqo=Ci.object({appId:Ci.property("app-id",Ci.string()),apiBase:Ci.property("api-base",Ci.string().optional())});var Fqo=Ci.object({apiKey:Ci.property("api-key",Ci.string()),endpoint:Ci.string().optional()});var Lqo=Ci.object({containerId:Ci.property("container-id",Ci.string())});var Uqo=Ci.object({measurementId:Ci.property("measurement-id",Ci.string())});var Vqo=Ci.object({segment:Rqo.optional(),fullstory:xqo.optional(),intercom:Nqo.optional(),posthog:Fqo.optional(),gtm:Lqo.optional(),ga4:Uqo.optional()});var Wqo=Ci.undiscriminatedUnion([Ci.string(),Ci.list(Ci.string())]);var Hqo=Ci.object({host:Ci.string().optional(),owner:Ci.string(),repo:Ci.string(),branch:Ci.string().optional()});var $qo=Ci.object({github:Hqo.optional()});var Gqo=Ci.object({url:Ci.string(),customDomain:Ci.property("custom-domain",Wqo.optional()),private:Ci.boolean().optional(),editThisPage:Ci.property("edit-this-page",$qo.optional())});var Qqo=Ci.object({message:Ci.string()});var uki=Ci.string();var Rer=Ci.string();var i5n=Ci.string();var Jqo=Ci.undiscriminatedUnion([uki,Ci.list(uki)]);var gF=Ci.object({viewers:Jqo.optional(),orphaned:Ci.boolean().optional()});var lRa=Ci.object({flag:Ci.string(),fallbackValue:Ci.property("fallback-value",Ci.unknown().optional()),match:Ci.unknown().optional()});var Kqo=Ci.undiscriminatedUnion([Ci.string(),lRa,Ci.list(lRa)]);var OF=Ci.object({featureFlag:Ci.property("feature-flag",Kqo.optional())});var DBi=Ci.object({displayName:Ci.property("display-name",Ci.string()),icon:Ci.string().optional(),slug:Ci.string().optional(),skipSlug:Ci.property("skip-slug",Ci.boolean().optional()),hidden:Ci.boolean().optional(),href:Ci.string().optional(),changelog:i5n.optional()}).extend(gF).extend(OF);var Yqo=Ci.enum_(["deprecated","ga","stable","beta"]);var n5n=Ci.object({displayName:Ci.property("display-name",Ci.string()),path:Ci.string(),slug:Ci.string().optional(),availability:Yqo.optional()}).extend(gF).extend(OF);var Xqo=Ci.object({displayName:Ci.property("display-name",Ci.string()),path:Ci.string(),subtitle:Ci.string().optional(),icon:Ci.string().optional(),image:Ci.string().optional(),slug:Ci.string().optional(),versions:Ci.list(n5n).optional()}).extend(gF).extend(OF);var tNe=Ci.object({page:Ci.string(),path:Ci.string(),slug:Ci.string().optional(),icon:Ci.string().optional(),hidden:Ci.boolean().optional(),noindex:Ci.boolean().optional()}).extend(gF).extend(OF);var Zqo=Ci.list(Ci.lazy(()=>EBi));var kqo=Ci.object({tab:Rer,layout:Ci.list(Ci.lazy(()=>EBi)).optional()});var eTo=Ci.list(kqo);var MBi=Ci.undiscriminatedUnion([Zqo,eTo]);var ABi=Ci.object({href:Ci.string().optional(),url:Ci.string().optional(),text:Ci.string().optional(),icon:Ci.string().optional(),rightIcon:Ci.string().optional(),rounded:Ci.boolean().optional()});var tTo=Ci.string();var rTo=Ci.union("type",{filled:ABi,outlined:ABi,minimal:ABi,github:Ci.object({value:tTo}),primary:ABi,secondary:ABi}).transform({transform:e=>e,untransform:e=>e});var iTo=Ci.object({github:Ci.string().optional(),twitter:Ci.string().optional(),x:Ci.string().optional(),linkedin:Ci.string().optional(),youtube:Ci.string().optional(),instagram:Ci.string().optional(),facebook:Ci.string().optional(),discord:Ci.string().optional(),slack:Ci.string().optional(),hackernews:Ci.string().optional(),medium:Ci.string().optional(),website:Ci.string().optional()});var nTo=Ci.object({mdxComponents:Ci.property("mdx-components",Ci.list(Ci.string()).optional()),disableStreamToggle:Ci.property("disable-stream-toggle",Ci.boolean().optional()),openapiParserV2:Ci.property("openapi-parser-v2",Ci.boolean().optional()),openapiParserV3:Ci.property("openapi-parser-v3",Ci.boolean().optional())});var aTo=Ci.enum_(["claude-3.5","claude-3.7","claude-4","command-a"]);var fRa=Ci.object({model:aTo.optional(),systemPrompt:Ci.property("system-prompt",Ci.string().optional())});var oTo=Ci.enum_(["summary","summary_large_image","app","player"]);var uTo=Ci.object({ogSiteName:Ci.property("og:site_name",Ci.string().optional()),ogTitle:Ci.property("og:title",Ci.string().optional()),ogDescription:Ci.property("og:description",Ci.string().optional()),ogUrl:Ci.property("og:url",Ci.string().optional()),ogImage:Ci.property("og:image",Ci.string().optional()),ogImageWidth:Ci.property("og:image:width",Ci.number().optional()),ogImageHeight:Ci.property("og:image:height",Ci.number().optional()),ogLocale:Ci.property("og:locale",Ci.string().optional()),ogLogo:Ci.property("og:logo",Ci.string().optional()),twitterTitle:Ci.property("twitter:title",Ci.string().optional()),twitterDescription:Ci.property("twitter:description",Ci.string().optional()),twitterHandle:Ci.property("twitter:handle",Ci.string().optional()),twitterImage:Ci.property("twitter:image",Ci.string().optional()),twitterSite:Ci.property("twitter:site",Ci.string().optional()),twitterUrl:Ci.property("twitter:url",Ci.string().optional()),twitterCard:Ci.property("twitter:card",oTo.optional())});var sTo=Ci.object({source:Ci.string(),destination:Ci.string(),permanent:Ci.boolean().optional()});var cTo=Ci.object({dark:Ci.string().optional(),light:Ci.string().optional(),height:Ci.number().optional(),href:Ci.string().optional()});var lTo=Ci.object({dark:Ci.string().optional(),light:Ci.string().optional()});var fTo=Ci.undiscriminatedUnion([Ci.string(),lTo]);var dTo=Ci.object({dark:Ci.string().optional(),light:Ci.string().optional()});var xer=Ci.undiscriminatedUnion([Ci.string(),dTo]);var pTo=Ci.object({accentPrimary:Ci.property("accent-primary",xer.optional()),accentPrimaryDeprecated:Ci.property("accentPrimary",xer.optional()),background:xer.optional(),border:xer.optional(),sidebarBackground:Ci.property("sidebar-background",xer.optional()),headerBackground:Ci.property("header-background",xer.optional()),cardBackground:Ci.property("card-background",xer.optional())});var a5n=Ci.undiscriminatedUnion([Ci.string(),Ci.number()]);var o5n=Ci.enum_(["normal","italic"]);var _To=Ci.object({path:Ci.string(),weight:a5n.optional(),style:o5n.optional()});var hTo=Ci.undiscriminatedUnion([Ci.string(),_To]);var yTo=Ci.enum_(["auto","block","swap","fallback","optional"]);var u5n=Ci.object({name:Ci.string().optional(),path:Ci.string().optional(),weight:a5n.optional(),style:o5n.optional(),paths:Ci.list(hTo).optional(),display:yTo.optional(),fallback:Ci.list(Ci.string()).optional(),fontVariationSettings:Ci.property("font-variation-settings",Ci.string().optional())});var vTo=Ci.object({headingsFont:u5n.optional(),bodyFont:u5n.optional(),codeFont:u5n.optional()});var bTo=Ci.enum_(["header","header-tabs","sidebar"]);var gTo=Ci.enum_(["header","sidebar"]);var OTo=Ci.enum_(["center","left"]);var mTo=Ci.enum_(["fixed","static"]);var PTo=Ci.object({pageWidth:Ci.property("page-width",Ci.string().optional()),contentWidth:Ci.property("content-width",Ci.string().optional()),sidebarWidth:Ci.property("sidebar-width",Ci.string().optional()),headerHeight:Ci.property("header-height",Ci.string().optional()),searchbarPlacement:Ci.property("searchbar-placement",bTo.optional()),tabsPlacement:Ci.property("tabs-placement",gTo.optional()),contentAlignment:Ci.property("content-alignment",OTo.optional()),headerPosition:Ci.property("header-position",mTo.optional()),disableHeader:Ci.property("disable-header",Ci.boolean().optional())});var jTo=Ci.object({intercom:Ci.string().optional()});var wTo=Ci.undiscriminatedUnion([Ci.string(),Ci.list(Ci.string())]);var s5n=Ci.enum_(["beforeInteractive","afterInteractive","lazyOnload"]);var STo=Ci.object({url:Ci.string(),strategy:s5n.optional()});var DTo=Ci.object({path:Ci.string(),strategy:s5n.optional()});var ETo=Ci.undiscriminatedUnion([Ci.string(),DTo]);var dRa=Ci.undiscriminatedUnion([STo,ETo]);var MTo=Ci.undiscriminatedUnion([dRa,Ci.list(dRa)]);var x6d=Ci.object({instances:Ci.list(Gqo),title:Ci.string().optional(),analytics:Vqo.optional(),announcement:Qqo.optional(),roles:Ci.list(uki).optional(),tabs:Ci.record(Rer,DBi).optional(),versions:Ci.list(n5n).optional(),products:Ci.list(Xqo).optional(),landingPage:Ci.property("landing-page",tNe.optional()),navigation:MBi.optional(),navbarLinks:Ci.property("navbar-links",Ci.list(rTo).optional()),footerLinks:Ci.property("footer-links",iTo.optional()),experimental:nTo.optional(),defaultLanguage:Ci.property("default-language",zqo.optional()),aiChat:Ci.property("ai-chat",fRa.optional()),aiSearch:Ci.property("ai-search",fRa.optional()),metadata:uTo.optional(),redirects:Ci.list(sTo).optional(),logo:cTo.optional(),favicon:Ci.string().optional(),backgroundImage:Ci.property("background-image",fTo.optional()),colors:pTo.optional(),typography:vTo.optional(),layout:PTo.optional(),integrations:jTo.optional(),css:wTo.optional(),js:MTo.optional()});var N6d=Ci.object({tabs:Ci.record(Rer,DBi).optional(),landingPage:Ci.property("landing-page",tNe.optional()),navigation:MBi});var ATo=Ci.string();var qTo=Ci.object({version:Ci.string(),package:Ci.string()});var Mgi=Ci.undiscriminatedUnion([Ci.string(),qTo]);var TTo=Ci.object({python:Mgi.optional(),typescript:Mgi.optional(),go:Mgi.optional(),java:Mgi.optional(),ruby:Mgi.optional(),csharp:Mgi.optional()});var CTo=Ci.object({href:Ci.string().optional()});var Ner=Ci.object({environments:Ci.list(Ci.string()).optional(),button:CTo.optional(),oauth:Ci.boolean().optional(),limitWebsocketMessagesPerConnection:Ci.property("limit-websocket-messages-per-connection",Ci.number().optional())});var BTo=Ci.object({api:Ci.string(),apiName:Ci.property("api-name",Ci.string().optional()),openrpc:Ci.string().optional(),audiences:Ci.list(ATo).optional(),displayErrors:Ci.property("display-errors",Ci.boolean().optional()),snippets:TTo.optional(),summary:Ci.string().optional(),layout:Ci.list(Ci.lazy(()=>Fer)).optional(),icon:Ci.string().optional(),slug:Ci.string().optional(),hidden:Ci.boolean().optional(),skipSlug:Ci.property("skip-slug",Ci.boolean().optional()),alphabetized:Ci.boolean().optional(),flattened:Ci.boolean().optional(),paginated:Ci.boolean().optional(),playground:Ner.optional()}).extend(gF).extend(OF);var c5n=Ci.object({link:Ci.string(),href:Ci.string(),icon:Ci.string().optional()});var ITo=Ci.object({changelog:i5n,title:Ci.string().optional(),slug:Ci.string().optional(),icon:Ci.string().optional(),hidden:Ci.boolean().optional()}).extend(gF).extend(OF);var EBi=Ci.undiscriminatedUnion([tNe,Ci.lazyObject(()=>zTo),BTo,c5n,ITo]);var zTo=Ci.object({section:Ci.string(),path:Ci.string().optional(),contents:Ci.list(Ci.lazy(()=>EBi)),collapsed:Ci.boolean().optional(),slug:Ci.string().optional(),icon:Ci.string().optional(),hidden:Ci.boolean().optional(),skipSlug:Ci.property("skip-slug",Ci.boolean().optional())}).extend(gF).extend(OF);var RTo=Ci.object({endpoint:Ci.string(),title:Ci.string().optional(),slug:Ci.string().optional(),icon:Ci.string().optional(),hidden:Ci.boolean().optional(),playground:Ner.optional()}).extend(gF).extend(OF);var Fer=Ci.undiscriminatedUnion([Ci.string(),Ci.record(Ci.string(),Ci.lazy(()=>NTo)),Ci.lazyObject(()=>xTo),RTo,tNe,c5n]);var xTo=Ci.object({section:Ci.string(),referencedPackages:Ci.property("referenced-packages",Ci.list(Ci.string()).optional()),summary:Ci.string().optional(),contents:Ci.list(Ci.lazy(()=>Fer)).optional(),slug:Ci.string().optional(),icon:Ci.string().optional(),hidden:Ci.boolean().optional(),skipSlug:Ci.property("skip-slug",Ci.boolean().optional()),playground:Ner.optional()}).extend(gF).extend(OF);var NTo=Ci.undiscriminatedUnion([Ci.list(Ci.lazy(()=>Fer)),Ci.lazyObject(()=>FTo)]);var FTo=Ci.object({title:Ci.string().optional(),summary:Ci.string().optional(),contents:Ci.list(Ci.lazy(()=>Fer)).optional(),slug:Ci.string().optional(),icon:Ci.string().optional(),hidden:Ci.boolean().optional(),skipSlug:Ci.property("skip-slug",Ci.boolean().optional()),playground:Ner.optional()}).extend(gF).extend(OF);var F6d=Ci.object({tabs:Ci.record(Rer,DBi).optional(),landingPage:Ci.property("landing-page",tNe.optional()),navigation:MBi});var Bh={};Po(Bh,{API_ORIGIN_LOCATION_KEY:()=>C4d,API_SETTINGS_KEY:()=>MzS,ASYNC_API_LOCATION_KEY:()=>B4d,DEFAULT_GROUP_GENERATORS_CONFIG_KEY:()=>I4d,DEFAULT_GROUP_NAME:()=>tRa,FormParameterEncoding:()=>$6d,GenerationLanguage:()=>L6d,GithubCommitAndReleaseMode:()=>G6d,GithubLicenseType:()=>Q6d,MessageNamingSettingsSchema:()=>H6d,OPENAPI_LOCATION_KEY:()=>z4d,OPENAPI_OVERRIDES_LOCATION_KEY:()=>EzS,UnionSettingsSchema:()=>W6d,fernDefinition:()=>lGs,generators:()=>oGs,getPackageName:()=>U6d,group:()=>uGs,isApiConfigurationV2Schema:()=>R4d,isAsyncApiSpecSchema:()=>x4d,isConjureSchema:()=>N4d,isNamespacedApiConfiguration:()=>F4d,isOpenApiSpecSchema:()=>L4d,isOpenRpcSpecSchema:()=>U4d,isProtoSpecSchema:()=>V4d,isRawProtobufAPIDefinitionSchema:()=>V6d,license:()=>sGs,reviewers:()=>J6d,serialization:()=>AGs});var L6d={TYPESCRIPT:"typescript",JAVA:"java",PYTHON:"python",GO:"go",RUBY:"ruby",CSHARP:"csharp",SWIFT:"swift",PHP:"php",RUST:"rust"};function U6d({generatorInvocation:e}){return e.language==="go"?mzS(e):e.outputMode._visit({downloadFiles:()=>{},github:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,_other:()=>{}}),githubV2:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,_other:()=>{}}),publish:()=>{},publishV2:()=>{},_other:()=>{}})}function mzS(e){return e.outputMode._visit({downloadFiles:()=>{},github:t=>`github.com/${t.owner}/${t.repo}`,githubV2:t=>`github.com/${t.owner}/${t.repo}`,publish:()=>{},publishV2:()=>{},_other:()=>{}})}function V6d(e){return typeof e!="string"&&"proto"in e}var oGs={};Po(oGs,{FormParameterEncoding:()=>$6d,MessageNamingSettingsSchema:()=>H6d,UnionSettingsSchema:()=>W6d});var W6d={V1:"v1"};var H6d={V1:"v1",V2:"v2"};var $6d={Form:"form",Json:"json"};var uGs={};Po(uGs,{GithubCommitAndReleaseMode:()=>G6d});var G6d={Commit:"commit",Release:"release"};var sGs={};Po(sGs,{GithubLicenseType:()=>Q6d});var Q6d={Mit:"MIT",Apache:"Apache-2.0"};var J6d={};var lGs={};Po(lGs,{AvailabilityStatusSchema:()=>Y6d,auth:()=>K6d,availability:()=>cGs,commons:()=>X6d,encoding:()=>Z6d,environments:()=>k6d,file:()=>e4d,service:()=>t4d,types:()=>r4d,validation:()=>i4d});var K6d={};var cGs={};Po(cGs,{AvailabilityStatusSchema:()=>Y6d});var Y6d={InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",GenerallyAvailable:"generally-available"};var X6d={};var Z6d={};var k6d={};var e4d={};var t4d={};var r4d={};var i4d={};var AGs={};Po(AGs,{ApiConfigurationSchema:()=>VCo,ApiConfigurationSchemaInternal:()=>b5n,ApiConfigurationV2Schema:()=>UCo,ApiConfigurationV2SpecsSchema:()=>PCo,ApiDefinitionList:()=>sCo,ApiDefinitionPathSchema:()=>BBi,ApiDefinitionSchema:()=>uCo,ApiDefinitionSettingsSchema:()=>IBi,ApiDefinitionWithOverridesSchema:()=>h5n,AsyncApiSettingsSchema:()=>yCo,AsyncApiSpecSchema:()=>vCo,BaseApiSettingsSchema:()=>m5n,ConjureSchema:()=>mCo,CratesOutputLocationSchema:()=>iBo,FormParameterEncoding:()=>dCo,GeneratorApiSettingsSchema:()=>_Bo,GeneratorGroupSchema:()=>yBo,GeneratorInvocationSchema:()=>hBo,GeneratorOutputSchema:()=>nBo,GeneratorPublishMetadataSchema:()=>gRa,GeneratorSnippetsSchema:()=>pBo,GeneratorsConfigurationSchema:()=>T4d,GeneratorsOpenApiObjectSchema:()=>vBo,GeneratorsOpenApiSchema:()=>bBo,GithubCommitAndReleaseMode:()=>sBo,GithubCommitAndReleaseSchema:()=>cBo,GithubConfigurationSchema:()=>dBo,GithubLicenseCustomSchema:()=>uBo,GithubLicenseSchema:()=>Ler,GithubLicenseType:()=>oBo,GithubPullRequestSchema:()=>lBo,GithubPushSchema:()=>fBo,GithubSelfhostedSchema:()=>aBo,LocalFileSystemOutputLocationSchema:()=>eBo,MavenOutputLocationSchema:()=>YCo,MavenOutputSignatureSchema:()=>KCo,MessageNamingSettingsSchema:()=>_5n,NamespacedApiConfigurationSchema:()=>cCo,NpmOutputLocationSchema:()=>JCo,NugetOutputLocationSchema:()=>tBo,OpenApiExampleGenerationSchema:()=>_Co,OpenApiFilterSchema:()=>pCo,OpenApiSettingsSchema:()=>P5n,OpenApiSpecSchema:()=>hCo,OpenRpcSpecSchema:()=>gCo,OutputMetadataAuthor:()=>$Co,OutputMetadataSchema:()=>RBi,PostmanOutputLocationSchema:()=>kCo,ProtobufApiDefinitionSchema:()=>v5n,ProtobufDefinitionSchema:()=>y5n,ProtobufSpecSchema:()=>bCo,PypiOutputLocationSchema:()=>ZCo,PypiOutputMetadataSchema:()=>XCo,ReadmeEndpointObjectSchema:()=>GCo,ReadmeEndpointSchema:()=>vRa,ReadmeSchema:()=>QCo,RequestOrResponseExampleGenerationSchema:()=>yRa,ReviewerSchema:()=>bRa,ReviewersSchema:()=>xBi,RubyGemsOutputLocationSchema:()=>rBo,SpecSchema:()=>OCo,UnionSettingsSchema:()=>oCo,WhitelabelConfigurationSchema:()=>HCo,WhitelabelGithubConfigurationSchema:()=>WCo,fernDefinition:()=>MGs,generators:()=>hGs,group:()=>yGs,license:()=>vGs,reviewers:()=>bGs});var hGs={};Po(hGs,{ApiConfigurationSchema:()=>VCo,ApiConfigurationSchemaInternal:()=>b5n,ApiConfigurationV2Schema:()=>UCo,ApiConfigurationV2SpecsSchema:()=>PCo,ApiDefinitionList:()=>sCo,ApiDefinitionPathSchema:()=>BBi,ApiDefinitionSchema:()=>uCo,ApiDefinitionSettingsSchema:()=>IBi,ApiDefinitionWithOverridesSchema:()=>h5n,AsyncApiSettingsSchema:()=>yCo,AsyncApiSpecSchema:()=>vCo,BaseApiSettingsSchema:()=>m5n,ConjureSchema:()=>mCo,FormParameterEncoding:()=>dCo,GeneratorsConfigurationSchema:()=>T4d,GeneratorsOpenApiObjectSchema:()=>vBo,GeneratorsOpenApiSchema:()=>bBo,MessageNamingSettingsSchema:()=>_5n,NamespacedApiConfigurationSchema:()=>cCo,OpenApiExampleGenerationSchema:()=>_Co,OpenApiFilterSchema:()=>pCo,OpenApiSettingsSchema:()=>P5n,OpenApiSpecSchema:()=>hCo,OpenRpcSpecSchema:()=>gCo,OutputMetadataAuthor:()=>$Co,OutputMetadataSchema:()=>RBi,ProtobufApiDefinitionSchema:()=>v5n,ProtobufDefinitionSchema:()=>y5n,ProtobufSpecSchema:()=>bCo,ReadmeEndpointObjectSchema:()=>GCo,ReadmeEndpointSchema:()=>vRa,ReadmeSchema:()=>QCo,RequestOrResponseExampleGenerationSchema:()=>yRa,SpecSchema:()=>OCo,UnionSettingsSchema:()=>oCo,WhitelabelConfigurationSchema:()=>HCo,WhitelabelGithubConfigurationSchema:()=>WCo});var Gi={};Po(Gi,{JsonError:()=>l5n,ParseError:()=>f5n,any:()=>b4d,bigint:()=>a4d,boolean:()=>g4d,booleanLiteral:()=>v4d,date:()=>o4d,discriminant:()=>M4d,enum_:()=>UTo,getObjectLikeUtils:()=>v$t,getObjectUtils:()=>ski,getSchemaUtils:()=>AA,isProperty:()=>TBi,lazy:()=>u4d,lazyObject:()=>_4d,list:()=>WTo,number:()=>O4d,object:()=>VTo,objectWithoutOptionalProperties:()=>p4d,optional:()=>fGs,property:()=>c4d,record:()=>w4d,set:()=>S4d,string:()=>m4d,stringLiteral:()=>y4d,transform:()=>dGs,undiscriminatedUnion:()=>E4d,union:()=>q4d,unknown:()=>P4d,withParsedProperties:()=>_Gs});var jm={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function MA(e,t){return`Expected ${t}. Received ${PzS(e)}.`}function PzS(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function nL(e){return{...e,json:n4d(e.json),parse:n4d(e.parse)}}function n4d(e){return(t,r)=>{let i=e(t,r),{skipValidation:n=!1}=r??{};return!i.ok&&n?(console.warn(["Failed to validate.",...i.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
1632
|
-
`)),{ok:!0,value:t}):i}}function LTo(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var l5n=class e extends Error{errors;constructor(t){super(t.map(LTo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var f5n=class e extends Error{errors;constructor(t){super(t.map(LTo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function AA(e){return{nullable:()=>jzS(e),optional:()=>fGs(e),optionalNullable:()=>wzS(e),transform:t=>dGs(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new f5n(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new l5n(i.errors)}}}function jzS(e){let t={parse:(r,i)=>r==null?{ok:!0,value:null}:e.parse(r,i),json:(r,i)=>r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>jm.NULLABLE};return{...t,...AA(t)}}function fGs(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>jm.OPTIONAL};return{...t,...AA(t)}}function wzS(e){let t={parse:(r,i)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,i),json:(r,i)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,i),getType:()=>jm.OPTIONAL_NULLABLE};return{...t,...AA(t)}}function dGs(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(i,n)=>{let a=t.untransform(i);return e.json(a,n)},getType:()=>e.getType()};return{...r,...AA(r)}}function a4d(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:MA(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:MA(t,"bigint")}]}:{ok:!0,value:t},getType:()=>jm.BIGINT};return{...nL(e),...AA(e)}}var SzS=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function o4d(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:MA(t,"string")}]}:SzS.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:MA(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:MA(t,"Date object")}]},getType:()=>jm.DATE};return{...nL(e),...AA(e)}}function lJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...nL(r),...AA(r)}}}function UTo(e){let t=new Set(e);return lJ(jm.ENUM,(i,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:a=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:a,message:MA(i,"string")}]}:!t.has(i)&&!n?{ok:!1,errors:[{path:a,message:MA(i,"enum")}]}:{ok:!0,value:i})()}function u4d(e){let t=pGs(e);return{...t,...AA(t)}}function pGs(e){return{parse:(t,r)=>d5n(e).parse(t,r),json:(t,r)=>d5n(e).json(t,r),getType:()=>d5n(e).getType()}}function d5n(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function pRa(e){return Object.entries(e)}function _Ra(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[n,a])=>(r.has(n)&&(i[n]=a),i),{})}function qBi(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function hRa(e){return Object.keys(e)}function s4d(e,t){let r=[],i=[];for(let n of e)t(n)?r.push(n):i.push(n);return[r,i]}function v$t(e){return{withParsedProperties:t=>_Gs(e,t)}}function _Gs(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);if(!a.ok)return a;let u=Object.entries(t).reduce((l,[d,s])=>({...l,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(i,n)=>{if(!qBi(i))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:MA(i,"object")}]};let a=new Set(Object.keys(t)),u=_Ra(i,Object.keys(i).filter(l=>!a.has(l)));return e.json(u,n)},getType:()=>e.getType()};return{...r,...AA(r),...v$t(r)}}function c4d(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function TBi(e){return e.isProperty}function VTo(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,i])=>TBi(i)?i.rawKey:r),_getParsedProperties:()=>hRa(e),parse:(r,i)=>{let n={},a=[];for(let[u,l]of pRa(e)){let d=TBi(l)?l.rawKey:u,s=TBi(l)?l.valueSchema:l,o={rawKey:d,parsedKey:u,valueSchema:s};n[d]=o,d4d(s)&&a.push(d)}return l4d({value:r,requiredKeys:a,getProperty:u=>{let l=n[u];if(l!=null)return{transformedKey:l.parsedKey,transform:d=>l.valueSchema.parse(d,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},json:(r,i)=>{let n=[];for(let[a,u]of pRa(e)){let l=TBi(u)?u.valueSchema:u;d4d(l)&&n.push(a)}return l4d({value:r,requiredKeys:n,getProperty:a=>{let u=e[a];if(u!=null)return TBi(u)?{transformedKey:u.rawKey,transform:l=>u.valueSchema.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:l=>u.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},getType:()=>jm.OBJECT};return{...nL(t),...AA(t),...v$t(t),...ski(t)}}function l4d({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:i="fail",skipValidation:n=!1,breadcrumbsPrefix:a=[]}){if(!qBi(e))return{ok:!1,errors:[{path:a,message:MA(e,"object")}]};let u=new Set(t),l=[],d={};for(let[s,o]of Object.entries(e)){let c=r(s);if(c!=null){u.delete(s);let b=c.transform(o);b.ok?d[c.transformedKey]=b.value:(d[s]=o,l.push(...b.errors))}else switch(i){case"fail":l.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=o;break}}return l.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),l.length===0||n?{ok:!0,value:d}:{ok:!1,errors:l}}function ski(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,n)=>f4d({extensionKeys:t._getRawProperties(),value:i,transformBase:a=>e.parse(a,n),transformExtension:a=>t.parse(a,n)}),json:(i,n)=>f4d({extensionKeys:t._getParsedProperties(),value:i,transformBase:a=>e.json(a,n),transformExtension:a=>t.json(a,n)}),getType:()=>jm.OBJECT};return{...r,...AA(r),...v$t(r),...ski(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,i)=>{let n=e.parse(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},json:(r,i)=>{let n=e.json(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},getType:()=>jm.OBJECT};return{...t,...AA(t),...v$t(t),...ski(t)}}}}function f4d({extensionKeys:e,value:t,transformBase:r,transformExtension:i}){let n=new Set(e),[a,u]=s4d(hRa(t),s=>n.has(s)),l=r(_Ra(t,u)),d=i(_Ra(t,a));return l.ok&&d.ok?{ok:!0,value:{...l.value,...d.value}}:{ok:!1,errors:[...l.ok?[]:l.errors,...d.ok?[]:d.errors]}}function d4d(e){return!DzS(e)}function DzS(e){switch(e.getType()){case jm.ANY:case jm.UNKNOWN:case jm.OPTIONAL:case jm.OPTIONAL_NULLABLE:return!0;default:return!1}}function p4d(e){return VTo(e)}function _4d(e){let t={...pGs(e),_getRawProperties:()=>d5n(e)._getRawProperties(),_getParsedProperties:()=>d5n(e)._getParsedProperties()};return{...t,...AA(t),...v$t(t),...ski(t)}}function WTo(e){let t={parse:(r,i)=>h4d(r,(n,a)=>e.parse(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,i)=>h4d(r,(n,a)=>e.json(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>jm.LIST};return{...nL(t),...AA(t)}}function h4d(e,t){return Array.isArray(e)?e.map((i,n)=>t(i,n)).reduce((i,n)=>{if(i.ok&&n.ok)return{ok:!0,value:[...i.value,n.value]};let a=[];return i.ok||a.push(...i.errors),n.ok||a.push(...n.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:MA(e,"list"),path:[]}]}}function y4d(e){return lJ(jm.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:MA(r,`"${e}"`)}]})()}function v4d(e){return lJ(jm.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:MA(r,`${e.toString()}`)}]})()}var b4d=lJ(jm.ANY,e=>({ok:!0,value:e}));var g4d=lJ(jm.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:MA(e,"boolean")}]});var O4d=lJ(jm.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:MA(e,"number")}]});var m4d=lJ(jm.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:MA(e,"string")}]});var P4d=lJ(jm.UNKNOWN,e=>({ok:!0,value:e}));function w4d(e,t){let r={parse:(i,n)=>j4d({value:i,isKeyNumeric:e.getType()===jm.NUMBER,transformKey:a=>e.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(i,n)=>j4d({value:i,isKeyNumeric:e.getType()===jm.NUMBER,transformKey:a=>e.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>jm.RECORD};return{...nL(r),...AA(r)}}function j4d({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:n=[]}){return qBi(e)?pRa(e).reduce((a,[u,l])=>{if(l===void 0)return a;let d=a,s=u;if(t){let g=u.length>0?Number(u):NaN;isNaN(g)||(s=g)}let o=r(s),c=i(l,s);if(d.ok&&o.ok&&c.ok)return{ok:!0,value:{...d.value,[o.value]:c.value}};let b=[];return d.ok||b.push(...d.errors),o.ok||b.push(...o.errors),c.ok||b.push(...c.errors),{ok:!1,errors:b}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:MA(e,"object")}]}}function S4d(e){let t=WTo(e),r={parse:(i,n)=>{let a=t.parse(i,n);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(i,n)=>i instanceof Set?t.json([...i],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:MA(i,"Set")}]},getType:()=>jm.SET};return{...nL(r),...AA(r)}}function E4d(e){let t={parse:(r,i)=>D4d((n,a)=>n.parse(r,a),e,i),json:(r,i)=>D4d((n,a)=>n.json(r,a),e,i),getType:()=>jm.UNDISCRIMINATED_UNION};return{...nL(t),...AA(t)}}function D4d(e,t,r){let i=[];for(let[n,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let l of u.errors)i.push({path:l.path,message:`[Variant ${n}] ${l.message}`})}return{ok:!1,errors:i}}function M4d(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function q4d(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,n=UTo(hRa(t)),a={parse:(u,l)=>A4d({value:u,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:d=>n.parse(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),json:(u,l)=>A4d({value:u,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:d=>n.json(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),getType:()=>jm.UNION};return{...nL(a),...AA(a),...v$t(a)}}function A4d({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:l=[]}){if(!qBi(e))return{ok:!1,errors:[{path:l,message:MA(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:l,message:`Missing discriminant ("${t}")`}]};let o=i(d);if(!o.ok)return{ok:!1,errors:o.errors};let c=n(o.value);if(c==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...l,t],message:"Unexpected discriminant value"}]};let b=u(s,c);return b.ok?{ok:!0,value:{[r]:d,...b.value}}:b}var HTo=Gi.object({"client-id":Gi.string().optional(),"client-secret":Gi.string().optional(),scopes:Gi.string().optional()});var $To=Gi.object({"access-token":Gi.string().optional(),"expires-in":Gi.string().optional(),"refresh-token":Gi.string().optional()});var GTo=Gi.object({endpoint:Gi.string(),"request-properties":HTo.optional(),"response-properties":$To.optional()});var QTo=Gi.object({"refresh-token":Gi.string()});var JTo=Gi.object({"access-token":Gi.string().optional(),"expires-in":Gi.string().optional(),"refresh-token":Gi.string().optional()});var KTo=Gi.object({endpoint:Gi.string(),"request-properties":QTo.optional(),"response-properties":JTo.optional()});var mF=Gi.object({docs:Gi.string().optional()});var YTo=Gi.object({scheme:Gi.stringLiteral("oauth"),type:Gi.stringLiteral("client-credentials"),scopes:Gi.list(Gi.string()).optional(),"client-id-env":Gi.string().optional(),"client-secret-env":Gi.string().optional(),"token-prefix":Gi.string().optional(),"token-header":Gi.string().optional(),"get-token":GTo,"refresh-token":KTo.optional()}).extend(mF);var p5n=Gi.object({env:Gi.string().optional()});var CBi=Gi.object({name:Gi.string().optional()});var XTo=Gi.object({header:Gi.string(),type:Gi.string().optional(),prefix:Gi.string().optional()}).extend(p5n).extend(CBi).extend(mF);var cki=Gi.object({}).extend(p5n).extend(CBi);var ZTo=Gi.object({scheme:Gi.stringLiteral("basic"),username:cki.optional(),password:cki.optional()}).extend(mF);var kTo=Gi.object({scheme:Gi.stringLiteral("bearer"),token:cki.optional()}).extend(mF);var eCo=Gi.object({"response-property":Gi.string(),"header-name":Gi.string(),"value-prefix":Gi.string().optional()});var tCo=Gi.object({endpoint:Gi.string(),"expiry-response-property":Gi.string().optional(),"authenticated-request-headers":Gi.list(eCo).optional()});var rCo=Gi.undiscriminatedUnion([Gi.string(),tCo]);var iCo=Gi.object({scheme:Gi.stringLiteral("bearer"),"get-token":rCo}).extend(mF);var nCo=Gi.undiscriminatedUnion([kTo,iCo]);var aCo=Gi.undiscriminatedUnion([YTo,XTo,ZTo,nCo]);var BBi=Gi.string();var oCo=Gi.enum_(["v1"]);var _5n=Gi.enum_(["v1","v2"]);var IBi=Gi.object({"use-title":Gi.boolean().optional(),unions:oCo.optional(),"message-naming":_5n.optional(),"respect-nullable-schemas":Gi.boolean().optional(),"only-include-referenced-schemas":Gi.boolean().optional(),"inline-path-parameters":Gi.boolean().optional(),"idiomatic-request-names":Gi.boolean().optional()});var h5n=Gi.object({path:BBi,origin:Gi.string().optional(),overrides:Gi.string().optional(),audiences:Gi.list(Gi.string()).optional(),settings:IBi.optional()});var y5n=Gi.object({target:Gi.string().optional(),root:Gi.string(),overrides:Gi.string().optional(),"local-generation":Gi.boolean().optional(),"from-openapi":Gi.boolean().optional(),dependencies:Gi.list(Gi.string()).optional()});var v5n=Gi.object({proto:y5n});var uCo=Gi.undiscriminatedUnion([BBi,h5n,v5n]);var sCo=Gi.list(uCo);var b5n=Gi.undiscriminatedUnion([BBi,h5n,sCo,v5n]);var cCo=Gi.object({namespaces:Gi.record(Gi.string(),b5n)});var g5n=Gi.object({scheme:Gi.string()}).extend(mF);var lCo=Gi.undiscriminatedUnion([Gi.string(),g5n]);var fCo=Gi.object({any:Gi.list(lCo)}).extend(mF);var O5n=Gi.undiscriminatedUnion([Gi.string(),g5n,fCo]);var dCo=Gi.enum_(["form","json"]);var pCo=Gi.object({endpoints:Gi.list(Gi.string()).optional()});var yRa=Gi.object({"max-depth":Gi.number().optional()});var _Co=Gi.object({request:yRa.optional(),response:yRa.optional()});var m5n=Gi.object({"respect-nullable-schemas":Gi.boolean().optional(),"title-as-schema-name":Gi.boolean().optional(),"optional-additional-properties":Gi.boolean().optional(),"coerce-enums-to-literals":Gi.boolean().optional(),"idiomatic-request-names":Gi.boolean().optional()});var P5n=Gi.object({"only-include-referenced-schemas":Gi.boolean().optional(),"inline-path-parameters":Gi.boolean().optional(),"prefer-undiscriminated-unions-with-literals":Gi.boolean().optional(),"object-query-parameters":Gi.boolean().optional(),"respect-readonly-schemas":Gi.boolean().optional(),"respect-forward-compatible-enums":Gi.boolean().optional(),"use-bytes-for-binary-response":Gi.boolean().optional(),"default-form-parameter-encoding":dCo.optional(),filter:pCo.optional(),"example-generation":_Co.optional(),"additional-properties-defaults-to":Gi.boolean().optional(),"type-dates-as-strings":Gi.boolean().optional(),"preserve-single-schema-oneof":Gi.boolean().optional(),"inline-all-of-schemas":Gi.boolean().optional()}).extend(m5n);var hCo=Gi.object({openapi:Gi.string(),origin:Gi.string().optional(),overrides:Gi.string().optional(),namespace:Gi.string().optional(),settings:P5n.optional()});var yCo=Gi.object({"message-naming":_5n.optional()}).extend(m5n);var vCo=Gi.object({asyncapi:Gi.string(),origin:Gi.string().optional(),overrides:Gi.string().optional(),namespace:Gi.string().optional(),settings:yCo.optional()});var bCo=Gi.object({proto:y5n});var gCo=Gi.object({openrpc:Gi.string(),overrides:Gi.string().optional(),namespace:Gi.string().optional()});var OCo=Gi.undiscriminatedUnion([hCo,vCo,bCo,gCo]);var mCo=Gi.object({conjure:Gi.string()});var PCo=Gi.undiscriminatedUnion([Gi.list(OCo),mCo]);var jCo=Gi.object({type:Gi.string()});var wCo=Gi.object({proto:jCo.optional()});var SCo=Gi.object({minLength:Gi.number().optional(),maxLength:Gi.number().optional(),pattern:Gi.string().optional(),format:Gi.string().optional()});var DCo=Gi.object({min:Gi.number().optional(),max:Gi.number().optional(),exclusiveMin:Gi.boolean().optional(),exclusiveMax:Gi.boolean().optional(),multipleOf:Gi.number().optional()});var ECo=Gi.undiscriminatedUnion([SCo,DCo]);var j5n=Gi.enum_(["in-development","pre-release","deprecated","generally-available"]);var MCo=Gi.object({status:j5n,message:Gi.string().optional()});var ACo=Gi.undiscriminatedUnion([j5n,MCo]);var qCo=Gi.object({availability:ACo.optional()});var TCo=Gi.object({default:Gi.unknown().optional(),encoding:wCo.optional(),validation:ECo.optional()}).extend(mF).extend(qCo);var zBi=Gi.object({audiences:Gi.list(Gi.string()).optional()});var CCo=Gi.object({type:Gi.string()}).extend(TCo).extend(CBi).extend(zBi);var BCo=Gi.object({env:Gi.string().optional()}).extend(CCo);var ICo=Gi.undiscriminatedUnion([Gi.string(),BCo]);var zCo=ICo;var RCo=Gi.object({headers:Gi.record(Gi.string(),zCo).optional()});var xCo=Gi.object({url:Gi.string()}).extend(zBi).extend(mF);var NCo=Gi.object({urls:Gi.record(Gi.string(),Gi.string())}).extend(zBi).extend(mF);var FCo=Gi.undiscriminatedUnion([Gi.string(),xCo,NCo]);var LCo=Gi.object({"default-url":Gi.string().optional(),"default-environment":Gi.string().optional(),environments:Gi.record(Gi.string(),FCo).optional()});var UCo=Gi.object({auth:O5n.optional(),specs:PCo}).extend(RCo).extend(LCo);var VCo=Gi.undiscriminatedUnion([b5n,cCo,UCo]);var WCo=Gi.object({username:Gi.string(),email:Gi.string(),token:Gi.string()});var HCo=Gi.object({github:WCo.optional()});var $Co=Gi.object({name:Gi.string(),email:Gi.string()});var RBi=Gi.object({description:Gi.string().optional(),authors:Gi.list($Co).optional()});var GCo=Gi.object({method:Gi.string(),path:Gi.string(),stream:Gi.boolean().optional()});var vRa=Gi.undiscriminatedUnion([Gi.string(),GCo]);var QCo=Gi.object({bannerLink:Gi.string().optional(),introduction:Gi.string().optional(),apiReferenceLink:Gi.string().optional(),apiName:Gi.string().optional(),disabledSections:Gi.set(Gi.string()).optional(),defaultEndpoint:vRa.optional(),features:Gi.record(Gi.string(),Gi.list(vRa)).optional()});var JCo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),token:Gi.string().optional()});var KCo=Gi.object({keyId:Gi.string(),password:Gi.string(),secretKey:Gi.string()});var YCo=Gi.object({url:Gi.string().optional(),coordinate:Gi.string(),username:Gi.string().optional(),password:Gi.string().optional(),signature:KCo.optional()});var XCo=Gi.object({keywords:Gi.list(Gi.string()).optional(),"documentation-link":Gi.string().optional(),"homepage-link":Gi.string().optional()}).extend(RBi);var ZCo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),token:Gi.string().optional(),username:Gi.string().optional(),password:Gi.string().optional(),metadata:XCo.optional()});var kCo=Gi.object({"api-key":Gi.string(),"workspace-id":Gi.string(),"collection-id":Gi.string().optional()});var eBo=Gi.object({path:Gi.string()});var tBo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),"api-key":Gi.string().optional()});var rBo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),"api-key":Gi.string().optional()});var iBo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),token:Gi.string().optional()});var nBo=Gi.union("location",{npm:JCo,maven:YCo,pypi:ZCo,postman:kCo,"local-file-system":eBo,nuget:tBo,rubygems:rBo,crates:iBo}).transform({transform:e=>e,untransform:e=>e});var aBo=Gi.object({uri:Gi.string(),token:Gi.string()});var oBo=Gi.enum_(["MIT","Apache-2.0"]);var uBo=Gi.object({custom:Gi.string()});var Ler=Gi.undiscriminatedUnion([oBo,uBo]);var sBo=Gi.enum_(["commit","release"]);var cBo=Gi.object({repository:Gi.string(),license:Ler.optional(),mode:sBo.optional()});var bRa=Gi.object({name:Gi.string()});var xBi=Gi.object({teams:Gi.list(bRa).optional(),users:Gi.list(bRa).optional()});var lBo=Gi.object({repository:Gi.string(),branch:Gi.string().optional(),license:Ler.optional(),mode:Gi.stringLiteral("pull-request"),reviewers:xBi.optional()});var fBo=Gi.object({repository:Gi.string(),license:Ler.optional(),mode:Gi.stringLiteral("push"),branch:Gi.string().optional()});var dBo=Gi.undiscriminatedUnion([aBo,cBo,lBo,fBo]);var gRa=Gi.object({"package-description":Gi.string().optional(),email:Gi.string().optional(),"reference-url":Gi.string().optional(),author:Gi.string().optional(),license:Ler.optional()});var pBo=Gi.object({path:Gi.string()});var _Bo=Gi.object({auth:O5n.optional(),settings:IBi.optional()});var hBo=Gi.object({name:Gi.string(),version:Gi.string(),output:nBo.optional(),github:dBo.optional(),config:Gi.unknown(),metadata:gRa.optional(),keywords:Gi.list(Gi.string()).optional(),snippets:pBo.optional(),"ir-version":Gi.string().optional(),"smart-casing":Gi.boolean().optional(),api:_Bo.optional(),"disable-examples":Gi.boolean().optional(),"publish-metadata":gRa.optional()});var yBo=Gi.object({audiences:Gi.list(Gi.string()).optional(),generators:Gi.list(hBo),metadata:RBi.optional(),reviewers:xBi.optional()});var vBo=Gi.object({path:Gi.string(),origin:Gi.string().optional(),overrides:Gi.string().optional(),"disable-examples":Gi.boolean().optional(),settings:P5n});var bBo=Gi.undiscriminatedUnion([vBo,Gi.string()]);var T4d=Gi.object({"auth-schemes":Gi.record(Gi.string(),aCo).optional(),api:VCo.optional(),whitelabel:HCo.optional(),metadata:RBi.optional(),readme:QCo.optional(),"default-group":Gi.string().optional(),groups:Gi.record(Gi.string(),yBo).optional(),reviewers:xBi.optional(),openapi:bBo.optional(),"openapi-overrides":Gi.string().optional(),"spec-origin":Gi.string().optional(),"async-api":Gi.string().optional(),"api-settings":IBi.optional()});var yGs={};Po(yGs,{CratesOutputLocationSchema:()=>iBo,GeneratorApiSettingsSchema:()=>_Bo,GeneratorGroupSchema:()=>yBo,GeneratorInvocationSchema:()=>hBo,GeneratorOutputSchema:()=>nBo,GeneratorPublishMetadataSchema:()=>gRa,GeneratorSnippetsSchema:()=>pBo,GithubCommitAndReleaseMode:()=>sBo,GithubCommitAndReleaseSchema:()=>cBo,GithubConfigurationSchema:()=>dBo,GithubPullRequestSchema:()=>lBo,GithubPushSchema:()=>fBo,GithubSelfhostedSchema:()=>aBo,LocalFileSystemOutputLocationSchema:()=>eBo,MavenOutputLocationSchema:()=>YCo,MavenOutputSignatureSchema:()=>KCo,NpmOutputLocationSchema:()=>JCo,NugetOutputLocationSchema:()=>tBo,PostmanOutputLocationSchema:()=>kCo,PypiOutputLocationSchema:()=>ZCo,PypiOutputMetadataSchema:()=>XCo,RubyGemsOutputLocationSchema:()=>rBo});var vGs={};Po(vGs,{GithubLicenseCustomSchema:()=>uBo,GithubLicenseSchema:()=>Ler,GithubLicenseType:()=>oBo});var bGs={};Po(bGs,{ReviewerSchema:()=>bRa,ReviewersSchema:()=>xBi});var MGs={};Po(MGs,{AnyAuthItem:()=>lCo,AnyAuthSchemesSchema:()=>fCo,ApiAuthSchema:()=>O5n,AuthSchemeDeclarationSchema:()=>aCo,AuthSchemeReferenceSchema:()=>g5n,AuthVariable:()=>cki,AvailabilitySchema:()=>MCo,AvailabilityStatusSchema:()=>j5n,AvailabilityUnionSchema:()=>ACo,BaseTypeReferenceSchema:()=>TCo,BasicAuthSchemeSchema:()=>ZTo,BearerAuthSchemeSchema:()=>nCo,EncodingSchema:()=>wCo,EnvironmentSchema:()=>FCo,HeaderAuthSchemeSchema:()=>XTo,HttpHeaderSchema:()=>zCo,InferredAuthenticatedRequestHeader:()=>eCo,InferredBearerAuthSchema:()=>iCo,InferredGetTokenEndpointSchema:()=>rCo,InferredGetTokenEndpointSchemaObject:()=>tCo,MultipleBaseUrlsEnvironmentSchema:()=>NCo,NumberValidationSchema:()=>DCo,OAuthAccessTokenRequestPropertiesSchema:()=>HTo,OAuthAccessTokenResponsePropertiesSchema:()=>$To,OAuthGetTokenEndpointSchema:()=>GTo,OAuthRefreshTokenEndpointSchema:()=>KTo,OAuthRefreshTokenRequestPropertiesSchema:()=>QTo,OAuthRefreshTokenResponsePropertiesSchema:()=>JTo,OAuthSchemeSchema:()=>YTo,ProtobufTypeSchema:()=>jCo,SingleBaseUrlEnvironmentSchema:()=>xCo,StringValidationSchema:()=>SCo,TokenBearerAuthSchema:()=>kTo,TypeReferenceDeclarationWithEnvOverride:()=>ICo,TypeReferenceDeclarationWithEnvOverrideSchema:()=>BCo,TypeReferenceDeclarationWithName:()=>CCo,ValidationSchema:()=>ECo,WithAudiences:()=>zBi,WithAvailability:()=>qCo,WithDocsSchema:()=>mF,WithEnvironmentVariable:()=>p5n,WithEnvironmentsSchema:()=>LCo,WithHeadersSchema:()=>RCo,WithName:()=>CBi,auth:()=>gGs,availability:()=>OGs,commons:()=>mGs,encoding:()=>PGs,environments:()=>jGs,file:()=>wGs,service:()=>SGs,types:()=>DGs,validation:()=>EGs});var gGs={};Po(gGs,{AnyAuthItem:()=>lCo,AnyAuthSchemesSchema:()=>fCo,ApiAuthSchema:()=>O5n,AuthSchemeDeclarationSchema:()=>aCo,AuthSchemeReferenceSchema:()=>g5n,AuthVariable:()=>cki,BasicAuthSchemeSchema:()=>ZTo,BearerAuthSchemeSchema:()=>nCo,HeaderAuthSchemeSchema:()=>XTo,InferredAuthenticatedRequestHeader:()=>eCo,InferredBearerAuthSchema:()=>iCo,InferredGetTokenEndpointSchema:()=>rCo,InferredGetTokenEndpointSchemaObject:()=>tCo,OAuthAccessTokenRequestPropertiesSchema:()=>HTo,OAuthAccessTokenResponsePropertiesSchema:()=>$To,OAuthGetTokenEndpointSchema:()=>GTo,OAuthRefreshTokenEndpointSchema:()=>KTo,OAuthRefreshTokenRequestPropertiesSchema:()=>QTo,OAuthRefreshTokenResponsePropertiesSchema:()=>JTo,OAuthSchemeSchema:()=>YTo,TokenBearerAuthSchema:()=>kTo,WithEnvironmentVariable:()=>p5n});var OGs={};Po(OGs,{AvailabilitySchema:()=>MCo,AvailabilityStatusSchema:()=>j5n,AvailabilityUnionSchema:()=>ACo});var mGs={};Po(mGs,{WithAudiences:()=>zBi,WithAvailability:()=>qCo,WithDocsSchema:()=>mF,WithName:()=>CBi});var PGs={};Po(PGs,{EncodingSchema:()=>wCo,ProtobufTypeSchema:()=>jCo});var jGs={};Po(jGs,{EnvironmentSchema:()=>FCo,MultipleBaseUrlsEnvironmentSchema:()=>NCo,SingleBaseUrlEnvironmentSchema:()=>xCo,WithEnvironmentsSchema:()=>LCo});var wGs={};Po(wGs,{WithHeadersSchema:()=>RCo});var SGs={};Po(SGs,{HttpHeaderSchema:()=>zCo,TypeReferenceDeclarationWithEnvOverride:()=>ICo,TypeReferenceDeclarationWithEnvOverrideSchema:()=>BCo});var DGs={};Po(DGs,{BaseTypeReferenceSchema:()=>TCo,TypeReferenceDeclarationWithName:()=>CCo});var EGs={};Po(EGs,{NumberValidationSchema:()=>DCo,StringValidationSchema:()=>SCo,ValidationSchema:()=>ECo});var C4d="spec-origin",B4d="async-api",I4d="default-group",z4d="openapi",EzS="openapi-overrides",MzS="api-settings";function R4d(e){return e?.specs!=null}function x4d(e){return e?.asyncapi!=null}function N4d(e){return e?.conjure!=null}function F4d(e){return e?.namespaces!=null}function L4d(e){return e?.openapi!=null}function U4d(e){return e?.openrpc!=null}function V4d(e){return e?.proto!=null}var W4d=si(require("path"),1);async function gBo({schema:e,value:t,context:r,filepathBeingParsed:i}){let n=await e.safeParseAsync(t);if(n.success)return n.data;let a=n.error.errors.map(l=>{let d=l.path.length>0?`${l.message} at "${AzS(l.path)}"`:l.message;return o$t({content:d,prefix:" - "})}),u=[`Failed to parse file: ${W4d.default.relative(process.cwd(),i)}`,...a].join(`
|
|
1632
|
+
`)),{ok:!0,value:t}):i}}function LTo(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var l5n=class e extends Error{errors;constructor(t){super(t.map(LTo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var f5n=class e extends Error{errors;constructor(t){super(t.map(LTo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function AA(e){return{nullable:()=>jzS(e),optional:()=>fGs(e),optionalNullable:()=>wzS(e),transform:t=>dGs(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new f5n(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new l5n(i.errors)}}}function jzS(e){let t={parse:(r,i)=>r==null?{ok:!0,value:null}:e.parse(r,i),json:(r,i)=>r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>jm.NULLABLE};return{...t,...AA(t)}}function fGs(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>jm.OPTIONAL};return{...t,...AA(t)}}function wzS(e){let t={parse:(r,i)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,i),json:(r,i)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,i),getType:()=>jm.OPTIONAL_NULLABLE};return{...t,...AA(t)}}function dGs(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(i,n)=>{let a=t.untransform(i);return e.json(a,n)},getType:()=>e.getType()};return{...r,...AA(r)}}function a4d(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:MA(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:MA(t,"bigint")}]}:{ok:!0,value:t},getType:()=>jm.BIGINT};return{...nL(e),...AA(e)}}var SzS=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function o4d(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:MA(t,"string")}]}:SzS.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:MA(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:MA(t,"Date object")}]},getType:()=>jm.DATE};return{...nL(e),...AA(e)}}function lJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...nL(r),...AA(r)}}}function UTo(e){let t=new Set(e);return lJ(jm.ENUM,(i,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:a=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:a,message:MA(i,"string")}]}:!t.has(i)&&!n?{ok:!1,errors:[{path:a,message:MA(i,"enum")}]}:{ok:!0,value:i})()}function u4d(e){let t=pGs(e);return{...t,...AA(t)}}function pGs(e){return{parse:(t,r)=>d5n(e).parse(t,r),json:(t,r)=>d5n(e).json(t,r),getType:()=>d5n(e).getType()}}function d5n(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function pRa(e){return Object.entries(e)}function _Ra(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[n,a])=>(r.has(n)&&(i[n]=a),i),{})}function qBi(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function hRa(e){return Object.keys(e)}function s4d(e,t){let r=[],i=[];for(let n of e)t(n)?r.push(n):i.push(n);return[r,i]}function v$t(e){return{withParsedProperties:t=>_Gs(e,t)}}function _Gs(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);if(!a.ok)return a;let u=Object.entries(t).reduce((l,[d,s])=>({...l,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(i,n)=>{if(!qBi(i))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:MA(i,"object")}]};let a=new Set(Object.keys(t)),u=_Ra(i,Object.keys(i).filter(l=>!a.has(l)));return e.json(u,n)},getType:()=>e.getType()};return{...r,...AA(r),...v$t(r)}}function c4d(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function TBi(e){return e.isProperty}function VTo(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,i])=>TBi(i)?i.rawKey:r),_getParsedProperties:()=>hRa(e),parse:(r,i)=>{let n={},a=[];for(let[u,l]of pRa(e)){let d=TBi(l)?l.rawKey:u,s=TBi(l)?l.valueSchema:l,o={rawKey:d,parsedKey:u,valueSchema:s};n[d]=o,d4d(s)&&a.push(d)}return l4d({value:r,requiredKeys:a,getProperty:u=>{let l=n[u];if(l!=null)return{transformedKey:l.parsedKey,transform:d=>l.valueSchema.parse(d,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},json:(r,i)=>{let n=[];for(let[a,u]of pRa(e)){let l=TBi(u)?u.valueSchema:u;d4d(l)&&n.push(a)}return l4d({value:r,requiredKeys:n,getProperty:a=>{let u=e[a];if(u!=null)return TBi(u)?{transformedKey:u.rawKey,transform:l=>u.valueSchema.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:l=>u.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},getType:()=>jm.OBJECT};return{...nL(t),...AA(t),...v$t(t),...ski(t)}}function l4d({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:i="fail",skipValidation:n=!1,breadcrumbsPrefix:a=[]}){if(!qBi(e))return{ok:!1,errors:[{path:a,message:MA(e,"object")}]};let u=new Set(t),l=[],d={};for(let[s,o]of Object.entries(e)){let c=r(s);if(c!=null){u.delete(s);let b=c.transform(o);b.ok?d[c.transformedKey]=b.value:(d[s]=o,l.push(...b.errors))}else switch(i){case"fail":l.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=o;break}}return l.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),l.length===0||n?{ok:!0,value:d}:{ok:!1,errors:l}}function ski(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,n)=>f4d({extensionKeys:t._getRawProperties(),value:i,transformBase:a=>e.parse(a,n),transformExtension:a=>t.parse(a,n)}),json:(i,n)=>f4d({extensionKeys:t._getParsedProperties(),value:i,transformBase:a=>e.json(a,n),transformExtension:a=>t.json(a,n)}),getType:()=>jm.OBJECT};return{...r,...AA(r),...v$t(r),...ski(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,i)=>{let n=e.parse(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},json:(r,i)=>{let n=e.json(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},getType:()=>jm.OBJECT};return{...t,...AA(t),...v$t(t),...ski(t)}}}}function f4d({extensionKeys:e,value:t,transformBase:r,transformExtension:i}){let n=new Set(e),[a,u]=s4d(hRa(t),s=>n.has(s)),l=r(_Ra(t,u)),d=i(_Ra(t,a));return l.ok&&d.ok?{ok:!0,value:{...l.value,...d.value}}:{ok:!1,errors:[...l.ok?[]:l.errors,...d.ok?[]:d.errors]}}function d4d(e){return!DzS(e)}function DzS(e){switch(e.getType()){case jm.ANY:case jm.UNKNOWN:case jm.OPTIONAL:case jm.OPTIONAL_NULLABLE:return!0;default:return!1}}function p4d(e){return VTo(e)}function _4d(e){let t={...pGs(e),_getRawProperties:()=>d5n(e)._getRawProperties(),_getParsedProperties:()=>d5n(e)._getParsedProperties()};return{...t,...AA(t),...v$t(t),...ski(t)}}function WTo(e){let t={parse:(r,i)=>h4d(r,(n,a)=>e.parse(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,i)=>h4d(r,(n,a)=>e.json(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>jm.LIST};return{...nL(t),...AA(t)}}function h4d(e,t){return Array.isArray(e)?e.map((i,n)=>t(i,n)).reduce((i,n)=>{if(i.ok&&n.ok)return{ok:!0,value:[...i.value,n.value]};let a=[];return i.ok||a.push(...i.errors),n.ok||a.push(...n.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:MA(e,"list"),path:[]}]}}function y4d(e){return lJ(jm.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:MA(r,`"${e}"`)}]})()}function v4d(e){return lJ(jm.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:MA(r,`${e.toString()}`)}]})()}var b4d=lJ(jm.ANY,e=>({ok:!0,value:e}));var g4d=lJ(jm.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:MA(e,"boolean")}]});var O4d=lJ(jm.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:MA(e,"number")}]});var m4d=lJ(jm.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:MA(e,"string")}]});var P4d=lJ(jm.UNKNOWN,e=>({ok:!0,value:e}));function w4d(e,t){let r={parse:(i,n)=>j4d({value:i,isKeyNumeric:e.getType()===jm.NUMBER,transformKey:a=>e.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(i,n)=>j4d({value:i,isKeyNumeric:e.getType()===jm.NUMBER,transformKey:a=>e.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>jm.RECORD};return{...nL(r),...AA(r)}}function j4d({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:n=[]}){return qBi(e)?pRa(e).reduce((a,[u,l])=>{if(l===void 0)return a;let d=a,s=u;if(t){let g=u.length>0?Number(u):NaN;isNaN(g)||(s=g)}let o=r(s),c=i(l,s);if(d.ok&&o.ok&&c.ok)return{ok:!0,value:{...d.value,[o.value]:c.value}};let b=[];return d.ok||b.push(...d.errors),o.ok||b.push(...o.errors),c.ok||b.push(...c.errors),{ok:!1,errors:b}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:MA(e,"object")}]}}function S4d(e){let t=WTo(e),r={parse:(i,n)=>{let a=t.parse(i,n);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(i,n)=>i instanceof Set?t.json([...i],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:MA(i,"Set")}]},getType:()=>jm.SET};return{...nL(r),...AA(r)}}function E4d(e){let t={parse:(r,i)=>D4d((n,a)=>n.parse(r,a),e,i),json:(r,i)=>D4d((n,a)=>n.json(r,a),e,i),getType:()=>jm.UNDISCRIMINATED_UNION};return{...nL(t),...AA(t)}}function D4d(e,t,r){let i=[];for(let[n,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let l of u.errors)i.push({path:l.path,message:`[Variant ${n}] ${l.message}`})}return{ok:!1,errors:i}}function M4d(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function q4d(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,n=UTo(hRa(t)),a={parse:(u,l)=>A4d({value:u,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:d=>n.parse(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),json:(u,l)=>A4d({value:u,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:d=>n.json(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),getType:()=>jm.UNION};return{...nL(a),...AA(a),...v$t(a)}}function A4d({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:l=[]}){if(!qBi(e))return{ok:!1,errors:[{path:l,message:MA(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:l,message:`Missing discriminant ("${t}")`}]};let o=i(d);if(!o.ok)return{ok:!1,errors:o.errors};let c=n(o.value);if(c==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...l,t],message:"Unexpected discriminant value"}]};let b=u(s,c);return b.ok?{ok:!0,value:{[r]:d,...b.value}}:b}var HTo=Gi.object({"client-id":Gi.string().optional(),"client-secret":Gi.string().optional(),scopes:Gi.string().optional()});var $To=Gi.object({"access-token":Gi.string().optional(),"expires-in":Gi.string().optional(),"refresh-token":Gi.string().optional()});var GTo=Gi.object({endpoint:Gi.string(),"request-properties":HTo.optional(),"response-properties":$To.optional()});var QTo=Gi.object({"refresh-token":Gi.string()});var JTo=Gi.object({"access-token":Gi.string().optional(),"expires-in":Gi.string().optional(),"refresh-token":Gi.string().optional()});var KTo=Gi.object({endpoint:Gi.string(),"request-properties":QTo.optional(),"response-properties":JTo.optional()});var mF=Gi.object({docs:Gi.string().optional()});var YTo=Gi.object({scheme:Gi.stringLiteral("oauth"),type:Gi.stringLiteral("client-credentials"),scopes:Gi.list(Gi.string()).optional(),"client-id-env":Gi.string().optional(),"client-secret-env":Gi.string().optional(),"token-prefix":Gi.string().optional(),"token-header":Gi.string().optional(),"get-token":GTo,"refresh-token":KTo.optional()}).extend(mF);var p5n=Gi.object({env:Gi.string().optional()});var CBi=Gi.object({name:Gi.string().optional()});var XTo=Gi.object({header:Gi.string(),type:Gi.string().optional(),prefix:Gi.string().optional()}).extend(p5n).extend(CBi).extend(mF);var cki=Gi.object({}).extend(p5n).extend(CBi);var ZTo=Gi.object({scheme:Gi.stringLiteral("basic"),username:cki.optional(),password:cki.optional()}).extend(mF);var kTo=Gi.object({scheme:Gi.stringLiteral("bearer"),token:cki.optional()}).extend(mF);var eCo=Gi.object({"response-property":Gi.string(),"header-name":Gi.string(),"value-prefix":Gi.string().optional()});var tCo=Gi.object({endpoint:Gi.string(),"expiry-response-property":Gi.string().optional(),"authenticated-request-headers":Gi.list(eCo).optional()});var rCo=Gi.undiscriminatedUnion([Gi.string(),tCo]);var iCo=Gi.object({scheme:Gi.stringLiteral("bearer"),"get-token":rCo}).extend(mF);var nCo=Gi.undiscriminatedUnion([kTo,iCo]);var aCo=Gi.undiscriminatedUnion([YTo,XTo,ZTo,nCo]);var BBi=Gi.string();var oCo=Gi.enum_(["v1"]);var _5n=Gi.enum_(["v1","v2"]);var IBi=Gi.object({"use-title":Gi.boolean().optional(),unions:oCo.optional(),"message-naming":_5n.optional(),"respect-nullable-schemas":Gi.boolean().optional(),"only-include-referenced-schemas":Gi.boolean().optional(),"inline-path-parameters":Gi.boolean().optional(),"idiomatic-request-names":Gi.boolean().optional()});var h5n=Gi.object({path:BBi,origin:Gi.string().optional(),overrides:Gi.string().optional(),audiences:Gi.list(Gi.string()).optional(),settings:IBi.optional()});var y5n=Gi.object({target:Gi.string().optional(),root:Gi.string(),overrides:Gi.string().optional(),"local-generation":Gi.boolean().optional(),"from-openapi":Gi.boolean().optional(),dependencies:Gi.list(Gi.string()).optional()});var v5n=Gi.object({proto:y5n});var uCo=Gi.undiscriminatedUnion([BBi,h5n,v5n]);var sCo=Gi.list(uCo);var b5n=Gi.undiscriminatedUnion([BBi,h5n,sCo,v5n]);var cCo=Gi.object({namespaces:Gi.record(Gi.string(),b5n)});var g5n=Gi.object({scheme:Gi.string()}).extend(mF);var lCo=Gi.undiscriminatedUnion([Gi.string(),g5n]);var fCo=Gi.object({any:Gi.list(lCo)}).extend(mF);var O5n=Gi.undiscriminatedUnion([Gi.string(),g5n,fCo]);var dCo=Gi.enum_(["form","json"]);var pCo=Gi.object({endpoints:Gi.list(Gi.string()).optional()});var yRa=Gi.object({"max-depth":Gi.number().optional()});var _Co=Gi.object({request:yRa.optional(),response:yRa.optional()});var m5n=Gi.object({"respect-nullable-schemas":Gi.boolean().optional(),"title-as-schema-name":Gi.boolean().optional(),"optional-additional-properties":Gi.boolean().optional(),"coerce-enums-to-literals":Gi.boolean().optional(),"idiomatic-request-names":Gi.boolean().optional()});var P5n=Gi.object({"only-include-referenced-schemas":Gi.boolean().optional(),"inline-path-parameters":Gi.boolean().optional(),"prefer-undiscriminated-unions-with-literals":Gi.boolean().optional(),"object-query-parameters":Gi.boolean().optional(),"respect-readonly-schemas":Gi.boolean().optional(),"respect-forward-compatible-enums":Gi.boolean().optional(),"use-bytes-for-binary-response":Gi.boolean().optional(),"default-form-parameter-encoding":dCo.optional(),filter:pCo.optional(),"example-generation":_Co.optional(),"additional-properties-defaults-to":Gi.boolean().optional(),"type-dates-as-strings":Gi.boolean().optional(),"preserve-single-schema-oneof":Gi.boolean().optional(),"inline-all-of-schemas":Gi.boolean().optional()}).extend(m5n);var hCo=Gi.object({openapi:Gi.string(),origin:Gi.string().optional(),overrides:Gi.string().optional(),namespace:Gi.string().optional(),settings:P5n.optional()});var yCo=Gi.object({"message-naming":_5n.optional()}).extend(m5n);var vCo=Gi.object({asyncapi:Gi.string(),origin:Gi.string().optional(),overrides:Gi.string().optional(),namespace:Gi.string().optional(),settings:yCo.optional()});var bCo=Gi.object({proto:y5n});var gCo=Gi.object({openrpc:Gi.string(),overrides:Gi.string().optional(),namespace:Gi.string().optional()});var OCo=Gi.undiscriminatedUnion([hCo,vCo,bCo,gCo]);var mCo=Gi.object({conjure:Gi.string()});var PCo=Gi.undiscriminatedUnion([Gi.list(OCo),mCo]);var jCo=Gi.object({type:Gi.string()});var wCo=Gi.object({proto:jCo.optional()});var SCo=Gi.object({minLength:Gi.number().optional(),maxLength:Gi.number().optional(),pattern:Gi.string().optional(),format:Gi.string().optional()});var DCo=Gi.object({min:Gi.number().optional(),max:Gi.number().optional(),exclusiveMin:Gi.boolean().optional(),exclusiveMax:Gi.boolean().optional(),multipleOf:Gi.number().optional()});var ECo=Gi.undiscriminatedUnion([SCo,DCo]);var j5n=Gi.enum_(["in-development","pre-release","deprecated","generally-available"]);var MCo=Gi.object({status:j5n,message:Gi.string().optional()});var ACo=Gi.undiscriminatedUnion([j5n,MCo]);var qCo=Gi.object({availability:ACo.optional()});var TCo=Gi.object({default:Gi.unknown().optional(),encoding:wCo.optional(),validation:ECo.optional()}).extend(mF).extend(qCo);var zBi=Gi.object({audiences:Gi.list(Gi.string()).optional()});var CCo=Gi.object({type:Gi.string()}).extend(TCo).extend(CBi).extend(zBi);var BCo=Gi.object({env:Gi.string().optional()}).extend(CCo);var ICo=Gi.undiscriminatedUnion([Gi.string(),BCo]);var zCo=ICo;var RCo=Gi.object({headers:Gi.record(Gi.string(),zCo).optional()});var xCo=Gi.object({url:Gi.string()}).extend(zBi).extend(mF);var NCo=Gi.object({urls:Gi.record(Gi.string(),Gi.string())}).extend(zBi).extend(mF);var FCo=Gi.undiscriminatedUnion([Gi.string(),xCo,NCo]);var LCo=Gi.object({"default-url":Gi.string().optional(),"default-environment":Gi.string().optional(),environments:Gi.record(Gi.string(),FCo).optional()});var UCo=Gi.object({auth:O5n.optional(),specs:PCo}).extend(RCo).extend(LCo);var VCo=Gi.undiscriminatedUnion([b5n,cCo,UCo]);var WCo=Gi.object({username:Gi.string(),email:Gi.string(),token:Gi.string()});var HCo=Gi.object({github:WCo.optional()});var $Co=Gi.object({name:Gi.string(),email:Gi.string()});var RBi=Gi.object({description:Gi.string().optional(),authors:Gi.list($Co).optional()});var GCo=Gi.object({method:Gi.string(),path:Gi.string(),stream:Gi.boolean().optional()});var vRa=Gi.undiscriminatedUnion([Gi.string(),GCo]);var QCo=Gi.object({bannerLink:Gi.string().optional(),introduction:Gi.string().optional(),apiReferenceLink:Gi.string().optional(),apiName:Gi.string().optional(),disabledSections:Gi.list(Gi.string()).optional(),defaultEndpoint:vRa.optional(),features:Gi.record(Gi.string(),Gi.list(vRa)).optional()});var JCo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),token:Gi.string().optional()});var KCo=Gi.object({keyId:Gi.string(),password:Gi.string(),secretKey:Gi.string()});var YCo=Gi.object({url:Gi.string().optional(),coordinate:Gi.string(),username:Gi.string().optional(),password:Gi.string().optional(),signature:KCo.optional()});var XCo=Gi.object({keywords:Gi.list(Gi.string()).optional(),"documentation-link":Gi.string().optional(),"homepage-link":Gi.string().optional()}).extend(RBi);var ZCo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),token:Gi.string().optional(),username:Gi.string().optional(),password:Gi.string().optional(),metadata:XCo.optional()});var kCo=Gi.object({"api-key":Gi.string(),"workspace-id":Gi.string(),"collection-id":Gi.string().optional()});var eBo=Gi.object({path:Gi.string()});var tBo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),"api-key":Gi.string().optional()});var rBo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),"api-key":Gi.string().optional()});var iBo=Gi.object({url:Gi.string().optional(),"package-name":Gi.string(),token:Gi.string().optional()});var nBo=Gi.union("location",{npm:JCo,maven:YCo,pypi:ZCo,postman:kCo,"local-file-system":eBo,nuget:tBo,rubygems:rBo,crates:iBo}).transform({transform:e=>e,untransform:e=>e});var aBo=Gi.object({uri:Gi.string(),token:Gi.string()});var oBo=Gi.enum_(["MIT","Apache-2.0"]);var uBo=Gi.object({custom:Gi.string()});var Ler=Gi.undiscriminatedUnion([oBo,uBo]);var sBo=Gi.enum_(["commit","release"]);var cBo=Gi.object({repository:Gi.string(),license:Ler.optional(),mode:sBo.optional()});var bRa=Gi.object({name:Gi.string()});var xBi=Gi.object({teams:Gi.list(bRa).optional(),users:Gi.list(bRa).optional()});var lBo=Gi.object({repository:Gi.string(),branch:Gi.string().optional(),license:Ler.optional(),mode:Gi.stringLiteral("pull-request"),reviewers:xBi.optional()});var fBo=Gi.object({repository:Gi.string(),license:Ler.optional(),mode:Gi.stringLiteral("push"),branch:Gi.string().optional()});var dBo=Gi.undiscriminatedUnion([aBo,cBo,lBo,fBo]);var gRa=Gi.object({"package-description":Gi.string().optional(),email:Gi.string().optional(),"reference-url":Gi.string().optional(),author:Gi.string().optional(),license:Ler.optional()});var pBo=Gi.object({path:Gi.string()});var _Bo=Gi.object({auth:O5n.optional(),settings:IBi.optional()});var hBo=Gi.object({name:Gi.string(),version:Gi.string(),output:nBo.optional(),github:dBo.optional(),config:Gi.unknown(),metadata:gRa.optional(),keywords:Gi.list(Gi.string()).optional(),snippets:pBo.optional(),"ir-version":Gi.string().optional(),"smart-casing":Gi.boolean().optional(),api:_Bo.optional(),"disable-examples":Gi.boolean().optional(),"publish-metadata":gRa.optional()});var yBo=Gi.object({audiences:Gi.list(Gi.string()).optional(),generators:Gi.list(hBo),metadata:RBi.optional(),reviewers:xBi.optional()});var vBo=Gi.object({path:Gi.string(),origin:Gi.string().optional(),overrides:Gi.string().optional(),"disable-examples":Gi.boolean().optional(),settings:P5n});var bBo=Gi.undiscriminatedUnion([vBo,Gi.string()]);var T4d=Gi.object({"auth-schemes":Gi.record(Gi.string(),aCo).optional(),api:VCo.optional(),whitelabel:HCo.optional(),metadata:RBi.optional(),readme:QCo.optional(),"default-group":Gi.string().optional(),groups:Gi.record(Gi.string(),yBo).optional(),reviewers:xBi.optional(),openapi:bBo.optional(),"openapi-overrides":Gi.string().optional(),"spec-origin":Gi.string().optional(),"async-api":Gi.string().optional(),"api-settings":IBi.optional()});var yGs={};Po(yGs,{CratesOutputLocationSchema:()=>iBo,GeneratorApiSettingsSchema:()=>_Bo,GeneratorGroupSchema:()=>yBo,GeneratorInvocationSchema:()=>hBo,GeneratorOutputSchema:()=>nBo,GeneratorPublishMetadataSchema:()=>gRa,GeneratorSnippetsSchema:()=>pBo,GithubCommitAndReleaseMode:()=>sBo,GithubCommitAndReleaseSchema:()=>cBo,GithubConfigurationSchema:()=>dBo,GithubPullRequestSchema:()=>lBo,GithubPushSchema:()=>fBo,GithubSelfhostedSchema:()=>aBo,LocalFileSystemOutputLocationSchema:()=>eBo,MavenOutputLocationSchema:()=>YCo,MavenOutputSignatureSchema:()=>KCo,NpmOutputLocationSchema:()=>JCo,NugetOutputLocationSchema:()=>tBo,PostmanOutputLocationSchema:()=>kCo,PypiOutputLocationSchema:()=>ZCo,PypiOutputMetadataSchema:()=>XCo,RubyGemsOutputLocationSchema:()=>rBo});var vGs={};Po(vGs,{GithubLicenseCustomSchema:()=>uBo,GithubLicenseSchema:()=>Ler,GithubLicenseType:()=>oBo});var bGs={};Po(bGs,{ReviewerSchema:()=>bRa,ReviewersSchema:()=>xBi});var MGs={};Po(MGs,{AnyAuthItem:()=>lCo,AnyAuthSchemesSchema:()=>fCo,ApiAuthSchema:()=>O5n,AuthSchemeDeclarationSchema:()=>aCo,AuthSchemeReferenceSchema:()=>g5n,AuthVariable:()=>cki,AvailabilitySchema:()=>MCo,AvailabilityStatusSchema:()=>j5n,AvailabilityUnionSchema:()=>ACo,BaseTypeReferenceSchema:()=>TCo,BasicAuthSchemeSchema:()=>ZTo,BearerAuthSchemeSchema:()=>nCo,EncodingSchema:()=>wCo,EnvironmentSchema:()=>FCo,HeaderAuthSchemeSchema:()=>XTo,HttpHeaderSchema:()=>zCo,InferredAuthenticatedRequestHeader:()=>eCo,InferredBearerAuthSchema:()=>iCo,InferredGetTokenEndpointSchema:()=>rCo,InferredGetTokenEndpointSchemaObject:()=>tCo,MultipleBaseUrlsEnvironmentSchema:()=>NCo,NumberValidationSchema:()=>DCo,OAuthAccessTokenRequestPropertiesSchema:()=>HTo,OAuthAccessTokenResponsePropertiesSchema:()=>$To,OAuthGetTokenEndpointSchema:()=>GTo,OAuthRefreshTokenEndpointSchema:()=>KTo,OAuthRefreshTokenRequestPropertiesSchema:()=>QTo,OAuthRefreshTokenResponsePropertiesSchema:()=>JTo,OAuthSchemeSchema:()=>YTo,ProtobufTypeSchema:()=>jCo,SingleBaseUrlEnvironmentSchema:()=>xCo,StringValidationSchema:()=>SCo,TokenBearerAuthSchema:()=>kTo,TypeReferenceDeclarationWithEnvOverride:()=>ICo,TypeReferenceDeclarationWithEnvOverrideSchema:()=>BCo,TypeReferenceDeclarationWithName:()=>CCo,ValidationSchema:()=>ECo,WithAudiences:()=>zBi,WithAvailability:()=>qCo,WithDocsSchema:()=>mF,WithEnvironmentVariable:()=>p5n,WithEnvironmentsSchema:()=>LCo,WithHeadersSchema:()=>RCo,WithName:()=>CBi,auth:()=>gGs,availability:()=>OGs,commons:()=>mGs,encoding:()=>PGs,environments:()=>jGs,file:()=>wGs,service:()=>SGs,types:()=>DGs,validation:()=>EGs});var gGs={};Po(gGs,{AnyAuthItem:()=>lCo,AnyAuthSchemesSchema:()=>fCo,ApiAuthSchema:()=>O5n,AuthSchemeDeclarationSchema:()=>aCo,AuthSchemeReferenceSchema:()=>g5n,AuthVariable:()=>cki,BasicAuthSchemeSchema:()=>ZTo,BearerAuthSchemeSchema:()=>nCo,HeaderAuthSchemeSchema:()=>XTo,InferredAuthenticatedRequestHeader:()=>eCo,InferredBearerAuthSchema:()=>iCo,InferredGetTokenEndpointSchema:()=>rCo,InferredGetTokenEndpointSchemaObject:()=>tCo,OAuthAccessTokenRequestPropertiesSchema:()=>HTo,OAuthAccessTokenResponsePropertiesSchema:()=>$To,OAuthGetTokenEndpointSchema:()=>GTo,OAuthRefreshTokenEndpointSchema:()=>KTo,OAuthRefreshTokenRequestPropertiesSchema:()=>QTo,OAuthRefreshTokenResponsePropertiesSchema:()=>JTo,OAuthSchemeSchema:()=>YTo,TokenBearerAuthSchema:()=>kTo,WithEnvironmentVariable:()=>p5n});var OGs={};Po(OGs,{AvailabilitySchema:()=>MCo,AvailabilityStatusSchema:()=>j5n,AvailabilityUnionSchema:()=>ACo});var mGs={};Po(mGs,{WithAudiences:()=>zBi,WithAvailability:()=>qCo,WithDocsSchema:()=>mF,WithName:()=>CBi});var PGs={};Po(PGs,{EncodingSchema:()=>wCo,ProtobufTypeSchema:()=>jCo});var jGs={};Po(jGs,{EnvironmentSchema:()=>FCo,MultipleBaseUrlsEnvironmentSchema:()=>NCo,SingleBaseUrlEnvironmentSchema:()=>xCo,WithEnvironmentsSchema:()=>LCo});var wGs={};Po(wGs,{WithHeadersSchema:()=>RCo});var SGs={};Po(SGs,{HttpHeaderSchema:()=>zCo,TypeReferenceDeclarationWithEnvOverride:()=>ICo,TypeReferenceDeclarationWithEnvOverrideSchema:()=>BCo});var DGs={};Po(DGs,{BaseTypeReferenceSchema:()=>TCo,TypeReferenceDeclarationWithName:()=>CCo});var EGs={};Po(EGs,{NumberValidationSchema:()=>DCo,StringValidationSchema:()=>SCo,ValidationSchema:()=>ECo});var C4d="spec-origin",B4d="async-api",I4d="default-group",z4d="openapi",EzS="openapi-overrides",MzS="api-settings";function R4d(e){return e?.specs!=null}function x4d(e){return e?.asyncapi!=null}function N4d(e){return e?.conjure!=null}function F4d(e){return e?.namespaces!=null}function L4d(e){return e?.openapi!=null}function U4d(e){return e?.openrpc!=null}function V4d(e){return e?.proto!=null}var W4d=si(require("path"),1);async function gBo({schema:e,value:t,context:r,filepathBeingParsed:i}){let n=await e.safeParseAsync(t);if(n.success)return n.data;let a=n.error.errors.map(l=>{let d=l.path.length>0?`${l.message} at "${AzS(l.path)}"`:l.message;return o$t({content:d,prefix:" - "})}),u=[`Failed to parse file: ${W4d.default.relative(process.cwd(),i)}`,...a].join(`
|
|
1633
1633
|
`);return r.failAndThrow(u)}function AzS(e){return e.reduce((t,r)=>typeof r=="number"?t+"["+r+"]":t+(t===""?"":".")+r,"")}var $4d=si(require("path"),1);function $Me(e){return e.replace(/\\/g,"/")}function OBo(e){return e.startsWith("/")}var w5n={of:e=>{if(!OBo(e))throw new Error("Filepath is not absolute: "+e);return $Me(e)}};function lki(e,t){let r=e.split("/").pop()??e;return t?.stripExtension?r.split(".")[0]??r:r}function iNe(e){let r=e.replace(/\/+$/,"").lastIndexOf("/");return r===-1?".":r===0?"/":e.slice(0,r)}function PF(...e){let t=[];for(let r of e.flatMap(i=>i.split("/")).filter(Boolean))r==="."||r===""||(r===".."&&t.length>0&&t[t.length-1]!==".."?t.pop():t.push(r));return(e[0]?.startsWith("/")?"/":"")+t.join("/")}var fy={of:e=>{if(OBo(e))throw new Error("Filepath is not relative: "+e);return $Me(e)}};var b$t="/";function mBo(e,t){let r=e.split(b$t).filter(Boolean),i=t.split(b$t).filter(Boolean),n=0;for(;n<r.length&&n<i.length&&r[n]===i[n];)n++;let a=r.length-n;return[...Array(a).fill(".."),...i.slice(n)].join(b$t)||"."}function qGs(e){return H4d(e)}function PBo(e){return H4d(e)}function H4d(e){let t=e;return/^[a-zA-Z]:\\/.test(e)&&(t=e.substring(2)),t.replace(/\\/g,"/")}var Fc={of:e=>{if(!$4d.default.isAbsolute(e))throw new Error("Filepath is not absolute: "+e);return $Me(e)}};function _I(){return process.cwd()}var G4d=si(require("path"),1);function Rd(e){return G4d.default.dirname(e)}var Q4d=require("fs"),J4d=require("fs/promises");async function jf(e,t){try{let r=await(0,J4d.lstat)(e);return!(t==="file"&&!r.isFile()||t==="directory"&&!r.isDirectory())}catch{return!1}}function Agi(e,t){try{let r=(0,Q4d.lstatSync)(e);return!(t==="file"&&!r.isFile()||t==="directory"&&!r.isDirectory())}catch{return!1}}var jBo=require("fs/promises"),TGs=si(require("path"),1);var K4d=si(require("path"),1);function Eu(...e){return K4d.default.join(...e)}var Y4d=si(require("path"),1);var Ta={of:e=>{if(Y4d.default.isAbsolute(e))throw new Error("Filepath is not relative: "+e);return $Me(e)}};async function Uer(e,t={}){let r=t.fileExtensions!=null?new Set(t.fileExtensions.map(a=>a.startsWith(".")?a:`.${a}`)):void 0,i=[],n=await(0,jBo.readdir)(e,{withFileTypes:!0});return await Promise.all(n.map(async a=>{let u=Eu(e,Ta.of(a.name));a.isDirectory()?i.push({type:"directory",name:a.name,absolutePath:u,contents:await Uer(u,t)}):(r==null||r.has(TGs.default.extname(a.name)))&&i.push({type:"file",name:a.name,absolutePath:u,contents:(await(0,jBo.readFile)(TGs.default.join(e,a.name))).toString()})})),i.sort((a,u)=>a.name<u.name?-1:1)}function X4d(e){return e.split(/[/\\]/).filter(t=>t.length>0)}function CGs(e){if(!e.includes("."))return;let t=X4d(e),r=t[t.length-1];if(r!=null)return Ta.of(r)}function BGs(){return process.env.CI==="true"||process.env.GITHUB_ACTIONS==="true"||process.env.GITLAB_CI==="true"||process.env.CIRCLECI==="true"||process.env.JENKINS_URL==="true"||process.env.TRAVIS==="true"}function fki(e){try{return new URL(e),!0}catch{return!1}}var IGs=(e,t,r)=>{let i=e instanceof RegExp?Z4d(e,r):e,n=t instanceof RegExp?Z4d(t,r):t,a=i!==null&&n!=null&&qzS(i,n,r);return a&&{start:a[0],end:a[1],pre:r.slice(0,a[0]),body:r.slice(a[0]+i.length,a[1]),post:r.slice(a[1]+n.length)}},Z4d=(e,t)=>{let r=t.match(e);return r?r[0]:null},qzS=(e,t,r)=>{let i,n,a,u,l,d=r.indexOf(e),s=r.indexOf(t,d+1),o=d;if(d>=0&&s>0){if(e===t)return[d,s];for(i=[],a=r.length;o>=0&&!l;){if(o===d)i.push(o),d=r.indexOf(e,o+1);else if(i.length===1){let c=i.pop();c!==void 0&&(l=[c,s])}else n=i.pop(),n!==void 0&&n<a&&(a=n,u=s),s=r.indexOf(t,o+1);o=d<s&&d>=0?d:s}i.length&&u!==void 0&&(l=[a,u])}return l};var k4d="\0SLASH"+Math.random()+"\0",e2d="\0OPEN"+Math.random()+"\0",RGs="\0CLOSE"+Math.random()+"\0",t2d="\0COMMA"+Math.random()+"\0",r2d="\0PERIOD"+Math.random()+"\0",TzS=new RegExp(k4d,"g"),CzS=new RegExp(e2d,"g"),BzS=new RegExp(RGs,"g"),IzS=new RegExp(t2d,"g"),zzS=new RegExp(r2d,"g"),RzS=/\\\\/g,xzS=/\\{/g,NzS=/\\}/g,FzS=/\\,/g,LzS=/\\./g;function zGs(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function UzS(e){return e.replace(RzS,k4d).replace(xzS,e2d).replace(NzS,RGs).replace(FzS,t2d).replace(LzS,r2d)}function VzS(e){return e.replace(TzS,"\\").replace(CzS,"{").replace(BzS,"}").replace(IzS,",").replace(zzS,".")}function i2d(e){if(!e)return[""];let t=[],r=IGs("{","}",e);if(!r)return e.split(",");let{pre:i,body:n,post:a}=r,u=i.split(",");u[u.length-1]+="{"+n+"}";let l=i2d(a);return a.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l)),t.push.apply(t,u),t}function n2d(e){return e?(e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),ORa(UzS(e),!0).map(VzS)):[]}function WzS(e){return"{"+e+"}"}function HzS(e){return/^-?0\d/.test(e)}function $zS(e,t){return e<=t}function GzS(e,t){return e>=t}function ORa(e,t){let r=[],i=IGs("{","}",e);if(!i)return[e];let n=i.pre,a=i.post.length?ORa(i.post,!1):[""];if(/\$$/.test(i.pre))for(let u=0;u<a.length;u++){let l=n+"{"+i.body+"}"+a[u];r.push(l)}else{let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),d=u||l,s=i.body.indexOf(",")>=0;if(!d&&!s)return i.post.match(/,(?!,).*\}/)?(e=i.pre+"{"+i.body+RGs+i.post,ORa(e)):[e];let o;if(d)o=i.body.split(/\.\./);else if(o=i2d(i.body),o.length===1&&o[0]!==void 0&&(o=ORa(o[0],!1).map(WzS),o.length===1))return a.map(b=>i.pre+o[0]+b);let c;if(d&&o[0]!==void 0&&o[1]!==void 0){let b=zGs(o[0]),g=zGs(o[1]),O=Math.max(o[0].length,o[1].length),m=o.length===3&&o[2]!==void 0?Math.abs(zGs(o[2])):1,w=$zS;g<b&&(m*=-1,w=GzS);let q=o.some(HzS);c=[];for(let M=b;w(M,g);M+=m){let D;if(l)D=String.fromCharCode(M),D==="\\"&&(D="");else if(D=String(M),q){let C=O-D.length;if(C>0){let R=new Array(C+1).join("0");M<0?D="-"+R+D.slice(1):D=R+D}}c.push(D)}}else{c=[];for(let b=0;b<o.length;b++)c.push.apply(c,ORa(o[b],!1))}for(let b=0;b<c.length;b++)for(let g=0;g<a.length;g++){let O=n+c[b]+a[g];(!t||d||O)&&r.push(O)}}return r}var mRa=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};var QzS={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},PRa=e=>e.replace(/[[\]\\-]/g,"\\$&"),JzS=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),a2d=e=>e.join(""),o2d=(e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],n=[],a=r+1,u=!1,l=!1,d=!1,s=!1,o=r,c="";e:for(;a<e.length;){let m=e.charAt(a);if((m==="!"||m==="^")&&a===r+1){s=!0,a++;continue}if(m==="]"&&u&&!d){o=a+1;break}if(u=!0,m==="\\"&&!d){d=!0,a++;continue}if(m==="["&&!d){for(let[w,[E,q,M]]of Object.entries(QzS))if(e.startsWith(w,a)){if(c)return["$.",!1,e.length-r,!0];a+=w.length,M?n.push(E):i.push(E),l=l||q;continue e}}if(d=!1,c){m>c?i.push(PRa(c)+"-"+PRa(m)):m===c&&i.push(PRa(m)),c="",a++;continue}if(e.startsWith("-]",a+1)){i.push(PRa(m+"-")),a+=2;continue}if(e.startsWith("-",a+1)){c=m,a+=2;continue}i.push(PRa(m)),a++}if(o<a)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,e.length-r,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!s){let m=i[0].length===2?i[0].slice(-1):i[0];return[JzS(m),!1,o-r,!1]}let b="["+(s?"^":"")+a2d(i)+"]",g="["+(s?"":"^")+a2d(n)+"]";return[i.length&&n.length?"("+b+"|"+g+")":i.length?b:g,l,o-r,!0]};var g$t=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var KzS=new Set(["!","?","+","*","@"]),u2d=e=>KzS.has(e),YzS="(?!(?:^|/)\\.\\.?(?:$|/))",wBo="(?!\\.)",XzS=new Set(["[","."]),ZzS=new Set(["..","."]),kzS=new Set("().*{}+?[]^$\\!"),eRS=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),xGs="[^/]",s2d=xGs+"*?",c2d=xGs+"+?",S5n=class e{type;#e;#t;#r=!1;#n=[];#i;#a;#o;#s=!1;#f;#u;#c=!1;constructor(t,r,i={}){this.type=t,t&&(this.#t=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#f=this.#e===this?i:this.#e.#f,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let t of this.#n)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#n.map(t=>String(t)).join("|")+")":this.#u=this.#n.map(t=>String(t)).join("")}#l(){if(this!==this.#e)throw new Error("should only call on root");if(this.#s)return this;this.toString(),this.#s=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let r=t,i=r.#i;for(;i;){for(let n=r.#a+1;!i.type&&n<i.#n.length;n++)for(let a of t.#n){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(i.#n[n])}r=i,i=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof e&&r.#i===this))throw new Error("invalid part: "+r);this.#n.push(r)}}toJSON(){let t=this.type===null?this.#n.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let t=this.#i;for(let r=0;r<this.#a;r++){let i=t.#n[r];if(!(i instanceof e&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#n.length:0;return this.#a===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new e(this.type,t);for(let i of this.#n)r.copyIn(i);return r}static#p(t,r,i,n){let a=!1,u=!1,l=-1,d=!1;if(r.type===null){let g=i,O="";for(;g<t.length;){let m=t.charAt(g++);if(a||m==="\\"){a=!a,O+=m;continue}if(u){g===l+1?(m==="^"||m==="!")&&(d=!0):m==="]"&&!(g===l+2&&d)&&(u=!1),O+=m;continue}else if(m==="["){u=!0,l=g,d=!1,O+=m;continue}if(!n.noext&&u2d(m)&&t.charAt(g)==="("){r.push(O),O="";let w=new e(m,r);g=e.#p(t,w,g,n),r.push(w);continue}O+=m}return r.push(O),g}let s=i+1,o=new e(null,r),c=[],b="";for(;s<t.length;){let g=t.charAt(s++);if(a||g==="\\"){a=!a,b+=g;continue}if(u){s===l+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(s===l+2&&d)&&(u=!1),b+=g;continue}else if(g==="["){u=!0,l=s,d=!1,b+=g;continue}if(u2d(g)&&t.charAt(s)==="("){o.push(b),b="";let O=new e(g,o);o.push(O),s=e.#p(t,O,s,n);continue}if(g==="|"){o.push(b),b="",c.push(o),o=new e(null,r);continue}if(g===")")return b===""&&r.#n.length===0&&(r.#c=!0),o.push(b),b="",r.push(...c,o),s;b+=g}return r.type=null,r.#t=void 0,r.#n=[t.substring(i-1)],s}static fromGlob(t,r={}){let i=new e(null,void 0,r);return e.#p(t,i,0,r),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,i,n,a]=this.toRegExpSource();if(!(n||this.#t||this.#f.nocase&&!this.#f.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let l=(this.#f.nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,l),{_src:r,_glob:t})}get options(){return this.#f}toRegExpSource(t){let r=t??!!this.#f.dot;if(this.#e===this&&this.#l(),!this.type){let d=this.isStart()&&this.isEnd(),s=this.#n.map(g=>{let[O,m,w,E]=typeof g=="string"?e.#h(g,this.#t,d):g.toRegExpSource(t);return this.#t=this.#t||w,this.#r=this.#r||E,O}).join(""),o="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&ZzS.has(this.#n[0]))){let O=XzS,m=r&&O.has(s.charAt(0))||s.startsWith("\\.")&&O.has(s.charAt(2))||s.startsWith("\\.\\.")&&O.has(s.charAt(4)),w=!r&&!t&&O.has(s.charAt(0));o=m?YzS:w?wBo:""}let c="";return this.isEnd()&&this.#e.#s&&this.#i?.type==="!"&&(c="(?:$|\\/)"),[o+s+c,g$t(s),this.#t=!!this.#t,this.#r]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",a=this.#_(r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){let d=this.toString();return this.#n=[d],this.type=null,this.#t=void 0,[d,g$t(this.toString()),!1,!1]}let u=!i||t||r||!wBo?"":this.#_(!0);u===a&&(u=""),u&&(a=`(?:${a})(?:${u})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!r?wBo:"")+c2d;else{let d=this.type==="!"?"))"+(this.isStart()&&!r&&!t?wBo:"")+s2d+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`;l=n+a+d}return[l,g$t(a),this.#t=!!this.#t,this.#r]}#_(t){return this.#n.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,n,a,u]=r.toRegExpSource(t);return this.#r=this.#r||u,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#h(t,r,i=!1){let n=!1,a="",u=!1;for(let l=0;l<t.length;l++){let d=t.charAt(l);if(n){n=!1,a+=(kzS.has(d)?"\\":"")+d;continue}if(d==="\\"){l===t.length-1?a+="\\\\":n=!0;continue}if(d==="["){let[s,o,c,b]=o2d(t,l);if(c){a+=s,u=u||o,l+=c-1,r=r||b;continue}}if(d==="*"){i&&t==="*"?a+=c2d:a+=s2d,r=!0;continue}if(d==="?"){a+=xGs,r=!0;continue}a+=eRS(d)}return[a,g$t(t),!!r,u]}};var D5n=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");var fk=(e,t,r={})=>(mRa(t),!r.nocomment&&t.charAt(0)==="#"?!1:new GMe(t,r).match(e)),tRS=/^\*+([^+@!?\*\[\(]*)$/,rRS=e=>t=>!t.startsWith(".")&&t.endsWith(e),iRS=e=>t=>t.endsWith(e),nRS=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),aRS=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),oRS=/^\*+\.\*+$/,uRS=e=>!e.startsWith(".")&&e.includes("."),sRS=e=>e!=="."&&e!==".."&&e.includes("."),cRS=/^\.\*+$/,lRS=e=>e!=="."&&e!==".."&&e.startsWith("."),fRS=/^\*+$/,dRS=e=>e.length!==0&&!e.startsWith("."),pRS=e=>e.length!==0&&e!=="."&&e!=="..",_RS=/^\?+([^+@!?\*\[\(]*)?$/,hRS=([e,t=""])=>{let r=d2d([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},yRS=([e,t=""])=>{let r=p2d([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},vRS=([e,t=""])=>{let r=p2d([e]);return t?i=>r(i)&&i.endsWith(t):r},bRS=([e,t=""])=>{let r=d2d([e]);return t?i=>r(i)&&i.endsWith(t):r},d2d=([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},p2d=([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},_2d=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",l2d={win32:{sep:"\\"},posix:{sep:"/"}},gRS=_2d==="win32"?l2d.win32.sep:l2d.posix.sep;fk.sep=gRS;var XW=Symbol("globstar **");fk.GLOBSTAR=XW;var ORS="[^/]",mRS=ORS+"*?",PRS="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",jRS="(?:(?!(?:\\/|^)\\.).)*?",wRS=(e,t={})=>r=>fk(r,e,t);fk.filter=wRS;var nNe=(e,t={})=>Object.assign({},e,t),SRS=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return fk;let t=fk;return Object.assign((i,n,a={})=>t(i,n,nNe(e,a)),{Minimatch:class extends t.Minimatch{constructor(n,a={}){super(n,nNe(e,a))}static defaults(n){return t.defaults(nNe(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,a,u={}){super(n,a,nNe(e,u))}static fromGlob(n,a={}){return t.AST.fromGlob(n,nNe(e,a))}},unescape:(i,n={})=>t.unescape(i,nNe(e,n)),escape:(i,n={})=>t.escape(i,nNe(e,n)),filter:(i,n={})=>t.filter(i,nNe(e,n)),defaults:i=>t.defaults(nNe(e,i)),makeRe:(i,n={})=>t.makeRe(i,nNe(e,n)),braceExpand:(i,n={})=>t.braceExpand(i,nNe(e,n)),match:(i,n,a={})=>t.match(i,n,nNe(e,a)),sep:t.sep,GLOBSTAR:XW})};fk.defaults=SRS;var h2d=(e,t={})=>(mRa(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:n2d(e));fk.braceExpand=h2d;var DRS=(e,t={})=>new GMe(e,t).makeRe();fk.makeRe=DRS;var ERS=(e,t,r={})=>{let i=new GMe(t,r);return e=e.filter(n=>i.match(n)),i.options.nonull&&!e.length&&e.push(t),e};fk.match=ERS;var f2d=/[?*]|[+@!]\(.*?\)|\[|\]/,MRS=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),GMe=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,r={}){mRa(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||_2d,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((a,u,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let d=a[0]===""&&a[1]===""&&(a[2]==="?"||!f2d.test(a[2]))&&!f2d.test(a[3]),s=/^[a-z]:/i.test(a[0]);if(d)return[...a.slice(0,4),...a.slice(4).map(o=>this.parse(o))];if(s)return[a[0],...a.slice(1).map(o=>this.parse(o))]}return a.map(d=>this.parse(d))});if(this.debug(this.pattern,n),this.set=n.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){let u=this.set[a];u[0]===""&&u[1]===""&&this.globParts[a][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i=0;i<t.length;i++)for(let n=0;n<t[i].length;n++)t[i][n]==="**"&&(t[i][n]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let n=i;for(;r[n+1]==="**";)n++;n!==i&&r.splice(i,n-i)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((i,n)=>{let a=i[i.length-1];return n==="**"&&a==="**"?i:n===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(i.pop(),i):(i.push(n),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){let a=t[n];n===1&&a===""&&t[0]===""||(a==="."||a==="")&&(r=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let n=t[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(r=!0,t.splice(i-1,2),i-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let i of t){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let u=n;for(;i[u+1]==="**";)u++;u>n&&i.splice(n+1,u-n);let l=i[n+1],d=i[n+2],s=i[n+3];if(l!==".."||!d||d==="."||d===".."||!s||s==="."||s==="..")continue;r=!0,i.splice(n,1);let o=i.slice(0);o[n]="**",t.push(o),n--}if(!this.preserveMultipleSlashes){for(let u=1;u<i.length-1;u++){let l=i[u];u===1&&l===""&&i[0]===""||(l==="."||l==="")&&(r=!0,i.splice(u,1),u--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let a=0;for(;(a=i.indexOf("..",a+1))!==-1;){let u=i[a-1];if(u&&u!=="."&&u!==".."&&u!=="**"){r=!0;let d=a===1&&i[a+1]==="**"?["."]:[];i.splice(a-1,2,...d),i.length===0&&i.push(""),a-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let i=r+1;i<t.length;i++){let n=this.partsMatch(t[r],t[i],!this.preserveMultipleSlashes);if(n){t[r]=[],t[i]=n;break}}return t.filter(r=>r.length)}partsMatch(t,r,i=!1){let n=0,a=0,u=[],l="";for(;n<t.length&&a<r.length;)if(t[n]===r[a])u.push(l==="b"?r[a]:t[n]),n++,a++;else if(i&&t[n]==="**"&&r[a]===t[n+1])u.push(t[n]),n++;else if(i&&r[a]==="**"&&t[n]===r[a+1])u.push(r[a]),a++;else if(t[n]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(l==="b")return!1;l="a",u.push(t[n]),n++,a++}else if(r[a]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(l==="a")return!1;l="b",u.push(r[a]),n++,a++}else return!1;return t.length===r.length&&u}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,i=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)r=!r,i++;i&&(this.pattern=t.slice(i)),this.negate=r}matchOne(t,r,i=!1){let n=this.options;if(this.isWindows){let m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),E=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),q=!E&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),M=w?3:m?0:void 0,D=q?3:E?0:void 0;if(typeof M=="number"&&typeof D=="number"){let[C,R]=[t[M],r[D]];C.toLowerCase()===R.toLowerCase()&&(r[D]=C,D>M?r=r.slice(D):M>D&&(t=t.slice(M)))}}let{optimizationLevel:a=1}=this.options;a>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var u=0,l=0,d=t.length,s=r.length;u<d&&l<s;u++,l++){this.debug("matchOne loop");var o=r[l],c=t[u];if(this.debug(r,o,c),o===!1)return!1;if(o===XW){this.debug("GLOBSTAR",[r,o,c]);var b=u,g=l+1;if(g===s){for(this.debug("** at the end");u<d;u++)if(t[u]==="."||t[u]===".."||!n.dot&&t[u].charAt(0)===".")return!1;return!0}for(;b<d;){var O=t[b];if(this.debug(`
|
|
1634
1634
|
globstar while`,t,b,r,g,O),this.matchOne(t.slice(b),r.slice(g),i))return this.debug("globstar found match!",b,d,O),!0;if(O==="."||O===".."||!n.dot&&O.charAt(0)==="."){this.debug("dot detected!",t,b,r,g);break}this.debug("globstar swallow a segment, and continue"),b++}return!!(i&&(this.debug(`
|
|
1635
1635
|
>>> no match, partial?`,t,b,r,g),b===d))}let m;if(typeof o=="string"?(m=c===o,this.debug("string match",o,c,m)):(m=o.test(c),this.debug("pattern match",o,c,m)),!m)return!1}if(u===d&&l===s)return!0;if(u===d)return i;if(l===s)return u===d-1&&t[u]==="";throw new Error("wtf?")}braceExpand(){return h2d(this.pattern,this.options)}parse(t){mRa(t);let r=this.options;if(t==="**")return XW;if(t==="")return"";let i,n=null;(i=t.match(fRS))?n=r.dot?pRS:dRS:(i=t.match(tRS))?n=(r.nocase?r.dot?aRS:nRS:r.dot?iRS:rRS)(i[1]):(i=t.match(_RS))?n=(r.nocase?r.dot?yRS:hRS:r.dot?vRS:bRS)(i):(i=t.match(oRS))?n=r.dot?sRS:uRS:(i=t.match(cRS))&&(n=lRS);let a=S5n.fromGlob(t,this.options).toMMPattern();return n&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:n}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?mRS:r.dot?PRS:jRS,n=new Set(r.nocase?["i"]:[]),a=t.map(d=>{let s=d.map(o=>{if(o instanceof RegExp)for(let c of o.flags.split(""))n.add(c);return typeof o=="string"?MRS(o):o===XW?XW:o._src});return s.forEach((o,c)=>{let b=s[c+1],g=s[c-1];o!==XW||g===XW||(g===void 0?b!==void 0&&b!==XW?s[c+1]="(?:\\/|"+i+"\\/)?"+b:s[c]=i:b===void 0?s[c-1]=g+"(?:\\/|"+i+")?":b!==XW&&(s[c-1]=g+"(?:\\/|\\/"+i+"\\/)"+b,s[c+1]=XW))}),s.filter(o=>o!==XW).join("/")}).join("|"),[u,l]=t.length>1?["(?:",")"]:["",""];a="^"+u+a+l+"$",this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let n=this.slashSplit(t);this.debug(this.pattern,"split",n);let a=this.set;this.debug(this.pattern,"set",a);let u=n[n.length-1];if(!u)for(let l=n.length-2;!u&&l>=0;l--)u=n[l];for(let l=0;l<a.length;l++){let d=a[l],s=n;if(i.matchBase&&d.length===1&&(s=[u]),this.matchOne(s,d,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return fk.defaults(t).Minimatch}};fk.AST=S5n;fk.Minimatch=GMe;fk.escape=D5n;fk.unescape=g$t;var F2d=require("url");var E5n=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,v2d=new Set,NGs=typeof process=="object"&&process?process:{},b2d=(e,t,r,i)=>{typeof NGs.emitWarning=="function"?NGs.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},SBo=globalThis.AbortController,y2d=globalThis.AbortSignal;if(typeof SBo>"u"){y2d=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},SBo=class{constructor(){t()}signal=new y2d;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let e=NGs.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=!1,b2d("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var ARS=e=>!v2d.has(e),qE2=Symbol("type"),NBi=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),g2d=e=>NBi(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?M5n:null:null,M5n=class extends Array{constructor(t){super(t),this.fill(0)}},FGs=class e{heap;length;static#e=!1;static create(t){let r=g2d(t);if(!r)return[];e.#e=!0;let i=new e(t,r);return e.#e=!1,i}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},jRa=class e{#e;#t;#r;#n;#i;#a;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#f;#u;#c;#l;#p;#_;#h;#v;#O;#y;#j;#w;#m;#g;#D;#P;#A;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#m,sizes:t.#j,keyMap:t.#u,keyList:t.#c,valList:t.#l,next:t.#p,prev:t.#_,get head(){return t.#h},get tail(){return t.#v},free:t.#O,isBackgroundFetch:r=>t.#b(r),backgroundFetch:(r,i,n,a)=>t.#z(r,i,n,a),moveToTail:r=>t.#N(r),indexes:r=>t.#q(r),rindexes:r=>t.#C(r),isStale:r=>t.#M(r)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#s}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#r}get onInsert(){return this.#n}get disposeAfter(){return this.#i}constructor(t){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:u,updateAgeOnHas:l,allowStale:d,dispose:s,onInsert:o,disposeAfter:c,noDisposeOnSet:b,noUpdateTTL:g,maxSize:O=0,maxEntrySize:m=0,sizeCalculation:w,fetchMethod:E,memoMethod:q,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:R,ignoreFetchAbort:G}=t;if(r!==0&&!NBi(r))throw new TypeError("max option must be a nonnegative integer");let I=r?g2d(r):Array;if(!I)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=O,this.maxEntrySize=m||this.#t,this.sizeCalculation=w,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(q!==void 0&&typeof q!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=q,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=E,this.#D=!!E,this.#u=new Map,this.#c=new Array(r).fill(void 0),this.#l=new Array(r).fill(void 0),this.#p=new I(r),this.#_=new I(r),this.#h=0,this.#v=0,this.#O=FGs.create(r),this.#s=0,this.#f=0,typeof s=="function"&&(this.#r=s),typeof o=="function"&&(this.#n=o),typeof c=="function"?(this.#i=c,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#g=!!this.#r,this.#A=!!this.#n,this.#P=!!this.#i,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!M,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#t!==0&&!NBi(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!NBi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!l,this.ttlResolution=NBi(n)||n===0?n:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!NBi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#d()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let L="LRU_CACHE_UNBOUNDED";ARS(L)&&(v2d.add(L),b2d("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",L,e))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#d(){let t=new M5n(this.#e),r=new M5n(this.#e);this.#m=t,this.#w=r,this.#S=(a,u,l=E5n.now())=>{if(r[a]=u!==0?l:0,t[a]=u,u!==0&&this.ttlAutopurge){let d=setTimeout(()=>{this.#M(a)&&this.#B(this.#c[a],"expire")},u+1);d.unref&&d.unref()}},this.#T=a=>{r[a]=t[a]!==0?E5n.now():0},this.#E=(a,u)=>{if(t[u]){let l=t[u],d=r[u];if(!l||!d)return;a.ttl=l,a.start=d,a.now=i||n();let s=a.now-d;a.remainingTTL=l-s}};let i=0,n=()=>{let a=E5n.now();if(this.ttlResolution>0){i=a;let u=setTimeout(()=>i=0,this.ttlResolution);u.unref&&u.unref()}return a};this.getRemainingTTL=a=>{let u=this.#u.get(a);if(u===void 0)return 0;let l=t[u],d=r[u];if(!l||!d)return 1/0;let s=(i||n())-d;return l-s},this.#M=a=>{let u=r[a],l=t[a];return!!l&&!!u&&(i||n())-u>l}}#T=()=>{};#E=()=>{};#S=()=>{};#M=()=>!1;#L(){let t=new M5n(this.#e);this.#f=0,this.#j=t,this.#I=r=>{this.#f-=t[r],t[r]=0},this.#U=(r,i,n,a)=>{if(this.#b(i))return 0;if(!NBi(n))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(n=a(i,r),!NBi(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#R=(r,i,n)=>{if(t[r]=i,this.#t){let a=this.#t-t[r];for(;this.#f>a;)this.#x(!0)}this.#f+=t[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#f)}}#I=t=>{};#R=(t,r,i)=>{};#U=(t,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#q({allowStale:t=this.allowStale}={}){if(this.#s)for(let r=this.#v;!(!this.#V(r)||((t||!this.#M(r))&&(yield r),r===this.#h));)r=this.#_[r]}*#C({allowStale:t=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#V(r)||((t||!this.#M(r))&&(yield r),r===this.#v));)r=this.#p[r]}#V(t){return t!==void 0&&this.#u.get(this.#c[t])===t}*entries(){for(let t of this.#q())this.#l[t]!==void 0&&this.#c[t]!==void 0&&!this.#b(this.#l[t])&&(yield[this.#c[t],this.#l[t]])}*rentries(){for(let t of this.#C())this.#l[t]!==void 0&&this.#c[t]!==void 0&&!this.#b(this.#l[t])&&(yield[this.#c[t],this.#l[t]])}*keys(){for(let t of this.#q()){let r=this.#c[t];r!==void 0&&!this.#b(this.#l[t])&&(yield r)}}*rkeys(){for(let t of this.#C()){let r=this.#c[t];r!==void 0&&!this.#b(this.#l[t])&&(yield r)}}*values(){for(let t of this.#q())this.#l[t]!==void 0&&!this.#b(this.#l[t])&&(yield this.#l[t])}*rvalues(){for(let t of this.#C())this.#l[t]!==void 0&&!this.#b(this.#l[t])&&(yield this.#l[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let i of this.#q()){let n=this.#l[i],a=this.#b(n)?n.__staleWhileFetching:n;if(a!==void 0&&t(a,this.#c[i],this))return this.get(this.#c[i],r)}}forEach(t,r=this){for(let i of this.#q()){let n=this.#l[i],a=this.#b(n)?n.__staleWhileFetching:n;a!==void 0&&t.call(r,a,this.#c[i],this)}}rforEach(t,r=this){for(let i of this.#C()){let n=this.#l[i],a=this.#b(n)?n.__staleWhileFetching:n;a!==void 0&&t.call(r,a,this.#c[i],this)}}purgeStale(){let t=!1;for(let r of this.#C({allowStale:!0}))this.#M(r)&&(this.#B(this.#c[r],"expire"),t=!0);return t}info(t){let r=this.#u.get(t);if(r===void 0)return;let i=this.#l[r],n=this.#b(i)?i.__staleWhileFetching:i;if(n===void 0)return;let a={value:n};if(this.#m&&this.#w){let u=this.#m[r],l=this.#w[r];if(u&&l){let d=u-(E5n.now()-l);a.ttl=d,a.start=Date.now()}}return this.#j&&(a.size=this.#j[r]),a}dump(){let t=[];for(let r of this.#q({allowStale:!0})){let i=this.#c[r],n=this.#l[r],a=this.#b(n)?n.__staleWhileFetching:n;if(a===void 0||i===void 0)continue;let u={value:a};if(this.#m&&this.#w){u.ttl=this.#m[r];let l=E5n.now()-this.#w[r];u.start=Math.floor(Date.now()-l)}this.#j&&(u.size=this.#j[r]),t.unshift([i,u])}return t}load(t){this.clear();for(let[r,i]of t){if(i.start){let n=Date.now()-i.start;i.start=E5n.now()-n}this.set(r,i.value,i)}}set(t,r,i={}){if(r===void 0)return this.delete(t),this;let{ttl:n=this.ttl,start:a,noDisposeOnSet:u=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:d}=i,{noUpdateTTL:s=this.noUpdateTTL}=i,o=this.#U(t,r,i.size||0,l);if(this.maxEntrySize&&o>this.maxEntrySize)return d&&(d.set="miss",d.maxEntrySizeExceeded=!0),this.#B(t,"set"),this;let c=this.#s===0?void 0:this.#u.get(t);if(c===void 0)c=this.#s===0?this.#v:this.#O.length!==0?this.#O.pop():this.#s===this.#e?this.#x(!1):this.#s,this.#c[c]=t,this.#l[c]=r,this.#u.set(t,c),this.#p[this.#v]=c,this.#_[c]=this.#v,this.#v=c,this.#s++,this.#R(c,o,d),d&&(d.set="add"),s=!1,this.#A&&this.#n?.(r,t,"add");else{this.#N(c);let b=this.#l[c];if(r!==b){if(this.#D&&this.#b(b)){b.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=b;g!==void 0&&!u&&(this.#g&&this.#r?.(g,t,"set"),this.#P&&this.#y?.push([g,t,"set"]))}else u||(this.#g&&this.#r?.(b,t,"set"),this.#P&&this.#y?.push([b,t,"set"]));if(this.#I(c),this.#R(c,o,d),this.#l[c]=r,d){d.set="replace";let g=b&&this.#b(b)?b.__staleWhileFetching:b;g!==void 0&&(d.oldValue=g)}}else d&&(d.set="update");this.#A&&this.onInsert?.(r,t,r===b?"update":"replace")}if(n!==0&&!this.#m&&this.#d(),this.#m&&(s||this.#S(c,n,a),d&&this.#E(d,c)),!u&&this.#P&&this.#y){let b=this.#y,g;for(;g=b?.shift();)this.#i?.(...g)}return this}pop(){try{for(;this.#s;){let t=this.#l[this.#h];if(this.#x(!0),this.#b(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#P&&this.#y){let t=this.#y,r;for(;r=t?.shift();)this.#i?.(...r)}}}#x(t){let r=this.#h,i=this.#c[r],n=this.#l[r];return this.#D&&this.#b(n)?n.__abortController.abort(new Error("evicted")):(this.#g||this.#P)&&(this.#g&&this.#r?.(n,i,"evict"),this.#P&&this.#y?.push([n,i,"evict"])),this.#I(r),t&&(this.#c[r]=void 0,this.#l[r]=void 0,this.#O.push(r)),this.#s===1?(this.#h=this.#v=0,this.#O.length=0):this.#h=this.#p[r],this.#u.delete(i),this.#s--,r}has(t,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,a=this.#u.get(t);if(a!==void 0){let u=this.#l[a];if(this.#b(u)&&u.__staleWhileFetching===void 0)return!1;if(this.#M(a))n&&(n.has="stale",this.#E(n,a));else return i&&this.#T(a),n&&(n.has="hit",this.#E(n,a)),!0}else n&&(n.has="miss");return!1}peek(t,r={}){let{allowStale:i=this.allowStale}=r,n=this.#u.get(t);if(n===void 0||!i&&this.#M(n))return;let a=this.#l[n];return this.#b(a)?a.__staleWhileFetching:a}#z(t,r,i,n){let a=r===void 0?void 0:this.#l[r];if(this.#b(a))return a;let u=new SBo,{signal:l}=i;l?.addEventListener("abort",()=>u.abort(l.reason),{signal:u.signal});let d={signal:u.signal,options:i,context:n},s=(m,w=!1)=>{let{aborted:E}=u.signal,q=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(E&&!w?(i.status.fetchAborted=!0,i.status.fetchError=u.signal.reason,q&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),E&&!q&&!w)return c(u.signal.reason);let M=g;return this.#l[r]===g&&(m===void 0?M.__staleWhileFetching?this.#l[r]=M.__staleWhileFetching:this.#B(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,m,d.options))),m},o=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),c(m)),c=m=>{let{aborted:w}=u.signal,E=w&&i.allowStaleOnFetchAbort,q=E||i.allowStaleOnFetchRejection,M=q||i.noDeleteOnFetchRejection,D=g;if(this.#l[r]===g&&(!M||D.__staleWhileFetching===void 0?this.#B(t,"fetch"):E||(this.#l[r]=D.__staleWhileFetching)),q)return i.status&&D.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),D.__staleWhileFetching;if(D.__returned===D)throw m},b=(m,w)=>{let E=this.#a?.(t,a,d);E&&E instanceof Promise&&E.then(q=>m(q===void 0?void 0:q),w),u.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=q=>s(q,!0)))})};i.status&&(i.status.fetchDispatched=!0);let g=new Promise(b).then(s,o),O=Object.assign(g,{__abortController:u,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(t,O,{...d.options,status:void 0}),r=this.#u.get(t)):this.#l[r]=O,O}#b(t){if(!this.#D)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof SBo}async fetch(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:u=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:d=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:o=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:m,forceRefresh:w=!1,status:E,signal:q}=r;if(!this.#D)return E&&(E.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,status:E});let M={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:a,ttl:u,noDisposeOnSet:l,size:d,sizeCalculation:s,noUpdateTTL:o,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:O,ignoreFetchAbort:g,status:E,signal:q},D=this.#u.get(t);if(D===void 0){E&&(E.fetch="miss");let C=this.#z(t,D,M,m);return C.__returned=C}else{let C=this.#l[D];if(this.#b(C)){let V=i&&C.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",V&&(E.returnedStale=!0)),V?C.__staleWhileFetching:C.__returned=C}let R=this.#M(D);if(!w&&!R)return E&&(E.fetch="hit"),this.#N(D),n&&this.#T(D),E&&this.#E(E,D),C;let G=this.#z(t,D,M,m),L=G.__staleWhileFetching!==void 0&&i;return E&&(E.fetch=R?"stale":"refresh",L&&R&&(E.returnedStale=!0)),L?G.__staleWhileFetching:G.__returned=G}}async forceFetch(t,r={}){let i=await this.fetch(t,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,r={}){let i=this.#o;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:a,...u}=r,l=this.get(t,u);if(!a&&l!==void 0)return l;let d=i(t,l,{options:u,context:n});return this.set(t,d,u),d}get(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:u}=r,l=this.#u.get(t);if(l!==void 0){let d=this.#l[l],s=this.#b(d);return u&&this.#E(u,l),this.#M(l)?(u&&(u.get="stale"),s?(u&&i&&d.__staleWhileFetching!==void 0&&(u.returnedStale=!0),i?d.__staleWhileFetching:void 0):(a||this.#B(t,"expire"),u&&i&&(u.returnedStale=!0),i?d:void 0)):(u&&(u.get="hit"),s?d.__staleWhileFetching:(this.#N(l),n&&this.#T(l),d))}else u&&(u.get="miss")}#W(t,r){this.#_[r]=t,this.#p[t]=r}#N(t){t!==this.#v&&(t===this.#h?this.#h=this.#p[t]:this.#W(this.#_[t],this.#p[t]),this.#W(this.#v,t),this.#v=t)}delete(t){return this.#B(t,"delete")}#B(t,r){let i=!1;if(this.#s!==0){let n=this.#u.get(t);if(n!==void 0)if(i=!0,this.#s===1)this.#F(r);else{this.#I(n);let a=this.#l[n];if(this.#b(a)?a.__abortController.abort(new Error("deleted")):(this.#g||this.#P)&&(this.#g&&this.#r?.(a,t,r),this.#P&&this.#y?.push([a,t,r])),this.#u.delete(t),this.#c[n]=void 0,this.#l[n]=void 0,n===this.#v)this.#v=this.#_[n];else if(n===this.#h)this.#h=this.#p[n];else{let u=this.#_[n];this.#p[u]=this.#p[n];let l=this.#p[n];this.#_[l]=this.#_[n]}this.#s--,this.#O.push(n)}}if(this.#P&&this.#y?.length){let n=this.#y,a;for(;a=n?.shift();)this.#i?.(...a)}return i}clear(){return this.#F("delete")}#F(t){for(let r of this.#C({allowStale:!0})){let i=this.#l[r];if(this.#b(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#c[r];this.#g&&this.#r?.(i,n,t),this.#P&&this.#y?.push([i,n,t])}}if(this.#u.clear(),this.#l.fill(void 0),this.#c.fill(void 0),this.#m&&this.#w&&(this.#m.fill(0),this.#w.fill(0)),this.#j&&this.#j.fill(0),this.#h=0,this.#v=0,this.#O.length=0,this.#f=0,this.#s=0,this.#P&&this.#y){let r=this.#y,i;for(;i=r?.shift();)this.#i?.(...i)}}};var T5n=require("path"),A2d=require("url"),Her=require("fs"),FRS=si(require("fs"),1),UBi=require("fs/promises");var CBo=require("events"),GGs=si(require("stream"),1),w2d=require("string_decoder"),O2d=typeof process=="object"&&process?process:{stdout:null,stderr:null},qRS=e=>!!e&&typeof e=="object"&&(e instanceof LBi||e instanceof GGs.default||TRS(e)||CRS(e)),TRS=e=>!!e&&typeof e=="object"&&e instanceof CBo.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==GGs.default.Writable.prototype.pipe,CRS=e=>!!e&&typeof e=="object"&&e instanceof CBo.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",qgi=Symbol("EOF"),Tgi=Symbol("maybeEmitEnd"),FBi=Symbol("emittedEnd"),DBo=Symbol("emittingEnd"),wRa=Symbol("emittedError"),EBo=Symbol("closed"),m2d=Symbol("read"),MBo=Symbol("flush"),P2d=Symbol("flushChunk"),O$t=Symbol("encoding"),A5n=Symbol("decoder"),aL=Symbol("flowing"),SRa=Symbol("paused"),q5n=Symbol("resume"),oL=Symbol("buffer"),dk=Symbol("pipes"),uL=Symbol("bufferLength"),LGs=Symbol("bufferPush"),ABo=Symbol("bufferShift"),fJ=Symbol("objectMode"),x3=Symbol("destroyed"),UGs=Symbol("error"),VGs=Symbol("emitData"),j2d=Symbol("emitEnd"),WGs=Symbol("emitEnd2"),Ver=Symbol("async"),HGs=Symbol("abort"),qBo=Symbol("aborted"),DRa=Symbol("signal"),dki=Symbol("dataListeners"),QMe=Symbol("discarded"),ERa=e=>Promise.resolve().then(e),BRS=e=>e(),IRS=e=>e==="end"||e==="finish"||e==="prefinish",zRS=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,RRS=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),TBo=class{src;dest;opts;ondrain;constructor(t,r,i){this.src=t,this.dest=r,this.opts=i,this.ondrain=()=>t[q5n](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},$Gs=class extends TBo{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,r,i){super(t,r,i),this.proxyErrors=n=>r.emit("error",n),t.on("error",this.proxyErrors)}},xRS=e=>!!e.objectMode,NRS=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",LBi=class extends CBo.EventEmitter{[aL]=!1;[SRa]=!1;[dk]=[];[oL]=[];[fJ];[O$t];[Ver];[A5n];[qgi]=!1;[FBi]=!1;[DBo]=!1;[EBo]=!1;[wRa]=null;[uL]=0;[x3]=!1;[DRa];[qBo]=!1;[dki]=0;[QMe]=!1;writable=!0;readable=!0;constructor(...t){let r=t[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");xRS(r)?(this[fJ]=!0,this[O$t]=null):NRS(r)?(this[O$t]=r.encoding,this[fJ]=!1):(this[fJ]=!1,this[O$t]=null),this[Ver]=!!r.async,this[A5n]=this[O$t]?new w2d.StringDecoder(this[O$t]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[oL]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[dk]});let{signal:i}=r;i&&(this[DRa]=i,i.aborted?this[HGs]():i.addEventListener("abort",()=>this[HGs]()))}get bufferLength(){return this[uL]}get encoding(){return this[O$t]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[fJ]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ver]}set async(t){this[Ver]=this[Ver]||!!t}[HGs](){this[qBo]=!0,this.emit("abort",this[DRa]?.reason),this.destroy(this[DRa]?.reason)}get aborted(){return this[qBo]}set aborted(t){}write(t,r,i){if(this[qBo])return!1;if(this[qgi])throw new Error("write after end");if(this[x3])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let n=this[Ver]?ERa:BRS;if(!this[fJ]&&!Buffer.isBuffer(t)){if(RRS(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(zRS(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[fJ]?(this[aL]&&this[uL]!==0&&this[MBo](!0),this[aL]?this.emit("data",t):this[LGs](t),this[uL]!==0&&this.emit("readable"),i&&n(i),this[aL]):t.length?(typeof t=="string"&&!(r===this[O$t]&&!this[A5n]?.lastNeed)&&(t=Buffer.from(t,r)),Buffer.isBuffer(t)&&this[O$t]&&(t=this[A5n].write(t)),this[aL]&&this[uL]!==0&&this[MBo](!0),this[aL]?this.emit("data",t):this[LGs](t),this[uL]!==0&&this.emit("readable"),i&&n(i),this[aL]):(this[uL]!==0&&this.emit("readable"),i&&n(i),this[aL])}read(t){if(this[x3])return null;if(this[QMe]=!1,this[uL]===0||t===0||t&&t>this[uL])return this[Tgi](),null;this[fJ]&&(t=null),this[oL].length>1&&!this[fJ]&&(this[oL]=[this[O$t]?this[oL].join(""):Buffer.concat(this[oL],this[uL])]);let r=this[m2d](t||null,this[oL][0]);return this[Tgi](),r}[m2d](t,r){if(this[fJ])this[ABo]();else{let i=r;t===i.length||t===null?this[ABo]():typeof i=="string"?(this[oL][0]=i.slice(t),r=i.slice(0,t),this[uL]-=t):(this[oL][0]=i.subarray(t),r=i.subarray(0,t),this[uL]-=t)}return this.emit("data",r),!this[oL].length&&!this[qgi]&&this.emit("drain"),r}end(t,r,i){return typeof t=="function"&&(i=t,t=void 0),typeof r=="function"&&(i=r,r="utf8"),t!==void 0&&this.write(t,r),i&&this.once("end",i),this[qgi]=!0,this.writable=!1,(this[aL]||!this[SRa])&&this[Tgi](),this}[q5n](){this[x3]||(!this[dki]&&!this[dk].length&&(this[QMe]=!0),this[SRa]=!1,this[aL]=!0,this.emit("resume"),this[oL].length?this[MBo]():this[qgi]?this[Tgi]():this.emit("drain"))}resume(){return this[q5n]()}pause(){this[aL]=!1,this[SRa]=!0,this[QMe]=!1}get destroyed(){return this[x3]}get flowing(){return this[aL]}get paused(){return this[SRa]}[LGs](t){this[fJ]?this[uL]+=1:this[uL]+=t.length,this[oL].push(t)}[ABo](){return this[fJ]?this[uL]-=1:this[uL]-=this[oL][0].length,this[oL].shift()}[MBo](t=!1){do;while(this[P2d](this[ABo]())&&this[oL].length);!t&&!this[oL].length&&!this[qgi]&&this.emit("drain")}[P2d](t){return this.emit("data",t),this[aL]}pipe(t,r){if(this[x3])return t;this[QMe]=!1;let i=this[FBi];return r=r||{},t===O2d.stdout||t===O2d.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&t.end():(this[dk].push(r.proxyErrors?new $Gs(this,t,r):new TBo(this,t,r)),this[Ver]?ERa(()=>this[q5n]()):this[q5n]()),t}unpipe(t){let r=this[dk].find(i=>i.dest===t);r&&(this[dk].length===1?(this[aL]&&this[dki]===0&&(this[aL]=!1),this[dk]=[]):this[dk].splice(this[dk].indexOf(r),1),r.unpipe())}addListener(t,r){return this.on(t,r)}on(t,r){let i=super.on(t,r);if(t==="data")this[QMe]=!1,this[dki]++,!this[dk].length&&!this[aL]&&this[q5n]();else if(t==="readable"&&this[uL]!==0)super.emit("readable");else if(IRS(t)&&this[FBi])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[wRa]){let n=r;this[Ver]?ERa(()=>n.call(this,this[wRa])):n.call(this,this[wRa])}return i}removeListener(t,r){return this.off(t,r)}off(t,r){let i=super.off(t,r);return t==="data"&&(this[dki]=this.listeners("data").length,this[dki]===0&&!this[QMe]&&!this[dk].length&&(this[aL]=!1)),i}removeAllListeners(t){let r=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[dki]=0,!this[QMe]&&!this[dk].length&&(this[aL]=!1)),r}get emittedEnd(){return this[FBi]}[Tgi](){!this[DBo]&&!this[FBi]&&!this[x3]&&this[oL].length===0&&this[qgi]&&(this[DBo]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[EBo]&&this.emit("close"),this[DBo]=!1)}emit(t,...r){let i=r[0];if(t!=="error"&&t!=="close"&&t!==x3&&this[x3])return!1;if(t==="data")return!this[fJ]&&!i?!1:this[Ver]?(ERa(()=>this[VGs](i)),!0):this[VGs](i);if(t==="end")return this[j2d]();if(t==="close"){if(this[EBo]=!0,!this[FBi]&&!this[x3])return!1;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(t==="error"){this[wRa]=i,super.emit(UGs,i);let a=!this[DRa]||this.listeners("error").length?super.emit("error",i):!1;return this[Tgi](),a}else if(t==="resume"){let a=super.emit("resume");return this[Tgi](),a}else if(t==="finish"||t==="prefinish"){let a=super.emit(t);return this.removeAllListeners(t),a}let n=super.emit(t,...r);return this[Tgi](),n}[VGs](t){for(let i of this[dk])i.dest.write(t)===!1&&this.pause();let r=this[QMe]?!1:super.emit("data",t);return this[Tgi](),r}[j2d](){return this[FBi]?!1:(this[FBi]=!0,this.readable=!1,this[Ver]?(ERa(()=>this[WGs]()),!0):this[WGs]())}[WGs](){if(this[A5n]){let r=this[A5n].end();if(r){for(let i of this[dk])i.dest.write(r);this[QMe]||super.emit("data",r)}}for(let r of this[dk])r.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[fJ]||(t.dataLength=0);let r=this.promise();return this.on("data",i=>{t.push(i),this[fJ]||(t.dataLength+=i.length)}),await r,t}async concat(){if(this[fJ])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[O$t]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,r)=>{this.on(x3,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[QMe]=!1;let t=!1,r=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return r();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[qgi])return r();let a,u,l=c=>{this.off("data",d),this.off("end",s),this.off(x3,o),r(),u(c)},d=c=>{this.off("error",l),this.off("end",s),this.off(x3,o),this.pause(),a({value:c,done:!!this[qgi]})},s=()=>{this.off("error",l),this.off("data",d),this.off(x3,o),r(),a({done:!0,value:void 0})},o=()=>l(new Error("stream destroyed"));return new Promise((c,b)=>{u=b,a=c,this.once(x3,o),this.once("error",l),this.once("end",s),this.once("data",d)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[QMe]=!1;let t=!1,r=()=>(this.pause(),this.off(UGs,r),this.off(x3,r),this.off("end",r),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return r();let n=this.read();return n===null?r():{done:!1,value:n}};return this.once("end",r),this.once(UGs,r),this.once(x3,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(t){if(this[x3])return t?this.emit("error",t):this.emit(x3),this;this[x3]=!0,this[QMe]=!0,this[oL].length=0,this[uL]=0;let r=this;return typeof r.close=="function"&&!this[EBo]&&r.close(),t?this.emit("error",t):this.emit(x3),this}static get isStream(){return qRS}};var LRS=Her.realpathSync.native,ARa={lstatSync:Her.lstatSync,readdir:Her.readdir,readdirSync:Her.readdirSync,readlinkSync:Her.readlinkSync,realpathSync:LRS,promises:{lstat:UBi.lstat,readdir:UBi.readdir,readlink:UBi.readlink,realpath:UBi.realpath}},q2d=e=>!e||e===ARa||e===FRS?ARa:{...ARa,...e,promises:{...ARa.promises,...e.promises||{}}},T2d=/^\\\\\?\\([a-z]:)\\?$/i,URS=e=>e.replace(/\//g,"\\").replace(T2d,"$1\\"),VRS=/[\\\/]/,oNe=0,C2d=1,B2d=2,Wer=4,I2d=6,z2d=8,pki=10,R2d=12,aNe=15,MRa=~aNe,QGs=16,S2d=32,qRa=64,m$t=128,BBo=256,zBo=512,D2d=qRa|m$t|zBo,WRS=1023,JGs=e=>e.isFile()?z2d:e.isDirectory()?Wer:e.isSymbolicLink()?pki:e.isCharacterDevice()?B2d:e.isBlockDevice()?I2d:e.isSocket()?R2d:e.isFIFO()?C2d:oNe,E2d=new Map,TRa=e=>{let t=E2d.get(e);if(t)return t;let r=e.normalize("NFKD");return E2d.set(e,r),r},M2d=new Map,IBo=e=>{let t=M2d.get(e);if(t)return t;let r=TRa(e.toLowerCase());return M2d.set(e,r),r},RBo=class extends jRa{constructor(){super({max:256})}},KGs=class extends jRa{constructor(t=16*1024){super({maxSize:t,sizeCalculation:r=>r.length+1})}},x2d=Symbol("PathScurry setAsCwd"),dJ=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#o;get rdev(){return this.#o}#s;get blksize(){return this.#s}#f;get ino(){return this.#f}#u;get size(){return this.#u}#c;get blocks(){return this.#c}#l;get atimeMs(){return this.#l}#p;get mtimeMs(){return this.#p}#_;get ctimeMs(){return this.#_}#h;get birthtimeMs(){return this.#h}#v;get atime(){return this.#v}#O;get mtime(){return this.#O}#y;get ctime(){return this.#y}#j;get birthtime(){return this.#j}#w;#m;#g;#D;#P;#A;#d;#T;#E;#S;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,r=oNe,i,n,a,u,l){this.name=t,this.#w=a?IBo(t):TRa(t),this.#d=r&WRS,this.nocase=a,this.roots=n,this.root=i||this,this.#T=u,this.#g=l.fullpath,this.#P=l.relative,this.#A=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=q2d(l.fs)}depth(){return this.#m!==void 0?this.#m:this.parent?this.#m=this.parent.depth()+1:this.#m=0}childrenCache(){return this.#T}resolve(t){if(!t)return this;let r=this.getRootString(t),n=t.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#M(n):this.#M(n)}#M(t){let r=this;for(let i of t)r=r.child(i);return r}children(){let t=this.#T.get(this);if(t)return t;let r=Object.assign([],{provisional:0});return this.#T.set(this,r),this.#d&=~QGs,r}child(t,r){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let i=this.children(),n=this.nocase?IBo(t):TRa(t);for(let d of i)if(d.#w===n)return d;let a=this.parent?this.sep:"",u=this.#g?this.#g+a+t:void 0,l=this.newChild(t,oNe,{...r,parent:this,fullpath:u});return this.canReaddir()||(l.#d|=m$t),i.push(l),l}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let t=this.name,r=this.parent;if(!r)return this.#P=this.name;let i=r.relative();return i+(!i||!r.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let t=this.name,r=this.parent;if(!r)return this.#A=this.fullpathPosix();let i=r.relativePosix();return i+(!i||!r.parent?"":"/")+t}fullpath(){if(this.#g!==void 0)return this.#g;let t=this.name,r=this.parent;if(!r)return this.#g=this.name;let n=r.fullpath()+(r.parent?this.sep:"")+t;return this.#g=n}fullpathPosix(){if(this.#D!==void 0)return this.#D;if(this.sep==="/")return this.#D=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#D=`//?/${n}`:this.#D=n}let t=this.parent,r=t.fullpathPosix(),i=r+(!r||!t.parent?"":"/")+this.name;return this.#D=i}isUnknown(){return(this.#d&aNe)===oNe}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#d&aNe)===z2d}isDirectory(){return(this.#d&aNe)===Wer}isCharacterDevice(){return(this.#d&aNe)===B2d}isBlockDevice(){return(this.#d&aNe)===I2d}isFIFO(){return(this.#d&aNe)===C2d}isSocket(){return(this.#d&aNe)===R2d}isSymbolicLink(){return(this.#d&pki)===pki}lstatCached(){return this.#d&S2d?this:void 0}readlinkCached(){return this.#E}realpathCached(){return this.#S}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#E)return!0;if(!this.parent)return!1;let t=this.#d&aNe;return!(t!==oNe&&t!==pki||this.#d&BBo||this.#d&m$t)}calledReaddir(){return!!(this.#d&QGs)}isENOENT(){return!!(this.#d&m$t)}isNamed(t){return this.nocase?this.#w===IBo(t):this.#w===TRa(t)}async readlink(){let t=this.#E;if(t)return t;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(r);if(i)return this.#E=i}catch(r){this.#x(r.code);return}}readlinkSync(){let t=this.#E;if(t)return t;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(r);if(i)return this.#E=i}catch(r){this.#x(r.code);return}}#L(t){this.#d|=QGs;for(let r=t.provisional;r<t.length;r++){let i=t[r];i&&i.#I()}}#I(){this.#d&m$t||(this.#d=(this.#d|m$t)&MRa,this.#R())}#R(){let t=this.children();t.provisional=0;for(let r of t)r.#I()}#U(){this.#d|=zBo,this.#q()}#q(){if(this.#d&qRa)return;let t=this.#d;(t&aNe)===Wer&&(t&=MRa),this.#d=t|qRa,this.#R()}#C(t=""){t==="ENOTDIR"||t==="EPERM"?this.#q():t==="ENOENT"?this.#I():this.children().provisional=0}#V(t=""){t==="ENOTDIR"?this.parent.#q():t==="ENOENT"&&this.#I()}#x(t=""){let r=this.#d;r|=BBo,t==="ENOENT"&&(r|=m$t),(t==="EINVAL"||t==="UNKNOWN")&&(r&=MRa),this.#d=r,t==="ENOTDIR"&&this.parent&&this.parent.#q()}#z(t,r){return this.#W(t,r)||this.#b(t,r)}#b(t,r){let i=JGs(t),n=this.newChild(t.name,i,{parent:this}),a=n.#d&aNe;return a!==Wer&&a!==pki&&a!==oNe&&(n.#d|=qRa),r.unshift(n),r.provisional++,n}#W(t,r){for(let i=r.provisional;i<r.length;i++){let n=r[i];if((this.nocase?IBo(t.name):TRa(t.name))===n.#w)return this.#N(t,n,i,r)}}#N(t,r,i,n){let a=r.name;return r.#d=r.#d&MRa|JGs(t),a!==t.name&&(r.name=t.name),i!==n.provisional&&(i===n.length-1?n.pop():n.splice(i,1),n.unshift(r)),n.provisional++,r}async lstat(){if((this.#d&m$t)===0)try{return this.#B(await this.#e.promises.lstat(this.fullpath())),this}catch(t){this.#V(t.code)}}lstatSync(){if((this.#d&m$t)===0)try{return this.#B(this.#e.lstatSync(this.fullpath())),this}catch(t){this.#V(t.code)}}#B(t){let{atime:r,atimeMs:i,birthtime:n,birthtimeMs:a,blksize:u,blocks:l,ctime:d,ctimeMs:s,dev:o,gid:c,ino:b,mode:g,mtime:O,mtimeMs:m,nlink:w,rdev:E,size:q,uid:M}=t;this.#v=r,this.#l=i,this.#j=n,this.#h=a,this.#s=u,this.#c=l,this.#y=d,this.#_=s,this.#t=o,this.#a=c,this.#f=b,this.#r=g,this.#O=O,this.#p=m,this.#n=w,this.#o=E,this.#u=q,this.#i=M;let D=JGs(t);this.#d=this.#d&MRa|D|S2d,D!==oNe&&D!==Wer&&D!==pki&&(this.#d|=qRa)}#F=[];#$=!1;#G(t){this.#$=!1;let r=this.#F.slice();this.#F.length=0,r.forEach(i=>i(null,t))}readdirCB(t,r=!1){if(!this.canReaddir()){r?t(null,[]):queueMicrotask(()=>t(null,[]));return}let i=this.children();if(this.calledReaddir()){let a=i.slice(0,i.provisional);r?t(null,a):queueMicrotask(()=>t(null,a));return}if(this.#F.push(t),this.#$)return;this.#$=!0;let n=this.fullpath();this.#e.readdir(n,{withFileTypes:!0},(a,u)=>{if(a)this.#C(a.code),i.provisional=0;else{for(let l of u)this.#z(l,i);this.#L(i)}this.#G(i.slice(0,i.provisional))})}#H;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();if(this.#H)await this.#H;else{let i=()=>{};this.#H=new Promise(n=>i=n);try{for(let n of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#z(n,t);this.#L(t)}catch(n){this.#C(n.code),t.provisional=0}this.#H=void 0,i()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();try{for(let i of this.#e.readdirSync(r,{withFileTypes:!0}))this.#z(i,t);this.#L(t)}catch(i){this.#C(i.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#d&D2d)return!1;let t=aNe&this.#d;return t===oNe||t===Wer||t===pki}shouldWalk(t,r){return(this.#d&Wer)===Wer&&!(this.#d&D2d)&&!t.has(this)&&(!r||r(this))}async realpath(){if(this.#S)return this.#S;if(!((zBo|BBo|m$t)&this.#d))try{let t=await this.#e.promises.realpath(this.fullpath());return this.#S=this.resolve(t)}catch{this.#U()}}realpathSync(){if(this.#S)return this.#S;if(!((zBo|BBo|m$t)&this.#d))try{let t=this.#e.realpathSync(this.fullpath());return this.#S=this.resolve(t)}catch{this.#U()}}[x2d](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let r=new Set([]),i=[],n=this;for(;n&&n.parent;)r.add(n),n.#P=i.join(this.sep),n.#A=i.join("/"),n=n.parent,i.push("..");for(n=t;n&&n.parent&&!r.has(n);)n.#P=void 0,n.#A=void 0,n=n.parent}},xBo=class e extends dJ{sep="\\";splitSep=VRS;constructor(t,r=oNe,i,n,a,u,l){super(t,r,i,n,a,u,l)}newChild(t,r=oNe,i={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(t){return T5n.win32.parse(t).root}getRoot(t){if(t=URS(t.toUpperCase()),t===this.root.name)return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(t,r))return this.roots[t]=i;return this.roots[t]=new C5n(t,this).root}sameRoot(t,r=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(T2d,"$1\\"),t===r}},NBo=class e extends dJ{splitSep="/";sep="/";constructor(t,r=oNe,i,n,a,u,l){super(t,r,i,n,a,u,l)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,r=oNe,i={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},FBo=class{root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(t=process.cwd(),r,i,{nocase:n,childrenCacheSize:a=16*1024,fs:u=ARa}={}){this.#n=q2d(u),(t instanceof URL||t.startsWith("file://"))&&(t=(0,A2d.fileURLToPath)(t));let l=r.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new RBo,this.#t=new RBo,this.#r=new KGs(a);let d=l.substring(this.rootPath.length).split(i);if(d.length===1&&!d[0]&&d.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let s=this.root,o=d.length-1,c=r.sep,b=this.rootPath,g=!1;for(let O of d){let m=o--;s=s.child(O,{relative:new Array(m).fill("..").join(c),relativePosix:new Array(m).fill("..").join("/"),fullpath:b+=(g?"":c)+O}),g=!0}this.cwd=s}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#r}resolve(...t){let r="";for(let a=t.length-1;a>=0;a--){let u=t[a];if(!(!u||u===".")&&(r=r?`${u}/${r}`:u,this.isAbsolute(u)))break}let i=this.#e.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpath();return this.#e.set(r,n),n}resolvePosix(...t){let r="";for(let a=t.length-1;a>=0;a--){let u=t[a];if(!(!u||u===".")&&(r=r?`${u}/${r}`:u,this.isAbsolute(u)))break}let i=this.#t.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,n),n}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd);let{withFileTypes:i}=r;if(t.canReaddir()){let n=await t.readdir();return i?n:n.map(a=>a.name)}else return[]}readdirSync(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd);let{withFileTypes:i=!0}=r;return t.canReaddir()?i?t.readdirSync():t.readdirSync().map(n=>n.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t.withFileTypes,t=this.cwd);let i=await t.readlink();return r?i:i?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t.withFileTypes,t=this.cwd);let i=t.readlinkSync();return r?i:i?.fullpath()}async realpath(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t.withFileTypes,t=this.cwd);let i=await t.realpath();return r?i:i?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t.withFileTypes,t=this.cwd);let i=t.realpathSync();return r?i:i?.fullpath()}async walk(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:a,walkFilter:u}=r,l=[];(!a||a(t))&&l.push(i?t:t.fullpath());let d=new Set,s=(c,b)=>{d.add(c),c.readdirCB((g,O)=>{if(g)return b(g);let m=O.length;if(!m)return b();let w=()=>{--m===0&&b()};for(let E of O)(!a||a(E))&&l.push(i?E:E.fullpath()),n&&E.isSymbolicLink()?E.realpath().then(q=>q?.isUnknown()?q.lstat():q).then(q=>q?.shouldWalk(d,u)?s(q,w):w()):E.shouldWalk(d,u)?s(E,w):w()},!0)},o=t;return new Promise((c,b)=>{s(o,g=>{if(g)return b(g);c(l)})})}walkSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:a,walkFilter:u}=r,l=[];(!a||a(t))&&l.push(i?t:t.fullpath());let d=new Set([t]);for(let s of d){let o=s.readdirSync();for(let c of o){(!a||a(c))&&l.push(i?c:c.fullpath());let b=c;if(c.isSymbolicLink()){if(!(n&&(b=c.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(d,u)&&d.add(b)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,r={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd),this.stream(t,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:a,walkFilter:u}=r;(!a||a(t))&&(yield i?t:t.fullpath());let l=new Set([t]);for(let d of l){let s=d.readdirSync();for(let o of s){(!a||a(o))&&(yield i?o:o.fullpath());let c=o;if(o.isSymbolicLink()){if(!(n&&(c=o.realpathSync())))continue;c.isUnknown()&&c.lstatSync()}c.shouldWalk(l,u)&&l.add(c)}}}stream(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:a,walkFilter:u}=r,l=new LBi({objectMode:!0});(!a||a(t))&&l.write(i?t:t.fullpath());let d=new Set,s=[t],o=0,c=()=>{let b=!1;for(;!b;){let g=s.shift();if(!g){o===0&&l.end();return}o++,d.add(g);let O=(w,E,q=!1)=>{if(w)return l.emit("error",w);if(n&&!q){let M=[];for(let D of E)D.isSymbolicLink()&&M.push(D.realpath().then(C=>C?.isUnknown()?C.lstat():C));if(M.length){Promise.all(M).then(()=>O(null,E,!0));return}}for(let M of E)M&&(!a||a(M))&&(l.write(i?M:M.fullpath())||(b=!0));o--;for(let M of E){let D=M.realpathCached()||M;D.shouldWalk(d,u)&&s.push(D)}b&&!l.flowing?l.once("drain",c):m||c()},m=!0;g.readdirCB(O,!0),m=!1}};return c(),l}streamSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof dJ||(r=t,t=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:a,walkFilter:u}=r,l=new LBi({objectMode:!0}),d=new Set;(!a||a(t))&&l.write(i?t:t.fullpath());let s=[t],o=0,c=()=>{let b=!1;for(;!b;){let g=s.shift();if(!g){o===0&&l.end();return}o++,d.add(g);let O=g.readdirSync();for(let m of O)(!a||a(m))&&(l.write(i?m:m.fullpath())||(b=!0));o--;for(let m of O){let w=m;if(m.isSymbolicLink()){if(!(n&&(w=m.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(d,u)&&s.push(w)}}b&&!l.flowing&&l.once("drain",c)};return c(),l}chdir(t=this.cwd){let r=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[x2d](r)}},C5n=class extends FBo{sep="\\";constructor(t=process.cwd(),r={}){let{nocase:i=!0}=r;super(t,T5n.win32,"\\",{...r,nocase:i}),this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(t){return T5n.win32.parse(t).root.toUpperCase()}newRoot(t){return new xBo(this.rootPath,Wer,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},B5n=class extends FBo{sep="/";constructor(t=process.cwd(),r={}){let{nocase:i=!1}=r;super(t,T5n.posix,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(t){return"/"}newRoot(t){return new NBo(this.rootPath,Wer,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},CRa=class extends B5n{constructor(t=process.cwd(),r={}){let{nocase:i=!0}=r;super(t,{...r,nocase:i})}},zE2=process.platform==="win32"?xBo:NBo,N2d=process.platform==="win32"?C5n:process.platform==="darwin"?CRa:B5n;var HRS=e=>e.length>=1,$RS=e=>e.length>=1,I5n=class e{#e;#t;#r;length;#n;#i;#a;#o;#s;#f;#u=!0;constructor(t,r,i,n){if(!HRS(t))throw new TypeError("empty pattern list");if(!$RS(r))throw new TypeError("empty glob list");if(r.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=t,this.#t=r,this.#r=i,this.#n=n,this.#r===0){if(this.isUNC()){let[a,u,l,d,...s]=this.#e,[o,c,b,g,...O]=this.#t;s[0]===""&&(s.shift(),O.shift());let m=[a,u,l,d,""].join("/"),w=[o,c,b,g,""].join("/");this.#e=[m,...s],this.#t=[w,...O],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[a,...u]=this.#e,[l,...d]=this.#t;u[0]===""&&(u.shift(),d.shift());let s=a+"/",o=l+"/";this.#e=[s,...u],this.#t=[o,...d],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===XW}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#a=this.#a||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new e(this.#e,this.#t,this.#r+1,this.#n),this.#i.#f=this.#f,this.#i.#s=this.#s,this.#i.#o=this.#o,this.#i):this.#i=null}isUNC(){let t=this.#e;return this.#s!==void 0?this.#s:this.#s=this.#n==="win32"&&this.#r===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#e;return this.#o!==void 0?this.#o:this.#o=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#e;return this.#f!==void 0?this.#f:this.#f=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#e[0];return typeof t=="string"&&this.isAbsolute()&&this.#r===0?t:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};var GRS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",z5n=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:r,nocase:i,noext:n,noglobstar:a,platform:u=GRS}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=u,this.mmopts={dot:!0,nobrace:r,nocase:i,noext:n,noglobstar:a,optimizationLevel:2,platform:u,nocomment:!0,nonegate:!0};for(let l of t)this.add(l)}add(t){let r=new GMe(t,this.mmopts);for(let i=0;i<r.set.length;i++){let n=r.set[i],a=r.globParts[i];if(!n||!a)throw new Error("invalid pattern object");for(;n[0]==="."&&a[0]===".";)n.shift(),a.shift();let u=new I5n(n,a,0,this.platform),l=new GMe(u.globString(),this.mmopts),d=a[a.length-1]==="**",s=u.isAbsolute();s?this.absolute.push(l):this.relative.push(l),d&&(s?this.absoluteChildren.push(l):this.relativeChildren.push(l))}}ignored(t){let r=t.fullpath(),i=`${r}/`,n=t.relative()||".",a=`${n}/`;for(let u of this.relative)if(u.match(n)||u.match(a))return!0;for(let u of this.absolute)if(u.match(r)||u.match(i))return!0;return!1}childrenIgnored(t){let r=t.fullpath()+"/",i=(t.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(i))return!0;for(let n of this.absoluteChildren)if(n.match(r))return!0;return!1}};var YGs=class e{store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,r){return this.store.get(t.fullpath())?.has(r.globString())}storeWalked(t,r){let i=t.fullpath(),n=this.store.get(i);n?n.add(r.globString()):this.store.set(i,new Set([r.globString()]))}},XGs=class{store=new Map;add(t,r,i){let n=(r?2:0)|(i?1:0),a=this.store.get(t);this.store.set(t,a===void 0?n:n&a)}entries(){return[...this.store.entries()].map(([t,r])=>[t,!!(r&2),!!(r&1)])}},ZGs=class{store=new Map;add(t,r){if(!t.canReaddir())return;let i=this.store.get(t);i?i.find(n=>n.globString()===r.globString())||i.push(r):this.store.set(t,[r])}get(t){let r=this.store.get(t);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},BRa=class e{hasWalkedCache;matches=new XGs;subwalks=new ZGs;patterns;follow;dot;opts;constructor(t,r){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=r?r.copy():new YGs}processPatterns(t,r){this.patterns=r;let i=r.map(n=>[t,n]);for(let[n,a]of i){this.hasWalkedCache.storeWalked(n,a);let u=a.root(),l=a.isAbsolute()&&this.opts.absolute!==!1;if(u){n=n.resolve(u==="/"&&this.opts.root!==void 0?this.opts.root:u);let c=a.rest();if(c)a=c;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let d,s,o=!1;for(;typeof(d=a.pattern())=="string"&&(s=a.rest());)n=n.resolve(d),a=s,o=!0;if(d=a.pattern(),s=a.rest(),o){if(this.hasWalkedCache.hasWalked(n,a))continue;this.hasWalkedCache.storeWalked(n,a)}if(typeof d=="string"){let c=d===".."||d===""||d===".";this.matches.add(n.resolve(d),l,c);continue}else if(d===XW){(!n.isSymbolicLink()||this.follow||a.checkFollowGlobstar())&&this.subwalks.add(n,a);let c=s?.pattern(),b=s?.rest();if(!s||(c===""||c===".")&&!b)this.matches.add(n,l,c===""||c===".");else if(c===".."){let g=n.parent||n;b?this.hasWalkedCache.hasWalked(g,b)||this.subwalks.add(g,b):this.matches.add(g,l,!0)}}else d instanceof RegExp&&this.subwalks.add(n,a)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,r){let i=this.subwalks.get(t),n=this.child();for(let a of r)for(let u of i){let l=u.isAbsolute(),d=u.pattern(),s=u.rest();d===XW?n.testGlobstar(a,u,s,l):d instanceof RegExp?n.testRegExp(a,d,s,l):n.testString(a,d,s,l)}return n}testGlobstar(t,r,i,n){if((this.dot||!t.name.startsWith("."))&&(r.hasMore()||this.matches.add(t,n,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,r):t.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(t,i):r.markFollowGlobstar()&&this.subwalks.add(t,r)))),i){let a=i.pattern();if(typeof a=="string"&&a!==".."&&a!==""&&a!==".")this.testString(t,a,i.rest(),n);else if(a===".."){let u=t.parent||t;this.subwalks.add(u,i)}else a instanceof RegExp&&this.testRegExp(t,a,i.rest(),n)}}testRegExp(t,r,i,n){r.test(t.name)&&(i?this.subwalks.add(t,i):this.matches.add(t,n,!1))}testString(t,r,i,n){t.isNamed(r)&&(i?this.subwalks.add(t,i):this.matches.add(t,n,!1))}};var QRS=(e,t)=>typeof e=="string"?new z5n([e],t):Array.isArray(e)?new z5n(e,t):e,LBo=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(t,r,i){if(this.patterns=t,this.path=r,this.opts=i,this.#r=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=QRS(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let n="cannot ignore child matches, ignore lacks add() method.";throw new Error(n)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(t){return this.seen.has(t)||!!this.#t?.ignored?.(t)}#i(t){return!!this.#t?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#e.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#e.push(t):t())}async matchCheck(t,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||await t.realpath(),!i)return;t=i}let a=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&a?.isSymbolicLink()){let u=await a.realpath();u&&(u.isUnknown()||this.opts.stat)&&await u.lstat()}return this.matchCheckTest(a,r)}matchCheckTest(t,r){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!r||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#n(t)?t:void 0}matchCheckSync(t,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||t.realpathSync(),!i)return;t=i}let a=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&a?.isSymbolicLink()){let u=a.realpathSync();u&&(u?.isUnknown()||this.opts.stat)&&u.lstatSync()}return this.matchCheckTest(a,r)}matchFinish(t,r){if(this.#n(t))return;if(!this.includeChildMatches&&this.#t?.add){let a=`${t.relativePosix()}/**`;this.#t.add(a)}let i=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(t);let n=this.opts.mark&&t.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(i){let a=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(a+n)}else{let a=this.opts.posix?t.relativePosix():t.relative(),u=this.opts.dotRelative&&!a.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(a?u+a+n:"."+n)}}async match(t,r,i){let n=await this.matchCheck(t,i);n&&this.matchFinish(n,r)}matchSync(t,r,i){let n=this.matchCheckSync(t,i);n&&this.matchFinish(n,r)}walkCB(t,r,i){this.signal?.aborted&&i(),this.walkCB2(t,r,new BRa(this.opts),i)}walkCB2(t,r,i,n){if(this.#i(t))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(t,r,i,n));return}i.processPatterns(t,r);let a=1,u=()=>{--a===0&&n()};for(let[l,d,s]of i.matches.entries())this.#n(l)||(a++,this.match(l,d,s).then(()=>u()));for(let l of i.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;a++;let d=l.readdirCached();l.calledReaddir()?this.walkCB3(l,d,i,u):l.readdirCB((s,o)=>this.walkCB3(l,o,i,u),!0)}u()}walkCB3(t,r,i,n){i=i.filterEntries(t,r);let a=1,u=()=>{--a===0&&n()};for(let[l,d,s]of i.matches.entries())this.#n(l)||(a++,this.match(l,d,s).then(()=>u()));for(let[l,d]of i.subwalks.entries())a++,this.walkCB2(l,d,i.child(),u);u()}walkCBSync(t,r,i){this.signal?.aborted&&i(),this.walkCB2Sync(t,r,new BRa(this.opts),i)}walkCB2Sync(t,r,i,n){if(this.#i(t))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(t,r,i,n));return}i.processPatterns(t,r);let a=1,u=()=>{--a===0&&n()};for(let[l,d,s]of i.matches.entries())this.#n(l)||this.matchSync(l,d,s);for(let l of i.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;a++;let d=l.readdirSync();this.walkCB3Sync(l,d,i,u)}u()}walkCB3Sync(t,r,i,n){i=i.filterEntries(t,r);let a=1,u=()=>{--a===0&&n()};for(let[l,d,s]of i.matches.entries())this.#n(l)||this.matchSync(l,d,s);for(let[l,d]of i.subwalks.entries())a++,this.walkCB2Sync(l,d,i.child(),u);u()}},IRa=class extends LBo{matches=new Set;constructor(t,r,i){super(t,r,i)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},zRa=class extends LBo{results;constructor(t,r,i){super(t,r,i),this.results=new LBi({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var JRS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",P$t=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,F2d.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(d=>d.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(d=>d.includes("/")?d:`./**/${d}`)}if(this.pattern=t,this.platform=r.platform||JRS,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let d=r.platform==="win32"?C5n:r.platform==="darwin"?CRa:r.platform?B5n:N2d;this.scurry=new d(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},a=this.pattern.map(d=>new GMe(d,n)),[u,l]=a.reduce((d,s)=>(d[0].push(...s.set),d[1].push(...s.globParts),d),[[],[]]);this.patterns=u.map((d,s)=>{let o=l[s];if(!o)throw new Error("invalid pattern object");return new I5n(d,o,0,this.platform)})}async walk(){return[...await new IRa(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new IRa(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new zRa(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new zRa(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var kGs=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new GMe(r,t).hasMagic())return!0;return!1};function UBo(e,t={}){return new P$t(e,t).streamSync()}function U2d(e,t={}){return new P$t(e,t).stream()}function V2d(e,t={}){return new P$t(e,t).walkSync()}async function L2d(e,t={}){return new P$t(e,t).walk()}function VBo(e,t={}){return new P$t(e,t).iterateSync()}function W2d(e,t={}){return new P$t(e,t).iterate()}var KRS=UBo,YRS=Object.assign(U2d,{sync:UBo}),XRS=VBo,ZRS=Object.assign(W2d,{sync:VBo}),kRS=Object.assign(V2d,{stream:UBo,iterate:VBo}),qA=Object.assign(L2d,{glob:L2d,globSync:V2d,sync:kRS,globStream:U2d,stream:YRS,globStreamSync:UBo,streamSync:KRS,globIterate:W2d,iterate:ZRS,globIterateSync:VBo,iterateSync:XRS,Glob:P$t,hasMagic:kGs,escape:D5n,unescape:g$t});qA.glob=qA;async function _ae(e,t){let r=(i,n)=>i.localeCompare(n,"en");return(await qA(`**/*.${t}`,{cwd:e,absolute:!0})).sort(r).map(Fc.of)}var WBo=require("fs/promises");async function j$t({src:e,dest:t}){let r=await Uer(e);await H2d({src:e,dest:t,contents:r})}async function H2d({src:e,dest:t,contents:r}){for(let i of r)if(i.type==="file"){let n=Eu(e,Ta.of(i.name)),a=Eu(t,Ta.of(i.name)),u=Rd(a);await jf(u)||await(0,WBo.mkdir)(u,{recursive:!0}),await(0,WBo.rename)(n,a)}else await H2d({src:Eu(e,Ta.of(i.name)),dest:Eu(t,Ta.of(i.name)),contents:i.contents})}var $2d=si(require("path"),1);function yT(e,t){return Ta.of($2d.default.relative(e,t))}var G2d=si(require("path"),1);function hae(e,t){return Ta.of(G2d.default.relative(e,t))}var Q2d=si(require("path"),1);function Bv(...e){return Q2d.default.resolve(...e.map($Me))}var Y2d=require("fs");var K2d=require("stream");function pk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eQs,tQs,exS=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,txS={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function rxS(e){return typeof e.read=="function"&&typeof e.pause=="function"&&typeof e.resume=="function"&&typeof e.pipe=="function"&&typeof e.once=="function"&&typeof e.removeListener=="function"}var ZW;(function(e){e[e.Array=0]="Array",e[e.Object=1]="Object",e[e.ReadableString=2]="ReadableString",e[e.ReadableObject=3]="ReadableObject",e[e.Primitive=4]="Primitive",e[e.Promise=5]="Promise"})(ZW||(ZW={}));function ixS(e){return e?typeof e.then=="function"?ZW.Promise:rxS(e)?e._readableState.objectMode?ZW.ReadableObject:ZW.ReadableString:Array.isArray(e)?ZW.Array:typeof e=="object"||e instanceof Object?ZW.Object:ZW.Primitive:ZW.Primitive}function iQs(e){return e.replace(exS,t=>{let r=txS[t];return typeof r=="string"?r:`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`})}var R5n;if(((eQs=global)===null||eQs===void 0||(tQs=eQs.JSON)===null||tQs===void 0?void 0:tQs.stringify)instanceof Function)try{if(JSON.stringify(global.BigInt?global.BigInt("123"):"")!=="123")throw new Error;R5n=JSON.stringify}catch{R5n=t=>typeof t=="bigint"?String(t):JSON.stringify(t)}else R5n=e=>{switch(typeof e){case"string":return`"${iQs(e)}"`;case"number":return Number.isFinite(e)?String(e):"null";case"bigint":return String(e);case"boolean":return e?"true":"false";case"object":if(!e)return"null";default:throw Object.assign(new Error(`Not a primitive "${typeof e}".`),{value:e})}};var rQs=new Map;function J2d(e){let t=e.length<1e4;if(t&&rQs.has(e))return rQs.get(e);let r=R5n(String(e));return t&&rQs.set(e,r),r}function nQs(e,t){var r;let i=e.read(t);return i===null&&!(e.readableEnded||(r=e._readableState)!==null&&r!==void 0&&r.ended)?new Promise((n,a)=>{let u=()=>n(null);e.once("end",u),e.once("error",a),e.once("readable",()=>{e.removeListener("end",u),e.removeListener("error",a),nQs(e,t).then(n,a)})}):Promise.resolve(i)}var uNe;(function(e){e[e.Inactive=0]="Inactive",e[e.Reading=1]="Reading",e[e.ReadMore=2]="ReadMore",e[e.Consumed=3]="Consumed"})(uNe||(uNe={}));var HBo=class extends K2d.Readable{constructor(t,r,i,n=!1,a=512){super({encoding:"utf8"}),pk(this,"cycle",void 0),pk(this,"bufferSize",void 0),pk(this,"item",void 0),pk(this,"indent",void 0),pk(this,"root",void 0),pk(this,"include",void 0),pk(this,"replacer",void 0),pk(this,"visited",void 0),pk(this,"objectItem",void 0),pk(this,"buffer",""),pk(this,"bufferLength",0),pk(this,"pushCalled",!1),pk(this,"readSize",0),pk(this,"prePush",void 0),pk(this,"readState",uNe.Inactive),this.cycle=n,this.bufferSize=a;let u=typeof i;u==="number"?this.indent=" ".repeat(i):u==="string"&&(this.indent=i);let l=typeof r;l==="object"?this.include=r:l==="function"&&(this.replacer=r),this.visited=n?new WeakMap:[],this.root={value:{"":t},depth:0,indent:"",path:[]},this.setItem(t,this.root,"")}setItem(t,r,i=""){t&&typeof t=="object"&&typeof t.toJSON=="function"&&(t=t.toJSON(i)),this.replacer&&(t=this.replacer.call(r.value,i,t)),(t instanceof Function||typeof t=="symbol")&&(t=void 0);let n=ixS(t),a;if(!this.cycle&&n!==ZW.Primitive){if(this.visited.some(u=>u===t)){this.destroy(Object.assign(new Error("Converting circular structure to JSON"),{value:t,key:i}));return}this.visited.push(t)}else if(this.cycle&&n!==ZW.Primitive){if(a=this.visited.get(t),a){this._push(`{"$ref":"$${a.map(u=>`[${Number.isInteger(u)?u:iQs(J2d(u))}]`).join("")}"}`),this.item=r;return}a=r===this.root?[]:r.path.concat(i),this.visited.set(t,a)}if(n===ZW.Object)this.setObjectItem(t,r);else if(n===ZW.Array)this.setArrayItem(t,r);else if(n===ZW.Primitive){r!==this.root&&typeof i=="string"?t===void 0||this._push(R5n(t)):t===void 0&&typeof i=="number"?this._push("null"):t===void 0||this._push(R5n(t)),this.item=r;return}else n===ZW.Promise?this.setPromiseItem(t,r,i):n===ZW.ReadableString?this.setReadableStringItem(t,r):n===ZW.ReadableObject&&this.setReadableObjectItem(t,r);this.item.value=t,this.item.depth=r.depth+1,this.indent&&(this.item.indent=this.indent.repeat(this.item.depth)),this.item.path=a}setReadableStringItem(t,r){var i,n;t.readableEnded||(i=t._readableState)!==null&&i!==void 0&&i.endEmitted?this.emit("error",new Error("Readable Stream has ended before it was serialized. All stream data have been lost"),t,r.path):(t.readableFlowing||(n=t._readableState)!==null&&n!==void 0&&n.flowing)&&(t.pause(),this.emit("error",new Error("Readable Stream is in flowing mode, data may have been lost. Trying to pause stream."),t,r.path));let a=this;this.prePush='"',this.item={type:"readable string",async read(u){try{let l=await nQs(t,u);if(l===null){a._push('"'),a.item=r,a.unvisit(t);return}l&&a._push(iQs(l.toString()))}catch(l){a.emit("error",l),a.destroy()}}}}setReadableObjectItem(t,r){var i,n;t.readableEnded||(i=t._readableState)!==null&&i!==void 0&&i.endEmitted?this.emit("error",new Error("Readable Stream has ended before it was serialized. All stream data have been lost"),t,r.path):(t.readableFlowing||(n=t._readableState)!==null&&n!==void 0&&n.flowing)&&(t.pause(),this.emit("error",new Error("Readable Stream is in flowing mode, data may have been lost. Trying to pause stream."),t,r.path));let a=this;this._push("[");let u=!0,l=0,d={type:"readable object",async read(){try{let s="",o=await nQs(t);if(o===null){l&&a.indent&&(s+=`
|
|
@@ -1672,7 +1672,7 @@ ${c.indent}`:""}${J2d(o)}:${l.indent?" ":""}`;return u=!1,s=!0,l.objectItem=void
|
|
|
1672
1672
|
`:""}var qFS=AFS,TFS={dump:qFS};function AQs(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var CFS=kW,BFS=I8d,IFS=N8d,zFS=W8d,RFS=H8d,xFS=SQs,NFS=u5d.load,FFS=u5d.loadAll,ZBo=TFS.dump,VRa=yk,LFS={binary:K8d,float:V8d,map:x8d,null:F8d,pairs:X8d,set:Z8d,timestamp:Q8d,bool:L8d,int:U8d,merge:J8d,omap:Y8d,seq:R8d,str:z8d},UFS=AQs("safeLoad","load"),VFS=AQs("safeLoadAll","loadAll"),WFS=AQs("safeDump","dump"),HFS={Type:CFS,Schema:BFS,FAILSAFE_SCHEMA:IFS,JSON_SCHEMA:zFS,CORE_SCHEMA:RFS,DEFAULT_SCHEMA:xFS,load:NFS,loadAll:FFS,dump:ZBo,YAMLException:VRa,types:LFS,safeLoad:UFS,safeLoadAll:VFS,safeDump:WFS},wd=HFS;var g5d=Su.object({dependencies:Su.record(Su.string(),Su.string())});async function m5d({absolutePathToWorkspace:e,context:t}){let r=Eu(e,Ta.of(X7d));if(!await jf(r))return;let i=await(0,O5d.readFile)(r),n=wd.load(i.toString());return await gBo({schema:g5d,value:n,context:t,filepathBeingParsed:r})}async function qQs({absolutePathToWorkspace:e,context:t}){let r=await m5d({absolutePathToWorkspace:e,context:t});return y8d({absolutePathToWorkspace:e,rawDependenciesConfiguration:r,context:t})}function kBo(e){"@babel/helpers - typeof";return kBo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kBo(e)}var $FS=/^\s+/,GFS=/\s+$/;function F_(e,t){if(e=e||"",t=t||{},e instanceof F_)return e;if(!(this instanceof F_))return new F_(e,t);var r=QFS(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}F_.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,i,n,a,u,l;return r=t.r/255,i=t.g/255,n=t.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?u=i/12.92:u=Math.pow((i+.055)/1.055,2.4),n<=.03928?l=n/12.92:l=Math.pow((n+.055)/1.055,2.4),.2126*a+.7152*u+.0722*l},setAlpha:function(t){return this._a=M5d(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=j5d(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=j5d(this._r,this._g,this._b),r=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+n+"%)":"hsva("+r+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=P5d(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=P5d(this._r,this._g,this._b),r=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+n+"%)":"hsla("+r+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return w5d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return XFS(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(WR(this._r,255)*100)+"%",g:Math.round(WR(this._g,255)*100)+"%",b:Math.round(WR(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(WR(this._r,255)*100)+"%, "+Math.round(WR(this._g,255)*100)+"%, "+Math.round(WR(this._b,255)*100)+"%)":"rgba("+Math.round(WR(this._r,255)*100)+"%, "+Math.round(WR(this._g,255)*100)+"%, "+Math.round(WR(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:c3S[w5d(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+S5d(this._r,this._g,this._b,this._a),i=r,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=F_(t);i="#"+S5d(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+r+",endColorstr="+i+")"},toString:function(t){var r=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0,a=!r&&n&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(i=this.toRgbString()),t==="prgb"&&(i=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(i=this.toHexString()),t==="hex3"&&(i=this.toHexString(!0)),t==="hex4"&&(i=this.toHex8String(!0)),t==="hex8"&&(i=this.toHex8String()),t==="name"&&(i=this.toName()),t==="hsl"&&(i=this.toHslString()),t==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return F_(this.toString())},_applyModification:function(t,r){var i=t.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(t3S,arguments)},brighten:function(){return this._applyModification(r3S,arguments)},darken:function(){return this._applyModification(i3S,arguments)},desaturate:function(){return this._applyModification(ZFS,arguments)},saturate:function(){return this._applyModification(kFS,arguments)},greyscale:function(){return this._applyModification(e3S,arguments)},spin:function(){return this._applyModification(n3S,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(u3S,arguments)},complement:function(){return this._applyCombination(a3S,arguments)},monochromatic:function(){return this._applyCombination(s3S,arguments)},splitcomplement:function(){return this._applyCombination(o3S,arguments)},triad:function(){return this._applyCombination(D5d,[3])},tetrad:function(){return this._applyCombination(D5d,[4])}};F_.fromRatio=function(e,t){if(kBo(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=WRa(e[i]));e=r}return F_(e,t)};function QFS(e){var t={r:0,g:0,b:0},r=1,i=null,n=null,a=null,u=!1,l=!1;return typeof e=="string"&&(e=p3S(e)),kBo(e)=="object"&&(zgi(e.r)&&zgi(e.g)&&zgi(e.b)?(t=JFS(e.r,e.g,e.b),u=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):zgi(e.h)&&zgi(e.s)&&zgi(e.v)?(i=WRa(e.s),n=WRa(e.v),t=YFS(e.h,i,n),u=!0,l="hsv"):zgi(e.h)&&zgi(e.s)&&zgi(e.l)&&(i=WRa(e.s),a=WRa(e.l),t=KFS(e.h,i,a),u=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=M5d(r),{ok:u,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function JFS(e,t,r){return{r:WR(e,255)*255,g:WR(t,255)*255,b:WR(r,255)*255}}function P5d(e,t,r){e=WR(e,255),t=WR(t,255),r=WR(r,255);var i=Math.max(e,t,r),n=Math.min(e,t,r),a,u,l=(i+n)/2;if(i==n)a=u=0;else{var d=i-n;switch(u=l>.5?d/(2-i-n):d/(i+n),i){case e:a=(t-r)/d+(t<r?6:0);break;case t:a=(r-e)/d+2;break;case r:a=(e-t)/d+4;break}a/=6}return{h:a,s:u,l}}function KFS(e,t,r){var i,n,a;e=WR(e,360),t=WR(t,100),r=WR(r,100);function u(s,o,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?s+(o-s)*6*c:c<1/2?o:c<2/3?s+(o-s)*(2/3-c)*6:s}if(t===0)i=n=a=r;else{var l=r<.5?r*(1+t):r+t-r*t,d=2*r-l;i=u(d,l,e+1/3),n=u(d,l,e),a=u(d,l,e-1/3)}return{r:i*255,g:n*255,b:a*255}}function j5d(e,t,r){e=WR(e,255),t=WR(t,255),r=WR(r,255);var i=Math.max(e,t,r),n=Math.min(e,t,r),a,u,l=i,d=i-n;if(u=i===0?0:d/i,i==n)a=0;else{switch(i){case e:a=(t-r)/d+(t<r?6:0);break;case t:a=(r-e)/d+2;break;case r:a=(e-t)/d+4;break}a/=6}return{h:a,s:u,v:l}}function YFS(e,t,r){e=WR(e,360)*6,t=WR(t,100),r=WR(r,100);var i=Math.floor(e),n=e-i,a=r*(1-t),u=r*(1-n*t),l=r*(1-(1-n)*t),d=i%6,s=[r,u,a,a,l,r][d],o=[l,r,r,u,a,a][d],c=[a,a,l,r,r,u][d];return{r:s*255,g:o*255,b:c*255}}function w5d(e,t,r,i){var n=[S$t(Math.round(e).toString(16)),S$t(Math.round(t).toString(16)),S$t(Math.round(r).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function XFS(e,t,r,i,n){var a=[S$t(Math.round(e).toString(16)),S$t(Math.round(t).toString(16)),S$t(Math.round(r).toString(16)),S$t(A5d(i))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function S5d(e,t,r,i){var n=[S$t(A5d(i)),S$t(Math.round(e).toString(16)),S$t(Math.round(t).toString(16)),S$t(Math.round(r).toString(16))];return n.join("")}F_.equals=function(e,t){return!e||!t?!1:F_(e).toRgbString()==F_(t).toRgbString()};F_.random=function(){return F_.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ZFS(e,t){t=t===0?0:t||10;var r=F_(e).toHsl();return r.s-=t/100,r.s=eIo(r.s),F_(r)}function kFS(e,t){t=t===0?0:t||10;var r=F_(e).toHsl();return r.s+=t/100,r.s=eIo(r.s),F_(r)}function e3S(e){return F_(e).desaturate(100)}function t3S(e,t){t=t===0?0:t||10;var r=F_(e).toHsl();return r.l+=t/100,r.l=eIo(r.l),F_(r)}function r3S(e,t){t=t===0?0:t||10;var r=F_(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),F_(r)}function i3S(e,t){t=t===0?0:t||10;var r=F_(e).toHsl();return r.l-=t/100,r.l=eIo(r.l),F_(r)}function n3S(e,t){var r=F_(e).toHsl(),i=(r.h+t)%360;return r.h=i<0?360+i:i,F_(r)}function a3S(e){var t=F_(e).toHsl();return t.h=(t.h+180)%360,F_(t)}function D5d(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=F_(e).toHsl(),i=[F_(e)],n=360/t,a=1;a<t;a++)i.push(F_({h:(r.h+a*n)%360,s:r.s,l:r.l}));return i}function o3S(e){var t=F_(e).toHsl(),r=t.h;return[F_(e),F_({h:(r+72)%360,s:t.s,l:t.l}),F_({h:(r+216)%360,s:t.s,l:t.l})]}function u3S(e,t,r){t=t||6,r=r||30;var i=F_(e).toHsl(),n=360/r,a=[F_(e)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,a.push(F_(i));return a}function s3S(e,t){t=t||6;for(var r=F_(e).toHsv(),i=r.h,n=r.s,a=r.v,u=[],l=1/t;t--;)u.push(F_({h:i,s:n,v:a})),a=(a+l)%1;return u}F_.mix=function(e,t,r){r=r===0?0:r||50;var i=F_(e).toRgb(),n=F_(t).toRgb(),a=r/100,u={r:(n.r-i.r)*a+i.r,g:(n.g-i.g)*a+i.g,b:(n.b-i.b)*a+i.b,a:(n.a-i.a)*a+i.a};return F_(u)};F_.readability=function(e,t){var r=F_(e),i=F_(t);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};F_.isReadable=function(e,t,r){var i=F_.readability(e,t),n,a;switch(a=!1,n=_3S(r),n.level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7;break}return a};F_.mostReadable=function(e,t,r){var i=null,n=0,a,u,l,d;r=r||{},u=r.includeFallbackColors,l=r.level,d=r.size;for(var s=0;s<t.length;s++)a=F_.readability(e,t[s]),a>n&&(n=a,i=F_(t[s]));return F_.isReadable(e,i,{level:l,size:d})||!u?i:(r.includeFallbackColors=!1,F_.mostReadable(e,["#fff","#000"],r))};var TQs=F_.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},c3S=F_.hexNames=l3S(TQs);function l3S(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function M5d(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function WR(e,t){f3S(e)&&(e="100%");var r=d3S(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function eIo(e){return Math.min(1,Math.max(0,e))}function YMe(e){return parseInt(e,16)}function f3S(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function d3S(e){return typeof e=="string"&&e.indexOf("%")!=-1}function S$t(e){return e.length==1?"0"+e:""+e}function WRa(e){return e<=1&&(e=e*100+"%"),e}function A5d(e){return Math.round(parseFloat(e)*255).toString(16)}function E5d(e){return YMe(e)/255}var w$t=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function zgi(e){return!!w$t.CSS_UNIT.exec(e)}function p3S(e){e=e.replace($FS,"").replace(GFS,"").toLowerCase();var t=!1;if(TQs[e])e=TQs[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=w$t.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=w$t.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=w$t.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=w$t.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=w$t.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=w$t.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=w$t.hex8.exec(e))?{r:YMe(r[1]),g:YMe(r[2]),b:YMe(r[3]),a:E5d(r[4]),format:t?"name":"hex8"}:(r=w$t.hex6.exec(e))?{r:YMe(r[1]),g:YMe(r[2]),b:YMe(r[3]),format:t?"name":"hex"}:(r=w$t.hex4.exec(e))?{r:YMe(r[1]+""+r[1]),g:YMe(r[2]+""+r[2]),b:YMe(r[3]+""+r[3]),a:E5d(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=w$t.hex3.exec(e))?{r:YMe(r[1]+""+r[1]),g:YMe(r[2]+""+r[2]),b:YMe(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function _3S(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}function q5d(e={accentPrimary:void 0,background:void 0},t){e.accentPrimary=e.accentPrimary??e.accentPrimaryDeprecated;let r=rIo(e);switch(r){case"dark":return{type:"dark",...tIo(e,t,"dark")};case"light":return{type:"light",...tIo(e,t,"light")};case"darkAndLight":return{type:"darkAndLight",dark:tIo(e,t,"dark"),light:tIo(e,t,"light")};default:So(r)}}function rIo({background:e,accentPrimary:t,accentPrimaryDeprecated:r}){if(t=t??r,typeof e=="string"&&typeof t=="string")return F_(e).isDark()?"dark":"light";if(e!=null){if(typeof e=="string")return F_(e).isDark()?"dark":"light";if(e.dark!=null&&e.light!=null)return"darkAndLight"}if(t!=null){if(typeof t=="string")return F_(t).isLight()?"dark":"light";if(t.dark!=null&&t.light!=null)return"darkAndLight"}if(t!=null&&e!=null){if(e.dark!=null&&t.dark!=null)return"dark";if(e.light!=null&&t.light!=null)return"light"}return"darkAndLight"}function tIo(e,t,r){let i=W5n(e.accentPrimary??e.accentPrimaryDeprecated,t,"accent-primary",r)??F_.random(),n=W5n(e.background,t,"background",r);return{accentPrimary:i.toRgb(),background:n?.toRgb(),border:W5n(e.border,t,"border",r)?.toRgb(),sidebarBackground:W5n(e.sidebarBackground,t,"sidebar-background",r)?.toRgb(),headerBackground:W5n(e.headerBackground,t,"header-background",r)?.toRgb(),cardBackground:W5n(e.cardBackground,t,"card-background",r)?.toRgb(),logo:void 0,backgroundImage:void 0}}function HRa(e,t,r){if(e==null)return;let i=typeof e=="string"?e:e[r];if(i==null&&t==="accent-primary"&&typeof e!="string"&&(i=e[r==="dark"?"light":"dark"]),i!=null)return i}function W5n(e,t,r,i){let n=HRa(e,r,i);if(n==null)return;let a=F_(n);return a.isValid()||t.failAndThrow(`'${typeof e=="string"?r:`colors.${r}.${i}`}' should be a hex color of the format #FFFFFF`),a}var oH=si(fAe(),1),HRo=require("fs/promises");var tgp=require("fs/promises");var egp=100;async function FHS({files:e,absolutePathToFernFolder:t}){let r=await Promise.all(e.map(async i=>{let n=await(0,tgp.readFile)(i,"utf-8");return[hae(t,i),n]}));return Object.fromEntries(r)}async function rgp({files:e,absolutePathToFernFolder:t}){let r={};for(let i=0;i<e.length;i+=egp){let n=e.slice(i,i+egp),a=await FHS({files:n,absolutePathToFernFolder:t});Object.assign(r,a)}return r}function URo({landingPage:e,navigation:t}){return Gxe([e?.absolutePath,...LHS(t)])}function LHS(e){switch(e.type){case"tabbed":return e.items.flatMap(t=>t.child.type==="layout"?t.child.layout.flatMap(r=>xXs({item:r})):t.child.type==="changelog"?t.child.changelog:[]);case"untabbed":return e.items.flatMap(t=>xXs({item:t}));case"versioned":return e.versions.flatMap(t=>URo({landingPage:t.landingPage,navigation:t.navigation}));case"productgroup":return e.products.flatMap(t=>URo({landingPage:t.landingPage,navigation:t.navigation}));default:So(e)}}function xXs({item:e}){switch(e.type){case"apiSection":return Gxe([e.overviewAbsolutePath,...e.navigation.flatMap(t=>igp({item:t}))]);case"link":return[];case"page":return[e.absolutePath];case"section":return Gxe([e.overviewAbsolutePath,...e.contents.flatMap(t=>xXs({item:t}))]);case"changelog":return e.changelog;default:So(e)}}function igp({item:e}){return e.type==="page"?[e.absolutePath]:e.type==="package"||e.type==="section"?Gxe([e.overviewAbsolutePath,...e.contents.flatMap(t=>igp({item:t}))]):[]}async function UXs({rawDocsConfiguration:e,absolutePathToFernFolder:t,absoluteFilepathToDocsConfig:r,context:i}){let{instances:n,title:a,tabs:u,products:l,versions:d,navigation:s,navbarLinks:o,footerLinks:c,defaultLanguage:b,metadata:g,redirects:O,logo:m,favicon:w,backgroundImage:E,colors:q,typography:M,layout:D,analytics:C,integrations:R,css:G,js:I,aiChat:L,aiSearch:V,experimental:Y}=e,K=wxa(e.landingPage,r),X=JHS({tabs:u,products:l,versions:d,navigation:s,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}),oe=X.then(mt=>rgp({files:URo({navigation:mt,landingPage:K}),absolutePathToFernFolder:t})),pe=UHS(m,r),de=D8(w,r),me=VHS(E,r),Ue=M!=null?KHS({rawTypography:M,absoluteFilepathToDocsConfig:r}):void 0,vt=WHS(G,r),De=GHS(I,r),Te=l$S(g,r),[zt,Pe,Dt,ut,Oe,we]=await Promise.all([X,oe,Ue,vt,De,Te]);return{title:a,instances:n,roles:e.roles,pages:Pe,landingPage:K,navigation:zt,navbarLinks:s$S(o),footerLinks:c$S(c),defaultLanguage:b,announcement:e.announcement,metadata:we,redirects:O?.map(mt=>({...mt,permanent:mt?.permanent})),logo:pe,favicon:de,backgroundImage:me,colors:q5d(q,i),typography:Dt,layout:QHS(D),analyticsConfig:{...e.analytics,intercom:e.analytics?.intercom?{...e.analytics.intercom,appId:e.analytics.intercom.appId,apiBase:e.analytics.intercom.apiBase}:void 0,fullstory:e.analytics?.fullstory,posthog:e.analytics?.posthog?{...e.analytics.posthog,apiKey:e.analytics.posthog.apiKey,endpoint:e.analytics.posthog.endpoint}:void 0,segment:e.analytics?.segment,gtm:e.analytics?.gtm,ga4:e.analytics?.ga4,amplitude:void 0,mixpanel:void 0,hotjar:void 0,koala:void 0,logrocket:void 0,pirsch:void 0,plausible:void 0,fathom:void 0,clearbit:void 0,heap:void 0},integrations:{...R,intercom:R?.intercom?R.intercom:void 0},css:ut,js:Oe,aiChatConfig:V??L,experimental:Y}}function UHS(e,t){return e!=null?{dark:D8(e.dark,t),light:D8(e.light,t),height:e.height,href:e.href!=null?oH.FernRegistry.Url(e.href):void 0}:void 0}function VHS(e,t){if(e!=null)if(typeof e=="string"){let r=D8(e,t);return{dark:r,light:r}}else{let r=D8(e.dark,t),i=D8(e.light,t);return{dark:r,light:i}}}async function WHS(e,t){if(e==null)return;let r=typeof e=="string"?[e]:e;return{inline:await Promise.all(r.map(async i=>(await(0,HRo.readFile)(D8(i,t))).toString()))}}function HHS(e){return Object.hasOwn(e,"url")}function $HS(e){return Object.hasOwn(e,"path")}async function GHS(e,t){let r=[],i=[];if(e==null)return{files:[]};let n=Array.isArray(e)?e:[e];for(let a of n)typeof a=="string"?i.push({absolutePath:D8(a,t)}):HHS(a)?r.push({strategy:a.strategy,url:oH.FernRegistry.Url(a.url)}):$HS(a)&&i.push({absolutePath:D8(a.path,t),strategy:a.strategy});return{remote:r,files:i}}function QHS(e){if(e!=null)return{pageWidth:e.pageWidth?.trim().toLowerCase()==="full"?{type:"full"}:VRo(e.pageWidth),contentWidth:VRo(e.contentWidth),sidebarWidth:VRo(e.sidebarWidth),headerHeight:VRo(e.headerHeight),searchbarPlacement:e.searchbarPlacement==="header"?oH.FernRegistry.docs.v1.commons.SearchbarPlacement.Header:e.searchbarPlacement==="header-tabs"?oH.FernRegistry.docs.v1.commons.SearchbarPlacement.HeaderTabs:oH.FernRegistry.docs.v1.commons.SearchbarPlacement.Sidebar,tabsPlacement:e.tabsPlacement==="header"?oH.FernRegistry.docs.v1.commons.TabsPlacement.Header:oH.FernRegistry.docs.v1.commons.TabsPlacement.Sidebar,contentAlignment:e.contentAlignment==="left"?oH.FernRegistry.docs.v1.commons.ContentAlignment.Left:oH.FernRegistry.docs.v1.commons.ContentAlignment.Center,headerPosition:e.headerPosition==="static"?oH.FernRegistry.docs.v1.commons.HeaderPosition.Absolute:oH.FernRegistry.docs.v1.commons.HeaderPosition.Fixed,disableHeader:e.disableHeader??!1}}function VRo(e){if(e==null)return;let t=e.trim().toLowerCase(),r=t.match(/^(\d+)px$/);if(r!=null&&r[1]!=null)return{type:"px",value:parseFloat(r[1])};let i=t.match(/^(\d+)rem$/);if(i!=null&&i[1]!=null)return{type:"rem",value:parseFloat(i[1])}}async function ngp({versions:e,absolutePathToFernFolder:t,context:r}){let i=[];for(let n of e){let a=Bv(t,n.path),u=wd.load((await(0,HRo.readFile)(a)).toString()),l=pae.RawSchemas.Serializer.VersionFileConfig.parseOrThrow(u),d=await LXs({tabs:l.tabs,rawNavigationConfig:l.navigation,absolutePathToFernFolder:t,absolutePathToConfig:a,context:r});i.push({landingPage:wxa(l.landingPage,a),version:n.displayName,navigation:d,availability:n.availability,slug:n.slug,viewers:PNe(n.viewers),orphaned:n.orphaned,featureFlags:mNe(n.featureFlag)})}return{type:"versioned",versions:i}}async function JHS({tabs:e,products:t,versions:r,navigation:i,absolutePathToFernFolder:n,absolutePathToConfig:a,context:u}){if(i!=null)return await LXs({tabs:e,rawNavigationConfig:i,absolutePathToFernFolder:n,absolutePathToConfig:a,context:u});if(t!=null){let l=[];for(let d of t){let s=Bv(n,d.path),o=d.image!=null?Bv(n,d.image):void 0,c=wd.load((await(0,HRo.readFile)(s)).toString()),b=pae.RawSchemas.Serializer.ProductFileConfig.parseOrThrow(c),g;d.versions!=null&&d.versions.length>0?g=await ngp({versions:d.versions,absolutePathToFernFolder:n,context:u}):g=await LXs({tabs:b.tabs,rawNavigationConfig:b.navigation,absolutePathToFernFolder:n,absolutePathToConfig:s,context:u}),l.push({landingPage:wxa(b.landingPage,s),product:d.displayName,navigation:g,slug:d.slug,subtitle:d.subtitle,icon:d.icon||"fa-solid fa-code",image:o,viewers:PNe(d.viewers),orphaned:d.orphaned,featureFlags:mNe(d.featureFlag)})}return{type:"productgroup",products:l}}else if(r!=null)return await ngp({versions:r,absolutePathToFernFolder:n,context:u});throw new Error("Unexpected. Docs have neither navigation or versions defined.")}function mNe(e){if(e!=null)return typeof e=="string"?[{flag:e,match:!0,fallbackValue:void 0}]:Array.isArray(e)?e.map(t=>({flag:t.flag,match:t.match,fallbackValue:t.fallbackValue})):[{flag:e.flag,match:e.match??!0,fallbackValue:e.fallbackValue}]}async function KHS({rawTypography:e,absoluteFilepathToDocsConfig:t}){return{headingsFont:e.headingsFont!=null?await NXs({rawFontConfig:e.headingsFont,absoluteFilepathToDocsConfig:t}):void 0,bodyFont:e.bodyFont!=null?await NXs({rawFontConfig:e.bodyFont,absoluteFilepathToDocsConfig:t}):void 0,codeFont:e.codeFont!=null?await NXs({rawFontConfig:e.codeFont,absoluteFilepathToDocsConfig:t}):void 0}}async function NXs({rawFontConfig:e,absoluteFilepathToDocsConfig:t}){return{name:e.name,variants:await YHS(e,t),display:e.display,fallback:e.fallback,fontVariationSettings:e.fontVariationSettings}}function YHS(e,t){let r=[];return e.path!=null&&r.push({path:e.path,weight:e.weight,style:e.style}),e.paths?.forEach(i=>{typeof i=="string"?r.push({path:i,weight:e.weight,style:e.style}):r.push({path:i.path,weight:i.weight??e.weight,style:i.style??e.style})}),Promise.all(r.map(async i=>({absolutePath:D8(i.path,t),weight:XHS(i.weight),style:i.style})))}function XHS(e){return e==null?void 0:typeof e=="number"?[e.toString()]:e.split(/\D+/).filter(r=>r!==""&&["100","200","300","400","500","600","700","800","900"].includes(r))}async function ZHS({tabs:e,item:t,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n}){let a=e[t.tab];if(a==null)throw new Error(`Tab ${t.tab} is not defined in the tabs config.`);if(t.layout!=null){let u=await Promise.all(t.layout.map(l=>VXs({rawConfig:l,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})));return{title:a.displayName,icon:a.icon,slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"layout",layout:u},viewers:PNe(a.viewers),orphaned:a.orphaned,featureFlags:mNe(a.featureFlag)}}if(a.href!=null)return{title:a.displayName,icon:a.icon,slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"link",href:a.href},viewers:PNe(a.viewers),orphaned:a.orphaned,featureFlags:mNe(a.featureFlag)};if(a.changelog!=null)return{title:a.displayName,icon:a.icon,slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"changelog",changelog:await _ae(D8(a.changelog,i),"{md,mdx}")},viewers:PNe(a.viewers),orphaned:a.orphaned,featureFlags:mNe(a.featureFlag)};So(a)}async function LXs({tabs:e={},rawNavigationConfig:t,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n}){return u$S(t)?{type:"tabbed",items:await Promise.all(t.map(u=>ZHS({tabs:e,item:u,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})))}:{type:"untabbed",items:await Promise.all(t.map(a=>VXs({rawConfig:a,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})))}}var kHS="Changelog";async function VXs({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}){if(agp(e))return wxa(e,r);if(t$S(e))return{type:"section",title:e.section,icon:e.icon,contents:await Promise.all(e.contents.map(n=>VXs({rawConfig:n,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}))),slug:e.slug??void 0,collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,skipUrlSlug:e.skipSlug??!1,overviewAbsolutePath:D8(e.path,r),viewers:PNe(e.viewers),orphaned:e.orphaned,featureFlags:mNe(e.featureFlag)};if(r$S(e))return{type:"apiSection",openrpc:e.openrpc,title:e.api,icon:e.icon,apiName:e.apiName??void 0,audiences:e.audiences!=null?{type:"select",audiences:e.audiences}:{type:"all"},showErrors:e.displayErrors??!0,snippetsConfiguration:e.snippets!=null?e$S({rawConfig:e.snippets}):void 0,navigation:e.layout?.flatMap(n=>WRo(n,r))??[],overviewAbsolutePath:D8(e.summary,r),hidden:e.hidden??void 0,slug:e.slug,skipUrlSlug:e.skipSlug??!1,flattened:e.flattened??!1,alphabetized:e.alphabetized??!1,paginated:e.paginated??!1,playground:e.playground,viewers:PNe(e.viewers),orphaned:e.orphaned,featureFlags:mNe(e.featureFlag)};if(ogp(e))return{type:"link",text:e.link,url:e.href,icon:e.icon};if(i$S(e))return{type:"changelog",changelog:await _ae(D8(e.changelog,r),"{md,mdx}"),hidden:e.hidden??!1,icon:e.icon,title:e.title??kHS,slug:e.slug,viewers:PNe(e.viewers),orphaned:e.orphaned,featureFlags:mNe(e.featureFlag)};So(e)}function wxa(e,t){if(e!=null)return{type:"page",title:e.page,absolutePath:D8(e.path,t),slug:e.slug,icon:e.icon,hidden:e.hidden,noindex:e.noindex,viewers:PNe(e.viewers),orphaned:e.orphaned,featureFlags:mNe(e.featureFlag)}}function WRo(e,t){return typeof e=="string"?[{type:"item",value:e}]:agp(e)?[wxa(e,t)]:ogp(e)?[{type:"link",text:e.link,url:e.href,icon:e.icon}]:n$S(e)?[{type:"section",title:e.section,referencedSubpackages:e.referencedPackages??[],overviewAbsolutePath:D8(e.summary,t),contents:e.contents?.flatMap(r=>WRo(r,t))??[],slug:e.slug,hidden:e.hidden,skipUrlSlug:e.skipSlug,icon:e.icon,playground:e.playground,viewers:PNe(e.viewers),orphaned:e.orphaned,featureFlags:mNe(e.featureFlag)}]:a$S(e)?[{type:"endpoint",endpoint:e.endpoint,title:e.title,icon:e.icon,slug:e.slug,hidden:e.hidden,playground:e.playground,viewers:PNe(e.viewers),orphaned:e.orphaned,featureFlags:mNe(e.featureFlag)}]:Object.entries(e).map(([r,i])=>o$S(i)?{type:"package",title:i.title,package:r,overviewAbsolutePath:D8(i.summary,t),contents:i.contents?.flatMap(n=>WRo(n,t))??[],slug:i.slug,hidden:i.hidden,skipUrlSlug:i.skipSlug,icon:i.icon,playground:i.playground,viewers:PNe(i.viewers),orphaned:i.orphaned,featureFlags:mNe(i.featureFlag)}:{type:"package",title:void 0,package:r,overviewAbsolutePath:void 0,contents:i.flatMap(n=>WRo(n,t)),hidden:!1,slug:void 0,skipUrlSlug:!1,icon:void 0,playground:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}function e$S({rawConfig:e}){return{python:e.python,typescript:e.typescript,go:e.go,java:e.java,ruby:e.ruby,csharp:e.csharp}}function agp(e){return vw(e)&&typeof e.page=="string"&&typeof e.path=="string"}function t$S(e){return e.section!=null}function r$S(e){return e.api!=null}function ogp(e){return pae.RawSchemas,vw(e)&&typeof e.link=="string"&&typeof e.href=="string"}function i$S(e){return vw(e)&&typeof e.changelog=="string"}function n$S(e){return vw(e)&&typeof e.section=="string"&&Array.isArray(e.contents)}function a$S(e){return vw(e)&&typeof e.endpoint=="string"}function o$S(e){return!Array.isArray(e)}function D8(e,t){if(e!=null)return Bv(Rd(t),e)}function u$S(e){return Array.isArray(e)&&e.length>0&&e[0].tab!=null}function s$S(e){return e?.map(t=>t.type==="github"?{type:"github",url:oH.FernRegistry.Url(t.value)}:{type:t.type,text:t.text,url:oH.FernRegistry.Url(t.href??t.url??"/"),icon:t.icon,rightIcon:t.rightIcon,rounded:t.rounded})}function c$S(e){if(e==null)return;let t=[];if(Object.keys(e).forEach(r=>{let i=e[r];i!=null&&t.push({type:r,value:oH.FernRegistry.Url(i)})}),t.length!==0)return t}async function l$S(e,t){if(e!=null)return{"og:site_name":e.ogSiteName,"og:title":e.ogTitle,"og:description":e.ogDescription,"og:url":e.ogUrl,"og:image":await FXs(e.ogImage,t),"og:image:width":e.ogImageWidth,"og:image:height":e.ogImageHeight,"og:locale":e.ogLocale,"og:logo":await FXs(e.ogLogo,t),"twitter:title":e.twitterTitle,"twitter:description":e.twitterDescription,"twitter:image":await FXs(e.twitterImage,t),"twitter:handle":e.twitterHandle,"twitter:site":e.twitterSite,"twitter:url":e.twitterUrl,"twitter:card":e.twitterCard,nofollow:void 0,noindex:void 0}}async function FXs(e,t){if(e==null)return;if(e.startsWith("http"))return{type:"url",value:e};let r=D8(e,t);return await jf(r)?{type:"filepath",value:r}:{type:"url",value:e}}function PNe(e){if(e!=null){if(typeof e=="string")return[oH.FernRegistry.RoleId(e)];if(e.length!==0)return e.map(oH.FernRegistry.RoleId)}}var sgp=require("fs/promises");var ugp=Su.strictObject({organization:Su.string(),version:Su.string()});async function Zgi({directory:e,context:t}){let r=Eu(e,Ta.of(lae)),i=await(0,sgp.readFile)(r),n=JSON.parse(i.toString()),a=await gBo({schema:ugp,value:n,context:t,filepathBeingParsed:r});return{_absolutePath:r,rawConfig:a,organization:a.organization,version:a.version}}var $={TYPESCRIPT:"fernapi/fern-typescript",TYPESCRIPT_SDK:"fernapi/fern-typescript-sdk",TYPESCRIPT_NODE_SDK:"fernapi/fern-typescript-node-sdk",TYPESCRIPT_BROWSER_SDK:"fernapi/fern-typescript-browser-sdk",TYPESCRIPT_EXPRESS:"fernapi/fern-typescript-express",JAVA:"fernapi/fern-java",JAVA_MODEL:"fernapi/java-model",JAVA_SDK:"fernapi/fern-java-sdk",JAVA_SPRING:"fernapi/fern-java-spring",PYTHON_FASTAPI:"fernapi/fern-fastapi-server",PYTHON_PYDANTIC:"fernapi/fern-pydantic-model",PYTHON_SDK:"fernapi/fern-python-sdk",GO_MODEL:"fernapi/fern-go-model",GO_SDK:"fernapi/fern-go-sdk",GO_FIBER:"fernapi/fern-go-fiber",RUBY_MODEL:"fernapi/fern-ruby-model",RUBY_SDK:"fernapi/fern-ruby-sdk",CSHARP_MODEL:"fernapi/fern-csharp-model",CSHARP_SDK:"fernapi/fern-csharp-sdk",SWIFT_MODEL:"fernapi/fern-swift-model",SWIFT_SDK:"fernapi/fern-swift-sdk",PHP_MODEL:"fernapi/fern-php-model",PHP_SDK:"fernapi/fern-php-sdk",RUST_MODEL:"fernapi/fern-rust-model",RUST_SDK:"fernapi/fern-rust-sdk",OPENAPI:"fernapi/fern-openapi",STOPLIGHT:"fernapi/fern-stoplight",POSTMAN:"fernapi/fern-postman",OPENAPI_PYTHON_CLIENT:"fernapi/openapi-python-client"};var Sxa={[$.JAVA]:{version:"2.38.1"},[$.TYPESCRIPT_EXPRESS]:{version:"0.18.4",output:{location:"local-file-system",path:"../src/fern"}},[$.JAVA_MODEL]:{version:"1.0.0"},[$.JAVA_SDK]:{version:"2.38.1",output:{location:"local-file-system",path:"../sdks/java/src/main/java/"}},[$.JAVA_SPRING]:{version:"0.9.2",output:{location:"local-file-system",path:"../src/main/java/com/fern"}},[$.TYPESCRIPT]:{version:"0.0.247"},[$.TYPESCRIPT_SDK]:{version:"2.3.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[$.TYPESCRIPT_NODE_SDK]:{version:"2.3.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[$.TYPESCRIPT_BROWSER_SDK]:{version:"1.0.0",output:{location:"local-file-system",path:"../sdks/typescript"}},[$.PYTHON_PYDANTIC]:{version:"1.4.7"},[$.PYTHON_FASTAPI]:{version:"1.7.0",output:{location:"local-file-system",path:"../src/fern"}},[$.PYTHON_SDK]:{version:"4.23.2",output:{location:"local-file-system",path:"../sdks/python"}},[$.GO_FIBER]:{version:"0.23.5"},[$.GO_MODEL]:{version:"0.23.5"},[$.GO_SDK]:{version:"1.4.0",output:{location:"local-file-system",path:"../sdks/go"},config:{module:{path:"sdk"}}},[$.RUBY_MODEL]:{version:"0.0.8"},[$.RUBY_SDK]:{version:"0.8.2",output:{location:"local-file-system",path:"../sdks/ruby"}},[$.OPENAPI]:{version:"0.1.7",config:{format:"yaml"},output:{location:"local-file-system",path:"../openapi"}},[$.STOPLIGHT]:{version:"0.0.28",config:{format:"yaml"}},[$.POSTMAN]:{version:"0.4.0",output:{location:"local-file-system",path:"../postman"}},[$.OPENAPI_PYTHON_CLIENT]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/python"},config:{format:"yaml"}},[$.CSHARP_MODEL]:{version:"0.0.1"},[$.CSHARP_SDK]:{version:"2.0.2",output:{location:"local-file-system",path:"../sdks/csharp"}},[$.SWIFT_MODEL]:{version:"0.0.0"},[$.SWIFT_SDK]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/swift/sdk"}},[$.PHP_MODEL]:{version:"0.0.0"},[$.PHP_SDK]:{version:"1.16.3",output:{location:"local-file-system",path:"../sdks/php/sdk"}},[$.RUST_MODEL]:{version:"0.0.1",output:{location:"local-file-system",path:"../models/rust"}},[$.RUST_SDK]:{version:"0.0.1",output:{location:"local-file-system",path:"../sdks/rust"}}};function TIi(e,t){let r=f$S(e);return r??t.failAndThrow("Unrecognized generator: "+e)}function f$S(e){if(e.startsWith("fernapi/")||(e=`fernapi/${e}`),d$S(e))return e}function d$S(e){return Object.values($).includes(e)}var CNo=si(Xxa(),1),RSp=si(XIi(),1);async function Brr({generatorName:e,cliVersion:t,channel:r,currentGeneratorVersion:i,includeMajor:n,context:a}){let u=RSp.default.parse(i),l=new CNo.FernRegistryClient({environment:"https://registry.buildwithfern.com"});a?.logger.debug(`Getting latest version for ${e} with CLI version ${t}, includeMajor: ${n}, prior version: ${u}`);let d={generator:LaD(e,a),releaseTypes:[r??CNo.FernRegistry.generators.ReleaseType.Ga],cliVersion:t==="0.0.0"?void 0:t};!n&&u!=null&&(d.generatorMajorVersion=u.major);let s=await l.generators.versions.getLatestGeneratorRelease(d);if(s.ok)return s.body.version}function LaD(e,t){switch(e.startsWith("fernapi/")&&(e=e.replace("fernapi/","")),e){case"fern-python-sdk":return"python-sdk";case"fern-pydantic-model":return"pydantic";case"fern-fastapi-server":return"fastapi";case"fern-typescript-browser-sdk":case"fern-typescript-node-sdk":case"fern-typescript-sdk":return"ts-sdk";case"fern-typescript-express":return"ts-express";case"fern-java-sdk":return"java-sdk";case"java-model":return"java-model";case"fern-java-spring":return"java-spring";case"fern-go-sdk":return"go-sdk";case"fern-go-model":return"go-model";case"fern-go-fiber":return"go-fiber";case"fern-csharp-sdk":return"csharp-sdk";case"fern-csharp-model":return"csharp-model";case"fern-ruby-sdk":return"ruby-sdk";case"fern-ruby-model":return"ruby-model";case"fern-postman":return"postman";case"fern-openapi":return"openapi";case"fern-php-sdk":return"php-sdk";case"fern-php-model":return"php-model";case"fern-rust-sdk":return"rust-sdk";case"fern-rust-model":return"rust-model";case"fern-swift-sdk":return"swift-sdk";case"fern-swift-model":return"swift-model";default:return t?.logger.warn(`Unrecognized generator name found, attempting to parse manually: ${e}`),e.startsWith("fern-")?e.replace("fern-",""):e}}async function xSp({generatorsConfiguration:e,groupName:t=e[Bh.DEFAULT_GROUP_GENERATORS_CONFIG_KEY],context:r,update:i}){if(t==null)return r.failAndThrow("No group specified.");let n=e.groups??={},a=n[t];if(a==null){let u=n[t]??={generators:[]};await i(u,t)}else await i(a,t);return e}async function Yks({generatorName:e,generatorsConfiguration:t,groupName:r=t[wqo],context:i,cliVersion:n}){let a=TIi(e,i),u=Sxa[a];return await xSp({generatorsConfiguration:t,groupName:r,context:i,update:async l=>{l.generators.some(d=>d.name===a)&&i.failAndThrow(`${e} is already installed in group ${r}.`),l.generators.push({name:a,...u,version:await Brr({cliVersion:n,generatorName:a,context:i,channel:void 0})??u.version})}})}var Irr="$";var MF={};Po(MF,{AvailabilityStatusSchema:()=>FSp,FernDefinitionError:()=>sNa,FernDefinitionTimeoutError:()=>cNa,FormDataBodyEncodingStyle:()=>KSp,HttpMethodSchema:()=>JSp,ObjectPropertyAccess:()=>ZSp,StreamFormat:()=>YSp,SupportedSdkLanguageSchema:()=>HSp,WebSocketOrigin:()=>iDp,WebhookMethodSchema:()=>rDp,auth:()=>NSp,availability:()=>Xks,commons:()=>LSp,encoding:()=>USp,environments:()=>VSp,errors:()=>WSp,examples:()=>Zks,file:()=>$Sp,pagination:()=>GSp,products:()=>QSp,serialization:()=>Sec,service:()=>kks,source:()=>XSp,types:()=>eec,validation:()=>kSp,variables:()=>eDp,versioning:()=>tDp,webhooks:()=>tec,websocket:()=>rec});var NSp={};var Xks={};Po(Xks,{AvailabilityStatusSchema:()=>FSp});var FSp={InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",GenerallyAvailable:"generally-available"};var LSp={};var USp={};var VSp={};var WSp={};var Zks={};Po(Zks,{SupportedSdkLanguageSchema:()=>HSp});var HSp={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java",Js:"js",Node:"node",Ts:"ts",Nodets:"nodets",Golang:"golang",Dotnet:"dotnet",Jvm:"jvm",Csharp2:"c#"};var $Sp={};var GSp={};var QSp={};var kks={};Po(kks,{FormDataBodyEncodingStyle:()=>KSp,HttpMethodSchema:()=>JSp,StreamFormat:()=>YSp});var JSp={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD"};var KSp={Json:"json",Exploded:"exploded",Form:"form"};var YSp={Sse:"sse",Json:"json"};var XSp={};var eec={};Po(eec,{ObjectPropertyAccess:()=>ZSp});var ZSp={ReadOnly:"read-only",WriteOnly:"write-only"};var kSp={};var eDp={};var tDp={};var tec={};Po(tec,{WebhookMethodSchema:()=>rDp});var rDp={Post:"POST",Get:"GET"};var rec={};Po(rec,{WebSocketOrigin:()=>iDp});var iDp={Client:"client",Server:"server"};var Sec={};Po(Sec,{AliasSchema:()=>JFo,AnyAuthItem:()=>xNo,AnyAuthSchemesSchema:()=>NNo,ApiAuthSchema:()=>FNo,AuthSchemeDeclarationSchema:()=>tFo,AuthSchemeReferenceSchema:()=>uLn,AuthVariable:()=>Men,AvailabilitySchema:()=>iFo,AvailabilityStatusSchema:()=>cLn,AvailabilityUnionSchema:()=>nFo,BaseTypeDeclarationSchema:()=>FNe,BaseTypeReferenceSchema:()=>pLn,BasicAuthSchemeSchema:()=>JNo,BearerAuthSchemeSchema:()=>eFo,CasingOverridesSchema:()=>BFo,CursorPaginationSchema:()=>b3o,CustomPaginationSchema:()=>O3o,DeclarationSchema:()=>zrr,DeclarationWithNameSchema:()=>TDp,DeclarationWithoutDocsSchema:()=>sFo,DefinitionFileSchema:()=>z3o,DiscriminatedUnionSchema:()=>HFo,EncodingSchema:()=>lLn,EnumSchema:()=>RFo,EnumValue:()=>zFo,EnumValueSchema:()=>IFo,EnvironmentSchema:()=>dFo,ErrorDeclarationSchema:()=>hFo,ErrorDiscriminationSchema:()=>V3o,ExampleBodyResponseSchema:()=>bFo,ExampleCodeSampleSchema:()=>DFo,ExampleCodeSampleSchemaLanguage:()=>SFo,ExampleCodeSampleSchemaSdk:()=>wFo,ExampleEndpointCallArraySchema:()=>CDp,ExampleEndpointCallSchema:()=>dLn,ExampleResponseSchema:()=>PFo,ExampleSseEventSchema:()=>OFo,ExampleSseResponseSchema:()=>mFo,ExampleStreamResponseSchema:()=>gFo,ExampleTypeReferenceSchema:()=>A8,ExampleTypeSchema:()=>fLn,ExampleTypeValueSchema:()=>_Fo,ExampleWebSocketMessage:()=>yFo,ExampleWebSocketSession:()=>vFo,ExampleWebhookCallSchema:()=>EFo,Export:()=>N3o,ExportDetailed:()=>x3o,FormDataBodyEncodingStyle:()=>i3o,GrpcTransport:()=>YFo,HeaderAuthSchemeSchema:()=>QNo,HttpEndpointSchema:()=>P3o,HttpHeaderSchema:()=>LNe,HttpInlineFileRequestBodyPropertySchema:()=>n3o,HttpInlineRequestBodyPropertySchema:()=>a3o,HttpInlineRequestBodySchema:()=>o3o,HttpMethodSchema:()=>XFo,HttpPathParameterSchema:()=>Rrr,HttpQueryParameterSchema:()=>hLn,HttpReferencedRequestBodySchema:()=>r3o,HttpRequest:()=>c3o,HttpRequestBodySchema:()=>u3o,HttpRequestSchema:()=>s3o,HttpResponseSchema:()=>f3o,HttpResponseSchemaDetailed:()=>l3o,HttpResponseStreamSchema:()=>_3o,HttpResponseStreamSchemaDetailed:()=>p3o,HttpServiceSchema:()=>j3o,InferredAuthenticatedRequestHeader:()=>YNo,InferredBearerAuthSchema:()=>kNo,InferredGetTokenEndpointSchema:()=>ZNo,InferredGetTokenEndpointSchemaObject:()=>XNo,MultipleBaseUrlsEnvironmentSchema:()=>fFo,Navigation:()=>R3o,NumberValidationSchema:()=>oFo,OAuthAccessTokenRequestPropertiesSchema:()=>LNo,OAuthAccessTokenResponsePropertiesSchema:()=>UNo,OAuthGetTokenEndpointSchema:()=>VNo,OAuthRefreshTokenEndpointSchema:()=>$No,OAuthRefreshTokenRequestPropertiesSchema:()=>WNo,OAuthRefreshTokenResponsePropertiesSchema:()=>HNo,OAuthSchemeSchema:()=>GNo,ObjectExtendsSchema:()=>xNe,ObjectPropertyAccess:()=>MFo,ObjectPropertySchema:()=>tzi,ObjectPropertyWithAccessSchema:()=>AFo,ObjectSchema:()=>CFo,OffsetPaginationSchema:()=>g3o,OpenApiSourceSchema:()=>qFo,PackageMarkerFileSchema:()=>BDp,Pagination:()=>m3o,PaginationSchema:()=>yLn,ProductDeclarationHeaderObjectSchema:()=>X3o,ProductDeclarationHeaderSchema:()=>Z3o,ProductDeclarationSchema:()=>k3o,ProductValue:()=>Y3o,ProductValueDetailed:()=>K3o,PropertyBasedErrorDiscrimination:()=>L3o,ProtobufSourceSchema:()=>TFo,ProtobufTypeSchema:()=>cFo,QueryParameterTypeReferenceDetailed:()=>kFo,ResponseError:()=>y3o,ResponseErrorWithDocsSchema:()=>h3o,ResponseErrorsSchema:()=>v3o,RootApiFileSchema:()=>IDp,ServiceTransport:()=>_Ln,SingleBaseUrlEnvironmentSchema:()=>lFo,SingleUndiscriminatedUnionTypeDetailedSchema:()=>$Fo,SingleUndiscriminatedUnionTypeSchema:()=>GFo,SingleUnionTypeDetailedSchema:()=>VFo,SingleUnionTypeKey:()=>UFo,SingleUnionTypeKeySchema:()=>LFo,SingleUnionTypeSchema:()=>WFo,SourceSchema:()=>rzi,StatusCodeBasedErrorDiscrimination:()=>U3o,StreamFormat:()=>d3o,StringValidationSchema:()=>aFo,SupportedSdkLanguageSchema:()=>jFo,TokenBearerAuthSchema:()=>KNo,TypeDeclarationSchema:()=>KFo,TypeReferenceDeclarationWithEnvOverride:()=>t3o,TypeReferenceDeclarationWithEnvOverrideSchema:()=>e3o,TypeReferenceDeclarationWithName:()=>NNe,TypeReferenceDeclarationWithNameSchema:()=>zDp,TypeReferenceDetailedSchema:()=>FFo,TypeReferenceSchema:()=>nOi,UndiscriminatedUnionSchema:()=>QFo,UnionDiscriminant:()=>NFo,UnionDiscriminantSchema:()=>xFo,ValidationSchema:()=>ezi,VariableDeclarationDetailed:()=>W3o,VariableDeclarationSchema:()=>H3o,VariableReferenceSchema:()=>ZFo,VersionDeclarationHeaderObjectSchema:()=>Q3o,VersionDeclarationHeaderSchema:()=>J3o,VersionDeclarationSchema:()=>vLn,VersionValue:()=>G3o,VersionValueDetailed:()=>$3o,WebSocketChannelInlinedMessageSchema:()=>T3o,WebSocketChannelMessageBodySchema:()=>C3o,WebSocketChannelMessageSchema:()=>B3o,WebSocketChannelReferencedMessageSchema:()=>q3o,WebSocketChannelSchema:()=>I3o,WebSocketOrigin:()=>A3o,WebhookInlinedPayloadSchema:()=>D3o,WebhookMethodSchema:()=>w3o,WebhookPayloadSchema:()=>E3o,WebhookReferencedPayloadSchema:()=>S3o,WebhookSchema:()=>M3o,WithAudiences:()=>bL,WithAuthSchema:()=>rFo,WithAvailability:()=>SJ,WithDisplayName:()=>vL,WithDocsSchema:()=>Zp,WithEnvironmentVariable:()=>sLn,WithEnvironmentsSchema:()=>pFo,WithHeadersSchema:()=>F3o,WithName:()=>pS,WithValidation:()=>uFo,auth:()=>uec,availability:()=>sec,commons:()=>cec,encoding:()=>lec,environments:()=>fec,errors:()=>dec,examples:()=>pec,file:()=>_ec,pagination:()=>hec,products:()=>yec,service:()=>vec,source:()=>bec,types:()=>gec,validation:()=>Oec,variables:()=>mec,versioning:()=>Pec,webhooks:()=>jec,websocket:()=>wec});var uec={};Po(uec,{AnyAuthItem:()=>xNo,AnyAuthSchemesSchema:()=>NNo,ApiAuthSchema:()=>FNo,AuthSchemeDeclarationSchema:()=>tFo,AuthSchemeReferenceSchema:()=>uLn,AuthVariable:()=>Men,BasicAuthSchemeSchema:()=>JNo,BearerAuthSchemeSchema:()=>eFo,HeaderAuthSchemeSchema:()=>QNo,InferredAuthenticatedRequestHeader:()=>YNo,InferredBearerAuthSchema:()=>kNo,InferredGetTokenEndpointSchema:()=>ZNo,InferredGetTokenEndpointSchemaObject:()=>XNo,OAuthAccessTokenRequestPropertiesSchema:()=>LNo,OAuthAccessTokenResponsePropertiesSchema:()=>UNo,OAuthGetTokenEndpointSchema:()=>VNo,OAuthRefreshTokenEndpointSchema:()=>$No,OAuthRefreshTokenRequestPropertiesSchema:()=>WNo,OAuthRefreshTokenResponsePropertiesSchema:()=>HNo,OAuthSchemeSchema:()=>GNo,TokenBearerAuthSchema:()=>KNo,WithAuthSchema:()=>rFo,WithEnvironmentVariable:()=>sLn});var gr={};Po(gr,{JsonError:()=>nLn,ParseError:()=>aLn,any:()=>bDp,bigint:()=>aDp,boolean:()=>gDp,booleanLiteral:()=>vDp,date:()=>oDp,discriminant:()=>MDp,enum_:()=>INo,getObjectLikeUtils:()=>W$t,getObjectUtils:()=>Een,getSchemaUtils:()=>vT,isProperty:()=>kIi,lazy:()=>uDp,lazyObject:()=>_Dp,list:()=>RNo,number:()=>ODp,object:()=>zNo,objectWithoutOptionalProperties:()=>pDp,optional:()=>iec,property:()=>cDp,record:()=>wDp,set:()=>SDp,string:()=>mDp,stringLiteral:()=>yDp,transform:()=>nec,undiscriminatedUnion:()=>EDp,union:()=>qDp,unknown:()=>PDp,withParsedProperties:()=>oec});var Jj={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function CA(e,t){return`Expected ${t}. Received ${UaD(e)}.`}function UaD(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function yL(e){return{...e,json:nDp(e.json),parse:nDp(e.parse)}}function nDp(e){return(t,r)=>{let i=e(t,r),{skipValidation:n=!1}=r??{};return!i.ok&&n?(console.warn(["Failed to validate.",...i.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
1673
1673
|
`)),{ok:!0,value:t}):i}}function BNo(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var nLn=class e extends Error{errors;constructor(t){super(t.map(BNo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var aLn=class e extends Error{errors;constructor(t){super(t.map(BNo).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function vT(e){return{optional:()=>iec(e),transform:t=>nec(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new aLn(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new nLn(i.errors)}}}function iec(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>Jj.OPTIONAL};return{...t,...vT(t)}}function nec(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(i,n)=>{let a=t.untransform(i);return e.json(a,n)},getType:()=>e.getType()};return{...r,...vT(r)}}function aDp(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:CA(t,"string")}]}:{ok:!0,value:BigInt(t)},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t.toString()}:{ok:!1,errors:[{path:r,message:CA(t,"bigint")}]},getType:()=>Jj.BIGINT};return{...yL(e),...vT(e)}}var VaD=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function oDp(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:CA(t,"string")}]}:VaD.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:CA(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:CA(t,"Date object")}]},getType:()=>Jj.DATE};return{...yL(e),...vT(e)}}function wJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...yL(r),...vT(r)}}}function INo(e){let t=new Set(e);return wJ(Jj.ENUM,(i,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:a=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:a,message:CA(i,"string")}]}:!t.has(i)&&!n?{ok:!1,errors:[{path:a,message:CA(i,"enum")}]}:{ok:!0,value:i})()}function uDp(e){let t=aec(e);return{...t,...vT(t)}}function aec(e){return{parse:(t,r)=>oLn(e).parse(t,r),json:(t,r)=>oLn(e).json(t,r),getType:()=>oLn(e).getType()}}function oLn(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function aNa(e){return Object.entries(e)}function oNa(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[n,a])=>(r.has(n)&&(i[n]=a),i),{})}function ZIi(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function uNa(e){return Object.keys(e)}function sDp(e,t){let r=[],i=[];for(let n of e)t(n)?r.push(n):i.push(n);return[r,i]}function W$t(e){return{withParsedProperties:t=>oec(e,t)}}function oec(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);if(!a.ok)return a;let u=Object.entries(t).reduce((l,[d,s])=>({...l,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(i,n)=>{if(!ZIi(i))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:CA(i,"object")}]};let a=new Set(Object.keys(t)),u=oNa(i,Object.keys(i).filter(l=>!a.has(l)));return e.json(u,n)},getType:()=>e.getType()};return{...r,...vT(r),...W$t(r)}}function cDp(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function kIi(e){return e.isProperty}function zNo(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,i])=>kIi(i)?i.rawKey:r),_getParsedProperties:()=>uNa(e),parse:(r,i)=>{let n={},a=[];for(let[u,l]of aNa(e)){let d=kIi(l)?l.rawKey:u,s=kIi(l)?l.valueSchema:l,o={rawKey:d,parsedKey:u,valueSchema:s};n[d]=o,dDp(s)&&a.push(d)}return lDp({value:r,requiredKeys:a,getProperty:u=>{let l=n[u];if(l!=null)return{transformedKey:l.parsedKey,transform:d=>l.valueSchema.parse(d,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},json:(r,i)=>{let n=[];for(let[a,u]of aNa(e)){let l=kIi(u)?u.valueSchema:u;dDp(l)&&n.push(a)}return lDp({value:r,requiredKeys:n,getProperty:a=>{let u=e[a];if(u!=null)return kIi(u)?{transformedKey:u.rawKey,transform:l=>u.valueSchema.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:l=>u.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},getType:()=>Jj.OBJECT};return{...yL(t),...vT(t),...W$t(t),...Een(t)}}function lDp({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:i="fail",skipValidation:n=!1,breadcrumbsPrefix:a=[]}){if(!ZIi(e))return{ok:!1,errors:[{path:a,message:CA(e,"object")}]};let u=new Set(t),l=[],d={};for(let[s,o]of Object.entries(e)){let c=r(s);if(c!=null){u.delete(s);let b=c.transform(o);b.ok?d[c.transformedKey]=b.value:(d[s]=o,l.push(...b.errors))}else switch(i){case"fail":l.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=o;break}}return l.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),l.length===0||n?{ok:!0,value:d}:{ok:!1,errors:l}}function Een(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,n)=>fDp({extensionKeys:t._getRawProperties(),value:i,transformBase:a=>e.parse(a,n),transformExtension:a=>t.parse(a,n)}),json:(i,n)=>fDp({extensionKeys:t._getParsedProperties(),value:i,transformBase:a=>e.json(a,n),transformExtension:a=>t.json(a,n)}),getType:()=>Jj.OBJECT};return{...r,...vT(r),...W$t(r),...Een(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,i)=>{let n=e.parse(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},json:(r,i)=>{let n=e.json(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},getType:()=>Jj.OBJECT};return{...t,...vT(t),...W$t(t),...Een(t)}}}}function fDp({extensionKeys:e,value:t,transformBase:r,transformExtension:i}){let n=new Set(e),[a,u]=sDp(uNa(t),s=>n.has(s)),l=r(oNa(t,u)),d=i(oNa(t,a));return l.ok&&d.ok?{ok:!0,value:{...l.value,...d.value}}:{ok:!1,errors:[...l.ok?[]:l.errors,...d.ok?[]:d.errors]}}function dDp(e){return!WaD(e)}function WaD(e){switch(e.getType()){case Jj.ANY:case Jj.UNKNOWN:case Jj.OPTIONAL:return!0;default:return!1}}function pDp(e){return zNo(e)}function _Dp(e){let t={...aec(e),_getRawProperties:()=>oLn(e)._getRawProperties(),_getParsedProperties:()=>oLn(e)._getParsedProperties()};return{...t,...vT(t),...W$t(t),...Een(t)}}function RNo(e){let t={parse:(r,i)=>hDp(r,(n,a)=>e.parse(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,i)=>hDp(r,(n,a)=>e.json(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>Jj.LIST};return{...yL(t),...vT(t)}}function hDp(e,t){return Array.isArray(e)?e.map((i,n)=>t(i,n)).reduce((i,n)=>{if(i.ok&&n.ok)return{ok:!0,value:[...i.value,n.value]};let a=[];return i.ok||a.push(...i.errors),n.ok||a.push(...n.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:CA(e,"list"),path:[]}]}}function yDp(e){return wJ(Jj.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:CA(r,`"${e}"`)}]})()}function vDp(e){return wJ(Jj.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:CA(r,`${e.toString()}`)}]})()}var bDp=wJ(Jj.ANY,e=>({ok:!0,value:e}));var gDp=wJ(Jj.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:CA(e,"boolean")}]});var ODp=wJ(Jj.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:CA(e,"number")}]});var mDp=wJ(Jj.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:CA(e,"string")}]});var PDp=wJ(Jj.UNKNOWN,e=>({ok:!0,value:e}));function wDp(e,t){let r={parse:(i,n)=>jDp({value:i,isKeyNumeric:e.getType()===Jj.NUMBER,transformKey:a=>e.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(i,n)=>jDp({value:i,isKeyNumeric:e.getType()===Jj.NUMBER,transformKey:a=>e.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>Jj.RECORD};return{...yL(r),...vT(r)}}function jDp({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:n=[]}){return ZIi(e)?aNa(e).reduce((a,[u,l])=>{if(l==null)return a;let d=a,s=u;if(t){let g=u.length>0?Number(u):NaN;isNaN(g)||(s=g)}let o=r(s),c=i(l,s);if(d.ok&&o.ok&&c.ok)return{ok:!0,value:{...d.value,[o.value]:c.value}};let b=[];return d.ok||b.push(...d.errors),o.ok||b.push(...o.errors),c.ok||b.push(...c.errors),{ok:!1,errors:b}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:CA(e,"object")}]}}function SDp(e){let t=RNo(e),r={parse:(i,n)=>{let a=t.parse(i,n);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(i,n)=>i instanceof Set?t.json([...i],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:CA(i,"Set")}]},getType:()=>Jj.SET};return{...yL(r),...vT(r)}}function EDp(e){let t={parse:(r,i)=>DDp((n,a)=>n.parse(r,a),e,i),json:(r,i)=>DDp((n,a)=>n.json(r,a),e,i),getType:()=>Jj.UNDISCRIMINATED_UNION};return{...yL(t),...vT(t)}}function DDp(e,t,r){let i=[];for(let[n,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let l of u.errors)i.push({path:l.path,message:`[Variant ${n}] ${l.message}`})}return{ok:!1,errors:i}}function MDp(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function qDp(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,n=INo(uNa(t)),a={parse:(u,l)=>ADp({value:u,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:d=>n.parse(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),json:(u,l)=>ADp({value:u,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:d=>n.json(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),getType:()=>Jj.UNION};return{...yL(a),...vT(a),...W$t(a)}}function ADp({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:l=[]}){if(!ZIi(e))return{ok:!1,errors:[{path:l,message:CA(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:l,message:`Missing discriminant ("${t}")`}]};let o=i(d);if(!o.ok)return{ok:!1,errors:o.errors};let c=n(o.value);if(c==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...l,t],message:"Unexpected discriminant value"}]};let b=u(s,c);return b.ok?{ok:!0,value:{[r]:d,...b.value}}:b}var Zp=gr.object({docs:gr.string().optional()});var uLn=gr.object({scheme:gr.string()}).extend(Zp);var xNo=gr.undiscriminatedUnion([gr.string(),uLn]);var NNo=gr.object({any:gr.list(xNo)}).extend(Zp);var FNo=gr.undiscriminatedUnion([gr.string(),uLn,NNo]);var LNo=gr.object({"client-id":gr.string().optional(),"client-secret":gr.string().optional(),scopes:gr.string().optional()});var UNo=gr.object({"access-token":gr.string().optional(),"expires-in":gr.string().optional(),"refresh-token":gr.string().optional()});var VNo=gr.object({endpoint:gr.string(),"request-properties":LNo.optional(),"response-properties":UNo.optional()});var WNo=gr.object({"refresh-token":gr.string()});var HNo=gr.object({"access-token":gr.string().optional(),"expires-in":gr.string().optional(),"refresh-token":gr.string().optional()});var $No=gr.object({endpoint:gr.string(),"request-properties":WNo.optional(),"response-properties":HNo.optional()});var GNo=gr.object({scheme:gr.stringLiteral("oauth"),type:gr.stringLiteral("client-credentials"),scopes:gr.list(gr.string()).optional(),"client-id-env":gr.string().optional(),"client-secret-env":gr.string().optional(),"token-prefix":gr.string().optional(),"token-header":gr.string().optional(),"get-token":VNo,"refresh-token":$No.optional()}).extend(Zp);var sLn=gr.object({env:gr.string().optional()});var pS=gr.object({name:gr.string().optional()});var QNo=gr.object({header:gr.string(),type:gr.string().optional(),prefix:gr.string().optional()}).extend(sLn).extend(pS).extend(Zp);var Men=gr.object({}).extend(sLn).extend(pS);var JNo=gr.object({scheme:gr.stringLiteral("basic"),username:Men.optional(),password:Men.optional()}).extend(Zp);var KNo=gr.object({scheme:gr.stringLiteral("bearer"),token:Men.optional()}).extend(Zp);var YNo=gr.object({"response-property":gr.string(),"header-name":gr.string(),"value-prefix":gr.string().optional()});var XNo=gr.object({endpoint:gr.string(),"expiry-response-property":gr.string().optional(),"authenticated-request-headers":gr.list(YNo).optional()});var ZNo=gr.undiscriminatedUnion([gr.string(),XNo]);var kNo=gr.object({scheme:gr.stringLiteral("bearer"),"get-token":ZNo}).extend(Zp);var eFo=gr.undiscriminatedUnion([KNo,kNo]);var tFo=gr.undiscriminatedUnion([GNo,QNo,JNo,eFo]);var rFo=gr.object({auth:FNo.optional(),"auth-schemes":gr.record(gr.string(),tFo).optional()});var sec={};Po(sec,{AvailabilitySchema:()=>iFo,AvailabilityStatusSchema:()=>cLn,AvailabilityUnionSchema:()=>nFo});var cLn=gr.enum_(["in-development","pre-release","deprecated","generally-available"]);var iFo=gr.object({status:cLn,message:gr.string().optional()});var nFo=gr.undiscriminatedUnion([cLn,iFo]);var cec={};Po(cec,{DeclarationSchema:()=>zrr,DeclarationWithNameSchema:()=>TDp,DeclarationWithoutDocsSchema:()=>sFo,WithAudiences:()=>bL,WithAvailability:()=>SJ,WithDisplayName:()=>vL,WithDocsSchema:()=>Zp,WithName:()=>pS,WithValidation:()=>uFo});var SJ=gr.object({availability:nFo.optional()});var vL=gr.object({"display-name":gr.string().optional()});var aFo=gr.object({minLength:gr.number().optional(),maxLength:gr.number().optional(),pattern:gr.string().optional(),format:gr.string().optional()});var oFo=gr.object({min:gr.number().optional(),max:gr.number().optional(),exclusiveMin:gr.boolean().optional(),exclusiveMax:gr.boolean().optional(),multipleOf:gr.number().optional()});var ezi=gr.undiscriminatedUnion([aFo,oFo]);var uFo=gr.object({validation:ezi.optional()});var bL=gr.object({audiences:gr.list(gr.string()).optional()});var zrr=gr.object({}).extend(Zp).extend(SJ).extend(bL);var sFo=gr.object({}).extend(SJ).extend(bL);var TDp=gr.object({}).extend(zrr).extend(pS);var lec={};Po(lec,{EncodingSchema:()=>lLn,ProtobufTypeSchema:()=>cFo});var cFo=gr.object({type:gr.string()});var lLn=gr.object({proto:cFo.optional()});var fec={};Po(fec,{EnvironmentSchema:()=>dFo,MultipleBaseUrlsEnvironmentSchema:()=>fFo,SingleBaseUrlEnvironmentSchema:()=>lFo,WithEnvironmentsSchema:()=>pFo});var lFo=gr.object({url:gr.string()}).extend(bL).extend(Zp);var fFo=gr.object({urls:gr.record(gr.string(),gr.string())}).extend(bL).extend(Zp);var dFo=gr.undiscriminatedUnion([gr.string(),lFo,fFo]);var pFo=gr.object({"default-url":gr.string().optional(),"default-environment":gr.string().optional(),environments:gr.record(gr.string(),dFo).optional()});var dec={};Po(dec,{ErrorDeclarationSchema:()=>hFo});var _Fo=gr.unknown();var fLn=gr.object({value:_Fo}).extend(pS).extend(Zp);var hFo=gr.object({"status-code":gr.number(),type:gr.string().optional(),examples:gr.list(fLn).optional()}).extend(Zp);var pec={};Po(pec,{ExampleBodyResponseSchema:()=>bFo,ExampleCodeSampleSchema:()=>DFo,ExampleCodeSampleSchemaLanguage:()=>SFo,ExampleCodeSampleSchemaSdk:()=>wFo,ExampleEndpointCallArraySchema:()=>CDp,ExampleEndpointCallSchema:()=>dLn,ExampleResponseSchema:()=>PFo,ExampleSseEventSchema:()=>OFo,ExampleSseResponseSchema:()=>mFo,ExampleStreamResponseSchema:()=>gFo,ExampleTypeReferenceSchema:()=>A8,ExampleTypeSchema:()=>fLn,ExampleTypeValueSchema:()=>_Fo,ExampleWebSocketMessage:()=>yFo,ExampleWebSocketSession:()=>vFo,ExampleWebhookCallSchema:()=>EFo,SupportedSdkLanguageSchema:()=>jFo});var A8=gr.unknown();var yFo=gr.object({type:gr.string(),body:gr.unknown()});var vFo=gr.object({"path-parameters":gr.record(gr.string(),A8).optional(),"query-parameters":gr.record(gr.string(),A8).optional(),headers:gr.record(gr.string(),A8).optional(),messages:gr.list(yFo)}).extend(pS).extend(Zp);var bFo=gr.object({error:gr.string().optional(),body:A8.optional()});var gFo=gr.object({stream:gr.list(A8)});var OFo=gr.object({event:gr.string(),data:A8.optional()});var mFo=gr.object({stream:gr.list(OFo)});var PFo=gr.undiscriminatedUnion([bFo,gFo,mFo]);var jFo=gr.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","js","node","ts","nodets","golang","dotnet","jvm","c#"]);var wFo=gr.object({sdk:jFo,code:gr.string()}).extend(Zp).extend(pS);var SFo=gr.object({language:gr.string(),code:gr.string(),install:gr.string().optional()}).extend(Zp).extend(pS);var DFo=gr.undiscriminatedUnion([wFo,SFo]);var dLn=gr.object({id:gr.string().optional(),"path-parameters":gr.record(gr.string(),A8).optional(),"query-parameters":gr.record(gr.string(),A8).optional(),headers:gr.record(gr.string(),A8).optional(),request:A8.optional(),response:PFo.optional(),"code-samples":gr.list(DFo).optional()}).extend(pS).extend(Zp);var CDp=gr.list(dLn);var EFo=gr.object({id:gr.string().optional(),payload:A8}).extend(pS).extend(Zp);var _ec={};Po(_ec,{DefinitionFileSchema:()=>z3o,ErrorDiscriminationSchema:()=>V3o,Export:()=>N3o,ExportDetailed:()=>x3o,Navigation:()=>R3o,PackageMarkerFileSchema:()=>BDp,PropertyBasedErrorDiscrimination:()=>L3o,RootApiFileSchema:()=>IDp,StatusCodeBasedErrorDiscrimination:()=>U3o,WithHeadersSchema:()=>F3o});var xNe=gr.undiscriminatedUnion([gr.string(),gr.list(gr.string())]);var MFo=gr.enum_(["read-only","write-only"]);var pLn=gr.object({default:gr.unknown().optional(),encoding:lLn.optional(),validation:ezi.optional()}).extend(Zp).extend(SJ);var NNe=gr.object({type:gr.string()}).extend(pLn).extend(pS).extend(bL);var AFo=gr.object({access:MFo.optional()}).extend(NNe);var tzi=gr.undiscriminatedUnion([gr.string(),AFo]);var qFo=gr.object({openapi:gr.string()});var TFo=gr.object({proto:gr.string()});var rzi=gr.undiscriminatedUnion([qFo,TFo]);var FNe=gr.object({examples:gr.list(fLn).optional(),encoding:lLn.optional(),source:rzi.optional(),inline:gr.boolean().optional()}).extend(Zp).extend(SJ).extend(bL);var CFo=gr.object({extends:xNe.optional(),properties:gr.record(gr.string(),tzi).optional(),"extra-properties":gr.boolean().optional()}).extend(FNe);var BFo=gr.object({camel:gr.string().optional(),snake:gr.string().optional(),pascal:gr.string().optional(),"screaming-snake":gr.string().optional()});var IFo=gr.object({value:gr.string(),casing:BFo.optional()}).extend(Zp).extend(pS);var zFo=gr.undiscriminatedUnion([gr.string(),IFo]);var RFo=gr.object({default:gr.string().optional(),enum:gr.list(zFo)}).extend(FNe);var xFo=gr.object({value:gr.string()}).extend(pS);var NFo=gr.undiscriminatedUnion([gr.string(),xFo]);var FFo=gr.object({type:gr.string()}).extend(pLn).extend(pS).extend(bL);var nOi=gr.undiscriminatedUnion([gr.string(),FFo]);var LFo=gr.object({value:gr.string()}).extend(pS);var UFo=gr.undiscriminatedUnion([gr.string(),LFo]);var VFo=gr.object({type:gr.string().optional(),key:UFo.optional()}).extend(Zp).extend(pS).extend(SJ).extend(vL);var WFo=gr.undiscriminatedUnion([gr.string(),VFo]);var HFo=gr.object({discriminant:NFo.optional(),extends:xNe.optional(),"base-properties":gr.record(gr.string(),nOi).optional(),union:gr.record(gr.string(),WFo)}).extend(FNe);var $Fo=gr.object({type:gr.string()}).extend(Zp).extend(vL).extend(uFo);var GFo=gr.undiscriminatedUnion([gr.string(),$Fo]);var QFo=gr.object({discriminated:gr.booleanLiteral(!1),union:gr.list(GFo)}).extend(FNe);var JFo=gr.object({type:gr.string(),validation:ezi.optional()}).extend(FNe);var KFo=gr.undiscriminatedUnion([gr.string(),CFo,RFo,HFo,QFo,JFo]);var YFo=gr.object({"service-name":gr.string()});var _Ln=gr.object({grpc:YFo.optional()});var XFo=gr.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"]);var ZFo=gr.object({variable:gr.string()}).extend(SJ).extend(Zp);var Rrr=gr.undiscriminatedUnion([nOi,ZFo]);var kFo=gr.object({"allow-multiple":gr.boolean().optional()}).extend(NNe);var hLn=gr.undiscriminatedUnion([gr.string(),kFo]);var e3o=gr.object({env:gr.string().optional()}).extend(NNe);var t3o=gr.undiscriminatedUnion([gr.string(),e3o]);var LNe=t3o;var r3o=gr.object({type:gr.string()}).extend(Zp);var i3o=gr.enum_(["json","exploded","form"]);var n3o=gr.object({style:i3o.optional(),"content-type":gr.string().optional()}).extend(NNe);var a3o=gr.undiscriminatedUnion([gr.string(),n3o]);var o3o=gr.object({extends:xNe.optional(),"extra-properties":gr.boolean().optional(),properties:gr.record(gr.string(),a3o).optional()});var u3o=gr.undiscriminatedUnion([gr.string(),r3o,o3o]);var s3o=gr.object({"content-type":gr.string().optional(),"path-parameters":gr.record(gr.string(),Rrr).optional(),"query-parameters":gr.record(gr.string(),hLn).optional(),headers:gr.record(gr.string(),LNe).optional(),body:u3o.optional()}).extend(pS).extend(Zp);var c3o=gr.undiscriminatedUnion([gr.string(),s3o]);var l3o=gr.object({type:gr.string().optional(),property:gr.string().optional(),"status-code":gr.number().optional()}).extend(Zp);var f3o=gr.undiscriminatedUnion([gr.string(),l3o]);var d3o=gr.enum_(["sse","json"]);var p3o=gr.object({type:gr.string(),format:d3o.optional(),terminator:gr.string().optional()}).extend(Zp);var _3o=gr.undiscriminatedUnion([gr.string(),p3o]);var h3o=gr.object({error:gr.string()}).extend(Zp);var y3o=gr.undiscriminatedUnion([gr.string(),h3o]);var v3o=gr.list(y3o);var b3o=gr.object({cursor:gr.string(),next_cursor:gr.string(),results:gr.string()});var g3o=gr.object({offset:gr.string(),results:gr.string(),step:gr.string().optional(),"has-next-page":gr.string().optional()});var O3o=gr.object({type:gr.stringLiteral("custom"),results:gr.string()});var yLn=gr.undiscriminatedUnion([b3o,g3o,O3o]);var m3o=gr.undiscriminatedUnion([yLn,gr.boolean()]);var P3o=gr.object({method:XFo.optional(),"base-path":gr.string().optional(),path:gr.string(),url:gr.string().optional(),"path-parameters":gr.record(gr.string(),Rrr).optional(),auth:gr.boolean().optional(),idempotent:gr.boolean().optional(),"stream-condition":gr.string().optional(),request:c3o.optional(),response:f3o.optional(),"response-stream":_3o.optional(),errors:v3o.optional(),examples:gr.list(dLn).optional(),pagination:m3o.optional(),transport:_Ln.optional(),source:rzi.optional()}).extend(vL).extend(zrr);var j3o=gr.object({auth:gr.boolean(),url:gr.string().optional(),"base-path":gr.string(),"path-parameters":gr.record(gr.string(),nOi).optional(),idempotent:gr.boolean().optional(),headers:gr.record(gr.string(),nOi).optional(),transport:_Ln.optional(),source:rzi.optional(),endpoints:gr.record(gr.string(),P3o)}).extend(sFo).extend(vL);var w3o=gr.enum_(["POST","GET"]);var S3o=gr.object({type:gr.string()}).extend(Zp);var D3o=gr.object({name:gr.string(),extends:xNe.optional(),properties:gr.record(gr.string(),tzi).optional()});var E3o=gr.undiscriminatedUnion([gr.string(),S3o,D3o]);var M3o=gr.object({method:w3o,headers:gr.record(gr.string(),LNe).optional(),payload:E3o,examples:gr.list(EFo).optional()}).extend(SJ).extend(bL).extend(Zp).extend(vL);var A3o=gr.enum_(["client","server"]);var q3o=gr.object({type:gr.string()}).extend(Zp);var T3o=gr.object({name:gr.string(),extends:xNe.optional(),properties:gr.record(gr.string(),tzi).optional()});var C3o=gr.undiscriminatedUnion([gr.string(),q3o,T3o]);var B3o=gr.object({origin:A3o,body:C3o}).extend(zrr).extend(vL);var I3o=gr.object({auth:gr.boolean(),url:gr.string().optional(),path:gr.string(),headers:gr.record(gr.string(),LNe).optional(),"path-parameters":gr.record(gr.string(),Rrr).optional(),"query-parameters":gr.record(gr.string(),hLn).optional(),messages:gr.record(gr.string(),B3o).optional(),examples:gr.list(vFo).optional()}).extend(zrr).extend(vL);var z3o=gr.object({imports:gr.record(gr.string(),gr.string()).optional(),types:gr.record(gr.string(),KFo).optional(),service:j3o.optional(),errors:gr.record(gr.string(),hFo).optional(),webhooks:gr.record(gr.string(),M3o).optional(),channel:I3o.optional()}).extend(Zp);var R3o=gr.undiscriminatedUnion([gr.string(),gr.list(gr.string())]);var x3o=gr.object({dependency:gr.string(),url:gr.string().optional()});var N3o=gr.undiscriminatedUnion([gr.string(),x3o]);var BDp=gr.object({navigation:R3o.optional(),export:N3o.optional()}).extend(z3o);var F3o=gr.object({headers:gr.record(gr.string(),LNe).optional()});var L3o=gr.object({strategy:gr.stringLiteral("property"),"property-name":gr.string()});var U3o=gr.object({strategy:gr.stringLiteral("status-code")});var V3o=gr.undiscriminatedUnion([L3o,U3o]);var W3o=gr.object({type:gr.string()}).extend(Zp);var H3o=gr.undiscriminatedUnion([gr.string(),W3o]);var $3o=gr.object({value:gr.string()}).extend(Zp).extend(pS);var G3o=gr.undiscriminatedUnion([gr.string(),$3o]);var Q3o=gr.object({name:gr.string().optional(),env:gr.string().optional(),value:gr.string()});var J3o=gr.undiscriminatedUnion([gr.string(),Q3o]);var vLn=gr.object({default:gr.string().optional(),values:gr.list(G3o),header:J3o});var K3o=gr.object({value:gr.string(),versions:vLn.optional()}).extend(Zp).extend(pS);var Y3o=gr.undiscriminatedUnion([gr.string(),K3o]);var X3o=gr.object({name:gr.string().optional(),env:gr.string().optional(),value:gr.string()});var Z3o=gr.undiscriminatedUnion([gr.string(),X3o]);var k3o=gr.object({default:gr.string().optional(),values:gr.list(Y3o),header:Z3o});var IDp=gr.object({name:gr.string(),imports:gr.record(gr.string(),gr.string()).optional(),"error-discrimination":V3o.optional(),audiences:gr.list(gr.string()).optional(),errors:gr.list(gr.string()).optional(),"base-path":gr.string().optional(),"path-parameters":gr.record(gr.string(),Rrr).optional(),"idempotency-headers":gr.record(gr.string(),LNe).optional(),variables:gr.record(gr.string(),H3o).optional(),pagination:yLn.optional(),product:k3o.optional(),version:vLn.optional()}).extend(Zp).extend(vL).extend(pFo).extend(rFo).extend(F3o);var hec={};Po(hec,{CursorPaginationSchema:()=>b3o,CustomPaginationSchema:()=>O3o,OffsetPaginationSchema:()=>g3o,PaginationSchema:()=>yLn});var yec={};Po(yec,{ProductDeclarationHeaderObjectSchema:()=>X3o,ProductDeclarationHeaderSchema:()=>Z3o,ProductDeclarationSchema:()=>k3o,ProductValue:()=>Y3o,ProductValueDetailed:()=>K3o});var vec={};Po(vec,{FormDataBodyEncodingStyle:()=>i3o,GrpcTransport:()=>YFo,HttpEndpointSchema:()=>P3o,HttpHeaderSchema:()=>LNe,HttpInlineFileRequestBodyPropertySchema:()=>n3o,HttpInlineRequestBodyPropertySchema:()=>a3o,HttpInlineRequestBodySchema:()=>o3o,HttpMethodSchema:()=>XFo,HttpPathParameterSchema:()=>Rrr,HttpQueryParameterSchema:()=>hLn,HttpReferencedRequestBodySchema:()=>r3o,HttpRequest:()=>c3o,HttpRequestBodySchema:()=>u3o,HttpRequestSchema:()=>s3o,HttpResponseSchema:()=>f3o,HttpResponseSchemaDetailed:()=>l3o,HttpResponseStreamSchema:()=>_3o,HttpResponseStreamSchemaDetailed:()=>p3o,HttpServiceSchema:()=>j3o,Pagination:()=>m3o,QueryParameterTypeReferenceDetailed:()=>kFo,ResponseError:()=>y3o,ResponseErrorWithDocsSchema:()=>h3o,ResponseErrorsSchema:()=>v3o,ServiceTransport:()=>_Ln,StreamFormat:()=>d3o,TypeReferenceDeclarationWithEnvOverride:()=>t3o,TypeReferenceDeclarationWithEnvOverrideSchema:()=>e3o});var bec={};Po(bec,{OpenApiSourceSchema:()=>qFo,ProtobufSourceSchema:()=>TFo,SourceSchema:()=>rzi});var gec={};Po(gec,{AliasSchema:()=>JFo,BaseTypeDeclarationSchema:()=>FNe,BaseTypeReferenceSchema:()=>pLn,CasingOverridesSchema:()=>BFo,DiscriminatedUnionSchema:()=>HFo,EnumSchema:()=>RFo,EnumValue:()=>zFo,EnumValueSchema:()=>IFo,ObjectExtendsSchema:()=>xNe,ObjectPropertyAccess:()=>MFo,ObjectPropertySchema:()=>tzi,ObjectPropertyWithAccessSchema:()=>AFo,ObjectSchema:()=>CFo,SingleUndiscriminatedUnionTypeDetailedSchema:()=>$Fo,SingleUndiscriminatedUnionTypeSchema:()=>GFo,SingleUnionTypeDetailedSchema:()=>VFo,SingleUnionTypeKey:()=>UFo,SingleUnionTypeKeySchema:()=>LFo,SingleUnionTypeSchema:()=>WFo,TypeDeclarationSchema:()=>KFo,TypeReferenceDeclarationWithName:()=>NNe,TypeReferenceDeclarationWithNameSchema:()=>zDp,TypeReferenceDetailedSchema:()=>FFo,TypeReferenceSchema:()=>nOi,UndiscriminatedUnionSchema:()=>QFo,UnionDiscriminant:()=>NFo,UnionDiscriminantSchema:()=>xFo});var zDp=gr.undiscriminatedUnion([gr.string(),NNe]);var Oec={};Po(Oec,{NumberValidationSchema:()=>oFo,StringValidationSchema:()=>aFo,ValidationSchema:()=>ezi});var mec={};Po(mec,{VariableDeclarationDetailed:()=>W3o,VariableDeclarationSchema:()=>H3o,VariableReferenceSchema:()=>ZFo});var Pec={};Po(Pec,{VersionDeclarationHeaderObjectSchema:()=>Q3o,VersionDeclarationHeaderSchema:()=>J3o,VersionDeclarationSchema:()=>vLn,VersionValue:()=>G3o,VersionValueDetailed:()=>$3o});var jec={};Po(jec,{WebhookInlinedPayloadSchema:()=>D3o,WebhookMethodSchema:()=>w3o,WebhookPayloadSchema:()=>E3o,WebhookReferencedPayloadSchema:()=>S3o,WebhookSchema:()=>M3o});var wec={};Po(wec,{WebSocketChannelInlinedMessageSchema:()=>T3o,WebSocketChannelMessageBodySchema:()=>C3o,WebSocketChannelMessageSchema:()=>B3o,WebSocketChannelReferencedMessageSchema:()=>q3o,WebSocketChannelSchema:()=>I3o,WebSocketOrigin:()=>A3o});var sNa=class e extends Error{statusCode;body;constructor({message:t,statusCode:r,body:i}){super(HaD({message:t,statusCode:r,body:i})),Object.setPrototypeOf(this,e.prototype),r!=null&&(this.statusCode=r),i!==void 0&&(this.body=i)}};function HaD({message:e,statusCode:t,body:r}){let i=[];return e!=null&&i.push(e),t!=null&&i.push(`Status code: ${t.toString()}`),r!=null&&i.push(`Body: ${JSON.stringify(r,void 0,2)}`),i.join(`
|
|
1674
1674
|
`)}var cNa=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function Dec(e){return e.scheme==="oauth"}var $aD={optional:"optional",nullable:"nullable",set:"set",list:"list",map:"map",literal:"literal"},RDp=new Set(Object.values($aD));function $x(e){let t=e.match(/([\w.]+)<([\w,\s]+)>/);if(t?.[0]!=null&&t[1]!=null&&t[2]!=null&&!RDp.has(t[1].trim()))return{name:t[1].trim(),arguments:t[2].split(",").map(r=>r.trim())}}function UNe(e){return $x(e)!=null}function Eec(e){if(e.request!=null)return typeof e.request=="string"?e.request:e.request.body}function Mec(e){if(e.response!=null)return typeof e.response=="string"?e.response:e.response.type}var Aen=class{REFERENCE_REGEX=/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/;validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let i=t.match(this.REFERENCE_REGEX);if(!(i==null||i[1]==null||i[2]==null))return{method:i[1],path:i[2]}}};function RB(e){return typeof e=="string"?!1:e?.extends!=null||e?.properties!=null}function xrr(e){return e?e.proto!=null:!1}var GaD="text";function bLn(e){return e===GaD}var Vs={};Po(Vs,{ApiDefinitionSource:()=>noe,ApiVersionScheme:()=>azi,AuthScheme:()=>BA,AuthSchemesRequirement:()=>toe,AvailabilityStatus:()=>gL,ContainerType:()=>Ry,Environments:()=>$R,ErrorDeclarationDiscriminantValue:()=>nzi,ErrorDiscriminationStrategy:()=>_Ae,ExampleCodeSample:()=>pAe,ExampleContainer:()=>Wm,ExampleEndpointSuccessResponse:()=>NB,ExamplePrimitive:()=>Vd,ExampleQueryParameterShape:()=>q8,ExampleRequestBody:()=>MJ,ExampleResponse:()=>gC,ExampleSingleUnionTypeProperties:()=>K3,ExampleTypeReferenceShape:()=>ay,ExampleTypeShape:()=>l1,ExampleWebSocketMessageBody:()=>hAe,FileProperty:()=>roe,FileUploadBodyPropertyEncoding:()=>lNa,FileUploadRequestProperty:()=>P4,HttpEndpointSource:()=>DJ,HttpMethod:()=>xB,HttpRequestBody:()=>IA,HttpResponseBody:()=>c1,JsonResponse:()=>OL,Literal:()=>jL,NamedTypeDefault:()=>gLn,NonStreamHttpResponseBody:()=>_H,OAuthConfiguration:()=>izi,ObjectPropertyAccess:()=>Urr,Pagination:()=>EJ,PathParameterLocation:()=>HNe,PrimitiveTypeV1:()=>ny,PrimitiveTypeV2:()=>Td,ProtobufMethodType:()=>$$t,ProtobufType:()=>mw,PublishTarget:()=>aoe,PublishingConfig:()=>Lrr,RequestPropertyValue:()=>ioe,ResolvedTypeReference:()=>hH,SdkRequestBodyType:()=>H$t,SdkRequestShape:()=>$Ne,ShapeType:()=>G$t,SingleUnionTypeProperties:()=>PL,Source:()=>aOi,StreamingResponse:()=>mL,SupportedSdkLanguage:()=>Frr,Transport:()=>WNe,Type:()=>Vb,TypeReference:()=>Xc,V2AuthValues:()=>VNe,V2EndpointLocationHttpMethod:()=>Nrr,V2HttpEndpointResponseBody:()=>m4,WebSocketMessageBody:()=>wL,WebSocketMessageOrigin:()=>i7o,WebhookHttpMethod:()=>r7o,WebhookPayload:()=>yH,WellKnownProtobufType:()=>od,audience:()=>xDp,auth:()=>Aec,commons:()=>qec,constants:()=>NDp,dynamic:()=>us,environment:()=>Rec,errors:()=>xec,examples:()=>Nec,generatorExec:()=>U0,http:()=>Lec,ir:()=>Uec,proto:()=>Vec,publish:()=>Wec,types:()=>Hec,variables:()=>aEp,webhooks:()=>$ec,websocket:()=>Gec});var xDp={};var Aec={};Po(Aec,{AuthScheme:()=>BA,AuthSchemesRequirement:()=>toe,OAuthConfiguration:()=>izi});var toe={All:"ALL",Any:"ANY",_visit:(e,t)=>{switch(e){case toe.All:return t.all();case toe.Any:return t.any();default:return t._other()}}};var BA={bearer:e=>({...e,type:"bearer",_visit:function(t){return BA._visit(this,t)}}),basic:e=>({...e,type:"basic",_visit:function(t){return BA._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return BA._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return BA._visit(this,t)}}),inferred:e=>({...e,type:"inferred",_visit:function(t){return BA._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"bearer":return t.bearer(e);case"basic":return t.basic(e);case"header":return t.header(e);case"oauth":return t.oauth(e);case"inferred":return t.inferred(e);default:return t._other(e)}}};var izi={clientCredentials:e=>({...e,type:"clientCredentials",_visit:function(t){return izi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"clientCredentials":return t.clientCredentials(e);default:return t._other(e)}}};var qec={};Po(qec,{AvailabilityStatus:()=>gL});var gL={InDevelopment:"IN_DEVELOPMENT",PreRelease:"PRE_RELEASE",GeneralAvailability:"GENERAL_AVAILABILITY",Deprecated:"DEPRECATED",_visit:(e,t)=>{switch(e){case gL.InDevelopment:return t.inDevelopment();case gL.PreRelease:return t.preRelease();case gL.GeneralAvailability:return t.generalAvailability();case gL.Deprecated:return t.deprecated();default:return t._other()}}};var NDp={};var us={};Po(us,{Auth:()=>FDp,AuthValues:()=>LDp,ErrorSeverity:()=>e7o,FileUploadRequestBodyProperty:()=>GDp,GeneratorOutputConfig:()=>JDp,InlinedRequestBody:()=>HDp,LiteralType:()=>kDp,NamedType:()=>YDp,PublishInfo:()=>KDp,ReferencedRequestBodyType:()=>$Dp,Request:()=>VDp,Response:()=>WDp,SingleDiscriminatedUnionType:()=>ZDp,TypeReference:()=>XDp,auth:()=>Tec,declaration:()=>UDp,endpoints:()=>Cec,environment:()=>QDp,ir:()=>Bec,snippets:()=>Iec,types:()=>zec});var Tec={};Po(Tec,{Auth:()=>FDp,AuthValues:()=>LDp});var FDp={basic:e=>({...e,type:"basic",_visit:function(t){return us.Auth._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return us.Auth._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return us.Auth._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return us.Auth._visit(this,t)}}),inferred:e=>({...e,type:"inferred",_visit:function(t){return us.Auth._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"header":return t.header(e);case"oauth":return t.oauth(e);case"inferred":return t.inferred(e);default:return t._other(e)}}};var LDp={basic:e=>({...e,type:"basic",_visit:function(t){return us.AuthValues._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return us.AuthValues._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return us.AuthValues._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return us.AuthValues._visit(this,t)}}),inferred:e=>({...e,type:"inferred",_visit:function(t){return us.AuthValues._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"header":return t.header(e);case"oauth":return t.oauth(e);case"inferred":return t.inferred(e);default:return t._other(e)}}};var UDp={};var Cec={};Po(Cec,{FileUploadRequestBodyProperty:()=>GDp,InlinedRequestBody:()=>HDp,ReferencedRequestBodyType:()=>$Dp,Request:()=>VDp,Response:()=>WDp});var VDp={body:e=>({...e,type:"body",_visit:function(t){return us.Request._visit(this,t)}}),inlined:e=>({...e,type:"inlined",_visit:function(t){return us.Request._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"body":return t.body(e);case"inlined":return t.inlined(e);default:return t._other(e)}}};var WDp={json:()=>({type:"json",_visit:function(e){return us.Response._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json();default:return t._other(e)}}};var HDp={properties:e=>({value:e,type:"properties",_visit:function(t){return us.InlinedRequestBody._visit(this,t)}}),referenced:e=>({...e,type:"referenced",_visit:function(t){return us.InlinedRequestBody._visit(this,t)}}),fileUpload:e=>({...e,type:"fileUpload",_visit:function(t){return us.InlinedRequestBody._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"properties":return t.properties(e.value);case"referenced":return t.referenced(e);case"fileUpload":return t.fileUpload(e);default:return t._other(e)}}};var $Dp={bytes:()=>({type:"bytes",_visit:function(e){return us.ReferencedRequestBodyType._visit(this,e)}}),typeReference:e=>({value:e,type:"typeReference",_visit:function(t){return us.ReferencedRequestBodyType._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"bytes":return t.bytes();case"typeReference":return t.typeReference(e.value);default:return t._other(e)}}};var GDp={file:e=>({...e,type:"file",_visit:function(t){return us.FileUploadRequestBodyProperty._visit(this,t)}}),fileArray:e=>({...e,type:"fileArray",_visit:function(t){return us.FileUploadRequestBodyProperty._visit(this,t)}}),bodyProperty:e=>({...e,type:"bodyProperty",_visit:function(t){return us.FileUploadRequestBodyProperty._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"fileArray":return t.fileArray(e);case"bodyProperty":return t.bodyProperty(e);default:return t._other(e)}}};var QDp={};var Bec={};Po(Bec,{GeneratorOutputConfig:()=>JDp,PublishInfo:()=>KDp});var JDp={publish:e=>({value:e,type:"publish",_visit:function(t){return us.GeneratorOutputConfig._visit(this,t)}}),local:()=>({type:"local",_visit:function(e){return us.GeneratorOutputConfig._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"publish":return t.publish(e.value);case"local":return t.local();default:return t._other(e)}}};var KDp={go:e=>({...e,type:"go",_visit:function(t){return us.PublishInfo._visit(this,t)}}),maven:e=>({...e,type:"maven",_visit:function(t){return us.PublishInfo._visit(this,t)}}),npm:e=>({...e,type:"npm",_visit:function(t){return us.PublishInfo._visit(this,t)}}),nuget:e=>({...e,type:"nuget",_visit:function(t){return us.PublishInfo._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return us.PublishInfo._visit(this,t)}}),rubygems:e=>({...e,type:"rubygems",_visit:function(t){return us.PublishInfo._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"go":return t.go(e);case"maven":return t.maven(e);case"npm":return t.npm(e);case"nuget":return t.nuget(e);case"pypi":return t.pypi(e);case"rubygems":return t.rubygems(e);default:return t._other(e)}}};var Iec={};Po(Iec,{ErrorSeverity:()=>e7o});var e7o={Critical:"CRITICAL",Warning:"WARNING",_visit:(e,t)=>{switch(e){case e7o.Critical:return t.critical();case e7o.Warning:return t.warning();default:return t._other()}}};var zec={};Po(zec,{LiteralType:()=>kDp,NamedType:()=>YDp,SingleDiscriminatedUnionType:()=>ZDp,TypeReference:()=>XDp});var YDp={alias:e=>({...e,type:"alias",_visit:function(t){return us.NamedType._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return us.NamedType._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return us.NamedType._visit(this,t)}}),discriminatedUnion:e=>({...e,type:"discriminatedUnion",_visit:function(t){return us.NamedType._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return us.NamedType._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"alias":return t.alias(e);case"enum":return t.enum(e);case"object":return t.object(e);case"discriminatedUnion":return t.discriminatedUnion(e);case"undiscriminatedUnion":return t.undiscriminatedUnion(e);default:return t._other(e)}}};var XDp={list:e=>({value:e,type:"list",_visit:function(t){return us.TypeReference._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return us.TypeReference._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return us.TypeReference._visit(this,t)}}),named:e=>({value:e,type:"named",_visit:function(t){return us.TypeReference._visit(this,t)}}),nullable:e=>({value:e,type:"nullable",_visit:function(t){return us.TypeReference._visit(this,t)}}),optional:e=>({value:e,type:"optional",_visit:function(t){return us.TypeReference._visit(this,t)}}),primitive:e=>({value:e,type:"primitive",_visit:function(t){return us.TypeReference._visit(this,t)}}),set:e=>({value:e,type:"set",_visit:function(t){return us.TypeReference._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return us.TypeReference._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e.value);case"literal":return t.literal(e.value);case"map":return t.map(e);case"named":return t.named(e.value);case"nullable":return t.nullable(e.value);case"optional":return t.optional(e.value);case"primitive":return t.primitive(e.value);case"set":return t.set(e.value);case"unknown":return t.unknown();default:return t._other(e)}}};var ZDp={samePropertiesAsObject:e=>({...e,type:"samePropertiesAsObject",_visit:function(t){return us.SingleDiscriminatedUnionType._visit(this,t)}}),singleProperty:e=>({...e,type:"singleProperty",_visit:function(t){return us.SingleDiscriminatedUnionType._visit(this,t)}}),noProperties:e=>({...e,type:"noProperties",_visit:function(t){return us.SingleDiscriminatedUnionType._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"samePropertiesAsObject":return t.samePropertiesAsObject(e);case"singleProperty":return t.singleProperty(e);case"noProperties":return t.noProperties(e);default:return t._other(e)}}};var kDp={boolean:e=>({value:e,type:"boolean",_visit:function(t){return us.LiteralType._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return us.LiteralType._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"boolean":return t.boolean(e.value);case"string":return t.string(e.value);default:return t._other(e)}}};var Rec={};Po(Rec,{Environments:()=>$R});var $R={singleBaseUrl:e=>({...e,type:"singleBaseUrl",_visit:function(t){return $R._visit(this,t)}}),multipleBaseUrls:e=>({...e,type:"multipleBaseUrls",_visit:function(t){return $R._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"singleBaseUrl":return t.singleBaseUrl(e);case"multipleBaseUrls":return t.multipleBaseUrls(e);default:return t._other(e)}}};var xec={};Po(xec,{ErrorDeclarationDiscriminantValue:()=>nzi});var nzi={property:e=>({...e,type:"property",_visit:function(t){return nzi._visit(this,t)}}),statusCode:()=>({type:"statusCode",_visit:function(e){return nzi._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"property":return t.property(e);case"statusCode":return t.statusCode();default:return t._other(e)}}};var Nec={};Po(Nec,{V2AuthValues:()=>VNe,V2EndpointLocationHttpMethod:()=>Nrr,V2HttpEndpointResponseBody:()=>m4});var m4={error:e=>({value:e,type:"error",_visit:function(t){return m4._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return m4._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return m4._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"error":return t.error(e.value);case"json":return t.json(e.value);case"stream":return t.stream(e.value);default:return t._other(e)}}};var Nrr={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",_visit:(e,t)=>{switch(e){case Nrr.Get:return t.get();case Nrr.Post:return t.post();case Nrr.Put:return t.put();case Nrr.Patch:return t.patch();case Nrr.Delete:return t.delete();case Nrr.Head:return t.head();default:return t._other()}}};var VNe={basic:e=>({...e,type:"basic",_visit:function(t){return VNe._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return VNe._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return VNe._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return VNe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"header":return t.header(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var U0={};Po(U0,{GeneratorEnvironment:()=>nEp,GeneratorPublishTarget:()=>iEp,GithubPublishInfo:()=>rEp,LicenseConfig:()=>eEp,LicenseId:()=>t7o,OutputMode:()=>tEp,config:()=>Fec});var Fec={};Po(Fec,{GeneratorEnvironment:()=>nEp,GeneratorPublishTarget:()=>iEp,GithubPublishInfo:()=>rEp,LicenseConfig:()=>eEp,LicenseId:()=>t7o,OutputMode:()=>tEp});var eEp={basic:e=>({...e,type:"basic",_visit:function(t){return U0.LicenseConfig._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return U0.LicenseConfig._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"custom":return t.custom(e);default:return t._other(e)}}};var t7o={Mit:"MIT",Apache2:"Apache-2.0",_visit:(e,t)=>{switch(e){case t7o.Mit:return t.mit();case t7o.Apache2:return t.apache2();default:return t._other()}}};var tEp={publish:e=>({...e,type:"publish",_visit:function(t){return U0.OutputMode._visit(this,t)}}),downloadFiles:()=>({type:"downloadFiles",_visit:function(e){return U0.OutputMode._visit(this,e)}}),github:e=>({...e,type:"github",_visit:function(t){return U0.OutputMode._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"publish":return t.publish(e);case"downloadFiles":return t.downloadFiles();case"github":return t.github(e);default:return t._other(e)}}};var rEp={npm:e=>({...e,type:"npm",_visit:function(t){return U0.GithubPublishInfo._visit(this,t)}}),maven:e=>({...e,type:"maven",_visit:function(t){return U0.GithubPublishInfo._visit(this,t)}}),postman:e=>({...e,type:"postman",_visit:function(t){return U0.GithubPublishInfo._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return U0.GithubPublishInfo._visit(this,t)}}),rubygems:e=>({...e,type:"rubygems",_visit:function(t){return U0.GithubPublishInfo._visit(this,t)}}),nuget:e=>({...e,type:"nuget",_visit:function(t){return U0.GithubPublishInfo._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"npm":return t.npm(e);case"maven":return t.maven(e);case"postman":return t.postman(e);case"pypi":return t.pypi(e);case"rubygems":return t.rubygems(e);case"nuget":return t.nuget(e);default:return t._other(e)}}};var iEp={maven:e=>({...e,type:"maven",_visit:function(t){return U0.GeneratorPublishTarget._visit(this,t)}}),npm:e=>({...e,type:"npm",_visit:function(t){return U0.GeneratorPublishTarget._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return U0.GeneratorPublishTarget._visit(this,t)}}),postman:e=>({...e,type:"postman",_visit:function(t){return U0.GeneratorPublishTarget._visit(this,t)}}),rubygems:e=>({...e,type:"rubygems",_visit:function(t){return U0.GeneratorPublishTarget._visit(this,t)}}),nuget:e=>({...e,type:"nuget",_visit:function(t){return U0.GeneratorPublishTarget._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"maven":return t.maven(e);case"npm":return t.npm(e);case"pypi":return t.pypi(e);case"postman":return t.postman(e);case"rubygems":return t.rubygems(e);case"nuget":return t.nuget(e);default:return t._other(e)}}};var nEp={local:()=>({type:"local",_visit:function(e){return U0.GeneratorEnvironment._visit(this,e)}}),remote:e=>({...e,type:"remote",_visit:function(t){return U0.GeneratorEnvironment._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"local":return t.local();case"remote":return t.remote(e);default:return t._other(e)}}};var Lec={};Po(Lec,{ExampleCodeSample:()=>pAe,ExampleEndpointSuccessResponse:()=>NB,ExampleQueryParameterShape:()=>q8,ExampleRequestBody:()=>MJ,ExampleResponse:()=>gC,FileProperty:()=>roe,FileUploadBodyPropertyEncoding:()=>lNa,FileUploadRequestProperty:()=>P4,HttpEndpointSource:()=>DJ,HttpMethod:()=>xB,HttpRequestBody:()=>IA,HttpResponseBody:()=>c1,JsonResponse:()=>OL,NonStreamHttpResponseBody:()=>_H,Pagination:()=>EJ,PathParameterLocation:()=>HNe,RequestPropertyValue:()=>ioe,SdkRequestBodyType:()=>H$t,SdkRequestShape:()=>$Ne,StreamingResponse:()=>mL,SupportedSdkLanguage:()=>Frr,Transport:()=>WNe});var WNe={http:()=>({type:"http",_visit:function(e){return WNe._visit(this,e)}}),grpc:e=>({...e,type:"grpc",_visit:function(t){return WNe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"http":return t.http();case"grpc":return t.grpc(e);default:return t._other(e)}}};var DJ={proto:e=>({...e,type:"proto",_visit:function(t){return DJ._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return DJ._visit(this,e)}}),openrpc:()=>({type:"openrpc",_visit:function(e){return DJ._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"proto":return t.proto(e);case"openapi":return t.openapi();case"openrpc":return t.openrpc();default:return t._other(e)}}};var xB={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",_visit:(e,t)=>{switch(e){case xB.Get:return t.get();case xB.Post:return t.post();case xB.Put:return t.put();case xB.Patch:return t.patch();case xB.Delete:return t.delete();case xB.Head:return t.head();default:return t._other()}}};var HNe={Root:"ROOT",Service:"SERVICE",Endpoint:"ENDPOINT",_visit:(e,t)=>{switch(e){case HNe.Root:return t.root();case HNe.Service:return t.service();case HNe.Endpoint:return t.endpoint();default:return t._other()}}};var IA={inlinedRequestBody:e=>({...e,type:"inlinedRequestBody",_visit:function(t){return IA._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return IA._visit(this,t)}}),fileUpload:e=>({...e,type:"fileUpload",_visit:function(t){return IA._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return IA._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedRequestBody":return t.inlinedRequestBody(e);case"reference":return t.reference(e);case"fileUpload":return t.fileUpload(e);case"bytes":return t.bytes(e);default:return t._other(e)}}};var P4={file:e=>({value:e,type:"file",_visit:function(t){return P4._visit(this,t)}}),bodyProperty:e=>({...e,type:"bodyProperty",_visit:function(t){return P4._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e.value);case"bodyProperty":return t.bodyProperty(e);default:return t._other(e)}}};var lNa={Exploded:"exploded",Json:"json",Form:"form",_visit:(e,t)=>{switch(e){case lNa.Exploded:return t.exploded();case lNa.Json:return t.json();case lNa.Form:return t.form();default:return t._other()}}};var roe={file:e=>({...e,type:"file",_visit:function(t){return roe._visit(this,t)}}),fileArray:e=>({...e,type:"fileArray",_visit:function(t){return roe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"fileArray":return t.fileArray(e);default:return t._other(e)}}};var H$t={typeReference:e=>({...e,type:"typeReference",_visit:function(t){return H$t._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return H$t._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"typeReference":return t.typeReference(e);case"bytes":return t.bytes(e);default:return t._other(e)}}};var $Ne={justRequestBody:e=>({value:e,type:"justRequestBody",_visit:function(t){return $Ne._visit(this,t)}}),wrapper:e=>({...e,type:"wrapper",_visit:function(t){return $Ne._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"justRequestBody":return t.justRequestBody(e.value);case"wrapper":return t.wrapper(e);default:return t._other(e)}}};var _H={json:e=>({value:e,type:"json",_visit:function(t){return _H._visit(this,t)}}),fileDownload:e=>({...e,type:"fileDownload",_visit:function(t){return _H._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return _H._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return _H._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e.value);case"fileDownload":return t.fileDownload(e);case"text":return t.text(e);case"bytes":return t.bytes(e);default:return t._other(e)}}};var c1={json:e=>({value:e,type:"json",_visit:function(t){return c1._visit(this,t)}}),fileDownload:e=>({...e,type:"fileDownload",_visit:function(t){return c1._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return c1._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return c1._visit(this,t)}}),streaming:e=>({value:e,type:"streaming",_visit:function(t){return c1._visit(this,t)}}),streamParameter:e=>({...e,type:"streamParameter",_visit:function(t){return c1._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e.value);case"fileDownload":return t.fileDownload(e);case"text":return t.text(e);case"bytes":return t.bytes(e);case"streaming":return t.streaming(e.value);case"streamParameter":return t.streamParameter(e);default:return t._other(e)}}};var OL={response:e=>({...e,type:"response",_visit:function(t){return OL._visit(this,t)}}),nestedPropertyAsResponse:e=>({...e,type:"nestedPropertyAsResponse",_visit:function(t){return OL._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"response":return t.response(e);case"nestedPropertyAsResponse":return t.nestedPropertyAsResponse(e);default:return t._other(e)}}};var mL={json:e=>({...e,type:"json",_visit:function(t){return mL._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return mL._visit(this,t)}}),sse:e=>({...e,type:"sse",_visit:function(t){return mL._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"json":return t.json(e);case"text":return t.text(e);case"sse":return t.sse(e);default:return t._other(e)}}};var EJ={cursor:e=>({...e,type:"cursor",_visit:function(t){return EJ._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return EJ._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return EJ._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);case"custom":return t.custom(e);default:return t._other(e)}}};var ioe={query:e=>({...e,type:"query",_visit:function(t){return ioe._visit(this,t)}}),body:e=>({...e,type:"body",_visit:function(t){return ioe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"query":return t.query(e);case"body":return t.body(e);default:return t._other(e)}}};var pAe={language:e=>({...e,type:"language",_visit:function(t){return pAe._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return pAe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"language":return t.language(e);case"sdk":return t.sdk(e);default:return t._other(e)}}};var Frr={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java",_visit:(e,t)=>{switch(e){case Frr.Curl:return t.curl();case Frr.Python:return t.python();case Frr.Javascript:return t.javascript();case Frr.Typescript:return t.typescript();case Frr.Go:return t.go();case Frr.Ruby:return t.ruby();case Frr.Csharp:return t.csharp();case Frr.Java:return t.java();default:return t._other()}}};var q8={single:()=>({type:"single",_visit:function(e){return q8._visit(this,e)}}),exploded:()=>({type:"exploded",_visit:function(e){return q8._visit(this,e)}}),commaSeparated:()=>({type:"commaSeparated",_visit:function(e){return q8._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"single":return t.single();case"exploded":return t.exploded();case"commaSeparated":return t.commaSeparated();default:return t._other(e)}}};var MJ={inlinedRequestBody:e=>({...e,type:"inlinedRequestBody",_visit:function(t){return MJ._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return MJ._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedRequestBody":return t.inlinedRequestBody(e);case"reference":return t.reference(e);default:return t._other(e)}}};var gC={ok:e=>({value:e,type:"ok",_visit:function(t){return gC._visit(this,t)}}),error:e=>({...e,type:"error",_visit:function(t){return gC._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"ok":return t.ok(e.value);case"error":return t.error(e);default:return t._other(e)}}};var NB={body:e=>({value:e,type:"body",_visit:function(t){return NB._visit(this,t)}}),stream:e=>({value:e,type:"stream",_visit:function(t){return NB._visit(this,t)}}),sse:e=>({value:e,type:"sse",_visit:function(t){return NB._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"body":return t.body(e.value);case"stream":return t.stream(e.value);case"sse":return t.sse(e.value);default:return t._other(e)}}};var Uec={};Po(Uec,{ApiDefinitionSource:()=>noe,ApiVersionScheme:()=>azi,ErrorDiscriminationStrategy:()=>_Ae});var noe={proto:e=>({...e,type:"proto",_visit:function(t){return noe._visit(this,t)}}),openapi:()=>({type:"openapi",_visit:function(e){return noe._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"proto":return t.proto(e);case"openapi":return t.openapi();default:return t._other(e)}}};var azi={header:e=>({...e,type:"header",_visit:function(t){return azi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"header":return t.header(e);default:return t._other(e)}}};var _Ae={statusCode:()=>({type:"statusCode",_visit:function(e){return _Ae._visit(this,e)}}),property:e=>({...e,type:"property",_visit:function(t){return _Ae._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"statusCode":return t.statusCode();case"property":return t.property(e);default:return t._other(e)}}};var Vec={};Po(Vec,{ProtobufMethodType:()=>$$t,ProtobufType:()=>mw,WellKnownProtobufType:()=>od});var mw={wellKnown:e=>({value:e,type:"wellKnown",_visit:function(t){return mw._visit(this,t)}}),userDefined:e=>({...e,type:"userDefined",_visit:function(t){return mw._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"wellKnown":return t.wellKnown(e.value);case"userDefined":return t.userDefined(e);default:return t._other(e)}}};var od={any:()=>({type:"any",_visit:function(e){return od._visit(this,e)}}),api:()=>({type:"api",_visit:function(e){return od._visit(this,e)}}),boolValue:()=>({type:"boolValue",_visit:function(e){return od._visit(this,e)}}),bytesValue:()=>({type:"bytesValue",_visit:function(e){return od._visit(this,e)}}),doubleValue:()=>({type:"doubleValue",_visit:function(e){return od._visit(this,e)}}),duration:()=>({type:"duration",_visit:function(e){return od._visit(this,e)}}),empty:()=>({type:"empty",_visit:function(e){return od._visit(this,e)}}),enum:()=>({type:"enum",_visit:function(e){return od._visit(this,e)}}),enumValue:()=>({type:"enumValue",_visit:function(e){return od._visit(this,e)}}),field:()=>({type:"field",_visit:function(e){return od._visit(this,e)}}),fieldCardinality:()=>({type:"fieldCardinality",_visit:function(e){return od._visit(this,e)}}),fieldKind:()=>({type:"fieldKind",_visit:function(e){return od._visit(this,e)}}),fieldMask:()=>({type:"fieldMask",_visit:function(e){return od._visit(this,e)}}),floatValue:()=>({type:"floatValue",_visit:function(e){return od._visit(this,e)}}),int32Value:()=>({type:"int32Value",_visit:function(e){return od._visit(this,e)}}),int64Value:()=>({type:"int64Value",_visit:function(e){return od._visit(this,e)}}),listValue:()=>({type:"listValue",_visit:function(e){return od._visit(this,e)}}),method:()=>({type:"method",_visit:function(e){return od._visit(this,e)}}),mixin:()=>({type:"mixin",_visit:function(e){return od._visit(this,e)}}),nullValue:()=>({type:"nullValue",_visit:function(e){return od._visit(this,e)}}),option:()=>({type:"option",_visit:function(e){return od._visit(this,e)}}),sourceContext:()=>({type:"sourceContext",_visit:function(e){return od._visit(this,e)}}),stringValue:()=>({type:"stringValue",_visit:function(e){return od._visit(this,e)}}),struct:()=>({type:"struct",_visit:function(e){return od._visit(this,e)}}),syntax:()=>({type:"syntax",_visit:function(e){return od._visit(this,e)}}),timestamp:()=>({type:"timestamp",_visit:function(e){return od._visit(this,e)}}),type:()=>({type:"type",_visit:function(e){return od._visit(this,e)}}),uint32Value:()=>({type:"uint32Value",_visit:function(e){return od._visit(this,e)}}),uint64Value:()=>({type:"uint64Value",_visit:function(e){return od._visit(this,e)}}),value:()=>({type:"value",_visit:function(e){return od._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"any":return t.any();case"api":return t.api();case"boolValue":return t.boolValue();case"bytesValue":return t.bytesValue();case"doubleValue":return t.doubleValue();case"duration":return t.duration();case"empty":return t.empty();case"enum":return t.enum();case"enumValue":return t.enumValue();case"field":return t.field();case"fieldCardinality":return t.fieldCardinality();case"fieldKind":return t.fieldKind();case"fieldMask":return t.fieldMask();case"floatValue":return t.floatValue();case"int32Value":return t.int32Value();case"int64Value":return t.int64Value();case"listValue":return t.listValue();case"method":return t.method();case"mixin":return t.mixin();case"nullValue":return t.nullValue();case"option":return t.option();case"sourceContext":return t.sourceContext();case"stringValue":return t.stringValue();case"struct":return t.struct();case"syntax":return t.syntax();case"timestamp":return t.timestamp();case"type":return t.type();case"uint32Value":return t.uint32Value();case"uint64Value":return t.uint64Value();case"value":return t.value();default:return t._other(e)}}};var $$t={Unary:"UNARY",ClientStream:"CLIENT_STREAM",ServerStream:"SERVER_STREAM",BidirectionalStream:"BIDIRECTIONAL_STREAM",_visit:(e,t)=>{switch(e){case $$t.Unary:return t.unary();case $$t.ClientStream:return t.clientStream();case $$t.ServerStream:return t.serverStream();case $$t.BidirectionalStream:return t.bidirectionalStream();default:return t._other()}}};var Wec={};Po(Wec,{PublishTarget:()=>aoe,PublishingConfig:()=>Lrr});var Lrr={github:e=>({...e,type:"github",_visit:function(t){return Lrr._visit(this,t)}}),direct:e=>({...e,type:"direct",_visit:function(t){return Lrr._visit(this,t)}}),filesystem:e=>({...e,type:"filesystem",_visit:function(t){return Lrr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"github":return t.github(e);case"direct":return t.direct(e);case"filesystem":return t.filesystem(e);default:return t._other(e)}}};var aoe={postman:e=>({...e,type:"postman",_visit:function(t){return aoe._visit(this,t)}}),npm:e=>({...e,type:"npm",_visit:function(t){return aoe._visit(this,t)}}),maven:e=>({...e,type:"maven",_visit:function(t){return aoe._visit(this,t)}}),pypi:e=>({...e,type:"pypi",_visit:function(t){return aoe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"postman":return t.postman(e);case"npm":return t.npm(e);case"maven":return t.maven(e);case"pypi":return t.pypi(e);default:return t._other(e)}}};var Hec={};Po(Hec,{ContainerType:()=>Ry,ExampleContainer:()=>Wm,ExamplePrimitive:()=>Vd,ExampleSingleUnionTypeProperties:()=>K3,ExampleTypeReferenceShape:()=>ay,ExampleTypeShape:()=>l1,Literal:()=>jL,NamedTypeDefault:()=>gLn,ObjectPropertyAccess:()=>Urr,PrimitiveTypeV1:()=>ny,PrimitiveTypeV2:()=>Td,ResolvedTypeReference:()=>hH,ShapeType:()=>G$t,SingleUnionTypeProperties:()=>PL,Source:()=>aOi,Type:()=>Vb,TypeReference:()=>Xc});var aOi={proto:e=>({value:e,type:"proto",_visit:function(t){return aOi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"proto":return t.proto(e.value);default:return t._other(e)}}};var Vb={alias:e=>({...e,type:"alias",_visit:function(t){return Vb._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return Vb._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Vb._visit(this,t)}}),union:e=>({...e,type:"union",_visit:function(t){return Vb._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return Vb._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"alias":return t.alias(e);case"enum":return t.enum(e);case"object":return t.object(e);case"union":return t.union(e);case"undiscriminatedUnion":return t.undiscriminatedUnion(e);default:return t._other(e)}}};var hH={container:e=>({container:e,type:"container",_visit:function(t){return hH._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return hH._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return hH._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return hH._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"container":return t.container(e.container);case"named":return t.named(e);case"primitive":return t.primitive(e.primitive);case"unknown":return t.unknown();default:return t._other(e)}}};var G$t={Enum:"ENUM",Object:"OBJECT",Union:"UNION",UndiscriminatedUnion:"UNDISCRIMINATED_UNION",_visit:(e,t)=>{switch(e){case G$t.Enum:return t.enum();case G$t.Object:return t.object();case G$t.Union:return t.union();case G$t.UndiscriminatedUnion:return t.undiscriminatedUnion();default:return t._other()}}};var Urr={ReadOnly:"READ_ONLY",WriteOnly:"WRITE_ONLY",_visit:(e,t)=>{switch(e){case Urr.ReadOnly:return t.readOnly();case Urr.WriteOnly:return t.writeOnly();default:return t._other()}}};var PL={samePropertiesAsObject:e=>({...e,propertiesType:"samePropertiesAsObject",_visit:function(t){return PL._visit(this,t)}}),singleProperty:e=>({...e,propertiesType:"singleProperty",_visit:function(t){return PL._visit(this,t)}}),noProperties:()=>({propertiesType:"noProperties",_visit:function(e){return PL._visit(this,e)}}),_visit:(e,t)=>{switch(e.propertiesType){case"samePropertiesAsObject":return t.samePropertiesAsObject(e);case"singleProperty":return t.singleProperty(e);case"noProperties":return t.noProperties();default:return t._other(e)}}};var Xc={container:e=>({container:e,type:"container",_visit:function(t){return Xc._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return Xc._visit(this,t)}}),primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return Xc._visit(this,t)}}),unknown:()=>({type:"unknown",_visit:function(e){return Xc._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"container":return t.container(e.container);case"named":return t.named(e);case"primitive":return t.primitive(e.primitive);case"unknown":return t.unknown();default:return t._other(e)}}};var gLn={enum:e=>({...e,type:"enum",_visit:function(t){return gLn._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"enum":return t.enum(e);default:return t._other(e)}}};var Ry={list:e=>({list:e,type:"list",_visit:function(t){return Ry._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Ry._visit(this,t)}}),nullable:e=>({nullable:e,type:"nullable",_visit:function(t){return Ry._visit(this,t)}}),optional:e=>({optional:e,type:"optional",_visit:function(t){return Ry._visit(this,t)}}),set:e=>({set:e,type:"set",_visit:function(t){return Ry._visit(this,t)}}),literal:e=>({literal:e,type:"literal",_visit:function(t){return Ry._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e.list);case"map":return t.map(e);case"nullable":return t.nullable(e.nullable);case"optional":return t.optional(e.optional);case"set":return t.set(e.set);case"literal":return t.literal(e.literal);default:return t._other(e)}}};var ny={Integer:"INTEGER",Long:"LONG",Uint:"UINT",Uint64:"UINT_64",Float:"FLOAT",Double:"DOUBLE",Boolean:"BOOLEAN",String:"STRING",Date:"DATE",DateTime:"DATE_TIME",Uuid:"UUID",Base64:"BASE_64",BigInteger:"BIG_INTEGER",_visit:(e,t)=>{switch(e){case ny.Integer:return t.integer();case ny.Long:return t.long();case ny.Uint:return t.uint();case ny.Uint64:return t.uint64();case ny.Float:return t.float();case ny.Double:return t.double();case ny.Boolean:return t.boolean();case ny.String:return t.string();case ny.Date:return t.date();case ny.DateTime:return t.dateTime();case ny.Uuid:return t.uuid();case ny.Base64:return t.base64();case ny.BigInteger:return t.bigInteger();default:return t._other()}}};var Td={integer:e=>({...e,type:"integer",_visit:function(t){return Td._visit(this,t)}}),long:e=>({...e,type:"long",_visit:function(t){return Td._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return Td._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return Td._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return Td._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return Td._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return Td._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return Td._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return Td._visit(this,t)}}),dateTime:e=>({...e,type:"dateTime",_visit:function(t){return Td._visit(this,t)}}),uuid:e=>({...e,type:"uuid",_visit:function(t){return Td._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return Td._visit(this,t)}}),bigInteger:e=>({...e,type:"bigInteger",_visit:function(t){return Td._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e);case"long":return t.long(e);case"uint":return t.uint(e);case"uint64":return t.uint64(e);case"float":return t.float(e);case"double":return t.double(e);case"boolean":return t.boolean(e);case"string":return t.string(e);case"date":return t.date(e);case"dateTime":return t.dateTime(e);case"uuid":return t.uuid(e);case"base64":return t.base64(e);case"bigInteger":return t.bigInteger(e);default:return t._other(e)}}};var jL={string:e=>({string:e,type:"string",_visit:function(t){return jL._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return jL._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"string":return t.string(e.string);case"boolean":return t.boolean(e.boolean);default:return t._other(e)}}};var l1={alias:e=>({...e,type:"alias",_visit:function(t){return l1._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return l1._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return l1._visit(this,t)}}),union:e=>({...e,type:"union",_visit:function(t){return l1._visit(this,t)}}),undiscriminatedUnion:e=>({...e,type:"undiscriminatedUnion",_visit:function(t){return l1._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"alias":return t.alias(e);case"enum":return t.enum(e);case"object":return t.object(e);case"union":return t.union(e);case"undiscriminatedUnion":return t.undiscriminatedUnion(e);default:return t._other(e)}}};var K3={samePropertiesAsObject:e=>({...e,type:"samePropertiesAsObject",_visit:function(t){return K3._visit(this,t)}}),singleProperty:e=>({...e,type:"singleProperty",_visit:function(t){return K3._visit(this,t)}}),noProperties:()=>({type:"noProperties",_visit:function(e){return K3._visit(this,e)}}),_visit:(e,t)=>{switch(e.type){case"samePropertiesAsObject":return t.samePropertiesAsObject(e);case"singleProperty":return t.singleProperty(e);case"noProperties":return t.noProperties();default:return t._other(e)}}};var ay={primitive:e=>({primitive:e,type:"primitive",_visit:function(t){return ay._visit(this,t)}}),container:e=>({container:e,type:"container",_visit:function(t){return ay._visit(this,t)}}),unknown:e=>({unknown:e,type:"unknown",_visit:function(t){return ay._visit(this,t)}}),named:e=>({...e,type:"named",_visit:function(t){return ay._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e.primitive);case"container":return t.container(e.container);case"unknown":return t.unknown(e.unknown);case"named":return t.named(e);default:return t._other(e)}}};var Wm={list:e=>({...e,type:"list",_visit:function(t){return Wm._visit(this,t)}}),set:e=>({...e,type:"set",_visit:function(t){return Wm._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return Wm._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return Wm._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Wm._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return Wm._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"list":return t.list(e);case"set":return t.set(e);case"optional":return t.optional(e);case"nullable":return t.nullable(e);case"map":return t.map(e);case"literal":return t.literal(e);default:return t._other(e)}}};var Vd={integer:e=>({integer:e,type:"integer",_visit:function(t){return Vd._visit(this,t)}}),long:e=>({long:e,type:"long",_visit:function(t){return Vd._visit(this,t)}}),uint:e=>({uint:e,type:"uint",_visit:function(t){return Vd._visit(this,t)}}),uint64:e=>({uint64:e,type:"uint64",_visit:function(t){return Vd._visit(this,t)}}),float:e=>({float:e,type:"float",_visit:function(t){return Vd._visit(this,t)}}),double:e=>({double:e,type:"double",_visit:function(t){return Vd._visit(this,t)}}),boolean:e=>({boolean:e,type:"boolean",_visit:function(t){return Vd._visit(this,t)}}),string:e=>({string:e,type:"string",_visit:function(t){return Vd._visit(this,t)}}),date:e=>({date:e,type:"date",_visit:function(t){return Vd._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return Vd._visit(this,t)}}),uuid:e=>({uuid:e,type:"uuid",_visit:function(t){return Vd._visit(this,t)}}),base64:e=>({base64:e,type:"base64",_visit:function(t){return Vd._visit(this,t)}}),bigInteger:e=>({bigInteger:e,type:"bigInteger",_visit:function(t){return Vd._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"integer":return t.integer(e.integer);case"long":return t.long(e.long);case"uint":return t.uint(e.uint);case"uint64":return t.uint64(e.uint64);case"float":return t.float(e.float);case"double":return t.double(e.double);case"boolean":return t.boolean(e.boolean);case"string":return t.string(e.string);case"date":return t.date(e.date);case"datetime":return t.datetime(e);case"uuid":return t.uuid(e.uuid);case"base64":return t.base64(e.base64);case"bigInteger":return t.bigInteger(e.bigInteger);default:return t._other(e)}}};var aEp={};var $ec={};Po($ec,{WebhookHttpMethod:()=>r7o,WebhookPayload:()=>yH});var yH={inlinedPayload:e=>({...e,type:"inlinedPayload",_visit:function(t){return yH._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return yH._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedPayload":return t.inlinedPayload(e);case"reference":return t.reference(e);default:return t._other(e)}}};var r7o={Get:"GET",Post:"POST",_visit:(e,t)=>{switch(e){case r7o.Get:return t.get();case r7o.Post:return t.post();default:return t._other()}}};var Gec={};Po(Gec,{ExampleWebSocketMessageBody:()=>hAe,WebSocketMessageBody:()=>wL,WebSocketMessageOrigin:()=>i7o});var i7o={Client:"client",Server:"server",_visit:(e,t)=>{switch(e){case i7o.Client:return t.client();case i7o.Server:return t.server();default:return t._other()}}};var wL={inlinedBody:e=>({...e,type:"inlinedBody",_visit:function(t){return wL._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return wL._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedBody":return t.inlinedBody(e);case"reference":return t.reference(e);default:return t._other(e)}}};var hAe={inlinedBody:e=>({...e,type:"inlinedBody",_visit:function(t){return hAe._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return hAe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"inlinedBody":return t.inlinedBody(e);case"reference":return t.reference(e);default:return t._other(e)}}};var Ap={};Po(Ap,{AliasTypeDeclaration:()=>$2o,ApiAuth:()=>D7o,ApiDefinitionSource:()=>x8o,ApiDefinitionSourceId:()=>z8o,ApiVersionScheme:()=>w2o,AudienceDefinition:()=>s7o,AudienceReference:()=>jLn,AuthScheme:()=>S7o,AuthSchemesRequirement:()=>c7o,AutogeneratedEndpointExample:()=>f2o,Availability:()=>Hrr,AvailabilityStatus:()=>p7o,Base64Type:()=>U2o,BasicAuthScheme:()=>f7o,BasicAuthValues:()=>R6o,BearerAuthScheme:()=>l7o,BearerAuthValues:()=>x6o,BigIntegerType:()=>V2o,BooleanType:()=>z2o,BytesRequest:()=>QLn,BytesResponse:()=>ZLn,Constants:()=>A7o,ContainerType:()=>cUn,CsharpProtobufFileOptions:()=>d2o,CursorPagination:()=>K4o,CustomPagination:()=>X4o,DateTimeType:()=>F2o,DateType:()=>N2o,Declaration:()=>j4,DeclaredErrorName:()=>pzi,DeclaredServiceName:()=>m4o,DeclaredTypeName:()=>OI,DirectPublish:()=>H8o,DisplayName:()=>fzi,DoubleType:()=>I2o,DoubleValidationRules:()=>B2o,Encoding:()=>oUn,EndpointId:()=>J$t,EndpointName:()=>j4o,EndpointReference:()=>szi,EnumTypeDeclaration:()=>uUn,EnumTypeReference:()=>FEp,EnumValue:()=>oOi,EnvironmentBaseUrlId:()=>qk,EnvironmentBaseUrlWithId:()=>_6o,EnvironmentId:()=>JNe,EnvironmentUrl:()=>Grr,EnvironmentVariable:()=>GNe,Environments:()=>v6o,EnvironmentsConfig:()=>CLn,ErrorDeclaration:()=>C6o,ErrorDeclarationDiscriminantValue:()=>REp,ErrorDiscriminationByPropertyStrategy:()=>E8o,ErrorDiscriminationStrategy:()=>M8o,ErrorId:()=>dzi,EscapedString:()=>E7o,ExampleAliasType:()=>Z8o,ExampleCodeSample:()=>r2o,ExampleCodeSampleLanguage:()=>k4o,ExampleCodeSampleSdk:()=>t2o,ExampleContainer:()=>u5o,ExampleDatetime:()=>o5o,ExampleEndpointCall:()=>iUn,ExampleEndpointErrorResponse:()=>s2o,ExampleEndpointSuccessResponse:()=>u2o,ExampleEnumType:()=>X8o,ExampleError:()=>T6o,ExampleHeader:()=>Cen,ExampleInlinedRequestBody:()=>rUn,ExampleInlinedRequestBodyProperty:()=>n2o,ExampleKeyValuePair:()=>h5o,ExampleListContainer:()=>l5o,ExampleLiteralContainer:()=>c5o,ExampleMapContainer:()=>_5o,ExampleNamedType:()=>s5o,ExampleNullableContainer:()=>p5o,ExampleObjectProperty:()=>t5o,ExampleObjectType:()=>pUn,ExampleObjectTypeWithTypeId:()=>n5o,ExampleOptionalContainer:()=>d5o,ExamplePathParameter:()=>_zi,ExamplePrimitive:()=>_Un,ExampleQueryParameter:()=>tUn,ExampleQueryParameterShape:()=>i2o,ExampleRequestBody:()=>a2o,ExampleResponse:()=>c2o,ExampleServerSideEvent:()=>o2o,ExampleSetContainer:()=>f5o,ExampleSingleUnionType:()=>r5o,ExampleSingleUnionTypeProperties:()=>i5o,ExampleType:()=>gNa,ExampleTypeReference:()=>Sm,ExampleTypeReferenceShape:()=>a5o,ExampleTypeShape:()=>lUn,ExampleUndiscriminatedUnionType:()=>e5o,ExampleUnionType:()=>k8o,ExampleWebSocketMessage:()=>P8o,ExampleWebSocketMessageBody:()=>m8o,ExampleWebSocketSession:()=>j8o,ExampleWebhookCall:()=>f8o,FeatureId:()=>hNa,FernFilepath:()=>ooe,FileDownloadResponse:()=>YLn,FileProperty:()=>M4o,FilePropertyArray:()=>E4o,FilePropertySingle:()=>D4o,FileUploadBodyProperty:()=>q4o,FileUploadBodyPropertyEncoding:()=>A4o,FileUploadRequest:()=>C4o,FileUploadRequestProperty:()=>T4o,Filesystem:()=>$8o,FloatType:()=>C2o,GithubPublish:()=>W8o,GrpcTransport:()=>h2o,HeaderApiVersionScheme:()=>j2o,HeaderAuthScheme:()=>d7o,HeaderAuthValues:()=>N6o,HttpEndpoint:()=>g2o,HttpEndpointSource:()=>b2o,HttpHeader:()=>Tk,HttpMethod:()=>MLn,HttpPath:()=>KNe,HttpPathPart:()=>P4o,HttpRequestBody:()=>JLn,HttpRequestBodyReference:()=>GLn,HttpResponse:()=>eUn,HttpResponseBody:()=>$4o,HttpService:()=>P2o,InferredAuthScheme:()=>w7o,InferredAuthSchemeTokenEndpoint:()=>j7o,InferredAuthenticatedRequestHeader:()=>P7o,InlinedRequestBody:()=>S4o,InlinedRequestBodyProperty:()=>$Ln,InlinedWebSocketMessageBody:()=>v8o,InlinedWebSocketMessageBodyProperty:()=>y8o,InlinedWebhookPayload:()=>s8o,InlinedWebhookPayloadProperty:()=>u8o,IntegerType:()=>M2o,IntegerValidationRules:()=>E2o,IntermediateRepresentation:()=>NEp,JsonEncoding:()=>O2o,JsonResponse:()=>KLn,JsonResponseBody:()=>N4o,JsonResponseBodyWithProperty:()=>F4o,JsonStreamChunk:()=>L4o,Literal:()=>K8o,LongType:()=>A2o,MapType:()=>Y8o,MavenPublishTarget:()=>U8o,MultipleBaseUrlsEnvironment:()=>h6o,MultipleBaseUrlsEnvironments:()=>y6o,MultipleEnvironmentUrlValues:()=>z6o,Name:()=>Sd,NameAndWireValue:()=>Gh,NamedType:()=>J8o,NamedTypeDefault:()=>Q8o,NonStreamHttpResponseBody:()=>W4o,NpmPublishTarget:()=>L8o,OAuthAccessTokenRequestProperties:()=>h7o,OAuthAccessTokenResponseProperties:()=>SLn,OAuthClientCredentials:()=>g7o,OAuthConfiguration:()=>O7o,OAuthRefreshEndpoint:()=>b7o,OAuthRefreshTokenRequestProperties:()=>v7o,OAuthScheme:()=>m7o,OAuthTokenEndpoint:()=>y7o,OAuthValues:()=>F6o,ObjectProperty:()=>Ak,ObjectPropertyAccess:()=>wLn,ObjectTypeDeclaration:()=>G2o,OffsetPagination:()=>Y4o,Package:()=>dUn,PackageNavigationConfig:()=>S8o,Pagination:()=>Z4o,PathParameter:()=>K$t,PathParameterLocation:()=>w4o,PlatformHeaders:()=>q8o,PostmanPublishTarget:()=>F8o,PrimitiveType:()=>sUn,PrimitiveTypeV1:()=>BLn,PrimitiveTypeV2:()=>W2o,ProtoEncoding:()=>m2o,ProtoSource:()=>R8o,ProtoSourceInfo:()=>v2o,ProtobufFile:()=>nUn,ProtobufFileOptions:()=>p2o,ProtobufMethodType:()=>y2o,ProtobufService:()=>_2o,ProtobufType:()=>r8o,PublishTarget:()=>hzi,PublishingConfig:()=>G8o,PypiPublishTarget:()=>V8o,QueryParameter:()=>czi,ReadmeConfig:()=>I8o,RequestProperty:()=>qJ,RequestPropertyValue:()=>_7o,ResolvedNamedType:()=>D2o,ResolvedTypeReference:()=>H2o,ResponseError:()=>Q4o,ResponseErrors:()=>J4o,ResponseProperty:()=>EL,SafeAndUnsafeString:()=>Ten,SdkConfig:()=>T8o,SdkRequest:()=>x4o,SdkRequestBodyType:()=>I4o,SdkRequestShape:()=>R4o,SdkRequestWrapper:()=>z4o,ServiceId:()=>Vrr,ServiceTypeReferenceInfo:()=>B8o,ShapeType:()=>S2o,SingleBaseUrlEnvironment:()=>d6o,SingleBaseUrlEnvironments:()=>p6o,SingleUnionType:()=>K2o,SingleUnionTypeProperties:()=>J2o,SingleUnionTypeProperty:()=>Q2o,Source:()=>i8o,SourceConfig:()=>N8o,SseStreamChunk:()=>V4o,StreamParameterResponse:()=>H4o,StreamingResponse:()=>kLn,StringType:()=>x2o,StringValidationRules:()=>R2o,Subpackage:()=>D8o,SubpackageId:()=>Wrr,SupportedSdkLanguage:()=>e2o,TextResponse:()=>XLn,TextStreamChunk:()=>U4o,Transport:()=>aUn,Type:()=>k2o,TypeDeclaration:()=>n8o,TypeId:()=>Gx,TypeReference:()=>av,Uint64Type:()=>T2o,UintType:()=>q2o,UndiscriminatedUnionMember:()=>X2o,UndiscriminatedUnionTypeDeclaration:()=>Z2o,UnionTypeDeclaration:()=>Y2o,UserAgent:()=>A8o,UserDefinedProtobufType:()=>t8o,UserSpecifiedEndpointExample:()=>l2o,UuidType:()=>L2o,V2AuthValues:()=>zLn,V2EndpointLocation:()=>I6o,V2EndpointLocationHttpMethod:()=>B6o,V2EnvironmentValues:()=>ILn,V2HttpEndpointCodeSample:()=>W6o,V2HttpEndpointExample:()=>yNa,V2HttpEndpointExamples:()=>H6o,V2HttpEndpointRequest:()=>L6o,V2HttpEndpointResponse:()=>V6o,V2HttpEndpointResponseBody:()=>U6o,V2HttpRequestBodies:()=>B4o,V2HttpResponses:()=>G4o,V2SchemaExample:()=>_Na,V2SchemaExamples:()=>DL,V2ValueExamples:()=>Qrr,V2WebSocketEndpointLocation:()=>$6o,V2WebSocketMessageExample:()=>G6o,V2WebSocketSessionExample:()=>vNa,V2WebSocketSessionExamples:()=>Q6o,V2WebhookExample:()=>bNa,V2WebhookExamples:()=>J6o,VariableDeclaration:()=>C8o,VariableId:()=>HLn,WebSocketChannel:()=>w8o,WebSocketChannelId:()=>ELn,WebSocketMessage:()=>O8o,WebSocketMessageBody:()=>g8o,WebSocketMessageBodyReference:()=>b8o,WebSocketMessageId:()=>fUn,WebSocketMessageOrigin:()=>h8o,WebSocketName:()=>_8o,Webhook:()=>d8o,WebhookGroup:()=>p8o,WebhookGroupId:()=>DLn,WebhookHttpMethod:()=>o8o,WebhookId:()=>M7o,WebhookName:()=>a8o,WebhookPayload:()=>l8o,WebhookPayloadReference:()=>c8o,WellKnownProtobufType:()=>e8o,WithContentType:()=>QNe,WithDocs:()=>Dd,WithDocsAndAvailability:()=>lzi,WithJsonExample:()=>$rr,WithV2Examples:()=>gI,audience:()=>Xec,auth:()=>Zec,commons:()=>kec,constants:()=>etc,dynamic:()=>AF,environment:()=>stc,errors:()=>ctc,examples:()=>ltc,generatorExec:()=>dtc,http:()=>ptc,ir:()=>_tc,proto:()=>htc,publish:()=>ytc,types:()=>vtc,variables:()=>btc,webhooks:()=>gtc,websocket:()=>Otc});var Xec={};Po(Xec,{AudienceDefinition:()=>s7o,AudienceReference:()=>jLn});var ie={};Po(ie,{JsonError:()=>OLn,ParseError:()=>mLn,any:()=>OEp,bigint:()=>uEp,boolean:()=>mEp,booleanLiteral:()=>gEp,date:()=>sEp,discriminant:()=>qEp,enum_:()=>a7o,getObjectLikeUtils:()=>Q$t,getObjectUtils:()=>qen,getSchemaUtils:()=>bT,isProperty:()=>uzi,lazy:()=>cEp,lazyObject:()=>yEp,list:()=>u7o,number:()=>PEp,object:()=>o7o,objectWithoutOptionalProperties:()=>hEp,optional:()=>Qec,property:()=>fEp,record:()=>DEp,set:()=>EEp,string:()=>jEp,stringLiteral:()=>bEp,transform:()=>Jec,undiscriminatedUnion:()=>AEp,union:()=>CEp,unknown:()=>wEp,withParsedProperties:()=>Yec});var Kj={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function zA(e,t){return`Expected ${t}. Received ${QaD(e)}.`}function QaD(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function SL(e){return{...e,json:oEp(e.json),parse:oEp(e.parse)}}function oEp(e){return(t,r)=>{let i=e(t,r),{skipValidation:n=!1}=r??{};return!i.ok&&n?(console.warn(["Failed to validate.",...i.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
1675
|
-
`)),{ok:!0,value:t}):i}}function n7o(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var OLn=class e extends Error{errors;constructor(t){super(t.map(n7o).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var mLn=class e extends Error{errors;constructor(t){super(t.map(n7o).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function bT(e){return{optional:()=>Qec(e),transform:t=>Jec(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new mLn(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new OLn(i.errors)}}}function Qec(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>Kj.OPTIONAL};return{...t,...bT(t)}}function Jec(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(i,n)=>{let a=t.untransform(i);return e.json(a,n)},getType:()=>e.getType()};return{...r,...bT(r)}}function uEp(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:zA(t,"string")}]}:{ok:!0,value:BigInt(t)},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t.toString()}:{ok:!1,errors:[{path:r,message:zA(t,"bigint")}]},getType:()=>Kj.BIGINT};return{...SL(e),...bT(e)}}var JaD=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function sEp(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:zA(t,"string")}]}:JaD.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:zA(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:zA(t,"Date object")}]},getType:()=>Kj.DATE};return{...SL(e),...bT(e)}}function AJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...SL(r),...bT(r)}}}function a7o(e){let t=new Set(e);return AJ(Kj.ENUM,(i,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:a=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:a,message:zA(i,"string")}]}:!t.has(i)&&!n?{ok:!1,errors:[{path:a,message:zA(i,"enum")}]}:{ok:!0,value:i})()}function cEp(e){let t=Kec(e);return{...t,...bT(t)}}function Kec(e){return{parse:(t,r)=>PLn(e).parse(t,r),json:(t,r)=>PLn(e).json(t,r),getType:()=>PLn(e).getType()}}function PLn(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function fNa(e){return Object.entries(e)}function dNa(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[n,a])=>(r.has(n)&&(i[n]=a),i),{})}function ozi(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pNa(e){return Object.keys(e)}function lEp(e,t){let r=[],i=[];for(let n of e)t(n)?r.push(n):i.push(n);return[r,i]}function Q$t(e){return{withParsedProperties:t=>Yec(e,t)}}function Yec(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);if(!a.ok)return a;let u=Object.entries(t).reduce((l,[d,s])=>({...l,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(i,n)=>{if(!ozi(i))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:zA(i,"object")}]};let a=new Set(Object.keys(t)),u=dNa(i,Object.keys(i).filter(l=>!a.has(l)));return e.json(u,n)},getType:()=>e.getType()};return{...r,...bT(r),...Q$t(r)}}function fEp(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function uzi(e){return e.isProperty}function o7o(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,i])=>uzi(i)?i.rawKey:r),_getParsedProperties:()=>pNa(e),parse:(r,i)=>{let n={},a=[];for(let[u,l]of fNa(e)){let d=uzi(l)?l.rawKey:u,s=uzi(l)?l.valueSchema:l,o={rawKey:d,parsedKey:u,valueSchema:s};n[d]=o,_Ep(s)&&a.push(d)}return dEp({value:r,requiredKeys:a,getProperty:u=>{let l=n[u];if(l!=null)return{transformedKey:l.parsedKey,transform:d=>l.valueSchema.parse(d,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},json:(r,i)=>{let n=[];for(let[a,u]of fNa(e)){let l=uzi(u)?u.valueSchema:u;_Ep(l)&&n.push(a)}return dEp({value:r,requiredKeys:n,getProperty:a=>{let u=e[a];if(u!=null)return uzi(u)?{transformedKey:u.rawKey,transform:l=>u.valueSchema.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:l=>u.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},getType:()=>Kj.OBJECT};return{...SL(t),...bT(t),...Q$t(t),...qen(t)}}function dEp({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:i="fail",skipValidation:n=!1,breadcrumbsPrefix:a=[]}){if(!ozi(e))return{ok:!1,errors:[{path:a,message:zA(e,"object")}]};let u=new Set(t),l=[],d={};for(let[s,o]of Object.entries(e)){let c=r(s);if(c!=null){u.delete(s);let b=c.transform(o);b.ok?d[c.transformedKey]=b.value:(d[s]=o,l.push(...b.errors))}else switch(i){case"fail":l.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=o;break}}return l.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),l.length===0||n?{ok:!0,value:d}:{ok:!1,errors:l}}function qen(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,n)=>pEp({extensionKeys:t._getRawProperties(),value:i,transformBase:a=>e.parse(a,n),transformExtension:a=>t.parse(a,n)}),json:(i,n)=>pEp({extensionKeys:t._getParsedProperties(),value:i,transformBase:a=>e.json(a,n),transformExtension:a=>t.json(a,n)}),getType:()=>Kj.OBJECT};return{...r,...bT(r),...Q$t(r),...qen(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,i)=>{let n=e.parse(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},json:(r,i)=>{let n=e.json(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},getType:()=>Kj.OBJECT};return{...t,...bT(t),...Q$t(t),...qen(t)}}}}function pEp({extensionKeys:e,value:t,transformBase:r,transformExtension:i}){let n=new Set(e),[a,u]=lEp(pNa(t),s=>n.has(s)),l=r(dNa(t,u)),d=i(dNa(t,a));return l.ok&&d.ok?{ok:!0,value:{...l.value,...d.value}}:{ok:!1,errors:[...l.ok?[]:l.errors,...d.ok?[]:d.errors]}}function _Ep(e){return!KaD(e)}function KaD(e){switch(e.getType()){case Kj.ANY:case Kj.UNKNOWN:case Kj.OPTIONAL:return!0;default:return!1}}function hEp(e){return o7o(e)}function yEp(e){let t={...Kec(e),_getRawProperties:()=>PLn(e)._getRawProperties(),_getParsedProperties:()=>PLn(e)._getParsedProperties()};return{...t,...bT(t),...Q$t(t),...qen(t)}}function u7o(e){let t={parse:(r,i)=>vEp(r,(n,a)=>e.parse(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,i)=>vEp(r,(n,a)=>e.json(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>Kj.LIST};return{...SL(t),...bT(t)}}function vEp(e,t){return Array.isArray(e)?e.map((i,n)=>t(i,n)).reduce((i,n)=>{if(i.ok&&n.ok)return{ok:!0,value:[...i.value,n.value]};let a=[];return i.ok||a.push(...i.errors),n.ok||a.push(...n.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:zA(e,"list"),path:[]}]}}function bEp(e){return AJ(Kj.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:zA(r,`"${e}"`)}]})()}function gEp(e){return AJ(Kj.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:zA(r,`${e.toString()}`)}]})()}var OEp=AJ(Kj.ANY,e=>({ok:!0,value:e}));var mEp=AJ(Kj.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:zA(e,"boolean")}]});var PEp=AJ(Kj.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:zA(e,"number")}]});var jEp=AJ(Kj.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:zA(e,"string")}]});var wEp=AJ(Kj.UNKNOWN,e=>({ok:!0,value:e}));function DEp(e,t){let r={parse:(i,n)=>SEp({value:i,isKeyNumeric:e.getType()===Kj.NUMBER,transformKey:a=>e.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(i,n)=>SEp({value:i,isKeyNumeric:e.getType()===Kj.NUMBER,transformKey:a=>e.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>Kj.RECORD};return{...SL(r),...bT(r)}}function SEp({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:n=[]}){return ozi(e)?fNa(e).reduce((a,[u,l])=>{if(l==null)return a;let d=a,s=u;if(t){let g=u.length>0?Number(u):NaN;isNaN(g)||(s=g)}let o=r(s),c=i(l,s);if(d.ok&&o.ok&&c.ok)return{ok:!0,value:{...d.value,[o.value]:c.value}};let b=[];return d.ok||b.push(...d.errors),o.ok||b.push(...o.errors),c.ok||b.push(...c.errors),{ok:!1,errors:b}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:zA(e,"object")}]}}function EEp(e){let t=u7o(e),r={parse:(i,n)=>{let a=t.parse(i,n);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(i,n)=>i instanceof Set?t.json([...i],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:zA(i,"Set")}]},getType:()=>Kj.SET};return{...SL(r),...bT(r)}}function AEp(e){let t={parse:(r,i)=>MEp((n,a)=>n.parse(r,a),e,i),json:(r,i)=>MEp((n,a)=>n.json(r,a),e,i),getType:()=>Kj.UNDISCRIMINATED_UNION};return{...SL(t),...bT(t)}}function MEp(e,t,r){let i=[];for(let[n,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let l of u.errors)i.push({path:l.path,message:`[Variant ${n}] ${l.message}`})}return{ok:!1,errors:i}}function qEp(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function CEp(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,n=a7o(pNa(t)),a={parse:(u,l)=>TEp({value:u,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:d=>n.parse(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),json:(u,l)=>TEp({value:u,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:d=>n.json(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),getType:()=>Kj.UNION};return{...SL(a),...bT(a),...Q$t(a)}}function TEp({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:l=[]}){if(!ozi(e))return{ok:!1,errors:[{path:l,message:zA(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:l,message:`Missing discriminant ("${t}")`}]};let o=i(d);if(!o.ok)return{ok:!1,errors:o.errors};let c=n(o.value);if(c==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...l,t],message:"Unexpected discriminant value"}]};let b=u(s,c);return b.ok?{ok:!0,value:{[r]:d,...b.value}}:b}var s7o=ie.string();var jLn=ie.string();var Zec={};Po(Zec,{ApiAuth:()=>D7o,AuthScheme:()=>S7o,AuthSchemesRequirement:()=>c7o,BasicAuthScheme:()=>f7o,BearerAuthScheme:()=>l7o,EnvironmentVariable:()=>GNe,HeaderAuthScheme:()=>d7o,InferredAuthScheme:()=>w7o,InferredAuthSchemeTokenEndpoint:()=>j7o,InferredAuthenticatedRequestHeader:()=>P7o,OAuthAccessTokenRequestProperties:()=>h7o,OAuthAccessTokenResponseProperties:()=>SLn,OAuthClientCredentials:()=>g7o,OAuthConfiguration:()=>O7o,OAuthRefreshEndpoint:()=>b7o,OAuthRefreshTokenRequestProperties:()=>v7o,OAuthScheme:()=>m7o,OAuthTokenEndpoint:()=>y7o});var GNe=ie.string();var c7o=ie.enum_(["ALL","ANY"]);var Ten=ie.objectWithoutOptionalProperties({unsafeName:ie.string(),safeName:ie.string()});var Sd=ie.objectWithoutOptionalProperties({originalName:ie.string(),camelCase:Ten,pascalCase:Ten,snakeCase:Ten,screamingSnakeCase:Ten});var Dd=ie.objectWithoutOptionalProperties({docs:ie.string().optional()});var l7o=ie.objectWithoutOptionalProperties({token:Sd,tokenEnvVar:GNe.optional()}).extend(Dd);var f7o=ie.objectWithoutOptionalProperties({username:Sd,usernameEnvVar:GNe.optional(),password:Sd,passwordEnvVar:GNe.optional()}).extend(Dd);var Gh=ie.objectWithoutOptionalProperties({wireValue:ie.string(),name:Sd});var d7o=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),prefix:ie.string().optional(),headerEnvVar:GNe.optional()}).extend(Dd);var J$t=ie.string();var Vrr=ie.string();var Wrr=ie.string();var szi=ie.objectWithoutOptionalProperties({endpointId:J$t,serviceId:Vrr,subpackageId:Wrr.optional()});var _Na=ie.unknown();var DL=ie.objectWithoutOptionalProperties({userSpecifiedExamples:ie.record(ie.string(),_Na),autogeneratedExamples:ie.record(ie.string(),_Na)});var p7o=ie.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED"]);var Hrr=ie.objectWithoutOptionalProperties({status:p7o,message:ie.string().optional()});var j4=ie.objectWithoutOptionalProperties({availability:Hrr.optional()}).extend(Dd);var czi=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),allowMultiple:ie.boolean(),v2Examples:DL.optional()}).extend(j4);var wLn=ie.enum_(["READ_ONLY","WRITE_ONLY"]);var Ak=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),propertyAccess:wLn.optional(),v2Examples:DL.optional()}).extend(j4);var _7o=ie.union("type",{query:czi,body:Ak}).transform({transform:e=>{switch(e.type){case"query":return ioe.query(e);case"body":return ioe.body(e);default:return e}},untransform:({_visit:e,...t})=>t});var qJ=ie.objectWithoutOptionalProperties({propertyPath:ie.list(Sd).optional(),property:_7o});var h7o=ie.objectWithoutOptionalProperties({clientId:qJ,clientSecret:qJ,scopes:qJ.optional(),customProperties:ie.list(qJ).optional()});var EL=ie.objectWithoutOptionalProperties({propertyPath:ie.list(Sd).optional(),property:Ak});var SLn=ie.objectWithoutOptionalProperties({accessToken:EL,expiresIn:EL.optional(),refreshToken:EL.optional()});var y7o=ie.objectWithoutOptionalProperties({endpointReference:szi,requestProperties:h7o,responseProperties:SLn});var v7o=ie.objectWithoutOptionalProperties({refreshToken:qJ});var b7o=ie.objectWithoutOptionalProperties({endpointReference:szi,requestProperties:v7o,responseProperties:SLn});var g7o=ie.objectWithoutOptionalProperties({clientIdEnvVar:GNe.optional(),clientSecretEnvVar:GNe.optional(),tokenPrefix:ie.string().optional(),tokenHeader:ie.string().optional(),scopes:ie.list(ie.string()).optional(),tokenEndpoint:y7o,refreshEndpoint:b7o.optional()});var O7o=ie.union("type",{clientCredentials:g7o}).transform({transform:e=>{switch(e.type){case"clientCredentials":return izi.clientCredentials(e);default:return e}},untransform:({_visit:e,...t})=>t});var m7o=ie.objectWithoutOptionalProperties({configuration:O7o}).extend(Dd);var P7o=ie.objectWithoutOptionalProperties({responseProperty:EL,headerName:ie.string(),valuePrefix:ie.string().optional()});var j7o=ie.objectWithoutOptionalProperties({endpoint:szi,expiryProperty:EL.optional(),authenticatedRequestHeaders:ie.list(P7o)});var w7o=ie.objectWithoutOptionalProperties({tokenEndpoint:j7o}).extend(Dd);var S7o=ie.union(ie.discriminant("type","_type"),{bearer:l7o,basic:f7o,header:d7o,oauth:m7o,inferred:w7o}).transform({transform:e=>{switch(e.type){case"bearer":return BA.bearer(e);case"basic":return BA.basic(e);case"header":return BA.header(e);case"oauth":return BA.oauth(e);case"inferred":return BA.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t});var D7o=ie.objectWithoutOptionalProperties({requirement:c7o,schemes:ie.list(S7o)}).extend(Dd);var kec={};Po(kec,{Availability:()=>Hrr,AvailabilityStatus:()=>p7o,Declaration:()=>j4,DisplayName:()=>fzi,EndpointId:()=>J$t,EndpointReference:()=>szi,ErrorId:()=>dzi,EscapedString:()=>E7o,FeatureId:()=>hNa,FernFilepath:()=>ooe,Name:()=>Sd,NameAndWireValue:()=>Gh,SafeAndUnsafeString:()=>Ten,ServiceId:()=>Vrr,SubpackageId:()=>Wrr,TypeId:()=>Gx,WebSocketChannelId:()=>ELn,WebhookGroupId:()=>DLn,WebhookId:()=>M7o,WithContentType:()=>QNe,WithDocs:()=>Dd,WithDocsAndAvailability:()=>lzi,WithJsonExample:()=>$rr});var lzi=ie.objectWithoutOptionalProperties({availability:Hrr.optional()}).extend(Dd);var ooe=ie.objectWithoutOptionalProperties({allParts:ie.list(Sd),packagePath:ie.list(Sd),file:Sd.optional()});var fzi=ie.string();var E7o=ie.objectWithoutOptionalProperties({original:ie.string()});var $rr=ie.objectWithoutOptionalProperties({jsonExample:ie.unknown()});var QNe=ie.objectWithoutOptionalProperties({contentType:ie.string().optional()});var Gx=ie.string();var dzi=ie.string();var DLn=ie.string();var M7o=ie.string();var ELn=ie.string();var hNa=ie.string();var etc={};Po(etc,{Constants:()=>A7o});var A7o=ie.objectWithoutOptionalProperties({errorInstanceIdKey:Gh});var AF={};Po(AF,{AliasType:()=>r6o,Auth:()=>z7o,AuthValues:()=>U7o,BasicAuth:()=>q7o,BasicAuthValues:()=>R7o,BearerAuth:()=>T7o,BearerAuthValues:()=>x7o,BodyRequest:()=>V7o,Declaration:()=>TJ,DiscriminatedUnionType:()=>c6o,DynamicIntermediateRepresentation:()=>E6o,Endpoint:()=>t6o,EndpointExample:()=>e6o,EndpointLocation:()=>ALn,EndpointSnippetRequest:()=>k7o,EndpointSnippetResponse:()=>BEp,EnumType:()=>i6o,EnvironmentValues:()=>Z7o,ErrorSeverity:()=>M6o,Error_:()=>A6o,FileUploadRequestBody:()=>$7o,FileUploadRequestBodyProperty:()=>H7o,GeneratorConfig:()=>D6o,GeneratorOutputConfig:()=>S6o,GoPublishInfo:()=>b6o,HeaderAuth:()=>C7o,HeaderAuthValues:()=>N7o,InferredAuth:()=>I7o,InferredAuthValues:()=>L7o,InlinedRequest:()=>J7o,InlinedRequestBody:()=>G7o,InlinedRequestMetadata:()=>Q7o,LiteralType:()=>q6o,MapType:()=>zEp,MavenPublishInfo:()=>g6o,MultipleEnvironmentUrlValues:()=>X7o,NamedParameter:()=>$z,NamedType:()=>f6o,NpmPublishInfo:()=>O6o,NugetPublishInfo:()=>m6o,OAuth:()=>B7o,OAuthValues:()=>F7o,ObjectType:()=>n6o,PublishInfo:()=>w6o,PypiPublishInfo:()=>P6o,ReferencedRequestBody:()=>W7o,ReferencedRequestBodyType:()=>qLn,Request:()=>K7o,Response:()=>Y7o,RubyGemsPublishInfo:()=>j6o,SingleDiscriminatedUnionType:()=>s6o,SingleDiscriminatedUnionTypeNoProperties:()=>u6o,SingleDiscriminatedUnionTypeObject:()=>a6o,SingleDiscriminatedUnionTypeSingleProperty:()=>o6o,TypeReference:()=>IEp,UndiscriminatedUnionType:()=>l6o,Values:()=>TLn,auth:()=>ttc,declaration:()=>rtc,endpoints:()=>itc,environment:()=>ntc,ir:()=>atc,snippets:()=>otc,types:()=>utc});var ttc={};Po(ttc,{Auth:()=>z7o,AuthValues:()=>U7o,BasicAuth:()=>q7o,BasicAuthValues:()=>R7o,BearerAuth:()=>T7o,BearerAuthValues:()=>x7o,HeaderAuth:()=>C7o,HeaderAuthValues:()=>N7o,InferredAuth:()=>I7o,InferredAuthValues:()=>L7o,OAuth:()=>B7o,OAuthValues:()=>F7o});var q7o=ie.objectWithoutOptionalProperties({username:Sd,password:Sd});var T7o=ie.objectWithoutOptionalProperties({token:Sd});var $z=ie.objectWithoutOptionalProperties({name:Gh,typeReference:ie.lazy(()=>AF.TypeReference)});var C7o=ie.objectWithoutOptionalProperties({header:$z});var B7o=ie.objectWithoutOptionalProperties({clientId:Sd,clientSecret:Sd});var I7o=ie.objectWithoutOptionalProperties({});var z7o=ie.union("type",{basic:q7o,bearer:T7o,header:C7o,oauth:B7o,inferred:I7o}).transform({transform:e=>{switch(e.type){case"basic":return us.Auth.basic(e);case"bearer":return us.Auth.bearer(e);case"header":return us.Auth.header(e);case"oauth":return us.Auth.oauth(e);case"inferred":return us.Auth.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t});var R7o=ie.objectWithoutOptionalProperties({username:ie.string(),password:ie.string()});var x7o=ie.objectWithoutOptionalProperties({token:ie.string()});var N7o=ie.objectWithoutOptionalProperties({value:ie.unknown()});var F7o=ie.objectWithoutOptionalProperties({clientId:ie.string(),clientSecret:ie.string()});var L7o=ie.objectWithoutOptionalProperties({});var U7o=ie.union("type",{basic:R7o,bearer:x7o,header:N7o,oauth:F7o,inferred:L7o}).transform({transform:e=>{switch(e.type){case"basic":return us.AuthValues.basic(e);case"bearer":return us.AuthValues.bearer(e);case"header":return us.AuthValues.header(e);case"oauth":return us.AuthValues.oauth(e);case"inferred":return us.AuthValues.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t});var rtc={};Po(rtc,{Declaration:()=>TJ});var TJ=ie.objectWithoutOptionalProperties({fernFilepath:ooe,name:Sd});var itc={};Po(itc,{BodyRequest:()=>V7o,Endpoint:()=>t6o,EndpointExample:()=>e6o,EndpointLocation:()=>ALn,FileUploadRequestBody:()=>$7o,FileUploadRequestBodyProperty:()=>H7o,InlinedRequest:()=>J7o,InlinedRequestBody:()=>G7o,InlinedRequestMetadata:()=>Q7o,ReferencedRequestBody:()=>W7o,ReferencedRequestBodyType:()=>qLn,Request:()=>K7o,Response:()=>Y7o});var MLn=ie.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"]);var ALn=ie.objectWithoutOptionalProperties({method:MLn,path:ie.string()});var qLn=ie.union("type",{bytes:ie.object({}),typeReference:ie.object({value:ie.lazy(()=>AF.TypeReference)})}).transform({transform:e=>{switch(e.type){case"bytes":return us.ReferencedRequestBodyType.bytes();case"typeReference":return us.ReferencedRequestBodyType.typeReference(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var V7o=ie.objectWithoutOptionalProperties({pathParameters:ie.list($z).optional(),body:qLn.optional()});var W7o=ie.objectWithoutOptionalProperties({bodyKey:Sd,bodyType:qLn});var H7o=ie.union("type",{file:Gh,fileArray:Gh,bodyProperty:$z}).transform({transform:e=>{switch(e.type){case"file":return us.FileUploadRequestBodyProperty.file(e);case"fileArray":return us.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return us.FileUploadRequestBodyProperty.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t});var $7o=ie.objectWithoutOptionalProperties({properties:ie.list(H7o)});var G7o=ie.union("type",{properties:ie.object({value:ie.list($z)}),referenced:W7o,fileUpload:$7o}).transform({transform:e=>{switch(e.type){case"properties":return us.InlinedRequestBody.properties(e.value);case"referenced":return us.InlinedRequestBody.referenced(e);case"fileUpload":return us.InlinedRequestBody.fileUpload(e);default:return e}},untransform:({_visit:e,...t})=>t});var Q7o=ie.objectWithoutOptionalProperties({includePathParameters:ie.boolean(),onlyPathParameters:ie.boolean()});var J7o=ie.objectWithoutOptionalProperties({declaration:TJ,pathParameters:ie.list($z).optional(),queryParameters:ie.list($z).optional(),headers:ie.list($z).optional(),body:G7o.optional(),metadata:Q7o.optional()});var K7o=ie.union("type",{body:V7o,inlined:J7o}).transform({transform:e=>{switch(e.type){case"body":return us.Request.body(e);case"inlined":return us.Request.inlined(e);default:return e}},untransform:({_visit:e,...t})=>t});var Y7o=ie.union("type",{json:ie.object({})}).transform({transform:e=>{switch(e.type){case"json":return us.Response.json();default:return e}},untransform:({_visit:e,...t})=>t});var JNe=ie.string();var qk=ie.string();var Grr=ie.string();var X7o=ie.record(qk,Grr);var Z7o=ie.undiscriminatedUnion([JNe,X7o]);var TLn=ie.record(ie.string(),ie.unknown());var k7o=ie.objectWithoutOptionalProperties({endpoint:ALn,baseUrl:ie.property("baseURL",ie.string().optional()),environment:Z7o.optional(),auth:U7o.optional(),pathParameters:TLn.optional(),queryParameters:TLn.optional(),headers:TLn.optional(),requestBody:ie.unknown().optional()});var e6o=ie.objectWithoutOptionalProperties({id:ie.string(),name:ie.string().optional()}).extend(k7o);var t6o=ie.objectWithoutOptionalProperties({auth:z7o.optional(),declaration:TJ,location:ALn,request:K7o,response:Y7o,examples:ie.list(e6o).optional()});var ntc={};Po(ntc,{EnvironmentValues:()=>Z7o,MultipleEnvironmentUrlValues:()=>X7o});var atc={};Po(atc,{DynamicIntermediateRepresentation:()=>E6o,GeneratorConfig:()=>D6o,GeneratorOutputConfig:()=>S6o,GoPublishInfo:()=>b6o,MavenPublishInfo:()=>g6o,NpmPublishInfo:()=>O6o,NugetPublishInfo:()=>m6o,PublishInfo:()=>w6o,PypiPublishInfo:()=>P6o,RubyGemsPublishInfo:()=>j6o});var r6o=ie.objectWithoutOptionalProperties({declaration:TJ,typeReference:ie.lazy(()=>AF.TypeReference)});var i6o=ie.objectWithoutOptionalProperties({declaration:TJ,values:ie.list(Gh)});var n6o=ie.objectWithoutOptionalProperties({declaration:TJ,properties:ie.list($z),additionalProperties:ie.boolean().optional()});var a6o=ie.objectWithoutOptionalProperties({typeId:Gx,discriminantValue:Gh,properties:ie.list($z)});var o6o=ie.objectWithoutOptionalProperties({typeReference:ie.lazy(()=>AF.TypeReference),discriminantValue:Gh,properties:ie.list($z).optional()});var u6o=ie.objectWithoutOptionalProperties({discriminantValue:Gh,properties:ie.list($z).optional()});var s6o=ie.union("type",{samePropertiesAsObject:a6o,singleProperty:o6o,noProperties:u6o}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return us.SingleDiscriminatedUnionType.samePropertiesAsObject(e);case"singleProperty":return us.SingleDiscriminatedUnionType.singleProperty(e);case"noProperties":return us.SingleDiscriminatedUnionType.noProperties(e);default:return e}},untransform:({_visit:e,...t})=>t});var c6o=ie.objectWithoutOptionalProperties({declaration:TJ,discriminant:Gh,types:ie.record(ie.string(),s6o)});var l6o=ie.objectWithoutOptionalProperties({declaration:TJ,types:ie.list(ie.lazy(()=>AF.TypeReference))});var f6o=ie.union("type",{alias:r6o,enum:i6o,object:n6o,discriminatedUnion:c6o,undiscriminatedUnion:l6o}).transform({transform:e=>{switch(e.type){case"alias":return us.NamedType.alias(e);case"enum":return us.NamedType.enum(e);case"object":return us.NamedType.object(e);case"discriminatedUnion":return us.NamedType.discriminatedUnion(e);case"undiscriminatedUnion":return us.NamedType.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var d6o=ie.objectWithoutOptionalProperties({id:JNe,name:Sd,url:Grr}).extend(Dd);var p6o=ie.objectWithoutOptionalProperties({environments:ie.list(d6o)});var _6o=ie.objectWithoutOptionalProperties({id:qk,name:Sd});var h6o=ie.objectWithoutOptionalProperties({id:JNe,name:Sd,urls:ie.record(qk,Grr)}).extend(Dd);var y6o=ie.objectWithoutOptionalProperties({baseUrls:ie.list(_6o),environments:ie.list(h6o)});var v6o=ie.union("type",{singleBaseUrl:p6o,multipleBaseUrls:y6o}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return $R.singleBaseUrl(e);case"multipleBaseUrls":return $R.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t});var CLn=ie.objectWithoutOptionalProperties({defaultEnvironment:JNe.optional(),environments:v6o});var b6o=ie.objectWithoutOptionalProperties({version:ie.string(),repoUrl:ie.string()});var g6o=ie.objectWithoutOptionalProperties({version:ie.string(),coordinate:ie.string(),repoUrl:ie.string().optional()});var O6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var m6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var P6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var j6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var w6o=ie.union("type",{go:b6o,maven:g6o,npm:O6o,nuget:m6o,pypi:P6o,rubygems:j6o}).transform({transform:e=>{switch(e.type){case"go":return us.PublishInfo.go(e);case"maven":return us.PublishInfo.maven(e);case"npm":return us.PublishInfo.npm(e);case"nuget":return us.PublishInfo.nuget(e);case"pypi":return us.PublishInfo.pypi(e);case"rubygems":return us.PublishInfo.rubygems(e);default:return e}},untransform:({_visit:e,...t})=>t});var S6o=ie.union("type",{publish:ie.object({value:w6o}),local:ie.object({})}).transform({transform:e=>{switch(e.type){case"publish":return us.GeneratorOutputConfig.publish(e.value);case"local":return us.GeneratorOutputConfig.local();default:return e}},untransform:({_visit:e,...t})=>t});var D6o=ie.objectWithoutOptionalProperties({apiName:ie.string(),organization:ie.string(),customConfig:ie.unknown(),outputConfig:S6o});var E6o=ie.objectWithoutOptionalProperties({version:ie.stringLiteral("1.0.0"),types:ie.record(Gx,f6o),endpoints:ie.record(J$t,t6o),environments:CLn.optional(),headers:ie.list($z).optional(),pathParameters:ie.list($z).optional(),generatorConfig:D6o.optional()});var otc={};Po(otc,{EndpointSnippetRequest:()=>k7o,EndpointSnippetResponse:()=>BEp,ErrorSeverity:()=>M6o,Error_:()=>A6o,Values:()=>TLn});var M6o=ie.enum_(["CRITICAL","WARNING"]);var A6o=ie.objectWithoutOptionalProperties({severity:M6o,message:ie.string()});var BEp=ie.objectWithoutOptionalProperties({snippet:ie.string(),errors:ie.list(A6o).optional()});var utc={};Po(utc,{AliasType:()=>r6o,DiscriminatedUnionType:()=>c6o,EnumType:()=>i6o,LiteralType:()=>q6o,MapType:()=>zEp,NamedParameter:()=>$z,NamedType:()=>f6o,ObjectType:()=>n6o,SingleDiscriminatedUnionType:()=>s6o,SingleDiscriminatedUnionTypeNoProperties:()=>u6o,SingleDiscriminatedUnionTypeObject:()=>a6o,SingleDiscriminatedUnionTypeSingleProperty:()=>o6o,TypeReference:()=>IEp,UndiscriminatedUnionType:()=>l6o});var q6o=ie.union("type",{boolean:ie.object({value:ie.boolean()}),string:ie.object({value:ie.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return us.LiteralType.boolean(e.value);case"string":return us.LiteralType.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var BLn=ie.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","UUID","BASE_64","BIG_INTEGER"]);var IEp=ie.union("type",{list:ie.object({value:ie.lazy(()=>AF.TypeReference)}),literal:ie.object({value:q6o}),map:ie.lazyObject(()=>AF.MapType),named:ie.object({value:Gx}),nullable:ie.object({value:ie.lazy(()=>AF.TypeReference)}),optional:ie.object({value:ie.lazy(()=>AF.TypeReference)}),primitive:ie.object({value:BLn}),set:ie.object({value:ie.lazy(()=>AF.TypeReference)}),unknown:ie.object({})}).transform({transform:e=>{switch(e.type){case"list":return us.TypeReference.list(e.value);case"literal":return us.TypeReference.literal(e.value);case"map":return us.TypeReference.map(e);case"named":return us.TypeReference.named(e.value);case"nullable":return us.TypeReference.nullable(e.value);case"optional":return us.TypeReference.optional(e.value);case"primitive":return us.TypeReference.primitive(e.value);case"set":return us.TypeReference.set(e.value);case"unknown":return us.TypeReference.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var zEp=ie.objectWithoutOptionalProperties({key:ie.lazy(()=>AF.TypeReference),value:ie.lazy(()=>AF.TypeReference)});var stc={};Po(stc,{EnvironmentBaseUrlId:()=>qk,EnvironmentBaseUrlWithId:()=>_6o,EnvironmentId:()=>JNe,EnvironmentUrl:()=>Grr,Environments:()=>v6o,EnvironmentsConfig:()=>CLn,MultipleBaseUrlsEnvironment:()=>h6o,MultipleBaseUrlsEnvironments:()=>y6o,SingleBaseUrlEnvironment:()=>d6o,SingleBaseUrlEnvironments:()=>p6o});var ctc={};Po(ctc,{DeclaredErrorName:()=>pzi,ErrorDeclaration:()=>C6o,ErrorDeclarationDiscriminantValue:()=>REp,ExampleError:()=>T6o});var pzi=ie.objectWithoutOptionalProperties({errorId:dzi,fernFilepath:ooe,name:Sd});var T6o=ie.objectWithoutOptionalProperties({name:Sd.optional(),shape:ie.lazyObject(()=>Sm)}).extend($rr).extend(Dd);var C6o=ie.objectWithoutOptionalProperties({name:pzi,displayName:ie.string().optional(),discriminantValue:Gh,type:ie.lazy(()=>av).optional(),statusCode:ie.number(),examples:ie.list(T6o),v2Examples:DL.optional()}).extend(Dd);var REp=ie.union("type",{property:Gh,statusCode:ie.object({})}).transform({transform:e=>{switch(e.type){case"property":return nzi.property(e);case"statusCode":return nzi.statusCode();default:return e}},untransform:({_visit:e,...t})=>t});var ltc={};Po(ltc,{BasicAuthValues:()=>R6o,BearerAuthValues:()=>x6o,HeaderAuthValues:()=>N6o,MultipleEnvironmentUrlValues:()=>z6o,OAuthValues:()=>F6o,V2AuthValues:()=>zLn,V2EndpointLocation:()=>I6o,V2EndpointLocationHttpMethod:()=>B6o,V2EnvironmentValues:()=>ILn,V2HttpEndpointCodeSample:()=>W6o,V2HttpEndpointExample:()=>yNa,V2HttpEndpointExamples:()=>H6o,V2HttpEndpointRequest:()=>L6o,V2HttpEndpointResponse:()=>V6o,V2HttpEndpointResponseBody:()=>U6o,V2SchemaExample:()=>_Na,V2SchemaExamples:()=>DL,V2ValueExamples:()=>Qrr,V2WebSocketEndpointLocation:()=>$6o,V2WebSocketMessageExample:()=>G6o,V2WebSocketSessionExample:()=>vNa,V2WebSocketSessionExamples:()=>Q6o,V2WebhookExample:()=>bNa,V2WebhookExamples:()=>J6o,WithV2Examples:()=>gI});var gI=ie.objectWithoutOptionalProperties({v2Examples:DL.optional()});var B6o=ie.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"]);var I6o=ie.objectWithoutOptionalProperties({method:B6o,path:ie.string()});var z6o=ie.record(qk,Grr);var ILn=ie.undiscriminatedUnion([JNe,z6o]);var R6o=ie.objectWithoutOptionalProperties({username:ie.string(),password:ie.string()});var x6o=ie.objectWithoutOptionalProperties({token:ie.string()});var N6o=ie.objectWithoutOptionalProperties({value:ie.unknown()});var F6o=ie.objectWithoutOptionalProperties({clientId:ie.string(),clientSecret:ie.string()});var zLn=ie.union("type",{basic:R6o,bearer:x6o,header:N6o,oauth:F6o}).transform({transform:e=>{switch(e.type){case"basic":return VNe.basic(e);case"bearer":return VNe.bearer(e);case"header":return VNe.header(e);case"oauth":return VNe.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var Qrr=ie.record(ie.string(),ie.unknown());var L6o=ie.objectWithoutOptionalProperties({endpoint:I6o,baseUrl:ie.property("baseURL",ie.string().optional()),environment:ILn.optional(),auth:zLn.optional(),pathParameters:Qrr.optional(),queryParameters:Qrr.optional(),headers:Qrr.optional(),requestBody:ie.unknown().optional()}).extend(Dd);var U6o=ie.union("type",{error:ie.object({value:ie.unknown()}),json:ie.object({value:ie.unknown()}),stream:ie.object({value:ie.list(ie.unknown())})}).transform({transform:e=>{switch(e.type){case"error":return m4.error(e.value);case"json":return m4.json(e.value);case"stream":return m4.stream(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var V6o=ie.objectWithoutOptionalProperties({statusCode:ie.number().optional(),body:U6o.optional()}).extend(Dd);var W6o=ie.objectWithoutOptionalProperties({name:ie.string().optional(),language:ie.string(),code:ie.string()}).extend(Dd);var yNa=ie.objectWithoutOptionalProperties({displayName:ie.string().optional(),request:L6o.optional(),response:V6o.optional(),codeSamples:ie.list(W6o).optional()});var H6o=ie.objectWithoutOptionalProperties({userSpecifiedExamples:ie.record(ie.string(),yNa),autogeneratedExamples:ie.record(ie.string(),yNa)});var $6o=ie.objectWithoutOptionalProperties({path:ie.string()});var G6o=ie.objectWithoutOptionalProperties({type:ie.string(),body:ie.unknown()});var vNa=ie.objectWithoutOptionalProperties({channel:$6o,baseUrl:ie.property("baseURL",ie.string().optional()),environment:ILn.optional(),auth:zLn.optional(),pathParameters:Qrr.optional(),queryParameters:Qrr.optional(),headers:Qrr.optional(),messages:ie.list(G6o).optional()});var Q6o=ie.objectWithoutOptionalProperties({autogeneratedExamples:ie.record(ie.string(),vNa),userSpecifiedExamples:ie.record(ie.string(),vNa)});var bNa=ie.objectWithoutOptionalProperties({name:ie.string().optional(),payload:ie.unknown()});var J6o=ie.objectWithoutOptionalProperties({userSpecifiedExamples:ie.record(ie.string(),bNa),autogeneratedExamples:ie.record(ie.string(),bNa)});var dtc={};Po(dtc,{BasicLicense:()=>Y6o,CustomLicense:()=>X6o,EnvironmentVariable:()=>Y3,GeneratorConfig:()=>xEp,GeneratorEnvironment:()=>O4o,GeneratorOutputConfig:()=>b4o,GeneratorPublishConfig:()=>WLn,GeneratorPublishTarget:()=>u4o,GeneratorRegistriesConfig:()=>r4o,GeneratorRegistriesConfigV2:()=>a4o,GithubOutputMode:()=>y4o,GithubPublishInfo:()=>h4o,LicenseConfig:()=>Z6o,LicenseId:()=>K6o,MavenCentralSignature:()=>RLn,MavenCentralSignatureGithubInfo:()=>c4o,MavenGithubPublishInfo:()=>l4o,MavenRegistryConfig:()=>e4o,MavenRegistryConfigV2:()=>xLn,NpmGithubPublishInfo:()=>s4o,NpmRegistryConfig:()=>t4o,NpmRegistryConfigV2:()=>NLn,NugetGithubPublishInfo:()=>_4o,NugetRegistryConfig:()=>VLn,OutputMetadata:()=>n4o,OutputMetadataAuthor:()=>i4o,OutputMode:()=>v4o,PostmanConfig:()=>o4o,PostmanGithubPublishInfo:()=>f4o,PublishingMetadata:()=>k6o,PypiGithubPublishInfo:()=>d4o,PypiMetadata:()=>FLn,PypiRegistryConfig:()=>LLn,RemoteGeneratorEnvironment:()=>g4o,RubyGemsGithubPublishInfo:()=>p4o,RubyGemsRegistryConfig:()=>ULn,config:()=>ftc});var ftc={};Po(ftc,{BasicLicense:()=>Y6o,CustomLicense:()=>X6o,EnvironmentVariable:()=>Y3,GeneratorConfig:()=>xEp,GeneratorEnvironment:()=>O4o,GeneratorOutputConfig:()=>b4o,GeneratorPublishConfig:()=>WLn,GeneratorPublishTarget:()=>u4o,GeneratorRegistriesConfig:()=>r4o,GeneratorRegistriesConfigV2:()=>a4o,GithubOutputMode:()=>y4o,GithubPublishInfo:()=>h4o,LicenseConfig:()=>Z6o,LicenseId:()=>K6o,MavenCentralSignature:()=>RLn,MavenCentralSignatureGithubInfo:()=>c4o,MavenGithubPublishInfo:()=>l4o,MavenRegistryConfig:()=>e4o,MavenRegistryConfigV2:()=>xLn,NpmGithubPublishInfo:()=>s4o,NpmRegistryConfig:()=>t4o,NpmRegistryConfigV2:()=>NLn,NugetGithubPublishInfo:()=>_4o,NugetRegistryConfig:()=>VLn,OutputMetadata:()=>n4o,OutputMetadataAuthor:()=>i4o,OutputMode:()=>v4o,PostmanConfig:()=>o4o,PostmanGithubPublishInfo:()=>f4o,PublishingMetadata:()=>k6o,PypiGithubPublishInfo:()=>d4o,PypiMetadata:()=>FLn,PypiRegistryConfig:()=>LLn,RemoteGeneratorEnvironment:()=>g4o,RubyGemsGithubPublishInfo:()=>p4o,RubyGemsRegistryConfig:()=>ULn});var K6o=ie.enum_(["MIT","Apache-2.0"]);var Y6o=ie.objectWithoutOptionalProperties({id:K6o});var X6o=ie.objectWithoutOptionalProperties({filename:ie.string()});var Z6o=ie.union("type",{basic:Y6o,custom:X6o}).transform({transform:e=>{switch(e.type){case"basic":return U0.LicenseConfig.basic(e);case"custom":return U0.LicenseConfig.custom(e);default:return e}},untransform:({_visit:e,...t})=>t});var k6o=ie.objectWithoutOptionalProperties({packageDescription:ie.property("package_description",ie.string().optional()),publisherEmail:ie.property("publisher_email",ie.string().optional()),referenceUrl:ie.property("reference_url",ie.string().optional()),publisherName:ie.property("publisher_name",ie.string().optional())});var RLn=ie.objectWithoutOptionalProperties({keyId:ie.string(),password:ie.string(),secretKey:ie.string()});var e4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),username:ie.string(),password:ie.string(),group:ie.string(),signature:RLn.optional()});var t4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),token:ie.string(),scope:ie.string()});var r4o=ie.objectWithoutOptionalProperties({maven:e4o,npm:t4o});var xLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),username:ie.string(),password:ie.string(),coordinate:ie.string(),signature:RLn.optional()});var NLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),token:ie.string(),packageName:ie.string()});var i4o=ie.objectWithoutOptionalProperties({name:ie.string(),email:ie.string()});var n4o=ie.objectWithoutOptionalProperties({description:ie.string().optional(),authors:ie.list(i4o).optional()});var FLn=ie.objectWithoutOptionalProperties({keywords:ie.list(ie.string()).optional(),documentationLink:ie.string().optional(),homepageLink:ie.string().optional()}).extend(n4o);var LLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),username:ie.string(),password:ie.string(),packageName:ie.string(),pypiMetadata:FLn.optional()});var ULn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),apiKey:ie.string(),packageName:ie.string()});var VLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),apiKey:ie.string(),packageName:ie.string()});var a4o=ie.objectWithoutOptionalProperties({maven:xLn,npm:NLn,pypi:LLn,rubygems:ULn,nuget:VLn});var o4o=ie.objectWithoutOptionalProperties({apiKey:ie.string(),workspaceId:ie.string()});var u4o=ie.union("type",{maven:xLn,npm:NLn,pypi:LLn,postman:o4o,rubygems:ULn,nuget:VLn}).transform({transform:e=>{switch(e.type){case"maven":return U0.GeneratorPublishTarget.maven(e);case"npm":return U0.GeneratorPublishTarget.npm(e);case"pypi":return U0.GeneratorPublishTarget.pypi(e);case"postman":return U0.GeneratorPublishTarget.postman(e);case"rubygems":return U0.GeneratorPublishTarget.rubygems(e);case"nuget":return U0.GeneratorPublishTarget.nuget(e);default:return e}},untransform:({_visit:e,...t})=>t});var WLn=ie.objectWithoutOptionalProperties({registries:r4o,registriesV2:a4o,publishTarget:u4o.optional(),version:ie.string()});var Y3=ie.string();var s4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),tokenEnvironmentVariable:Y3,shouldGeneratePublishWorkflow:ie.boolean().optional()});var c4o=ie.objectWithoutOptionalProperties({keyIdEnvironmentVariable:Y3,passwordEnvironmentVariable:Y3,secretKeyEnvironmentVariable:Y3});var l4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),coordinate:ie.string(),usernameEnvironmentVariable:Y3,passwordEnvironmentVariable:Y3,signature:c4o.optional(),shouldGeneratePublishWorkflow:ie.boolean().optional()});var f4o=ie.objectWithoutOptionalProperties({apiKeyEnvironmentVariable:Y3,workspaceIdEnvironmentVariable:Y3});var d4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),usernameEnvironmentVariable:Y3,passwordEnvironmentVariable:Y3,pypiMetadata:FLn.optional(),shouldGeneratePublishWorkflow:ie.boolean().optional()});var p4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),apiKeyEnvironmentVariable:Y3,shouldGeneratePublishWorkflow:ie.boolean().optional()});var _4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),apiKeyEnvironmentVariable:Y3,shouldGeneratePublishWorkflow:ie.boolean().optional()});var h4o=ie.union("type",{npm:s4o,maven:l4o,postman:f4o,pypi:d4o,rubygems:p4o,nuget:_4o}).transform({transform:e=>{switch(e.type){case"npm":return U0.GithubPublishInfo.npm(e);case"maven":return U0.GithubPublishInfo.maven(e);case"postman":return U0.GithubPublishInfo.postman(e);case"pypi":return U0.GithubPublishInfo.pypi(e);case"rubygems":return U0.GithubPublishInfo.rubygems(e);case"nuget":return U0.GithubPublishInfo.nuget(e);default:return e}},untransform:({_visit:e,...t})=>t});var y4o=ie.objectWithoutOptionalProperties({version:ie.string(),repoUrl:ie.string(),installationToken:ie.string().optional(),publishInfo:h4o.optional()});var v4o=ie.union("type",{publish:WLn,downloadFiles:ie.object({}),github:y4o}).transform({transform:e=>{switch(e.type){case"publish":return U0.OutputMode.publish(e);case"downloadFiles":return U0.OutputMode.downloadFiles();case"github":return U0.OutputMode.github(e);default:return e}},untransform:({_visit:e,...t})=>t});var b4o=ie.objectWithoutOptionalProperties({path:ie.string(),snippetFilepath:ie.string().optional(),snippetTemplateFilepath:ie.string().optional(),publishingMetadata:k6o.optional(),mode:v4o});var g4o=ie.objectWithoutOptionalProperties({coordinatorUrl:ie.string(),coordinatorUrlV2:ie.string(),id:ie.string()});var O4o=ie.union(ie.discriminant("type","_type"),{local:ie.object({}),remote:g4o}).transform({transform:e=>{switch(e.type){case"local":return U0.GeneratorEnvironment.local();case"remote":return U0.GeneratorEnvironment.remote(e);default:return e}},untransform:({_visit:e,...t})=>t});var xEp=ie.objectWithoutOptionalProperties({dryRun:ie.boolean(),irFilepath:ie.string(),originalReadmeFilepath:ie.string().optional(),license:Z6o.optional(),output:b4o,publish:WLn.optional(),workspaceName:ie.string(),organization:ie.string(),customConfig:ie.unknown(),environment:O4o,whitelabel:ie.boolean(),writeUnitTests:ie.boolean(),generatePaginatedClients:ie.boolean().optional(),generateOauthClients:ie.boolean()});var ptc={};Po(ptc,{AutogeneratedEndpointExample:()=>f2o,BytesRequest:()=>QLn,BytesResponse:()=>ZLn,CursorPagination:()=>K4o,CustomPagination:()=>X4o,DeclaredServiceName:()=>m4o,EndpointName:()=>j4o,ExampleCodeSample:()=>r2o,ExampleCodeSampleLanguage:()=>k4o,ExampleCodeSampleSdk:()=>t2o,ExampleEndpointCall:()=>iUn,ExampleEndpointErrorResponse:()=>s2o,ExampleEndpointSuccessResponse:()=>u2o,ExampleHeader:()=>Cen,ExampleInlinedRequestBody:()=>rUn,ExampleInlinedRequestBodyProperty:()=>n2o,ExamplePathParameter:()=>_zi,ExampleQueryParameter:()=>tUn,ExampleQueryParameterShape:()=>i2o,ExampleRequestBody:()=>a2o,ExampleResponse:()=>c2o,ExampleServerSideEvent:()=>o2o,FileDownloadResponse:()=>YLn,FileProperty:()=>M4o,FilePropertyArray:()=>E4o,FilePropertySingle:()=>D4o,FileUploadBodyProperty:()=>q4o,FileUploadBodyPropertyEncoding:()=>A4o,FileUploadRequest:()=>C4o,FileUploadRequestProperty:()=>T4o,GrpcTransport:()=>h2o,HttpEndpoint:()=>g2o,HttpEndpointSource:()=>b2o,HttpHeader:()=>Tk,HttpMethod:()=>MLn,HttpPath:()=>KNe,HttpPathPart:()=>P4o,HttpRequestBody:()=>JLn,HttpRequestBodyReference:()=>GLn,HttpResponse:()=>eUn,HttpResponseBody:()=>$4o,HttpService:()=>P2o,InlinedRequestBody:()=>S4o,InlinedRequestBodyProperty:()=>$Ln,JsonResponse:()=>KLn,JsonResponseBody:()=>N4o,JsonResponseBodyWithProperty:()=>F4o,JsonStreamChunk:()=>L4o,NonStreamHttpResponseBody:()=>W4o,OffsetPagination:()=>Y4o,Pagination:()=>Z4o,PathParameter:()=>K$t,PathParameterLocation:()=>w4o,ProtoSourceInfo:()=>v2o,QueryParameter:()=>czi,RequestProperty:()=>qJ,RequestPropertyValue:()=>_7o,ResponseError:()=>Q4o,ResponseErrors:()=>J4o,ResponseProperty:()=>EL,SdkRequest:()=>x4o,SdkRequestBodyType:()=>I4o,SdkRequestShape:()=>R4o,SdkRequestWrapper:()=>z4o,SseStreamChunk:()=>V4o,StreamParameterResponse:()=>H4o,StreamingResponse:()=>kLn,SupportedSdkLanguage:()=>e2o,TextResponse:()=>XLn,TextStreamChunk:()=>U4o,Transport:()=>aUn,UserSpecifiedEndpointExample:()=>l2o,V2HttpRequestBodies:()=>B4o,V2HttpResponses:()=>G4o});var m4o=ie.objectWithoutOptionalProperties({fernFilepath:ooe});var P4o=ie.objectWithoutOptionalProperties({pathParameter:ie.string(),tail:ie.string()});var KNe=ie.objectWithoutOptionalProperties({head:ie.string(),parts:ie.list(P4o)});var j4o=Sd;var Tk=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),env:ie.string().optional(),v2Examples:DL.optional()}).extend(j4);var w4o=ie.enum_(["ROOT","SERVICE","ENDPOINT"]);var HLn=ie.string();var K$t=ie.objectWithoutOptionalProperties({name:Sd,valueType:ie.lazy(()=>av),location:w4o,variable:HLn.optional(),v2Examples:DL.optional()}).extend(Dd);var OI=ie.objectWithoutOptionalProperties({typeId:Gx,fernFilepath:ooe,name:Sd,displayName:fzi.optional()});var $Ln=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),v2Examples:DL.optional(),propertyAccess:wLn.optional()}).extend(lzi);var S4o=ie.objectWithoutOptionalProperties({name:Sd,extends:ie.list(OI),properties:ie.list($Ln),extendedProperties:ie.list(Ak).optional(),extraProperties:ie.property("extra-properties",ie.boolean())}).extend(Dd).extend(gI).extend(QNe);var GLn=ie.objectWithoutOptionalProperties({requestBodyType:ie.lazy(()=>av)}).extend(Dd).extend(QNe).extend(gI);var D4o=ie.objectWithoutOptionalProperties({key:Gh,isOptional:ie.boolean(),contentType:ie.string().optional()}).extend(Dd);var E4o=ie.objectWithoutOptionalProperties({key:Gh,isOptional:ie.boolean(),contentType:ie.string().optional()}).extend(Dd);var M4o=ie.union("type",{file:D4o,fileArray:E4o}).transform({transform:e=>{switch(e.type){case"file":return roe.file(e);case"fileArray":return roe.fileArray(e);default:return e}},untransform:({_visit:e,...t})=>t});var A4o=ie.enum_(["exploded","json","form"]);var q4o=ie.objectWithoutOptionalProperties({style:A4o.optional()}).extend($Ln).extend(QNe);var T4o=ie.union("type",{file:ie.object({value:M4o}),bodyProperty:q4o}).transform({transform:e=>{switch(e.type){case"file":return P4.file(e.value);case"bodyProperty":return P4.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t});var C4o=ie.objectWithoutOptionalProperties({name:Sd,properties:ie.list(T4o)}).extend(Dd).extend(gI).extend(QNe);var QLn=ie.objectWithoutOptionalProperties({isOptional:ie.boolean()}).extend(Dd).extend(gI).extend(QNe);var JLn=ie.union("type",{inlinedRequestBody:S4o,reference:GLn,fileUpload:C4o,bytes:QLn}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return IA.inlinedRequestBody(e);case"reference":return IA.reference(e);case"fileUpload":return IA.fileUpload(e);case"bytes":return IA.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var B4o=ie.objectWithoutOptionalProperties({requestBodies:ie.list(JLn).optional()});var I4o=ie.union("type",{typeReference:GLn,bytes:QLn}).transform({transform:e=>{switch(e.type){case"typeReference":return H$t.typeReference(e);case"bytes":return H$t.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var z4o=ie.objectWithoutOptionalProperties({wrapperName:Sd,bodyKey:Sd,includePathParameters:ie.boolean().optional(),onlyPathParameters:ie.boolean().optional()});var R4o=ie.union("type",{justRequestBody:ie.object({value:I4o}),wrapper:z4o}).transform({transform:e=>{switch(e.type){case"justRequestBody":return $Ne.justRequestBody(e.value);case"wrapper":return $Ne.wrapper(e);default:return e}},untransform:({_visit:e,...t})=>t});var x4o=ie.objectWithoutOptionalProperties({streamParameter:qJ.optional(),requestParameterName:Sd,shape:R4o});var N4o=ie.objectWithoutOptionalProperties({responseBodyType:ie.lazy(()=>av)}).extend(Dd).extend(gI);var F4o=ie.objectWithoutOptionalProperties({responseBodyType:ie.lazy(()=>av),responseProperty:Ak.optional()}).extend(Dd).extend(gI);var KLn=ie.union("type",{response:N4o,nestedPropertyAsResponse:F4o}).transform({transform:e=>{switch(e.type){case"response":return OL.response(e);case"nestedPropertyAsResponse":return OL.nestedPropertyAsResponse(e);default:return e}},untransform:({_visit:e,...t})=>t});var YLn=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var XLn=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var ZLn=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var L4o=ie.objectWithoutOptionalProperties({payload:ie.lazy(()=>av),terminator:ie.string().optional()}).extend(Dd).extend(gI);var U4o=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var V4o=ie.objectWithoutOptionalProperties({payload:ie.lazy(()=>av),terminator:ie.string().optional()}).extend(Dd).extend(gI);var kLn=ie.union("type",{json:L4o,text:U4o,sse:V4o}).transform({transform:e=>{switch(e.type){case"json":return mL.json(e);case"text":return mL.text(e);case"sse":return mL.sse(e);default:return e}},untransform:({_visit:e,...t})=>t});var W4o=ie.union("type",{json:ie.object({value:KLn}),fileDownload:YLn,text:XLn,bytes:ZLn}).transform({transform:e=>{switch(e.type){case"json":return _H.json(e.value);case"fileDownload":return _H.fileDownload(e);case"text":return _H.text(e);case"bytes":return _H.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var H4o=ie.objectWithoutOptionalProperties({nonStreamResponse:W4o,streamResponse:kLn});var $4o=ie.union("type",{json:ie.object({value:KLn}),fileDownload:YLn,text:XLn,bytes:ZLn,streaming:ie.object({value:kLn}),streamParameter:H4o}).transform({transform:e=>{switch(e.type){case"json":return c1.json(e.value);case"fileDownload":return c1.fileDownload(e);case"text":return c1.text(e);case"bytes":return c1.bytes(e);case"streaming":return c1.streaming(e.value);case"streamParameter":return c1.streamParameter(e);default:return e}},untransform:({_visit:e,...t})=>t});var eUn=ie.objectWithoutOptionalProperties({statusCode:ie.property("status-code",ie.number().optional()),body:$4o.optional()});var G4o=ie.objectWithoutOptionalProperties({responses:ie.list(eUn).optional()});var Q4o=ie.objectWithoutOptionalProperties({error:pzi}).extend(Dd);var J4o=ie.list(Q4o);var K4o=ie.objectWithoutOptionalProperties({page:qJ,next:EL,results:EL});var Y4o=ie.objectWithoutOptionalProperties({page:qJ,results:EL,hasNextPage:EL.optional(),step:qJ.optional()});var X4o=ie.objectWithoutOptionalProperties({results:EL});var Z4o=ie.union("type",{cursor:K4o,offset:Y4o,custom:X4o}).transform({transform:e=>{switch(e.type){case"cursor":return EJ.cursor(e);case"offset":return EJ.offset(e);case"custom":return EJ.custom(e);default:return e}},untransform:({_visit:e,...t})=>t});var k4o=ie.objectWithoutOptionalProperties({name:Sd.optional(),language:ie.string(),code:ie.string(),install:ie.string().optional()}).extend(Dd);var e2o=ie.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java"]);var t2o=ie.objectWithoutOptionalProperties({name:Sd.optional(),sdk:e2o,code:ie.string()}).extend(Dd);var r2o=ie.union("type",{language:k4o,sdk:t2o}).transform({transform:e=>{switch(e.type){case"language":return pAe.language(e);case"sdk":return pAe.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var _zi=ie.objectWithoutOptionalProperties({name:Sd,value:ie.lazyObject(()=>Sm)});var Cen=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm)});var i2o=ie.union("type",{single:ie.object({}),exploded:ie.object({}),commaSeparated:ie.object({})}).transform({transform:e=>{switch(e.type){case"single":return q8.single();case"exploded":return q8.exploded();case"commaSeparated":return q8.commaSeparated();default:return e}},untransform:({_visit:e,...t})=>t});var tUn=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm),shape:i2o.optional()});var n2o=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm),originalTypeDeclaration:OI.optional()});var rUn=ie.objectWithoutOptionalProperties({properties:ie.list(n2o)}).extend($rr);var a2o=ie.union("type",{inlinedRequestBody:rUn,reference:ie.lazyObject(()=>Sm)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return MJ.inlinedRequestBody(e);case"reference":return MJ.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var o2o=ie.objectWithoutOptionalProperties({event:ie.string(),data:ie.lazyObject(()=>Sm)});var u2o=ie.union("type",{body:ie.object({value:ie.lazyObject(()=>Sm).optional()}),stream:ie.object({value:ie.list(ie.lazyObject(()=>Sm))}),sse:ie.object({value:ie.list(o2o)})}).transform({transform:e=>{switch(e.type){case"body":return NB.body(e.value);case"stream":return NB.stream(e.value);case"sse":return NB.sse(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var s2o=ie.objectWithoutOptionalProperties({error:pzi,body:ie.lazyObject(()=>Sm).optional()});var c2o=ie.union("type",{ok:ie.object({value:u2o}),error:s2o}).transform({transform:e=>{switch(e.type){case"ok":return gC.ok(e.value);case"error":return gC.error(e);default:return e}},untransform:({_visit:e,...t})=>t});var iUn=ie.objectWithoutOptionalProperties({id:ie.string().optional(),name:Sd.optional(),url:ie.string(),rootPathParameters:ie.list(_zi),servicePathParameters:ie.list(_zi),endpointPathParameters:ie.list(_zi),serviceHeaders:ie.list(Cen),endpointHeaders:ie.list(Cen),queryParameters:ie.list(tUn),request:a2o.optional(),response:c2o}).extend(Dd);var l2o=ie.objectWithoutOptionalProperties({codeSamples:ie.list(r2o).optional(),example:iUn.optional()});var f2o=ie.objectWithoutOptionalProperties({example:iUn});var d2o=ie.objectWithoutOptionalProperties({namespace:ie.string()});var p2o=ie.objectWithoutOptionalProperties({csharp:d2o.optional()});var nUn=ie.objectWithoutOptionalProperties({filepath:ie.string(),packageName:ie.string().optional(),options:p2o.optional()});var _2o=ie.objectWithoutOptionalProperties({file:nUn,name:Sd});var h2o=ie.objectWithoutOptionalProperties({service:_2o});var aUn=ie.union("type",{http:ie.object({}),grpc:h2o}).transform({transform:e=>{switch(e.type){case"http":return WNe.http();case"grpc":return WNe.grpc(e);default:return e}},untransform:({_visit:e,...t})=>t});var y2o=ie.enum_(["UNARY","CLIENT_STREAM","SERVER_STREAM","BIDIRECTIONAL_STREAM"]);var v2o=ie.objectWithoutOptionalProperties({methodType:y2o.optional()});var b2o=ie.union("type",{proto:v2o,openapi:ie.object({}),openrpc:ie.object({})}).transform({transform:e=>{switch(e.type){case"proto":return DJ.proto(e);case"openapi":return DJ.openapi();case"openrpc":return DJ.openrpc();default:return e}},untransform:({_visit:e,...t})=>t});var g2o=ie.objectWithoutOptionalProperties({id:J$t,name:j4o,displayName:ie.string().optional(),method:MLn,headers:ie.list(Tk),baseUrl:qk.optional(),v2BaseUrls:ie.list(qk).optional(),basePath:KNe.optional(),path:KNe,fullPath:KNe,pathParameters:ie.list(K$t),allPathParameters:ie.list(K$t),queryParameters:ie.list(czi),requestBody:JLn.optional(),v2RequestBodies:B4o.optional(),sdkRequest:x4o.optional(),response:eUn.optional(),v2Responses:G4o.optional(),errors:J4o,auth:ie.boolean(),idempotent:ie.boolean(),pagination:Z4o.optional(),userSpecifiedExamples:ie.list(l2o),autogeneratedExamples:ie.list(f2o),v2Examples:H6o.optional(),transport:aUn.optional(),source:b2o.optional(),audiences:ie.list(jLn).optional()}).extend(j4);var O2o=ie.objectWithoutOptionalProperties({});var m2o=ie.objectWithoutOptionalProperties({});var oUn=ie.objectWithoutOptionalProperties({json:O2o.optional(),proto:m2o.optional()});var P2o=ie.objectWithoutOptionalProperties({availability:Hrr.optional(),name:m4o,displayName:ie.string().optional(),basePath:KNe,endpoints:ie.list(g2o),headers:ie.list(Tk),pathParameters:ie.list(K$t),encoding:oUn.optional(),transport:aUn.optional(),audiences:ie.list(jLn).optional()});var _tc={};Po(_tc,{ApiDefinitionSource:()=>x8o,ApiDefinitionSourceId:()=>z8o,ApiVersionScheme:()=>w2o,ErrorDiscriminationByPropertyStrategy:()=>E8o,ErrorDiscriminationStrategy:()=>M8o,HeaderApiVersionScheme:()=>j2o,IntermediateRepresentation:()=>NEp,Package:()=>dUn,PackageNavigationConfig:()=>S8o,PlatformHeaders:()=>q8o,ProtoSource:()=>R8o,ReadmeConfig:()=>I8o,SdkConfig:()=>T8o,ServiceTypeReferenceInfo:()=>B8o,SourceConfig:()=>N8o,Subpackage:()=>D8o,UserAgent:()=>A8o});var oOi=ie.objectWithoutOptionalProperties({name:Gh}).extend(j4);var uUn=ie.objectWithoutOptionalProperties({default:oOi.optional(),values:ie.list(oOi)});var j2o=ie.objectWithoutOptionalProperties({header:Tk,value:uUn});var w2o=ie.union("type",{header:j2o}).transform({transform:e=>{switch(e.type){case"header":return azi.header(e);default:return e}},untransform:({_visit:e,...t})=>t});var S2o=ie.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"]);var D2o=ie.objectWithoutOptionalProperties({name:OI,shape:S2o});var E2o=ie.objectWithoutOptionalProperties({min:ie.number().optional(),max:ie.number().optional(),exclusiveMin:ie.boolean().optional(),exclusiveMax:ie.boolean().optional(),multipleOf:ie.number().optional()});var M2o=ie.objectWithoutOptionalProperties({default:ie.number().optional(),validation:E2o.optional()});var A2o=ie.objectWithoutOptionalProperties({default:ie.number().optional()});var q2o=ie.objectWithoutOptionalProperties({});var T2o=ie.objectWithoutOptionalProperties({});var C2o=ie.objectWithoutOptionalProperties({});var B2o=ie.objectWithoutOptionalProperties({min:ie.number().optional(),max:ie.number().optional(),exclusiveMin:ie.boolean().optional(),exclusiveMax:ie.boolean().optional(),multipleOf:ie.number().optional()});var I2o=ie.objectWithoutOptionalProperties({default:ie.number().optional(),validation:B2o.optional()});var z2o=ie.objectWithoutOptionalProperties({default:ie.boolean().optional()});var R2o=ie.objectWithoutOptionalProperties({format:ie.string().optional(),pattern:ie.string().optional(),minLength:ie.number().optional(),maxLength:ie.number().optional()});var x2o=ie.objectWithoutOptionalProperties({default:ie.string().optional(),validation:R2o.optional()});var N2o=ie.objectWithoutOptionalProperties({});var F2o=ie.objectWithoutOptionalProperties({});var L2o=ie.objectWithoutOptionalProperties({});var U2o=ie.objectWithoutOptionalProperties({});var V2o=ie.objectWithoutOptionalProperties({default:ie.string().optional()});var W2o=ie.union("type",{integer:M2o,long:A2o,uint:q2o,uint64:T2o,float:C2o,double:I2o,boolean:z2o,string:x2o,date:N2o,dateTime:F2o,uuid:L2o,base64:U2o,bigInteger:V2o}).transform({transform:e=>{switch(e.type){case"integer":return Td.integer(e);case"long":return Td.long(e);case"uint":return Td.uint(e);case"uint64":return Td.uint64(e);case"float":return Td.float(e);case"double":return Td.double(e);case"boolean":return Td.boolean(e);case"string":return Td.string(e);case"date":return Td.date(e);case"dateTime":return Td.dateTime(e);case"uuid":return Td.uuid(e);case"base64":return Td.base64(e);case"bigInteger":return Td.bigInteger(e);default:return e}},untransform:({_visit:e,...t})=>t});var sUn=ie.objectWithoutOptionalProperties({v1:BLn,v2:W2o.optional()});var H2o=ie.union(ie.discriminant("type","_type"),{container:ie.object({container:ie.lazy(()=>cUn)}),named:D2o,primitive:ie.object({primitive:sUn}),unknown:ie.object({})}).transform({transform:e=>{switch(e.type){case"container":return hH.container(e.container);case"named":return hH.named(e);case"primitive":return hH.primitive(e.primitive);case"unknown":return hH.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var $2o=ie.objectWithoutOptionalProperties({aliasOf:ie.lazy(()=>av),resolvedType:H2o});var G2o=ie.objectWithoutOptionalProperties({extends:ie.list(OI),properties:ie.list(Ak),extendedProperties:ie.list(Ak).optional(),extraProperties:ie.property("extra-properties",ie.boolean())});var Q2o=ie.objectWithoutOptionalProperties({name:Gh,type:ie.lazy(()=>av)});var J2o=ie.union(ie.discriminant("propertiesType","_type"),{samePropertiesAsObject:OI,singleProperty:Q2o,noProperties:ie.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return PL.samePropertiesAsObject(e);case"singleProperty":return PL.singleProperty(e);case"noProperties":return PL.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var K2o=ie.objectWithoutOptionalProperties({discriminantValue:Gh,shape:J2o,displayName:ie.string().optional(),availability:Hrr.optional()}).extend(Dd);var Y2o=ie.objectWithoutOptionalProperties({discriminant:Gh,extends:ie.list(OI),types:ie.list(K2o),baseProperties:ie.list(Ak)});var X2o=ie.objectWithoutOptionalProperties({type:ie.lazy(()=>av)}).extend(Dd);var Z2o=ie.objectWithoutOptionalProperties({members:ie.list(X2o)});var k2o=ie.union(ie.discriminant("type","_type"),{alias:$2o,enum:uUn,object:G2o,union:Y2o,undiscriminatedUnion:Z2o}).transform({transform:e=>{switch(e.type){case"alias":return Vb.alias(e);case"enum":return Vb.enum(e);case"object":return Vb.object(e);case"union":return Vb.union(e);case"undiscriminatedUnion":return Vb.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var gNa=ie.objectWithoutOptionalProperties({name:Sd.optional(),shape:ie.lazy(()=>lUn)}).extend($rr).extend(Dd);var e8o=ie.union("type",{any:ie.object({}),api:ie.object({}),boolValue:ie.object({}),bytesValue:ie.object({}),doubleValue:ie.object({}),duration:ie.object({}),empty:ie.object({}),enum:ie.object({}),enumValue:ie.object({}),field:ie.object({}),fieldCardinality:ie.object({}),fieldKind:ie.object({}),fieldMask:ie.object({}),floatValue:ie.object({}),int32Value:ie.object({}),int64Value:ie.object({}),listValue:ie.object({}),method:ie.object({}),mixin:ie.object({}),nullValue:ie.object({}),option:ie.object({}),sourceContext:ie.object({}),stringValue:ie.object({}),struct:ie.object({}),syntax:ie.object({}),timestamp:ie.object({}),type:ie.object({}),uint32Value:ie.object({}),uint64Value:ie.object({}),value:ie.object({})}).transform({transform:e=>{switch(e.type){case"any":return od.any();case"api":return od.api();case"boolValue":return od.boolValue();case"bytesValue":return od.bytesValue();case"doubleValue":return od.doubleValue();case"duration":return od.duration();case"empty":return od.empty();case"enum":return od.enum();case"enumValue":return od.enumValue();case"field":return od.field();case"fieldCardinality":return od.fieldCardinality();case"fieldKind":return od.fieldKind();case"fieldMask":return od.fieldMask();case"floatValue":return od.floatValue();case"int32Value":return od.int32Value();case"int64Value":return od.int64Value();case"listValue":return od.listValue();case"method":return od.method();case"mixin":return od.mixin();case"nullValue":return od.nullValue();case"option":return od.option();case"sourceContext":return od.sourceContext();case"stringValue":return od.stringValue();case"struct":return od.struct();case"syntax":return od.syntax();case"timestamp":return od.timestamp();case"type":return od.type();case"uint32Value":return od.uint32Value();case"uint64Value":return od.uint64Value();case"value":return od.value();default:return e}},untransform:({_visit:e,...t})=>t});var t8o=ie.objectWithoutOptionalProperties({file:nUn,name:Sd});var r8o=ie.union("type",{wellKnown:ie.object({value:e8o}),userDefined:t8o}).transform({transform:e=>{switch(e.type){case"wellKnown":return mw.wellKnown(e.value);case"userDefined":return mw.userDefined(e);default:return e}},untransform:({_visit:e,...t})=>t});var i8o=ie.union("type",{proto:ie.object({value:r8o})}).transform({transform:e=>{switch(e.type){case"proto":return aOi.proto(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var n8o=ie.objectWithoutOptionalProperties({name:OI,shape:k2o,autogeneratedExamples:ie.list(gNa),userProvidedExamples:ie.list(gNa),v2Examples:DL.optional(),referencedTypes:ie.set(Gx),encoding:oUn.optional(),source:i8o.optional(),inline:ie.boolean().optional()}).extend(j4);var a8o=Sd;var o8o=ie.enum_(["GET","POST"]);var u8o=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av)}).extend(lzi);var s8o=ie.objectWithoutOptionalProperties({name:Sd,extends:ie.list(OI),properties:ie.list(u8o)});var c8o=ie.objectWithoutOptionalProperties({payloadType:ie.lazy(()=>av)}).extend(Dd);var l8o=ie.union("type",{inlinedPayload:s8o,reference:c8o}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return yH.inlinedPayload(e);case"reference":return yH.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var f8o=ie.objectWithoutOptionalProperties({name:Sd.optional(),payload:ie.lazyObject(()=>Sm)}).extend(Dd);var d8o=ie.objectWithoutOptionalProperties({id:M7o,name:a8o,displayName:ie.string().optional(),method:o8o,headers:ie.list(Tk),payload:l8o,examples:ie.list(f8o).optional(),v2Examples:J6o.optional()}).extend(j4);var p8o=ie.list(d8o);var _8o=Sd;var fUn=ie.string();var h8o=ie.enum_(["client","server"]);var y8o=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av)}).extend(lzi);var v8o=ie.objectWithoutOptionalProperties({name:Sd,extends:ie.list(OI),properties:ie.list(y8o)});var b8o=ie.objectWithoutOptionalProperties({bodyType:ie.lazy(()=>av)}).extend(Dd);var g8o=ie.union("type",{inlinedBody:v8o,reference:b8o}).transform({transform:e=>{switch(e.type){case"inlinedBody":return wL.inlinedBody(e);case"reference":return wL.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var O8o=ie.objectWithoutOptionalProperties({type:fUn,displayName:ie.string().optional(),origin:h8o,body:g8o}).extend(j4);var m8o=ie.union("type",{inlinedBody:rUn,reference:ie.lazyObject(()=>Sm)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return hAe.inlinedBody(e);case"reference":return hAe.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var P8o=ie.objectWithoutOptionalProperties({type:fUn,body:m8o});var j8o=ie.objectWithoutOptionalProperties({name:Sd.optional(),url:ie.string(),pathParameters:ie.list(_zi),headers:ie.list(Cen),queryParameters:ie.list(tUn),messages:ie.list(P8o)}).extend(Dd);var w8o=ie.objectWithoutOptionalProperties({name:_8o,displayName:ie.string().optional(),baseUrl:qk.optional(),path:KNe,auth:ie.boolean(),headers:ie.list(Tk),queryParameters:ie.list(czi),pathParameters:ie.list(K$t),messages:ie.list(O8o),examples:ie.list(j8o),v2Examples:Q6o.optional()}).extend(j4);var S8o=ie.objectWithoutOptionalProperties({pointsTo:Wrr});var dUn=ie.objectWithoutOptionalProperties({fernFilepath:ooe,service:Vrr.optional(),types:ie.list(Gx),errors:ie.list(dzi),webhooks:DLn.optional(),websocket:ELn.optional(),subpackages:ie.list(Wrr),hasEndpointsInTree:ie.boolean(),navigationConfig:S8o.optional()}).extend(Dd);var D8o=ie.objectWithoutOptionalProperties({name:Sd,displayName:fzi.optional()}).extend(dUn);var E8o=ie.objectWithoutOptionalProperties({discriminant:Gh,contentProperty:Gh});var M8o=ie.union("type",{statusCode:ie.object({}),property:E8o}).transform({transform:e=>{switch(e.type){case"statusCode":return _Ae.statusCode();case"property":return _Ae.property(e);default:return e}},untransform:({_visit:e,...t})=>t});var A8o=ie.objectWithoutOptionalProperties({header:ie.stringLiteral("User-Agent"),value:ie.string()});var q8o=ie.objectWithoutOptionalProperties({language:ie.string(),sdkName:ie.string(),sdkVersion:ie.string(),userAgent:A8o.optional()});var T8o=ie.objectWithoutOptionalProperties({isAuthMandatory:ie.boolean(),hasStreamingEndpoints:ie.boolean(),hasPaginatedEndpoints:ie.boolean(),hasFileDownloadEndpoints:ie.boolean(),platformHeaders:q8o});var C8o=ie.objectWithoutOptionalProperties({id:HLn,name:Sd,type:ie.lazy(()=>av)}).extend(Dd);var B8o=ie.objectWithoutOptionalProperties({typesReferencedOnlyByService:ie.record(Vrr,ie.list(Gx)),sharedTypes:ie.list(Gx)});var I8o=ie.objectWithoutOptionalProperties({defaultEndpoint:J$t.optional(),bannerLink:ie.string().optional(),introduction:ie.string().optional(),apiReferenceLink:ie.string().optional(),apiName:ie.string().optional(),disabledFeatures:ie.set(hNa).optional(),whiteLabel:ie.boolean().optional(),features:ie.record(hNa,ie.list(J$t)).optional()});var z8o=ie.string();var R8o=ie.objectWithoutOptionalProperties({id:z8o,protoRootUrl:ie.string()});var x8o=ie.union("type",{proto:R8o,openapi:ie.object({})}).transform({transform:e=>{switch(e.type){case"proto":return noe.proto(e);case"openapi":return noe.openapi();default:return e}},untransform:({_visit:e,...t})=>t});var N8o=ie.objectWithoutOptionalProperties({sources:ie.list(x8o)});var F8o=ie.objectWithoutOptionalProperties({apiKey:ie.string(),workspaceId:ie.string(),collectionId:ie.string().optional()});var L8o=ie.objectWithoutOptionalProperties({version:ie.string().optional(),packageName:ie.string().optional(),tokenEnvironmentVariable:ie.string()});var U8o=ie.objectWithoutOptionalProperties({coordinate:ie.string().optional(),version:ie.string().optional(),usernameEnvironmentVariable:ie.string(),passwordEnvironmentVariable:ie.string(),mavenUrlEnvironmentVariable:ie.string()});var V8o=ie.objectWithoutOptionalProperties({version:ie.string().optional(),packageName:ie.string().optional()});var hzi=ie.union("type",{postman:F8o,npm:L8o,maven:U8o,pypi:V8o}).transform({transform:e=>{switch(e.type){case"postman":return aoe.postman(e);case"npm":return aoe.npm(e);case"maven":return aoe.maven(e);case"pypi":return aoe.pypi(e);default:return e}},untransform:({_visit:e,...t})=>t});var W8o=ie.objectWithoutOptionalProperties({owner:ie.string(),repo:ie.string(),uri:ie.string().optional(),token:ie.string().optional(),target:hzi});var H8o=ie.objectWithoutOptionalProperties({target:hzi});var $8o=ie.objectWithoutOptionalProperties({generateFullProject:ie.boolean(),publishTarget:hzi.optional()});var G8o=ie.union("type",{github:W8o,direct:H8o,filesystem:$8o}).transform({transform:e=>{switch(e.type){case"github":return Lrr.github(e);case"direct":return Lrr.direct(e);case"filesystem":return Lrr.filesystem(e);default:return e}},untransform:({_visit:e,...t})=>t});var NEp=ie.objectWithoutOptionalProperties({fdrApiDefinitionId:ie.string().optional(),apiVersion:w2o.optional(),apiName:Sd,apiDisplayName:ie.string().optional(),apiDocs:ie.string().optional(),auth:D7o,headers:ie.list(Tk),idempotencyHeaders:ie.list(Tk),types:ie.record(Gx,n8o),services:ie.record(Vrr,P2o),webhookGroups:ie.record(DLn,p8o),websocketChannels:ie.record(ELn,w8o).optional(),errors:ie.record(dzi,C6o),subpackages:ie.record(Wrr,D8o),rootPackage:dUn,constants:A7o,environments:CLn.optional(),basePath:KNe.optional(),pathParameters:ie.list(K$t),errorDiscriminationStrategy:M8o,sdkConfig:T8o,variables:ie.list(C8o),serviceTypeReferenceInfo:B8o,readmeConfig:I8o.optional(),sourceConfig:N8o.optional(),publishConfig:G8o.optional(),dynamic:E6o.optional(),selfHosted:ie.boolean().optional(),audiences:ie.list(s7o).optional()});var htc={};Po(htc,{CsharpProtobufFileOptions:()=>d2o,ProtobufFile:()=>nUn,ProtobufFileOptions:()=>p2o,ProtobufMethodType:()=>y2o,ProtobufService:()=>_2o,ProtobufType:()=>r8o,UserDefinedProtobufType:()=>t8o,WellKnownProtobufType:()=>e8o});var ytc={};Po(ytc,{DirectPublish:()=>H8o,Filesystem:()=>$8o,GithubPublish:()=>W8o,MavenPublishTarget:()=>U8o,NpmPublishTarget:()=>L8o,PostmanPublishTarget:()=>F8o,PublishTarget:()=>hzi,PublishingConfig:()=>G8o,PypiPublishTarget:()=>V8o});var vtc={};Po(vtc,{AliasTypeDeclaration:()=>$2o,Base64Type:()=>U2o,BigIntegerType:()=>V2o,BooleanType:()=>z2o,ContainerType:()=>cUn,DateTimeType:()=>F2o,DateType:()=>N2o,DeclaredTypeName:()=>OI,DoubleType:()=>I2o,DoubleValidationRules:()=>B2o,Encoding:()=>oUn,EnumTypeDeclaration:()=>uUn,EnumTypeReference:()=>FEp,EnumValue:()=>oOi,ExampleAliasType:()=>Z8o,ExampleContainer:()=>u5o,ExampleDatetime:()=>o5o,ExampleEnumType:()=>X8o,ExampleKeyValuePair:()=>h5o,ExampleListContainer:()=>l5o,ExampleLiteralContainer:()=>c5o,ExampleMapContainer:()=>_5o,ExampleNamedType:()=>s5o,ExampleNullableContainer:()=>p5o,ExampleObjectProperty:()=>t5o,ExampleObjectType:()=>pUn,ExampleObjectTypeWithTypeId:()=>n5o,ExampleOptionalContainer:()=>d5o,ExamplePrimitive:()=>_Un,ExampleSetContainer:()=>f5o,ExampleSingleUnionType:()=>r5o,ExampleSingleUnionTypeProperties:()=>i5o,ExampleType:()=>gNa,ExampleTypeReference:()=>Sm,ExampleTypeReferenceShape:()=>a5o,ExampleTypeShape:()=>lUn,ExampleUndiscriminatedUnionType:()=>e5o,ExampleUnionType:()=>k8o,FloatType:()=>C2o,IntegerType:()=>M2o,IntegerValidationRules:()=>E2o,JsonEncoding:()=>O2o,Literal:()=>K8o,LongType:()=>A2o,MapType:()=>Y8o,NamedType:()=>J8o,NamedTypeDefault:()=>Q8o,ObjectProperty:()=>Ak,ObjectPropertyAccess:()=>wLn,ObjectTypeDeclaration:()=>G2o,PrimitiveType:()=>sUn,PrimitiveTypeV1:()=>BLn,PrimitiveTypeV2:()=>W2o,ProtoEncoding:()=>m2o,ResolvedNamedType:()=>D2o,ResolvedTypeReference:()=>H2o,ShapeType:()=>S2o,SingleUnionType:()=>K2o,SingleUnionTypeProperties:()=>J2o,SingleUnionTypeProperty:()=>Q2o,Source:()=>i8o,StringType:()=>x2o,StringValidationRules:()=>R2o,Type:()=>k2o,TypeDeclaration:()=>n8o,TypeReference:()=>av,Uint64Type:()=>T2o,UintType:()=>q2o,UndiscriminatedUnionMember:()=>X2o,UndiscriminatedUnionTypeDeclaration:()=>Z2o,UnionTypeDeclaration:()=>Y2o,UuidType:()=>L2o});var Q8o=ie.union("type",{enum:oOi}).transform({transform:e=>{switch(e.type){case"enum":return gLn.enum(e);default:return e}},untransform:({_visit:e,...t})=>t});var J8o=ie.objectWithoutOptionalProperties({typeId:Gx,fernFilepath:ooe,name:Sd,displayName:fzi.optional(),default:Q8o.optional(),inline:ie.boolean().optional()});var av=ie.union(ie.discriminant("type","_type"),{container:ie.object({container:ie.lazy(()=>cUn)}),named:J8o,primitive:ie.object({primitive:sUn}),unknown:ie.object({})}).transform({transform:e=>{switch(e.type){case"container":return Xc.container(e.container);case"named":return Xc.named(e);case"primitive":return Xc.primitive(e.primitive);case"unknown":return Xc.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var FEp=ie.objectWithoutOptionalProperties({default:oOi.optional(),name:OI});var K8o=ie.union("type",{string:ie.object({string:ie.string()}),boolean:ie.object({boolean:ie.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return jL.string(e.string);case"boolean":return jL.boolean(e.boolean);default:return e}},untransform:({_visit:e,...t})=>t});var cUn=ie.union(ie.discriminant("type","_type"),{list:ie.object({list:ie.lazy(()=>av)}),map:ie.lazyObject(()=>Y8o),nullable:ie.object({nullable:ie.lazy(()=>av)}),optional:ie.object({optional:ie.lazy(()=>av)}),set:ie.object({set:ie.lazy(()=>av)}),literal:ie.object({literal:K8o})}).transform({transform:e=>{switch(e.type){case"list":return Ry.list(e.list);case"map":return Ry.map(e);case"nullable":return Ry.nullable(e.nullable);case"optional":return Ry.optional(e.optional);case"set":return Ry.set(e.set);case"literal":return Ry.literal(e.literal);default:return e}},untransform:({_visit:e,...t})=>t});var Y8o=ie.objectWithoutOptionalProperties({keyType:ie.lazy(()=>av),valueType:ie.lazy(()=>av)});var X8o=ie.objectWithoutOptionalProperties({value:Gh});var lUn=ie.union("type",{alias:ie.lazyObject(()=>Z8o),enum:X8o,object:ie.lazyObject(()=>pUn),union:ie.lazyObject(()=>k8o),undiscriminatedUnion:ie.lazyObject(()=>e5o)}).transform({transform:e=>{switch(e.type){case"alias":return l1.alias(e);case"enum":return l1.enum(e);case"object":return l1.object(e);case"union":return l1.union(e);case"undiscriminatedUnion":return l1.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var Z8o=ie.objectWithoutOptionalProperties({value:ie.lazyObject(()=>Sm)});var pUn=ie.objectWithoutOptionalProperties({properties:ie.list(ie.lazyObject(()=>t5o))});var t5o=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm),originalTypeDeclaration:OI});var k8o=ie.objectWithoutOptionalProperties({discriminant:Gh,singleUnionType:ie.lazyObject(()=>r5o)});var e5o=ie.objectWithoutOptionalProperties({index:ie.number(),singleUnionType:ie.lazyObject(()=>Sm)});var r5o=ie.objectWithoutOptionalProperties({wireDiscriminantValue:Gh,shape:ie.lazy(()=>i5o)});var i5o=ie.union("type",{samePropertiesAsObject:ie.lazyObject(()=>n5o),singleProperty:ie.lazyObject(()=>Sm),noProperties:ie.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return K3.samePropertiesAsObject(e);case"singleProperty":return K3.singleProperty(e);case"noProperties":return K3.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var Sm=ie.objectWithoutOptionalProperties({shape:ie.lazy(()=>a5o)}).extend($rr);var o5o=ie.objectWithoutOptionalProperties({datetime:ie.date(),raw:ie.string().optional()});var _Un=ie.union("type",{integer:ie.object({integer:ie.number()}),long:ie.object({long:ie.number()}),uint:ie.object({uint:ie.number()}),uint64:ie.object({uint64:ie.number()}),float:ie.object({float:ie.number()}),double:ie.object({double:ie.number()}),boolean:ie.object({boolean:ie.boolean()}),string:ie.object({string:E7o}),date:ie.object({date:ie.string()}),datetime:o5o,uuid:ie.object({uuid:ie.string()}),base64:ie.object({base64:ie.string()}),bigInteger:ie.object({bigInteger:ie.string()})}).transform({transform:e=>{switch(e.type){case"integer":return Vd.integer(e.integer);case"long":return Vd.long(e.long);case"uint":return Vd.uint(e.uint);case"uint64":return Vd.uint64(e.uint64);case"float":return Vd.float(e.float);case"double":return Vd.double(e.double);case"boolean":return Vd.boolean(e.boolean);case"string":return Vd.string(e.string);case"date":return Vd.date(e.date);case"datetime":return Vd.datetime(e);case"uuid":return Vd.uuid(e.uuid);case"base64":return Vd.base64(e.base64);case"bigInteger":return Vd.bigInteger(e.bigInteger);default:return e}},untransform:({_visit:e,...t})=>t});var a5o=ie.union("type",{primitive:ie.object({primitive:_Un}),container:ie.object({container:ie.lazy(()=>u5o)}),unknown:ie.object({unknown:ie.unknown()}),named:ie.lazyObject(()=>s5o)}).transform({transform:e=>{switch(e.type){case"primitive":return ay.primitive(e.primitive);case"container":return ay.container(e.container);case"unknown":return ay.unknown(e.unknown);case"named":return ay.named(e);default:return e}},untransform:({_visit:e,...t})=>t});var c5o=ie.objectWithoutOptionalProperties({literal:_Un});var u5o=ie.union("type",{list:ie.lazyObject(()=>l5o),set:ie.lazyObject(()=>f5o),optional:ie.lazyObject(()=>d5o),nullable:ie.lazyObject(()=>p5o),map:ie.lazyObject(()=>_5o),literal:c5o}).transform({transform:e=>{switch(e.type){case"list":return Wm.list(e);case"set":return Wm.set(e);case"optional":return Wm.optional(e);case"nullable":return Wm.nullable(e);case"map":return Wm.map(e);case"literal":return Wm.literal(e);default:return e}},untransform:({_visit:e,...t})=>t});var l5o=ie.objectWithoutOptionalProperties({list:ie.list(ie.lazyObject(()=>Sm)),itemType:ie.lazy(()=>av)});var f5o=ie.objectWithoutOptionalProperties({set:ie.list(ie.lazyObject(()=>Sm)),itemType:ie.lazy(()=>av)});var d5o=ie.objectWithoutOptionalProperties({optional:ie.lazyObject(()=>Sm).optional(),valueType:ie.lazy(()=>av)});var p5o=ie.objectWithoutOptionalProperties({nullable:ie.lazyObject(()=>Sm).optional(),valueType:ie.lazy(()=>av)});var _5o=ie.objectWithoutOptionalProperties({map:ie.list(ie.lazyObject(()=>h5o)),keyType:ie.lazy(()=>av),valueType:ie.lazy(()=>av)});var h5o=ie.objectWithoutOptionalProperties({key:ie.lazyObject(()=>Sm),value:ie.lazyObject(()=>Sm)});var s5o=ie.objectWithoutOptionalProperties({typeName:OI,shape:ie.lazy(()=>lUn)});var n5o=ie.objectWithoutOptionalProperties({typeId:Gx,object:ie.lazyObject(()=>pUn)});var btc={};Po(btc,{VariableDeclaration:()=>C8o,VariableId:()=>HLn});var gtc={};Po(gtc,{ExampleWebhookCall:()=>f8o,InlinedWebhookPayload:()=>s8o,InlinedWebhookPayloadProperty:()=>u8o,Webhook:()=>d8o,WebhookGroup:()=>p8o,WebhookHttpMethod:()=>o8o,WebhookName:()=>a8o,WebhookPayload:()=>l8o,WebhookPayloadReference:()=>c8o});var Otc={};Po(Otc,{ExampleWebSocketMessage:()=>P8o,ExampleWebSocketMessageBody:()=>m8o,ExampleWebSocketSession:()=>j8o,InlinedWebSocketMessageBody:()=>v8o,InlinedWebSocketMessageBodyProperty:()=>y8o,WebSocketChannel:()=>w8o,WebSocketMessage:()=>O8o,WebSocketMessageBody:()=>g8o,WebSocketMessageBodyReference:()=>b8o,WebSocketMessageId:()=>fUn,WebSocketMessageOrigin:()=>h8o,WebSocketName:()=>_8o});var Ck={integer:"integer",long:"long",uint:"uint",uint64:"uint64",float:"float",double:"double",boolean:"boolean",string:"string",datetime:"datetime",base64:"base64",uuid:"uuid",date:"date",bigint:"bigint",unknown:"unknown"};var uoe={MAP:/^map<\s*([^,]*)\s*,\s*(.*)\s*>$/,LIST:/^list<\s*(.*)\s*>$/,SET:/^set<\s*(.*)\s*>$/,OPTIONAL:/^optional<\s*(.*)\s*>$/,NULLABLE:/^nullable<\s*(.*)\s*>$/,LITERAL:/^literal<\s*(?:"(.*)"|(true|false))\s*>$/};function Ben({type:e,_default:t,validation:r,visitor:i}){switch(e){case Ck.integer:{let o=r??void 0;return i.primitive({v1:ny.Integer,v2:Td.integer({default:t??void 0,validation:o!=null?{min:o.min,max:o.max,exclusiveMin:o.exclusiveMin,exclusiveMax:o.exclusiveMax,multipleOf:o.multipleOf}:void 0})})}case Ck.double:{let o=r??void 0;return i.primitive({v1:ny.Double,v2:Td.double({default:t??void 0,validation:o!=null?{min:o.min,max:o.max,exclusiveMin:o.exclusiveMin,exclusiveMax:o.exclusiveMax,multipleOf:o.multipleOf}:void 0})})}case Ck.string:{let o=r??void 0;return i.primitive({v1:ny.String,v2:Td.string({default:t??void 0,validation:o!=null?{format:o.format,pattern:o.pattern,minLength:o.minLength,maxLength:o.maxLength}:void 0})})}case Ck.float:return i.primitive({v1:ny.Float,v2:void 0});case Ck.long:return i.primitive({v1:ny.Long,v2:Td.long({default:t??void 0})});case Ck.boolean:return i.primitive({v1:ny.Boolean,v2:Td.boolean({default:t??void 0})});case Ck.datetime:return i.primitive({v1:ny.DateTime,v2:void 0});case Ck.date:return i.primitive({v1:ny.Date,v2:void 0});case Ck.uuid:return i.primitive({v1:ny.Uuid,v2:void 0});case Ck.base64:return i.primitive({v1:ny.Base64,v2:void 0});case Ck.bigint:return i.primitive({v1:ny.BigInteger,v2:Td.bigInteger({default:t??void 0})});case Ck.uint:return i.primitive({v1:ny.Uint,v2:void 0});case Ck.uint64:return i.primitive({v1:ny.Uint64,v2:void 0});case Ck.unknown:return i.unknown()}let n=e.match(uoe.MAP);if(n?.[1]!=null&&n[2]!=null)return i.map({keyType:n[1],valueType:n[2]});let a=e.match(uoe.LIST);if(a?.[1]!=null)return i.list(a[1]);let u=e.match(uoe.SET);if(u?.[1]!=null)return i.set(u[1]);let l=e.match(uoe.OPTIONAL);if(l?.[1]!=null)return i.optional(l[1]);let d=e.match(uoe.NULLABLE);if(d?.[1]!=null)return i.nullable(d[1]);let s=e.match(uoe.LITERAL);if(s?.[1]!=null)return i.literal(jL.string(s[1]));if(s?.[2]!=null){let o=s[2];switch(o){case"false":return i.literal(jL.boolean(!1));case"true":return i.literal(jL.boolean(!0));default:throw new Error(`Unsupported literal value: ${o}`)}}return i.named(e)}var LEp="bytes";function Jrr(e){if(e===LEp)return{isOptional:!1};if(e.match(uoe.OPTIONAL)?.[1]===LEp)return{isOptional:!0}}function ONa(e){let t=typeof e=="string"?e:typeof e.body=="string"?e.body:void 0;if(t!=null)return Jrr(t)}function Ptc({input:e,typeName:t}){for(let r of e.arguments)if(typeof r=="string"){if(r===t)return!0}else if(Ptc({input:r,typeName:t}))return!0;return!1}function UEp(e){return Ptc({input:e,typeName:"file"})}function VEp(e){let t=0,r=0;function i(){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)return;let a="";for(;t<e.length&&e[t]!=="<"&&e[t]!==","&&e[t]!==">";)a+=e[t++];if(a.trim()){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t<e.length&&e[t]==="<"){if(t++,r++,r>128)throw new Error("Internal error; Exceeded maximum recursion depth while parsing generics.");let u={name:a.trim(),arguments:[]};for(;t<e.length&&e[t]!==">";){for(;t<e.length&&/[\s,]/.test(e[t]);)t++;if(t<e.length&&e[t]!==">"){let l=i();l&&u.arguments.push(l)}}if(t<e.length&&e[t]===">")t++,r--;else throw new Error("Malformed input: missing closing '>' for generic arguments.");return u}else return a.trim()}}let n=i();if(typeof n=="object")return n}var jtc="file";function WEp(e){return e.match(uoe.LIST)?.[1]===jtc}function YNe(e){if(e===jtc)return{isOptional:!1,isArray:!1};let t=e.match(uoe.OPTIONAL);if(t?.[1]!==void 0){if(t[1]===jtc)return{isOptional:!0,isArray:!1};if(WEp(t[1]))return{isOptional:!0,isArray:!0}}if(WEp(e))return{isOptional:!1,isArray:!0}}function YaD(e){return typeof e=="string"?!1:hq.parse(e["content-type"])?.isMultiPartFormData()??!1?!0:e.body==null?!1:!!(RB(e.body)&&Object.values(e.body.properties??[]).some(ZaD))}function Ien(e){if(!(!YaD(e)||e.body==null)&&e.name!=null&&e.body!=null&&RB(e.body))return XaD(e.name,e.body)}function XaD(e,t){let r=Object.entries(t.properties??[]).reduce((i,[n,a])=>{let u=typeof a!="string"?a.docs:void 0,l=typeof a!="string"?a["content-type"]:void 0,d=typeof a!="string"?a.style:void 0,s=YNe(typeof a=="string"?a:a.type);return s!=null?i.push({isFile:!0,key:n,docs:u,isOptional:s.isOptional,isArray:s.isArray,contentType:l,style:d}):i.push({isFile:!1,key:n,propertyType:a,docs:u,contentType:l,style:d}),i},[]);return t["extra-properties"],{name:e,extends:t.extends,properties:r}}function ZaD(e){let t=typeof e=="string"?e:e.type;if(t==="file")return!0;if(!t.includes("file"))return!1;let r=VEp(t);return r==null?!1:UEp(r)}var HEp="text";function mNa(e){if(e===HEp)return{isOptional:!1};if(e.match(uoe.OPTIONAL)?.[1]===HEp)return{isOptional:!0}}function X3({type:e,_default:t,validation:r,visitor:i}){return Ben({type:e,_default:t,validation:r,visitor:{primitive:i.primitive,map:({keyType:n,valueType:a})=>i.map({keyType:X3({type:n,_default:void 0,validation:void 0,visitor:i}),valueType:X3({type:a,_default:void 0,validation:void 0,visitor:i})}),list:n=>i.list(X3({type:n,_default:void 0,validation:void 0,visitor:i})),set:n=>i.set(X3({type:n,_default:void 0,validation:void 0,visitor:i})),optional:n=>i.optional(X3({type:n,_default:t,validation:r,visitor:i})),nullable:n=>i.nullable(X3({type:n,_default:t,validation:r,visitor:i})),literal:i.literal,named:i.named,unknown:i.unknown}})}function wtc(e,t){if(kaD(e))return t.sdk(e);if(eoD(e))return t.language(e);So(e)}function kaD(e){return e.sdk!=null}function eoD(e){return e.language!=null}function $Ep(e){return e["response-stream"]!=null&&(typeof e["response-stream"]=="string"||e["response-stream"].format==null||e["response-stream"].format==="json")}function GEp(e){return e["response-stream"]!=null&&typeof e["response-stream"]!="string"&&e["response-stream"].format==="sse"}function zen(e,t,r){return toD(e,t)?r.stream(t):roD(e,t)?r.events(t):r.body(t)}function toD(e,t){return t.stream!==void 0&&$Ep(e)}function roD(e,t){return t.stream!==void 0&&GEp(e)}function Ren(e,t){if(QEp(e))return t.single(e);if(JEp(e))return t.any(e);So(e)}function QEp(e){return typeof e=="string"||e.scheme!=null}function JEp(e){let[t,...r]=Object.keys(e);return t==="any"&&r.length===0}function PNa(e,t){if(KEp(e))return t.header(e);switch(e.scheme){case"basic":return t.basic(e);case"bearer":return"get-token"in e?t.inferredBearer(e):t.tokenBearer(e);case"oauth":return t.oauth(e);default:So(e)}}function KEp(e){return e.header!=null}function Krr(e,t){if(YEp(e))return t.singleBaseUrl(e);if(hUn(e))return t.multipleBaseUrls(e);So(e)}function YEp(e){return typeof e=="string"||"url"in e}function hUn(e){return typeof e!="string"&&"urls"in e}function yUn(e){return typeof e=="string"?e.startsWith("$"):"variable"in e}function Z3(e,t){if(yzi(e))return t.alias(e);if(vzi(e))return t.discriminatedUnion(e);if(cD(e))return t.object(e);if(vUn(e))return t.undiscriminatedUnion(e);if(Y$t(e))return t.enum(e);So(e)}function yzi(e){return typeof e=="string"||e.type!=null}function cD(e){return e.extends!=null||e.properties!=null}function vzi(e){return e.union!=null&&e.discriminated==null}function vUn(e){let t=e;return t.union!=null&&t.discriminated!=null}function Y$t(e){return e.enum!=null}var $E=si(Nzi(),1),Dic=si(zO(),1),tRp=require("fs/promises"),rRp=si(require("path"),1),Fzi={shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,shouldUseIdiomaticRequestNames:void 0,asyncApiMessageNaming:void 0,onlyIncludeReferencedSchemas:void 0,shouldUseOptionalAdditionalProperties:void 0,coerceEnumsToLiterals:void 0,objectQueryParameters:void 0,respectReadonlySchemas:void 0,respectNullableSchemas:void 0,inlinePathParameters:void 0,useBytesForBinaryResponse:void 0,respectForwardCompatibleEnums:void 0,filter:void 0,exampleGeneration:void 0,defaultFormParameterEncoding:void 0,additionalPropertiesDefaultsTo:void 0,typeDatesAsStrings:void 0,preserveSingleSchemaOneOf:void 0,inlineAllOfSchemas:void 0};async function iRp({absolutePathToGeneratorsConfiguration:e,rawGeneratorsConfiguration:t,context:r}){let i=sRp(t.metadata),n=t.readme;avD(r,t);let a=await JyD(t);return{absolutePathToConfiguration:e,api:a,rawConfiguration:t,defaultGroup:t["default-group"],reviewers:t.reviewers,groups:t.groups!=null?await Promise.all(Object.entries(t.groups).map(([u,l])=>KyD({absolutePathToGeneratorsConfiguration:e,groupName:u,group:l,maybeTopLevelMetadata:i,maybeTopLevelReviewers:t.reviewers,readme:n}))):[],whitelabel:t.whitelabel!=null&&t.whitelabel.github!=null?{github:t.whitelabel.github}:void 0}}function F9o(e){return{...Fzi,shouldUseTitleAsName:e?.["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:e?.unions==="v1",asyncApiMessageNaming:e?.["message-naming"],respectNullableSchemas:e?.["respect-nullable-schemas"],onlyIncludeReferencedSchemas:e?.["only-include-referenced-schemas"],inlinePathParameters:e?.["inline-path-parameters"],shouldUseIdiomaticRequestNames:e?.["idiomatic-request-names"]}}function nRp(e){return{...aRp(e),shouldUseUndiscriminatedUnionsWithLiterals:e?.["prefer-undiscriminated-unions-with-literals"],onlyIncludeReferencedSchemas:e?.["only-include-referenced-schemas"],objectQueryParameters:e?.["object-query-parameters"],respectReadonlySchemas:e?.["respect-readonly-schemas"],inlinePathParameters:e?.["inline-path-parameters"],filter:e?.filter,exampleGeneration:e?.["example-generation"],defaultFormParameterEncoding:e?.["default-form-parameter-encoding"],useBytesForBinaryResponse:e?.["use-bytes-for-binary-response"],respectForwardCompatibleEnums:e?.["respect-forward-compatible-enums"],additionalPropertiesDefaultsTo:e?.["additional-properties-defaults-to"],typeDatesAsStrings:e?.["type-dates-as-strings"],preserveSingleSchemaOneOf:e?.["preserve-single-schema-oneof"],inlineAllOfSchemas:e?.["inline-all-of-schemas"]}}function GyD(e){return{...aRp(e),asyncApiMessageNaming:e?.["message-naming"]}}function aRp(e){return{...Fzi,shouldUseTitleAsName:e?.["title-as-schema-name"],shouldUseIdiomaticRequestNames:e?.["idiomatic-request-names"],shouldUseOptionalAdditionalProperties:e?.["optional-additional-properties"]??!0,coerceEnumsToLiterals:e?.["coerce-enums-to-literals"],respectNullableSchemas:e?.["respect-nullable-schemas"]}}async function eRp(e,t){let r=[];if(e!=null)if(typeof e=="string")r.push({schema:{type:"oss",path:e},origin:void 0,overrides:void 0,audiences:[],settings:{...Fzi}});else if(Bh.isRawProtobufAPIDefinitionSchema(e))r.push({schema:{type:"protobuf",root:e.proto.root,target:e.proto.target??"",localGeneration:e.proto["local-generation"]??!1,fromOpenAPI:e.proto["from-openapi"]??!1,dependencies:e.proto.dependencies??[]},origin:void 0,overrides:e.proto.overrides,audiences:[],settings:{...Fzi}});else if(Array.isArray(e))for(let i of e)typeof i=="string"?r.push({schema:{type:"oss",path:i},origin:void 0,overrides:void 0,audiences:[],settings:{...Fzi}}):Bh.isRawProtobufAPIDefinitionSchema(i)?r.push({schema:{type:"protobuf",root:i.proto.root,target:i.proto.target??"",localGeneration:i.proto["local-generation"]??!1,fromOpenAPI:i.proto["from-openapi"]??!1,dependencies:i.proto.dependencies??[]},origin:void 0,overrides:i.proto.overrides,audiences:[],settings:{...Fzi}}):r.push({schema:{type:"oss",path:i.path},origin:i.origin,overrides:i.overrides,audiences:i.audiences,settings:F9o(i.settings)});else r.push({schema:{type:"oss",path:e.path},origin:e.origin,overrides:e.overrides,audiences:e.audiences,settings:F9o(e.settings)});else{let i=t[Bh.API_SETTINGS_KEY],n=t[Bh.OPENAPI_LOCATION_KEY],a=t[Bh.API_ORIGIN_LOCATION_KEY],u=t[Bh.OPENAPI_OVERRIDES_LOCATION_KEY],l=t[Bh.ASYNC_API_LOCATION_KEY];n!=null&&(typeof n=="string"?r.push({schema:{type:"oss",path:n},origin:a,overrides:u,audiences:[],settings:F9o(i)}):typeof n=="object"&&r.push({schema:{type:"oss",path:n.path},origin:n.origin,overrides:n.overrides,audiences:[],settings:nRp(n.settings)})),l!=null&&r.push({schema:{type:"oss",path:l},origin:a,overrides:void 0,audiences:[],settings:F9o(i)})}return r}async function QyD({apiConfiguration:e,rawConfiguration:t}){let r={"auth-schemes":e.auth!=null?Object.fromEntries(Object.entries(t["auth-schemes"]??{}).filter(([a,u])=>e.auth==null?!1:Ren(e.auth,{any:l=>l.any.includes(a),single:l=>l===a}))):void 0,...e};if(Bh.isConjureSchema(e.specs))return{type:"conjure",pathToConjureDefinition:e.specs.conjure,...r};let i=[],n={};for(let a of e.specs??[]){let u;if(Bh.isOpenApiSpecSchema(a))u={schema:{type:"oss",path:a.openapi},origin:a.origin,overrides:a.overrides,audiences:[],settings:nRp(a.settings)};else if(Bh.isAsyncApiSpecSchema(a))u={schema:{type:"oss",path:a.asyncapi},origin:a.origin,overrides:a.overrides,audiences:[],settings:GyD(a.settings)};else if(Bh.isProtoSpecSchema(a))u={schema:{type:"protobuf",root:a.proto.root,target:a.proto.target??"",localGeneration:a.proto["local-generation"]??!1,fromOpenAPI:a.proto["from-openapi"]??!1,dependencies:a.proto.dependencies??[]},origin:void 0,overrides:a.proto.overrides,audiences:[],settings:{...Fzi}};else if(Bh.isOpenRpcSpecSchema(a))u={schema:{type:"openrpc",path:a.openrpc},origin:void 0,overrides:a.overrides,audiences:[],settings:{...Fzi}};else continue;"namespace"in a&&a.namespace!=null?(n[a.namespace]??=[],n[a.namespace].push(u)):i.push(u)}return Object.keys(n).length===0?{type:"singleNamespace",definitions:i,...r}:{type:"multiNamespace",rootDefinitions:i,definitions:n,...r}}async function JyD(e){let t=e.api;if(t!=null){if(Bh.isApiConfigurationV2Schema(t))return QyD({apiConfiguration:t,rawConfiguration:e});if(Bh.isNamespacedApiConfiguration(t)){let r={};for(let[i,n]of Object.entries(t.namespaces))r[i]=await eRp(n,e);return{type:"multiNamespace",rootDefinitions:void 0,definitions:r}}}return{type:"singleNamespace",definitions:await eRp(t,e)}}async function KyD({absolutePathToGeneratorsConfiguration:e,groupName:t,group:r,maybeTopLevelMetadata:i,maybeTopLevelReviewers:n,readme:a}){let u=sRp(r.metadata);return{groupName:t,reviewers:r.reviewers,audiences:r.audiences==null?{type:"all"}:{type:"select",audiences:r.audiences},generators:await Promise.all(r.generators.map(l=>YyD({absolutePathToGeneratorsConfiguration:e,generator:l,maybeTopLevelMetadata:i,maybeGroupLevelMetadata:u,maybeTopLevelReviewers:n,maybeGroupLevelReviewers:r.reviewers,readme:a})))}}async function YyD({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:i,maybeGroupLevelReviewers:n,maybeTopLevelReviewers:a,readme:u}){return{raw:t,name:t.name,version:t.version,config:t.config,outputMode:await kyD({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:i,maybeGroupLevelReviewers:n,maybeTopLevelReviewers:a}),keywords:t.keywords,smartCasing:t["smart-casing"]??!1,disableExamples:t["disable-examples"]??!1,absolutePathToLocalOutput:t.output?.location==="local-file-system"?Bv(Rd(e),t.output.path):void 0,absolutePathToLocalSnippets:t.snippets?.path!=null?Bv(Rd(e),t.snippets.path):void 0,language:rvD(t.name),irVersionOverride:t["ir-version"]??void 0,publishMetadata:XyD({generatorInvocation:t}),readme:u,settings:t.api?.settings??void 0}}function XyD({generatorInvocation:e}){let t=e["publish-metadata"];if(t!=null)return{packageDescription:t["package-description"],publisherEmail:t.email,publisherName:t.author,referenceUrl:t["reference-url"]};if(e.metadata!=null)return{packageDescription:e.metadata["package-description"],publisherEmail:e.metadata.email,publisherName:e.metadata.author,referenceUrl:e.metadata["reference-url"]}}function oRp({pypiOutputMetadata:e,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r}){let i;return e!=null&&(i=nvD(e),i={...r,...t,...i}),i}function ZyD({topLevelReviewers:e,groupLevelReviewers:t,outputModeReviewers:r}){let i=new Set,n=new Set,a=[],u=[...e?.teams??[],...t?.teams??[],...r?.teams??[]],l=[...e?.users??[],...t?.users??[],...r?.users??[]];for(let d of u)i.has(d.name)||(a.push(Dic.GithubPullRequestReviewer.team({name:d.name})),i.add(d.name));for(let d of l)n.has(d.name)||(a.push(Dic.GithubPullRequestReviewer.user({name:d.name})),n.add(d.name));return a}async function kyD({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r={},maybeTopLevelMetadata:i={},maybeGroupLevelReviewers:n,maybeTopLevelReviewers:a}){let u=t.snippets!=null&&t.snippets.path!=="";if(t.github!=null&&!GNa(t.github)){let l=t.github.repository.indexOf("/"),d=t.github.repository.slice(0,l),s=t.github.repository.slice(l+1),o=t.output!=null?tvD(t.output,r,i):void 0,c=ivD(t),b=c!=null?await evD({absolutePathToGeneratorsConfiguration:e,githubLicense:c}):void 0,g=t.github.mode??"release";switch(g){case"commit":case"release":return $E.FernFiddle.OutputMode.githubV2($E.FernFiddle.GithubOutputModeV2.commitAndRelease({owner:d,repo:s,license:b,publishInfo:o,downloadSnippets:u}));case"pull-request":{let O=ZyD({topLevelReviewers:a,groupLevelReviewers:n,outputModeReviewers:t.github.reviewers});return $E.FernFiddle.OutputMode.githubV2($E.FernFiddle.GithubOutputModeV2.pullRequest({owner:d,repo:s,license:b,publishInfo:o,downloadSnippets:u,reviewers:O}))}case"push":return $E.FernFiddle.OutputMode.githubV2($E.FernFiddle.GithubOutputModeV2.push({owner:d,repo:s,branch:t.github.mode==="push"?t.github.branch:void 0,license:b,publishInfo:o,downloadSnippets:u}));default:So(g)}}if(t.output==null)return $E.FernFiddle.remoteGen.OutputMode.publish({registryOverrides:{}});switch(t.output.location){case"local-file-system":return $E.FernFiddle.OutputMode.downloadFiles({downloadSnippets:u});case"npm":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.npmOverride({registryUrl:t.output.url??"https://registry.npmjs.org",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:u}));case"maven":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.mavenOverride({registryUrl:uRp(t.output),username:t.output.username??"",password:t.output.password??"",coordinate:t.output.coordinate,signature:t.output.signature!=null?{keyId:t.output.signature.keyId,secretKey:t.output.signature.secretKey,password:t.output.signature.password}:void 0,downloadSnippets:u}));case"postman":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.postman({apiKey:t.output["api-key"],workspaceId:t.output["workspace-id"]}));case"pypi":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.pypiOverride({registryUrl:t.output.url??"https://upload.pypi.org/legacy/",username:t.output.token!=null?"__token__":t.output.password??"",password:t.output.token??t.output.password??"",coordinate:t.output["package-name"],downloadSnippets:u,pypiMetadata:oRp({pypiOutputMetadata:t.output.metadata,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:i})}));case"nuget":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.nugetOverride({registryUrl:t.output.url??"https://nuget.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));case"rubygems":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.rubyGemsOverride({registryUrl:t.output.url??"https://rubygems.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));case"crates":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.npmOverride({registryUrl:t.output.url??"https://crates.io/api/v1/crates",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:u}));default:So(t.output)}}async function evD({absolutePathToGeneratorsConfiguration:e,githubLicense:t}){if(typeof t=="string")switch(t){case"MIT":return $E.FernFiddle.GithubLicense.basic({id:$E.FernFiddle.GithubLicenseId.Mit});case"Apache-2.0":return $E.FernFiddle.GithubLicense.basic({id:$E.FernFiddle.GithubLicenseId.Apache});default:So(t)}let r=Eu(Fc.of(rRp.default.dirname(e)),Ta.of(t.custom)),i=await(0,tRp.readFile)(r);return $E.FernFiddle.GithubLicense.custom({contents:i.toString()})}function tvD(e,t,r){switch(e.location){case"local-file-system":throw new Error("Cannot use local-file-system with github publishing");case"npm":return $E.FernFiddle.GithubPublishInfo.npm({registryUrl:e.url??"https://registry.npmjs.org",packageName:e["package-name"],token:e.token});case"maven":return $E.FernFiddle.GithubPublishInfo.maven({registryUrl:uRp(e),coordinate:e.coordinate,credentials:e.username!=null&&e.password!=null?{username:e.username,password:e.password}:void 0,signature:e.signature!=null?{keyId:e.signature.keyId,password:e.signature.password,secretKey:e.signature.secretKey}:void 0});case"postman":return $E.FernFiddle.GithubPublishInfo.postman({apiKey:e["api-key"],workspaceId:e["workspace-id"]});case"pypi":return $E.FernFiddle.GithubPublishInfo.pypi({registryUrl:e.url??"https://upload.pypi.org/legacy/",packageName:e["package-name"],credentials:e.token!=null?{username:"__token__",password:e.token}:{username:e.username??"",password:e.password??""},pypiMetadata:oRp({pypiOutputMetadata:e.metadata,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r})});case"nuget":return $E.FernFiddle.GithubPublishInfo.nuget({registryUrl:e.url??"https://nuget.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"rubygems":return $E.FernFiddle.GithubPublishInfo.rubygems({registryUrl:e.url??"https://rubygems.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"crates":return $E.FernFiddle.GithubPublishInfo.npm({registryUrl:e.url??"https://crates.io",packageName:e["package-name"],token:e.token});default:So(e)}}function rvD(e){if(e.includes("csharp"))return Bh.GenerationLanguage.CSHARP;if(e.includes("go"))return Bh.GenerationLanguage.GO;if(e.includes("java")||e.includes("spring"))return Bh.GenerationLanguage.JAVA;if(e.includes("php"))return Bh.GenerationLanguage.PHP;if(e.includes("python")||e.includes("fastapi")||e.includes("pydantic"))return Bh.GenerationLanguage.PYTHON;if(e.includes("ruby"))return Bh.GenerationLanguage.RUBY;if(e.includes("swift"))return Bh.GenerationLanguage.SWIFT;if(e.includes("typescript"))return Bh.GenerationLanguage.TYPESCRIPT}function uRp(e){return e.url!=null?e.url:e.signature!=null?"https://oss.sonatype.org/service/local/staging/deploy/maven2/":"https://s01.oss.sonatype.org/content/repositories/releases/"}function ivD(e){return e["publish-metadata"]?.license!=null?e["publish-metadata"].license:e.metadata?.license!=null?e.metadata.license:GNa(e.github)?void 0:e.github?.license}function sRp(e){return e!=null?{description:e.description,authors:e.authors?.map(t=>({name:t.name,email:t.email}))}:void 0}function nvD(e){return e!=null?{description:e.description,authors:e.authors?.map(t=>({name:t.name,email:t.email})),keywords:e.keywords,documentationLink:e["documentation-link"],homepageLink:e["homepage-link"]}:void 0}function avD(e,t){let r=[];t["api-settings"]!=null&&r.push('"api-settings" is deprecated. Please use "api.specs[].settings" instead.'),t["async-api"]!=null&&r.push('"async-api" is deprecated. Please use "api.specs[].asyncapi" instead.'),t.openapi!=null&&r.push('"openapi" is deprecated. Please use "api.specs[].openapi" instead.'),t["openapi-overrides"]!=null&&r.push('"openapi-overrides" is deprecated. Please use "api.specs[].overrides" instead.'),t["spec-origin"]&&r.push('"spec-origin" is deprecated. Please use "api.specs[].origin" instead.'),t.api!=null&&(typeof t.api=="string"&&r.push('Using an OpenAPI or AsyncAPI path string for "api" is deprecated. Please use "api.specs[].openapi" or "api.specs[].asyncapi" instead.'),Array.isArray(t.api)?r.push('Using an array for "api" is deprecated. Please use "api.specs[].openapi", "api.specs[].asyncapi", or "api.specs[].proto" instead.'):typeof t.api=="object"&&("path"in t.api&&r.push('Using "api.path" is deprecated. Please use "api.specs[].openapi" or "api.specs[].asyncapi" instead.'),"proto"in t.api&&r.push('Using "api.proto" is deprecated. Please use "api.specs[].proto" instead.'),"namespaces"in t.api&&r.push('Using "api.namespaces" is deprecated. Please use "api.specs[].openapi", "api.specs[].asyncapi", or "api.specs[].proto" with the "namespace" property instead.'))),r.length>0&&(e.logger.warn("Warnings for generators.yml:"),e.logger.warn(" "+r.join(`
|
|
1675
|
+
`)),{ok:!0,value:t}):i}}function n7o(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var OLn=class e extends Error{errors;constructor(t){super(t.map(n7o).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var mLn=class e extends Error{errors;constructor(t){super(t.map(n7o).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function bT(e){return{optional:()=>Qec(e),transform:t=>Jec(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new mLn(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new OLn(i.errors)}}}function Qec(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>Kj.OPTIONAL};return{...t,...bT(t)}}function Jec(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(i,n)=>{let a=t.untransform(i);return e.json(a,n)},getType:()=>e.getType()};return{...r,...bT(r)}}function uEp(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:zA(t,"string")}]}:{ok:!0,value:BigInt(t)},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t.toString()}:{ok:!1,errors:[{path:r,message:zA(t,"bigint")}]},getType:()=>Kj.BIGINT};return{...SL(e),...bT(e)}}var JaD=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function sEp(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:zA(t,"string")}]}:JaD.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:zA(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:zA(t,"Date object")}]},getType:()=>Kj.DATE};return{...SL(e),...bT(e)}}function AJ(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...SL(r),...bT(r)}}}function a7o(e){let t=new Set(e);return AJ(Kj.ENUM,(i,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:a=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:a,message:zA(i,"string")}]}:!t.has(i)&&!n?{ok:!1,errors:[{path:a,message:zA(i,"enum")}]}:{ok:!0,value:i})()}function cEp(e){let t=Kec(e);return{...t,...bT(t)}}function Kec(e){return{parse:(t,r)=>PLn(e).parse(t,r),json:(t,r)=>PLn(e).json(t,r),getType:()=>PLn(e).getType()}}function PLn(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function fNa(e){return Object.entries(e)}function dNa(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[n,a])=>(r.has(n)&&(i[n]=a),i),{})}function ozi(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pNa(e){return Object.keys(e)}function lEp(e,t){let r=[],i=[];for(let n of e)t(n)?r.push(n):i.push(n);return[r,i]}function Q$t(e){return{withParsedProperties:t=>Yec(e,t)}}function Yec(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);if(!a.ok)return a;let u=Object.entries(t).reduce((l,[d,s])=>({...l,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(i,n)=>{if(!ozi(i))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:zA(i,"object")}]};let a=new Set(Object.keys(t)),u=dNa(i,Object.keys(i).filter(l=>!a.has(l)));return e.json(u,n)},getType:()=>e.getType()};return{...r,...bT(r),...Q$t(r)}}function fEp(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function uzi(e){return e.isProperty}function o7o(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,i])=>uzi(i)?i.rawKey:r),_getParsedProperties:()=>pNa(e),parse:(r,i)=>{let n={},a=[];for(let[u,l]of fNa(e)){let d=uzi(l)?l.rawKey:u,s=uzi(l)?l.valueSchema:l,o={rawKey:d,parsedKey:u,valueSchema:s};n[d]=o,_Ep(s)&&a.push(d)}return dEp({value:r,requiredKeys:a,getProperty:u=>{let l=n[u];if(l!=null)return{transformedKey:l.parsedKey,transform:d=>l.valueSchema.parse(d,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},json:(r,i)=>{let n=[];for(let[a,u]of fNa(e)){let l=uzi(u)?u.valueSchema:u;_Ep(l)&&n.push(a)}return dEp({value:r,requiredKeys:n,getProperty:a=>{let u=e[a];if(u!=null)return uzi(u)?{transformedKey:u.rawKey,transform:l=>u.valueSchema.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:l=>u.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},getType:()=>Kj.OBJECT};return{...SL(t),...bT(t),...Q$t(t),...qen(t)}}function dEp({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:i="fail",skipValidation:n=!1,breadcrumbsPrefix:a=[]}){if(!ozi(e))return{ok:!1,errors:[{path:a,message:zA(e,"object")}]};let u=new Set(t),l=[],d={};for(let[s,o]of Object.entries(e)){let c=r(s);if(c!=null){u.delete(s);let b=c.transform(o);b.ok?d[c.transformedKey]=b.value:(d[s]=o,l.push(...b.errors))}else switch(i){case"fail":l.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=o;break}}return l.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),l.length===0||n?{ok:!0,value:d}:{ok:!1,errors:l}}function qen(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,n)=>pEp({extensionKeys:t._getRawProperties(),value:i,transformBase:a=>e.parse(a,n),transformExtension:a=>t.parse(a,n)}),json:(i,n)=>pEp({extensionKeys:t._getParsedProperties(),value:i,transformBase:a=>e.json(a,n),transformExtension:a=>t.json(a,n)}),getType:()=>Kj.OBJECT};return{...r,...bT(r),...Q$t(r),...qen(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,i)=>{let n=e.parse(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},json:(r,i)=>{let n=e.json(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},getType:()=>Kj.OBJECT};return{...t,...bT(t),...Q$t(t),...qen(t)}}}}function pEp({extensionKeys:e,value:t,transformBase:r,transformExtension:i}){let n=new Set(e),[a,u]=lEp(pNa(t),s=>n.has(s)),l=r(dNa(t,u)),d=i(dNa(t,a));return l.ok&&d.ok?{ok:!0,value:{...l.value,...d.value}}:{ok:!1,errors:[...l.ok?[]:l.errors,...d.ok?[]:d.errors]}}function _Ep(e){return!KaD(e)}function KaD(e){switch(e.getType()){case Kj.ANY:case Kj.UNKNOWN:case Kj.OPTIONAL:return!0;default:return!1}}function hEp(e){return o7o(e)}function yEp(e){let t={...Kec(e),_getRawProperties:()=>PLn(e)._getRawProperties(),_getParsedProperties:()=>PLn(e)._getParsedProperties()};return{...t,...bT(t),...Q$t(t),...qen(t)}}function u7o(e){let t={parse:(r,i)=>vEp(r,(n,a)=>e.parse(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,i)=>vEp(r,(n,a)=>e.json(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>Kj.LIST};return{...SL(t),...bT(t)}}function vEp(e,t){return Array.isArray(e)?e.map((i,n)=>t(i,n)).reduce((i,n)=>{if(i.ok&&n.ok)return{ok:!0,value:[...i.value,n.value]};let a=[];return i.ok||a.push(...i.errors),n.ok||a.push(...n.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:zA(e,"list"),path:[]}]}}function bEp(e){return AJ(Kj.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:zA(r,`"${e}"`)}]})()}function gEp(e){return AJ(Kj.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:zA(r,`${e.toString()}`)}]})()}var OEp=AJ(Kj.ANY,e=>({ok:!0,value:e}));var mEp=AJ(Kj.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:zA(e,"boolean")}]});var PEp=AJ(Kj.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:zA(e,"number")}]});var jEp=AJ(Kj.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:zA(e,"string")}]});var wEp=AJ(Kj.UNKNOWN,e=>({ok:!0,value:e}));function DEp(e,t){let r={parse:(i,n)=>SEp({value:i,isKeyNumeric:e.getType()===Kj.NUMBER,transformKey:a=>e.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(i,n)=>SEp({value:i,isKeyNumeric:e.getType()===Kj.NUMBER,transformKey:a=>e.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>Kj.RECORD};return{...SL(r),...bT(r)}}function SEp({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:n=[]}){return ozi(e)?fNa(e).reduce((a,[u,l])=>{if(l==null)return a;let d=a,s=u;if(t){let g=u.length>0?Number(u):NaN;isNaN(g)||(s=g)}let o=r(s),c=i(l,s);if(d.ok&&o.ok&&c.ok)return{ok:!0,value:{...d.value,[o.value]:c.value}};let b=[];return d.ok||b.push(...d.errors),o.ok||b.push(...o.errors),c.ok||b.push(...c.errors),{ok:!1,errors:b}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:zA(e,"object")}]}}function EEp(e){let t=u7o(e),r={parse:(i,n)=>{let a=t.parse(i,n);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(i,n)=>i instanceof Set?t.json([...i],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:zA(i,"Set")}]},getType:()=>Kj.SET};return{...SL(r),...bT(r)}}function AEp(e){let t={parse:(r,i)=>MEp((n,a)=>n.parse(r,a),e,i),json:(r,i)=>MEp((n,a)=>n.json(r,a),e,i),getType:()=>Kj.UNDISCRIMINATED_UNION};return{...SL(t),...bT(t)}}function MEp(e,t,r){let i=[];for(let[n,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let l of u.errors)i.push({path:l.path,message:`[Variant ${n}] ${l.message}`})}return{ok:!1,errors:i}}function qEp(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function CEp(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,n=a7o(pNa(t)),a={parse:(u,l)=>TEp({value:u,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:d=>n.parse(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),json:(u,l)=>TEp({value:u,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:d=>n.json(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),getType:()=>Kj.UNION};return{...SL(a),...bT(a),...Q$t(a)}}function TEp({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:l=[]}){if(!ozi(e))return{ok:!1,errors:[{path:l,message:zA(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:l,message:`Missing discriminant ("${t}")`}]};let o=i(d);if(!o.ok)return{ok:!1,errors:o.errors};let c=n(o.value);if(c==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...l,t],message:"Unexpected discriminant value"}]};let b=u(s,c);return b.ok?{ok:!0,value:{[r]:d,...b.value}}:b}var s7o=ie.string();var jLn=ie.string();var Zec={};Po(Zec,{ApiAuth:()=>D7o,AuthScheme:()=>S7o,AuthSchemesRequirement:()=>c7o,BasicAuthScheme:()=>f7o,BearerAuthScheme:()=>l7o,EnvironmentVariable:()=>GNe,HeaderAuthScheme:()=>d7o,InferredAuthScheme:()=>w7o,InferredAuthSchemeTokenEndpoint:()=>j7o,InferredAuthenticatedRequestHeader:()=>P7o,OAuthAccessTokenRequestProperties:()=>h7o,OAuthAccessTokenResponseProperties:()=>SLn,OAuthClientCredentials:()=>g7o,OAuthConfiguration:()=>O7o,OAuthRefreshEndpoint:()=>b7o,OAuthRefreshTokenRequestProperties:()=>v7o,OAuthScheme:()=>m7o,OAuthTokenEndpoint:()=>y7o});var GNe=ie.string();var c7o=ie.enum_(["ALL","ANY"]);var Ten=ie.objectWithoutOptionalProperties({unsafeName:ie.string(),safeName:ie.string()});var Sd=ie.objectWithoutOptionalProperties({originalName:ie.string(),camelCase:Ten,pascalCase:Ten,snakeCase:Ten,screamingSnakeCase:Ten});var Dd=ie.objectWithoutOptionalProperties({docs:ie.string().optional()});var l7o=ie.objectWithoutOptionalProperties({token:Sd,tokenEnvVar:GNe.optional()}).extend(Dd);var f7o=ie.objectWithoutOptionalProperties({username:Sd,usernameEnvVar:GNe.optional(),password:Sd,passwordEnvVar:GNe.optional()}).extend(Dd);var Gh=ie.objectWithoutOptionalProperties({wireValue:ie.string(),name:Sd});var d7o=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),prefix:ie.string().optional(),headerEnvVar:GNe.optional()}).extend(Dd);var J$t=ie.string();var Vrr=ie.string();var Wrr=ie.string();var szi=ie.objectWithoutOptionalProperties({endpointId:J$t,serviceId:Vrr,subpackageId:Wrr.optional()});var _Na=ie.unknown();var DL=ie.objectWithoutOptionalProperties({userSpecifiedExamples:ie.record(ie.string(),_Na),autogeneratedExamples:ie.record(ie.string(),_Na)});var p7o=ie.enum_(["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED"]);var Hrr=ie.objectWithoutOptionalProperties({status:p7o,message:ie.string().optional()});var j4=ie.objectWithoutOptionalProperties({availability:Hrr.optional()}).extend(Dd);var czi=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),allowMultiple:ie.boolean(),v2Examples:DL.optional()}).extend(j4);var wLn=ie.enum_(["READ_ONLY","WRITE_ONLY"]);var Ak=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),propertyAccess:wLn.optional(),v2Examples:DL.optional()}).extend(j4);var _7o=ie.union("type",{query:czi,body:Ak}).transform({transform:e=>{switch(e.type){case"query":return ioe.query(e);case"body":return ioe.body(e);default:return e}},untransform:({_visit:e,...t})=>t});var qJ=ie.objectWithoutOptionalProperties({propertyPath:ie.list(Sd).optional(),property:_7o});var h7o=ie.objectWithoutOptionalProperties({clientId:qJ,clientSecret:qJ,scopes:qJ.optional(),customProperties:ie.list(qJ).optional()});var EL=ie.objectWithoutOptionalProperties({propertyPath:ie.list(Sd).optional(),property:Ak});var SLn=ie.objectWithoutOptionalProperties({accessToken:EL,expiresIn:EL.optional(),refreshToken:EL.optional()});var y7o=ie.objectWithoutOptionalProperties({endpointReference:szi,requestProperties:h7o,responseProperties:SLn});var v7o=ie.objectWithoutOptionalProperties({refreshToken:qJ});var b7o=ie.objectWithoutOptionalProperties({endpointReference:szi,requestProperties:v7o,responseProperties:SLn});var g7o=ie.objectWithoutOptionalProperties({clientIdEnvVar:GNe.optional(),clientSecretEnvVar:GNe.optional(),tokenPrefix:ie.string().optional(),tokenHeader:ie.string().optional(),scopes:ie.list(ie.string()).optional(),tokenEndpoint:y7o,refreshEndpoint:b7o.optional()});var O7o=ie.union("type",{clientCredentials:g7o}).transform({transform:e=>{switch(e.type){case"clientCredentials":return izi.clientCredentials(e);default:return e}},untransform:({_visit:e,...t})=>t});var m7o=ie.objectWithoutOptionalProperties({configuration:O7o}).extend(Dd);var P7o=ie.objectWithoutOptionalProperties({responseProperty:EL,headerName:ie.string(),valuePrefix:ie.string().optional()});var j7o=ie.objectWithoutOptionalProperties({endpoint:szi,expiryProperty:EL.optional(),authenticatedRequestHeaders:ie.list(P7o)});var w7o=ie.objectWithoutOptionalProperties({tokenEndpoint:j7o}).extend(Dd);var S7o=ie.union(ie.discriminant("type","_type"),{bearer:l7o,basic:f7o,header:d7o,oauth:m7o,inferred:w7o}).transform({transform:e=>{switch(e.type){case"bearer":return BA.bearer(e);case"basic":return BA.basic(e);case"header":return BA.header(e);case"oauth":return BA.oauth(e);case"inferred":return BA.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t});var D7o=ie.objectWithoutOptionalProperties({requirement:c7o,schemes:ie.list(S7o)}).extend(Dd);var kec={};Po(kec,{Availability:()=>Hrr,AvailabilityStatus:()=>p7o,Declaration:()=>j4,DisplayName:()=>fzi,EndpointId:()=>J$t,EndpointReference:()=>szi,ErrorId:()=>dzi,EscapedString:()=>E7o,FeatureId:()=>hNa,FernFilepath:()=>ooe,Name:()=>Sd,NameAndWireValue:()=>Gh,SafeAndUnsafeString:()=>Ten,ServiceId:()=>Vrr,SubpackageId:()=>Wrr,TypeId:()=>Gx,WebSocketChannelId:()=>ELn,WebhookGroupId:()=>DLn,WebhookId:()=>M7o,WithContentType:()=>QNe,WithDocs:()=>Dd,WithDocsAndAvailability:()=>lzi,WithJsonExample:()=>$rr});var lzi=ie.objectWithoutOptionalProperties({availability:Hrr.optional()}).extend(Dd);var ooe=ie.objectWithoutOptionalProperties({allParts:ie.list(Sd),packagePath:ie.list(Sd),file:Sd.optional()});var fzi=ie.string();var E7o=ie.objectWithoutOptionalProperties({original:ie.string()});var $rr=ie.objectWithoutOptionalProperties({jsonExample:ie.unknown()});var QNe=ie.objectWithoutOptionalProperties({contentType:ie.string().optional()});var Gx=ie.string();var dzi=ie.string();var DLn=ie.string();var M7o=ie.string();var ELn=ie.string();var hNa=ie.string();var etc={};Po(etc,{Constants:()=>A7o});var A7o=ie.objectWithoutOptionalProperties({errorInstanceIdKey:Gh});var AF={};Po(AF,{AliasType:()=>r6o,Auth:()=>z7o,AuthValues:()=>U7o,BasicAuth:()=>q7o,BasicAuthValues:()=>R7o,BearerAuth:()=>T7o,BearerAuthValues:()=>x7o,BodyRequest:()=>V7o,Declaration:()=>TJ,DiscriminatedUnionType:()=>c6o,DynamicIntermediateRepresentation:()=>E6o,Endpoint:()=>t6o,EndpointExample:()=>e6o,EndpointLocation:()=>ALn,EndpointSnippetRequest:()=>k7o,EndpointSnippetResponse:()=>BEp,EnumType:()=>i6o,EnvironmentValues:()=>Z7o,ErrorSeverity:()=>M6o,Error_:()=>A6o,FileUploadRequestBody:()=>$7o,FileUploadRequestBodyProperty:()=>H7o,GeneratorConfig:()=>D6o,GeneratorOutputConfig:()=>S6o,GoPublishInfo:()=>b6o,HeaderAuth:()=>C7o,HeaderAuthValues:()=>N7o,InferredAuth:()=>I7o,InferredAuthValues:()=>L7o,InlinedRequest:()=>J7o,InlinedRequestBody:()=>G7o,InlinedRequestMetadata:()=>Q7o,LiteralType:()=>q6o,MapType:()=>zEp,MavenPublishInfo:()=>g6o,MultipleEnvironmentUrlValues:()=>X7o,NamedParameter:()=>$z,NamedType:()=>f6o,NpmPublishInfo:()=>O6o,NugetPublishInfo:()=>m6o,OAuth:()=>B7o,OAuthValues:()=>F7o,ObjectType:()=>n6o,PublishInfo:()=>w6o,PypiPublishInfo:()=>P6o,ReferencedRequestBody:()=>W7o,ReferencedRequestBodyType:()=>qLn,Request:()=>K7o,Response:()=>Y7o,RubyGemsPublishInfo:()=>j6o,SingleDiscriminatedUnionType:()=>s6o,SingleDiscriminatedUnionTypeNoProperties:()=>u6o,SingleDiscriminatedUnionTypeObject:()=>a6o,SingleDiscriminatedUnionTypeSingleProperty:()=>o6o,TypeReference:()=>IEp,UndiscriminatedUnionType:()=>l6o,Values:()=>TLn,auth:()=>ttc,declaration:()=>rtc,endpoints:()=>itc,environment:()=>ntc,ir:()=>atc,snippets:()=>otc,types:()=>utc});var ttc={};Po(ttc,{Auth:()=>z7o,AuthValues:()=>U7o,BasicAuth:()=>q7o,BasicAuthValues:()=>R7o,BearerAuth:()=>T7o,BearerAuthValues:()=>x7o,HeaderAuth:()=>C7o,HeaderAuthValues:()=>N7o,InferredAuth:()=>I7o,InferredAuthValues:()=>L7o,OAuth:()=>B7o,OAuthValues:()=>F7o});var q7o=ie.objectWithoutOptionalProperties({username:Sd,password:Sd});var T7o=ie.objectWithoutOptionalProperties({token:Sd});var $z=ie.objectWithoutOptionalProperties({name:Gh,typeReference:ie.lazy(()=>AF.TypeReference)});var C7o=ie.objectWithoutOptionalProperties({header:$z});var B7o=ie.objectWithoutOptionalProperties({clientId:Sd,clientSecret:Sd});var I7o=ie.objectWithoutOptionalProperties({});var z7o=ie.union("type",{basic:q7o,bearer:T7o,header:C7o,oauth:B7o,inferred:I7o}).transform({transform:e=>{switch(e.type){case"basic":return us.Auth.basic(e);case"bearer":return us.Auth.bearer(e);case"header":return us.Auth.header(e);case"oauth":return us.Auth.oauth(e);case"inferred":return us.Auth.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t});var R7o=ie.objectWithoutOptionalProperties({username:ie.string(),password:ie.string()});var x7o=ie.objectWithoutOptionalProperties({token:ie.string()});var N7o=ie.objectWithoutOptionalProperties({value:ie.unknown()});var F7o=ie.objectWithoutOptionalProperties({clientId:ie.string(),clientSecret:ie.string()});var L7o=ie.objectWithoutOptionalProperties({});var U7o=ie.union("type",{basic:R7o,bearer:x7o,header:N7o,oauth:F7o,inferred:L7o}).transform({transform:e=>{switch(e.type){case"basic":return us.AuthValues.basic(e);case"bearer":return us.AuthValues.bearer(e);case"header":return us.AuthValues.header(e);case"oauth":return us.AuthValues.oauth(e);case"inferred":return us.AuthValues.inferred(e);default:return e}},untransform:({_visit:e,...t})=>t});var rtc={};Po(rtc,{Declaration:()=>TJ});var TJ=ie.objectWithoutOptionalProperties({fernFilepath:ooe,name:Sd});var itc={};Po(itc,{BodyRequest:()=>V7o,Endpoint:()=>t6o,EndpointExample:()=>e6o,EndpointLocation:()=>ALn,FileUploadRequestBody:()=>$7o,FileUploadRequestBodyProperty:()=>H7o,InlinedRequest:()=>J7o,InlinedRequestBody:()=>G7o,InlinedRequestMetadata:()=>Q7o,ReferencedRequestBody:()=>W7o,ReferencedRequestBodyType:()=>qLn,Request:()=>K7o,Response:()=>Y7o});var MLn=ie.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"]);var ALn=ie.objectWithoutOptionalProperties({method:MLn,path:ie.string()});var qLn=ie.union("type",{bytes:ie.object({}),typeReference:ie.object({value:ie.lazy(()=>AF.TypeReference)})}).transform({transform:e=>{switch(e.type){case"bytes":return us.ReferencedRequestBodyType.bytes();case"typeReference":return us.ReferencedRequestBodyType.typeReference(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var V7o=ie.objectWithoutOptionalProperties({pathParameters:ie.list($z).optional(),body:qLn.optional()});var W7o=ie.objectWithoutOptionalProperties({bodyKey:Sd,bodyType:qLn});var H7o=ie.union("type",{file:Gh,fileArray:Gh,bodyProperty:$z}).transform({transform:e=>{switch(e.type){case"file":return us.FileUploadRequestBodyProperty.file(e);case"fileArray":return us.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return us.FileUploadRequestBodyProperty.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t});var $7o=ie.objectWithoutOptionalProperties({properties:ie.list(H7o)});var G7o=ie.union("type",{properties:ie.object({value:ie.list($z)}),referenced:W7o,fileUpload:$7o}).transform({transform:e=>{switch(e.type){case"properties":return us.InlinedRequestBody.properties(e.value);case"referenced":return us.InlinedRequestBody.referenced(e);case"fileUpload":return us.InlinedRequestBody.fileUpload(e);default:return e}},untransform:({_visit:e,...t})=>t});var Q7o=ie.objectWithoutOptionalProperties({includePathParameters:ie.boolean(),onlyPathParameters:ie.boolean()});var J7o=ie.objectWithoutOptionalProperties({declaration:TJ,pathParameters:ie.list($z).optional(),queryParameters:ie.list($z).optional(),headers:ie.list($z).optional(),body:G7o.optional(),metadata:Q7o.optional()});var K7o=ie.union("type",{body:V7o,inlined:J7o}).transform({transform:e=>{switch(e.type){case"body":return us.Request.body(e);case"inlined":return us.Request.inlined(e);default:return e}},untransform:({_visit:e,...t})=>t});var Y7o=ie.union("type",{json:ie.object({})}).transform({transform:e=>{switch(e.type){case"json":return us.Response.json();default:return e}},untransform:({_visit:e,...t})=>t});var JNe=ie.string();var qk=ie.string();var Grr=ie.string();var X7o=ie.record(qk,Grr);var Z7o=ie.undiscriminatedUnion([JNe,X7o]);var TLn=ie.record(ie.string(),ie.unknown());var k7o=ie.objectWithoutOptionalProperties({endpoint:ALn,baseUrl:ie.property("baseURL",ie.string().optional()),environment:Z7o.optional(),auth:U7o.optional(),pathParameters:TLn.optional(),queryParameters:TLn.optional(),headers:TLn.optional(),requestBody:ie.unknown().optional()});var e6o=ie.objectWithoutOptionalProperties({id:ie.string(),name:ie.string().optional()}).extend(k7o);var t6o=ie.objectWithoutOptionalProperties({auth:z7o.optional(),declaration:TJ,location:ALn,request:K7o,response:Y7o,examples:ie.list(e6o).optional()});var ntc={};Po(ntc,{EnvironmentValues:()=>Z7o,MultipleEnvironmentUrlValues:()=>X7o});var atc={};Po(atc,{DynamicIntermediateRepresentation:()=>E6o,GeneratorConfig:()=>D6o,GeneratorOutputConfig:()=>S6o,GoPublishInfo:()=>b6o,MavenPublishInfo:()=>g6o,NpmPublishInfo:()=>O6o,NugetPublishInfo:()=>m6o,PublishInfo:()=>w6o,PypiPublishInfo:()=>P6o,RubyGemsPublishInfo:()=>j6o});var r6o=ie.objectWithoutOptionalProperties({declaration:TJ,typeReference:ie.lazy(()=>AF.TypeReference)});var i6o=ie.objectWithoutOptionalProperties({declaration:TJ,values:ie.list(Gh)});var n6o=ie.objectWithoutOptionalProperties({declaration:TJ,properties:ie.list($z),additionalProperties:ie.boolean().optional()});var a6o=ie.objectWithoutOptionalProperties({typeId:Gx,discriminantValue:Gh,properties:ie.list($z)});var o6o=ie.objectWithoutOptionalProperties({typeReference:ie.lazy(()=>AF.TypeReference),discriminantValue:Gh,properties:ie.list($z).optional()});var u6o=ie.objectWithoutOptionalProperties({discriminantValue:Gh,properties:ie.list($z).optional()});var s6o=ie.union("type",{samePropertiesAsObject:a6o,singleProperty:o6o,noProperties:u6o}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return us.SingleDiscriminatedUnionType.samePropertiesAsObject(e);case"singleProperty":return us.SingleDiscriminatedUnionType.singleProperty(e);case"noProperties":return us.SingleDiscriminatedUnionType.noProperties(e);default:return e}},untransform:({_visit:e,...t})=>t});var c6o=ie.objectWithoutOptionalProperties({declaration:TJ,discriminant:Gh,types:ie.record(ie.string(),s6o)});var l6o=ie.objectWithoutOptionalProperties({declaration:TJ,types:ie.list(ie.lazy(()=>AF.TypeReference))});var f6o=ie.union("type",{alias:r6o,enum:i6o,object:n6o,discriminatedUnion:c6o,undiscriminatedUnion:l6o}).transform({transform:e=>{switch(e.type){case"alias":return us.NamedType.alias(e);case"enum":return us.NamedType.enum(e);case"object":return us.NamedType.object(e);case"discriminatedUnion":return us.NamedType.discriminatedUnion(e);case"undiscriminatedUnion":return us.NamedType.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var d6o=ie.objectWithoutOptionalProperties({id:JNe,name:Sd,url:Grr}).extend(Dd);var p6o=ie.objectWithoutOptionalProperties({environments:ie.list(d6o)});var _6o=ie.objectWithoutOptionalProperties({id:qk,name:Sd});var h6o=ie.objectWithoutOptionalProperties({id:JNe,name:Sd,urls:ie.record(qk,Grr)}).extend(Dd);var y6o=ie.objectWithoutOptionalProperties({baseUrls:ie.list(_6o),environments:ie.list(h6o)});var v6o=ie.union("type",{singleBaseUrl:p6o,multipleBaseUrls:y6o}).transform({transform:e=>{switch(e.type){case"singleBaseUrl":return $R.singleBaseUrl(e);case"multipleBaseUrls":return $R.multipleBaseUrls(e);default:return e}},untransform:({_visit:e,...t})=>t});var CLn=ie.objectWithoutOptionalProperties({defaultEnvironment:JNe.optional(),environments:v6o});var b6o=ie.objectWithoutOptionalProperties({version:ie.string(),repoUrl:ie.string()});var g6o=ie.objectWithoutOptionalProperties({version:ie.string(),coordinate:ie.string(),repoUrl:ie.string().optional()});var O6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var m6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var P6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var j6o=ie.objectWithoutOptionalProperties({version:ie.string(),packageName:ie.string(),repoUrl:ie.string().optional()});var w6o=ie.union("type",{go:b6o,maven:g6o,npm:O6o,nuget:m6o,pypi:P6o,rubygems:j6o}).transform({transform:e=>{switch(e.type){case"go":return us.PublishInfo.go(e);case"maven":return us.PublishInfo.maven(e);case"npm":return us.PublishInfo.npm(e);case"nuget":return us.PublishInfo.nuget(e);case"pypi":return us.PublishInfo.pypi(e);case"rubygems":return us.PublishInfo.rubygems(e);default:return e}},untransform:({_visit:e,...t})=>t});var S6o=ie.union("type",{publish:ie.object({value:w6o}),local:ie.object({})}).transform({transform:e=>{switch(e.type){case"publish":return us.GeneratorOutputConfig.publish(e.value);case"local":return us.GeneratorOutputConfig.local();default:return e}},untransform:({_visit:e,...t})=>t});var D6o=ie.objectWithoutOptionalProperties({apiName:ie.string(),organization:ie.string(),customConfig:ie.unknown(),outputConfig:S6o});var E6o=ie.objectWithoutOptionalProperties({version:ie.stringLiteral("1.0.0"),types:ie.record(Gx,f6o),endpoints:ie.record(J$t,t6o),environments:CLn.optional(),headers:ie.list($z).optional(),pathParameters:ie.list($z).optional(),generatorConfig:D6o.optional()});var otc={};Po(otc,{EndpointSnippetRequest:()=>k7o,EndpointSnippetResponse:()=>BEp,ErrorSeverity:()=>M6o,Error_:()=>A6o,Values:()=>TLn});var M6o=ie.enum_(["CRITICAL","WARNING"]);var A6o=ie.objectWithoutOptionalProperties({severity:M6o,message:ie.string()});var BEp=ie.objectWithoutOptionalProperties({snippet:ie.string(),errors:ie.list(A6o).optional()});var utc={};Po(utc,{AliasType:()=>r6o,DiscriminatedUnionType:()=>c6o,EnumType:()=>i6o,LiteralType:()=>q6o,MapType:()=>zEp,NamedParameter:()=>$z,NamedType:()=>f6o,ObjectType:()=>n6o,SingleDiscriminatedUnionType:()=>s6o,SingleDiscriminatedUnionTypeNoProperties:()=>u6o,SingleDiscriminatedUnionTypeObject:()=>a6o,SingleDiscriminatedUnionTypeSingleProperty:()=>o6o,TypeReference:()=>IEp,UndiscriminatedUnionType:()=>l6o});var q6o=ie.union("type",{boolean:ie.object({value:ie.boolean()}),string:ie.object({value:ie.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return us.LiteralType.boolean(e.value);case"string":return us.LiteralType.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var BLn=ie.enum_(["INTEGER","LONG","UINT","UINT_64","FLOAT","DOUBLE","BOOLEAN","STRING","DATE","DATE_TIME","UUID","BASE_64","BIG_INTEGER"]);var IEp=ie.union("type",{list:ie.object({value:ie.lazy(()=>AF.TypeReference)}),literal:ie.object({value:q6o}),map:ie.lazyObject(()=>AF.MapType),named:ie.object({value:Gx}),nullable:ie.object({value:ie.lazy(()=>AF.TypeReference)}),optional:ie.object({value:ie.lazy(()=>AF.TypeReference)}),primitive:ie.object({value:BLn}),set:ie.object({value:ie.lazy(()=>AF.TypeReference)}),unknown:ie.object({})}).transform({transform:e=>{switch(e.type){case"list":return us.TypeReference.list(e.value);case"literal":return us.TypeReference.literal(e.value);case"map":return us.TypeReference.map(e);case"named":return us.TypeReference.named(e.value);case"nullable":return us.TypeReference.nullable(e.value);case"optional":return us.TypeReference.optional(e.value);case"primitive":return us.TypeReference.primitive(e.value);case"set":return us.TypeReference.set(e.value);case"unknown":return us.TypeReference.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var zEp=ie.objectWithoutOptionalProperties({key:ie.lazy(()=>AF.TypeReference),value:ie.lazy(()=>AF.TypeReference)});var stc={};Po(stc,{EnvironmentBaseUrlId:()=>qk,EnvironmentBaseUrlWithId:()=>_6o,EnvironmentId:()=>JNe,EnvironmentUrl:()=>Grr,Environments:()=>v6o,EnvironmentsConfig:()=>CLn,MultipleBaseUrlsEnvironment:()=>h6o,MultipleBaseUrlsEnvironments:()=>y6o,SingleBaseUrlEnvironment:()=>d6o,SingleBaseUrlEnvironments:()=>p6o});var ctc={};Po(ctc,{DeclaredErrorName:()=>pzi,ErrorDeclaration:()=>C6o,ErrorDeclarationDiscriminantValue:()=>REp,ExampleError:()=>T6o});var pzi=ie.objectWithoutOptionalProperties({errorId:dzi,fernFilepath:ooe,name:Sd});var T6o=ie.objectWithoutOptionalProperties({name:Sd.optional(),shape:ie.lazyObject(()=>Sm)}).extend($rr).extend(Dd);var C6o=ie.objectWithoutOptionalProperties({name:pzi,displayName:ie.string().optional(),discriminantValue:Gh,type:ie.lazy(()=>av).optional(),statusCode:ie.number(),examples:ie.list(T6o),v2Examples:DL.optional()}).extend(Dd);var REp=ie.union("type",{property:Gh,statusCode:ie.object({})}).transform({transform:e=>{switch(e.type){case"property":return nzi.property(e);case"statusCode":return nzi.statusCode();default:return e}},untransform:({_visit:e,...t})=>t});var ltc={};Po(ltc,{BasicAuthValues:()=>R6o,BearerAuthValues:()=>x6o,HeaderAuthValues:()=>N6o,MultipleEnvironmentUrlValues:()=>z6o,OAuthValues:()=>F6o,V2AuthValues:()=>zLn,V2EndpointLocation:()=>I6o,V2EndpointLocationHttpMethod:()=>B6o,V2EnvironmentValues:()=>ILn,V2HttpEndpointCodeSample:()=>W6o,V2HttpEndpointExample:()=>yNa,V2HttpEndpointExamples:()=>H6o,V2HttpEndpointRequest:()=>L6o,V2HttpEndpointResponse:()=>V6o,V2HttpEndpointResponseBody:()=>U6o,V2SchemaExample:()=>_Na,V2SchemaExamples:()=>DL,V2ValueExamples:()=>Qrr,V2WebSocketEndpointLocation:()=>$6o,V2WebSocketMessageExample:()=>G6o,V2WebSocketSessionExample:()=>vNa,V2WebSocketSessionExamples:()=>Q6o,V2WebhookExample:()=>bNa,V2WebhookExamples:()=>J6o,WithV2Examples:()=>gI});var gI=ie.objectWithoutOptionalProperties({v2Examples:DL.optional()});var B6o=ie.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD"]);var I6o=ie.objectWithoutOptionalProperties({method:B6o,path:ie.string()});var z6o=ie.record(qk,Grr);var ILn=ie.undiscriminatedUnion([JNe,z6o]);var R6o=ie.objectWithoutOptionalProperties({username:ie.string(),password:ie.string()});var x6o=ie.objectWithoutOptionalProperties({token:ie.string()});var N6o=ie.objectWithoutOptionalProperties({value:ie.unknown()});var F6o=ie.objectWithoutOptionalProperties({clientId:ie.string(),clientSecret:ie.string()});var zLn=ie.union("type",{basic:R6o,bearer:x6o,header:N6o,oauth:F6o}).transform({transform:e=>{switch(e.type){case"basic":return VNe.basic(e);case"bearer":return VNe.bearer(e);case"header":return VNe.header(e);case"oauth":return VNe.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var Qrr=ie.record(ie.string(),ie.unknown());var L6o=ie.objectWithoutOptionalProperties({endpoint:I6o,baseUrl:ie.property("baseURL",ie.string().optional()),environment:ILn.optional(),auth:zLn.optional(),pathParameters:Qrr.optional(),queryParameters:Qrr.optional(),headers:Qrr.optional(),requestBody:ie.unknown().optional()}).extend(Dd);var U6o=ie.union("type",{error:ie.object({value:ie.unknown()}),json:ie.object({value:ie.unknown()}),stream:ie.object({value:ie.list(ie.unknown())})}).transform({transform:e=>{switch(e.type){case"error":return m4.error(e.value);case"json":return m4.json(e.value);case"stream":return m4.stream(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var V6o=ie.objectWithoutOptionalProperties({statusCode:ie.number().optional(),body:U6o.optional()}).extend(Dd);var W6o=ie.objectWithoutOptionalProperties({name:ie.string().optional(),language:ie.string(),code:ie.string()}).extend(Dd);var yNa=ie.objectWithoutOptionalProperties({displayName:ie.string().optional(),request:L6o.optional(),response:V6o.optional(),codeSamples:ie.list(W6o).optional()});var H6o=ie.objectWithoutOptionalProperties({userSpecifiedExamples:ie.record(ie.string(),yNa),autogeneratedExamples:ie.record(ie.string(),yNa)});var $6o=ie.objectWithoutOptionalProperties({path:ie.string()});var G6o=ie.objectWithoutOptionalProperties({type:ie.string(),body:ie.unknown()});var vNa=ie.objectWithoutOptionalProperties({channel:$6o,baseUrl:ie.property("baseURL",ie.string().optional()),environment:ILn.optional(),auth:zLn.optional(),pathParameters:Qrr.optional(),queryParameters:Qrr.optional(),headers:Qrr.optional(),messages:ie.list(G6o).optional()});var Q6o=ie.objectWithoutOptionalProperties({autogeneratedExamples:ie.record(ie.string(),vNa),userSpecifiedExamples:ie.record(ie.string(),vNa)});var bNa=ie.objectWithoutOptionalProperties({name:ie.string().optional(),payload:ie.unknown()});var J6o=ie.objectWithoutOptionalProperties({userSpecifiedExamples:ie.record(ie.string(),bNa),autogeneratedExamples:ie.record(ie.string(),bNa)});var dtc={};Po(dtc,{BasicLicense:()=>Y6o,CustomLicense:()=>X6o,EnvironmentVariable:()=>Y3,GeneratorConfig:()=>xEp,GeneratorEnvironment:()=>O4o,GeneratorOutputConfig:()=>b4o,GeneratorPublishConfig:()=>WLn,GeneratorPublishTarget:()=>u4o,GeneratorRegistriesConfig:()=>r4o,GeneratorRegistriesConfigV2:()=>a4o,GithubOutputMode:()=>y4o,GithubPublishInfo:()=>h4o,LicenseConfig:()=>Z6o,LicenseId:()=>K6o,MavenCentralSignature:()=>RLn,MavenCentralSignatureGithubInfo:()=>c4o,MavenGithubPublishInfo:()=>l4o,MavenRegistryConfig:()=>e4o,MavenRegistryConfigV2:()=>xLn,NpmGithubPublishInfo:()=>s4o,NpmRegistryConfig:()=>t4o,NpmRegistryConfigV2:()=>NLn,NugetGithubPublishInfo:()=>_4o,NugetRegistryConfig:()=>VLn,OutputMetadata:()=>n4o,OutputMetadataAuthor:()=>i4o,OutputMode:()=>v4o,PostmanConfig:()=>o4o,PostmanGithubPublishInfo:()=>f4o,PublishingMetadata:()=>k6o,PypiGithubPublishInfo:()=>d4o,PypiMetadata:()=>FLn,PypiRegistryConfig:()=>LLn,RemoteGeneratorEnvironment:()=>g4o,RubyGemsGithubPublishInfo:()=>p4o,RubyGemsRegistryConfig:()=>ULn,config:()=>ftc});var ftc={};Po(ftc,{BasicLicense:()=>Y6o,CustomLicense:()=>X6o,EnvironmentVariable:()=>Y3,GeneratorConfig:()=>xEp,GeneratorEnvironment:()=>O4o,GeneratorOutputConfig:()=>b4o,GeneratorPublishConfig:()=>WLn,GeneratorPublishTarget:()=>u4o,GeneratorRegistriesConfig:()=>r4o,GeneratorRegistriesConfigV2:()=>a4o,GithubOutputMode:()=>y4o,GithubPublishInfo:()=>h4o,LicenseConfig:()=>Z6o,LicenseId:()=>K6o,MavenCentralSignature:()=>RLn,MavenCentralSignatureGithubInfo:()=>c4o,MavenGithubPublishInfo:()=>l4o,MavenRegistryConfig:()=>e4o,MavenRegistryConfigV2:()=>xLn,NpmGithubPublishInfo:()=>s4o,NpmRegistryConfig:()=>t4o,NpmRegistryConfigV2:()=>NLn,NugetGithubPublishInfo:()=>_4o,NugetRegistryConfig:()=>VLn,OutputMetadata:()=>n4o,OutputMetadataAuthor:()=>i4o,OutputMode:()=>v4o,PostmanConfig:()=>o4o,PostmanGithubPublishInfo:()=>f4o,PublishingMetadata:()=>k6o,PypiGithubPublishInfo:()=>d4o,PypiMetadata:()=>FLn,PypiRegistryConfig:()=>LLn,RemoteGeneratorEnvironment:()=>g4o,RubyGemsGithubPublishInfo:()=>p4o,RubyGemsRegistryConfig:()=>ULn});var K6o=ie.enum_(["MIT","Apache-2.0"]);var Y6o=ie.objectWithoutOptionalProperties({id:K6o});var X6o=ie.objectWithoutOptionalProperties({filename:ie.string()});var Z6o=ie.union("type",{basic:Y6o,custom:X6o}).transform({transform:e=>{switch(e.type){case"basic":return U0.LicenseConfig.basic(e);case"custom":return U0.LicenseConfig.custom(e);default:return e}},untransform:({_visit:e,...t})=>t});var k6o=ie.objectWithoutOptionalProperties({packageDescription:ie.property("package_description",ie.string().optional()),publisherEmail:ie.property("publisher_email",ie.string().optional()),referenceUrl:ie.property("reference_url",ie.string().optional()),publisherName:ie.property("publisher_name",ie.string().optional())});var RLn=ie.objectWithoutOptionalProperties({keyId:ie.string(),password:ie.string(),secretKey:ie.string()});var e4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),username:ie.string(),password:ie.string(),group:ie.string(),signature:RLn.optional()});var t4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),token:ie.string(),scope:ie.string()});var r4o=ie.objectWithoutOptionalProperties({maven:e4o,npm:t4o});var xLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),username:ie.string(),password:ie.string(),coordinate:ie.string(),signature:RLn.optional()});var NLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),token:ie.string(),packageName:ie.string()});var i4o=ie.objectWithoutOptionalProperties({name:ie.string(),email:ie.string()});var n4o=ie.objectWithoutOptionalProperties({description:ie.string().optional(),authors:ie.list(i4o).optional()});var FLn=ie.objectWithoutOptionalProperties({keywords:ie.list(ie.string()).optional(),documentationLink:ie.string().optional(),homepageLink:ie.string().optional()}).extend(n4o);var LLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),username:ie.string(),password:ie.string(),packageName:ie.string(),pypiMetadata:FLn.optional()});var ULn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),apiKey:ie.string(),packageName:ie.string()});var VLn=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),apiKey:ie.string(),packageName:ie.string()});var a4o=ie.objectWithoutOptionalProperties({maven:xLn,npm:NLn,pypi:LLn,rubygems:ULn,nuget:VLn});var o4o=ie.objectWithoutOptionalProperties({apiKey:ie.string(),workspaceId:ie.string()});var u4o=ie.union("type",{maven:xLn,npm:NLn,pypi:LLn,postman:o4o,rubygems:ULn,nuget:VLn}).transform({transform:e=>{switch(e.type){case"maven":return U0.GeneratorPublishTarget.maven(e);case"npm":return U0.GeneratorPublishTarget.npm(e);case"pypi":return U0.GeneratorPublishTarget.pypi(e);case"postman":return U0.GeneratorPublishTarget.postman(e);case"rubygems":return U0.GeneratorPublishTarget.rubygems(e);case"nuget":return U0.GeneratorPublishTarget.nuget(e);default:return e}},untransform:({_visit:e,...t})=>t});var WLn=ie.objectWithoutOptionalProperties({registries:r4o,registriesV2:a4o,publishTarget:u4o.optional(),version:ie.string()});var Y3=ie.string();var s4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),tokenEnvironmentVariable:Y3,shouldGeneratePublishWorkflow:ie.boolean().optional()});var c4o=ie.objectWithoutOptionalProperties({keyIdEnvironmentVariable:Y3,passwordEnvironmentVariable:Y3,secretKeyEnvironmentVariable:Y3});var l4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),coordinate:ie.string(),usernameEnvironmentVariable:Y3,passwordEnvironmentVariable:Y3,signature:c4o.optional(),shouldGeneratePublishWorkflow:ie.boolean().optional()});var f4o=ie.objectWithoutOptionalProperties({apiKeyEnvironmentVariable:Y3,workspaceIdEnvironmentVariable:Y3});var d4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),usernameEnvironmentVariable:Y3,passwordEnvironmentVariable:Y3,pypiMetadata:FLn.optional(),shouldGeneratePublishWorkflow:ie.boolean().optional()});var p4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),apiKeyEnvironmentVariable:Y3,shouldGeneratePublishWorkflow:ie.boolean().optional()});var _4o=ie.objectWithoutOptionalProperties({registryUrl:ie.string(),packageName:ie.string(),apiKeyEnvironmentVariable:Y3,shouldGeneratePublishWorkflow:ie.boolean().optional()});var h4o=ie.union("type",{npm:s4o,maven:l4o,postman:f4o,pypi:d4o,rubygems:p4o,nuget:_4o}).transform({transform:e=>{switch(e.type){case"npm":return U0.GithubPublishInfo.npm(e);case"maven":return U0.GithubPublishInfo.maven(e);case"postman":return U0.GithubPublishInfo.postman(e);case"pypi":return U0.GithubPublishInfo.pypi(e);case"rubygems":return U0.GithubPublishInfo.rubygems(e);case"nuget":return U0.GithubPublishInfo.nuget(e);default:return e}},untransform:({_visit:e,...t})=>t});var y4o=ie.objectWithoutOptionalProperties({version:ie.string(),repoUrl:ie.string(),installationToken:ie.string().optional(),publishInfo:h4o.optional()});var v4o=ie.union("type",{publish:WLn,downloadFiles:ie.object({}),github:y4o}).transform({transform:e=>{switch(e.type){case"publish":return U0.OutputMode.publish(e);case"downloadFiles":return U0.OutputMode.downloadFiles();case"github":return U0.OutputMode.github(e);default:return e}},untransform:({_visit:e,...t})=>t});var b4o=ie.objectWithoutOptionalProperties({path:ie.string(),snippetFilepath:ie.string().optional(),snippetTemplateFilepath:ie.string().optional(),publishingMetadata:k6o.optional(),mode:v4o});var g4o=ie.objectWithoutOptionalProperties({coordinatorUrl:ie.string(),coordinatorUrlV2:ie.string(),id:ie.string()});var O4o=ie.union(ie.discriminant("type","_type"),{local:ie.object({}),remote:g4o}).transform({transform:e=>{switch(e.type){case"local":return U0.GeneratorEnvironment.local();case"remote":return U0.GeneratorEnvironment.remote(e);default:return e}},untransform:({_visit:e,...t})=>t});var xEp=ie.objectWithoutOptionalProperties({dryRun:ie.boolean(),irFilepath:ie.string(),originalReadmeFilepath:ie.string().optional(),license:Z6o.optional(),output:b4o,publish:WLn.optional(),workspaceName:ie.string(),organization:ie.string(),customConfig:ie.unknown(),environment:O4o,whitelabel:ie.boolean(),writeUnitTests:ie.boolean(),generatePaginatedClients:ie.boolean().optional(),generateOauthClients:ie.boolean()});var ptc={};Po(ptc,{AutogeneratedEndpointExample:()=>f2o,BytesRequest:()=>QLn,BytesResponse:()=>ZLn,CursorPagination:()=>K4o,CustomPagination:()=>X4o,DeclaredServiceName:()=>m4o,EndpointName:()=>j4o,ExampleCodeSample:()=>r2o,ExampleCodeSampleLanguage:()=>k4o,ExampleCodeSampleSdk:()=>t2o,ExampleEndpointCall:()=>iUn,ExampleEndpointErrorResponse:()=>s2o,ExampleEndpointSuccessResponse:()=>u2o,ExampleHeader:()=>Cen,ExampleInlinedRequestBody:()=>rUn,ExampleInlinedRequestBodyProperty:()=>n2o,ExamplePathParameter:()=>_zi,ExampleQueryParameter:()=>tUn,ExampleQueryParameterShape:()=>i2o,ExampleRequestBody:()=>a2o,ExampleResponse:()=>c2o,ExampleServerSideEvent:()=>o2o,FileDownloadResponse:()=>YLn,FileProperty:()=>M4o,FilePropertyArray:()=>E4o,FilePropertySingle:()=>D4o,FileUploadBodyProperty:()=>q4o,FileUploadBodyPropertyEncoding:()=>A4o,FileUploadRequest:()=>C4o,FileUploadRequestProperty:()=>T4o,GrpcTransport:()=>h2o,HttpEndpoint:()=>g2o,HttpEndpointSource:()=>b2o,HttpHeader:()=>Tk,HttpMethod:()=>MLn,HttpPath:()=>KNe,HttpPathPart:()=>P4o,HttpRequestBody:()=>JLn,HttpRequestBodyReference:()=>GLn,HttpResponse:()=>eUn,HttpResponseBody:()=>$4o,HttpService:()=>P2o,InlinedRequestBody:()=>S4o,InlinedRequestBodyProperty:()=>$Ln,JsonResponse:()=>KLn,JsonResponseBody:()=>N4o,JsonResponseBodyWithProperty:()=>F4o,JsonStreamChunk:()=>L4o,NonStreamHttpResponseBody:()=>W4o,OffsetPagination:()=>Y4o,Pagination:()=>Z4o,PathParameter:()=>K$t,PathParameterLocation:()=>w4o,ProtoSourceInfo:()=>v2o,QueryParameter:()=>czi,RequestProperty:()=>qJ,RequestPropertyValue:()=>_7o,ResponseError:()=>Q4o,ResponseErrors:()=>J4o,ResponseProperty:()=>EL,SdkRequest:()=>x4o,SdkRequestBodyType:()=>I4o,SdkRequestShape:()=>R4o,SdkRequestWrapper:()=>z4o,SseStreamChunk:()=>V4o,StreamParameterResponse:()=>H4o,StreamingResponse:()=>kLn,SupportedSdkLanguage:()=>e2o,TextResponse:()=>XLn,TextStreamChunk:()=>U4o,Transport:()=>aUn,UserSpecifiedEndpointExample:()=>l2o,V2HttpRequestBodies:()=>B4o,V2HttpResponses:()=>G4o});var m4o=ie.objectWithoutOptionalProperties({fernFilepath:ooe});var P4o=ie.objectWithoutOptionalProperties({pathParameter:ie.string(),tail:ie.string()});var KNe=ie.objectWithoutOptionalProperties({head:ie.string(),parts:ie.list(P4o)});var j4o=Sd;var Tk=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),env:ie.string().optional(),v2Examples:DL.optional()}).extend(j4);var w4o=ie.enum_(["ROOT","SERVICE","ENDPOINT"]);var HLn=ie.string();var K$t=ie.objectWithoutOptionalProperties({name:Sd,valueType:ie.lazy(()=>av),location:w4o,variable:HLn.optional(),v2Examples:DL.optional()}).extend(Dd);var OI=ie.objectWithoutOptionalProperties({typeId:Gx,fernFilepath:ooe,name:Sd,displayName:fzi.optional()});var $Ln=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av),v2Examples:DL.optional(),propertyAccess:wLn.optional()}).extend(lzi);var S4o=ie.objectWithoutOptionalProperties({name:Sd,extends:ie.list(OI),properties:ie.list($Ln),extendedProperties:ie.list(Ak).optional(),extraProperties:ie.property("extra-properties",ie.boolean())}).extend(Dd).extend(gI).extend(QNe);var GLn=ie.objectWithoutOptionalProperties({requestBodyType:ie.lazy(()=>av)}).extend(Dd).extend(QNe).extend(gI);var D4o=ie.objectWithoutOptionalProperties({key:Gh,isOptional:ie.boolean(),contentType:ie.string().optional()}).extend(Dd);var E4o=ie.objectWithoutOptionalProperties({key:Gh,isOptional:ie.boolean(),contentType:ie.string().optional()}).extend(Dd);var M4o=ie.union("type",{file:D4o,fileArray:E4o}).transform({transform:e=>{switch(e.type){case"file":return roe.file(e);case"fileArray":return roe.fileArray(e);default:return e}},untransform:({_visit:e,...t})=>t});var A4o=ie.enum_(["exploded","json","form"]);var q4o=ie.objectWithoutOptionalProperties({style:A4o.optional()}).extend($Ln).extend(QNe);var T4o=ie.union("type",{file:ie.object({value:M4o}),bodyProperty:q4o}).transform({transform:e=>{switch(e.type){case"file":return P4.file(e.value);case"bodyProperty":return P4.bodyProperty(e);default:return e}},untransform:({_visit:e,...t})=>t});var C4o=ie.objectWithoutOptionalProperties({name:Sd,properties:ie.list(T4o)}).extend(Dd).extend(gI).extend(QNe);var QLn=ie.objectWithoutOptionalProperties({isOptional:ie.boolean()}).extend(Dd).extend(gI).extend(QNe);var JLn=ie.union("type",{inlinedRequestBody:S4o,reference:GLn,fileUpload:C4o,bytes:QLn}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return IA.inlinedRequestBody(e);case"reference":return IA.reference(e);case"fileUpload":return IA.fileUpload(e);case"bytes":return IA.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var B4o=ie.objectWithoutOptionalProperties({requestBodies:ie.list(JLn).optional()});var I4o=ie.union("type",{typeReference:GLn,bytes:QLn}).transform({transform:e=>{switch(e.type){case"typeReference":return H$t.typeReference(e);case"bytes":return H$t.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var z4o=ie.objectWithoutOptionalProperties({wrapperName:Sd,bodyKey:Sd,includePathParameters:ie.boolean().optional(),onlyPathParameters:ie.boolean().optional()});var R4o=ie.union("type",{justRequestBody:ie.object({value:I4o}),wrapper:z4o}).transform({transform:e=>{switch(e.type){case"justRequestBody":return $Ne.justRequestBody(e.value);case"wrapper":return $Ne.wrapper(e);default:return e}},untransform:({_visit:e,...t})=>t});var x4o=ie.objectWithoutOptionalProperties({streamParameter:qJ.optional(),requestParameterName:Sd,shape:R4o});var N4o=ie.objectWithoutOptionalProperties({responseBodyType:ie.lazy(()=>av)}).extend(Dd).extend(gI);var F4o=ie.objectWithoutOptionalProperties({responseBodyType:ie.lazy(()=>av),responseProperty:Ak.optional()}).extend(Dd).extend(gI);var KLn=ie.union("type",{response:N4o,nestedPropertyAsResponse:F4o}).transform({transform:e=>{switch(e.type){case"response":return OL.response(e);case"nestedPropertyAsResponse":return OL.nestedPropertyAsResponse(e);default:return e}},untransform:({_visit:e,...t})=>t});var YLn=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var XLn=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var ZLn=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var L4o=ie.objectWithoutOptionalProperties({payload:ie.lazy(()=>av),terminator:ie.string().optional()}).extend(Dd).extend(gI);var U4o=ie.objectWithoutOptionalProperties({}).extend(Dd).extend(gI);var V4o=ie.objectWithoutOptionalProperties({payload:ie.lazy(()=>av),terminator:ie.string().optional()}).extend(Dd).extend(gI);var kLn=ie.union("type",{json:L4o,text:U4o,sse:V4o}).transform({transform:e=>{switch(e.type){case"json":return mL.json(e);case"text":return mL.text(e);case"sse":return mL.sse(e);default:return e}},untransform:({_visit:e,...t})=>t});var W4o=ie.union("type",{json:ie.object({value:KLn}),fileDownload:YLn,text:XLn,bytes:ZLn}).transform({transform:e=>{switch(e.type){case"json":return _H.json(e.value);case"fileDownload":return _H.fileDownload(e);case"text":return _H.text(e);case"bytes":return _H.bytes(e);default:return e}},untransform:({_visit:e,...t})=>t});var H4o=ie.objectWithoutOptionalProperties({nonStreamResponse:W4o,streamResponse:kLn});var $4o=ie.union("type",{json:ie.object({value:KLn}),fileDownload:YLn,text:XLn,bytes:ZLn,streaming:ie.object({value:kLn}),streamParameter:H4o}).transform({transform:e=>{switch(e.type){case"json":return c1.json(e.value);case"fileDownload":return c1.fileDownload(e);case"text":return c1.text(e);case"bytes":return c1.bytes(e);case"streaming":return c1.streaming(e.value);case"streamParameter":return c1.streamParameter(e);default:return e}},untransform:({_visit:e,...t})=>t});var eUn=ie.objectWithoutOptionalProperties({statusCode:ie.property("status-code",ie.number().optional()),body:$4o.optional()});var G4o=ie.objectWithoutOptionalProperties({responses:ie.list(eUn).optional()});var Q4o=ie.objectWithoutOptionalProperties({error:pzi}).extend(Dd);var J4o=ie.list(Q4o);var K4o=ie.objectWithoutOptionalProperties({page:qJ,next:EL,results:EL});var Y4o=ie.objectWithoutOptionalProperties({page:qJ,results:EL,hasNextPage:EL.optional(),step:qJ.optional()});var X4o=ie.objectWithoutOptionalProperties({results:EL});var Z4o=ie.union("type",{cursor:K4o,offset:Y4o,custom:X4o}).transform({transform:e=>{switch(e.type){case"cursor":return EJ.cursor(e);case"offset":return EJ.offset(e);case"custom":return EJ.custom(e);default:return e}},untransform:({_visit:e,...t})=>t});var k4o=ie.objectWithoutOptionalProperties({name:Sd.optional(),language:ie.string(),code:ie.string(),install:ie.string().optional()}).extend(Dd);var e2o=ie.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java"]);var t2o=ie.objectWithoutOptionalProperties({name:Sd.optional(),sdk:e2o,code:ie.string()}).extend(Dd);var r2o=ie.union("type",{language:k4o,sdk:t2o}).transform({transform:e=>{switch(e.type){case"language":return pAe.language(e);case"sdk":return pAe.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var _zi=ie.objectWithoutOptionalProperties({name:Sd,value:ie.lazyObject(()=>Sm)});var Cen=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm)});var i2o=ie.union("type",{single:ie.object({}),exploded:ie.object({}),commaSeparated:ie.object({})}).transform({transform:e=>{switch(e.type){case"single":return q8.single();case"exploded":return q8.exploded();case"commaSeparated":return q8.commaSeparated();default:return e}},untransform:({_visit:e,...t})=>t});var tUn=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm),shape:i2o.optional()});var n2o=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm),originalTypeDeclaration:OI.optional()});var rUn=ie.objectWithoutOptionalProperties({properties:ie.list(n2o)}).extend($rr);var a2o=ie.union("type",{inlinedRequestBody:rUn,reference:ie.lazyObject(()=>Sm)}).transform({transform:e=>{switch(e.type){case"inlinedRequestBody":return MJ.inlinedRequestBody(e);case"reference":return MJ.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var o2o=ie.objectWithoutOptionalProperties({event:ie.string(),data:ie.lazyObject(()=>Sm)});var u2o=ie.union("type",{body:ie.object({value:ie.lazyObject(()=>Sm).optional()}),stream:ie.object({value:ie.list(ie.lazyObject(()=>Sm))}),sse:ie.object({value:ie.list(o2o)})}).transform({transform:e=>{switch(e.type){case"body":return NB.body(e.value);case"stream":return NB.stream(e.value);case"sse":return NB.sse(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var s2o=ie.objectWithoutOptionalProperties({error:pzi,body:ie.lazyObject(()=>Sm).optional()});var c2o=ie.union("type",{ok:ie.object({value:u2o}),error:s2o}).transform({transform:e=>{switch(e.type){case"ok":return gC.ok(e.value);case"error":return gC.error(e);default:return e}},untransform:({_visit:e,...t})=>t});var iUn=ie.objectWithoutOptionalProperties({id:ie.string().optional(),name:Sd.optional(),url:ie.string(),rootPathParameters:ie.list(_zi),servicePathParameters:ie.list(_zi),endpointPathParameters:ie.list(_zi),serviceHeaders:ie.list(Cen),endpointHeaders:ie.list(Cen),queryParameters:ie.list(tUn),request:a2o.optional(),response:c2o}).extend(Dd);var l2o=ie.objectWithoutOptionalProperties({codeSamples:ie.list(r2o).optional(),example:iUn.optional()});var f2o=ie.objectWithoutOptionalProperties({example:iUn});var d2o=ie.objectWithoutOptionalProperties({namespace:ie.string()});var p2o=ie.objectWithoutOptionalProperties({csharp:d2o.optional()});var nUn=ie.objectWithoutOptionalProperties({filepath:ie.string(),packageName:ie.string().optional(),options:p2o.optional()});var _2o=ie.objectWithoutOptionalProperties({file:nUn,name:Sd});var h2o=ie.objectWithoutOptionalProperties({service:_2o});var aUn=ie.union("type",{http:ie.object({}),grpc:h2o}).transform({transform:e=>{switch(e.type){case"http":return WNe.http();case"grpc":return WNe.grpc(e);default:return e}},untransform:({_visit:e,...t})=>t});var y2o=ie.enum_(["UNARY","CLIENT_STREAM","SERVER_STREAM","BIDIRECTIONAL_STREAM"]);var v2o=ie.objectWithoutOptionalProperties({methodType:y2o.optional()});var b2o=ie.union("type",{proto:v2o,openapi:ie.object({}),openrpc:ie.object({})}).transform({transform:e=>{switch(e.type){case"proto":return DJ.proto(e);case"openapi":return DJ.openapi();case"openrpc":return DJ.openrpc();default:return e}},untransform:({_visit:e,...t})=>t});var g2o=ie.objectWithoutOptionalProperties({id:J$t,name:j4o,displayName:ie.string().optional(),method:MLn,headers:ie.list(Tk),baseUrl:qk.optional(),v2BaseUrls:ie.list(qk).optional(),basePath:KNe.optional(),path:KNe,fullPath:KNe,pathParameters:ie.list(K$t),allPathParameters:ie.list(K$t),queryParameters:ie.list(czi),requestBody:JLn.optional(),v2RequestBodies:B4o.optional(),sdkRequest:x4o.optional(),response:eUn.optional(),v2Responses:G4o.optional(),errors:J4o,auth:ie.boolean(),idempotent:ie.boolean(),pagination:Z4o.optional(),userSpecifiedExamples:ie.list(l2o),autogeneratedExamples:ie.list(f2o),v2Examples:H6o.optional(),transport:aUn.optional(),source:b2o.optional(),audiences:ie.list(jLn).optional()}).extend(j4);var O2o=ie.objectWithoutOptionalProperties({});var m2o=ie.objectWithoutOptionalProperties({});var oUn=ie.objectWithoutOptionalProperties({json:O2o.optional(),proto:m2o.optional()});var P2o=ie.objectWithoutOptionalProperties({availability:Hrr.optional(),name:m4o,displayName:ie.string().optional(),basePath:KNe,endpoints:ie.list(g2o),headers:ie.list(Tk),pathParameters:ie.list(K$t),encoding:oUn.optional(),transport:aUn.optional(),audiences:ie.list(jLn).optional()});var _tc={};Po(_tc,{ApiDefinitionSource:()=>x8o,ApiDefinitionSourceId:()=>z8o,ApiVersionScheme:()=>w2o,ErrorDiscriminationByPropertyStrategy:()=>E8o,ErrorDiscriminationStrategy:()=>M8o,HeaderApiVersionScheme:()=>j2o,IntermediateRepresentation:()=>NEp,Package:()=>dUn,PackageNavigationConfig:()=>S8o,PlatformHeaders:()=>q8o,ProtoSource:()=>R8o,ReadmeConfig:()=>I8o,SdkConfig:()=>T8o,ServiceTypeReferenceInfo:()=>B8o,SourceConfig:()=>N8o,Subpackage:()=>D8o,UserAgent:()=>A8o});var oOi=ie.objectWithoutOptionalProperties({name:Gh}).extend(j4);var uUn=ie.objectWithoutOptionalProperties({default:oOi.optional(),values:ie.list(oOi)});var j2o=ie.objectWithoutOptionalProperties({header:Tk,value:uUn});var w2o=ie.union("type",{header:j2o}).transform({transform:e=>{switch(e.type){case"header":return azi.header(e);default:return e}},untransform:({_visit:e,...t})=>t});var S2o=ie.enum_(["ENUM","OBJECT","UNION","UNDISCRIMINATED_UNION"]);var D2o=ie.objectWithoutOptionalProperties({name:OI,shape:S2o});var E2o=ie.objectWithoutOptionalProperties({min:ie.number().optional(),max:ie.number().optional(),exclusiveMin:ie.boolean().optional(),exclusiveMax:ie.boolean().optional(),multipleOf:ie.number().optional()});var M2o=ie.objectWithoutOptionalProperties({default:ie.number().optional(),validation:E2o.optional()});var A2o=ie.objectWithoutOptionalProperties({default:ie.number().optional()});var q2o=ie.objectWithoutOptionalProperties({});var T2o=ie.objectWithoutOptionalProperties({});var C2o=ie.objectWithoutOptionalProperties({});var B2o=ie.objectWithoutOptionalProperties({min:ie.number().optional(),max:ie.number().optional(),exclusiveMin:ie.boolean().optional(),exclusiveMax:ie.boolean().optional(),multipleOf:ie.number().optional()});var I2o=ie.objectWithoutOptionalProperties({default:ie.number().optional(),validation:B2o.optional()});var z2o=ie.objectWithoutOptionalProperties({default:ie.boolean().optional()});var R2o=ie.objectWithoutOptionalProperties({format:ie.string().optional(),pattern:ie.string().optional(),minLength:ie.number().optional(),maxLength:ie.number().optional()});var x2o=ie.objectWithoutOptionalProperties({default:ie.string().optional(),validation:R2o.optional()});var N2o=ie.objectWithoutOptionalProperties({});var F2o=ie.objectWithoutOptionalProperties({});var L2o=ie.objectWithoutOptionalProperties({});var U2o=ie.objectWithoutOptionalProperties({});var V2o=ie.objectWithoutOptionalProperties({default:ie.string().optional()});var W2o=ie.union("type",{integer:M2o,long:A2o,uint:q2o,uint64:T2o,float:C2o,double:I2o,boolean:z2o,string:x2o,date:N2o,dateTime:F2o,uuid:L2o,base64:U2o,bigInteger:V2o}).transform({transform:e=>{switch(e.type){case"integer":return Td.integer(e);case"long":return Td.long(e);case"uint":return Td.uint(e);case"uint64":return Td.uint64(e);case"float":return Td.float(e);case"double":return Td.double(e);case"boolean":return Td.boolean(e);case"string":return Td.string(e);case"date":return Td.date(e);case"dateTime":return Td.dateTime(e);case"uuid":return Td.uuid(e);case"base64":return Td.base64(e);case"bigInteger":return Td.bigInteger(e);default:return e}},untransform:({_visit:e,...t})=>t});var sUn=ie.objectWithoutOptionalProperties({v1:BLn,v2:W2o.optional()});var H2o=ie.union(ie.discriminant("type","_type"),{container:ie.object({container:ie.lazy(()=>cUn)}),named:D2o,primitive:ie.object({primitive:sUn}),unknown:ie.object({})}).transform({transform:e=>{switch(e.type){case"container":return hH.container(e.container);case"named":return hH.named(e);case"primitive":return hH.primitive(e.primitive);case"unknown":return hH.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var $2o=ie.objectWithoutOptionalProperties({aliasOf:ie.lazy(()=>av),resolvedType:H2o});var G2o=ie.objectWithoutOptionalProperties({extends:ie.list(OI),properties:ie.list(Ak),extendedProperties:ie.list(Ak).optional(),extraProperties:ie.property("extra-properties",ie.boolean())});var Q2o=ie.objectWithoutOptionalProperties({name:Gh,type:ie.lazy(()=>av)});var J2o=ie.union(ie.discriminant("propertiesType","_type"),{samePropertiesAsObject:OI,singleProperty:Q2o,noProperties:ie.object({})}).transform({transform:e=>{switch(e.propertiesType){case"samePropertiesAsObject":return PL.samePropertiesAsObject(e);case"singleProperty":return PL.singleProperty(e);case"noProperties":return PL.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var K2o=ie.objectWithoutOptionalProperties({discriminantValue:Gh,shape:J2o,displayName:ie.string().optional(),availability:Hrr.optional()}).extend(Dd);var Y2o=ie.objectWithoutOptionalProperties({discriminant:Gh,extends:ie.list(OI),types:ie.list(K2o),baseProperties:ie.list(Ak)});var X2o=ie.objectWithoutOptionalProperties({type:ie.lazy(()=>av)}).extend(Dd);var Z2o=ie.objectWithoutOptionalProperties({members:ie.list(X2o)});var k2o=ie.union(ie.discriminant("type","_type"),{alias:$2o,enum:uUn,object:G2o,union:Y2o,undiscriminatedUnion:Z2o}).transform({transform:e=>{switch(e.type){case"alias":return Vb.alias(e);case"enum":return Vb.enum(e);case"object":return Vb.object(e);case"union":return Vb.union(e);case"undiscriminatedUnion":return Vb.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var gNa=ie.objectWithoutOptionalProperties({name:Sd.optional(),shape:ie.lazy(()=>lUn)}).extend($rr).extend(Dd);var e8o=ie.union("type",{any:ie.object({}),api:ie.object({}),boolValue:ie.object({}),bytesValue:ie.object({}),doubleValue:ie.object({}),duration:ie.object({}),empty:ie.object({}),enum:ie.object({}),enumValue:ie.object({}),field:ie.object({}),fieldCardinality:ie.object({}),fieldKind:ie.object({}),fieldMask:ie.object({}),floatValue:ie.object({}),int32Value:ie.object({}),int64Value:ie.object({}),listValue:ie.object({}),method:ie.object({}),mixin:ie.object({}),nullValue:ie.object({}),option:ie.object({}),sourceContext:ie.object({}),stringValue:ie.object({}),struct:ie.object({}),syntax:ie.object({}),timestamp:ie.object({}),type:ie.object({}),uint32Value:ie.object({}),uint64Value:ie.object({}),value:ie.object({})}).transform({transform:e=>{switch(e.type){case"any":return od.any();case"api":return od.api();case"boolValue":return od.boolValue();case"bytesValue":return od.bytesValue();case"doubleValue":return od.doubleValue();case"duration":return od.duration();case"empty":return od.empty();case"enum":return od.enum();case"enumValue":return od.enumValue();case"field":return od.field();case"fieldCardinality":return od.fieldCardinality();case"fieldKind":return od.fieldKind();case"fieldMask":return od.fieldMask();case"floatValue":return od.floatValue();case"int32Value":return od.int32Value();case"int64Value":return od.int64Value();case"listValue":return od.listValue();case"method":return od.method();case"mixin":return od.mixin();case"nullValue":return od.nullValue();case"option":return od.option();case"sourceContext":return od.sourceContext();case"stringValue":return od.stringValue();case"struct":return od.struct();case"syntax":return od.syntax();case"timestamp":return od.timestamp();case"type":return od.type();case"uint32Value":return od.uint32Value();case"uint64Value":return od.uint64Value();case"value":return od.value();default:return e}},untransform:({_visit:e,...t})=>t});var t8o=ie.objectWithoutOptionalProperties({file:nUn,name:Sd});var r8o=ie.union("type",{wellKnown:ie.object({value:e8o}),userDefined:t8o}).transform({transform:e=>{switch(e.type){case"wellKnown":return mw.wellKnown(e.value);case"userDefined":return mw.userDefined(e);default:return e}},untransform:({_visit:e,...t})=>t});var i8o=ie.union("type",{proto:ie.object({value:r8o})}).transform({transform:e=>{switch(e.type){case"proto":return aOi.proto(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var n8o=ie.objectWithoutOptionalProperties({name:OI,shape:k2o,autogeneratedExamples:ie.list(gNa),userProvidedExamples:ie.list(gNa),v2Examples:DL.optional(),referencedTypes:ie.set(Gx),encoding:oUn.optional(),source:i8o.optional(),inline:ie.boolean().optional()}).extend(j4);var a8o=Sd;var o8o=ie.enum_(["GET","POST"]);var u8o=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av)}).extend(lzi);var s8o=ie.objectWithoutOptionalProperties({name:Sd,extends:ie.list(OI),properties:ie.list(u8o)});var c8o=ie.objectWithoutOptionalProperties({payloadType:ie.lazy(()=>av)}).extend(Dd);var l8o=ie.union("type",{inlinedPayload:s8o,reference:c8o}).transform({transform:e=>{switch(e.type){case"inlinedPayload":return yH.inlinedPayload(e);case"reference":return yH.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var f8o=ie.objectWithoutOptionalProperties({name:Sd.optional(),payload:ie.lazyObject(()=>Sm)}).extend(Dd);var d8o=ie.objectWithoutOptionalProperties({id:M7o,name:a8o,displayName:ie.string().optional(),method:o8o,headers:ie.list(Tk),payload:l8o,examples:ie.list(f8o).optional(),v2Examples:J6o.optional()}).extend(j4);var p8o=ie.list(d8o);var _8o=Sd;var fUn=ie.string();var h8o=ie.enum_(["client","server"]);var y8o=ie.objectWithoutOptionalProperties({name:Gh,valueType:ie.lazy(()=>av)}).extend(lzi);var v8o=ie.objectWithoutOptionalProperties({name:Sd,extends:ie.list(OI),properties:ie.list(y8o)});var b8o=ie.objectWithoutOptionalProperties({bodyType:ie.lazy(()=>av)}).extend(Dd);var g8o=ie.union("type",{inlinedBody:v8o,reference:b8o}).transform({transform:e=>{switch(e.type){case"inlinedBody":return wL.inlinedBody(e);case"reference":return wL.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var O8o=ie.objectWithoutOptionalProperties({type:fUn,displayName:ie.string().optional(),origin:h8o,body:g8o}).extend(j4);var m8o=ie.union("type",{inlinedBody:rUn,reference:ie.lazyObject(()=>Sm)}).transform({transform:e=>{switch(e.type){case"inlinedBody":return hAe.inlinedBody(e);case"reference":return hAe.reference(e);default:return e}},untransform:({_visit:e,...t})=>t});var P8o=ie.objectWithoutOptionalProperties({type:fUn,body:m8o});var j8o=ie.objectWithoutOptionalProperties({name:Sd.optional(),url:ie.string(),pathParameters:ie.list(_zi),headers:ie.list(Cen),queryParameters:ie.list(tUn),messages:ie.list(P8o)}).extend(Dd);var w8o=ie.objectWithoutOptionalProperties({name:_8o,displayName:ie.string().optional(),baseUrl:qk.optional(),path:KNe,auth:ie.boolean(),headers:ie.list(Tk),queryParameters:ie.list(czi),pathParameters:ie.list(K$t),messages:ie.list(O8o),examples:ie.list(j8o),v2Examples:Q6o.optional()}).extend(j4);var S8o=ie.objectWithoutOptionalProperties({pointsTo:Wrr});var dUn=ie.objectWithoutOptionalProperties({fernFilepath:ooe,service:Vrr.optional(),types:ie.list(Gx),errors:ie.list(dzi),webhooks:DLn.optional(),websocket:ELn.optional(),subpackages:ie.list(Wrr),hasEndpointsInTree:ie.boolean(),navigationConfig:S8o.optional()}).extend(Dd);var D8o=ie.objectWithoutOptionalProperties({name:Sd,displayName:fzi.optional()}).extend(dUn);var E8o=ie.objectWithoutOptionalProperties({discriminant:Gh,contentProperty:Gh});var M8o=ie.union("type",{statusCode:ie.object({}),property:E8o}).transform({transform:e=>{switch(e.type){case"statusCode":return _Ae.statusCode();case"property":return _Ae.property(e);default:return e}},untransform:({_visit:e,...t})=>t});var A8o=ie.objectWithoutOptionalProperties({header:ie.stringLiteral("User-Agent"),value:ie.string()});var q8o=ie.objectWithoutOptionalProperties({language:ie.string(),sdkName:ie.string(),sdkVersion:ie.string(),userAgent:A8o.optional()});var T8o=ie.objectWithoutOptionalProperties({isAuthMandatory:ie.boolean(),hasStreamingEndpoints:ie.boolean(),hasPaginatedEndpoints:ie.boolean(),hasFileDownloadEndpoints:ie.boolean(),platformHeaders:q8o});var C8o=ie.objectWithoutOptionalProperties({id:HLn,name:Sd,type:ie.lazy(()=>av)}).extend(Dd);var B8o=ie.objectWithoutOptionalProperties({typesReferencedOnlyByService:ie.record(Vrr,ie.list(Gx)),sharedTypes:ie.list(Gx)});var I8o=ie.objectWithoutOptionalProperties({defaultEndpoint:J$t.optional(),bannerLink:ie.string().optional(),introduction:ie.string().optional(),apiReferenceLink:ie.string().optional(),apiName:ie.string().optional(),disabledFeatures:ie.list(hNa).optional(),whiteLabel:ie.boolean().optional(),features:ie.record(hNa,ie.list(J$t)).optional()});var z8o=ie.string();var R8o=ie.objectWithoutOptionalProperties({id:z8o,protoRootUrl:ie.string()});var x8o=ie.union("type",{proto:R8o,openapi:ie.object({})}).transform({transform:e=>{switch(e.type){case"proto":return noe.proto(e);case"openapi":return noe.openapi();default:return e}},untransform:({_visit:e,...t})=>t});var N8o=ie.objectWithoutOptionalProperties({sources:ie.list(x8o)});var F8o=ie.objectWithoutOptionalProperties({apiKey:ie.string(),workspaceId:ie.string(),collectionId:ie.string().optional()});var L8o=ie.objectWithoutOptionalProperties({version:ie.string().optional(),packageName:ie.string().optional(),tokenEnvironmentVariable:ie.string()});var U8o=ie.objectWithoutOptionalProperties({coordinate:ie.string().optional(),version:ie.string().optional(),usernameEnvironmentVariable:ie.string(),passwordEnvironmentVariable:ie.string(),mavenUrlEnvironmentVariable:ie.string()});var V8o=ie.objectWithoutOptionalProperties({version:ie.string().optional(),packageName:ie.string().optional()});var hzi=ie.union("type",{postman:F8o,npm:L8o,maven:U8o,pypi:V8o}).transform({transform:e=>{switch(e.type){case"postman":return aoe.postman(e);case"npm":return aoe.npm(e);case"maven":return aoe.maven(e);case"pypi":return aoe.pypi(e);default:return e}},untransform:({_visit:e,...t})=>t});var W8o=ie.objectWithoutOptionalProperties({owner:ie.string(),repo:ie.string(),uri:ie.string().optional(),token:ie.string().optional(),target:hzi});var H8o=ie.objectWithoutOptionalProperties({target:hzi});var $8o=ie.objectWithoutOptionalProperties({generateFullProject:ie.boolean(),publishTarget:hzi.optional()});var G8o=ie.union("type",{github:W8o,direct:H8o,filesystem:$8o}).transform({transform:e=>{switch(e.type){case"github":return Lrr.github(e);case"direct":return Lrr.direct(e);case"filesystem":return Lrr.filesystem(e);default:return e}},untransform:({_visit:e,...t})=>t});var NEp=ie.objectWithoutOptionalProperties({fdrApiDefinitionId:ie.string().optional(),apiVersion:w2o.optional(),apiName:Sd,apiDisplayName:ie.string().optional(),apiDocs:ie.string().optional(),auth:D7o,headers:ie.list(Tk),idempotencyHeaders:ie.list(Tk),types:ie.record(Gx,n8o),services:ie.record(Vrr,P2o),webhookGroups:ie.record(DLn,p8o),websocketChannels:ie.record(ELn,w8o).optional(),errors:ie.record(dzi,C6o),subpackages:ie.record(Wrr,D8o),rootPackage:dUn,constants:A7o,environments:CLn.optional(),basePath:KNe.optional(),pathParameters:ie.list(K$t),errorDiscriminationStrategy:M8o,sdkConfig:T8o,variables:ie.list(C8o),serviceTypeReferenceInfo:B8o,readmeConfig:I8o.optional(),sourceConfig:N8o.optional(),publishConfig:G8o.optional(),dynamic:E6o.optional(),selfHosted:ie.boolean().optional(),audiences:ie.list(s7o).optional()});var htc={};Po(htc,{CsharpProtobufFileOptions:()=>d2o,ProtobufFile:()=>nUn,ProtobufFileOptions:()=>p2o,ProtobufMethodType:()=>y2o,ProtobufService:()=>_2o,ProtobufType:()=>r8o,UserDefinedProtobufType:()=>t8o,WellKnownProtobufType:()=>e8o});var ytc={};Po(ytc,{DirectPublish:()=>H8o,Filesystem:()=>$8o,GithubPublish:()=>W8o,MavenPublishTarget:()=>U8o,NpmPublishTarget:()=>L8o,PostmanPublishTarget:()=>F8o,PublishTarget:()=>hzi,PublishingConfig:()=>G8o,PypiPublishTarget:()=>V8o});var vtc={};Po(vtc,{AliasTypeDeclaration:()=>$2o,Base64Type:()=>U2o,BigIntegerType:()=>V2o,BooleanType:()=>z2o,ContainerType:()=>cUn,DateTimeType:()=>F2o,DateType:()=>N2o,DeclaredTypeName:()=>OI,DoubleType:()=>I2o,DoubleValidationRules:()=>B2o,Encoding:()=>oUn,EnumTypeDeclaration:()=>uUn,EnumTypeReference:()=>FEp,EnumValue:()=>oOi,ExampleAliasType:()=>Z8o,ExampleContainer:()=>u5o,ExampleDatetime:()=>o5o,ExampleEnumType:()=>X8o,ExampleKeyValuePair:()=>h5o,ExampleListContainer:()=>l5o,ExampleLiteralContainer:()=>c5o,ExampleMapContainer:()=>_5o,ExampleNamedType:()=>s5o,ExampleNullableContainer:()=>p5o,ExampleObjectProperty:()=>t5o,ExampleObjectType:()=>pUn,ExampleObjectTypeWithTypeId:()=>n5o,ExampleOptionalContainer:()=>d5o,ExamplePrimitive:()=>_Un,ExampleSetContainer:()=>f5o,ExampleSingleUnionType:()=>r5o,ExampleSingleUnionTypeProperties:()=>i5o,ExampleType:()=>gNa,ExampleTypeReference:()=>Sm,ExampleTypeReferenceShape:()=>a5o,ExampleTypeShape:()=>lUn,ExampleUndiscriminatedUnionType:()=>e5o,ExampleUnionType:()=>k8o,FloatType:()=>C2o,IntegerType:()=>M2o,IntegerValidationRules:()=>E2o,JsonEncoding:()=>O2o,Literal:()=>K8o,LongType:()=>A2o,MapType:()=>Y8o,NamedType:()=>J8o,NamedTypeDefault:()=>Q8o,ObjectProperty:()=>Ak,ObjectPropertyAccess:()=>wLn,ObjectTypeDeclaration:()=>G2o,PrimitiveType:()=>sUn,PrimitiveTypeV1:()=>BLn,PrimitiveTypeV2:()=>W2o,ProtoEncoding:()=>m2o,ResolvedNamedType:()=>D2o,ResolvedTypeReference:()=>H2o,ShapeType:()=>S2o,SingleUnionType:()=>K2o,SingleUnionTypeProperties:()=>J2o,SingleUnionTypeProperty:()=>Q2o,Source:()=>i8o,StringType:()=>x2o,StringValidationRules:()=>R2o,Type:()=>k2o,TypeDeclaration:()=>n8o,TypeReference:()=>av,Uint64Type:()=>T2o,UintType:()=>q2o,UndiscriminatedUnionMember:()=>X2o,UndiscriminatedUnionTypeDeclaration:()=>Z2o,UnionTypeDeclaration:()=>Y2o,UuidType:()=>L2o});var Q8o=ie.union("type",{enum:oOi}).transform({transform:e=>{switch(e.type){case"enum":return gLn.enum(e);default:return e}},untransform:({_visit:e,...t})=>t});var J8o=ie.objectWithoutOptionalProperties({typeId:Gx,fernFilepath:ooe,name:Sd,displayName:fzi.optional(),default:Q8o.optional(),inline:ie.boolean().optional()});var av=ie.union(ie.discriminant("type","_type"),{container:ie.object({container:ie.lazy(()=>cUn)}),named:J8o,primitive:ie.object({primitive:sUn}),unknown:ie.object({})}).transform({transform:e=>{switch(e.type){case"container":return Xc.container(e.container);case"named":return Xc.named(e);case"primitive":return Xc.primitive(e.primitive);case"unknown":return Xc.unknown();default:return e}},untransform:({_visit:e,...t})=>t});var FEp=ie.objectWithoutOptionalProperties({default:oOi.optional(),name:OI});var K8o=ie.union("type",{string:ie.object({string:ie.string()}),boolean:ie.object({boolean:ie.boolean()})}).transform({transform:e=>{switch(e.type){case"string":return jL.string(e.string);case"boolean":return jL.boolean(e.boolean);default:return e}},untransform:({_visit:e,...t})=>t});var cUn=ie.union(ie.discriminant("type","_type"),{list:ie.object({list:ie.lazy(()=>av)}),map:ie.lazyObject(()=>Y8o),nullable:ie.object({nullable:ie.lazy(()=>av)}),optional:ie.object({optional:ie.lazy(()=>av)}),set:ie.object({set:ie.lazy(()=>av)}),literal:ie.object({literal:K8o})}).transform({transform:e=>{switch(e.type){case"list":return Ry.list(e.list);case"map":return Ry.map(e);case"nullable":return Ry.nullable(e.nullable);case"optional":return Ry.optional(e.optional);case"set":return Ry.set(e.set);case"literal":return Ry.literal(e.literal);default:return e}},untransform:({_visit:e,...t})=>t});var Y8o=ie.objectWithoutOptionalProperties({keyType:ie.lazy(()=>av),valueType:ie.lazy(()=>av)});var X8o=ie.objectWithoutOptionalProperties({value:Gh});var lUn=ie.union("type",{alias:ie.lazyObject(()=>Z8o),enum:X8o,object:ie.lazyObject(()=>pUn),union:ie.lazyObject(()=>k8o),undiscriminatedUnion:ie.lazyObject(()=>e5o)}).transform({transform:e=>{switch(e.type){case"alias":return l1.alias(e);case"enum":return l1.enum(e);case"object":return l1.object(e);case"union":return l1.union(e);case"undiscriminatedUnion":return l1.undiscriminatedUnion(e);default:return e}},untransform:({_visit:e,...t})=>t});var Z8o=ie.objectWithoutOptionalProperties({value:ie.lazyObject(()=>Sm)});var pUn=ie.objectWithoutOptionalProperties({properties:ie.list(ie.lazyObject(()=>t5o))});var t5o=ie.objectWithoutOptionalProperties({name:Gh,value:ie.lazyObject(()=>Sm),originalTypeDeclaration:OI});var k8o=ie.objectWithoutOptionalProperties({discriminant:Gh,singleUnionType:ie.lazyObject(()=>r5o)});var e5o=ie.objectWithoutOptionalProperties({index:ie.number(),singleUnionType:ie.lazyObject(()=>Sm)});var r5o=ie.objectWithoutOptionalProperties({wireDiscriminantValue:Gh,shape:ie.lazy(()=>i5o)});var i5o=ie.union("type",{samePropertiesAsObject:ie.lazyObject(()=>n5o),singleProperty:ie.lazyObject(()=>Sm),noProperties:ie.object({})}).transform({transform:e=>{switch(e.type){case"samePropertiesAsObject":return K3.samePropertiesAsObject(e);case"singleProperty":return K3.singleProperty(e);case"noProperties":return K3.noProperties();default:return e}},untransform:({_visit:e,...t})=>t});var Sm=ie.objectWithoutOptionalProperties({shape:ie.lazy(()=>a5o)}).extend($rr);var o5o=ie.objectWithoutOptionalProperties({datetime:ie.date(),raw:ie.string().optional()});var _Un=ie.union("type",{integer:ie.object({integer:ie.number()}),long:ie.object({long:ie.number()}),uint:ie.object({uint:ie.number()}),uint64:ie.object({uint64:ie.number()}),float:ie.object({float:ie.number()}),double:ie.object({double:ie.number()}),boolean:ie.object({boolean:ie.boolean()}),string:ie.object({string:E7o}),date:ie.object({date:ie.string()}),datetime:o5o,uuid:ie.object({uuid:ie.string()}),base64:ie.object({base64:ie.string()}),bigInteger:ie.object({bigInteger:ie.string()})}).transform({transform:e=>{switch(e.type){case"integer":return Vd.integer(e.integer);case"long":return Vd.long(e.long);case"uint":return Vd.uint(e.uint);case"uint64":return Vd.uint64(e.uint64);case"float":return Vd.float(e.float);case"double":return Vd.double(e.double);case"boolean":return Vd.boolean(e.boolean);case"string":return Vd.string(e.string);case"date":return Vd.date(e.date);case"datetime":return Vd.datetime(e);case"uuid":return Vd.uuid(e.uuid);case"base64":return Vd.base64(e.base64);case"bigInteger":return Vd.bigInteger(e.bigInteger);default:return e}},untransform:({_visit:e,...t})=>t});var a5o=ie.union("type",{primitive:ie.object({primitive:_Un}),container:ie.object({container:ie.lazy(()=>u5o)}),unknown:ie.object({unknown:ie.unknown()}),named:ie.lazyObject(()=>s5o)}).transform({transform:e=>{switch(e.type){case"primitive":return ay.primitive(e.primitive);case"container":return ay.container(e.container);case"unknown":return ay.unknown(e.unknown);case"named":return ay.named(e);default:return e}},untransform:({_visit:e,...t})=>t});var c5o=ie.objectWithoutOptionalProperties({literal:_Un});var u5o=ie.union("type",{list:ie.lazyObject(()=>l5o),set:ie.lazyObject(()=>f5o),optional:ie.lazyObject(()=>d5o),nullable:ie.lazyObject(()=>p5o),map:ie.lazyObject(()=>_5o),literal:c5o}).transform({transform:e=>{switch(e.type){case"list":return Wm.list(e);case"set":return Wm.set(e);case"optional":return Wm.optional(e);case"nullable":return Wm.nullable(e);case"map":return Wm.map(e);case"literal":return Wm.literal(e);default:return e}},untransform:({_visit:e,...t})=>t});var l5o=ie.objectWithoutOptionalProperties({list:ie.list(ie.lazyObject(()=>Sm)),itemType:ie.lazy(()=>av)});var f5o=ie.objectWithoutOptionalProperties({set:ie.list(ie.lazyObject(()=>Sm)),itemType:ie.lazy(()=>av)});var d5o=ie.objectWithoutOptionalProperties({optional:ie.lazyObject(()=>Sm).optional(),valueType:ie.lazy(()=>av)});var p5o=ie.objectWithoutOptionalProperties({nullable:ie.lazyObject(()=>Sm).optional(),valueType:ie.lazy(()=>av)});var _5o=ie.objectWithoutOptionalProperties({map:ie.list(ie.lazyObject(()=>h5o)),keyType:ie.lazy(()=>av),valueType:ie.lazy(()=>av)});var h5o=ie.objectWithoutOptionalProperties({key:ie.lazyObject(()=>Sm),value:ie.lazyObject(()=>Sm)});var s5o=ie.objectWithoutOptionalProperties({typeName:OI,shape:ie.lazy(()=>lUn)});var n5o=ie.objectWithoutOptionalProperties({typeId:Gx,object:ie.lazyObject(()=>pUn)});var btc={};Po(btc,{VariableDeclaration:()=>C8o,VariableId:()=>HLn});var gtc={};Po(gtc,{ExampleWebhookCall:()=>f8o,InlinedWebhookPayload:()=>s8o,InlinedWebhookPayloadProperty:()=>u8o,Webhook:()=>d8o,WebhookGroup:()=>p8o,WebhookHttpMethod:()=>o8o,WebhookName:()=>a8o,WebhookPayload:()=>l8o,WebhookPayloadReference:()=>c8o});var Otc={};Po(Otc,{ExampleWebSocketMessage:()=>P8o,ExampleWebSocketMessageBody:()=>m8o,ExampleWebSocketSession:()=>j8o,InlinedWebSocketMessageBody:()=>v8o,InlinedWebSocketMessageBodyProperty:()=>y8o,WebSocketChannel:()=>w8o,WebSocketMessage:()=>O8o,WebSocketMessageBody:()=>g8o,WebSocketMessageBodyReference:()=>b8o,WebSocketMessageId:()=>fUn,WebSocketMessageOrigin:()=>h8o,WebSocketName:()=>_8o});var Ck={integer:"integer",long:"long",uint:"uint",uint64:"uint64",float:"float",double:"double",boolean:"boolean",string:"string",datetime:"datetime",base64:"base64",uuid:"uuid",date:"date",bigint:"bigint",unknown:"unknown"};var uoe={MAP:/^map<\s*([^,]*)\s*,\s*(.*)\s*>$/,LIST:/^list<\s*(.*)\s*>$/,SET:/^set<\s*(.*)\s*>$/,OPTIONAL:/^optional<\s*(.*)\s*>$/,NULLABLE:/^nullable<\s*(.*)\s*>$/,LITERAL:/^literal<\s*(?:"(.*)"|(true|false))\s*>$/};function Ben({type:e,_default:t,validation:r,visitor:i}){switch(e){case Ck.integer:{let o=r??void 0;return i.primitive({v1:ny.Integer,v2:Td.integer({default:t??void 0,validation:o!=null?{min:o.min,max:o.max,exclusiveMin:o.exclusiveMin,exclusiveMax:o.exclusiveMax,multipleOf:o.multipleOf}:void 0})})}case Ck.double:{let o=r??void 0;return i.primitive({v1:ny.Double,v2:Td.double({default:t??void 0,validation:o!=null?{min:o.min,max:o.max,exclusiveMin:o.exclusiveMin,exclusiveMax:o.exclusiveMax,multipleOf:o.multipleOf}:void 0})})}case Ck.string:{let o=r??void 0;return i.primitive({v1:ny.String,v2:Td.string({default:t??void 0,validation:o!=null?{format:o.format,pattern:o.pattern,minLength:o.minLength,maxLength:o.maxLength}:void 0})})}case Ck.float:return i.primitive({v1:ny.Float,v2:void 0});case Ck.long:return i.primitive({v1:ny.Long,v2:Td.long({default:t??void 0})});case Ck.boolean:return i.primitive({v1:ny.Boolean,v2:Td.boolean({default:t??void 0})});case Ck.datetime:return i.primitive({v1:ny.DateTime,v2:void 0});case Ck.date:return i.primitive({v1:ny.Date,v2:void 0});case Ck.uuid:return i.primitive({v1:ny.Uuid,v2:void 0});case Ck.base64:return i.primitive({v1:ny.Base64,v2:void 0});case Ck.bigint:return i.primitive({v1:ny.BigInteger,v2:Td.bigInteger({default:t??void 0})});case Ck.uint:return i.primitive({v1:ny.Uint,v2:void 0});case Ck.uint64:return i.primitive({v1:ny.Uint64,v2:void 0});case Ck.unknown:return i.unknown()}let n=e.match(uoe.MAP);if(n?.[1]!=null&&n[2]!=null)return i.map({keyType:n[1],valueType:n[2]});let a=e.match(uoe.LIST);if(a?.[1]!=null)return i.list(a[1]);let u=e.match(uoe.SET);if(u?.[1]!=null)return i.set(u[1]);let l=e.match(uoe.OPTIONAL);if(l?.[1]!=null)return i.optional(l[1]);let d=e.match(uoe.NULLABLE);if(d?.[1]!=null)return i.nullable(d[1]);let s=e.match(uoe.LITERAL);if(s?.[1]!=null)return i.literal(jL.string(s[1]));if(s?.[2]!=null){let o=s[2];switch(o){case"false":return i.literal(jL.boolean(!1));case"true":return i.literal(jL.boolean(!0));default:throw new Error(`Unsupported literal value: ${o}`)}}return i.named(e)}var LEp="bytes";function Jrr(e){if(e===LEp)return{isOptional:!1};if(e.match(uoe.OPTIONAL)?.[1]===LEp)return{isOptional:!0}}function ONa(e){let t=typeof e=="string"?e:typeof e.body=="string"?e.body:void 0;if(t!=null)return Jrr(t)}function Ptc({input:e,typeName:t}){for(let r of e.arguments)if(typeof r=="string"){if(r===t)return!0}else if(Ptc({input:r,typeName:t}))return!0;return!1}function UEp(e){return Ptc({input:e,typeName:"file"})}function VEp(e){let t=0,r=0;function i(){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)return;let a="";for(;t<e.length&&e[t]!=="<"&&e[t]!==","&&e[t]!==">";)a+=e[t++];if(a.trim()){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t<e.length&&e[t]==="<"){if(t++,r++,r>128)throw new Error("Internal error; Exceeded maximum recursion depth while parsing generics.");let u={name:a.trim(),arguments:[]};for(;t<e.length&&e[t]!==">";){for(;t<e.length&&/[\s,]/.test(e[t]);)t++;if(t<e.length&&e[t]!==">"){let l=i();l&&u.arguments.push(l)}}if(t<e.length&&e[t]===">")t++,r--;else throw new Error("Malformed input: missing closing '>' for generic arguments.");return u}else return a.trim()}}let n=i();if(typeof n=="object")return n}var jtc="file";function WEp(e){return e.match(uoe.LIST)?.[1]===jtc}function YNe(e){if(e===jtc)return{isOptional:!1,isArray:!1};let t=e.match(uoe.OPTIONAL);if(t?.[1]!==void 0){if(t[1]===jtc)return{isOptional:!0,isArray:!1};if(WEp(t[1]))return{isOptional:!0,isArray:!0}}if(WEp(e))return{isOptional:!1,isArray:!0}}function YaD(e){return typeof e=="string"?!1:hq.parse(e["content-type"])?.isMultiPartFormData()??!1?!0:e.body==null?!1:!!(RB(e.body)&&Object.values(e.body.properties??[]).some(ZaD))}function Ien(e){if(!(!YaD(e)||e.body==null)&&e.name!=null&&e.body!=null&&RB(e.body))return XaD(e.name,e.body)}function XaD(e,t){let r=Object.entries(t.properties??[]).reduce((i,[n,a])=>{let u=typeof a!="string"?a.docs:void 0,l=typeof a!="string"?a["content-type"]:void 0,d=typeof a!="string"?a.style:void 0,s=YNe(typeof a=="string"?a:a.type);return s!=null?i.push({isFile:!0,key:n,docs:u,isOptional:s.isOptional,isArray:s.isArray,contentType:l,style:d}):i.push({isFile:!1,key:n,propertyType:a,docs:u,contentType:l,style:d}),i},[]);return t["extra-properties"],{name:e,extends:t.extends,properties:r}}function ZaD(e){let t=typeof e=="string"?e:e.type;if(t==="file")return!0;if(!t.includes("file"))return!1;let r=VEp(t);return r==null?!1:UEp(r)}var HEp="text";function mNa(e){if(e===HEp)return{isOptional:!1};if(e.match(uoe.OPTIONAL)?.[1]===HEp)return{isOptional:!0}}function X3({type:e,_default:t,validation:r,visitor:i}){return Ben({type:e,_default:t,validation:r,visitor:{primitive:i.primitive,map:({keyType:n,valueType:a})=>i.map({keyType:X3({type:n,_default:void 0,validation:void 0,visitor:i}),valueType:X3({type:a,_default:void 0,validation:void 0,visitor:i})}),list:n=>i.list(X3({type:n,_default:void 0,validation:void 0,visitor:i})),set:n=>i.set(X3({type:n,_default:void 0,validation:void 0,visitor:i})),optional:n=>i.optional(X3({type:n,_default:t,validation:r,visitor:i})),nullable:n=>i.nullable(X3({type:n,_default:t,validation:r,visitor:i})),literal:i.literal,named:i.named,unknown:i.unknown}})}function wtc(e,t){if(kaD(e))return t.sdk(e);if(eoD(e))return t.language(e);So(e)}function kaD(e){return e.sdk!=null}function eoD(e){return e.language!=null}function $Ep(e){return e["response-stream"]!=null&&(typeof e["response-stream"]=="string"||e["response-stream"].format==null||e["response-stream"].format==="json")}function GEp(e){return e["response-stream"]!=null&&typeof e["response-stream"]!="string"&&e["response-stream"].format==="sse"}function zen(e,t,r){return toD(e,t)?r.stream(t):roD(e,t)?r.events(t):r.body(t)}function toD(e,t){return t.stream!==void 0&&$Ep(e)}function roD(e,t){return t.stream!==void 0&&GEp(e)}function Ren(e,t){if(QEp(e))return t.single(e);if(JEp(e))return t.any(e);So(e)}function QEp(e){return typeof e=="string"||e.scheme!=null}function JEp(e){let[t,...r]=Object.keys(e);return t==="any"&&r.length===0}function PNa(e,t){if(KEp(e))return t.header(e);switch(e.scheme){case"basic":return t.basic(e);case"bearer":return"get-token"in e?t.inferredBearer(e):t.tokenBearer(e);case"oauth":return t.oauth(e);default:So(e)}}function KEp(e){return e.header!=null}function Krr(e,t){if(YEp(e))return t.singleBaseUrl(e);if(hUn(e))return t.multipleBaseUrls(e);So(e)}function YEp(e){return typeof e=="string"||"url"in e}function hUn(e){return typeof e!="string"&&"urls"in e}function yUn(e){return typeof e=="string"?e.startsWith("$"):"variable"in e}function Z3(e,t){if(yzi(e))return t.alias(e);if(vzi(e))return t.discriminatedUnion(e);if(cD(e))return t.object(e);if(vUn(e))return t.undiscriminatedUnion(e);if(Y$t(e))return t.enum(e);So(e)}function yzi(e){return typeof e=="string"||e.type!=null}function cD(e){return e.extends!=null||e.properties!=null}function vzi(e){return e.union!=null&&e.discriminated==null}function vUn(e){let t=e;return t.union!=null&&t.discriminated!=null}function Y$t(e){return e.enum!=null}var $E=si(Nzi(),1),Dic=si(zO(),1),tRp=require("fs/promises"),rRp=si(require("path"),1),Fzi={shouldUseTitleAsName:void 0,shouldUseUndiscriminatedUnionsWithLiterals:void 0,shouldUseIdiomaticRequestNames:void 0,asyncApiMessageNaming:void 0,onlyIncludeReferencedSchemas:void 0,shouldUseOptionalAdditionalProperties:void 0,coerceEnumsToLiterals:void 0,objectQueryParameters:void 0,respectReadonlySchemas:void 0,respectNullableSchemas:void 0,inlinePathParameters:void 0,useBytesForBinaryResponse:void 0,respectForwardCompatibleEnums:void 0,filter:void 0,exampleGeneration:void 0,defaultFormParameterEncoding:void 0,additionalPropertiesDefaultsTo:void 0,typeDatesAsStrings:void 0,preserveSingleSchemaOneOf:void 0,inlineAllOfSchemas:void 0};async function iRp({absolutePathToGeneratorsConfiguration:e,rawGeneratorsConfiguration:t,context:r}){let i=sRp(t.metadata),n=t.readme;avD(r,t);let a=await JyD(t);return{absolutePathToConfiguration:e,api:a,rawConfiguration:t,defaultGroup:t["default-group"],reviewers:t.reviewers,groups:t.groups!=null?await Promise.all(Object.entries(t.groups).map(([u,l])=>KyD({absolutePathToGeneratorsConfiguration:e,groupName:u,group:l,maybeTopLevelMetadata:i,maybeTopLevelReviewers:t.reviewers,readme:n}))):[],whitelabel:t.whitelabel!=null&&t.whitelabel.github!=null?{github:t.whitelabel.github}:void 0}}function F9o(e){return{...Fzi,shouldUseTitleAsName:e?.["use-title"],shouldUseUndiscriminatedUnionsWithLiterals:e?.unions==="v1",asyncApiMessageNaming:e?.["message-naming"],respectNullableSchemas:e?.["respect-nullable-schemas"],onlyIncludeReferencedSchemas:e?.["only-include-referenced-schemas"],inlinePathParameters:e?.["inline-path-parameters"],shouldUseIdiomaticRequestNames:e?.["idiomatic-request-names"]}}function nRp(e){return{...aRp(e),shouldUseUndiscriminatedUnionsWithLiterals:e?.["prefer-undiscriminated-unions-with-literals"],onlyIncludeReferencedSchemas:e?.["only-include-referenced-schemas"],objectQueryParameters:e?.["object-query-parameters"],respectReadonlySchemas:e?.["respect-readonly-schemas"],inlinePathParameters:e?.["inline-path-parameters"],filter:e?.filter,exampleGeneration:e?.["example-generation"],defaultFormParameterEncoding:e?.["default-form-parameter-encoding"],useBytesForBinaryResponse:e?.["use-bytes-for-binary-response"],respectForwardCompatibleEnums:e?.["respect-forward-compatible-enums"],additionalPropertiesDefaultsTo:e?.["additional-properties-defaults-to"],typeDatesAsStrings:e?.["type-dates-as-strings"],preserveSingleSchemaOneOf:e?.["preserve-single-schema-oneof"],inlineAllOfSchemas:e?.["inline-all-of-schemas"]}}function GyD(e){return{...aRp(e),asyncApiMessageNaming:e?.["message-naming"]}}function aRp(e){return{...Fzi,shouldUseTitleAsName:e?.["title-as-schema-name"],shouldUseIdiomaticRequestNames:e?.["idiomatic-request-names"],shouldUseOptionalAdditionalProperties:e?.["optional-additional-properties"]??!0,coerceEnumsToLiterals:e?.["coerce-enums-to-literals"],respectNullableSchemas:e?.["respect-nullable-schemas"]}}async function eRp(e,t){let r=[];if(e!=null)if(typeof e=="string")r.push({schema:{type:"oss",path:e},origin:void 0,overrides:void 0,audiences:[],settings:{...Fzi}});else if(Bh.isRawProtobufAPIDefinitionSchema(e))r.push({schema:{type:"protobuf",root:e.proto.root,target:e.proto.target??"",localGeneration:e.proto["local-generation"]??!1,fromOpenAPI:e.proto["from-openapi"]??!1,dependencies:e.proto.dependencies??[]},origin:void 0,overrides:e.proto.overrides,audiences:[],settings:{...Fzi}});else if(Array.isArray(e))for(let i of e)typeof i=="string"?r.push({schema:{type:"oss",path:i},origin:void 0,overrides:void 0,audiences:[],settings:{...Fzi}}):Bh.isRawProtobufAPIDefinitionSchema(i)?r.push({schema:{type:"protobuf",root:i.proto.root,target:i.proto.target??"",localGeneration:i.proto["local-generation"]??!1,fromOpenAPI:i.proto["from-openapi"]??!1,dependencies:i.proto.dependencies??[]},origin:void 0,overrides:i.proto.overrides,audiences:[],settings:{...Fzi}}):r.push({schema:{type:"oss",path:i.path},origin:i.origin,overrides:i.overrides,audiences:i.audiences,settings:F9o(i.settings)});else r.push({schema:{type:"oss",path:e.path},origin:e.origin,overrides:e.overrides,audiences:e.audiences,settings:F9o(e.settings)});else{let i=t[Bh.API_SETTINGS_KEY],n=t[Bh.OPENAPI_LOCATION_KEY],a=t[Bh.API_ORIGIN_LOCATION_KEY],u=t[Bh.OPENAPI_OVERRIDES_LOCATION_KEY],l=t[Bh.ASYNC_API_LOCATION_KEY];n!=null&&(typeof n=="string"?r.push({schema:{type:"oss",path:n},origin:a,overrides:u,audiences:[],settings:F9o(i)}):typeof n=="object"&&r.push({schema:{type:"oss",path:n.path},origin:n.origin,overrides:n.overrides,audiences:[],settings:nRp(n.settings)})),l!=null&&r.push({schema:{type:"oss",path:l},origin:a,overrides:void 0,audiences:[],settings:F9o(i)})}return r}async function QyD({apiConfiguration:e,rawConfiguration:t}){let r={"auth-schemes":e.auth!=null?Object.fromEntries(Object.entries(t["auth-schemes"]??{}).filter(([a,u])=>e.auth==null?!1:Ren(e.auth,{any:l=>l.any.includes(a),single:l=>l===a}))):void 0,...e};if(Bh.isConjureSchema(e.specs))return{type:"conjure",pathToConjureDefinition:e.specs.conjure,...r};let i=[],n={};for(let a of e.specs??[]){let u;if(Bh.isOpenApiSpecSchema(a))u={schema:{type:"oss",path:a.openapi},origin:a.origin,overrides:a.overrides,audiences:[],settings:nRp(a.settings)};else if(Bh.isAsyncApiSpecSchema(a))u={schema:{type:"oss",path:a.asyncapi},origin:a.origin,overrides:a.overrides,audiences:[],settings:GyD(a.settings)};else if(Bh.isProtoSpecSchema(a))u={schema:{type:"protobuf",root:a.proto.root,target:a.proto.target??"",localGeneration:a.proto["local-generation"]??!1,fromOpenAPI:a.proto["from-openapi"]??!1,dependencies:a.proto.dependencies??[]},origin:void 0,overrides:a.proto.overrides,audiences:[],settings:{...Fzi}};else if(Bh.isOpenRpcSpecSchema(a))u={schema:{type:"openrpc",path:a.openrpc},origin:void 0,overrides:a.overrides,audiences:[],settings:{...Fzi}};else continue;"namespace"in a&&a.namespace!=null?(n[a.namespace]??=[],n[a.namespace].push(u)):i.push(u)}return Object.keys(n).length===0?{type:"singleNamespace",definitions:i,...r}:{type:"multiNamespace",rootDefinitions:i,definitions:n,...r}}async function JyD(e){let t=e.api;if(t!=null){if(Bh.isApiConfigurationV2Schema(t))return QyD({apiConfiguration:t,rawConfiguration:e});if(Bh.isNamespacedApiConfiguration(t)){let r={};for(let[i,n]of Object.entries(t.namespaces))r[i]=await eRp(n,e);return{type:"multiNamespace",rootDefinitions:void 0,definitions:r}}}return{type:"singleNamespace",definitions:await eRp(t,e)}}async function KyD({absolutePathToGeneratorsConfiguration:e,groupName:t,group:r,maybeTopLevelMetadata:i,maybeTopLevelReviewers:n,readme:a}){let u=sRp(r.metadata);return{groupName:t,reviewers:r.reviewers,audiences:r.audiences==null?{type:"all"}:{type:"select",audiences:r.audiences},generators:await Promise.all(r.generators.map(l=>YyD({absolutePathToGeneratorsConfiguration:e,generator:l,maybeTopLevelMetadata:i,maybeGroupLevelMetadata:u,maybeTopLevelReviewers:n,maybeGroupLevelReviewers:r.reviewers,readme:a})))}}async function YyD({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:i,maybeGroupLevelReviewers:n,maybeTopLevelReviewers:a,readme:u}){return{raw:t,name:t.name,version:t.version,config:t.config,outputMode:await kyD({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:i,maybeGroupLevelReviewers:n,maybeTopLevelReviewers:a}),keywords:t.keywords,smartCasing:t["smart-casing"]??!1,disableExamples:t["disable-examples"]??!1,absolutePathToLocalOutput:t.output?.location==="local-file-system"?Bv(Rd(e),t.output.path):void 0,absolutePathToLocalSnippets:t.snippets?.path!=null?Bv(Rd(e),t.snippets.path):void 0,language:rvD(t.name),irVersionOverride:t["ir-version"]??void 0,publishMetadata:XyD({generatorInvocation:t}),readme:u,settings:t.api?.settings??void 0}}function XyD({generatorInvocation:e}){let t=e["publish-metadata"];if(t!=null)return{packageDescription:t["package-description"],publisherEmail:t.email,publisherName:t.author,referenceUrl:t["reference-url"]};if(e.metadata!=null)return{packageDescription:e.metadata["package-description"],publisherEmail:e.metadata.email,publisherName:e.metadata.author,referenceUrl:e.metadata["reference-url"]}}function oRp({pypiOutputMetadata:e,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r}){let i;return e!=null&&(i=nvD(e),i={...r,...t,...i}),i}function ZyD({topLevelReviewers:e,groupLevelReviewers:t,outputModeReviewers:r}){let i=new Set,n=new Set,a=[],u=[...e?.teams??[],...t?.teams??[],...r?.teams??[]],l=[...e?.users??[],...t?.users??[],...r?.users??[]];for(let d of u)i.has(d.name)||(a.push(Dic.GithubPullRequestReviewer.team({name:d.name})),i.add(d.name));for(let d of l)n.has(d.name)||(a.push(Dic.GithubPullRequestReviewer.user({name:d.name})),n.add(d.name));return a}async function kyD({absolutePathToGeneratorsConfiguration:e,generator:t,maybeGroupLevelMetadata:r={},maybeTopLevelMetadata:i={},maybeGroupLevelReviewers:n,maybeTopLevelReviewers:a}){let u=t.snippets!=null&&t.snippets.path!=="";if(t.github!=null&&!GNa(t.github)){let l=t.github.repository.indexOf("/"),d=t.github.repository.slice(0,l),s=t.github.repository.slice(l+1),o=t.output!=null?tvD(t.output,r,i):void 0,c=ivD(t),b=c!=null?await evD({absolutePathToGeneratorsConfiguration:e,githubLicense:c}):void 0,g=t.github.mode??"release";switch(g){case"commit":case"release":return $E.FernFiddle.OutputMode.githubV2($E.FernFiddle.GithubOutputModeV2.commitAndRelease({owner:d,repo:s,license:b,publishInfo:o,downloadSnippets:u}));case"pull-request":{let O=ZyD({topLevelReviewers:a,groupLevelReviewers:n,outputModeReviewers:t.github.reviewers});return $E.FernFiddle.OutputMode.githubV2($E.FernFiddle.GithubOutputModeV2.pullRequest({owner:d,repo:s,license:b,publishInfo:o,downloadSnippets:u,reviewers:O}))}case"push":return $E.FernFiddle.OutputMode.githubV2($E.FernFiddle.GithubOutputModeV2.push({owner:d,repo:s,branch:t.github.mode==="push"?t.github.branch:void 0,license:b,publishInfo:o,downloadSnippets:u}));default:So(g)}}if(t.output==null)return $E.FernFiddle.remoteGen.OutputMode.publish({registryOverrides:{}});switch(t.output.location){case"local-file-system":return $E.FernFiddle.OutputMode.downloadFiles({downloadSnippets:u});case"npm":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.npmOverride({registryUrl:t.output.url??"https://registry.npmjs.org",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:u}));case"maven":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.mavenOverride({registryUrl:uRp(t.output),username:t.output.username??"",password:t.output.password??"",coordinate:t.output.coordinate,signature:t.output.signature!=null?{keyId:t.output.signature.keyId,secretKey:t.output.signature.secretKey,password:t.output.signature.password}:void 0,downloadSnippets:u}));case"postman":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.postman({apiKey:t.output["api-key"],workspaceId:t.output["workspace-id"]}));case"pypi":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.pypiOverride({registryUrl:t.output.url??"https://upload.pypi.org/legacy/",username:t.output.token!=null?"__token__":t.output.password??"",password:t.output.token??t.output.password??"",coordinate:t.output["package-name"],downloadSnippets:u,pypiMetadata:oRp({pypiOutputMetadata:t.output.metadata,maybeGroupLevelMetadata:r,maybeTopLevelMetadata:i})}));case"nuget":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.nugetOverride({registryUrl:t.output.url??"https://nuget.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));case"rubygems":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.rubyGemsOverride({registryUrl:t.output.url??"https://rubygems.org/",packageName:t.output["package-name"],apiKey:t.output["api-key"]??"",downloadSnippets:u}));case"crates":return $E.FernFiddle.OutputMode.publishV2($E.FernFiddle.remoteGen.PublishOutputModeV2.npmOverride({registryUrl:t.output.url??"https://crates.io/api/v1/crates",packageName:t.output["package-name"],token:t.output.token??"",downloadSnippets:u}));default:So(t.output)}}async function evD({absolutePathToGeneratorsConfiguration:e,githubLicense:t}){if(typeof t=="string")switch(t){case"MIT":return $E.FernFiddle.GithubLicense.basic({id:$E.FernFiddle.GithubLicenseId.Mit});case"Apache-2.0":return $E.FernFiddle.GithubLicense.basic({id:$E.FernFiddle.GithubLicenseId.Apache});default:So(t)}let r=Eu(Fc.of(rRp.default.dirname(e)),Ta.of(t.custom)),i=await(0,tRp.readFile)(r);return $E.FernFiddle.GithubLicense.custom({contents:i.toString()})}function tvD(e,t,r){switch(e.location){case"local-file-system":throw new Error("Cannot use local-file-system with github publishing");case"npm":return $E.FernFiddle.GithubPublishInfo.npm({registryUrl:e.url??"https://registry.npmjs.org",packageName:e["package-name"],token:e.token});case"maven":return $E.FernFiddle.GithubPublishInfo.maven({registryUrl:uRp(e),coordinate:e.coordinate,credentials:e.username!=null&&e.password!=null?{username:e.username,password:e.password}:void 0,signature:e.signature!=null?{keyId:e.signature.keyId,password:e.signature.password,secretKey:e.signature.secretKey}:void 0});case"postman":return $E.FernFiddle.GithubPublishInfo.postman({apiKey:e["api-key"],workspaceId:e["workspace-id"]});case"pypi":return $E.FernFiddle.GithubPublishInfo.pypi({registryUrl:e.url??"https://upload.pypi.org/legacy/",packageName:e["package-name"],credentials:e.token!=null?{username:"__token__",password:e.token}:{username:e.username??"",password:e.password??""},pypiMetadata:oRp({pypiOutputMetadata:e.metadata,maybeGroupLevelMetadata:t,maybeTopLevelMetadata:r})});case"nuget":return $E.FernFiddle.GithubPublishInfo.nuget({registryUrl:e.url??"https://nuget.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"rubygems":return $E.FernFiddle.GithubPublishInfo.rubygems({registryUrl:e.url??"https://rubygems.org/",packageName:e["package-name"],apiKey:e["api-key"]});case"crates":return $E.FernFiddle.GithubPublishInfo.npm({registryUrl:e.url??"https://crates.io",packageName:e["package-name"],token:e.token});default:So(e)}}function rvD(e){if(e.includes("csharp"))return Bh.GenerationLanguage.CSHARP;if(e.includes("go"))return Bh.GenerationLanguage.GO;if(e.includes("java")||e.includes("spring"))return Bh.GenerationLanguage.JAVA;if(e.includes("php"))return Bh.GenerationLanguage.PHP;if(e.includes("python")||e.includes("fastapi")||e.includes("pydantic"))return Bh.GenerationLanguage.PYTHON;if(e.includes("ruby"))return Bh.GenerationLanguage.RUBY;if(e.includes("swift"))return Bh.GenerationLanguage.SWIFT;if(e.includes("typescript"))return Bh.GenerationLanguage.TYPESCRIPT}function uRp(e){return e.url!=null?e.url:e.signature!=null?"https://oss.sonatype.org/service/local/staging/deploy/maven2/":"https://s01.oss.sonatype.org/content/repositories/releases/"}function ivD(e){return e["publish-metadata"]?.license!=null?e["publish-metadata"].license:e.metadata?.license!=null?e.metadata.license:GNa(e.github)?void 0:e.github?.license}function sRp(e){return e!=null?{description:e.description,authors:e.authors?.map(t=>({name:t.name,email:t.email}))}:void 0}function nvD(e){return e!=null?{description:e.description,authors:e.authors?.map(t=>({name:t.name,email:t.email})),keywords:e.keywords,documentationLink:e["documentation-link"],homepageLink:e["homepage-link"]}:void 0}function avD(e,t){let r=[];t["api-settings"]!=null&&r.push('"api-settings" is deprecated. Please use "api.specs[].settings" instead.'),t["async-api"]!=null&&r.push('"async-api" is deprecated. Please use "api.specs[].asyncapi" instead.'),t.openapi!=null&&r.push('"openapi" is deprecated. Please use "api.specs[].openapi" instead.'),t["openapi-overrides"]!=null&&r.push('"openapi-overrides" is deprecated. Please use "api.specs[].overrides" instead.'),t["spec-origin"]&&r.push('"spec-origin" is deprecated. Please use "api.specs[].origin" instead.'),t.api!=null&&(typeof t.api=="string"&&r.push('Using an OpenAPI or AsyncAPI path string for "api" is deprecated. Please use "api.specs[].openapi" or "api.specs[].asyncapi" instead.'),Array.isArray(t.api)?r.push('Using an array for "api" is deprecated. Please use "api.specs[].openapi", "api.specs[].asyncapi", or "api.specs[].proto" instead.'):typeof t.api=="object"&&("path"in t.api&&r.push('Using "api.path" is deprecated. Please use "api.specs[].openapi" or "api.specs[].asyncapi" instead.'),"proto"in t.api&&r.push('Using "api.proto" is deprecated. Please use "api.specs[].proto" instead.'),"namespaces"in t.api&&r.push('Using "api.namespaces" is deprecated. Please use "api.specs[].openapi", "api.specs[].asyncapi", or "api.specs[].proto" with the "namespace" property instead.'))),r.length>0&&(e.logger.warn("Warnings for generators.yml:"),e.logger.warn(" "+r.join(`
|
|
1676
1676
|
`)))}function GNa(e){return e==null?!1:"uri"in e&&"token"in e}var cRp=require("fs/promises");var lRp=si(require("path"),1);async function eVn({absolutePathToWorkspace:e,context:t}){let r=await Lzi({absolutePathToWorkspace:e});if(r==null)return;let i=await(0,cRp.readFile)(r);try{let n=wd.load(i.toString()),a=Bh.serialization.GeneratorsConfigurationSchema.parse(n,{allowUnrecognizedEnumValues:!1,unrecognizedObjectKeys:"fail",allowUnrecognizedUnionMembers:!1,skipValidation:!1,breadcrumbsPrefix:void 0,omitUndefined:!1});if(a.ok)return a.value;throw new Error(a.errors.map(u=>u.message).join(`
|
|
1677
1677
|
`))}catch(n){if(n instanceof wd.YAMLException)t.failAndThrow(`Failed to parse ${lRp.default.relative(process.cwd(),r)}: ${n.reason}`);else throw n}}async function k$t({absolutePathToWorkspace:e,context:t}){let r=await eVn({absolutePathToWorkspace:e,context:t});if(r==null)return;let i=await Lzi({absolutePathToWorkspace:e});if(i!=null)return iRp({absolutePathToGeneratorsConfiguration:i,rawGeneratorsConfiguration:r,context:t})}async function Lzi({absolutePathToWorkspace:e}){let t=Eu(e,Ta.of("generators.yml")),r=Eu(e,Ta.of("generators.yaml"));if(await jf(t))return t;if(await jf(r))return r}var tVn=si(require("path"),1),yRp=require("url");var fRp=si(require("process"),1),dRp=si(require("path"),1),V9o=si(require("fs"),1),pRp=require("url");var Eic=class{value;next;constructor(t){this.value=t}},QNa=class{#e;#t;#r;constructor(){this.clear()}enqueue(t){let r=new Eic(t);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let t=this.#e;if(t)return this.#e=this.#e.next,this.#r--,t.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let t=this.#e;for(;t;)yield t.value,t=t.next}*drain(){for(;this.#e;)yield this.dequeue()}};function L9o(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new QNa,r=0,i=()=>{r--,t.size>0&&t.dequeue()()},n=async(l,d,s)=>{r++;let o=(async()=>l(...s))();d(o);try{await o}catch{}i()},a=(l,d,s)=>{t.enqueue(n.bind(void 0,l,d,s)),(async()=>(await Promise.resolve(),r<e&&t.size>0&&t.dequeue()()))()},u=(l,...d)=>new Promise(s=>{a(l,s,d)});return Object.defineProperties(u,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),u}var U9o=class extends Error{constructor(t){super(),this.value=t}},ovD=async(e,t)=>t(await e),uvD=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new U9o(t[0]);return!1};async function Mic(e,t,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:i=!0}={}){let n=L9o(r),a=[...e].map(l=>[l,n(ovD,l,t)]),u=L9o(i?1:Number.POSITIVE_INFINITY);try{await Promise.all(a.map(l=>u(uvD,l)))}catch(l){if(l instanceof U9o)return l.value;throw l}}var _Rp={directory:"isDirectory",file:"isFile"};function svD(e){if(!Object.hasOwnProperty.call(_Rp,e))throw new Error(`Invalid type specified: ${e}`)}var cvD=(e,t)=>t[_Rp[e]](),lvD=e=>e instanceof URL?(0,pRp.fileURLToPath)(e):e;async function Aic(e,{cwd:t=fRp.default.cwd(),type:r="file",allowSymlinks:i=!0,concurrency:n,preserveOrder:a}={}){svD(r),t=lvD(t);let u=i?V9o.promises.stat:V9o.promises.lstat;return Mic(e,async l=>{try{let d=await u(dRp.default.resolve(t,l));return cvD(r,d)}catch{return!1}},{concurrency:n,preserveOrder:a})}var hRp=si(require("fs"),1);var fvD=e=>e instanceof URL?(0,yRp.fileURLToPath)(e):e,dvD=Symbol("findUpStop");async function pvD(e,t={}){let r=tVn.default.resolve(fvD(t.cwd)||""),{root:i}=tVn.default.parse(r),n=tVn.default.resolve(r,t.stopAt||i),a=t.limit||Number.POSITIVE_INFINITY,u=[e].flat(),l=async s=>{if(typeof e!="function")return Aic(u,s);let o=await e(s.cwd);return typeof o=="string"?Aic([o],s):o},d=[];for(;;){let s=await l({...t,cwd:r});if(s===dvD||(s&&d.push(tVn.default.resolve(r,s)),r===n||d.length>=a))break;r=tVn.default.dirname(r)}return d}async function RA(e,t={}){return(await pvD(e,{...t,limit:1}))[0]}async function eGt(e){let t=await RA(e??KW,{type:"directory"});if(t==null)return;let r=Fc.of(t);if(await jf(Eu(r,Ta.of(lae))))return r}var vRp=(e=0)=>t=>`\x1B[${t+e}m`,bRp=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,gRp=(e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,GR={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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},jx8=Object.keys(GR.modifier),_vD=Object.keys(GR.color),hvD=Object.keys(GR.bgColor),wx8=[..._vD,...hvD];function yvD(){let e=new Map;for(let[t,r]of Object.entries(GR)){for(let[i,n]of Object.entries(r))GR[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[i]=GR[i],e.set(n[0],n[1]);Object.defineProperty(GR,t,{value:r,enumerable:!1})}return Object.defineProperty(GR,"codes",{value:e,enumerable:!1}),GR.color.close="\x1B[39m",GR.bgColor.close="\x1B[49m",GR.color.ansi=vRp(),GR.color.ansi256=bRp(),GR.color.ansi16m=gRp(),GR.bgColor.ansi=vRp(10),GR.bgColor.ansi256=bRp(10),GR.bgColor.ansi16m=gRp(10),Object.defineProperties(GR,{rgbToAnsi256:{value(t,r,i){return t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(a=>a+a).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>GR.rgbToAnsi256(...GR.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,n;if(t>=232)r=((t-232)*10+8)/255,i=r,n=r;else{t-=16;let l=t%36;r=Math.floor(t/36)/5,i=Math.floor(l/6)/5,n=l%6/5}let a=Math.max(r,i,n)*2;if(a===0)return 30;let u=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(r));return a===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(t,r,i)=>GR.ansi256ToAnsi(GR.rgbToAnsi256(t,r,i)),enumerable:!1},hexToAnsi:{value:t=>GR.ansi256ToAnsi(GR.hexToAnsi256(t)),enumerable:!1}}),GR}var vvD=yvD(),tGt=vvD;var H9o=si(require("process"),1),mRp=si(require("os"),1),qic=si(require("tty"),1);function BFe(e,t=globalThis.Deno?globalThis.Deno.args:H9o.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(r+e),n=t.indexOf("--");return i!==-1&&(n===-1||i<n)}var{env:TF}=H9o.default,W9o;BFe("no-color")||BFe("no-colors")||BFe("color=false")||BFe("color=never")?W9o=0:(BFe("color")||BFe("colors")||BFe("color=true")||BFe("color=always"))&&(W9o=1);function bvD(){if("FORCE_COLOR"in TF)return TF.FORCE_COLOR==="true"?1:TF.FORCE_COLOR==="false"?0:TF.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(TF.FORCE_COLOR,10),3)}function gvD(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function OvD(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let i=bvD();i!==void 0&&(W9o=i);let n=r?W9o:i;if(n===0)return 0;if(r){if(BFe("color=16m")||BFe("color=full")||BFe("color=truecolor"))return 3;if(BFe("color=256"))return 2}if("TF_BUILD"in TF&&"AGENT_NAME"in TF)return 1;if(e&&!t&&n===void 0)return 0;let a=n||0;if(TF.TERM==="dumb")return a;if(H9o.default.platform==="win32"){let u=mRp.default.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in TF)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(u=>u in TF)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in TF)||TF.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in TF)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(TF.TEAMCITY_VERSION)?1:0;if(TF.COLORTERM==="truecolor"||TF.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in TF){let u=Number.parseInt((TF.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(TF.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(TF.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(TF.TERM)||"COLORTERM"in TF?1:a}function ORp(e,t={}){let r=OvD(e,{streamIsTTY:e&&e.isTTY,...t});return gvD(r)}var mvD={stdout:ORp({isTTY:qic.default.isatty(1)}),stderr:ORp({isTTY:qic.default.isatty(2)})},PRp=mvD;function jRp(e,t,r){let i=e.indexOf(t);if(i===-1)return e;let n=t.length,a=0,u="";do u+=e.slice(a,i)+t+r,a=i+n,i=e.indexOf(t,a);while(i!==-1);return u+=e.slice(a),u}function wRp(e,t,r,i){let n=0,a="";do{let u=e[i-1]==="\r";a+=e.slice(n,u?i-1:i)+t+(u?`\r
|
|
1678
1678
|
`:`
|
|
@@ -1709,7 +1709,7 @@ ${DQp.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&Ifc(th
|
|
|
1709
1709
|
`+Xtn.default.red(">> ")+t),this.screen.render(r,i)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?Xtn.default.cyan(zQp(t,this.opt.mask)):Xtn.default.italic(Xtn.default.dim("[hidden]")):this.opt.mask?zQp(t,this.opt.mask):Xtn.default.italic(Xtn.default.dim("[input is hidden] "))}getSpinningValue(t){return this.getMaskedValue(t)}filterInput(t){return t||(this.opt.default==null?"":this.opt.default)}onEnd(t){this.status="answered",this.answer=t.value,this.render(),this.screen.done(),this.done(t.value)}onError(t){this.render(t.isValid)}onKeypress(){this.opt.default&&=void 0,this.render()}};var KGo=si(z8(),1),oKp=si(Ddc(),1),uKp=si(wAe(),1);var K3a=class extends R8{_run(t){this.done=t,this.editorResult=new uKp.Subject;let r=AH(this.rl);this.lineSubscription=r.line.subscribe(this.startExternalEditor.bind(this));let i=this.opt.waitUserInput===void 0?!0:this.opt.waitUserInput,n=this.handleSubmitEvents(this.editorResult);return n.success.forEach(this.onEnd.bind(this)),n.error.forEach(this.onError.bind(this)),this.currentText=this.opt.default,this.opt.default=null,i?this.render():this.startExternalEditor(),this}render(t){let r="",i=this.getQuestion();i+=this.status==="answered"?KGo.default.dim("Received"):KGo.default.dim("Press <enter> to launch your preferred editor."),t&&(r=KGo.default.red(">> ")+t),this.screen.render(i,r)}startExternalEditor(){this.rl.pause(),(0,oKp.editAsync)(this.currentText,this.endExternalEditor.bind(this),{postfix:this.opt.postfix??".txt"})}endExternalEditor(t,r){this.rl.resume(),t?this.editorResult.error(t):this.editorResult.next(r)}onEnd(t){this.editorResult.unsubscribe(),this.lineSubscription.unsubscribe(),this.answer=t.value,this.status="answered",this.render(),this.screen.done(),this.done(this.answer)}onError(t){this.render(t.isValid)}};var dKp=require("stream");var lKp=si(require("readline"),1),fKp=si(cKp(),1),arn=class{constructor(t){this.rl||=lKp.default.createInterface(YXD(t)),this.rl.resume(),this.onForceClose=this.onForceClose.bind(this),process.on("exit",this.onForceClose),this.rl.on("SIGINT",this.onForceClose)}onForceClose(){this.close(),process.kill(process.pid,"SIGINT"),console.log("")}close(){this.rl.removeListener("SIGINT",this.onForceClose),process.removeListener("exit",this.onForceClose),this.rl.output.unmute(),this.activePrompt&&typeof this.activePrompt.close=="function"&&this.activePrompt.close(),this.rl.output.end(),this.rl.pause(),this.rl.close()}};function YXD(e={}){e.skipTTYChecks=e.skipTTYChecks===void 0?!0:e.skipTTYChecks;let t=e.input||process.stdin;if(!e.skipTTYChecks&&!t.isTTY){let n=new Error("Prompts can not be meaningfully rendered in non-TTY environments");throw n.isTtyError=!0,n}let r=new fKp.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var Y3a=class extends arn{constructor(t={}){super(t),this.log=new dKp.Writable({write:(r,i,n)=>{this.writeLog(r),n()}}),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return T3a(this.rl,this.bottomBar.split(`
|
|
1710
1710
|
`).length),this}updateBottomBar(t){return T3a(this.rl,1),this.rl.output.unmute(),this.clean(),this.bottomBar=t,this.render(),this.rl.output.mute(),this}writeLog(t){return this.rl.output.unmute(),this.clean(),this.rl.output.write(this.enforceLF(t.toString())),this.render(),this.rl.output.mute(),this}enforceLF(t){return/[\n\r]$/.test(t)?t:t+`
|
|
1711
1711
|
`}write(t){let r=t.split(/\n/);this.height=r.length,this.rl.setPrompt(r.at(-1)),this.rl.output.rows===0&&this.rl.output.columns===0&&jGo(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var yM=si(wAe(),1),hKp=si(ZFa(),1);var YGo=si(wAe(),1),pKp=si(ZFa(),1),XGo=function(e,t,r){return typeof e[t]!="function"?(0,YGo.of)(e):(0,YGo.from)((0,pKp.default)(e[t])(r).then(i=>(e[t]=i,e)))};var _Kp={set:(e,t="",r)=>{let i=e;t.split(".").forEach((n,a,u)=>{n==="__proto__"||n==="constructor"||(a===u.length-1?i[n]=r:(!(n in i)||typeof i[n]!="object")&&(i[n]={}),i=i[n])})},get:(e,t="",r)=>{let i=a=>String.prototype.split.call(t,a).filter(Boolean).reduce((u,l)=>u!=null?u[l]:u,e),n=i(/[,[\]]+?/)||i(/[,.[\]]+?/);return n===void 0||n===e?r:n}},sHn=class extends arn{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=typeof r=="object"?{...r}:{};let i;return Array.isArray(t)?i=(0,yM.from)(t):(0,yM.isObservable)(t)?i=t:Object.values(t).every(n=>typeof n=="object"&&!Array.isArray(n)&&n!=null)?i=(0,yM.from)(Object.entries(t).map(([n,a])=>({name:n,...a}))):i=(0,yM.from)([t]),this.process=i.pipe((0,yM.concatMap)(this.processQuestion.bind(this)),(0,yM.publish)()),this.process.connect(),this.process.pipe((0,yM.reduce)((n,a)=>(_Kp.set(n,a.name,a.answer),n),this.answers)).toPromise(Promise).then(this.onCompletion.bind(this),this.onError.bind(this))}onCompletion(){return this.close(),this.answers}onError(t){return this.close(),Promise.reject(t)}processQuestion(t){return t={...t},(0,yM.defer)(()=>(0,yM.of)(t).pipe((0,yM.concatMap)(this.setDefaultType.bind(this)),(0,yM.concatMap)(this.filterIfRunnable.bind(this)),(0,yM.concatMap)(()=>XGo(t,"message",this.answers)),(0,yM.concatMap)(()=>XGo(t,"default",this.answers)),(0,yM.concatMap)(()=>XGo(t,"choices",this.answers)),(0,yM.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,yM.defer)(()=>(0,yM.from)(this.activePrompt.run().then(i=>({name:t.name,answer:i}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,yM.defer)(()=>(0,yM.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&_Kp.get(this.answers,t.name)!==void 0)return yM.EMPTY;if(t.when===!1)return yM.EMPTY;if(typeof t.when!="function")return(0,yM.of)(t);let{answers:r}=this;return(0,yM.defer)(()=>(0,yM.from)((0,hKp.default)(t.when)(r).then(i=>{if(i)return t})).pipe((0,yM.filter)(i=>i!=null)))}};function yKp(e){let t=function(r,i){let n;try{n=new sHn(t.prompts,e)}catch(u){return Promise.reject(u)}let a=n.run(r,i);return a.ui=n,a};return t.prompts={},t.registerPrompt=function(r,i){return t.prompts[r]=i,this},t.restoreDefaultPrompts=function(){this.registerPrompt("list",B3a),this.registerPrompt("input",Ytn),this.registerPrompt("number",I3a),this.registerPrompt("confirm",z3a),this.registerPrompt("rawlist",R3a),this.registerPrompt("expand",x3a),this.registerPrompt("checkbox",N3a),this.registerPrompt("password",F3a),this.registerPrompt("editor",K3a)},t.restoreDefaultPrompts(),t}var Mdc=yKp();function ZXD(e,t){Mdc.registerPrompt(e,t)}function kXD(){Mdc.restoreDefaultPrompts()}var eZD={prompt:Mdc,ui:{BottomBar:Y3a,Prompt:sHn},createPromptModule:yKp,registerPrompt:ZXD,restoreDefaultPrompts:kXD,Separator:Loe},ZGo=eZD;var OHn=require("path"),YYp=require("fs"),XYp=require("readline"),mYp="posthog-node";function zeE(e,{organization:t,projectId:r,prefix:i,severityAllowList:n=["error"]}={}){return a=>{if(!(n==="*"||n.includes(a.level)))return a;a.tags||(a.tags={});let l=a.tags[OQo.POSTHOG_ID_TAG];if(l===void 0)return a;let d=e.options.host??"https://us.i.posthog.com",s=new URL(`/project/${e.apiKey}/person/${l}`,d).toString();a.tags["PostHog Person URL"]=s;let o=a.exception?.values||[],c=o.map(g=>({...g,stacktrace:g.stacktrace?{...g.stacktrace,type:"raw",frames:(g.stacktrace.frames||[]).map(O=>({...O,platform:"node:javascript"}))}:void 0})),b={$exception_message:o[0]?.value||a.message,$exception_type:o[0]?.type,$exception_personURL:s,$exception_level:a.level,$exception_list:c,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:o[0]?.value||a.message,$sentry_exception_type:o[0]?.type,$sentry_tags:a.tags};return t&&r&&(b.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+a.event_id),e.capture({event:"$exception",distinctId:l,properties:b}),a}}var OQo=class{constructor(t,r,i,n){this.name=mYp,this.name=mYp,this.setupOnce=function(a,u){let l=u()?.getClient()?.getDsn()?.projectId;a(zeE(t,{organization:r,projectId:l,prefix:i,severityAllowList:n}))}}};OQo.POSTHOG_ID_TAG="posthog_distinct_id";var hQo="0123456789abcdef",mQo=class e{constructor(t){this.bytes=t}static ofInner(t){if(t.length!==16)throw new TypeError("not 128-bit length");return new e(t)}static fromFieldsV7(t,r,i,n){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||t<0||r<0||i<0||n<0||t>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");let a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|r>>>8,a[7]=r,a[8]=128|i>>>24,a[9]=i>>>16,a[10]=i>>>8,a[11]=i,a[12]=n>>>24,a[13]=n>>>16,a[14]=n>>>8,a[15]=n,new e(a)}static parse(t){let r;switch(t.length){case 32:r=/^[0-9a-f]{32}$/i.exec(t)?.[0];break;case 36:r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break;case 38:r=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t)?.slice(1,6).join("");break;case 45:r=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break}if(r){let i=new Uint8Array(16);for(let n=0;n<16;n+=4){let a=parseInt(r.substring(2*n,2*n+8),16);i[n+0]=a>>>24,i[n+1]=a>>>16,i[n+2]=a>>>8,i[n+3]=a}return new e(i)}else throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let r=0;r<this.bytes.length;r++)t+=hQo.charAt(this.bytes[r]>>>4),t+=hQo.charAt(this.bytes[r]&15),(r===3||r===5||r===7||r===9)&&(t+="-");return t}toHex(){let t="";for(let r=0;r<this.bytes.length;r++)t+=hQo.charAt(this.bytes[r]>>>4),t+=hQo.charAt(this.bytes[r]&15);return t}toJSON(){return this.toString()}getVariant(){let t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.bytes.every(r=>r===0)?"NIL":"VAR_0";if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.bytes.every(r=>r===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new e(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let r=0;r<16;r++){let i=this.bytes[r]-t.bytes[r];if(i!==0)return Math.sign(i)}return 0}},vpc=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??ReE()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,r){let i=this.generateOrAbortCore(t,r);return i===void 0&&(this.timestamp=0,i=this.generateOrAbortCore(t,r)),i}generateOrAbortCore(t,r){if(!Number.isInteger(t)||t<1||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(r<0||r>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(t>this.timestamp)this.timestamp=t,this.resetCounter();else if(t+r>=this.timestamp)this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter());else return;return mQo.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){let t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,mQo.ofInner(t)}},ReE=()=>({nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}),PYp,bpc=()=>xeE().toString(),xeE=()=>(PYp||(PYp=new vpc)).generate();function NeE(e,t){let r=!1;return Object.assign(i=>{let a=global.process.listeners("uncaughtException").filter(u=>u.name!=="domainUncaughtExceptionClear"&&u._posthogErrorHandler!==!0).length===0;e(i,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&a&&(r=!0,t())},{_posthogErrorHandler:!0})}function FeE(e,t){global.process.on("uncaughtException",NeE(e,t))}function LeE(e){global.process.on("unhandledRejection",t=>{e(t,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var yQo,jYp,vQo;function UeE(e){let t=globalThis._posthogChunkIds;if(!t)return console.error("No chunk id map found"),{};let r=Object.keys(t);return vQo&&r.length===jYp||(jYp=r.length,vQo=r.reduce((i,n)=>{yQo||(yQo={});let a=yQo[n];if(a)i[a[0]]=a[1];else{let u=e(n);for(let l=u.length-1;l>=0;l--){let s=u[l]?.filename,o=t[n];if(s&&o){i[s]=o,yQo[n]=[s,o];break}}}return i},{})),vQo}function VeE(e){return typeof Event<"u"&&ZYp(e,Event)}function WeE(e){return kYp(e,"Object")}function Dpc(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ZYp(e,Error)}}function ZYp(e,t){try{return e instanceof t}catch{return!1}}function HeE(e){return kYp(e,"ErrorEvent")}function kYp(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}async function $eE(e,t,r,i){let a=i&&i.mechanism||{handled:!0,type:"generic"},u=eXp(a,r,i);return{$exception_list:await Promise.all(u.map(async s=>{let o=await ZeE(e,t,s);return o.value=o.value||"",o.type=o.type||"Error",o.mechanism=a,o}))}}function eXp(e,t,r){let i=GeE(e,t,r);return i.cause?[i,...eXp(e,i.cause,r)]:[i]}function GeE(e,t,r){if(Dpc(t))return t;if(e.synthetic=!0,WeE(t)){let n=QeE(t);if(n)return n;let a=JeE(t),u=r?.syntheticException||new Error(a);return u.message=a,u}let i=r?.syntheticException||new Error(t);return i.message=`${t}`,i}function QeE(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(Dpc(r))return r}}function JeE(e){if("name"in e&&typeof e.name=="string"){let i=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(i+=` with message '${e.message}'`),i}else if("message"in e&&typeof e.message=="string")return e.message;let t=YeE(e);if(HeE(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=KeE(e);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${t}`}function KeE(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function YeE(e,t=40){let r=Object.keys(XeE(e));r.sort();let i=r[0];if(!i)return"[object has no keys]";if(i.length>=t)return wYp(i,t);for(let n=r.length;n>0;n--){let a=r.slice(0,n).join(", ");if(!(a.length>t))return n===r.length?a:wYp(a,t)}return""}function wYp(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function XeE(e){return Dpc(e)?{message:e.message,name:e.name,stack:e.stack,...SYp(e)}:VeE(e)?{type:e.type,target:DYp(e.target),currentTarget:DYp(e.currentTarget),...SYp(e)}:e}function SYp(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function DYp(e){try{return Object.prototype.toString.call(e)}catch{return"<unknown>"}}async function ZeE(e,t,r){let i={type:r.name||r.constructor.name,value:r.message},n=keE(e,r);for(let a of t)n=await a(n);return n.length&&(i.stacktrace={frames:n,type:"raw"}),i}function keE(e,t){return etE(e(t.stack||"",1),e)}function etE(e,t){let r=UeE(t);return e.forEach(i=>{i.filename&&(i.chunk_id=r[i.filename])}),e}var ttE=2e3,vHn=class e{static async captureException(t,r,i,n,a){let u={...a};n||(u.$process_person_profile=!1);let l=await $eE(this.stackParser,this.frameModifiers,r,i);t.capture({event:"$exception",distinctId:n||bpc(),properties:{...l,...u}})}constructor(t,r){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this.startAutocaptureIfEnabled()}startAutocaptureIfEnabled(){this.isEnabled()&&(FeE(this.onException.bind(this),this.onFatalError.bind(this)),LeE(this.onException.bind(this)))}onException(t,r){e.captureException(this.client,t,r)}async onFatalError(){await this.client.shutdown(ttE)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}};function rtE(e=process.argv[1]?(0,OHn.dirname)(process.argv[1]):process.cwd(),t=OHn.sep==="\\"){let r=t?EYp(e):e;return i=>{if(!i)return;let n=t?EYp(i):i,{dir:a,base:u,ext:l}=OHn.posix.parse(n);(l===".js"||l===".mjs"||l===".cjs")&&(u=u.slice(0,l.length*-1));let d=decodeURIComponent(u);a||(a=".");let s=a.lastIndexOf("/node_modules");if(s>-1)return`${a.slice(s+14).replace(/\//g,".")}:${d}`;if(a.startsWith(r)){let o=a.slice(r.length+1).replace(/\//g,".");return o?`${o}:${d}`:d}return d}}function EYp(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var PQo=class{constructor(t){this._maxSize=t,this._cache=new Map}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){this._cache.set(t,r)}reduce(){for(;this._cache.size>=this._maxSize;){let t=this._cache.keys().next().value;t&&this._cache.delete(t)}}},gQo=new PQo(25),tXp=new PQo(20),Epc=7,itE=1e3,ntE=1e4;async function atE(e){let t={};for(let n=e.length-1;n>=0;n--){let a=e[n],u=a?.filename;if(!a||typeof u!="string"||typeof a.lineno!="number"||ctE(u)||ltE(a))continue;t[u]||(t[u]=[]),t[u].push(a.lineno)}let r=Object.keys(t);if(r.length==0)return e;let i=[];for(let n of r){if(tXp.get(n))continue;let a=t[n];if(!a)continue;a.sort((d,s)=>d-s);let u=dtE(a);if(u.every(d=>ftE(n,d)))continue;let l=ptE(gQo,n,{});i.push(otE(n,u,l))}return await Promise.all(i).catch(()=>{}),e&&e.length>0&&utE(e,gQo),gQo.reduce(),e}function otE(e,t,r){return new Promise(i=>{let n=(0,YYp.createReadStream)(e),a=(0,XYp.createInterface)({input:n});function u(){n.destroy(),i()}let l=0,d=0,s=t[d];if(s===void 0){u();return}let o=s[0],c=s[1];function b(){tXp.set(e,1),a.close(),a.removeAllListeners(),u()}n.on("error",b),a.on("error",b),a.on("close",u),a.on("line",g=>{if(l++,!(l<o)&&(r[l]=_tE(g,0),l>=c)){if(d===t.length-1){a.close(),a.removeAllListeners();return}d++;let O=t[d];if(O===void 0){a.close(),a.removeAllListeners();return}o=O[0],c=O[1]}})})}function utE(e,t){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let i=t.get(r.filename);if(i===void 0)continue;stE(r.lineno,r,i)}}function stE(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let n=rXp(e);n<e;n++){let a=r[n];if(a===void 0){MYp(t);return}t.pre_context.push(a)}if(r[e]===void 0){MYp(t);return}t.context_line=r[e];let i=iXp(e);t.post_context=[];for(let n=e+1;n<=i;n++){let a=r[n];if(a===void 0)break;t.post_context.push(a)}}function MYp(e){delete e.pre_context,delete e.context_line,delete e.post_context}function ctE(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function ltE(e){return e.lineno!==void 0&&e.lineno>ntE||e.colno!==void 0&&e.colno>itE}function ftE(e,t){let r=gQo.get(e);if(r===void 0)return!1;for(let i=t[0];i<=t[1];i++)if(r[i]===void 0)return!1;return!0}function dtE(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let i=AYp(r),n=[];for(;;){if(t===e.length-1){n.push(i);break}let a=e[t+1];if(typeof a!="number")break;a<=i[1]?i[1]=a+Epc:(n.push(i),i=AYp(a)),t++}return n}function AYp(e){return[rXp(e),iXp(e)]}function rXp(e){return Math.max(1,e-Epc)}function iXp(e){return e+Epc}function ptE(e,t,r){let i=e.get(t);return i===void 0?(e.set(t,r),r):i}function _tE(e,t){let r=e,i=r.length;if(i<=150)return r;t>i&&(t=i);let n=Math.max(t-60,0);n<5&&(n=0);let a=Math.min(n+140,i);return a>i-5&&(a=i),a===i&&(n=Math.max(a-140,0)),r=r.slice(n,a),n>0&&(r=`...${r}`),a<i&&(r+="..."),r}var htE="4.18.0",Goe;(function(e){e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.DecideEndpointWasHit="decide_endpoint_was_hit",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config"})(Goe||(Goe={}));var qYp;(function(e){e.Left="left",e.Right="right",e.Center="center"})(qYp||(qYp={}));var TYp;(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})(TYp||(TYp={}));var CYp;(function(e){e.Popover="popover",e.API="api",e.Widget="widget"})(CYp||(CYp={}));var BYp;(function(e){e.Html="html",e.Text="text"})(BYp||(BYp={}));var IYp;(function(e){e.Number="number",e.Emoji="emoji"})(IYp||(IYp={}));var zYp;(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"})(zYp||(zYp={}));var RYp;(function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"})(RYp||(RYp={}));var xYp;(function(e){e.Regex="regex",e.NotRegex="not_regex",e.Exact="exact",e.IsNot="is_not",e.Icontains="icontains",e.NotIcontains="not_icontains"})(xYp||(xYp={}));var NYp;(function(e){e.Contains="contains",e.Exact="exact",e.Regex="regex"})(NYp||(NYp={}));var ytE=e=>{if("flags"in e){let t=btE(e.flags),r=gtE(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}else{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([n,a])=>[n,nXp(a)])),i=Object.fromEntries(Object.entries(t).map(([n,a])=>[n,vtE(n,a,r[n])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:i}}};function vtE(e,t,r){return{key:e,enabled:typeof t=="string"?!0:t,variant:typeof t=="string"?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var btE=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,Mpc(r)]).filter(([,t])=>t!==void 0)),gtE=e=>{let t=e??{};return Object.fromEntries(Object.keys(t).filter(r=>{let i=t[r];return i.enabled&&i.metadata&&i.metadata.payload!==void 0}).map(r=>{let i=t[r].metadata?.payload;return[r,i?nXp(i):void 0]}))},Mpc=e=>e===void 0?void 0:e.variant??e.enabled,nXp=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},OtE=1,mtE=new Set(["61be3dd8","96f6df5f","8cfdba9b","bf027177","e59430a8","7fa5500b","569798e9","04809ff7","0ebc61a5","32de7f98","3beeb69a","12d34ad9","733853ec","0645bb64","5dcbee21","b1f95fa3","2189e408","82b460c2","3a8cc979","29ef8843","2cdbf767","38084b54","50f9f8de","41d0df91","5c236689","c11aedd3","ada46672","f4331ee1","42fed62a","c957462c","d62f705a","e0162666","01b3e5cf","441cef7f","bb9cafee","8f348eb0","b2553f3a","97469d7d","39f21a76","03706dcc","27d50569","307584a7","6433e92e","150c7fbb","49f57f22","3772f65b","01eb8256","3c9e9234","f853c7f7","c0ac4b67","cd609d40","10ca9b1a","8a87f11b","8e8e5216","1f6b63b3","db7943dd","79b7164c","07f78e33","2d21b6fd","952db5ee","a7d3b43f","1924dd9c","84e1b8f6","dff631b6","c5aa8a79","fa133a95","498a4508","24748755","98f3d658","21bbda67","7dbfed69","be3ec24c","fc80b8e2","75cc0998"]),PtE="utf8";function jtE(e,t){if(!e||typeof e!="string"||wtE(e))throw new Error(t)}function wtE(e){return e.trim().length===0}function StE(e){return e?.replace(/\/+$/,"")}async function DtE(e,t){let r=null;for(let i=0;i<t.retryCount+1;i++){i>0&&await new Promise(n=>setTimeout(n,t.retryDelay));try{return await e()}catch(n){if(r=n,!t.retryCheck(n))throw n}}throw r}function FYp(){return new Date().getTime()}function hpc(){return new Date().toISOString()}function jQo(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}function EtE(){return typeof fetch<"u"?fetch:typeof globalThis.fetch<"u"?globalThis.fetch:void 0}function MtE(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24);return(t>>>0).toString(16).padStart(8,"0")}function AtE(e,t=0,r){let i=MtE(e);return r?.has(i)?!1:parseInt(i,16)/4294967295<t}function LYp(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var o7a=String.fromCharCode,UYp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bQo={};function qtE(e,t){if(!bQo[e]){bQo[e]={};for(let r=0;r<e.length;r++)bQo[e][e.charAt(r)]=r}return bQo[e][t]}var hHn={compressToBase64:function(e){if(e==null)return"";let t=hHn._compress(e,6,function(r){return UYp.charAt(r)});switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return e==null?"":e==""?null:hHn._decompress(e.length,32,function(t){return qtE(UYp,e.charAt(t))})},compress:function(e){return hHn._compress(e,16,function(t){return o7a(t)})},_compress:function(e,t,r){if(e==null)return"";let i={},n={},a=[],u,l,d="",s="",o="",c=2,b=3,g=2,O=0,m=0,w;for(w=0;w<e.length;w+=1)if(d=e.charAt(w),Object.prototype.hasOwnProperty.call(i,d)||(i[d]=b++,n[d]=!0),s=o+d,Object.prototype.hasOwnProperty.call(i,s))o=s;else{if(Object.prototype.hasOwnProperty.call(n,o)){if(o.charCodeAt(0)<256){for(u=0;u<g;u++)O=O<<1,m==t-1?(m=0,a.push(r(O)),O=0):m++;for(l=o.charCodeAt(0),u=0;u<8;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}else{for(l=1,u=0;u<g;u++)O=O<<1|l,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=0;for(l=o.charCodeAt(0),u=0;u<16;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}c--,c==0&&(c=Math.pow(2,g),g++),delete n[o]}else for(l=i[o],u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;c--,c==0&&(c=Math.pow(2,g),g++),i[s]=b++,o=String(d)}if(o!==""){if(Object.prototype.hasOwnProperty.call(n,o)){if(o.charCodeAt(0)<256){for(u=0;u<g;u++)O=O<<1,m==t-1?(m=0,a.push(r(O)),O=0):m++;for(l=o.charCodeAt(0),u=0;u<8;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}else{for(l=1,u=0;u<g;u++)O=O<<1|l,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=0;for(l=o.charCodeAt(0),u=0;u<16;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}c--,c==0&&(c=Math.pow(2,g),g++),delete n[o]}else for(l=i[o],u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;c--,c==0&&(c=Math.pow(2,g),g++)}for(l=2,u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;for(;;)if(O=O<<1,m==t-1){a.push(r(O));break}else m++;return a.join("")},decompress:function(e){return e==null?"":e==""?null:hHn._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(e,t,r){let i=[],n=[],a={val:r(0),position:t,index:1},u=4,l=4,d=3,s="",o,c,b,g,O,m,w;for(o=0;o<3;o+=1)i[o]=o;for(b=0,O=Math.pow(2,2),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;switch(b){case 0:for(b=0,O=Math.pow(2,8),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;w=o7a(b);break;case 1:for(b=0,O=Math.pow(2,16),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;w=o7a(b);break;case 2:return""}for(i[3]=w,c=w,n.push(w);;){if(a.index>e)return"";for(b=0,O=Math.pow(2,d),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;switch(w=b){case 0:for(b=0,O=Math.pow(2,8),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;i[l++]=o7a(b),w=l-1,u--;break;case 1:for(b=0,O=Math.pow(2,16),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;i[l++]=o7a(b),w=l-1,u--;break;case 2:return n.join("")}if(u==0&&(u=Math.pow(2,d),d++),i[w])s=i[w];else if(w===l)s=c+c.charAt(0);else return null;n.push(s),i[l++]=c+s.charAt(0),u--,c=s,u==0&&(u=Math.pow(2,d),d++)}}},gpc=class{constructor(){this.events={},this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),()=>{this.events[t]=this.events[t].filter(i=>i!==r)}}emit(t,r){for(let i of this.events[t]||[])i(r);for(let i of this.events["*"]||[])i(t,r)}},bHn=class extends Error{constructor(t,r){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}},u7a=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};async function VYp(e){if(e instanceof bHn){let t="";try{t=await e.text}catch{}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function ypc(e){return typeof e=="object"&&(e instanceof bHn||e instanceof u7a)}function WYp(e){return typeof e=="object"&&e instanceof bHn&&e.status===413}var Opc;(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(Opc||(Opc={}));var mpc=class{constructor(t,r){this.flushPromise=null,this.shutdownPromise=null,this.pendingPromises={},this._events=new gpc,this._isInitialized=!1,jtE(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=StE(r?.host||"https://us.i.posthog.com"),this.flushAt=r?.flushAt?Math.max(r?.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,r?.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,r?.maxQueueSize??1e3),this.flushInterval=r?.flushInterval??1e4,this.captureMode=r?.captureMode||"json",this.preloadFeatureFlags=r?.preloadFeatureFlags??!0,this.defaultOptIn=r?.defaultOptIn??!0,this.disableSurveys=r?.disableSurveys??!1,this._retryOptions={retryCount:r?.fetchRetryCount??3,retryDelay:r?.fetchRetryDelay??3e3,retryCheck:ypc},this.requestTimeout=r?.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r?.featureFlagsRequestTimeoutMs??3e3,this.remoteConfigRequestTimeoutMs=r?.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r?.disableGeoip??!0,this.disabled=r?.disabled??!1,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(Goe.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(Goe.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(Goe.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(i,n)=>console.log("PostHog Debug",i,n));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){return{distinct_id:t.distinct_id,event:t.event,properties:{...t.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(t){let r=bpc();return this.pendingPromises[r]=t,t.catch(()=>{}).finally(()=>{delete this.pendingPromises[r]}),t}identifyStateless(t,r,i){this.wrap(()=>{let n={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};this.enqueue("identify",n,i)})}async identifyStatelessImmediate(t,r,i){let n={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};await this.sendImmediate("identify",n,i)}captureStateless(t,r,i,n){this.wrap(()=>{let a=this.buildPayload({distinct_id:t,event:r,properties:i});this.enqueue("capture",a,n)})}async captureStatelessImmediate(t,r,i,n){let a=this.buildPayload({distinct_id:t,event:r,properties:i});await this.sendImmediate("capture",a,n)}aliasStateless(t,r,i,n){this.wrap(()=>{let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...i||{},distinct_id:r,alias:t}});this.enqueue("alias",a,n)})}async aliasStatelessImmediate(t,r,i,n){let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...i||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",a,n)}groupIdentifyStateless(t,r,i,n,a,u){this.wrap(()=>{let l=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:i||{},...u||{}}});this.enqueue("capture",l,n)})}async getRemoteConfig(){await this._initPromise;let t=this.host;t==="https://us.i.posthog.com"?t="https://us-assets.i.posthog.com":t==="https://eu.i.posthog.com"&&(t="https://eu-assets.i.posthog.com");let r=`${t}/array/${this.apiKey}/config`,i={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(r,i,{retryCount:0},this.remoteConfigRequestTimeoutMs).then(n=>n.json()).catch(n=>{this.logMsgIfDebug(()=>console.error("Remote config could not be loaded",n)),this._events.emit("error",n)})}async getDecide(t,r={},i={},n={},a={}){await this._initPromise;let l=AtE(this.apiKey,OtE,mtE)?`${this.host}/flags/?v=2`:`${this.host}/decide/?v=4`,d={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify({token:this.apiKey,distinct_id:t,groups:r,person_properties:i,group_properties:n,...a})};return this.logMsgIfDebug(()=>console.log("PostHog Debug","Decide URL",l)),this.fetchWithRetry(l,d,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(s=>s.json()).then(s=>ytE(s)).catch(s=>{this._events.emit("error",s)})}async getFeatureFlagStateless(t,r,i={},n={},a={},u){await this._initPromise;let l=await this.getFeatureFlagDetailStateless(t,r,i,n,a,u);if(l===void 0)return{response:void 0,requestId:void 0};let d=Mpc(l.response);return d===void 0&&(d=!1),{response:d,requestId:l.requestId}}async getFeatureFlagDetailStateless(t,r,i={},n={},a={},u){await this._initPromise;let l=await this.getFeatureFlagDetailsStateless(r,i,n,a,u,[t]);return l===void 0?void 0:{response:l.flags[t],requestId:l.requestId}}async getFeatureFlagPayloadStateless(t,r,i={},n={},a={},u){await this._initPromise;let l=await this.getFeatureFlagPayloadsStateless(r,i,n,a,u,[t]);if(!l)return;let d=l[t];return d===void 0?null:d}async getFeatureFlagPayloadsStateless(t,r={},i={},n={},a,u){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a,u)).payloads}async getFeatureFlagsStateless(t,r={},i={},n={},a,u){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a,u)}async getFeatureFlagsAndPayloadsStateless(t,r={},i={},n={},a,u){await this._initPromise;let l=await this.getFeatureFlagDetailsStateless(t,r,i,n,a,u);return l?{flags:l.featureFlags,payloads:l.featureFlagPayloads,requestId:l.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},i={},n={},a,u){await this._initPromise;let l={};(a??this.disableGeoip)&&(l.geoip_disable=!0),u&&(l.flag_keys_to_evaluate=u);let d=await this.getDecide(t,r,i,n,l);if(d!==void 0)return d.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),d.quotaLimited?.includes(Opc.FeatureFlags)?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:d?.requestId}):d}async getSurveysStateless(){if(await this._initPromise,this.disableSurveys===!0)return this.logMsgIfDebug(()=>console.log("PostHog Debug","Loading surveys is disabled.")),[];let t=`${this.host}/api/surveys/?token=${this.apiKey}`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},n=(await this.fetchWithRetry(t,r).then(a=>{if(a.status!==200||!a.json){let u=`Surveys API could not be loaded: ${a.status}`,l=new Error(u);this.logMsgIfDebug(()=>console.error(l)),this._events.emit("error",new Error(u));return}return a.json()}).catch(a=>{this.logMsgIfDebug(()=>console.error("Surveys API could not be loaded",a)),this._events.emit("error",a)}))?.surveys;return n&&this.logMsgIfDebug(()=>console.log("PostHog Debug","Surveys fetched from API: ",JSON.stringify(n))),n??[]}get props(){return this._props||(this._props=this.getPersistedProperty(Goe.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(Goe.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(Goe.Props,this.props)})}enqueue(t,r,i){this.wrap(()=>{if(this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let n=this.prepareMessage(t,r,i),a=this.getPersistedProperty(Goe.Queue)||[];a.length>=this.maxQueueSize&&(a.shift(),this.logMsgIfDebug(()=>console.info("Queue is full, the oldest event is dropped."))),a.push({message:n}),this.setPersistedProperty(Goe.Queue,a),this._events.emit(t,n),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=jQo(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,i){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized||await this._initPromise,this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let n={api_key:this.apiKey,batch:[this.prepareMessage(t,r,i)],sent_at:hpc()};this.historicalMigration&&(n.historical_migration=!0);let a=JSON.stringify(n),u=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${FYp()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,l=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(hHn.compressToBase64(a))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:a};try{await this.fetchWithRetry(u,l)}catch(d){this._events.emit("error",d)}}prepareMessage(t,r,i){let n={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:i?.timestamp?i?.timestamp:hpc(),uuid:i?.uuid?i.uuid:bpc()};return(i?.disableGeoip??this.disableGeoip)&&(n.properties||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(async t=>{await VYp(t)})}async flush(){let t=LYp([this.flushPromise]).then(()=>this._flush());return this.flushPromise=t,this.addPendingPromise(t),LYp([t]).then(()=>{this.flushPromise===t&&(this.flushPromise=null)}),t}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getPersistedProperty(Goe.Queue)||[];if(!t.length)return;let r=[],i=t.length;for(;t.length>0&&r.length<i;){let n=t.slice(0,this.maxBatchSize),a=n.map(b=>b.message),u=()=>{let g=(this.getPersistedProperty(Goe.Queue)||[]).slice(n.length);this.setPersistedProperty(Goe.Queue,g),t=g},l={api_key:this.apiKey,batch:a,sent_at:hpc()};this.historicalMigration&&(l.historical_migration=!0);let d=JSON.stringify(l),s=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${FYp()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,o=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(hHn.compressToBase64(d))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:d},c={retryCheck:b=>WYp(b)?!1:ypc(b)};try{await this.fetchWithRetry(s,o,c)}catch(b){if(WYp(b)&&a.length>1){this.maxBatchSize=Math.max(1,Math.floor(a.length/2)),this.logMsgIfDebug(()=>console.warn(`Received 413 when sending batch of size ${a.length}, reducing batch size to ${this.maxBatchSize}`));continue}throw b instanceof u7a||u(),this._events.emit("error",b),b}u(),r.push(...a)}this._events.emit("flush",r)}async fetchWithRetry(t,r,i,n){var a;(a=AbortSignal).timeout??(a.timeout=function(s){let o=new AbortController;return setTimeout(()=>o.abort(),s),o.signal});let u=r.body?r.body:"",l=-1;try{l=Buffer.byteLength(u,PtE)}catch{l=new TextEncoder().encode(u).length}return await DtE(async()=>{let d=null;try{d=await this.fetch(t,{signal:AbortSignal.timeout(n??this.requestTimeout),...r})}catch(o){throw new u7a(o)}if(!(r.mode==="no-cors")&&(d.status<200||d.status>=400))throw new bHn(d,l);return d},{...this._retryOptions,...i})}async _shutdown(t=3e4){await this._initPromise;let r=!1;this.clearFlushTimer();let i=async()=>{try{for(await Promise.all(Object.values(this.pendingPromises));!((this.getPersistedProperty(Goe.Queue)||[]).length===0||(await this.flush(),r)););}catch(n){if(!ypc(n))throw n;await VYp(n)}};return Promise.race([new Promise((n,a)=>{jQo(()=>{this.logMsgIfDebug(()=>console.error("Timed out while shutting down PostHog")),r=!0,a("Timeout while shutting down PostHog. Some events may not have been sent.")},t)}),i()])}async shutdown(t=3e4){return this.shutdownPromise?this.logMsgIfDebug(()=>console.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup")):this.shutdownPromise=this._shutdown(t).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}},Ppc=EtE();if(!Ppc){let e=OYp();Ppc=async(t,r)=>{let i=await e.request({url:t,headers:r.headers,method:r.method.toLowerCase(),data:r.body,signal:r.signal,validateStatus:()=>!0});return{status:i.status,text:async()=>i.data,json:async()=>i.data}}}var aXp=Ppc,wQo=class{constructor(t){this.factory=t}async getValue(){return this.value!==void 0?this.value:(this.initializationPromise===void 0&&(this.initializationPromise=(async()=>{try{let t=await this.factory();return this.value=t,t}finally{this.initializationPromise=void 0}})()),this.initializationPromise)}isInitialized(){return this.value!==void 0}async waitForInitialization(){this.isInitialized()||await this.getValue()}},oXp=new wQo(async()=>{try{return await import("crypto")}catch{return}});async function TtE(){return await oXp.getValue()}var CtE=new wQo(async()=>{if(typeof globalThis.crypto?.subtle<"u")return globalThis.crypto.subtle;try{let e=await oXp.getValue();if(e?.webcrypto?.subtle)return e.webcrypto.subtle}catch{}});async function BtE(){return await CtE.getValue()}async function ItE(e){let t=await TtE();if(t)return t.createHash("sha1").update(e).digest("hex");let r=await BtE();if(r){let i=await r.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(i)).map(a=>a.toString(16).padStart(2,"0")).join("")}throw new Error("No crypto implementation available. Tried Node Crypto API and Web SubtleCrypto API")}var ztE=60*1e3,RtE=1152921504606847e3,xtE=["is_not"],yHn=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},x8=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},jpc=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:i,timeout:n,host:a,customHeaders:u,...l}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollingInterval=t,this.personalApiKey=r,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=n,this.projectApiKey=i,this.host=a,this.poller=void 0,this.fetch=l.fetch||aXp,this.onError=l.onError,this.customHeaders=u,this.onLoad=l.onLoad,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,i={},n={},a={}){await this.loadFeatureFlags();let u,l;if(!this.loadedSuccessfullyOnce)return u;for(let d of this.featureFlags)if(t===d.key){l=d;break}if(l!==void 0)try{u=await this.computeFlagLocally(l,r,i,n,a),this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${u}`))}catch(d){d instanceof x8?this.logMsgIfDebug(()=>console.debug(`InconclusiveMatchError when computing flag locally: ${t}: ${d}`)):d instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${d}`))}return u}async computeFeatureFlagPayloadLocally(t,r){await this.loadFeatureFlags();let i;if(this.loadedSuccessfullyOnce){if(typeof r=="boolean"?i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]:typeof r=="string"&&(i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]),i==null)return null;try{return JSON.parse(i)}catch{return i}}}async getAllFlagsAndPayloads(t,r={},i={},n={}){await this.loadFeatureFlags();let a={},u={},l=this.featureFlags.length==0;return await Promise.all(this.featureFlags.map(async d=>{try{let s=await this.computeFlagLocally(d,t,r,i,n);a[d.key]=s;let o=await this.computeFeatureFlagPayloadLocally(d.key,s);o&&(u[d.key]=o)}catch(s){s instanceof x8||s instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${d.key}: ${s}`)),l=!0}})),{response:a,payloads:u,fallbackToDecide:l}}async computeFlagLocally(t,r,i={},n={},a={}){if(t.ensure_experience_continuity)throw new x8("Flag has experience continuity enabled");if(!t.active)return!1;let l=(t.filters||{}).aggregation_group_type_index;if(l!=null){let d=this.groupTypeMapping[String(l)];if(!d)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${l} for feature flag ${t.key}`)),new x8("Flag has unknown group type index");if(!(d in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;let s=a[d];return await this.matchFeatureFlagProperties(t,i[d],s)}else return await this.matchFeatureFlagProperties(t,r,n)}async matchFeatureFlagProperties(t,r,i){let n=t.filters||{},a=n.groups||[],u=!1,l,d=[...a].sort((s,o)=>{let c=!!s.variant,b=!!o.variant;return c&&b?0:c?-1:b?1:0});for(let s of d)try{if(await this.isConditionMatch(t,r,s,i)){let o=s.variant,c=n.multivariate?.variants||[];o&&c.some(b=>b.key===o)?l=o:l=await this.getMatchingVariant(t,r)||!0;break}}catch(o){if(o instanceof x8)u=!0;else throw o}if(l!==void 0)return l;if(u)throw new x8("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,i,n){let a=i.rollout_percentage,u=l=>{this.logMsgIfDebug(()=>console.warn(l))};if((i.properties||[]).length>0){for(let l of i.properties){let d=l.type,s=!1;if(d==="cohort"?s=sXp(l,n,this.cohorts,this.debugMode):s=uXp(l,n,u),!s)return!1}if(a==null)return!0}return!(a!=null&&await HYp(t.key,r)>a/100)}async getMatchingVariant(t,r){let i=await HYp(t.key,r,"variant"),n=this.variantLookupTable(t).find(a=>i>=a.valueMin&&i<a.valueMax);if(n)return n.key}variantLookupTable(t){let r=[],i=0,n=0;return((t.filters||{}).multivariate?.variants||[]).forEach(l=>{n=i+l.rollout_percentage/100,r.push({valueMin:i,valueMax:n,key:l.key}),i=n}),r}async loadFeatureFlags(t=!1){(!this.loadedSuccessfullyOnce||t)&&await this._loadFeatureFlags()}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getPollingInterval(){return this.shouldBeginExponentialBackoff?Math.min(ztE,this.pollingInterval*2**this.backOffCount):this.pollingInterval}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this._loadFeatureFlags(),this.getPollingInterval());try{let t=await this._requestFeatureFlagDefinitions();if(!t)return;switch(t.status){case 401:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new yHn(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new yHn(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new yHn(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let r=await t.json()??{};if(!("flags"in r)){this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(r)}`));return}this.featureFlags=r.flags??[],this.featureFlagsByKey=this.featureFlags.reduce((i,n)=>(i[n.key]=n,i),{}),this.groupTypeMapping=r.group_type_mapping||{},this.cohorts=r.cohorts||{},this.loadedSuccessfullyOnce=!0,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.onLoad?.(this.featureFlags.length);break}default:return}}catch(t){t instanceof yHn&&this.onError?.(t)}}getPersonalApiKeyRequestOptions(t="GET"){return{method:t,headers:{...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`}}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions(),i=null;if(this.timeout&&typeof this.timeout=="number"){let n=new AbortController;i=jQo(()=>{n.abort()},this.timeout),r.signal=n.signal}try{return await this.fetch(t,r)}finally{clearTimeout(i)}}stopPoller(){clearTimeout(this.poller)}_requestRemoteConfigPayload(t){let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config/`,i=this.getPersonalApiKeyRequestOptions(),n=null;if(this.timeout&&typeof this.timeout=="number"){let a=new AbortController;n=jQo(()=>{a.abort()},this.timeout),i.signal=a.signal}try{return this.fetch(r,i)}finally{clearTimeout(n)}}};async function HYp(e,t,r=""){let i=await ItE(`${e}.${t}${r}`);return parseInt(i.slice(0,15),16)/RtE}function uXp(e,t,r){let i=e.key,n=e.value,a=e.operator||"exact";if(i in t){if(a==="is_not_set")throw new x8("Operator is_not_set is not supported")}else throw new x8(`Property ${i} not found in propertyValues`);let u=t[i];if(u==null&&!xtE.includes(a))return r&&r(`Property ${i} cannot have a value of null/undefined with the ${a} operator`),!1;function l(s,o){return Array.isArray(s)?s.map(c=>String(c).toLowerCase()).includes(String(o).toLowerCase()):String(s).toLowerCase()===String(o).toLowerCase()}function d(s,o,c){if(c==="gt")return s>o;if(c==="gte")return s>=o;if(c==="lt")return s<o;if(c==="lte")return s<=o;throw new Error(`Invalid operator: ${c}`)}switch(a){case"exact":return l(n,u);case"is_not":return!l(n,u);case"is_set":return i in t;case"icontains":return String(u).toLowerCase().includes(String(n).toLowerCase());case"not_icontains":return!String(u).toLowerCase().includes(String(n).toLowerCase());case"regex":return $Yp(String(n))&&String(u).match(String(n))!==null;case"not_regex":return $Yp(String(n))&&String(u).match(String(n))===null;case"gt":case"gte":case"lt":case"lte":{let s=typeof n=="number"?n:null;if(typeof n=="string")try{s=parseFloat(n)}catch{}return s!=null&&u!=null?typeof u=="string"?d(u,String(n),a):d(u,s,a):d(String(u),String(n),a)}case"is_date_after":case"is_date_before":{let s=NtE(String(n));if(s==null&&(s=GYp(n)),s==null)throw new x8(`Invalid date: ${n}`);let o=GYp(u);return["is_date_before"].includes(a)?o<s:o>s}default:throw new x8(`Unknown operator: ${a}`)}}function sXp(e,t,r,i=!1){let n=String(e.value);if(!(n in r))throw new x8("can't match cohort without a given cohort property value");let a=r[n];return cXp(a,t,r,i)}function cXp(e,t,r,i=!1){if(!e)return!0;let n=e.type,a=e.values;if(!a||a.length===0)return!0;let u=!1;if("values"in a[0]){for(let l of a)try{let d=cXp(l,t,r,i);if(n==="AND"){if(!d)return!1}else if(d)return!0}catch(d){if(d instanceof x8)i&&console.debug(`Failed to compute property ${l} locally: ${d}`),u=!0;else throw d}if(u)throw new x8("Can't match cohort without a given cohort property value");return n==="AND"}else{for(let l of a)try{let d;l.type==="cohort"?d=sXp(l,t,r,i):d=uXp(l,t);let s=l.negation||!1;if(n==="AND"){if(!d&&!s||d&&s)return!1}else if(d&&!s||!d&&s)return!0}catch(d){if(d instanceof x8)i&&console.debug(`Failed to compute property ${l} locally: ${d}`),u=!0;else throw d}if(u)throw new x8("can't match cohort without a given cohort property value");return n==="AND"}}function $Yp(e){try{return new RegExp(e),!0}catch{return!1}}function GYp(e){if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);if(!isNaN(t.valueOf()))return t;throw new x8(`${e} is in an invalid date format`)}else throw new x8(`The date provided ${e} must be a string, number, or date object`)}function NtE(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),i=new Date(new Date().toISOString());if(r){if(!r.groups)return null;let n=parseInt(r.groups.number);if(n>=1e4)return null;let a=r.groups.interval;if(a=="h")i.setUTCHours(i.getUTCHours()-n);else if(a=="d")i.setUTCDate(i.getUTCDate()-n);else if(a=="w")i.setUTCDate(i.getUTCDate()-n*7);else if(a=="m")i.setUTCMonth(i.getUTCMonth()-n);else if(a=="y")i.setUTCFullYear(i.getUTCFullYear()-n);else return null;return i}else return null}var wpc=class{constructor(){this._memoryStorage={}}getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}},FtE=100,QYp=30*1e3,LtE=50*1e3,Spc=class extends mpc{constructor(t,r={}){if(super(t,r),this._memoryStorage=new wpc,this.options=r,this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,FtE):QYp,r.personalApiKey){if(r.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');this.featureFlagsPoller=new jpc({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:i=>{this._events.emit("error",i)},onLoad:i=>{this._events.emit("localEvaluationFlagsLoaded",i)},customHeaders:this.getCustomHeaders()})}this.errorTracking=new vHn(this,r),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||LtE}getPersistedProperty(t){return this._memoryStorage.getProperty(t)}setPersistedProperty(t,r){return this._memoryStorage.setProperty(t,r)}fetch(t,r){return this.options.fetch?this.options.fetch(t,r):aXp(t,r)}getLibraryVersion(){return htE}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}capture(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:i,properties:n,groups:a,sendFeatureFlags:u,timestamp:l,disableGeoip:d,uuid:s}=t,o=g=>{super.captureStateless(r,i,g,{timestamp:l,disableGeoip:d,uuid:s})},c=async(g,O,m)=>(await super.getFeatureFlagsStateless(g,O,void 0,void 0,m)).flags,b=Promise.resolve().then(async()=>{if(u)return await c(r,a,d);if(i==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let g={};for(let[O,m]of Object.entries(a||{}))g[O]=String(m);return await this.getAllFlags(r,{groups:g,disableGeoip:d,onlyEvaluateLocally:!0})}return{}}).then(g=>{let O={};if(g)for(let[w,E]of Object.entries(g))O[`$feature/${w}`]=E;let m=Object.keys(g||{}).filter(w=>g?.[w]!==!1).sort();return m.length>0&&(O.$active_feature_flags=m),O}).catch(()=>({})).then(g=>{o({...g,...n,$groups:a})});this.addPendingPromise(b)}async captureImmediate(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:i,properties:n,groups:a,sendFeatureFlags:u,timestamp:l,disableGeoip:d,uuid:s}=t,o=g=>super.captureStatelessImmediate(r,i,g,{timestamp:l,disableGeoip:d,uuid:s}),c=async(g,O,m)=>(await super.getFeatureFlagsStateless(g,O,void 0,void 0,m)).flags;await Promise.resolve().then(async()=>{if(u)return await c(r,a,d);if(i==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let g={};for(let[O,m]of Object.entries(a||{}))g[O]=String(m);return await this.getAllFlags(r,{groups:g,disableGeoip:d,onlyEvaluateLocally:!0})}return{}}).then(g=>{let O={};if(g)for(let[w,E]of Object.entries(g))O[`$feature/${w}`]=E;let m=Object.keys(g||{}).filter(w=>g?.[w]!==!1).sort();return m.length>0&&(O.$active_feature_flags=m),O}).catch(()=>({})).then(g=>{o({...g,...n,$groups:a})})}identify({distinctId:t,properties:r,disableGeoip:i}){let n=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;super.identifyStateless(t,{$set:a,$set_once:n},{disableGeoip:i})}async identifyImmediate({distinctId:t,properties:r,disableGeoip:i}){let n=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;await super.identifyStatelessImmediate(t,{$set:a,$set_once:n},{disableGeoip:i})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async aliasImmediate(t){await super.aliasStatelessImmediate(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(t=QYp){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let i=setTimeout(()=>{n(),r(!1)},t),n=this._events.on("localEvaluationFlagsLoaded",a=>{clearTimeout(i),n(),r(a>0)})})}async getFeatureFlag(t,r,i){let{groups:n,disableGeoip:a}=i||{},{onlyEvaluateLocally:u,sendFeatureFlagEvents:l,personProperties:d,groupProperties:s}=i||{},o=this.addLocalPersonAndGroupProperties(r,n,d,s);d=o.allPersonProperties,s=o.allGroupProperties,u==null&&(u=!1),l==null&&(l=!0);let c=await this.featureFlagsPoller?.getFeatureFlag(t,r,n,d,s),b=c!==void 0,g,O;if(!b&&!u){let w=await super.getFeatureFlagDetailStateless(t,r,n,d,s,a);if(w===void 0)return;O=w.response,c=Mpc(O),g=w?.requestId}let m=`${t}_${c}`;return l&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(m))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(m):this.distinctIdHasSentFlagCalls[r]=[m],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:c,$feature_flag_id:O?.metadata?.id,$feature_flag_version:O?.metadata?.version,$feature_flag_reason:O?.reason?.description??O?.reason?.code,locally_evaluated:b,[`$feature/${t}`]:c,$feature_flag_request_id:g},groups:n,disableGeoip:a})),c}async getFeatureFlagPayload(t,r,i,n){let{groups:a,disableGeoip:u}=n||{},{onlyEvaluateLocally:l,sendFeatureFlagEvents:d,personProperties:s,groupProperties:o}=n||{},c=this.addLocalPersonAndGroupProperties(r,a,s,o);s=c.allPersonProperties,o=c.allGroupProperties;let b;return this.featureFlagsPoller!==void 0&&(i||(i=await this.getFeatureFlag(t,r,{...n,onlyEvaluateLocally:!0,sendFeatureFlagEvents:!1})),i&&(b=await this.featureFlagsPoller?.computeFeatureFlagPayloadLocally(t,i))),l==null&&(l=!1),d==null&&(d=!0),l==null&&(l=!1),!(b!==void 0)&&!l&&(b=await super.getFeatureFlagPayloadStateless(t,r,a,s,o,u)),b}async getRemoteConfigPayload(t){return(await this.featureFlagsPoller?._requestRemoteConfigPayload(t))?.json()}async isFeatureEnabled(t,r,i){let n=await this.getFeatureFlag(t,r,i);if(n!==void 0)return!!n||!1}async getAllFlags(t,r){return(await this.getAllFlagsAndPayloads(t,r)).featureFlags||{}}async getAllFlagsAndPayloads(t,r){let{groups:i,disableGeoip:n}=r||{},{onlyEvaluateLocally:a,personProperties:u,groupProperties:l}=r||{},d=this.addLocalPersonAndGroupProperties(t,i,u,l);u=d.allPersonProperties,l=d.allGroupProperties,a==null&&(a=!1);let s=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,i,u,l),o={},c={},b=!0;if(s&&(o=s.response,c=s.payloads,b=s.fallbackToDecide),b&&!a){let g=await super.getFeatureFlagsAndPayloadsStateless(t,i,u,l,n);o={...o,...g.flags||{}},c={...c,...g.payloads||{}}}return{featureFlags:o,featureFlagPayloads:c}}groupIdentify({groupType:t,groupKey:r,properties:i,distinctId:n,disableGeoip:a}){super.groupIdentifyStateless(t,r,i,{disableGeoip:a},n)}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}async _shutdown(t){return this.featureFlagsPoller?.stopPoller(),super._shutdown(t)}addLocalPersonAndGroupProperties(t,r,i,n){let a={distinct_id:t,...i||{}},u={};if(r)for(let l of Object.keys(r))u[l]={$group_key:r[l],...n?.[l]||{}};return{allPersonProperties:a,allGroupProperties:u}}captureException(t,r,i){let n=new Error("PostHog syntheticException");vHn.captureException(this,t,{syntheticException:n},r,i)}},JYp=/\(error: (.*)\)/,lXp=50,fXp="?";function UtE(e){let t=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return i=>{let n=i.match(r);if(n){let a,u,l,d,s;if(n[1]){l=n[1];let b=l.lastIndexOf(".");if(l[b-1]==="."&&b--,b>0){a=l.slice(0,b),u=l.slice(b+1);let g=a.indexOf(".Module");g>0&&(l=l.slice(g+1),a=a.slice(0,g))}d=void 0}u&&(d=a,s=u),u==="<anonymous>"&&(s=void 0,l=void 0),l===void 0&&(s=s||fXp,l=d?`${d}.${s}`:s);let o=n[2]?.startsWith("file://")?n[2].slice(7):n[2],c=n[5]==="native";return o?.match(/\/[A-Z]:/)&&(o=o.slice(1)),!o&&n[5]&&!c&&(o=n[5]),{filename:o?decodeURI(o):void 0,module:e?e(o):void 0,function:l,lineno:KYp(n[3]),colno:KYp(n[4]),in_app:VtE(o||"",c),platform:"node:javascript"}}if(i.match(t))return{filename:i,platform:"node:javascript"}}}function VtE(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function KYp(e){return parseInt(e||"",10)||void 0}function WtE(e){return[90,UtE(e)]}function HtE(e){let r=[WtE(e)].sort((i,n)=>i[0]-n[0]).map(i=>i[1]);return(i,n=0)=>{let a=[],u=i.split(`
|
|
1712
|
-
`);for(let l=n;l<u.length;l++){let d=u[l];if(d.length>1024)continue;let s=JYp.test(d)?d.replace(JYp,"$1"):d;if(!s.match(/\S*Error: /)){for(let o of r){let c=o(s);if(c){a.push(c);break}}if(a.length>=lXp)break}}return $tE(a)}}function $tE(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,lXp).map(r=>({...r,filename:r.filename||GtE(t).filename,function:r.function||fXp}))}function GtE(e){return e[e.length-1]||{}}vHn.stackParser=HtE(rtE());vHn.frameModifiers=[atE];var gHn=class extends Spc{getLibraryId(){return"posthog-node"}};var SQo=class{posthog;constructor({posthogApiKey:t}){this.posthog=new gHn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.66.26",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var s7a=class{async sendEvent(){}async identify(){}async flush(){}};var mHn=require("fs/promises"),hXp=require("os"),yXp=require("path");var dXp=si(require("crypto")),EQo=new Uint8Array(256),DQo=EQo.length;function Apc(){return DQo>EQo.length-16&&(dXp.default.randomFillSync(EQo),DQo=0),EQo.slice(DQo,DQo+=16)}var CH=[];for(let e=0;e<256;++e)CH.push((e+256).toString(16).slice(1));function pXp(e,t=0){return CH[e[t+0]]+CH[e[t+1]]+CH[e[t+2]]+CH[e[t+3]]+"-"+CH[e[t+4]]+CH[e[t+5]]+"-"+CH[e[t+6]]+CH[e[t+7]]+"-"+CH[e[t+8]]+CH[e[t+9]]+"-"+CH[e[t+10]]+CH[e[t+11]]+CH[e[t+12]]+CH[e[t+13]]+CH[e[t+14]]+CH[e[t+15]]}var _Xp=si(require("crypto")),qpc={randomUUID:_Xp.default.randomUUID};function QtE(e,t,r){if(qpc.randomUUID&&!t&&!e)return qpc.randomUUID();e=e||{};let i=e.random||(e.rng||Apc)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return pXp(i)}var Qoe=QtE;var JtE="id",KtE=".fern",c7a=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new gHn(r),this.userId=t==null?void 0:hoc(t)}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"0.66.26",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Eu(Fc.of((0,hXp.homedir)()),Ta.of(KtE),Ta.of(JtE));await jf(t)||(await(0,mHn.mkdir)((0,yXp.dirname)(t),{recursive:!0}),await(0,mHn.writeFile)(t,Qoe())),this.persistedDistinctId=(await(0,mHn.readFile)(t)).toString()}return this.persistedDistinctId}};var Tpc;async function PHn(){return Tpc==null&&(Tpc=await YtE()),Tpc}async function YtE(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new s7a;let r=await WLo();return r!=null?new c7a({token:r,posthogApiKey:e}):await bVn()!=null?new SQo({posthogApiKey:e}):new c7a({token:void 0,posthogApiKey:e})}catch{return new s7a}}function l7a(e,t){return function(){return e.apply(t,arguments)}}var{toString:XtE}=Object.prototype,{getPrototypeOf:Bpc}=Object,{iterator:AQo,toStringTag:bXp}=Symbol,qQo=(e=>t=>{let r=XtE.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),MGt=e=>(e=e.toLowerCase(),t=>qQo(t)===e),TQo=e=>t=>typeof t===e,{isArray:jHn}=Array,f7a=TQo("undefined");function ZtE(e){return e!==null&&!f7a(e)&&e.constructor!==null&&!f7a(e.constructor)&&Joe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var gXp=MGt("ArrayBuffer");function ktE(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&gXp(e.buffer),t}var erE=TQo("string"),Joe=TQo("function"),OXp=TQo("number"),CQo=e=>e!==null&&typeof e=="object",trE=e=>e===!0||e===!1,MQo=e=>{if(qQo(e)!=="object")return!1;let t=Bpc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(bXp in e)&&!(AQo in e)},rrE=MGt("Date"),irE=MGt("File"),nrE=MGt("Blob"),arE=MGt("FileList"),orE=e=>CQo(e)&&Joe(e.pipe),urE=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Joe(e.append)&&((t=qQo(e))==="formdata"||t==="object"&&Joe(e.toString)&&e.toString()==="[object FormData]"))},srE=MGt("URLSearchParams"),[crE,lrE,frE,drE]=["ReadableStream","Request","Response","Headers"].map(MGt),prE=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function d7a(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),jHn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let a=r?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length,l;for(i=0;i<u;i++)l=a[i],t.call(null,e[l],l,e)}}function mXp(e,t){t=t.toLowerCase();let r=Object.keys(e),i=r.length,n;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}var frn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,PXp=e=>!f7a(e)&&e!==frn;function Cpc(){let{caseless:e}=PXp(this)&&this||{},t={},r=(i,n)=>{let a=e&&mXp(t,n)||n;MQo(t[a])&&MQo(i)?t[a]=Cpc(t[a],i):MQo(i)?t[a]=Cpc({},i):jHn(i)?t[a]=i.slice():t[a]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&d7a(arguments[i],r);return t}var _rE=(e,t,r,{allOwnKeys:i}={})=>(d7a(t,(n,a)=>{r&&Joe(n)?e[a]=l7a(n,r):e[a]=n},{allOwnKeys:i}),e),hrE=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),yrE=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},vrE=(e,t,r,i)=>{let n,a,u,l={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)u=n[a],(!i||i(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=r!==!1&&Bpc(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},brE=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},grE=e=>{if(!e)return null;if(jHn(e))return e;let t=e.length;if(!OXp(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},OrE=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Bpc(Uint8Array)),mrE=(e,t)=>{let i=(e&&e[AQo]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},PrE=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},jrE=MGt("HTMLFormElement"),wrE=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),vXp=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),SrE=MGt("RegExp"),jXp=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};d7a(r,(n,a)=>{let u;(u=t(n,a,e))!==!1&&(i[a]=u||n)}),Object.defineProperties(e,i)},DrE=e=>{jXp(e,(t,r)=>{if(Joe(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(Joe(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ErE=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return jHn(e)?i(e):i(String(e).split(t)),r},MrE=()=>{},ArE=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qrE(e){return!!(e&&Joe(e.append)&&e[bXp]==="FormData"&&e[AQo])}var TrE=e=>{let t=new Array(10),r=(i,n)=>{if(CQo(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;let a=jHn(i)?[]:{};return d7a(i,(u,l)=>{let d=r(u,n+1);!f7a(d)&&(a[l]=d)}),t[n]=void 0,a}}return i};return r(e,0)},CrE=MGt("AsyncFunction"),BrE=e=>e&&(CQo(e)||Joe(e))&&Joe(e.then)&&Joe(e.catch),wXp=((e,t)=>e?setImmediate:t?((r,i)=>(frn.addEventListener("message",({source:n,data:a})=>{n===frn&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),frn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Joe(frn.postMessage)),IrE=typeof queueMicrotask<"u"?queueMicrotask.bind(frn):typeof process<"u"&&process.nextTick||wXp,zrE=e=>e!=null&&Joe(e[AQo]),ss={isArray:jHn,isArrayBuffer:gXp,isBuffer:ZtE,isFormData:urE,isArrayBufferView:ktE,isString:erE,isNumber:OXp,isBoolean:trE,isObject:CQo,isPlainObject:MQo,isReadableStream:crE,isRequest:lrE,isResponse:frE,isHeaders:drE,isUndefined:f7a,isDate:rrE,isFile:irE,isBlob:nrE,isRegExp:SrE,isFunction:Joe,isStream:orE,isURLSearchParams:srE,isTypedArray:OrE,isFileList:arE,forEach:d7a,merge:Cpc,extend:_rE,trim:prE,stripBOM:hrE,inherits:yrE,toFlatObject:vrE,kindOf:qQo,kindOfTest:MGt,endsWith:brE,toArray:grE,forEachEntry:mrE,matchAll:PrE,isHTMLForm:jrE,hasOwnProperty:vXp,hasOwnProp:vXp,reduceDescriptors:jXp,freezeMethods:DrE,toObjectSet:ErE,toCamelCase:wrE,noop:MrE,toFiniteNumber:ArE,findKey:mXp,global:frn,isContextDefined:PXp,isSpecCompliantForm:qrE,toJSONObject:TrE,isAsyncFn:CrE,isThenable:BrE,setImmediate:wXp,asap:IrE,isIterable:zrE};function wHn(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}ss.inherits(wHn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ss.toJSONObject(this.config),code:this.code,status:this.status}}});var SXp=wHn.prototype,DXp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{DXp[e]={value:e}});Object.defineProperties(wHn,DXp);Object.defineProperty(SXp,"isAxiosError",{value:!0});wHn.from=(e,t,r,i,n,a)=>{let u=Object.create(SXp);return ss.toFlatObject(e,u,function(d){return d!==Error.prototype},l=>l!=="isAxiosError"),wHn.call(u,e.message,t,r,i,n),u.cause=e,u.name=e.name,a&&Object.assign(u,a),u};var Qp=wHn;var EXp=si(kGo(),1),BQo=EXp.default;function Ipc(e){return ss.isPlainObject(e)||ss.isArray(e)}function AXp(e){return ss.endsWith(e,"[]")?e.slice(0,-2):e}function MXp(e,t,r){return e?e.concat(t).map(function(n,a){return n=AXp(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function RrE(e){return ss.isArray(e)&&!e.some(Ipc)}var xrE=ss.toFlatObject(ss,{},null,function(t){return/^is[A-Z]/.test(t)});function NrE(e,t,r){if(!ss.isObject(e))throw new TypeError("target must be an object");t=t||new(BQo||FormData),r=ss.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,w){return!ss.isUndefined(w[m])});let i=r.metaTokens,n=r.visitor||o,a=r.dots,u=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&ss.isSpecCompliantForm(t);if(!ss.isFunction(n))throw new TypeError("visitor must be a function");function s(O){if(O===null)return"";if(ss.isDate(O))return O.toISOString();if(ss.isBoolean(O))return O.toString();if(!d&&ss.isBlob(O))throw new Qp("Blob is not supported. Use a Buffer instead.");return ss.isArrayBuffer(O)||ss.isTypedArray(O)?d&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function o(O,m,w){let E=O;if(O&&!w&&typeof O=="object"){if(ss.endsWith(m,"{}"))m=i?m:m.slice(0,-2),O=JSON.stringify(O);else if(ss.isArray(O)&&RrE(O)||(ss.isFileList(O)||ss.endsWith(m,"[]"))&&(E=ss.toArray(O)))return m=AXp(m),E.forEach(function(M,D){!(ss.isUndefined(M)||M===null)&&t.append(u===!0?MXp([m],D,a):u===null?m:m+"[]",s(M))}),!1}return Ipc(O)?!0:(t.append(MXp(w,m,a),s(O)),!1)}let c=[],b=Object.assign(xrE,{defaultVisitor:o,convertValue:s,isVisitable:Ipc});function g(O,m){if(!ss.isUndefined(O)){if(c.indexOf(O)!==-1)throw Error("Circular reference detected in "+m.join("."));c.push(O),ss.forEach(O,function(E,q){(!(ss.isUndefined(E)||E===null)&&n.call(t,E,ss.isString(q)?q.trim():q,m,b))===!0&&g(E,m?m.concat(q):[q])}),c.pop()}}if(!ss.isObject(e))throw new TypeError("data must be an object");return g(e),t}var ZRi=NrE;function qXp(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function TXp(e,t){this._pairs=[],e&&ZRi(e,this,t)}var CXp=TXp.prototype;CXp.append=function(t,r){this._pairs.push([t,r])};CXp.toString=function(t){let r=t?function(i){return t.call(this,i,qXp)}:qXp;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var BXp=TXp;function FrE(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function drn(e,t,r){if(!t)return e;let i=r&&r.encode||FrE;ss.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,a;if(n?a=n(t,r):a=ss.isURLSearchParams(t)?t.toString():new BXp(t,r).toString(i),a){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var zpc=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ss.forEach(this.handlers,function(i){i!==null&&t(i)})}},Rpc=zpc;var SHn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var xXp=si(require("crypto"),1);var IXp=si(require("url"),1),zXp=IXp.default.URLSearchParams;var xpc="abcdefghijklmnopqrstuvwxyz",RXp="0123456789",NXp={DIGIT:RXp,ALPHA:xpc,ALPHA_DIGIT:xpc+xpc.toUpperCase()+RXp},LrE=(e=16,t=NXp.ALPHA_DIGIT)=>{let r="",{length:i}=t,n=new Uint32Array(e);xXp.default.randomFillSync(n);for(let a=0;a<e;a++)r+=t[n[a]%i];return r},FXp={isNode:!0,classes:{URLSearchParams:zXp,FormData:BQo,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:NXp,generateString:LrE,protocols:["http","https","file","data"]};var Lpc={};Po(Lpc,{hasBrowserEnv:()=>Fpc,hasStandardBrowserEnv:()=>UrE,hasStandardBrowserWebWorkerEnv:()=>VrE,navigator:()=>Npc,origin:()=>WrE});var Fpc=typeof window<"u"&&typeof document<"u",Npc=typeof navigator=="object"&&navigator||void 0,UrE=Fpc&&(!Npc||["ReactNative","NativeScript","NS"].indexOf(Npc.product)<0),VrE=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",WrE=Fpc&&window.location.href||"http://localhost";var NA={...Lpc,...FXp};function Upc(e,t){return ZRi(e,new NA.classes.URLSearchParams,Object.assign({visitor:function(r,i,n,a){return NA.isNode&&ss.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function HrE(e){return ss.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $rE(e){let t={},r=Object.keys(e),i,n=r.length,a;for(i=0;i<n;i++)a=r[i],t[a]=e[a];return t}function GrE(e){function t(r,i,n,a){let u=r[a++];if(u==="__proto__")return!0;let l=Number.isFinite(+u),d=a>=r.length;return u=!u&&ss.isArray(n)?n.length:u,d?(ss.hasOwnProp(n,u)?n[u]=[n[u],i]:n[u]=i,!l):((!n[u]||!ss.isObject(n[u]))&&(n[u]=[]),t(r,i,n[u],a)&&ss.isArray(n[u])&&(n[u]=$rE(n[u])),!l)}if(ss.isFormData(e)&&ss.isFunction(e.entries)){let r={};return ss.forEachEntry(e,(i,n)=>{t(HrE(i),n,r,0)}),r}return null}var IQo=GrE;function QrE(e,t,r){if(ss.isString(e))try{return(t||JSON.parse)(e),ss.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var Vpc={transitional:SHn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=ss.isObject(t);if(a&&ss.isHTMLForm(t)&&(t=new FormData(t)),ss.isFormData(t))return n?JSON.stringify(IQo(t)):t;if(ss.isArrayBuffer(t)||ss.isBuffer(t)||ss.isStream(t)||ss.isFile(t)||ss.isBlob(t)||ss.isReadableStream(t))return t;if(ss.isArrayBufferView(t))return t.buffer;if(ss.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Upc(t,this.formSerializer).toString();if((l=ss.isFileList(t))||i.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return ZRi(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),QrE(t)):t}],transformResponse:[function(t){let r=this.transitional||Vpc.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(ss.isResponse(t)||ss.isReadableStream(t))return t;if(t&&ss.isString(t)&&(i&&!this.responseType||n)){let u=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(l){if(u)throw l.name==="SyntaxError"?Qp.from(l,Qp.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:NA.classes.FormData,Blob:NA.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ss.forEach(["delete","get","head","post","put","patch"],e=>{Vpc.headers[e]={}});var DHn=Vpc;var JrE=ss.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),LXp=e=>{let t={},r,i,n;return e&&e.split(`
|
|
1712
|
+
`);for(let l=n;l<u.length;l++){let d=u[l];if(d.length>1024)continue;let s=JYp.test(d)?d.replace(JYp,"$1"):d;if(!s.match(/\S*Error: /)){for(let o of r){let c=o(s);if(c){a.push(c);break}}if(a.length>=lXp)break}}return $tE(a)}}function $tE(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,lXp).map(r=>({...r,filename:r.filename||GtE(t).filename,function:r.function||fXp}))}function GtE(e){return e[e.length-1]||{}}vHn.stackParser=HtE(rtE());vHn.frameModifiers=[atE];var gHn=class extends Spc{getLibraryId(){return"posthog-node"}};var SQo=class{posthog;constructor({posthogApiKey:t}){this.posthog=new gHn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.66.27",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var s7a=class{async sendEvent(){}async identify(){}async flush(){}};var mHn=require("fs/promises"),hXp=require("os"),yXp=require("path");var dXp=si(require("crypto")),EQo=new Uint8Array(256),DQo=EQo.length;function Apc(){return DQo>EQo.length-16&&(dXp.default.randomFillSync(EQo),DQo=0),EQo.slice(DQo,DQo+=16)}var CH=[];for(let e=0;e<256;++e)CH.push((e+256).toString(16).slice(1));function pXp(e,t=0){return CH[e[t+0]]+CH[e[t+1]]+CH[e[t+2]]+CH[e[t+3]]+"-"+CH[e[t+4]]+CH[e[t+5]]+"-"+CH[e[t+6]]+CH[e[t+7]]+"-"+CH[e[t+8]]+CH[e[t+9]]+"-"+CH[e[t+10]]+CH[e[t+11]]+CH[e[t+12]]+CH[e[t+13]]+CH[e[t+14]]+CH[e[t+15]]}var _Xp=si(require("crypto")),qpc={randomUUID:_Xp.default.randomUUID};function QtE(e,t,r){if(qpc.randomUUID&&!t&&!e)return qpc.randomUUID();e=e||{};let i=e.random||(e.rng||Apc)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return pXp(i)}var Qoe=QtE;var JtE="id",KtE=".fern",c7a=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new gHn(r),this.userId=t==null?void 0:hoc(t)}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"0.66.27",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Eu(Fc.of((0,hXp.homedir)()),Ta.of(KtE),Ta.of(JtE));await jf(t)||(await(0,mHn.mkdir)((0,yXp.dirname)(t),{recursive:!0}),await(0,mHn.writeFile)(t,Qoe())),this.persistedDistinctId=(await(0,mHn.readFile)(t)).toString()}return this.persistedDistinctId}};var Tpc;async function PHn(){return Tpc==null&&(Tpc=await YtE()),Tpc}async function YtE(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new s7a;let r=await WLo();return r!=null?new c7a({token:r,posthogApiKey:e}):await bVn()!=null?new SQo({posthogApiKey:e}):new c7a({token:void 0,posthogApiKey:e})}catch{return new s7a}}function l7a(e,t){return function(){return e.apply(t,arguments)}}var{toString:XtE}=Object.prototype,{getPrototypeOf:Bpc}=Object,{iterator:AQo,toStringTag:bXp}=Symbol,qQo=(e=>t=>{let r=XtE.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),MGt=e=>(e=e.toLowerCase(),t=>qQo(t)===e),TQo=e=>t=>typeof t===e,{isArray:jHn}=Array,f7a=TQo("undefined");function ZtE(e){return e!==null&&!f7a(e)&&e.constructor!==null&&!f7a(e.constructor)&&Joe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var gXp=MGt("ArrayBuffer");function ktE(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&gXp(e.buffer),t}var erE=TQo("string"),Joe=TQo("function"),OXp=TQo("number"),CQo=e=>e!==null&&typeof e=="object",trE=e=>e===!0||e===!1,MQo=e=>{if(qQo(e)!=="object")return!1;let t=Bpc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(bXp in e)&&!(AQo in e)},rrE=MGt("Date"),irE=MGt("File"),nrE=MGt("Blob"),arE=MGt("FileList"),orE=e=>CQo(e)&&Joe(e.pipe),urE=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Joe(e.append)&&((t=qQo(e))==="formdata"||t==="object"&&Joe(e.toString)&&e.toString()==="[object FormData]"))},srE=MGt("URLSearchParams"),[crE,lrE,frE,drE]=["ReadableStream","Request","Response","Headers"].map(MGt),prE=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function d7a(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),jHn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let a=r?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length,l;for(i=0;i<u;i++)l=a[i],t.call(null,e[l],l,e)}}function mXp(e,t){t=t.toLowerCase();let r=Object.keys(e),i=r.length,n;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}var frn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,PXp=e=>!f7a(e)&&e!==frn;function Cpc(){let{caseless:e}=PXp(this)&&this||{},t={},r=(i,n)=>{let a=e&&mXp(t,n)||n;MQo(t[a])&&MQo(i)?t[a]=Cpc(t[a],i):MQo(i)?t[a]=Cpc({},i):jHn(i)?t[a]=i.slice():t[a]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&d7a(arguments[i],r);return t}var _rE=(e,t,r,{allOwnKeys:i}={})=>(d7a(t,(n,a)=>{r&&Joe(n)?e[a]=l7a(n,r):e[a]=n},{allOwnKeys:i}),e),hrE=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),yrE=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},vrE=(e,t,r,i)=>{let n,a,u,l={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)u=n[a],(!i||i(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=r!==!1&&Bpc(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},brE=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},grE=e=>{if(!e)return null;if(jHn(e))return e;let t=e.length;if(!OXp(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},OrE=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Bpc(Uint8Array)),mrE=(e,t)=>{let i=(e&&e[AQo]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},PrE=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},jrE=MGt("HTMLFormElement"),wrE=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),vXp=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),SrE=MGt("RegExp"),jXp=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};d7a(r,(n,a)=>{let u;(u=t(n,a,e))!==!1&&(i[a]=u||n)}),Object.defineProperties(e,i)},DrE=e=>{jXp(e,(t,r)=>{if(Joe(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(Joe(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ErE=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return jHn(e)?i(e):i(String(e).split(t)),r},MrE=()=>{},ArE=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qrE(e){return!!(e&&Joe(e.append)&&e[bXp]==="FormData"&&e[AQo])}var TrE=e=>{let t=new Array(10),r=(i,n)=>{if(CQo(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;let a=jHn(i)?[]:{};return d7a(i,(u,l)=>{let d=r(u,n+1);!f7a(d)&&(a[l]=d)}),t[n]=void 0,a}}return i};return r(e,0)},CrE=MGt("AsyncFunction"),BrE=e=>e&&(CQo(e)||Joe(e))&&Joe(e.then)&&Joe(e.catch),wXp=((e,t)=>e?setImmediate:t?((r,i)=>(frn.addEventListener("message",({source:n,data:a})=>{n===frn&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),frn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Joe(frn.postMessage)),IrE=typeof queueMicrotask<"u"?queueMicrotask.bind(frn):typeof process<"u"&&process.nextTick||wXp,zrE=e=>e!=null&&Joe(e[AQo]),ss={isArray:jHn,isArrayBuffer:gXp,isBuffer:ZtE,isFormData:urE,isArrayBufferView:ktE,isString:erE,isNumber:OXp,isBoolean:trE,isObject:CQo,isPlainObject:MQo,isReadableStream:crE,isRequest:lrE,isResponse:frE,isHeaders:drE,isUndefined:f7a,isDate:rrE,isFile:irE,isBlob:nrE,isRegExp:SrE,isFunction:Joe,isStream:orE,isURLSearchParams:srE,isTypedArray:OrE,isFileList:arE,forEach:d7a,merge:Cpc,extend:_rE,trim:prE,stripBOM:hrE,inherits:yrE,toFlatObject:vrE,kindOf:qQo,kindOfTest:MGt,endsWith:brE,toArray:grE,forEachEntry:mrE,matchAll:PrE,isHTMLForm:jrE,hasOwnProperty:vXp,hasOwnProp:vXp,reduceDescriptors:jXp,freezeMethods:DrE,toObjectSet:ErE,toCamelCase:wrE,noop:MrE,toFiniteNumber:ArE,findKey:mXp,global:frn,isContextDefined:PXp,isSpecCompliantForm:qrE,toJSONObject:TrE,isAsyncFn:CrE,isThenable:BrE,setImmediate:wXp,asap:IrE,isIterable:zrE};function wHn(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}ss.inherits(wHn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ss.toJSONObject(this.config),code:this.code,status:this.status}}});var SXp=wHn.prototype,DXp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{DXp[e]={value:e}});Object.defineProperties(wHn,DXp);Object.defineProperty(SXp,"isAxiosError",{value:!0});wHn.from=(e,t,r,i,n,a)=>{let u=Object.create(SXp);return ss.toFlatObject(e,u,function(d){return d!==Error.prototype},l=>l!=="isAxiosError"),wHn.call(u,e.message,t,r,i,n),u.cause=e,u.name=e.name,a&&Object.assign(u,a),u};var Qp=wHn;var EXp=si(kGo(),1),BQo=EXp.default;function Ipc(e){return ss.isPlainObject(e)||ss.isArray(e)}function AXp(e){return ss.endsWith(e,"[]")?e.slice(0,-2):e}function MXp(e,t,r){return e?e.concat(t).map(function(n,a){return n=AXp(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function RrE(e){return ss.isArray(e)&&!e.some(Ipc)}var xrE=ss.toFlatObject(ss,{},null,function(t){return/^is[A-Z]/.test(t)});function NrE(e,t,r){if(!ss.isObject(e))throw new TypeError("target must be an object");t=t||new(BQo||FormData),r=ss.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,w){return!ss.isUndefined(w[m])});let i=r.metaTokens,n=r.visitor||o,a=r.dots,u=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&ss.isSpecCompliantForm(t);if(!ss.isFunction(n))throw new TypeError("visitor must be a function");function s(O){if(O===null)return"";if(ss.isDate(O))return O.toISOString();if(ss.isBoolean(O))return O.toString();if(!d&&ss.isBlob(O))throw new Qp("Blob is not supported. Use a Buffer instead.");return ss.isArrayBuffer(O)||ss.isTypedArray(O)?d&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function o(O,m,w){let E=O;if(O&&!w&&typeof O=="object"){if(ss.endsWith(m,"{}"))m=i?m:m.slice(0,-2),O=JSON.stringify(O);else if(ss.isArray(O)&&RrE(O)||(ss.isFileList(O)||ss.endsWith(m,"[]"))&&(E=ss.toArray(O)))return m=AXp(m),E.forEach(function(M,D){!(ss.isUndefined(M)||M===null)&&t.append(u===!0?MXp([m],D,a):u===null?m:m+"[]",s(M))}),!1}return Ipc(O)?!0:(t.append(MXp(w,m,a),s(O)),!1)}let c=[],b=Object.assign(xrE,{defaultVisitor:o,convertValue:s,isVisitable:Ipc});function g(O,m){if(!ss.isUndefined(O)){if(c.indexOf(O)!==-1)throw Error("Circular reference detected in "+m.join("."));c.push(O),ss.forEach(O,function(E,q){(!(ss.isUndefined(E)||E===null)&&n.call(t,E,ss.isString(q)?q.trim():q,m,b))===!0&&g(E,m?m.concat(q):[q])}),c.pop()}}if(!ss.isObject(e))throw new TypeError("data must be an object");return g(e),t}var ZRi=NrE;function qXp(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function TXp(e,t){this._pairs=[],e&&ZRi(e,this,t)}var CXp=TXp.prototype;CXp.append=function(t,r){this._pairs.push([t,r])};CXp.toString=function(t){let r=t?function(i){return t.call(this,i,qXp)}:qXp;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var BXp=TXp;function FrE(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function drn(e,t,r){if(!t)return e;let i=r&&r.encode||FrE;ss.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,a;if(n?a=n(t,r):a=ss.isURLSearchParams(t)?t.toString():new BXp(t,r).toString(i),a){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var zpc=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ss.forEach(this.handlers,function(i){i!==null&&t(i)})}},Rpc=zpc;var SHn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var xXp=si(require("crypto"),1);var IXp=si(require("url"),1),zXp=IXp.default.URLSearchParams;var xpc="abcdefghijklmnopqrstuvwxyz",RXp="0123456789",NXp={DIGIT:RXp,ALPHA:xpc,ALPHA_DIGIT:xpc+xpc.toUpperCase()+RXp},LrE=(e=16,t=NXp.ALPHA_DIGIT)=>{let r="",{length:i}=t,n=new Uint32Array(e);xXp.default.randomFillSync(n);for(let a=0;a<e;a++)r+=t[n[a]%i];return r},FXp={isNode:!0,classes:{URLSearchParams:zXp,FormData:BQo,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:NXp,generateString:LrE,protocols:["http","https","file","data"]};var Lpc={};Po(Lpc,{hasBrowserEnv:()=>Fpc,hasStandardBrowserEnv:()=>UrE,hasStandardBrowserWebWorkerEnv:()=>VrE,navigator:()=>Npc,origin:()=>WrE});var Fpc=typeof window<"u"&&typeof document<"u",Npc=typeof navigator=="object"&&navigator||void 0,UrE=Fpc&&(!Npc||["ReactNative","NativeScript","NS"].indexOf(Npc.product)<0),VrE=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",WrE=Fpc&&window.location.href||"http://localhost";var NA={...Lpc,...FXp};function Upc(e,t){return ZRi(e,new NA.classes.URLSearchParams,Object.assign({visitor:function(r,i,n,a){return NA.isNode&&ss.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function HrE(e){return ss.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $rE(e){let t={},r=Object.keys(e),i,n=r.length,a;for(i=0;i<n;i++)a=r[i],t[a]=e[a];return t}function GrE(e){function t(r,i,n,a){let u=r[a++];if(u==="__proto__")return!0;let l=Number.isFinite(+u),d=a>=r.length;return u=!u&&ss.isArray(n)?n.length:u,d?(ss.hasOwnProp(n,u)?n[u]=[n[u],i]:n[u]=i,!l):((!n[u]||!ss.isObject(n[u]))&&(n[u]=[]),t(r,i,n[u],a)&&ss.isArray(n[u])&&(n[u]=$rE(n[u])),!l)}if(ss.isFormData(e)&&ss.isFunction(e.entries)){let r={};return ss.forEachEntry(e,(i,n)=>{t(HrE(i),n,r,0)}),r}return null}var IQo=GrE;function QrE(e,t,r){if(ss.isString(e))try{return(t||JSON.parse)(e),ss.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var Vpc={transitional:SHn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=ss.isObject(t);if(a&&ss.isHTMLForm(t)&&(t=new FormData(t)),ss.isFormData(t))return n?JSON.stringify(IQo(t)):t;if(ss.isArrayBuffer(t)||ss.isBuffer(t)||ss.isStream(t)||ss.isFile(t)||ss.isBlob(t)||ss.isReadableStream(t))return t;if(ss.isArrayBufferView(t))return t.buffer;if(ss.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Upc(t,this.formSerializer).toString();if((l=ss.isFileList(t))||i.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return ZRi(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),QrE(t)):t}],transformResponse:[function(t){let r=this.transitional||Vpc.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(ss.isResponse(t)||ss.isReadableStream(t))return t;if(t&&ss.isString(t)&&(i&&!this.responseType||n)){let u=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(l){if(u)throw l.name==="SyntaxError"?Qp.from(l,Qp.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:NA.classes.FormData,Blob:NA.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ss.forEach(["delete","get","head","post","put","patch"],e=>{Vpc.headers[e]={}});var DHn=Vpc;var JrE=ss.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),LXp=e=>{let t={},r,i,n;return e&&e.split(`
|
|
1713
1713
|
`).forEach(function(u){n=u.indexOf(":"),r=u.substring(0,n).trim().toLowerCase(),i=u.substring(n+1).trim(),!(!r||t[r]&&JrE[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t};var UXp=Symbol("internals");function p7a(e){return e&&String(e).trim().toLowerCase()}function zQo(e){return e===!1||e==null?e:ss.isArray(e)?e.map(zQo):String(e)}function KrE(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}var YrE=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wpc(e,t,r,i,n){if(ss.isFunction(i))return i.call(this,t,r);if(n&&(t=r),!!ss.isString(t)){if(ss.isString(i))return t.indexOf(i)!==-1;if(ss.isRegExp(i))return i.test(t)}}function XrE(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function ZrE(e,t){let r=ss.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(n,a,u){return this[i].call(this,t,n,a,u)},configurable:!0})})}var EHn=class{constructor(t){t&&this.set(t)}set(t,r,i){let n=this;function a(l,d,s){let o=p7a(d);if(!o)throw new Error("header name must be a non-empty string");let c=ss.findKey(n,o);(!c||n[c]===void 0||s===!0||s===void 0&&n[c]!==!1)&&(n[c||d]=zQo(l))}let u=(l,d)=>ss.forEach(l,(s,o)=>a(s,o,d));if(ss.isPlainObject(t)||t instanceof this.constructor)u(t,r);else if(ss.isString(t)&&(t=t.trim())&&!YrE(t))u(LXp(t),r);else if(ss.isObject(t)&&ss.isIterable(t)){let l={},d,s;for(let o of t){if(!ss.isArray(o))throw TypeError("Object iterator must return a key-value pair");l[s=o[0]]=(d=l[s])?ss.isArray(d)?[...d,o[1]]:[d,o[1]]:o[1]}u(l,r)}else t!=null&&a(r,t,i);return this}get(t,r){if(t=p7a(t),t){let i=ss.findKey(this,t);if(i){let n=this[i];if(!r)return n;if(r===!0)return KrE(n);if(ss.isFunction(r))return r.call(this,n,i);if(ss.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=p7a(t),t){let i=ss.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||Wpc(this,this[i],i,r)))}return!1}delete(t,r){let i=this,n=!1;function a(u){if(u=p7a(u),u){let l=ss.findKey(i,u);l&&(!r||Wpc(i,i[l],l,r))&&(delete i[l],n=!0)}}return ss.isArray(t)?t.forEach(a):a(t),n}clear(t){let r=Object.keys(this),i=r.length,n=!1;for(;i--;){let a=r[i];(!t||Wpc(this,this[a],a,t,!0))&&(delete this[a],n=!0)}return n}normalize(t){let r=this,i={};return ss.forEach(this,(n,a)=>{let u=ss.findKey(i,a);if(u){r[u]=zQo(n),delete r[a];return}let l=t?XrE(a):String(a).trim();l!==a&&delete r[a],r[l]=zQo(n),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return ss.forEach(this,(i,n)=>{i!=null&&i!==!1&&(r[n]=t&&ss.isArray(i)?i.join(", "):i)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
1714
1714
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let i=new this(t);return r.forEach(n=>i.set(n)),i}static accessor(t){let i=(this[UXp]=this[UXp]={accessors:{}}).accessors,n=this.prototype;function a(u){let l=p7a(u);i[l]||(ZrE(n,u),i[l]=!0)}return ss.isArray(t)?t.forEach(a):a(t),this}};EHn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ss.reduceDescriptors(EHn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});ss.freezeMethods(EHn);var Kx=EHn;function _7a(e,t){let r=this||DHn,i=t||r,n=Kx.from(i.headers),a=i.data;return ss.forEach(e,function(l){a=l.call(r,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function h7a(e){return!!(e&&e.__CANCEL__)}function VXp(e,t,r){Qp.call(this,e??"canceled",Qp.ERR_CANCELED,t,r),this.name="CanceledError"}ss.inherits(VXp,Qp,{__CANCEL__:!0});var DAe=VXp;function war(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new Qp("Request failed with status code "+r.status,[Qp.ERR_BAD_REQUEST,Qp.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Hpc(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $pc(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function prn(e,t,r){let i=!Hpc(t);return e&&(i||r==!1)?$pc(e,t):t}var nZp=si(X3a(),1),aZp=si(require("http"),1),oZp=si(require("https"),1),uZp=si(require("util"),1),sZp=si($dc(),1),ZOi=si(require("zlib"),1);var _rn="1.10.0";function y7a(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var krE=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Gpc(e,t,r){let i=r&&r.Blob||NA.classes.Blob,n=y7a(e);if(t===void 0&&i&&(t=!0),n==="data"){e=n.length?e.slice(n.length+1):e;let a=krE.exec(e);if(!a)throw new Qp("Invalid URL",Qp.ERR_INVALID_URL);let u=a[1],l=a[2],d=a[3],s=Buffer.from(decodeURIComponent(d),l?"base64":"utf8");if(t){if(!i)throw new Qp("Blob is not supported",Qp.ERR_NOT_SUPPORT);return new i([s],{type:u})}return s}throw new Qp("Unsupported protocol "+n,Qp.ERR_NOT_SUPPORT)}var yrn=si(require("stream"),1);var WXp=si(require("stream"),1);var Qpc=Symbol("internals"),Jpc=class extends WXp.default.Transform{constructor(t){t=ss.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,n)=>!ss.isUndefined(n[i])),super({readableHighWaterMark:t.chunkSize});let r=this[Qpc]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[Qpc];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,i){let n=this[Qpc],a=n.maxRate,u=this.readableHighWaterMark,l=n.timeWindow,d=1e3/l,s=a/d,o=n.minChunkSize!==!1?Math.max(n.minChunkSize,s*.01):0,c=(g,O)=>{let m=Buffer.byteLength(g);n.bytesSeen+=m,n.bytes+=m,n.isCaptured&&this.emit("progress",n.bytesSeen),this.push(g)?process.nextTick(O):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(O)}},b=(g,O)=>{let m=Buffer.byteLength(g),w=null,E=u,q,M=0;if(a){let D=Date.now();(!n.ts||(M=D-n.ts)>=l)&&(n.ts=D,q=s-n.bytes,n.bytes=q<0?-q:0,M=0),q=s-n.bytes}if(a){if(q<=0)return setTimeout(()=>{O(null,g)},l-M);q<E&&(E=q)}E&&m>E&&m-E>o&&(w=g.subarray(E),g=g.subarray(0,E)),c(g,w?()=>{process.nextTick(O,null,w)}:O)};b(t,function g(O,m){if(O)return i(O);m?b(m,g):i(null)})}},Kpc=Jpc;var cZp=require("events");var $Xp=si(require("util"),1),GXp=require("stream");var{asyncIterator:HXp}=Symbol,eiE=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[HXp]?yield*e[HXp]():yield e},RQo=eiE;var tiE=NA.ALPHABET.ALPHA_DIGIT+"-_",v7a=typeof TextEncoder=="function"?new TextEncoder:new $Xp.default.TextEncoder,hrn=`\r
|
|
1715
1715
|
`,riE=v7a.encode(hrn),iiE=2,Ypc=class{constructor(t,r){let{escapeName:i}=this.constructor,n=ss.isString(r),a=`Content-Disposition: form-data; name="${i(t)}"${!n&&r.name?`; filename="${i(r.name)}"`:""}${hrn}`;n?r=v7a.encode(String(r).replace(/\r?\n|\r\n?/g,hrn)):a+=`Content-Type: ${r.type||"application/octet-stream"}${hrn}`,this.headers=v7a.encode(a+hrn),this.contentLength=n?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+iiE,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;ss.isTypedArray(t)?yield t:yield*RQo(t),yield riE}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},niE=(e,t,r)=>{let{tag:i="form-data-boundary",size:n=25,boundary:a=i+"-"+NA.generateString(n,tiE)}=r||{};if(!ss.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let u=v7a.encode("--"+a+hrn),l=v7a.encode("--"+a+"--"+hrn),d=l.byteLength,s=Array.from(e.entries()).map(([c,b])=>{let g=new Ypc(c,b);return d+=g.size,g});d+=u.byteLength*s.length,d=ss.toFiniteNumber(d);let o={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(d)&&(o["Content-Length"]=d),t&&t(o),GXp.Readable.from(async function*(){for(let c of s)yield u,yield*c.encode();yield l}())},QXp=niE;var JXp=si(require("stream"),1),Xpc=class extends JXp.default.Transform{__transform(t,r,i){this.push(t),i()}_transform(t,r,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,r)}this.__transform(t,r,i)}},KXp=Xpc;var aiE=(e,t)=>ss.isAsyncFn(e)?function(...r){let i=r.pop();e.apply(this,r).then(n=>{try{t?i(null,...t(n)):i(null,n)}catch(a){i(a)}},i)}:e,YXp=aiE;function oiE(e,t){e=e||10;let r=new Array(e),i=new Array(e),n=0,a=0,u;return t=t!==void 0?t:1e3,function(d){let s=Date.now(),o=i[a];u||(u=s),r[n]=d,i[n]=s;let c=a,b=0;for(;c!==n;)b+=r[c++],c=c%e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),s-u<t)return;let g=o&&s-o;return g?Math.round(b*1e3/g):void 0}}var XXp=oiE;function uiE(e,t){let r=0,i=1e3/t,n,a,u=(s,o=Date.now())=>{r=o,n=null,a&&(clearTimeout(a),a=null),e.apply(null,s)};return[(...s)=>{let o=Date.now(),c=o-r;c>=i?u(s,o):(n=s,a||(a=setTimeout(()=>{a=null,u(n)},i-c)))},()=>n&&u(n)]}var ZXp=uiE;var XOi=(e,t,r=3)=>{let i=0,n=XXp(50,250);return ZXp(a=>{let u=a.loaded,l=a.lengthComputable?a.total:void 0,d=u-i,s=n(d),o=u<=l;i=u;let c={loaded:u,total:l,progress:l?u/l:void 0,bytes:d,rate:s||void 0,estimated:s&&l&&o?(l-u)/s:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(c)},r)},MHn=(e,t)=>{let r=e!=null;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},AHn=e=>(...t)=>ss.asap(()=>e(...t));var kXp={flush:ZOi.default.constants.Z_SYNC_FLUSH,finishFlush:ZOi.default.constants.Z_SYNC_FLUSH},siE={flush:ZOi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:ZOi.default.constants.BROTLI_OPERATION_FLUSH},eZp=ss.isFunction(ZOi.default.createBrotliDecompress),{http:ciE,https:liE}=sZp.default,fiE=/https:?/,tZp=NA.protocols.map(e=>e+":"),rZp=(e,[t,r])=>(e.on("end",r).on("error",r),t);function diE(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function lZp(e,t,r){let i=t;if(!i&&i!==!1){let n=nZp.default.getProxyForUrl(r);n&&(i=new URL(n))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let a=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+a}e.headers.host=e.hostname+(e.port?":"+e.port:"");let n=i.hostname||i.host;e.hostname=n,e.host=n,e.port=i.port,e.path=r,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(a){lZp(a,t,a.href)}}var piE=typeof process<"u"&&ss.kindOf(process)==="process",_iE=e=>new Promise((t,r)=>{let i,n,a=(d,s)=>{n||(n=!0,i&&i(d,s))},u=d=>{a(d),t(d)},l=d=>{a(d,!0),r(d)};e(u,l,d=>i=d).catch(l)}),hiE=({address:e,family:t})=>{if(!ss.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},iZp=(e,t)=>hiE(ss.isObject(e)?e:{address:e,family:t}),fZp=piE&&function(t){return _iE(async function(i,n,a){let{data:u,lookup:l,family:d}=t,{responseType:s,responseEncoding:o}=t,c=t.method.toUpperCase(),b,g=!1,O;if(l){let me=YXp(l,Ue=>ss.isArray(Ue)?Ue:[Ue]);l=(Ue,vt,De)=>{me(Ue,vt,(Te,zt,Pe)=>{if(Te)return De(Te);let Dt=ss.isArray(zt)?zt.map(ut=>iZp(ut)):[iZp(zt,Pe)];vt.all?De(Te,Dt):De(Te,Dt[0].address,Dt[0].family)})}}let m=new cZp.EventEmitter,w=()=>{t.cancelToken&&t.cancelToken.unsubscribe(E),t.signal&&t.signal.removeEventListener("abort",E),m.removeAllListeners()};a((me,Ue)=>{b=!0,Ue&&(g=!0,w())});function E(me){m.emit("abort",!me||me.type?new DAe(null,t,O):me)}m.once("abort",n),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(E),t.signal&&(t.signal.aborted?E():t.signal.addEventListener("abort",E)));let q=prn(t.baseURL,t.url,t.allowAbsoluteUrls),M=new URL(q,NA.hasBrowserEnv?NA.origin:void 0),D=M.protocol||tZp[0];if(D==="data:"){let me;if(c!=="GET")return war(i,n,{status:405,statusText:"method not allowed",headers:{},config:t});try{me=Gpc(t.url,s==="blob",{Blob:t.env&&t.env.Blob})}catch(Ue){throw Qp.from(Ue,Qp.ERR_BAD_REQUEST,t)}return s==="text"?(me=me.toString(o),(!o||o==="utf8")&&(me=ss.stripBOM(me))):s==="stream"&&(me=yrn.default.Readable.from(me)),war(i,n,{data:me,status:200,statusText:"OK",headers:new Kx,config:t})}if(tZp.indexOf(D)===-1)return n(new Qp("Unsupported protocol "+D,Qp.ERR_BAD_REQUEST,t));let C=Kx.from(t.headers).normalize();C.set("User-Agent","axios/"+_rn,!1);let{onUploadProgress:R,onDownloadProgress:G}=t,I=t.maxRate,L,V;if(ss.isSpecCompliantForm(u)){let me=C.getContentType(/boundary=([-_\w\d]{10,70})/i);u=QXp(u,Ue=>{C.set(Ue)},{tag:`axios-${_rn}-boundary`,boundary:me&&me[1]||void 0})}else if(ss.isFormData(u)&&ss.isFunction(u.getHeaders)){if(C.set(u.getHeaders()),!C.hasContentLength())try{let me=await uZp.default.promisify(u.getLength).call(u);Number.isFinite(me)&&me>=0&&C.setContentLength(me)}catch{}}else if(ss.isBlob(u)||ss.isFile(u))u.size&&C.setContentType(u.type||"application/octet-stream"),C.setContentLength(u.size||0),u=yrn.default.Readable.from(RQo(u));else if(u&&!ss.isStream(u)){if(!Buffer.isBuffer(u))if(ss.isArrayBuffer(u))u=Buffer.from(new Uint8Array(u));else if(ss.isString(u))u=Buffer.from(u,"utf-8");else return n(new Qp("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Qp.ERR_BAD_REQUEST,t));if(C.setContentLength(u.length,!1),t.maxBodyLength>-1&&u.length>t.maxBodyLength)return n(new Qp("Request body larger than maxBodyLength limit",Qp.ERR_BAD_REQUEST,t))}let Y=ss.toFiniteNumber(C.getContentLength());ss.isArray(I)?(L=I[0],V=I[1]):L=V=I,u&&(R||L)&&(ss.isStream(u)||(u=yrn.default.Readable.from(u,{objectMode:!1})),u=yrn.default.pipeline([u,new Kpc({maxRate:ss.toFiniteNumber(L)})],ss.noop),R&&u.on("progress",rZp(u,MHn(Y,XOi(AHn(R),!1,3)))));let K;if(t.auth){let me=t.auth.username||"",Ue=t.auth.password||"";K=me+":"+Ue}if(!K&&M.username){let me=M.username,Ue=M.password;K=me+":"+Ue}K&&C.delete("authorization");let X;try{X=drn(M.pathname+M.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(me){let Ue=new Error(me.message);return Ue.config=t,Ue.url=t.url,Ue.exists=!0,n(Ue)}C.set("Accept-Encoding","gzip, compress, deflate"+(eZp?", br":""),!1);let oe={path:X,method:c,headers:C.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:K,protocol:D,family:d,beforeRedirect:diE,beforeRedirects:{}};!ss.isUndefined(l)&&(oe.lookup=l),t.socketPath?oe.socketPath=t.socketPath:(oe.hostname=M.hostname.startsWith("[")?M.hostname.slice(1,-1):M.hostname,oe.port=M.port,lZp(oe,t.proxy,D+"//"+M.hostname+(M.port?":"+M.port:"")+oe.path));let pe,de=fiE.test(oe.protocol);if(oe.agent=de?t.httpsAgent:t.httpAgent,t.transport?pe=t.transport:t.maxRedirects===0?pe=de?oZp.default:aZp.default:(t.maxRedirects&&(oe.maxRedirects=t.maxRedirects),t.beforeRedirect&&(oe.beforeRedirects.config=t.beforeRedirect),pe=de?liE:ciE),t.maxBodyLength>-1?oe.maxBodyLength=t.maxBodyLength:oe.maxBodyLength=1/0,t.insecureHTTPParser&&(oe.insecureHTTPParser=t.insecureHTTPParser),O=pe.request(oe,function(Ue){if(O.destroyed)return;let vt=[Ue],De=+Ue.headers["content-length"];if(G||V){let ut=new Kpc({maxRate:ss.toFiniteNumber(V)});G&&ut.on("progress",rZp(ut,MHn(De,XOi(AHn(G),!0,3)))),vt.push(ut)}let Te=Ue,zt=Ue.req||O;if(t.decompress!==!1&&Ue.headers["content-encoding"])switch((c==="HEAD"||Ue.statusCode===204)&&delete Ue.headers["content-encoding"],(Ue.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":vt.push(ZOi.default.createUnzip(kXp)),delete Ue.headers["content-encoding"];break;case"deflate":vt.push(new KXp),vt.push(ZOi.default.createUnzip(kXp)),delete Ue.headers["content-encoding"];break;case"br":eZp&&(vt.push(ZOi.default.createBrotliDecompress(siE)),delete Ue.headers["content-encoding"])}Te=vt.length>1?yrn.default.pipeline(vt,ss.noop):vt[0];let Pe=yrn.default.finished(Te,()=>{Pe(),w()}),Dt={status:Ue.statusCode,statusText:Ue.statusMessage,headers:new Kx(Ue.headers),config:t,request:zt};if(s==="stream")Dt.data=Te,war(i,n,Dt);else{let ut=[],Oe=0;Te.on("data",function(mt){ut.push(mt),Oe+=mt.length,t.maxContentLength>-1&&Oe>t.maxContentLength&&(g=!0,Te.destroy(),n(new Qp("maxContentLength size of "+t.maxContentLength+" exceeded",Qp.ERR_BAD_RESPONSE,t,zt)))}),Te.on("aborted",function(){if(g)return;let mt=new Qp("stream has been aborted",Qp.ERR_BAD_RESPONSE,t,zt);Te.destroy(mt),n(mt)}),Te.on("error",function(mt){O.destroyed||n(Qp.from(mt,null,t,zt))}),Te.on("end",function(){try{let mt=ut.length===1?ut[0]:Buffer.concat(ut);s!=="arraybuffer"&&(mt=mt.toString(o),(!o||o==="utf8")&&(mt=ss.stripBOM(mt))),Dt.data=mt}catch(mt){return n(Qp.from(mt,null,t,Dt.request,Dt))}war(i,n,Dt)})}m.once("abort",ut=>{Te.destroyed||(Te.emit("error",ut),Te.destroy())})}),m.once("abort",me=>{n(me),O.destroy(me)}),O.on("error",function(Ue){n(Qp.from(Ue,null,t,O))}),O.on("socket",function(Ue){Ue.setKeepAlive(!0,1e3*60)}),t.timeout){let me=parseInt(t.timeout,10);if(Number.isNaN(me)){n(new Qp("error trying to parse `config.timeout` to int",Qp.ERR_BAD_OPTION_VALUE,t,O));return}O.setTimeout(me,function(){if(b)return;let vt=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",De=t.transitional||SHn;t.timeoutErrorMessage&&(vt=t.timeoutErrorMessage),n(new Qp(vt,De.clarifyTimeoutError?Qp.ETIMEDOUT:Qp.ECONNABORTED,t,O)),E()})}if(ss.isStream(u)){let me=!1,Ue=!1;u.on("end",()=>{me=!0}),u.once("error",vt=>{Ue=!0,O.destroy(vt)}),u.on("close",()=>{!me&&!Ue&&E(new DAe("Request stream has been aborted",t,O))}),u.pipe(O)}else O.end(u)})};var dZp=NA.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,NA.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(NA.origin),NA.navigator&&/(msie|trident)/i.test(NA.navigator.userAgent)):()=>!0;var pZp=NA.hasStandardBrowserEnv?{write(e,t,r,i,n,a){let u=[e+"="+encodeURIComponent(t)];ss.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),ss.isString(i)&&u.push("path="+i),ss.isString(n)&&u.push("domain="+n),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var _Zp=e=>e instanceof Kx?{...e}:e;function AGt(e,t){t=t||{};let r={};function i(s,o,c,b){return ss.isPlainObject(s)&&ss.isPlainObject(o)?ss.merge.call({caseless:b},s,o):ss.isPlainObject(o)?ss.merge({},o):ss.isArray(o)?o.slice():o}function n(s,o,c,b){if(ss.isUndefined(o)){if(!ss.isUndefined(s))return i(void 0,s,c,b)}else return i(s,o,c,b)}function a(s,o){if(!ss.isUndefined(o))return i(void 0,o)}function u(s,o){if(ss.isUndefined(o)){if(!ss.isUndefined(s))return i(void 0,s)}else return i(void 0,o)}function l(s,o,c){if(c in t)return i(s,o);if(c in e)return i(void 0,s)}let d={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l,headers:(s,o,c)=>n(_Zp(s),_Zp(o),c,!0)};return ss.forEach(Object.keys(Object.assign({},e,t)),function(o){let c=d[o]||n,b=c(e[o],t[o],o);ss.isUndefined(b)&&c!==l||(r[o]=b)}),r}var xQo=e=>{let t=AGt({},e),{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:a,headers:u,auth:l}=t;t.headers=u=Kx.from(u),t.url=drn(prn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&u.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let d;if(ss.isFormData(r)){if(NA.hasStandardBrowserEnv||NA.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((d=u.getContentType())!==!1){let[s,...o]=d?d.split(";").map(c=>c.trim()).filter(Boolean):[];u.setContentType([s||"multipart/form-data",...o].join("; "))}}if(NA.hasStandardBrowserEnv&&(i&&ss.isFunction(i)&&(i=i(t)),i||i!==!1&&dZp(t.url))){let s=n&&a&&pZp.read(a);s&&u.set(n,s)}return t};var yiE=typeof XMLHttpRequest<"u",hZp=yiE&&function(e){return new Promise(function(r,i){let n=xQo(e),a=n.data,u=Kx.from(n.headers).normalize(),{responseType:l,onUploadProgress:d,onDownloadProgress:s}=n,o,c,b,g,O;function m(){g&&g(),O&&O(),n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let w=new XMLHttpRequest;w.open(n.method.toUpperCase(),n.url,!0),w.timeout=n.timeout;function E(){if(!w)return;let M=Kx.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:M,config:e,request:w};war(function(G){r(G),m()},function(G){i(G),m()},C),w=null}"onloadend"in w?w.onloadend=E:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(E)},w.onabort=function(){w&&(i(new Qp("Request aborted",Qp.ECONNABORTED,e,w)),w=null)},w.onerror=function(){i(new Qp("Network Error",Qp.ERR_NETWORK,e,w)),w=null},w.ontimeout=function(){let D=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",C=n.transitional||SHn;n.timeoutErrorMessage&&(D=n.timeoutErrorMessage),i(new Qp(D,C.clarifyTimeoutError?Qp.ETIMEDOUT:Qp.ECONNABORTED,e,w)),w=null},a===void 0&&u.setContentType(null),"setRequestHeader"in w&&ss.forEach(u.toJSON(),function(D,C){w.setRequestHeader(C,D)}),ss.isUndefined(n.withCredentials)||(w.withCredentials=!!n.withCredentials),l&&l!=="json"&&(w.responseType=n.responseType),s&&([b,O]=XOi(s,!0),w.addEventListener("progress",b)),d&&w.upload&&([c,g]=XOi(d),w.upload.addEventListener("progress",c),w.upload.addEventListener("loadend",g)),(n.cancelToken||n.signal)&&(o=M=>{w&&(i(!M||M.type?new DAe(null,e,w):M),w.abort(),w=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));let q=y7a(n.url);if(q&&NA.protocols.indexOf(q)===-1){i(new Qp("Unsupported protocol "+q+":",Qp.ERR_BAD_REQUEST,e));return}w.send(a||null)})};var viE=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let i=new AbortController,n,a=function(s){if(!n){n=!0,l();let o=s instanceof Error?s:this.reason;i.abort(o instanceof Qp?o:new DAe(o instanceof Error?o.message:o))}},u=t&&setTimeout(()=>{u=null,a(new Qp(`timeout ${t} of ms exceeded`,Qp.ETIMEDOUT))},t),l=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(s=>{s.unsubscribe?s.unsubscribe(a):s.removeEventListener("abort",a)}),e=null)};e.forEach(s=>s.addEventListener("abort",a));let{signal:d}=i;return d.unsubscribe=()=>ss.asap(l),d}},yZp=viE;var biE=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let i=0,n;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},giE=async function*(e,t){for await(let r of OiE(e))yield*biE(r,t)},OiE=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:i}=await t.read();if(r)break;yield i}}finally{await t.cancel()}},Zpc=(e,t,r,i)=>{let n=giE(e,t),a=0,u,l=d=>{u||(u=!0,i&&i(d))};return new ReadableStream({async pull(d){try{let{done:s,value:o}=await n.next();if(s){l(),d.close();return}let c=o.byteLength;if(r){let b=a+=c;r(b)}d.enqueue(new Uint8Array(o))}catch(s){throw l(s),s}},cancel(d){return l(d),n.return()}},{highWaterMark:2})};var FQo=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",bZp=FQo&&typeof ReadableStream=="function",miE=FQo&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),gZp=(e,...t)=>{try{return!!e(...t)}catch{return!1}},PiE=bZp&&gZp(()=>{let e=!1,t=new Request(NA.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),vZp=64*1024,kpc=bZp&&gZp(()=>ss.isReadableStream(new Response("").body)),NQo={stream:kpc&&(e=>e.body)};FQo&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!NQo[t]&&(NQo[t]=ss.isFunction(e[t])?r=>r[t]():(r,i)=>{throw new Qp(`Response type '${t}' is not supported`,Qp.ERR_NOT_SUPPORT,i)})})})(new Response);var jiE=async e=>{if(e==null)return 0;if(ss.isBlob(e))return e.size;if(ss.isSpecCompliantForm(e))return(await new Request(NA.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ss.isArrayBufferView(e)||ss.isArrayBuffer(e))return e.byteLength;if(ss.isURLSearchParams(e)&&(e=e+""),ss.isString(e))return(await miE(e)).byteLength},wiE=async(e,t)=>{let r=ss.toFiniteNumber(e.getContentLength());return r??jiE(t)},OZp=FQo&&(async e=>{let{url:t,method:r,data:i,signal:n,cancelToken:a,timeout:u,onDownloadProgress:l,onUploadProgress:d,responseType:s,headers:o,withCredentials:c="same-origin",fetchOptions:b}=xQo(e);s=s?(s+"").toLowerCase():"text";let g=yZp([n,a&&a.toAbortSignal()],u),O,m=g&&g.unsubscribe&&(()=>{g.unsubscribe()}),w;try{if(d&&PiE&&r!=="get"&&r!=="head"&&(w=await wiE(o,i))!==0){let C=new Request(t,{method:"POST",body:i,duplex:"half"}),R;if(ss.isFormData(i)&&(R=C.headers.get("content-type"))&&o.setContentType(R),C.body){let[G,I]=MHn(w,XOi(AHn(d)));i=Zpc(C.body,vZp,G,I)}}ss.isString(c)||(c=c?"include":"omit");let E="credentials"in Request.prototype;O=new Request(t,{...b,signal:g,method:r.toUpperCase(),headers:o.normalize().toJSON(),body:i,duplex:"half",credentials:E?c:void 0});let q=await fetch(O,b),M=kpc&&(s==="stream"||s==="response");if(kpc&&(l||M&&m)){let C={};["status","statusText","headers"].forEach(L=>{C[L]=q[L]});let R=ss.toFiniteNumber(q.headers.get("content-length")),[G,I]=l&&MHn(R,XOi(AHn(l),!0))||[];q=new Response(Zpc(q.body,vZp,G,()=>{I&&I(),m&&m()}),C)}s=s||"text";let D=await NQo[ss.findKey(NQo,s)||"text"](q,e);return!M&&m&&m(),await new Promise((C,R)=>{war(C,R,{data:D,headers:Kx.from(q.headers),status:q.status,statusText:q.statusText,config:e,request:O})})}catch(E){throw m&&m(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new Qp("Network Error",Qp.ERR_NETWORK,e,O),{cause:E.cause||E}):Qp.from(E,E&&E.code,e,O)}});var e_c={http:fZp,xhr:hZp,fetch:OZp};ss.forEach(e_c,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var mZp=e=>`- ${e}`,SiE=e=>ss.isFunction(e)||e===null||e===!1,LQo={getAdapter:e=>{e=ss.isArray(e)?e:[e];let{length:t}=e,r,i,n={};for(let a=0;a<t;a++){r=e[a];let u;if(i=r,!SiE(r)&&(i=e_c[(u=String(r)).toLowerCase()],i===void 0))throw new Qp(`Unknown adapter '${u}'`);if(i)break;n[u||"#"+a]=i}if(!i){let a=Object.entries(n).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build")),u=t?a.length>1?`since :
|
|
@@ -1953,7 +1953,7 @@ ${M}${q}${D}${tP_.default.cursorHide}`});function Jru({message:e,error:t,logger:
|
|
|
1953
1953
|
Run ${Ds.cyan("fern generator upgrade")} to upgrade your generators.`),n.length>2&&(r+=`
|
|
1954
1954
|
Run ${Ds.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),THn(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function l1c({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:i=!0}){if(!wP_(e))return;let n=t??"",a=e.filter(l=>l.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let u=a.sort((l,d)=>l.generatorName.localeCompare(d.generatorName)||l.currentVersion.localeCompare(d.currentVersion));for(let l of u)n+=`
|
|
1955
1955
|
${await yRE(l.generatorName)} (${l.apiName!=null?"API: "+l.apiName+", ":""}Group: ${l.generatorGroup}) `+Ds.dim(l.currentVersion)+Ds.reset(" \u2192 ")+Ds.green(l.latestVersion);return n+=`
|
|
1956
|
-
`,i?THn(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function yRE(e){let r=await new jP_.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new Error(`Generator ${e} not found`);return r.body.displayName}async function vRE({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let l={type:"singleApi",versions:{}};return await DP_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,o,c)=>{l.versions[s]==null&&(l.versions[s]={});let b=TIi(o.name,c),g=await Brr({generatorName:b,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:n,includeMajor:a,context:c});g!=null&&(l.versions[s][o.name]={previousVersion:o.version,latestVersion:g})},generatorFilter:r,groupFilter:i}),l}let u={type:"multiApi",versions:{}};return await DP_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(l,d,s,o)=>{if(l==null)return;u.versions[l]==null&&(u.versions[l]={}),u.versions[l][d]==null&&(u.versions[l][d]={});let c=TIi(s.name,o),b=await Brr({generatorName:c,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:o});b!=null&&(u.versions[l][d][s.name]={previousVersion:s.version,latestVersion:b})},generatorFilter:r,groupFilter:i}),u}async function DP_({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let l=await k$t({absolutePathToWorkspace:a.absoluteFilePath,context:u});if(!(l==null||l.groups==null)){for(let d of l.groups)if(!(n!=null&&d.groupName!==n))for(let s of d.generators)i!=null&&s.name!==i||await r(a.workspaceName,d.groupName,s,u)}})}))}function EP_(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[u,l]of Object.entries(a)){r.debug(`Checking if ${u} in group ${n} has an upgrade available...`);let d=sue(l.latestVersion,l.previousVersion);r.debug(`Latest version: ${l.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),i.push({generatorName:u,generatorGroup:n,apiName:t,isUpgradeAvailable:d,currentVersion:l.previousVersion,latestVersion:l.latestVersion})}return i}async function kru({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let u=[];if(e!=null){let l=await vRE({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(l.type==="multiApi")for(let[d,s]of Object.entries(l.versions))u.push(...EP_(s,d,t.logger));else u.push(...EP_(l.versions,void 0,t.logger))}return u}var M5a=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${n} ${a}`.trim(),l=u?`status code ${u}`:"an unknown error";super(`Request failed with ${l}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var UJn=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var f1c=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(r&&i)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&n.message==="unsupported BodyInit type")return!1;throw n}return e&&!t})(),MP_=typeof globalThis.AbortController=="function",AP_=typeof globalThis.ReadableStream=="function",qP_=typeof globalThis.FormData=="function",eiu=["get","post","put","patch","head","delete"],bRE=()=>{};bRE();var TP_={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},tiu=2147483647,CP_=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,riu=Symbol("stop"),BP_={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},IP_={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var gRE=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,i]of e)t+=CP_,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof i=="string"?new TextEncoder().encode(i).length:i.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},zP_=(e,t)=>{let r=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:i},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(n){let a=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function u(){let{done:l,value:d}=await a.read();if(l){n.close();return}if(t){i+=d.byteLength;let s=r===0?0:i/r;t({percent:s,transferredBytes:i,totalBytes:r},d)}n.enqueue(d),await u()}await u()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},RP_=(e,t)=>{let r=gRE(e.body),i=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(n){let a=e.body instanceof ReadableStream?e.body.getReader():new Response("").body.getReader();async function u(){let{done:l,value:d}=await a.read();if(l){t&&t({percent:1,transferredBytes:i,totalBytes:Math.max(r,i)},new Uint8Array),n.close();return}i+=d.byteLength;let s=r===0?0:i/r;(r<i||s===1)&&(s=.99),t&&t({percent:Number(s.toFixed(2)),transferredBytes:i,totalBytes:r},d),n.enqueue(d),await u()}await u()}})})};var VJn=e=>e!==null&&typeof e=="object";var A5a=(...e)=>{for(let t of e)if((!VJn(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return _1c({},...e)},d1c=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,u]of n.entries())i&&u==="undefined"||u===void 0?r.delete(a):r.set(a,u);return r};function iiu(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:_1c(e[r]??[],t[r]??[])}var p1c=(e={},t={})=>({beforeRequest:iiu(e,t,"beforeRequest"),beforeRetry:iiu(e,t,"beforeRetry"),afterResponse:iiu(e,t,"afterResponse"),beforeError:iiu(e,t,"beforeError")}),_1c=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(VJn(n)){for(let[a,u]of Object.entries(n))VJn(u)&&a in t&&(u=_1c(t[a],u)),t={...t,[a]:u};VJn(n.hooks)&&(i=p1c(i,n.hooks),t.hooks=i),VJn(n.headers)&&(r=d1c(r,n.headers),t.headers=r)}return t};var NP_=e=>eiu.includes(e)?e.toUpperCase():e,ORE=["get","put","head","delete","options","trace"],mRE=[408,413,429,500,502,503,504],PRE=[413,429,503],xP_={limit:2,methods:ORE,statusCodes:mRE,afterStatusCodes:PRE,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},FP_=(e={})=>{if(typeof e=="number")return{...xP_,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...xP_,...e}};async function h1c(e,t,r,i){return new Promise((n,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new UJn(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(u)})})}async function y1c(e,{signal:t}){return new Promise((r,i)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));function n(){clearTimeout(a),i(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}var LP_=(e,t)=>{let r={};for(let i in t)!(i in IP_)&&!(i in BP_)&&!(i in e)&&(r[i]=t[i]);return r};var q5a=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>tiu)throw new RangeError(`The \`timeout\` option cannot be greater than ${tiu}`);await Promise.resolve();let l=await i._fetch();for(let d of i._options.hooks.afterResponse){let s=await d(i.request,i._options,i._decorateResponse(l.clone()));s instanceof globalThis.Response&&(l=s)}if(i._decorateResponse(l),!l.ok&&i._options.throwHttpErrors){let d=new M5a(l,i.request,i._options);for(let s of i._options.hooks.beforeError)d=await s(d);throw d}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!AP_)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return zP_(l.clone(),i._options.onDownloadProgress)}return l},u=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n()).finally(async()=>{i.request.bodyUsed||await i.request.body?.cancel()});for(let[l,d]of Object.entries(TP_))u[l]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||d);let s=await u;if(l==="json"){if(s.status===204||(await s.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await s.text())}return s[l]()};return u}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:d1c(this._input.headers,r.headers),hooks:p1c({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:NP_(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:FP_(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(MP_){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}if(f1c&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(qP_&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!f1c)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=RP_(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof UJn)throw t;if(t instanceof M5a){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let i=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(i&&this._options.retry.afterStatusCodes.includes(t.response.status)){let n=Number(i)*1e3;Number.isNaN(n)?n=Date.parse(i)-Date.now():n>=Date.parse("2024-01-01")&&(n-=Date.now());let a=this._options.retry.maxRetryAfter??n;return n<a?n:a}if(t.response.status===413)throw t}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let i=Math.min(this._calculateRetryDelay(r),tiu);if(this._retryCount<1)throw r;await y1c(i,{signal:this._options.signal});for(let n of this._options.hooks.beforeRetry)if(await n({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===riu)return;return this._retry(t)}}async _fetch(){for(let i of this._options.hooks.beforeRequest){let n=await i(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=LP_(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):h1c(r,t,this.abortController,this._options)}};var v1c=e=>{let t=(r,i)=>q5a.create(r,A5a(e,i));for(let r of eiu)t[r]=(i,n)=>q5a.create(i,A5a(e,n,{method:r}));return t.create=r=>v1c(A5a(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),v1c(A5a(e,r))),t.stop=riu,t},jRE=v1c(),UP_=jRE;var lj_=si(cj_(),1);function P1c(e){let t=(0,lj_.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var nw_=si(iw_(),1),aw_=si(XIi(),1),z1c=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},R1c=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function x1c(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??P1c(n),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),l=(0,nw_.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,l&&(d.authorization=`${l.type} ${l.token}`);let s;try{s=await UP_(u,{headers:d,keepalive:!0}).json()}catch(c){throw c?.response?.status===404?new z1c(e):c}if(t.allVersions)return s;let o=new R1c(e,r);if(s["dist-tags"][r]){let{time:c}=s;s=s.versions[s["dist-tags"][r]],s.time=c}else if(r){let c=!!s.versions[r];if(i&&!c)for(let[g,O]of Object.entries(s.versions))O.deprecated&&delete s.versions[g];if(!c){let g=Object.keys(s.versions);if(r=aw_.default.maxSatisfying(g,r),!r)throw o}let{time:b}=s;if(s=s.versions[r],s.time=b,!s)throw o}return s}async function R5a(e,t){let{version:r}=await x1c(e.toLowerCase(),t);return r}async function INi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:R5a(e.packageName,{version:t?"prerelease":"latest"})}var ow_=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],hiu=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=pb.Info;isLocal;constructor(t,r,{isLocal:i}){this.ttyAwareLogger=new Zru(t,r),this.isLocal=i??!1;let n=this.getPackageName(),a=this.getPackageVersion(),u=this.getCliName();(n==null||a==null||u==null)&&this.exitProgram(),this.environment={packageName:n,packageVersion:a,cliName:u}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.66.26"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${Ds.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new sL}failWithoutThrowing(t,r){this.didSucceed=!1,Jru({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await PHn()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((i,n)=>setTimeout(()=>n("Request timed out"),300))]),r=await SP_({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
1956
|
+
`,i?THn(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function yRE(e){let r=await new jP_.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new Error(`Generator ${e} not found`);return r.body.displayName}async function vRE({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let l={type:"singleApi",versions:{}};return await DP_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,o,c)=>{l.versions[s]==null&&(l.versions[s]={});let b=TIi(o.name,c),g=await Brr({generatorName:b,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:n,includeMajor:a,context:c});g!=null&&(l.versions[s][o.name]={previousVersion:o.version,latestVersion:g})},generatorFilter:r,groupFilter:i}),l}let u={type:"multiApi",versions:{}};return await DP_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(l,d,s,o)=>{if(l==null)return;u.versions[l]==null&&(u.versions[l]={}),u.versions[l][d]==null&&(u.versions[l][d]={});let c=TIi(s.name,o),b=await Brr({generatorName:c,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:o});b!=null&&(u.versions[l][d][s.name]={previousVersion:s.version,latestVersion:b})},generatorFilter:r,groupFilter:i}),u}async function DP_({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let l=await k$t({absolutePathToWorkspace:a.absoluteFilePath,context:u});if(!(l==null||l.groups==null)){for(let d of l.groups)if(!(n!=null&&d.groupName!==n))for(let s of d.generators)i!=null&&s.name!==i||await r(a.workspaceName,d.groupName,s,u)}})}))}function EP_(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[u,l]of Object.entries(a)){r.debug(`Checking if ${u} in group ${n} has an upgrade available...`);let d=sue(l.latestVersion,l.previousVersion);r.debug(`Latest version: ${l.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),i.push({generatorName:u,generatorGroup:n,apiName:t,isUpgradeAvailable:d,currentVersion:l.previousVersion,latestVersion:l.latestVersion})}return i}async function kru({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let u=[];if(e!=null){let l=await vRE({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(l.type==="multiApi")for(let[d,s]of Object.entries(l.versions))u.push(...EP_(s,d,t.logger));else u.push(...EP_(l.versions,void 0,t.logger))}return u}var M5a=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${n} ${a}`.trim(),l=u?`status code ${u}`:"an unknown error";super(`Request failed with ${l}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var UJn=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var f1c=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(r&&i)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&n.message==="unsupported BodyInit type")return!1;throw n}return e&&!t})(),MP_=typeof globalThis.AbortController=="function",AP_=typeof globalThis.ReadableStream=="function",qP_=typeof globalThis.FormData=="function",eiu=["get","post","put","patch","head","delete"],bRE=()=>{};bRE();var TP_={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},tiu=2147483647,CP_=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,riu=Symbol("stop"),BP_={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},IP_={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var gRE=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,i]of e)t+=CP_,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof i=="string"?new TextEncoder().encode(i).length:i.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},zP_=(e,t)=>{let r=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:i},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(n){let a=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function u(){let{done:l,value:d}=await a.read();if(l){n.close();return}if(t){i+=d.byteLength;let s=r===0?0:i/r;t({percent:s,transferredBytes:i,totalBytes:r},d)}n.enqueue(d),await u()}await u()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},RP_=(e,t)=>{let r=gRE(e.body),i=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(n){let a=e.body instanceof ReadableStream?e.body.getReader():new Response("").body.getReader();async function u(){let{done:l,value:d}=await a.read();if(l){t&&t({percent:1,transferredBytes:i,totalBytes:Math.max(r,i)},new Uint8Array),n.close();return}i+=d.byteLength;let s=r===0?0:i/r;(r<i||s===1)&&(s=.99),t&&t({percent:Number(s.toFixed(2)),transferredBytes:i,totalBytes:r},d),n.enqueue(d),await u()}await u()}})})};var VJn=e=>e!==null&&typeof e=="object";var A5a=(...e)=>{for(let t of e)if((!VJn(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return _1c({},...e)},d1c=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,u]of n.entries())i&&u==="undefined"||u===void 0?r.delete(a):r.set(a,u);return r};function iiu(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:_1c(e[r]??[],t[r]??[])}var p1c=(e={},t={})=>({beforeRequest:iiu(e,t,"beforeRequest"),beforeRetry:iiu(e,t,"beforeRetry"),afterResponse:iiu(e,t,"afterResponse"),beforeError:iiu(e,t,"beforeError")}),_1c=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(VJn(n)){for(let[a,u]of Object.entries(n))VJn(u)&&a in t&&(u=_1c(t[a],u)),t={...t,[a]:u};VJn(n.hooks)&&(i=p1c(i,n.hooks),t.hooks=i),VJn(n.headers)&&(r=d1c(r,n.headers),t.headers=r)}return t};var NP_=e=>eiu.includes(e)?e.toUpperCase():e,ORE=["get","put","head","delete","options","trace"],mRE=[408,413,429,500,502,503,504],PRE=[413,429,503],xP_={limit:2,methods:ORE,statusCodes:mRE,afterStatusCodes:PRE,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},FP_=(e={})=>{if(typeof e=="number")return{...xP_,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...xP_,...e}};async function h1c(e,t,r,i){return new Promise((n,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new UJn(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(u)})})}async function y1c(e,{signal:t}){return new Promise((r,i)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));function n(){clearTimeout(a),i(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}var LP_=(e,t)=>{let r={};for(let i in t)!(i in IP_)&&!(i in BP_)&&!(i in e)&&(r[i]=t[i]);return r};var q5a=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>tiu)throw new RangeError(`The \`timeout\` option cannot be greater than ${tiu}`);await Promise.resolve();let l=await i._fetch();for(let d of i._options.hooks.afterResponse){let s=await d(i.request,i._options,i._decorateResponse(l.clone()));s instanceof globalThis.Response&&(l=s)}if(i._decorateResponse(l),!l.ok&&i._options.throwHttpErrors){let d=new M5a(l,i.request,i._options);for(let s of i._options.hooks.beforeError)d=await s(d);throw d}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!AP_)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return zP_(l.clone(),i._options.onDownloadProgress)}return l},u=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n()).finally(async()=>{i.request.bodyUsed||await i.request.body?.cancel()});for(let[l,d]of Object.entries(TP_))u[l]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||d);let s=await u;if(l==="json"){if(s.status===204||(await s.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await s.text())}return s[l]()};return u}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:d1c(this._input.headers,r.headers),hooks:p1c({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:NP_(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:FP_(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(MP_){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}if(f1c&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(qP_&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!f1c)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=RP_(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof UJn)throw t;if(t instanceof M5a){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let i=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(i&&this._options.retry.afterStatusCodes.includes(t.response.status)){let n=Number(i)*1e3;Number.isNaN(n)?n=Date.parse(i)-Date.now():n>=Date.parse("2024-01-01")&&(n-=Date.now());let a=this._options.retry.maxRetryAfter??n;return n<a?n:a}if(t.response.status===413)throw t}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let i=Math.min(this._calculateRetryDelay(r),tiu);if(this._retryCount<1)throw r;await y1c(i,{signal:this._options.signal});for(let n of this._options.hooks.beforeRetry)if(await n({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===riu)return;return this._retry(t)}}async _fetch(){for(let i of this._options.hooks.beforeRequest){let n=await i(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=LP_(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):h1c(r,t,this.abortController,this._options)}};var v1c=e=>{let t=(r,i)=>q5a.create(r,A5a(e,i));for(let r of eiu)t[r]=(i,n)=>q5a.create(i,A5a(e,n,{method:r}));return t.create=r=>v1c(A5a(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),v1c(A5a(e,r))),t.stop=riu,t},jRE=v1c(),UP_=jRE;var lj_=si(cj_(),1);function P1c(e){let t=(0,lj_.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var nw_=si(iw_(),1),aw_=si(XIi(),1),z1c=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},R1c=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function x1c(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??P1c(n),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),l=(0,nw_.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,l&&(d.authorization=`${l.type} ${l.token}`);let s;try{s=await UP_(u,{headers:d,keepalive:!0}).json()}catch(c){throw c?.response?.status===404?new z1c(e):c}if(t.allVersions)return s;let o=new R1c(e,r);if(s["dist-tags"][r]){let{time:c}=s;s=s.versions[s["dist-tags"][r]],s.time=c}else if(r){let c=!!s.versions[r];if(i&&!c)for(let[g,O]of Object.entries(s.versions))O.deprecated&&delete s.versions[g];if(!c){let g=Object.keys(s.versions);if(r=aw_.default.maxSatisfying(g,r),!r)throw o}let{time:b}=s;if(s=s.versions[r],s.time=b,!s)throw o}return s}async function R5a(e,t){let{version:r}=await x1c(e.toLowerCase(),t);return r}async function INi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:R5a(e.packageName,{version:t?"prerelease":"latest"})}var ow_=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],hiu=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=pb.Info;isLocal;constructor(t,r,{isLocal:i}){this.ttyAwareLogger=new Zru(t,r),this.isLocal=i??!1;let n=this.getPackageName(),a=this.getPackageVersion(),u=this.getCliName();(n==null||a==null||u==null)&&this.exitProgram(),this.environment={packageName:n,packageVersion:a,cliName:u}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.66.27"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${Ds.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new sL}failWithoutThrowing(t,r){this.didSucceed=!1,Jru({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await PHn()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((i,n)=>setTimeout(()=>n("Request timed out"),300))]),r=await SP_({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
1957
1957
|
`)||(r+=`
|
|
1958
1958
|
`),this.stderr.info(r))}catch{}}async exitIfFailed(){this.didSucceed||await this.exit()}exitProgram({code:t}={}){process.exit(t??(this.didSucceed?0:1))}longestWorkspaceName;registerWorkspaces(t){let r=QWs(t.map(i=>i.type==="docs"?"docs":i.workspaceName??"api"),i=>i.length);r!=null&&(this.longestWorkspaceName=r)}project;registerProject(t){this.project=t}runTask(t){return this.runTaskWithInit(this.constructTaskInit(),t)}addTask(){return this.addTaskWithInit(this.constructTaskInit())}async runTaskForWorkspace(t,r){await this.runTaskWithInit(this.constructTaskInitForWorkspace(t),r)}addTaskWithInit(t){let r=new m5a(t);return this.ttyAwareLogger.registerTask(r),r}USE_NODE_18_OR_ABOVE_MESSAGE="The Fern CLI requires Node 18+ or above.";async runTaskWithInit(t,r){let i=this.addTaskWithInit(t).start(),n;try{n=await r(i)}catch(a){throw a.message.includes("globalThis")?(i.logger.error(this.USE_NODE_18_OR_ABOVE_MESSAGE),i.failWithoutThrowing()):i.failWithoutThrowing(void 0,a),new sL}finally{i.finish()}return n}async instrumentPostHogEvent(t){this.isLocal||(await PHn()).sendEvent(t)}logger=Ger((t,...r)=>this.log(t,...r));stderr=Ger((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=uw_(t.type==="docs"?"docs":t.workspaceName??"api"),i=1+(this.longestWorkspaceName!=null?uw_(this.longestWorkspaceName):r).length,n=r.padEnd(i),a=ow_[this.numTasks++%ow_.length],u=Ds.hex(a)(n);return{...this.constructTaskInit(),logPrefix:u}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===hI.Failure&&(this.didSucceed=!1)},instrumentPostHogEvent:async t=>{await this.instrumentPostHogEvent(t)},shouldBufferLogs:!1}}log(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}])}logStderr(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}],{stderr:!0})}logImmediately(t,{stderr:r=!1}={}){let i=t.filter(n=>WBi.indexOf(n.level)>=WBi.indexOf(this.logLevel));this.ttyAwareLogger.log(i,{includeDebugInfo:this.logLevel===pb.Debug,stderr:r})}_suppressUpgradeMessage=!1;suppressUpgradeMessage(){this._suppressUpgradeMessage=!0}_isUpgradeAvailable;async isUpgradeAvailable({includePreReleases:t=!1}={}){if(this._isUpgradeAvailable==null){this.logger.debug(`Checking if ${this.environment.packageName} upgrade is available...`);let r=await INi({cliEnvironment:this.environment,includePreReleases:t}),i=sue(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(i?"Upgrade available.":"No upgrade available."));let n={isUpgradeAvailable:i,latestVersion:r},a=await kru({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:n,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){return await Kwc({message:t,default:r})}async getInput(t){return await Ywc({message:t.message,default:t.default})}};function uw_(e){return`[${e}]:`}var hQt=class{generatorsConfiguration;workspaceName;cliVersion;absoluteFilePath;changelog;constructor({generatorsConfiguration:t,workspaceName:r,cliVersion:i,absoluteFilePath:n,changelog:a}){this.generatorsConfiguration=t,this.workspaceName=r,this.cliVersion=i,this.absoluteFilePath=n,this.changelog=a}};var ZAe=class extends hQt{definition;sources;type="fern";constructor({definition:t,sources:r,...i}){super(i),this.definition=t,this.sources=r??[]}async getDefinition(){return this.definition}async toFernWorkspace(){return this}getSources(){return this.sources}getAbsoluteFilePaths(){return[this.absoluteFilePath]}};var Jmi={enableUniqueErrorsPerEndpoint:!1,detectGlobalHeaders:!0,objectQueryParameters:!1,respectReadonlySchemas:!1,respectNullableSchemas:!1,onlyIncludeReferencedSchemas:!1,inlinePathParameters:!1,useBytesForBinaryResponse:!1,respectForwardCompatibleEnums:!1};function x5a({options:e,overrides:t}){return{enableUniqueErrorsPerEndpoint:t?.enableUniqueErrorsPerEndpoint??e?.enableUniqueErrorsPerEndpoint??Jmi.enableUniqueErrorsPerEndpoint,detectGlobalHeaders:t?.detectGlobalHeaders??e?.detectGlobalHeaders??Jmi.detectGlobalHeaders,objectQueryParameters:t?.objectQueryParameters??e?.objectQueryParameters??Jmi.objectQueryParameters,respectReadonlySchemas:t?.respectReadonlySchemas??e?.respectReadonlySchemas??Jmi.respectReadonlySchemas,respectNullableSchemas:t?.respectNullableSchemas??e?.respectNullableSchemas??Jmi.respectNullableSchemas,onlyIncludeReferencedSchemas:t?.onlyIncludeReferencedSchemas??e?.onlyIncludeReferencedSchemas??Jmi.onlyIncludeReferencedSchemas,inlinePathParameters:t?.inlinePathParameters??e?.inlinePathParameters??Jmi.inlinePathParameters,useBytesForBinaryResponse:t?.useBytesForBinaryResponse??e?.useBytesForBinaryResponse??Jmi.useBytesForBinaryResponse,respectForwardCompatibleEnums:t?.respectForwardCompatibleEnums??e?.respectForwardCompatibleEnums??Jmi.respectForwardCompatibleEnums}}var nK={openapi:e=>({...e,type:"openapi",_visit:function(t){return nK._visit(this,t)}}),protobuf:e=>({...e,type:"protobuf",_visit:function(t){return nK._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"openapi":return t.openapi(e);case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var KJn={protobuf:e=>({...e,type:"protobuf",_visit:function(t){return KJn._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var JL={basic:e=>({...e,type:"basic",_visit:function(t){return JL._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return JL._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return JL._visit(this,t)}}),query:e=>({...e,type:"query",_visit:function(t){return JL._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return JL._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"header":return t.header(e);case"query":return t.query(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var xg={primitive:e=>({value:e,type:"primitive",_visit:function(t){return xg._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return xg._visit(this,t)}}),array:e=>({value:e,type:"array",_visit:function(t){return xg._visit(this,t)}}),map:e=>({value:e,type:"map",_visit:function(t){return xg._visit(this,t)}}),enum:e=>({value:e,type:"enum",_visit:function(t){return xg._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return xg._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return xg._visit(this,t)}}),unknown:e=>({value:e,type:"unknown",_visit:function(t){return xg._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e.value);case"object":return t.object(e);case"array":return t.array(e.value);case"map":return t.map(e.value);case"enum":return t.enum(e.value);case"literal":return t.literal(e.value);case"oneOf":return t.oneOf(e.value);case"unknown":return t.unknown(e.value);default:return t._other(e)}}};var h_={int:e=>({value:e,type:"int",_visit:function(t){return h_._visit(this,t)}}),int64:e=>({value:e,type:"int64",_visit:function(t){return h_._visit(this,t)}}),uint:e=>({value:e,type:"uint",_visit:function(t){return h_._visit(this,t)}}),uint64:e=>({value:e,type:"uint64",_visit:function(t){return h_._visit(this,t)}}),float:e=>({value:e,type:"float",_visit:function(t){return h_._visit(this,t)}}),double:e=>({value:e,type:"double",_visit:function(t){return h_._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return h_._visit(this,t)}}),datetime:e=>({value:e,type:"datetime",_visit:function(t){return h_._visit(this,t)}}),date:e=>({value:e,type:"date",_visit:function(t){return h_._visit(this,t)}}),base64:e=>({value:e,type:"base64",_visit:function(t){return h_._visit(this,t)}}),boolean:e=>({value:e,type:"boolean",_visit:function(t){return h_._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e.value);case"int64":return t.int64(e.value);case"uint":return t.uint(e.value);case"uint64":return t.uint64(e.value);case"float":return t.float(e.value);case"double":return t.double(e.value);case"string":return t.string(e.value);case"datetime":return t.datetime(e.value);case"date":return t.date(e.value);case"base64":return t.base64(e.value);case"boolean":return t.boolean(e.value);default:return t._other(e)}}};var zNi={boolean:e=>({value:e,type:"boolean",_visit:function(t){return zNi._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return zNi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"boolean":return t.boolean(e.value);case"string":return t.string(e.value);default:return t._other(e)}}};var RNi={discriminated:e=>({value:e,type:"discriminated",_visit:function(t){return RNi._visit(this,t)}}),undiscriminated:e=>({value:e,type:"undiscriminated",_visit:function(t){return RNi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e.value);case"undiscriminated":return t.undiscriminated(e.value);default:return t._other(e)}}};var $H={GenerallyAvailable:"GenerallyAvailable",Beta:"Beta",Deprecated:"Deprecated",_visit:(e,t)=>{switch(e){case $H.GenerallyAvailable:return t.generallyAvailable();case $H.Beta:return t.beta();case $H.Deprecated:return t.deprecated();default:return t._other()}}};var t7e={cursor:e=>({...e,type:"cursor",_visit:function(t){return t7e._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return t7e._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return t7e._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);case"custom":return t.custom(e);default:return t._other(e)}}};var Kmi={language:e=>({...e,type:"language",_visit:function(t){return Kmi._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return Kmi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"language":return t.language(e);case"sdk":return t.sdk(e);default:return t._other(e)}}};var GH={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java",Js:"js",Node:"node",Ts:"ts",Nodets:"nodets",Golang:"golang",Dotnet:"dotnet",Jvm:"jvm",_visit:(e,t)=>{switch(e){case GH.Curl:return t.curl();case GH.Python:return t.python();case GH.Javascript:return t.javascript();case GH.Typescript:return t.typescript();case GH.Go:return t.go();case GH.Ruby:return t.ruby();case GH.Csharp:return t.csharp();case GH.Java:return t.java();case GH.Js:return t.js();case GH.Node:return t.node();case GH.Ts:return t.ts();case GH.Nodets:return t.nodets();case GH.Golang:return t.golang();case GH.Dotnet:return t.dotnet();case GH.Jvm:return t.jvm();default:return t._other()}}};var yQt={unknown:e=>({value:e,type:"unknown",_visit:function(t){return yQt._visit(this,t)}}),full:e=>({...e,type:"full",_visit:function(t){return yQt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"unknown":return t.unknown(e.value);case"full":return t.full(e);default:return t._other(e)}}};var vQt={withStreaming:e=>({...e,type:"withStreaming",_visit:function(t){return vQt._visit(this,t)}}),withoutStreaming:e=>({value:e,type:"withoutStreaming",_visit:function(t){return vQt._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"withStreaming":return t.withStreaming(e);case"withoutStreaming":return t.withoutStreaming(e.value);default:return t._other(e)}}};var QH={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",Options:"OPTIONS",Trace:"TRACE",_visit:(e,t)=>{switch(e){case QH.Get:return t.get();case QH.Post:return t.post();case QH.Put:return t.put();case QH.Patch:return t.patch();case QH.Delete:return t.delete();case QH.Head:return t.head();case QH.Options:return t.options();case QH.Trace:return t.trace();default:return t._other()}}};var gor={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return gor._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return gor._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return gor._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return gor._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"octetStream":return t.octetStream(e);case"multipart":return t.multipart(e);case"json":return t.json(e);case"formUrlEncoded":return t.formUrlEncoded(e);default:return t._other(e)}}};var Ymi={file:e=>({...e,type:"file",_visit:function(t){return Ymi._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return Ymi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e.value);default:return t._other(e)}}};var aK={file:e=>({...e,type:"file",_visit:function(t){return aK._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return aK._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return aK._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return aK._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return aK._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return aK._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return aK._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e);case"text":return t.text(e);case"bytes":return t.bytes(e);case"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var cv={primitive:e=>({...e,type:"primitive",_visit:function(t){return cv._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return cv._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return cv._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return cv._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return cv._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return cv._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return cv._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return cv._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return cv._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return cv._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return cv._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e);case"object":return t.object(e);case"array":return t.array(e);case"map":return t.map(e);case"optional":return t.optional(e);case"enum":return t.enum(e);case"reference":return t.reference(e);case"literal":return t.literal(e);case"oneOf":return t.oneOf(e.value);case"nullable":return t.nullable(e);case"unknown":return t.unknown(e);default:return t._other(e)}}};var jw={int:e=>({...e,type:"int",_visit:function(t){return jw._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return jw._visit(this,t)}}),uint:()=>({type:"uint",_visit:function(e){return jw._visit(this,e)}}),uint64:()=>({type:"uint64",_visit:function(e){return jw._visit(this,e)}}),float:()=>({type:"float",_visit:function(e){return jw._visit(this,e)}}),double:e=>({...e,type:"double",_visit:function(t){return jw._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return jw._visit(this,t)}}),datetime:()=>({type:"datetime",_visit:function(e){return jw._visit(this,e)}}),date:()=>({type:"date",_visit:function(e){return jw._visit(this,e)}}),base64:()=>({type:"base64",_visit:function(e){return jw._visit(this,e)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return jw._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e);case"int64":return t.int64(e);case"uint":return t.uint();case"uint64":return t.uint64();case"float":return t.float();case"double":return t.double(e);case"string":return t.string(e);case"datetime":return t.datetime();case"date":return t.date();case"base64":return t.base64();case"boolean":return t.boolean(e);default:return t._other(e)}}};var Kz={boolean:e=>({value:e,type:"boolean",_visit:function(t){return Kz._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return Kz._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"boolean":return t.boolean(e.value);case"string":return t.string(e.value);default:return t._other(e)}}};var Xmi={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return Xmi._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return Xmi._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undiscriminated":return t.undiscriminated(e);default:return t._other(e)}}};var nee={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return nee._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return nee._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return nee._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return nee._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"octetStream":return t.octetStream(e);case"multipart":return t.multipart(e);case"json":return t.json(e);case"formUrlEncoded":return t.formUrlEncoded(e);default:return t._other(e)}}};var iB={file:e=>({...e,type:"file",_visit:function(t){return iB._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return iB._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return iB._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return iB._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return iB._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return iB._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return iB._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e);case"text":return t.text(e);case"bytes":return t.bytes(e);case"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var Al={primitive:e=>({...e,type:"primitive",_visit:function(t){return Al._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Al._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return Al._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Al._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return Al._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return Al._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return Al._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return Al._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return Al._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return Al._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return Al._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e);case"object":return t.object(e);case"array":return t.array(e);case"map":return t.map(e);case"optional":return t.optional(e);case"enum":return t.enum(e);case"reference":return t.reference(e);case"literal":return t.literal(e);case"oneOf":return t.oneOf(e.value);case"nullable":return t.nullable(e);case"unknown":return t.unknown(e);default:return t._other(e)}}};var aee={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return aee._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return aee._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undiscriminated":return t.undiscriminated(e);default:return t._other(e)}}};var ap={int:e=>({...e,type:"int",_visit:function(t){return ap._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return ap._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return ap._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return ap._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return ap._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return ap._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return ap._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return ap._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return ap._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return ap._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return ap._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e);case"int64":return t.int64(e);case"uint":return t.uint(e);case"uint64":return t.uint64(e);case"float":return t.float(e);case"double":return t.double(e);case"string":return t.string(e);case"datetime":return t.datetime(e);case"date":return t.date(e);case"base64":return t.base64(e);case"boolean":return t.boolean(e);default:return t._other(e)}}};var vv={};Po(vv,{AllOfPropertyConflict:()=>bKn,ArraySchema:()=>Cnu,ArraySchemaWithExample:()=>cau,Availability:()=>Siu,Base64WithExample:()=>nau,BasicSecurityScheme:()=>Miu,BearerSecurityScheme:()=>Aiu,BooleanSchema:()=>Dnu,BooleanWithExample:()=>aau,BytesResponse:()=>cKn,CasingOverrides:()=>Ciu,CommonProperty:()=>Lnu,CommonPropertyWithExample:()=>bau,CursorPagination:()=>cnu,CustomCodeSample:()=>unu,CustomCodeSampleLanguage:()=>nnu,CustomCodeSampleSdk:()=>onu,CustomPagination:()=>fnu,DateWithExample:()=>iau,DatetimeWithExample:()=>rau,DiscriminatedOneOfSchema:()=>Nnu,DiscriminatedOneOfSchemaWithExample:()=>yau,DoubleSchema:()=>wnu,DoubleWithExample:()=>eau,Encoding:()=>wiu,Endpoint:()=>dnu,EndpointExample:()=>pKn,EndpointResponseExample:()=>inu,EndpointSdkName:()=>Por,EndpointWithExample:()=>xw_,EnumSchema:()=>kJn,EnumSchemaWithExample:()=>uau,EnumValue:()=>FNi,ErrorExample:()=>Ziu,FernExample:()=>enu,FileResponse:()=>uKn,FileSchema:()=>Hiu,FloatWithExample:()=>knu,FormUrlEncodedRequest:()=>Kiu,FullEndpointExample:()=>snu,FullExample:()=>PT,FullObjectExample:()=>Fiu,FullOneOfExample:()=>Uiu,GlobalHeader:()=>Mnu,Header:()=>UNi,HeaderExample:()=>dKn,HeaderSecurityScheme:()=>qiu,HeaderWithExample:()=>HNi,HttpEndpointServer:()=>lKn,HttpError:()=>kiu,HttpErrorWithExample:()=>Jnu,HttpMethod:()=>rKn,IdempotencyHeader:()=>Anu,Int64WithExample:()=>Ynu,IntSchema:()=>Pnu,IntWithExample:()=>Knu,JsonRequest:()=>Jiu,JsonRequestWithExample:()=>Hnu,JsonResponse:()=>sKn,JsonResponseWithExample:()=>mKn,KeyValuePair:()=>Liu,LiteralExample:()=>Niu,LiteralSchema:()=>vKn,LiteralSchemaValue:()=>qnu,LongSchema:()=>jnu,MapSchema:()=>Bnu,MapSchemaWithExample:()=>lau,MultipartRequest:()=>oKn,MultipartRequestProperty:()=>Qiu,MultipartRequestPropertyEncoding:()=>Giu,MultipartSchema:()=>$iu,NamedFullExample:()=>i7e,Namespace:()=>Biu,NamespaceId:()=>xiu,NullableSchema:()=>znu,NullableSchemaWithExample:()=>dau,OauthSecurityScheme:()=>ziu,ObjectProperty:()=>xnu,ObjectPropertyConflictInfo:()=>gKn,ObjectPropertyWithExample:()=>hau,ObjectSchema:()=>Tnu,ObjectSchemaWithExample:()=>pau,OctetStreamRequest:()=>aKn,OffsetPagination:()=>lnu,OneOfSchema:()=>Rnu,OneOfSchemaWithExample:()=>_au,OpenApiIntermediateRepresentation:()=>zw_,OpenApiSource:()=>Oiu,OptionalSchema:()=>Inu,OptionalSchemaWithExample:()=>fau,Pagination:()=>_Kn,ParseFormUrlEncodedRequest:()=>$nu,ParseMultipartRequest:()=>Wnu,ParseOctetStreamRequest:()=>Vnu,PathParameter:()=>iKn,PathParameterExample:()=>tnu,PathParameterWithExample:()=>Unu,PrimitiveExample:()=>tKn,PrimitiveSchema:()=>WNi,PrimitiveSchemaValue:()=>Enu,PrimitiveSchemaValueWithExample:()=>oau,PrimitiveSchemaWithExample:()=>PKn,PropertyKey:()=>eKn,ProtobufEncoding:()=>jiu,ProtobufSource:()=>miu,QueryParameter:()=>nKn,QueryParameterExample:()=>fKn,QueryParameterWithExample:()=>OKn,QuerySecurityScheme:()=>Tiu,ReferencedSchema:()=>jor,Request:()=>Yiu,RequestWithExample:()=>Gnu,Response:()=>Xiu,ResponseWithExample:()=>Qnu,Schema:()=>VO,SchemaId:()=>oee,SchemaWithExample:()=>gM,Schemas:()=>mnu,SdkGroup:()=>Iiu,SdkGroupInfo:()=>Viu,SdkGroupName:()=>LNi,SecurityScheme:()=>Riu,SecuritySchemeId:()=>Eiu,Server:()=>U5a,Source:()=>Piu,StatusCode:()=>Oor,StreamingResponseExample:()=>rnu,StringSchema:()=>Snu,StringSchemaWithExample:()=>tau,SupportedSdkLanguage:()=>anu,Tag:()=>Diu,TagId:()=>uee,Tags:()=>Wiu,TextResponse:()=>VNi,Uint64WithExample:()=>Znu,UintWithExample:()=>Xnu,UnDiscriminatedOneOfSchema:()=>Fnu,UnDiscriminatedOneOfSchemaWithExample:()=>vau,UnknownSchemaWithExample:()=>sau,Webhook:()=>pnu,WebhookExampleCall:()=>yKn,WebhookHttpMethod:()=>hKn,WebhookWithExample:()=>Nw_,WebsocketChannel:()=>Onu,WebsocketHandshake:()=>_nu,WebsocketHandshakeWithExample:()=>Rw_,WebsocketMessageExample:()=>bnu,WebsocketMessageOrigin:()=>hnu,WebsocketMessageSchema:()=>ynu,WebsocketServer:()=>vnu,WebsocketSessionExample:()=>gnu,WithAvailability:()=>Jh,WithDescription:()=>ff,WithEncoding:()=>lue,WithInline:()=>bM,WithName:()=>k0,WithNamespace:()=>j0,WithSdkGroupName:()=>Mm,WithSdkMethodName:()=>mor,WithSource:()=>Oh,WithStatusCode:()=>r7e,WithTitle:()=>Em,commons:()=>V1c,example:()=>W1c,finalIr:()=>H1c,parseIr:()=>$1c});var V1c={};Po(V1c,{BasicSecurityScheme:()=>Miu,BearerSecurityScheme:()=>Aiu,Encoding:()=>wiu,HeaderSecurityScheme:()=>qiu,Namespace:()=>Biu,NamespaceId:()=>xiu,OauthSecurityScheme:()=>ziu,OpenApiSource:()=>Oiu,ProtobufEncoding:()=>jiu,ProtobufSource:()=>miu,QuerySecurityScheme:()=>Tiu,SchemaId:()=>oee,SdkGroup:()=>Iiu,SdkGroupName:()=>LNi,SecurityScheme:()=>Riu,SecuritySchemeId:()=>Eiu,Server:()=>U5a,Source:()=>Piu,StatusCode:()=>Oor,Tag:()=>Diu,TagId:()=>uee,WithAvailability:()=>Jh,WithDescription:()=>ff,WithEncoding:()=>lue,WithInline:()=>bM,WithName:()=>k0,WithNamespace:()=>j0,WithSdkGroupName:()=>Mm,WithSdkMethodName:()=>mor,WithSource:()=>Oh,WithStatusCode:()=>r7e,WithTitle:()=>Em});var bt={};Po(bt,{JsonError:()=>YJn,ParseError:()=>XJn,any:()=>Pw_,bigint:()=>cw_,boolean:()=>jw_,booleanLiteral:()=>mw_,date:()=>lw_,discriminant:()=>Cw_,enum_:()=>viu,getObjectLikeUtils:()=>bQt,getObjectUtils:()=>ean,getSchemaUtils:()=>mT,isProperty:()=>NNi,lazy:()=>fw_,lazyObject:()=>bw_,list:()=>giu,number:()=>ww_,object:()=>biu,objectWithoutOptionalProperties:()=>vw_,optional:()=>N1c,property:()=>pw_,record:()=>Mw_,set:()=>Aw_,string:()=>Sw_,stringLiteral:()=>Ow_,transform:()=>F1c,undiscriminatedUnion:()=>Tw_,union:()=>Iw_,unknown:()=>Dw_,withParsedProperties:()=>U1c});var Zj={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function VA(e,t){return`Expected ${t}. Received ${AxE(e)}.`}function AxE(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function KL(e){return{...e,json:sw_(e.json),parse:sw_(e.parse)}}function sw_(e){return(t,r)=>{let i=e(t,r),{skipValidation:n=!1}=r??{};return!i.ok&&n?(console.warn(["Failed to validate.",...i.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
1959
1959
|
`)),{ok:!0,value:t}):i}}function yiu(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var YJn=class e extends Error{errors;constructor(t){super(t.map(yiu).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};var XJn=class e extends Error{errors;constructor(t){super(t.map(yiu).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype)}};function mT(e){return{optional:()=>N1c(e),transform:t=>F1c(e,t),parseOrThrow:(t,r)=>{let i=e.parse(t,r);if(i.ok)return i.value;throw new XJn(i.errors)},jsonOrThrow:(t,r)=>{let i=e.json(t,r);if(i.ok)return i.value;throw new YJn(i.errors)}}}function N1c(e){let t={parse:(r,i)=>r==null?{ok:!0,value:void 0}:e.parse(r,i),json:(r,i)=>i?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,i),getType:()=>Zj.OPTIONAL};return{...t,...mT(t)}}function F1c(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);return a.ok?{ok:!0,value:t.transform(a.value)}:a},json:(i,n)=>{let a=t.untransform(i);return e.json(a,n)},getType:()=>e.getType()};return{...r,...mT(r)}}function cw_(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:VA(t,"string")}]}:{ok:!0,value:BigInt(t)},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t.toString()}:{ok:!1,errors:[{path:r,message:VA(t,"bigint")}]},getType:()=>Zj.BIGINT};return{...KL(e),...mT(e)}}var qxE=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function lw_(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:VA(t,"string")}]}:qxE.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:VA(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:VA(t,"Date object")}]},getType:()=>Zj.DATE};return{...KL(e),...mT(e)}}function oK(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...KL(r),...mT(r)}}}function viu(e){let t=new Set(e);return oK(Zj.ENUM,(i,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:a=[]}={})=>typeof i!="string"?{ok:!1,errors:[{path:a,message:VA(i,"string")}]}:!t.has(i)&&!n?{ok:!1,errors:[{path:a,message:VA(i,"enum")}]}:{ok:!0,value:i})()}function fw_(e){let t=L1c(e);return{...t,...mT(t)}}function L1c(e){return{parse:(t,r)=>ZJn(e).parse(t,r),json:(t,r)=>ZJn(e).json(t,r),getType:()=>ZJn(e).getType()}}function ZJn(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}function N5a(e){return Object.entries(e)}function F5a(e,t){let r=new Set(t);return Object.entries(e).reduce((i,[n,a])=>(r.has(n)&&(i[n]=a),i),{})}function xNi(e){if(typeof e!="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function L5a(e){return Object.keys(e)}function dw_(e,t){let r=[],i=[];for(let n of e)t(n)?r.push(n):i.push(n);return[r,i]}function bQt(e){return{withParsedProperties:t=>U1c(e,t)}}function U1c(e,t){let r={parse:(i,n)=>{let a=e.parse(i,n);if(!a.ok)return a;let u=Object.entries(t).reduce((l,[d,s])=>({...l,[d]:typeof s=="function"?s(a.value):s}),{});return{ok:!0,value:{...a.value,...u}}},json:(i,n)=>{if(!xNi(i))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:VA(i,"object")}]};let a=new Set(Object.keys(t)),u=F5a(i,Object.keys(i).filter(l=>!a.has(l)));return e.json(u,n)},getType:()=>e.getType()};return{...r,...mT(r),...bQt(r)}}function pw_(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function NNi(e){return e.isProperty}function biu(e){let t={_getRawProperties:()=>Object.entries(e).map(([r,i])=>NNi(i)?i.rawKey:r),_getParsedProperties:()=>L5a(e),parse:(r,i)=>{let n={},a=[];for(let[u,l]of N5a(e)){let d=NNi(l)?l.rawKey:u,s=NNi(l)?l.valueSchema:l,o={rawKey:d,parsedKey:u,valueSchema:s};n[d]=o,yw_(s)&&a.push(d)}return _w_({value:r,requiredKeys:a,getProperty:u=>{let l=n[u];if(l!=null)return{transformedKey:l.parsedKey,transform:d=>l.valueSchema.parse(d,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],u]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},json:(r,i)=>{let n=[];for(let[a,u]of N5a(e)){let l=NNi(u)?u.valueSchema:u;yw_(l)&&n.push(a)}return _w_({value:r,requiredKeys:n,getProperty:a=>{let u=e[a];if(u!=null)return NNi(u)?{transformedKey:u.rawKey,transform:l=>u.valueSchema.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}:{transformedKey:a,transform:l=>u.json(l,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],a]})}},unrecognizedObjectKeys:i?.unrecognizedObjectKeys,skipValidation:i?.skipValidation,breadcrumbsPrefix:i?.breadcrumbsPrefix,omitUndefined:i?.omitUndefined})},getType:()=>Zj.OBJECT};return{...KL(t),...mT(t),...bQt(t),...ean(t)}}function _w_({value:e,requiredKeys:t,getProperty:r,unrecognizedObjectKeys:i="fail",skipValidation:n=!1,breadcrumbsPrefix:a=[]}){if(!xNi(e))return{ok:!1,errors:[{path:a,message:VA(e,"object")}]};let u=new Set(t),l=[],d={};for(let[s,o]of Object.entries(e)){let c=r(s);if(c!=null){u.delete(s);let b=c.transform(o);b.ok?d[c.transformedKey]=b.value:(d[s]=o,l.push(...b.errors))}else switch(i){case"fail":l.push({path:[...a,s],message:`Unexpected key "${s}"`});break;case"strip":break;case"passthrough":d[s]=o;break}}return l.push(...t.filter(s=>u.has(s)).map(s=>({path:a,message:`Missing required key "${s}"`}))),l.length===0||n?{ok:!0,value:d}:{ok:!1,errors:l}}function ean(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(i,n)=>hw_({extensionKeys:t._getRawProperties(),value:i,transformBase:a=>e.parse(a,n),transformExtension:a=>t.parse(a,n)}),json:(i,n)=>hw_({extensionKeys:t._getParsedProperties(),value:i,transformBase:a=>e.json(a,n),transformExtension:a=>t.json(a,n)}),getType:()=>Zj.OBJECT};return{...r,...mT(r),...bQt(r),...ean(r)}},passthrough:()=>{let t={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(r,i)=>{let n=e.parse(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},json:(r,i)=>{let n=e.json(r,{...i,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...r,...n.value}}:n},getType:()=>Zj.OBJECT};return{...t,...mT(t),...bQt(t),...ean(t)}}}}function hw_({extensionKeys:e,value:t,transformBase:r,transformExtension:i}){let n=new Set(e),[a,u]=dw_(L5a(t),s=>n.has(s)),l=r(F5a(t,u)),d=i(F5a(t,a));return l.ok&&d.ok?{ok:!0,value:{...l.value,...d.value}}:{ok:!1,errors:[...l.ok?[]:l.errors,...d.ok?[]:d.errors]}}function yw_(e){return!TxE(e)}function TxE(e){switch(e.getType()){case Zj.ANY:case Zj.UNKNOWN:case Zj.OPTIONAL:return!0;default:return!1}}function vw_(e){return biu(e)}function bw_(e){let t={...L1c(e),_getRawProperties:()=>ZJn(e)._getRawProperties(),_getParsedProperties:()=>ZJn(e)._getParsedProperties()};return{...t,...mT(t),...bQt(t),...ean(t)}}function giu(e){let t={parse:(r,i)=>gw_(r,(n,a)=>e.parse(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),json:(r,i)=>gw_(r,(n,a)=>e.json(n,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`[${a}]`]})),getType:()=>Zj.LIST};return{...KL(t),...mT(t)}}function gw_(e,t){return Array.isArray(e)?e.map((i,n)=>t(i,n)).reduce((i,n)=>{if(i.ok&&n.ok)return{ok:!0,value:[...i.value,n.value]};let a=[];return i.ok||a.push(...i.errors),n.ok||a.push(...n.errors),{ok:!1,errors:a}},{ok:!0,value:[]}):{ok:!1,errors:[{message:VA(e,"list"),path:[]}]}}function Ow_(e){return oK(Zj.STRING_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:VA(r,`"${e}"`)}]})()}function mw_(e){return oK(Zj.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:i=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:i,message:VA(r,`${e.toString()}`)}]})()}var Pw_=oK(Zj.ANY,e=>({ok:!0,value:e}));var jw_=oK(Zj.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:VA(e,"boolean")}]});var ww_=oK(Zj.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:VA(e,"number")}]});var Sw_=oK(Zj.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:VA(e,"string")}]});var Dw_=oK(Zj.UNKNOWN,e=>({ok:!0,value:e}));function Mw_(e,t){let r={parse:(i,n)=>Ew_({value:i,isKeyNumeric:e.getType()===Zj.NUMBER,transformKey:a=>e.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.parse(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(i,n)=>Ew_({value:i,isKeyNumeric:e.getType()===Zj.NUMBER,transformKey:a=>e.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${a} (key)`]}),transformValue:(a,u)=>t.json(a,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${u}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>Zj.RECORD};return{...KL(r),...mT(r)}}function Ew_({value:e,isKeyNumeric:t,transformKey:r,transformValue:i,breadcrumbsPrefix:n=[]}){return xNi(e)?N5a(e).reduce((a,[u,l])=>{if(l==null)return a;let d=a,s=u;if(t){let g=u.length>0?Number(u):NaN;isNaN(g)||(s=g)}let o=r(s),c=i(l,s);if(d.ok&&o.ok&&c.ok)return{ok:!0,value:{...d.value,[o.value]:c.value}};let b=[];return d.ok||b.push(...d.errors),o.ok||b.push(...o.errors),c.ok||b.push(...c.errors),{ok:!1,errors:b}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:VA(e,"object")}]}}function Aw_(e){let t=giu(e),r={parse:(i,n)=>{let a=t.parse(i,n);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:(i,n)=>i instanceof Set?t.json([...i],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:VA(i,"Set")}]},getType:()=>Zj.SET};return{...KL(r),...mT(r)}}function Tw_(e){let t={parse:(r,i)=>qw_((n,a)=>n.parse(r,a),e,i),json:(r,i)=>qw_((n,a)=>n.json(r,a),e,i),getType:()=>Zj.UNDISCRIMINATED_UNION};return{...KL(t),...mT(t)}}function qw_(e,t,r){let i=[];for(let[n,a]of t.entries()){let u=e(a,{...r,skipValidation:!1});if(u.ok)return u;for(let l of u.errors)i.push({path:l.path,message:`[Variant ${n}] ${l.message}`})}return{ok:!1,errors:i}}function Cw_(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}function Iw_(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,i=typeof e=="string"?e:e.parsedDiscriminant,n=viu(L5a(t)),a={parse:(u,l)=>Bw_({value:u,discriminant:r,transformedDiscriminant:i,transformDiscriminantValue:d=>n.parse(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.parse(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),json:(u,l)=>Bw_({value:u,discriminant:i,transformedDiscriminant:r,transformDiscriminantValue:d=>n.json(d,{allowUnrecognizedEnumValues:l?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...l?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:d=>t[d],allowUnrecognizedUnionMembers:l?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(d,s)=>s.json(d,l),breadcrumbsPrefix:l?.breadcrumbsPrefix}),getType:()=>Zj.UNION};return{...KL(a),...mT(a),...bQt(a)}}function Bw_({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:i,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:a=!1,transformAdditionalProperties:u,breadcrumbsPrefix:l=[]}){if(!xNi(e))return{ok:!1,errors:[{path:l,message:VA(e,"object")}]};let{[t]:d,...s}=e;if(d==null)return{ok:!1,errors:[{path:l,message:`Missing discriminant ("${t}")`}]};let o=i(d);if(!o.ok)return{ok:!1,errors:o.errors};let c=n(o.value);if(c==null)return a?{ok:!0,value:{[r]:o.value,...s}}:{ok:!1,errors:[{path:[...l,t],message:"Unexpected discriminant value"}]};let b=u(s,c);return b.ok?{ok:!0,value:{[r]:d,...b.value}}:b}var Em=bt.objectWithoutOptionalProperties({title:bt.string().optional()});var Oiu=bt.objectWithoutOptionalProperties({file:bt.string()});var miu=bt.objectWithoutOptionalProperties({file:bt.string()});var Piu=bt.union("type",{openapi:Oiu,protobuf:miu}).transform({transform:e=>{switch(e.type){case"openapi":return nK.openapi(e);case"protobuf":return nK.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var Oh=bt.objectWithoutOptionalProperties({source:Piu.optional()});var jiu=bt.objectWithoutOptionalProperties({typeName:bt.string()});var wiu=bt.union("type",{protobuf:jiu}).transform({transform:e=>{switch(e.type){case"protobuf":return KJn.protobuf(e);default:return e}},untransform:({_visit:e,...t})=>t});var lue=bt.objectWithoutOptionalProperties({encoding:wiu.optional()});var ff=bt.objectWithoutOptionalProperties({description:bt.string().optional()});var Siu=bt.enum_(["GenerallyAvailable","Beta","Deprecated"]);var Jh=bt.objectWithoutOptionalProperties({availability:Siu.optional()});var Oor=bt.number();var r7e=bt.objectWithoutOptionalProperties({statusCode:Oor.optional()});var k0=bt.objectWithoutOptionalProperties({nameOverride:bt.string().optional(),generatedName:bt.string()});var bM=bt.objectWithoutOptionalProperties({inline:bt.boolean().optional()});var oee=bt.string();var uee=bt.string();var Diu=bt.objectWithoutOptionalProperties({id:uee}).extend(ff);var Eiu=bt.string();var Miu=bt.objectWithoutOptionalProperties({usernameVariableName:bt.string().optional(),usernameEnvVar:bt.string().optional(),passwordVariableName:bt.string().optional(),passwordEnvVar:bt.string().optional()});var Aiu=bt.objectWithoutOptionalProperties({tokenVariableName:bt.string().optional(),tokenEnvVar:bt.string().optional()});var qiu=bt.objectWithoutOptionalProperties({headerName:bt.string(),prefix:bt.string().optional(),headerVariableName:bt.string().optional(),headerEnvVar:bt.string().optional()});var Tiu=bt.objectWithoutOptionalProperties({queryParameterName:bt.string()});var Ciu=bt.objectWithoutOptionalProperties({snake:bt.string().optional(),camel:bt.string().optional(),screamingSnake:bt.string().optional(),pascal:bt.string().optional()});var FNi=bt.objectWithoutOptionalProperties({nameOverride:bt.string().optional(),generatedName:bt.string(),value:bt.string(),casing:Ciu.optional()}).extend(ff).extend(Jh);var Biu=bt.objectWithoutOptionalProperties({type:bt.stringLiteral("namespace"),name:bt.string()});var Iiu=bt.undiscriminatedUnion([bt.string(),Biu]);var LNi=bt.list(Iiu);var Mm=bt.objectWithoutOptionalProperties({groupName:LNi.optional()});var j0=bt.objectWithoutOptionalProperties({namespace:bt.string().optional()});var kJn=bt.objectWithoutOptionalProperties({default:FNi.optional(),values:bt.list(FNi)}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Oh).extend(Em).extend(bM);var ziu=bt.objectWithoutOptionalProperties({scopesEnum:kJn.optional()});var Riu=bt.union("type",{basic:Miu,bearer:Aiu,header:qiu,query:Tiu,oauth:ziu}).transform({transform:e=>{switch(e.type){case"basic":return JL.basic(e);case"bearer":return JL.bearer(e);case"header":return JL.header(e);case"query":return JL.query(e);case"oauth":return JL.oauth(e);default:return e}},untransform:({_visit:e,...t})=>t});var U5a=bt.objectWithoutOptionalProperties({name:bt.string().optional(),url:bt.string(),audiences:bt.list(bt.string()).optional()}).extend(ff);var xiu=bt.string();var mor=bt.objectWithoutOptionalProperties({sdkMethodName:bt.string().optional()});var W1c={};Po(W1c,{FullExample:()=>PT,FullObjectExample:()=>Fiu,FullOneOfExample:()=>Uiu,KeyValuePair:()=>Liu,LiteralExample:()=>Niu,PrimitiveExample:()=>tKn,PropertyKey:()=>eKn});var eKn=bt.string();var tKn=bt.union("type",{int:bt.object({value:bt.number()}),int64:bt.object({value:bt.number()}),uint:bt.object({value:bt.number()}),uint64:bt.object({value:bt.number()}),float:bt.object({value:bt.number()}),double:bt.object({value:bt.number()}),string:bt.object({value:bt.string()}),datetime:bt.object({value:bt.string()}),date:bt.object({value:bt.string()}),base64:bt.object({value:bt.string()}),boolean:bt.object({value:bt.boolean()})}).transform({transform:e=>{switch(e.type){case"int":return h_.int(e.value);case"int64":return h_.int64(e.value);case"uint":return h_.uint(e.value);case"uint64":return h_.uint64(e.value);case"float":return h_.float(e.value);case"double":return h_.double(e.value);case"string":return h_.string(e.value);case"datetime":return h_.datetime(e.value);case"date":return h_.date(e.value);case"base64":return h_.base64(e.value);case"boolean":return h_.boolean(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Niu=bt.union("type",{boolean:bt.object({value:bt.boolean()}),string:bt.object({value:bt.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return zNi.boolean(e.value);case"string":return zNi.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var PT=bt.union("type",{primitive:bt.object({value:tKn}),object:bt.lazyObject(()=>Fiu),array:bt.object({value:bt.list(bt.lazy(()=>PT))}),map:bt.object({value:bt.list(bt.lazyObject(()=>Liu))}),enum:bt.object({value:bt.string()}),literal:bt.object({value:Niu}),oneOf:bt.object({value:bt.lazy(()=>Uiu)}),unknown:bt.object({value:bt.lazy(()=>PT)})}).transform({transform:e=>{switch(e.type){case"primitive":return xg.primitive(e.value);case"object":return xg.object(e);case"array":return xg.array(e.value);case"map":return xg.map(e.value);case"enum":return xg.enum(e.value);case"literal":return xg.literal(e.value);case"oneOf":return xg.oneOf(e.value);case"unknown":return xg.unknown(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Fiu=bt.objectWithoutOptionalProperties({properties:bt.record(eKn,bt.lazy(()=>PT))});var Liu=bt.objectWithoutOptionalProperties({key:tKn,value:bt.lazy(()=>PT)});var Uiu=bt.union("type",{discriminated:bt.object({value:bt.record(eKn,bt.lazy(()=>PT))}),undiscriminated:bt.object({value:bt.lazy(()=>PT)})}).transform({transform:e=>{switch(e.type){case"discriminated":return RNi.discriminated(e.value);case"undiscriminated":return RNi.undiscriminated(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var H1c={};Po(H1c,{AllOfPropertyConflict:()=>bKn,ArraySchema:()=>Cnu,Availability:()=>Siu,BooleanSchema:()=>Dnu,BytesResponse:()=>cKn,CasingOverrides:()=>Ciu,CommonProperty:()=>Lnu,CursorPagination:()=>cnu,CustomCodeSample:()=>unu,CustomCodeSampleLanguage:()=>nnu,CustomCodeSampleSdk:()=>onu,CustomPagination:()=>fnu,DiscriminatedOneOfSchema:()=>Nnu,DoubleSchema:()=>wnu,Endpoint:()=>dnu,EndpointExample:()=>pKn,EndpointResponseExample:()=>inu,EndpointSdkName:()=>Por,EnumSchema:()=>kJn,EnumValue:()=>FNi,ErrorExample:()=>Ziu,FernExample:()=>enu,FileResponse:()=>uKn,FileSchema:()=>Hiu,FormUrlEncodedRequest:()=>Kiu,FullEndpointExample:()=>snu,GlobalHeader:()=>Mnu,Header:()=>UNi,HeaderExample:()=>dKn,HttpEndpointServer:()=>lKn,HttpError:()=>kiu,HttpMethod:()=>rKn,IdempotencyHeader:()=>Anu,IntSchema:()=>Pnu,JsonRequest:()=>Jiu,JsonResponse:()=>sKn,LiteralSchema:()=>vKn,LiteralSchemaValue:()=>qnu,LongSchema:()=>jnu,MapSchema:()=>Bnu,MultipartRequest:()=>oKn,MultipartRequestProperty:()=>Qiu,MultipartRequestPropertyEncoding:()=>Giu,MultipartSchema:()=>$iu,NullableSchema:()=>znu,ObjectProperty:()=>xnu,ObjectPropertyConflictInfo:()=>gKn,ObjectSchema:()=>Tnu,OctetStreamRequest:()=>aKn,OffsetPagination:()=>lnu,OneOfSchema:()=>Rnu,OpenApiIntermediateRepresentation:()=>zw_,OptionalSchema:()=>Inu,Pagination:()=>_Kn,PathParameter:()=>iKn,PathParameterExample:()=>tnu,PrimitiveSchema:()=>WNi,PrimitiveSchemaValue:()=>Enu,QueryParameter:()=>nKn,QueryParameterExample:()=>fKn,ReferencedSchema:()=>jor,Request:()=>Yiu,Response:()=>Xiu,Schema:()=>VO,Schemas:()=>mnu,SdkGroupInfo:()=>Viu,StreamingResponseExample:()=>rnu,StringSchema:()=>Snu,SupportedSdkLanguage:()=>anu,Tags:()=>Wiu,TextResponse:()=>VNi,UnDiscriminatedOneOfSchema:()=>Fnu,Webhook:()=>pnu,WebhookExampleCall:()=>yKn,WebhookHttpMethod:()=>hKn,WebsocketChannel:()=>Onu,WebsocketHandshake:()=>_nu,WebsocketMessageExample:()=>bnu,WebsocketMessageOrigin:()=>hnu,WebsocketMessageSchema:()=>ynu,WebsocketServer:()=>vnu,WebsocketSessionExample:()=>gnu});var Viu=bt.objectWithoutOptionalProperties({summary:bt.string().optional(),description:bt.string().optional()});var Wiu=bt.objectWithoutOptionalProperties({tagsById:bt.record(uee,Diu),orderedTagIds:bt.list(uee).optional()});var rKn=bt.enum_(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","TRACE"]);var iKn=bt.objectWithoutOptionalProperties({name:bt.string(),schema:bt.lazy(()=>VO),variableReference:bt.string().optional(),parameterNameOverride:bt.string().optional()}).extend(ff).extend(Jh).extend(Oh);var nKn=bt.objectWithoutOptionalProperties({name:bt.string(),schema:bt.lazy(()=>VO),parameterNameOverride:bt.string().optional()}).extend(ff).extend(Jh).extend(Oh);var UNi=bt.objectWithoutOptionalProperties({name:bt.string(),schema:bt.lazy(()=>VO),env:bt.string().optional(),parameterNameOverride:bt.string().optional()}).extend(ff).extend(Jh).extend(Oh);var Por=bt.objectWithoutOptionalProperties({groupName:LNi,methodName:bt.string()});var aKn=bt.objectWithoutOptionalProperties({contentType:bt.string().optional()}).extend(ff).extend(Oh);var Hiu=bt.objectWithoutOptionalProperties({isOptional:bt.boolean(),isArray:bt.boolean()}).extend(ff);var $iu=bt.union("type",{file:Hiu,json:bt.object({value:bt.lazy(()=>VO)})}).transform({transform:e=>{switch(e.type){case"file":return Ymi.file(e);case"json":return Ymi.json(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var Giu=bt.enum_(["json","form"]);var Qiu=bt.objectWithoutOptionalProperties({key:bt.string(),schema:$iu,contentType:bt.string().optional(),exploded:bt.boolean().optional(),encoding:Giu.optional()}).extend(ff);var oKn=bt.objectWithoutOptionalProperties({name:bt.string().optional(),properties:bt.list(Qiu)}).extend(ff).extend(Oh);var Jiu=bt.objectWithoutOptionalProperties({schema:bt.lazy(()=>VO),contentType:bt.string().optional(),additionalProperties:bt.boolean()}).extend(ff).extend(Oh);var Kiu=bt.objectWithoutOptionalProperties({schema:bt.lazy(()=>VO),contentType:bt.string().optional(),additionalProperties:bt.boolean()}).extend(ff).extend(Oh);var Yiu=bt.union("type",{octetStream:aKn,multipart:oKn,json:Jiu,formUrlEncoded:Kiu}).transform({transform:e=>{switch(e.type){case"octetStream":return gor.octetStream(e);case"multipart":return gor.multipart(e);case"json":return gor.json(e);case"formUrlEncoded":return gor.formUrlEncoded(e);default:return e}},untransform:({_visit:e,...t})=>t});var uKn=bt.objectWithoutOptionalProperties({}).extend(ff).extend(Oh).extend(r7e);var sKn=bt.objectWithoutOptionalProperties({schema:bt.lazy(()=>VO),responseProperty:bt.string().optional()}).extend(ff).extend(Oh).extend(r7e);var VNi=bt.objectWithoutOptionalProperties({}).extend(ff).extend(Oh).extend(r7e);var cKn=bt.objectWithoutOptionalProperties({}).extend(ff).extend(Oh).extend(r7e);var Xiu=bt.union("type",{file:uKn,json:sKn,text:VNi,bytes:cKn,streamingSse:sKn,streamingText:VNi,streamingJson:sKn}).transform({transform:e=>{switch(e.type){case"file":return aK.file(e);case"json":return aK.json(e);case"text":return aK.text(e);case"bytes":return aK.bytes(e);case"streamingSse":return aK.streamingSse(e);case"streamingText":return aK.streamingText(e);case"streamingJson":return aK.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var Ziu=bt.objectWithoutOptionalProperties({name:bt.string().optional(),description:bt.string().optional(),example:bt.lazy(()=>PT)});var kiu=bt.objectWithoutOptionalProperties({schema:bt.lazy(()=>VO).optional(),examples:bt.list(Ziu).optional()}).extend(ff).extend(k0).extend(Oh);var lKn=bt.objectWithoutOptionalProperties({name:bt.string().optional(),url:bt.string().optional(),audiences:bt.list(bt.string()).optional()});var enu=bt.unknown();var tnu=bt.objectWithoutOptionalProperties({name:bt.string(),parameterNameOverride:bt.string().optional(),value:bt.lazy(()=>PT)});var fKn=bt.objectWithoutOptionalProperties({name:bt.string(),value:bt.lazy(()=>PT)});var dKn=bt.objectWithoutOptionalProperties({name:bt.string(),value:bt.lazy(()=>PT)});var rnu=bt.objectWithoutOptionalProperties({sse:bt.boolean(),events:bt.list(bt.lazy(()=>PT))});var inu=bt.union("type",{withStreaming:rnu,withoutStreaming:bt.object({value:bt.lazy(()=>PT)})}).transform({transform:e=>{switch(e.type){case"withStreaming":return vQt.withStreaming(e);case"withoutStreaming":return vQt.withoutStreaming(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var nnu=bt.objectWithoutOptionalProperties({name:bt.string().optional(),language:bt.string(),code:bt.string(),install:bt.string().optional()}).extend(ff);var anu=bt.enum_(["curl","python","javascript","typescript","go","ruby","csharp","java","js","node","ts","nodets","golang","dotnet","jvm"]);var onu=bt.objectWithoutOptionalProperties({name:bt.string().optional(),sdk:anu,code:bt.string()}).extend(ff);var unu=bt.union("type",{language:nnu,sdk:onu}).transform({transform:e=>{switch(e.type){case"language":return Kmi.language(e);case"sdk":return Kmi.sdk(e);default:return e}},untransform:({_visit:e,...t})=>t});var snu=bt.objectWithoutOptionalProperties({name:bt.string().optional(),pathParameters:bt.list(tnu).optional(),queryParameters:bt.list(fKn).optional(),headers:bt.list(dKn).optional(),request:bt.lazy(()=>PT).optional(),response:inu.optional(),codeSamples:bt.list(unu)}).extend(ff);var pKn=bt.union("type",{unknown:bt.object({value:enu}),full:snu}).transform({transform:e=>{switch(e.type){case"unknown":return yQt.unknown(e.value);case"full":return yQt.full(e);default:return e}},untransform:({_visit:e,...t})=>t});var cnu=bt.objectWithoutOptionalProperties({cursor:bt.string(),nextCursor:bt.property("next_cursor",bt.string()),results:bt.string()});var lnu=bt.objectWithoutOptionalProperties({offset:bt.string(),results:bt.string(),step:bt.string().optional(),hasNextPage:bt.string().optional()});var fnu=bt.objectWithoutOptionalProperties({results:bt.string()});var _Kn=bt.union("type",{cursor:cnu,offset:lnu,custom:fnu}).transform({transform:e=>{switch(e.type){case"cursor":return t7e.cursor(e);case"offset":return t7e.offset(e);case"custom":return t7e.custom(e);default:return e}},untransform:({_visit:e,...t})=>t});var dnu=bt.objectWithoutOptionalProperties({authed:bt.boolean(),internal:bt.boolean().optional(),idempotent:bt.boolean().optional(),method:rKn,audiences:bt.list(bt.string()),path:bt.string(),summary:bt.string().optional(),operationId:bt.string().optional(),tags:bt.list(uee),pathParameters:bt.list(iKn),queryParameters:bt.list(nKn),headers:bt.list(UNi),sdkName:Por.optional(),generatedRequestName:bt.string(),requestNameOverride:bt.string().optional(),request:Yiu.optional(),response:Xiu.optional(),errors:bt.record(Oor,kiu),servers:bt.list(lKn),examples:bt.list(pKn),pagination:_Kn.optional()}).extend(ff).extend(Jh).extend(Oh).extend(j0);var hKn=bt.enum_(["GET","POST"]);var yKn=bt.objectWithoutOptionalProperties({name:bt.string().optional(),payload:bt.lazy(()=>PT)}).extend(ff);var pnu=bt.objectWithoutOptionalProperties({audiences:bt.list(bt.string()),sdkName:Por.optional(),method:hKn,summary:bt.string().optional(),operationId:bt.string(),tags:bt.list(uee),headers:bt.list(UNi),generatedPayloadName:bt.string(),payload:bt.lazy(()=>VO),examples:bt.list(yKn)}).extend(ff).extend(Oh).extend(j0);var _nu=bt.objectWithoutOptionalProperties({queryParameters:bt.list(nKn),headers:bt.list(UNi),pathParameters:bt.list(iKn)});var hnu=bt.enum_(["client","server"]);var ynu=bt.objectWithoutOptionalProperties({name:bt.string(),origin:hnu,body:bt.lazy(()=>VO)});var vnu=bt.objectWithoutOptionalProperties({name:bt.string(),url:bt.string()});var bnu=bt.objectWithoutOptionalProperties({messageType:bt.string(),payload:bt.lazy(()=>PT)}).extend(ff);var gnu=bt.objectWithoutOptionalProperties({name:bt.string().optional(),queryParameters:bt.list(fKn).optional(),headers:bt.list(dKn).optional(),messages:bt.list(bnu)}).extend(ff);var Onu=bt.objectWithoutOptionalProperties({audiences:bt.list(bt.string()),path:bt.string(),groupName:LNi,summary:bt.string().optional(),handshake:_nu,messages:bt.list(ynu),servers:bt.list(vnu),examples:bt.list(gnu)}).extend(ff).extend(Oh);var mnu=bt.objectWithoutOptionalProperties({rootSchemas:bt.record(oee,bt.lazy(()=>VO)),namespacedSchemas:bt.record(xiu,bt.record(oee,bt.lazy(()=>VO)))});var Pnu=bt.objectWithoutOptionalProperties({default:bt.number().optional(),minimum:bt.number().optional(),maximum:bt.number().optional(),exclusiveMinimum:bt.boolean().optional(),exclusiveMaximum:bt.boolean().optional(),multipleOf:bt.number().optional()});var jnu=bt.objectWithoutOptionalProperties({default:bt.number().optional()});var wnu=bt.objectWithoutOptionalProperties({default:bt.number().optional(),minimum:bt.number().optional(),maximum:bt.number().optional(),exclusiveMinimum:bt.boolean().optional(),exclusiveMaximum:bt.boolean().optional(),multipleOf:bt.number().optional()});var Snu=bt.objectWithoutOptionalProperties({default:bt.string().optional(),pattern:bt.string().optional(),format:bt.string().optional(),minLength:bt.number().optional(),maxLength:bt.number().optional()});var Dnu=bt.objectWithoutOptionalProperties({default:bt.boolean().optional()});var Enu=bt.union("type",{int:Pnu,int64:jnu,uint:bt.object({}),uint64:bt.object({}),float:bt.object({}),double:wnu,string:Snu,datetime:bt.object({}),date:bt.object({}),base64:bt.object({}),boolean:Dnu}).transform({transform:e=>{switch(e.type){case"int":return jw.int(e);case"int64":return jw.int64(e);case"uint":return jw.uint();case"uint64":return jw.uint64();case"float":return jw.float();case"double":return jw.double(e);case"string":return jw.string(e);case"datetime":return jw.datetime();case"date":return jw.date();case"base64":return jw.base64();case"boolean":return jw.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var WNi=bt.objectWithoutOptionalProperties({schema:Enu}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em);var Mnu=bt.objectWithoutOptionalProperties({header:bt.string(),name:bt.string().optional(),optional:bt.boolean().optional(),env:bt.string().optional(),schema:bt.lazy(()=>VO).optional()});var Anu=bt.objectWithoutOptionalProperties({header:bt.string(),name:bt.string().optional(),env:bt.string().optional(),schema:bt.lazy(()=>VO).optional()});var zw_=bt.objectWithoutOptionalProperties({apiVersion:bt.unknown().optional(),title:bt.string().optional(),description:bt.string().optional(),basePath:bt.string().optional(),servers:bt.list(U5a),websocketServers:bt.list(U5a),groups:bt.record(bt.string(),Viu),tags:Wiu,hasEndpointsMarkedInternal:bt.boolean(),endpoints:bt.list(dnu),webhooks:bt.list(pnu),channels:bt.record(bt.string(),Onu),groupedSchemas:mnu,variables:bt.record(bt.string(),WNi),nonRequestReferencedSchemas:bt.set(oee),securitySchemes:bt.record(Eiu,Riu),globalHeaders:bt.list(Mnu).optional(),idempotencyHeaders:bt.list(Anu).optional()});var jor=bt.objectWithoutOptionalProperties({schema:oee}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Oh).extend(Em);var qnu=bt.union("type",{boolean:bt.object({value:bt.boolean()}),string:bt.object({value:bt.string()})}).transform({transform:e=>{switch(e.type){case"boolean":return Kz.boolean(e.value);case"string":return Kz.string(e.value);default:return e}},untransform:({_visit:e,...t})=>t});var vKn=bt.objectWithoutOptionalProperties({value:qnu}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em);var VO=bt.union("type",{primitive:WNi,object:bt.lazyObject(()=>Tnu),array:bt.lazyObject(()=>Cnu),map:bt.lazyObject(()=>Bnu),optional:bt.lazyObject(()=>Inu),enum:kJn,reference:jor,literal:vKn,oneOf:bt.object({value:bt.lazy(()=>Rnu)}),nullable:bt.lazyObject(()=>znu),unknown:k0}).transform({transform:e=>{switch(e.type){case"primitive":return cv.primitive(e);case"object":return cv.object(e);case"array":return cv.array(e);case"map":return cv.map(e);case"optional":return cv.optional(e);case"enum":return cv.enum(e);case"reference":return cv.reference(e);case"literal":return cv.literal(e);case"oneOf":return cv.oneOf(e.value);case"nullable":return cv.nullable(e);case"unknown":return cv.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var bKn=bt.objectWithoutOptionalProperties({propertyKey:bt.string(),allOfSchemaIds:bt.list(oee),conflictingTypeSignatures:bt.boolean()});var Tnu=bt.objectWithoutOptionalProperties({allOf:bt.list(jor),properties:bt.list(bt.lazyObject(()=>xnu)),allOfPropertyConflicts:bt.list(bKn),additionalProperties:bt.boolean()}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Oh).extend(Em).extend(bM);var gKn=bt.objectWithoutOptionalProperties({differentSchema:bt.boolean()});var xnu=bt.objectWithoutOptionalProperties({key:bt.string(),schema:bt.lazy(()=>VO),readonly:bt.boolean().optional(),writeonly:bt.boolean().optional(),conflict:bt.record(oee,gKn),generatedName:bt.string(),nameOverride:bt.string().optional(),audiences:bt.list(bt.string())}).extend(Jh);var Cnu=bt.objectWithoutOptionalProperties({value:bt.lazy(()=>VO)}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em).extend(bM);var Bnu=bt.objectWithoutOptionalProperties({key:WNi,value:bt.lazy(()=>VO)}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(lue).extend(Em).extend(bM);var Inu=bt.objectWithoutOptionalProperties({value:bt.lazy(()=>VO)}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em).extend(bM);var znu=bt.objectWithoutOptionalProperties({value:bt.lazy(()=>VO)}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em).extend(bM);var Rnu=bt.union("type",{discriminated:bt.lazyObject(()=>Nnu),undiscriminated:bt.lazyObject(()=>Fnu)}).transform({transform:e=>{switch(e.type){case"discriminated":return Xmi.discriminated(e);case"undiscriminated":return Xmi.undiscriminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var Nnu=bt.objectWithoutOptionalProperties({discriminantProperty:bt.string(),commonProperties:bt.list(bt.lazyObject(()=>Lnu)),schemas:bt.record(bt.string(),bt.lazy(()=>VO))}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(lue).extend(Oh).extend(Em).extend(bM);var Lnu=bt.objectWithoutOptionalProperties({key:bt.string(),schema:bt.lazy(()=>VO)});var Fnu=bt.objectWithoutOptionalProperties({schemas:bt.list(bt.lazy(()=>VO))}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(lue).extend(Oh).extend(Em).extend(bM);var $1c={};Po($1c,{ArraySchemaWithExample:()=>cau,Base64WithExample:()=>nau,BooleanWithExample:()=>aau,CommonPropertyWithExample:()=>bau,DateWithExample:()=>iau,DatetimeWithExample:()=>rau,DiscriminatedOneOfSchemaWithExample:()=>yau,DoubleWithExample:()=>eau,EndpointWithExample:()=>xw_,EnumSchemaWithExample:()=>uau,FloatWithExample:()=>knu,HeaderWithExample:()=>HNi,HttpErrorWithExample:()=>Jnu,Int64WithExample:()=>Ynu,IntWithExample:()=>Knu,JsonRequestWithExample:()=>Hnu,JsonResponseWithExample:()=>mKn,MapSchemaWithExample:()=>lau,NamedFullExample:()=>i7e,NullableSchemaWithExample:()=>dau,ObjectPropertyWithExample:()=>hau,ObjectSchemaWithExample:()=>pau,OneOfSchemaWithExample:()=>_au,OptionalSchemaWithExample:()=>fau,ParseFormUrlEncodedRequest:()=>$nu,ParseMultipartRequest:()=>Wnu,ParseOctetStreamRequest:()=>Vnu,PathParameterWithExample:()=>Unu,PrimitiveSchemaValueWithExample:()=>oau,PrimitiveSchemaWithExample:()=>PKn,QueryParameterWithExample:()=>OKn,RequestWithExample:()=>Gnu,ResponseWithExample:()=>Qnu,SchemaWithExample:()=>gM,StringSchemaWithExample:()=>tau,Uint64WithExample:()=>Znu,UintWithExample:()=>Xnu,UnDiscriminatedOneOfSchemaWithExample:()=>vau,UnknownSchemaWithExample:()=>sau,WebhookWithExample:()=>Nw_,WebsocketHandshakeWithExample:()=>Rw_});var i7e=bt.objectWithoutOptionalProperties({name:bt.string().optional(),value:bt.unknown()}).extend(ff);var OKn=bt.objectWithoutOptionalProperties({name:bt.string(),schema:bt.lazy(()=>gM),parameterNameOverride:bt.string().optional()}).extend(ff).extend(Jh).extend(Oh);var HNi=bt.objectWithoutOptionalProperties({name:bt.string(),schema:bt.lazy(()=>gM),env:bt.string().optional(),parameterNameOverride:bt.string().optional()}).extend(ff).extend(Jh).extend(Oh);var Rw_=bt.objectWithoutOptionalProperties({queryParameters:bt.list(OKn),headers:bt.list(HNi)});var Unu=bt.objectWithoutOptionalProperties({name:bt.string(),schema:bt.lazy(()=>gM),variableReference:bt.string().optional(),parameterNameOverride:bt.string().optional()}).extend(ff).extend(Jh).extend(Oh);var Vnu=bt.objectWithoutOptionalProperties({}).extend(aKn).extend(mor);var Wnu=bt.objectWithoutOptionalProperties({}).extend(oKn).extend(mor);var Hnu=bt.objectWithoutOptionalProperties({schema:bt.lazy(()=>gM),contentType:bt.string().optional(),fullExamples:bt.list(i7e).optional(),additionalProperties:bt.boolean()}).extend(ff).extend(Oh).extend(mor);var $nu=bt.objectWithoutOptionalProperties({schema:bt.lazy(()=>gM),contentType:bt.string().optional(),fullExamples:bt.list(i7e).optional(),additionalProperties:bt.boolean()}).extend(ff).extend(Oh).extend(mor);var Gnu=bt.union("type",{octetStream:Vnu,multipart:Wnu,json:Hnu,formUrlEncoded:$nu}).transform({transform:e=>{switch(e.type){case"octetStream":return nee.octetStream(e);case"multipart":return nee.multipart(e);case"json":return nee.json(e);case"formUrlEncoded":return nee.formUrlEncoded(e);default:return e}},untransform:({_visit:e,...t})=>t});var mKn=bt.objectWithoutOptionalProperties({schema:bt.lazy(()=>gM),responseProperty:bt.string().optional(),fullExamples:bt.list(i7e).optional()}).extend(ff).extend(Oh).extend(r7e);var Qnu=bt.union("type",{file:uKn,json:mKn,text:VNi,bytes:cKn,streamingSse:mKn,streamingText:VNi,streamingJson:mKn}).transform({transform:e=>{switch(e.type){case"file":return iB.file(e);case"json":return iB.json(e);case"text":return iB.text(e);case"bytes":return iB.bytes(e);case"streamingSse":return iB.streamingSse(e);case"streamingText":return iB.streamingText(e);case"streamingJson":return iB.streamingJson(e);default:return e}},untransform:({_visit:e,...t})=>t});var Jnu=bt.objectWithoutOptionalProperties({statusCode:Oor,schema:bt.lazy(()=>gM),fullExamples:bt.list(i7e).optional()}).extend(ff).extend(k0).extend(Oh);var xw_=bt.objectWithoutOptionalProperties({authed:bt.boolean(),internal:bt.boolean().optional(),idempotent:bt.boolean().optional(),method:rKn,audiences:bt.list(bt.string()),path:bt.string(),summary:bt.string().optional(),operationId:bt.string().optional(),tags:bt.list(uee),pathParameters:bt.list(Unu),queryParameters:bt.list(OKn),headers:bt.list(HNi),sdkName:Por.optional(),generatedRequestName:bt.string(),requestNameOverride:bt.string().optional(),request:Gnu.optional(),response:Qnu.optional(),errors:bt.record(Oor,Jnu),servers:bt.list(lKn),examples:bt.list(pKn),pagination:_Kn.optional()}).extend(ff).extend(Jh).extend(Oh).extend(j0);var Nw_=bt.objectWithoutOptionalProperties({audiences:bt.list(bt.string()),sdkName:Por.optional(),method:hKn,summary:bt.string().optional(),operationId:bt.string(),tags:bt.list(uee),headers:bt.list(HNi),generatedPayloadName:bt.string(),payload:bt.lazy(()=>gM),examples:bt.list(yKn)}).extend(ff).extend(Oh).extend(j0);var Knu=bt.objectWithoutOptionalProperties({default:bt.number().optional(),minimum:bt.number().optional(),maximum:bt.number().optional(),exclusiveMinimum:bt.boolean().optional(),exclusiveMaximum:bt.boolean().optional(),multipleOf:bt.number().optional(),example:bt.number().optional()});var Ynu=bt.objectWithoutOptionalProperties({default:bt.number().optional(),example:bt.number().optional()});var Xnu=bt.objectWithoutOptionalProperties({default:bt.number().optional(),example:bt.number().optional()});var Znu=bt.objectWithoutOptionalProperties({default:bt.number().optional(),example:bt.number().optional()});var knu=bt.objectWithoutOptionalProperties({example:bt.number().optional()});var eau=bt.objectWithoutOptionalProperties({default:bt.number().optional(),minimum:bt.number().optional(),maximum:bt.number().optional(),exclusiveMinimum:bt.boolean().optional(),exclusiveMaximum:bt.boolean().optional(),multipleOf:bt.number().optional(),example:bt.number().optional()});var tau=bt.objectWithoutOptionalProperties({default:bt.string().optional(),pattern:bt.string().optional(),format:bt.string().optional(),minLength:bt.number().optional(),maxLength:bt.number().optional(),example:bt.string().optional()});var rau=bt.objectWithoutOptionalProperties({example:bt.string().optional()});var iau=bt.objectWithoutOptionalProperties({example:bt.string().optional()});var nau=bt.objectWithoutOptionalProperties({example:bt.string().optional()});var aau=bt.objectWithoutOptionalProperties({default:bt.boolean().optional(),example:bt.boolean().optional()});var oau=bt.union("type",{int:Knu,int64:Ynu,uint:Xnu,uint64:Znu,float:knu,double:eau,string:tau,datetime:rau,date:iau,base64:nau,boolean:aau}).transform({transform:e=>{switch(e.type){case"int":return ap.int(e);case"int64":return ap.int64(e);case"uint":return ap.uint(e);case"uint64":return ap.uint64(e);case"float":return ap.float(e);case"double":return ap.double(e);case"string":return ap.string(e);case"datetime":return ap.datetime(e);case"date":return ap.date(e);case"base64":return ap.base64(e);case"boolean":return ap.boolean(e);default:return e}},untransform:({_visit:e,...t})=>t});var PKn=bt.objectWithoutOptionalProperties({schema:oau}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em);var uau=bt.objectWithoutOptionalProperties({default:FNi.optional(),values:bt.list(FNi),example:bt.string().optional()}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Oh).extend(Em).extend(bM);var sau=bt.objectWithoutOptionalProperties({example:bt.unknown()}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em);var gM=bt.union("type",{primitive:PKn,object:bt.lazyObject(()=>pau),array:bt.lazyObject(()=>cau),map:bt.lazyObject(()=>lau),optional:bt.lazyObject(()=>fau),enum:uau,reference:jor,literal:vKn,oneOf:bt.object({value:bt.lazy(()=>_au)}),nullable:bt.lazyObject(()=>dau),unknown:sau}).transform({transform:e=>{switch(e.type){case"primitive":return Al.primitive(e);case"object":return Al.object(e);case"array":return Al.array(e);case"map":return Al.map(e);case"optional":return Al.optional(e);case"enum":return Al.enum(e);case"reference":return Al.reference(e);case"literal":return Al.literal(e);case"oneOf":return Al.oneOf(e.value);case"nullable":return Al.nullable(e);case"unknown":return Al.unknown(e);default:return e}},untransform:({_visit:e,...t})=>t});var cau=bt.objectWithoutOptionalProperties({value:bt.lazy(()=>gM),example:bt.list(bt.unknown()).optional()}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em).extend(bM);var lau=bt.objectWithoutOptionalProperties({key:PKn,value:bt.lazy(()=>gM),example:bt.unknown().optional()}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(lue).extend(Em).extend(bM);var fau=bt.objectWithoutOptionalProperties({value:bt.lazy(()=>gM)}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em).extend(bM);var dau=bt.objectWithoutOptionalProperties({value:bt.lazy(()=>gM)}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Em).extend(bM);var pau=bt.objectWithoutOptionalProperties({allOf:bt.list(jor),properties:bt.list(bt.lazyObject(()=>hau)),allOfPropertyConflicts:bt.list(bKn),fullExamples:bt.list(i7e).optional(),additionalProperties:bt.boolean()}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(Oh).extend(Em).extend(bM);var hau=bt.objectWithoutOptionalProperties({key:bt.string(),schema:bt.lazy(()=>gM),readonly:bt.boolean().optional(),writeonly:bt.boolean().optional(),audiences:bt.list(bt.string()),conflict:bt.record(oee,gKn),nameOverride:bt.string().optional(),generatedName:bt.string()}).extend(Jh);var _au=bt.union("type",{discriminated:bt.lazyObject(()=>yau),undiscriminated:bt.lazyObject(()=>vau)}).transform({transform:e=>{switch(e.type){case"discriminated":return aee.discriminated(e);case"undiscriminated":return aee.undiscriminated(e);default:return e}},untransform:({_visit:e,...t})=>t});var yau=bt.objectWithoutOptionalProperties({discriminantProperty:bt.string(),commonProperties:bt.list(bt.lazyObject(()=>bau)),schemas:bt.record(bt.string(),bt.lazy(()=>gM))}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(lue).extend(Oh).extend(Em).extend(bM);var bau=bt.objectWithoutOptionalProperties({key:bt.string(),schema:bt.lazy(()=>gM)});var vau=bt.objectWithoutOptionalProperties({schemas:bt.list(bt.lazy(()=>gM))}).extend(Mm).extend(j0).extend(k0).extend(ff).extend(Jh).extend(lue).extend(Oh).extend(Em).extend(bM);var Fw_=/^(\d+)/,jKn=/^[a-zA-Z][a-zA-Z0-9_]*$/,Lw_={"<":"LESS_THAN",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL_TO","<=":"LESS_THAN_OR_EQUAL_TO","!=":"NOT_EQUALS","=":"EQUAL_TO","==":"EQUAL_TO","*":"ALL","":"EMPTY",'""':"EMPTY_STRING","-":"HYPHEN","|":"PIPE",".":"DOT","/":"SLASH"};function $Ni(e){let t=["zero","one","two","three","four","five","six","seven","eight","nine"],r=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],i=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];if(e<0||e>9999)return;if(e<10)return t[e];if(e<20)return r[e-10];if(e<100){let u=Math.floor(e/10),l=e%10;return l===0?i[u]:`${i[u]}_${t[l]}`}if(e<1e3){let u=Math.floor(e/100),l=e%100;return l===0?`${t[u]}_hundred`:`${t[u]}_hundred_${$Ni(l)}`}let n=Math.floor(e/1e3),a=e%1e3;return a===0?`${t[n]}_thousand`:`${t[n]}_thousand_${$Ni(a)}`}function V5a(e){let t=e.match(Fw_);if(t&&t[0]!=null){let r=t[0],i=e.substring(r.length),n=parseFloat(r);if(!isNaN(n)&&isFinite(n)){let a=$Ni(n);return i.length>0?`${a}_${i}`:a}}}function wKn(e){let t=V5a(e),r=Lw_[e];return t!=null?qB(S_(t)):r??(e.toLowerCase()==="n/a"?"NOT_APPLICABLE":qB(S_(e)))}function fue(e,t){return e.type==="primitive"&&t.type==="primitive"?Uw_(e.schema,t.schema):e.type==="enum"&&t.type==="enum"?CxE(e.values,t.values):e.type==="array"&&t.type==="array"?fue(e.value,t.value):e.type==="unknown"&&t.type==="unknown"?!0:e.type==="reference"&&t.type==="reference"?e.schema===t.schema:e.type==="optional"&&t.type==="optional"?fue(e.value,t.value):e.type==="oneOf"&&t.type==="oneOf"?BxE(e.value,t.value):e.type==="object"&&t.type==="object"?IxE(e,t):e.type==="map"&&t.type==="map"?Uw_(e.key.schema,t.key.schema)&&fue(e.value,t.value):e.type==="literal"&&t.type==="literal"?e.value===t.value:!1}function Uw_(e,t){return e.type===t.type}function CxE(e,t){let r=new Set(...e.map(n=>n.value)),i=new Set(...t.map(n=>n.value));return g8(r,i)}function BxE(e,t){return e.type==="discriminated"&&t.type==="discriminated"?e.discriminantProperty===t.discriminantProperty&&Object.keys(e.schemas).length===Object.keys(t.schemas).length&&Object.entries(e.schemas).every(([r,i])=>{let n=t.schemas[r];return n==null?!1:fue(i,n)}):e.type==="undiscriminated"&&t.type==="undiscriminated"?e.schemas.length===t.schemas.length&&e.schemas.every((r,i)=>{let n=t.schemas[i];return n==null?!1:fue(r,n)}):!1}function IxE(e,t){if(Object.keys(e.properties).length!==Object.keys(t.properties).length)return!1;let r=Object.fromEntries(e.properties.map(i=>[i.key,i.schema]));return Object.entries(t.properties).every(([i,n])=>{let a=r[i];return a==null?!1:fue(a,n.schema)})}function rx(e){switch(e){case $H.Deprecated:return"deprecated";case $H.Beta:return"pre-release";case $H.GenerallyAvailable:return"generally-available";default:return}}function zxE(e){let t=e.find(i=>typeof i=="object"&&i.type==="namespace"),r=e.filter(i=>typeof i=="string"||i.type!=="namespace");return t?[t,...r]:r}function Vw_(e){let t=e?zxE(e):void 0;if(t==null||t.length===0)return WZi;let r=[];for(let[i,n]of t.entries())if(typeof n=="string")r.push(S_(n));else if(typeof n=="object")switch(n.type){case"namespace":{i<t.length-1?r.push(S_(n.name)):r.push(n.name,WZi);break}default:So(n.type)}else So(n);return r.join("/")}function GNi(e){return fy.of(`${Vw_(e)}.yml`)}function G1c({sdkName:e,namespaceOverride:t}){let r;return e==null||e.groupName.length===0&&t==null?WZi:(t!=null?r=[{type:"namespace",name:t},...e.groupName.filter(i=>typeof i=="string"||i.type!=="namespace")]:r=e.groupName,Vw_(r))}function Ww_({sdkName:e,namespaceOverride:t}){return fy.of(`${G1c({sdkName:e,namespaceOverride:t})}.yml`)}function Hw_({location:e,namespaceOverride:t}){return t!=null?PF(fy.of(t),e):e}function gau(e){switch(e.type){case"protobuf":return{proto:{type:e.typeName}};default:So(e.type)}}function SKn(e){switch(e.type){case"object":case"enum":case"array":case"map":case"reference":case"literal":case"optional":case"nullable":case"primitive":return e.groupName??void 0;case"oneOf":return e.value.groupName??void 0;case"unknown":return;default:So(e)}}function WA(e){return typeof e=="string"?e:e.type}function DKn(e){if(typeof e!="string")return e.docs}function W5a(e){if(typeof e!="string")return e.default}function Q1c(e){if(typeof e!="string")return e.validation}var RxE=-2147483648,xxE=2147483647,NxE=-17976931348623157e292,FxE=17976931348623157e292;function Ng({schema:e,fileContainingReference:t,declarationFile:r=t,context:i,namespace:n,declarationDepth:a}){switch(i.shouldMarkSchemaAsReferenced()&&i.markSchemaAsReferenced(e,n),e.type){case"primitive":return Oau(e);case"array":return Y1c({schema:e,fileContainingReference:t,context:i,declarationFile:r,namespace:n,declarationDepth:a});case"map":return X1c({schema:e,fileContainingReference:t,context:i,declarationFile:r,namespace:n,declarationDepth:a});case"reference":return K1c({schema:e,fileContainingReference:t,context:i,namespace:n});case"unknown":return k1c();case"optional":return mau({schema:e,fileContainingReference:t,context:i,declarationFile:r,namespace:n,declarationDepth:a});case"nullable":return Z1c({schema:e,fileContainingReference:t,context:i,declarationFile:r,namespace:n,declarationDepth:a});case"enum":return JxE({schema:e,fileContainingReference:t,context:i,declarationFile:r,declarationDepth:a});case"literal":return e.value,eSc(e);case"object":return KxE({schema:e,fileContainingReference:t,context:i,declarationFile:r,namespace:n,declarationDepth:a});case"oneOf":return YxE({schema:e.value,fileContainingReference:t,context:i,declarationFile:r,namespace:n,declarationDepth:a});default:So(e)}}function Oau(e){switch(e.schema.type){case"string":return VxE({description:e.description,schema:e.schema});case"int":return WxE({description:e.description,schema:e.schema});case"float":return HxE({description:e.description,schema:e.schema});case"double":return $xE({description:e.description,schema:e.schema});case"boolean":return LxE({description:e.description,schema:e.schema});case"int64":return UxE({description:e.description,schema:e.schema})}let t=e.schema._visit({int:()=>"integer",int64:()=>"long",uint:()=>"uint",uint64:()=>"uint64",float:()=>"double",double:()=>"double",string:()=>"string",datetime:()=>"datetime",date:()=>"date",base64:()=>"base64",boolean:()=>"boolean",_other:()=>"unknown"});return e.description==null&&e.title==null?t:{type:t,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:rx(e.availability)}:{}}}function LxE({description:e,schema:t}){let r="boolean";if(e==null&&t.default==null)return r;let i={type:r};return e!=null&&(i.docs=e),t.default!=null&&(i.default=t.default),i}function UxE({description:e,schema:t}){let r="long";if(e==null&&t.default==null)return r;let i={type:r};return e!=null&&(i.docs=e),t.default!=null&&(i.default=t.default),i}function VxE({description:e,schema:t}){let r="string",i=GxE(t);if(e==null&&t.default==null&&i==null)return r;let n={type:r};return e!=null&&(n.docs=e),t.default!=null&&(n.default=t.default),i!=null&&(n.validation=i),n}function WxE({description:e,schema:t}){let r="integer",i=Gw_(t,r);if(e==null&&t.default==null&&i==null)return r;let n={type:r};return e!=null&&(n.docs=e),t.default!=null&&(n.default=t.default),i!=null&&(n.validation=i),n}function HxE({description:e,schema:t}){let r="float";if(e==null)return r;let i={type:r};return e!=null&&(i.docs=e),i}function $xE({description:e,schema:t}){let r="double",i=Gw_(t,r);if(e==null&&t.default==null&&i==null)return r;let n={type:r};return e!=null&&(n.docs=e),t.default!=null&&(n.default=t.default),i!=null&&(n.validation=i),n}function GxE(e){if(e==null)return;let{format:t,pattern:r,minLength:i,maxLength:n}=e,a=QxE(t);if(!(a==null&&r==null&&i==null&&n==null))return{format:a,pattern:r,minLength:i,maxLength:n}}function QxE(e){switch(e){case"date":case"date-time":case"password":case"byte":case"bytes":case"binary":case"email":case"uuid":case"uri":case"hostname":case"ipv4":case"ipv6":return e;default:return}}function Gw_(e,t){if(e==null)return;let{minimum:r,maximum:i,multipleOf:n}=e,{exclusiveMinimum:a,exclusiveMaximum:u}=e;if(r=J1c(r,t),i=J1c(i,t),n=J1c(n,t),!(r==null&&i==null&&a==null&&u==null&&n==null))return{min:r,max:i,exclusiveMin:a,exclusiveMax:u,multipleOf:n}}function J1c(e,t){if(e===void 0)return;let[r,i]=t==="integer"?[RxE,xxE]:[NxE,FxE];return e<r||e>i?void 0:e}function K1c({schema:e,fileContainingReference:t,context:r,namespace:i}){let n=r.getSchema(e.schema,i);if(n==null)return"unknown";let a=XxE(n)??e.schema,u=SKn(n),l=ZxE(n),d=Pau({context:r,fileContainingReference:t,declarationFile:GNi(u),type:a}),s=n.type==="nullable"?`optional<${d}>`:d;return e.description==null&&l==null?s:{type:n.type==="nullable"?`optional<${d}>`:d,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:rx(e.availability)}:{}}}function Y1c({schema:e,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}){let u=Ng({schema:e.value,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}),l=`list<${WA(u)}>`;return e.description==null&&e.title==null?l:{...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:rx(e.availability)}:{},type:l}}function X1c({schema:e,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}){let u=Oau(e.key),l=Ng({schema:e.value,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}),d=e.encoding!=null?gau(e.encoding):void 0,s=`map<${WA(u)}, ${WA(l)}>`;if(e.description==null&&d==null&&e.title==null)return s;let o={type:s};return e.description!=null&&(o.docs=e.description),e.encoding!=null&&(o.encoding=d),e.availability!=null&&(o.availability=rx(e.availability)),o}function Z1c({schema:e,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}){if(!i.respectNullableSchemas)return mau({schema:e,fileContainingReference:t,context:i,declarationFile:r,namespace:n,declarationDepth:a});let u=Ng({schema:e.value,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}),l=WA(u),d=DKn(u),s=W5a(u),o=Q1c(u),c=l.startsWith("nullable<")?l:`nullable<${l}>`;if(e.availability==null&&e.description==null&&d==null&&s==null&&o==null&&e.title==null)return $w_({typeReference:c,itemType:l});let b={type:c};return(e.description!=null||d!=null)&&(b.docs=e.description??d),s!=null&&(b.default=s),o!=null&&(b.validation=o),e.availability!=null&&(b.availability=rx(e.availability)),$w_({typeReference:b,itemType:l})}function mau({schema:e,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}){let u=Ng({schema:e.value,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}),l=WA(u),d=DKn(u),s=W5a(u),o=Q1c(u),c=l.startsWith("optional<")?l:`optional<${l}>`;if(e.availability==null&&e.description==null&&d==null&&s==null&&o==null&&e.title==null)return c;let b={type:c};return(e.description!=null||d!=null)&&(b.docs=e.description??d),s!=null&&(b.default=s),o!=null&&(b.validation=o),e.availability!=null&&(b.availability=rx(e.availability)),b}function k1c(){return"unknown"}function eSc(e){let t;switch(e.value.type){case"boolean":{t=`literal<${e.value.value}>`;break}case"string":{t=`literal<"${e.value.value}">`;break}default:So(e.value)}return e.description==null&&e.title==null?t:{type:t,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:rx(e.availability)}:{}}}function JxE({schema:e,fileContainingReference:t,declarationFile:r,context:i,declarationDepth:n}){let a=H5a(e,n),u=e.nameOverride??e.generatedName;i.builder.addType(r,{name:u,schema:a.schema});let l=Pau({type:u,fileContainingReference:t,declarationFile:r,context:i});if(e.description==null&&e.default==null&&e.title==null)return l;let d={type:l};return e.description!=null&&(d.docs=e.description),e.default!=null&&(d.default=e.default.value),e.availability!=null&&(d.availability=rx(e.availability)),d}function KxE({schema:e,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}){let u=tSc({schema:e,declarationFile:r,context:i,namespace:n,declarationDepth:a}),l=e.nameOverride??e.generatedName;i.builder.addType(r,{name:l,schema:u.schema});let d=Pau({type:l,fileContainingReference:t,declarationFile:r,context:i});return e.description==null&&e.title==null?d:{type:d,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:rx(e.availability)}:{}}}function YxE({schema:e,fileContainingReference:t,declarationFile:r,context:i,namespace:n,declarationDepth:a}){let u=rSc({schema:e,declarationFile:r,context:i,namespace:n,declarationDepth:a}),l=e.nameOverride??e.generatedName;i.builder.addType(r,{name:l,schema:u.schema});let d=Pau({type:l,fileContainingReference:t,declarationFile:r,context:i});return e.description==null&&e.title==null?d:{...e.title!=null?{"display-name":e.title}:{},type:d,...e.description!=null?{docs:e.description}:{},...e.availability!=null?{availability:rx(e.availability)}:{}}}function Pau({type:e,fileContainingReference:t,declarationFile:r,context:i}){if(r===t)return e;let n=i.builder.addImport({file:t,fileToImport:r});return n!=null?`${n}.${e}`:e}function XxE(e){return cv._visit(e,{primitive:t=>t.nameOverride??t.generatedName,object:t=>t.nameOverride??t.generatedName,array:t=>t.nameOverride??t.generatedName,map:t=>t.nameOverride??t.generatedName,enum:t=>t.nameOverride??t.generatedName,reference:t=>t.nameOverride??t.generatedName,literal:t=>t.nameOverride??t.generatedName,oneOf:t=>t.nameOverride??t.generatedName,optional:t=>t.nameOverride??t.generatedName,nullable:t=>t.nameOverride??t.generatedName,unknown:t=>t.nameOverride??t.generatedName,_other:()=>{}})}function ZxE(e){return cv._visit(e,{primitive:t=>t.title,object:t=>t.title,array:t=>t.title,map:t=>t.title,enum:t=>t.title,reference:t=>t.title,literal:t=>t.title,oneOf:t=>t.title,optional:t=>t.title,nullable:t=>t.title,unknown:t=>{},_other:()=>{}})}function $w_({typeReference:e,itemType:t}){return t.startsWith("optional<")?e:typeof e=="string"?`optional<${e}>`:{...e,type:`optional<${e.type}>`}}var $8;(function(e){e[e.Channel=0]="Channel",e[e.Endpoint=1]="Endpoint",e[e.Request=2]="Request",e[e.Webhook=3]="Webhook"})($8||($8={}));function Zmi(e){switch(e.type){case"openapi":return{openapi:e.file};case"protobuf":return{proto:e.file};default:So(e)}}function Jw_({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n}){let a;switch(e.type){case"primitive":a=tNE(e);break;case"array":a=kxE({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n});break;case"map":a=eNE({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n});break;case"reference":a=rNE({schema:e,context:t,declarationFile:r,namespace:i});break;case"unknown":a=nNE(e.nameOverride,e.generatedName);break;case"optional":a=Kw_({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n});break;case"nullable":a=iNE({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n});break;case"enum":a=H5a(e,n);break;case"literal":a=aNE(e,e.nameOverride,e.generatedName);break;case"object":a=tSc({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n});break;case"oneOf":a=rSc({schema:e.value,context:t,declarationFile:r,namespace:i,declarationDepth:n});break;default:So(e)}return a}function tSc({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n}){let a=t.isInState($8.Request)&&t.respectReadonlySchemas&&(t.getEndpointMethod()==="POST"||t.getEndpointMethod()==="PUT"||t.getEndpointMethod()==="PATCH"),u=!1,l={},d=new Set;for(let g of e.properties){if(g.readonly&&(u=!0),a&&g.readonly)continue;if(Object.keys(g.conflict).length>0){if(Object.entries(g.conflict).every(([D,C])=>!C.differentSchema))continue;Object.entries(g.conflict).forEach(([D])=>{iSc({property:g.key,schemaId:D,context:t,namespace:i}).forEach(R=>{d.add(R)})})}let O=Ng({schema:g.schema,context:t,fileContainingReference:r,namespace:i,declarationDepth:n+1}),m=g.audiences,w=g.nameOverride,E=rx(g.availability),q=cNE(g);l[g.key]=sNE({typeReference:O,audiences:m,name:w,availability:E,propertyAccess:q})}let s=new Set;for(let g of e.allOfPropertyConflicts)g.allOfSchemaIds.forEach(O=>d.add(O)),g.conflictingTypeSignatures&&s.add(g.propertyKey);let o=[];for(let g of e.allOf){let O=Yw_({schema:g.schema,context:t,namespace:i});if(O==null||d.has(g.schema)||d.has(O))continue;let m=Ng({schema:cv.reference(g),context:t,fileContainingReference:r,namespace:i,declarationDepth:n+1});o.push(WA(m))}for(let g of d){let O=nSc(t,g,i);for(let m of O.properties)l[m.key]==null&&(s.has(m.key)&&(l[m.key]="unknown"),l[m.key]=Ng({schema:m.schema,context:t,fileContainingReference:r,namespace:i,declarationDepth:n+1}));for(let m of O.allOf){if(d.has(m.schema))continue;let w=Ng({schema:cv.reference(m),context:t,fileContainingReference:r,namespace:i,declarationDepth:n+1});o.push(WA(w))}}let c={docs:e.description??void 0,properties:Object.fromEntries(Object.entries(l).map(([g,O])=>uNE(g)?[g,typeof O=="string"?{type:O,name:`_${g}`}:{...O,name:`_${g}`}]:[g,O]))};o.length>0&&(c.extends=o),e.additionalProperties&&(c["extra-properties"]=!0),e.availability!=null&&(c.availability=rx(e.availability)),e.source!=null&&(c.source=Zmi(e.source)),c.inline=aSc(e,n);let b=e.nameOverride??e.generatedName;return{name:u&&t.respectReadonlySchemas&&!a?`${b}Read`:b,schema:c}}function iSc({property:e,schemaId:t,context:r,namespace:i}){let n=r.getSchema(t,i);if(n==null)return[];if(n.type==="reference")return iSc({property:e,schemaId:n.schema,context:r,namespace:i});if(n.type==="object"){let{properties:a,allOf:u}=nSc(r,t,i),l=a.some(s=>s.key===e),d=[...u.flatMap(s=>iSc({property:e,context:r,schemaId:s.schema,namespace:i}))];if(l||d.length>0)return[t,...d]}return[]}function nSc(e,t,r){let i=e.getSchema(t,r);if(i==null)return{properties:[],allOf:[]};if(i.type==="object")return{properties:i.properties,allOf:i.allOf};if(i.type==="reference")return nSc(e,i.schema,r);throw new Error(`Cannot getAllProperties for a non-object schema. schemaId=${t}, type=${i.type}`)}function kxE({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n}){return{name:e.nameOverride??e.generatedName,schema:Y1c({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:i,declarationDepth:n})}}function eNE({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n}){return{name:e.nameOverride??e.generatedName,schema:X1c({schema:e,fileContainingReference:r,declarationFile:r,context:t,namespace:i,declarationDepth:n})}}function tNE(e){let t=Oau(e);if(typeof t=="string")return{name:e.nameOverride??e.generatedName,schema:t};let{default:r,...i}=t;return{name:e.nameOverride??e.generatedName,schema:{...i}}}function Qw_(e){return e.camel==null&&e.pascal==null&&e.screamingSnake==null&&e.snake==null}function H5a(e,t){let r={enum:e.values.map(a=>{let u=a.nameOverride??a.generatedName,l=a.value;if(u===l&&a.description==null&&(a.casing==null||Qw_(a.casing)))return u;let d={value:a.value};if(u!==l&&(d.name=u),a.description!=null&&(d.docs=a.description),a.casing!=null&&!Qw_(a.casing)){let s={},o=!1;a.casing.camel!=null&&(s.camel=a.casing.camel,o=!0),a.casing.screamingSnake!=null&&(s["screaming-snake"]=a.casing.screamingSnake,o=!0),a.casing.snake!=null&&(s.snake=a.casing.snake,o=!0),a.casing.pascal!=null&&(s.pascal=a.casing.pascal,o=!0),o&&(d.casing=s)}return d})};e.description!=null&&(r.docs=e.description),e.default!=null&&(r.default=e.default.value),r.inline=aSc(e,t);let i=new Set,n={...r,enum:[],source:e.source!=null?Zmi(e.source):void 0};for(let a of r.enum){let u=typeof a=="string"?a:a.name??a.value;i.has(u.toLowerCase())||(n.enum.push(a),i.add(u.toLowerCase()))}return{name:e.nameOverride??e.generatedName,schema:n}}function rNE({schema:e,context:t,declarationFile:r,namespace:i}){return{name:e.nameOverride??e.generatedName,schema:K1c({schema:e,context:t,fileContainingReference:r,namespace:i})}}function iNE({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n}){return t.respectNullableSchemas?{name:e.nameOverride??e.generatedName,schema:Z1c({schema:e,context:t,fileContainingReference:r,declarationFile:r,namespace:i,declarationDepth:n})}:Kw_({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n})}function Kw_({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n}){return{name:e.nameOverride??e.generatedName,schema:mau({schema:e,context:t,fileContainingReference:r,declarationFile:r,namespace:i,declarationDepth:n})}}function nNE(e,t){return{name:e??t,schema:k1c()}}function aNE(e,t,r){return{name:t??r,schema:eSc(e)}}function rSc({schema:e,context:t,declarationFile:r,namespace:i,declarationDepth:n}){let a=e.encoding!=null?gau(e.encoding):void 0;if(e.type==="discriminated"){let l={};for(let s of e.commonProperties)l[s.key]=Ng({schema:s.schema,fileContainingReference:r,context:t,namespace:i,declarationDepth:n+1});let d={};for(let[s,o]of Object.entries(e.schemas))d[s]=Ng({schema:o,context:t,fileContainingReference:r,namespace:i,declarationDepth:n+1});return{name:e.nameOverride??e.generatedName,schema:{discriminant:e.discriminantProperty,"base-properties":l,docs:e.description??void 0,availability:e.availability!=null?rx(e.availability):void 0,union:d,encoding:a,source:e.source!=null?Zmi(e.source):void 0}}}let u=[];for(let l of e.schemas)u.push(Ng({schema:l,fileContainingReference:r,context:t,namespace:i,declarationDepth:n+1}));return{name:e.nameOverride??e.generatedName,schema:{discriminated:!1,docs:e.description??void 0,union:u,encoding:a,source:e.source!=null?Zmi(e.source):void 0,inline:aSc(e,n)}}}var oNE=/^[0-9]/;function uNE(e){return oNE.test(e)}function Yw_({schema:e,context:t,namespace:r}){let i=t.getSchema(e,r);if(i!=null)return i.type==="reference"?Yw_({context:t,schema:i.schema,namespace:r}):e}function sNE({typeReference:e,audiences:t,name:r,availability:i,propertyAccess:n}){return t.length===0&&r==null&&i==null&&n==null?e:{...typeof e=="string"?{type:e}:{...e},...t.length>0?{audiences:t}:{},...r!=null?{name:r}:{},...i!=null?{availability:i}:{},...n!=null?{access:n}:{}}}function aSc(e,t){return e.inline===!0||t>0?!0:void 0}function cNE(e){if(!(e.readonly&&e.writeonly)){if(e.readonly)return MF.ObjectPropertyAccess.ReadOnly;if(e.writeonly)return MF.ObjectPropertyAccess.WriteOnly}}function Xw_(e){let t=e.replace(/^x-|^X-/,"");return S_(t)}var Zw_="BasicAuthScheme",jau="BearerAuthScheme";function kw_(e){if(e.authOverrides!=null){for(let[r,i]of Object.entries(e.authOverrides["auth-schemes"]??{}))e.builder.addAuthScheme({name:r,schema:i});e.authOverrides.auth!=null&&e.builder.setAuth(e.authOverrides.auth);return}let t=!1;for(let[r,i]of Object.entries(e.ir.securitySchemes))if(i.type==="basic"){let n={scheme:"basic"};i.usernameVariableName!=null&&(n.username===void 0?n.username={name:i.usernameVariableName}:n.username.name=i.usernameVariableName),i.usernameEnvVar!=null&&(n.username===void 0?n.username={env:i.usernameEnvVar}:n.username.env=i.usernameEnvVar),i.passwordVariableName!=null&&(n.password===void 0?n.password={name:i.passwordVariableName}:n.password.name=i.passwordVariableName),i.passwordEnvVar!=null&&(n.password===void 0?n.password={env:i.passwordEnvVar}:n.password.env=i.passwordEnvVar),e.builder.addAuthScheme({name:Zw_,schema:n}),t||(e.builder.setAuth(Zw_),t=!0)}else if(i.type==="bearer"){let n={scheme:"bearer"};i.tokenVariableName!=null&&(n.token===void 0?n.token={name:i.tokenVariableName}:n.token.name=i.tokenVariableName),i.tokenEnvVar!=null&&(n.token===void 0?n.token={env:i.tokenEnvVar}:n.token.env=i.tokenEnvVar),e.builder.addAuthScheme({name:jau,schema:n}),t||(e.builder.setAuth(jau),t=!0)}else if(i.type==="header")if(t)e.builder.addGlobalHeader({name:i.headerName,schema:{type:"string",name:i.headerVariableName??Xw_(i.headerName),env:i.headerEnvVar}});else{let n={header:i.headerName,name:i.headerVariableName??"apiKey",type:"string"};i.headerEnvVar!=null&&(n.env=i.headerEnvVar),i.prefix!=null&&(n.prefix=i.prefix),e.builder.addAuthScheme({name:r,schema:n}),e.builder.setAuth(r),t=!0}else if(i.type==="oauth"){let n={scheme:"bearer"};e.builder.addAuthScheme({name:jau,schema:n}),t||(e.builder.setAuth(jau),t=!0),i.scopesEnum!=null&&i.scopesEnum.values.length>0&&e.builder.addType(fy.of("__package__.yml"),{name:"OauthScope",schema:H5a(i.scopesEnum,0).schema})}}function wor({header:e,context:t,fileContainingReference:r,namespace:i}){let n=Ng({schema:e.schema,context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),a=WA(n),u=e.name.replace(/^x-|^X-/,""),l=e.parameterNameOverride!=null?e.parameterNameOverride:S_(u);if(e.description==null&&e.name===l&&e.env==null&&e.availability==null)return a;let d={type:a};return l!==e.name&&(d.name=l),e.description!=null&&(d.docs=e.description),e.env!=null&&(d.env=e.env),e.availability!=null&&(d.availability=rx(e.availability)),d}function wau({pathParameter:e,context:t,fileContainingReference:r,namespace:i}){let n=Ng({schema:e.schema,context:t,fileContainingReference:r,namespace:i,declarationDepth:0});if(e.variableReference==null&&e.description==null&&e.availability==null)return WA(n);let a=e.variableReference!=null?{variable:`$${e.variableReference}`}:{type:WA(n)};return e.description!=null&&(a.docs=e.description),e.availability!=null&&(a.availability=rx(e.availability)),a}function Dau({queryParameter:e,context:t,fileContainingReference:r,namespace:i}){let n=oSc({schema:e.schema,context:t,fileContainingReference:r,namespace:i});if(n==null)return;let a=WA(n.value),u=W5a(n.value);a==="unknown"?a="string":a==="optional<unknown>"&&(a="optional<string>");let l={type:a};return u!=null&&(l.default=u),n.allowMultiple&&(l["allow-multiple"]=!0),e.description!=null&&(l.docs=e.description),e.parameterNameOverride!=null&&(l.name=e.parameterNameOverride),e.availability!=null&&(l.availability=rx(e.availability)),lNE(n.value)&&n.value.validation!==void 0&&(l.validation=n.value.validation),l.default==null&&l["allow-multiple"]==null&&l.docs==null&&l.name==null&&l.availability==null&&l.validation==null?a:l}function oSc({schema:e,context:t,fileContainingReference:r,namespace:i}){if(e.type==="reference"){let n=t.getSchema(e.schema,i);if(n==null)return;if(n.type==="array")return{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:n.value,description:e.description??n.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:void 0}),context:t,declarationFile:fy.of(fS),fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!0};if(n.type==="oneOf"&&n.value.type==="undiscriminated"){let a=[],u=!1;for(let[l,d]of Object.entries(n.value.schemas))d.type==="primitive"&&d.schema.type==="string"&&(u=!0),d.type==="literal"&&d.value.type==="string"&&(jKn.test(d.value.value)?a.push(d.value.value):a.push({value:d.value.value,name:wKn(d.value.value)}));if(a.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:a}}),u&&t.respectForwardCompatibleEnums?(t.builder.addType(r,{name:`${e.generatedName}OrString`,schema:{discriminated:!1,union:[{type:"string"},{type:e.generatedName}]}}),{value:`${e.generatedName}OrString`,allowMultiple:!1}):{value:e.generatedName,allowMultiple:!1};if(n.value.schemas.length===2){let[l,d]=n.value.schemas;if(l!=null&&d!=null&&Sau({array:l,primitive:d}))return{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:d,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:void 0}),context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!0};if(l!=null&&d!=null&&Sau({array:l,primitive:d}))return{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:l,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:void 0}),context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!0}}for(let[l,d]of Object.entries(n.value.schemas))return oSc({schema:d,context:t,fileContainingReference:r,namespace:i})}else if(t.objectQueryParameters)return{value:Ng({schema:e,context:t,fileContainingReference:r,declarationFile:fy.of(fS),namespace:i,declarationDepth:0}),allowMultiple:!1}}if(e.type==="optional"||e.type==="nullable"){if(e.value.type==="reference"){let n=t.getSchema(e.value.schema,i);if(n==null)return;if(n.type==="array")return{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:n.value,description:e.description??n.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,declarationFile:fy.of(fS),namespace:i,declarationDepth:0}),allowMultiple:!0};if(t.objectQueryParameters)return{value:Ng({schema:e,context:t,fileContainingReference:r,declarationFile:fy.of(fS),namespace:i,declarationDepth:0}),allowMultiple:!1}}if(e.value.type==="array")return{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value.value,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!0};if(e.value.type==="oneOf"&&e.value.value.type==="undiscriminated"){let n=[],a=!1;for(let[u,l]of Object.entries(e.value.value.schemas))l.type==="primitive"&&l.schema.type==="string"&&(a=!0),l.type==="literal"&&l.value.type==="string"&&(jKn.test(l.value.value)?n.push(l.value.value):n.push({value:l.value.value,name:wKn(l.value.value)}));if(n.length>0)return t.builder.addType(r,{name:e.generatedName,schema:{enum:n}}),a&&t.respectForwardCompatibleEnums?(t.builder.addType(r,{name:`${e.generatedName}OrString`,schema:{discriminated:!1,union:[{type:"string"},{type:`optional<${e.value.value.generatedName}>`}]}}),{value:`optional<${e.value.value.generatedName}OrString>`,allowMultiple:!1}):{value:`optional<${e.value.value.generatedName}>`,allowMultiple:!1};if(e.value.value.schemas.length===2){let[u,l]=e.value.value.schemas;if(u!=null&&l!=null&&Sau({array:u,primitive:l}))return{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:l,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!0};if(u!=null&&l!=null&&Sau({array:l,primitive:u}))return{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:u,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!0}}if(t.objectQueryParameters)return{value:Ng({schema:e,context:t,fileContainingReference:r,declarationFile:fy.of(fS),namespace:i,declarationDepth:0}),allowMultiple:!1};for(let[u,l]of Object.entries(e.value.value.schemas))return oSc({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:l,description:void 0,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:i})}else if(e.value.type==="object")return t.objectQueryParameters?{value:Ng({schema:e,context:t,fileContainingReference:r,declarationFile:fy.of(fS),namespace:i,declarationDepth:0}),allowMultiple:!1}:void 0;return{value:Ng({schema:e,context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!1}}return e.type==="array"?{value:Ng({schema:cv.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:e.description,availability:e.availability,namespace:void 0,groupName:void 0,inline:e.inline}),context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!0}:{value:Ng({schema:e,context:t,fileContainingReference:r,namespace:i,declarationDepth:0}),allowMultiple:!1}}function Sau({array:e,primitive:t}){return e?.type==="array"&&e.value.type==="primitive"&&t?.type==="primitive"&&e.value.schema.type===t.schema.type}function lNE(e){return e.type!=null}function e1_({websocketExample:e,context:t}){let r={messages:[]};e.name!=null&&(r.name=e.name),e.description!=null&&(r.docs=e.description),e.queryParameters!=null&&e.queryParameters.length>0&&(r["query-parameters"]=fNE(e.queryParameters)),e.headers!=null&&e.headers.length>0&&(r.headers=dNE({context:t,namedFullExamples:e.headers}));for(let i of e.messages){let n=QNi(i.payload);n!=null&&r.messages.push({type:i.messageType,body:n})}return r}function fNE(e){let t={};return e.forEach(r=>{let i=QNi(r.value);Array.isArray(i)?t[r.name]=i[0]:i!=null&&(t[r.name]=i)}),t}function dNE({context:e,namedFullExamples:t}){let r=e.builder.getGlobalHeaderNames(),i={};return t.forEach(n=>{let a=QNi(n.value);r.has(n.name)||a!=null&&(i[n.name]=a)}),i}function QNi(e){switch(e.type){case"primitive":return t1_(e.value);case"object":return r1_(e.properties);case"array":return pNE(e.value);case"map":return _NE(e.value);case"oneOf":return hNE(e.value);case"enum":return e.value;case"literal":return yNE(e.value);case"unknown":return QNi(e.value);default:So(e)}}function t1_(e){switch(e.type){case"int":return e.value;case"int64":return e.value;case"uint":return e.value;case"uint64":return e.value;case"float":return e.value;case"double":return e.value;case"string":return e.value.startsWith("$")?`${e.value.slice(1)}`:e.value;case"datetime":try{return new Date(e.value).toISOString().replace(/\.\d{3}Z$/,"Z")}catch{return"2024-01-15T09:30:00Z"}case"date":return e.value;case"base64":case"boolean":return e.value;default:So(e)}}function r1_(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,QNi(r)]))}function pNE(e){return e.map(t=>QNi(t))}function _NE(e){return Object.fromEntries(e.map(t=>[t1_(t.key),QNi(t.value)]))}function hNE(e){return e.type==="discriminated"?r1_(e.value):QNi(e.value)}function yNE(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:So(e)}}function kmi(e){return e.find(t=>typeof t!="string"&&t.type==="namespace")?.name}function Eau(e,t){return t??(e?.groupName!=null?kmi(e.groupName):void 0)}function i1_({channel:e,context:t,declarationFile:r}){let i={path:e.path,url:e.servers[0]?.name,auth:!1};e.audiences!=null&&e.audiences.length>0&&(i.audiences=e.audiences),e.summary!=null&&(i["display-name"]=e.summary),e.description!=null&&(i.docs=e.description);let n=kmi(e.groupName),a={};if(e.handshake.pathParameters.length>0)for(let d of e.handshake.pathParameters)a[d.name]=wau({pathParameter:d,context:t,fileContainingReference:r,namespace:n});Object.keys(a).length>0&&(i["path-parameters"]=a);let u={};if(e.handshake.queryParameters.length>0)for(let d of e.handshake.queryParameters){let s=Dau({queryParameter:d,context:t,fileContainingReference:r,namespace:n});s!=null&&(u[d.name]=s)}Object.keys(u).length>0&&(i["query-parameters"]=u);let l={};if(e.handshake.headers.length>0)for(let d of e.handshake.headers){let s=wor({header:d,context:t,fileContainingReference:r,namespace:n});l[d.name]=s}Object.keys(l).length>0&&(i.headers=l),t.builder.addChannel(r,{channel:i});for(let d of e.messages)t.builder.addChannelMessage(r,{messageId:d.name,message:{origin:d.origin,body:Ng({schema:d.body,context:t,fileContainingReference:r,namespace:n,declarationDepth:0})}});for(let d of e.examples){let s=e1_({context:t,websocketExample:d});t.builder.addChannelExample(r,{example:s})}}var ePi="Base",vNE="Default";function JNi(e){return Object.entries(e).reduce((t,[r,i])=>(hUn(i)?Object.entries(i.urls).forEach(([n,a])=>{t[n]=a}):t[r]=typeof i=="string"?i:i.url,t),{})}function n1_(e){if(e.environmentOverrides!=null){for(let[g,O]of Object.entries(e.environmentOverrides.environments??{}))e.builder.addEnvironment({name:g,schema:O});e.environmentOverrides["default-environment"]!=null&&e.builder.setDefaultEnvironment(e.environmentOverrides["default-environment"]),e.environmentOverrides["default-url"]!=null&&e.builder.setDefaultUrl(e.environmentOverrides["default-url"]);return}let t={},r=[];for(let g of e.ir.servers){let O=g.audiences?{url:g.url,audiences:g.audiences}:g.url;if(g.name==null){r.push(O);continue}t[g.name]=O}let i={},n=[];for(let g of e.ir.endpoints)for(let O of g.servers){if(O.url==null)continue;let m=O.audiences?{url:O.url,audiences:O.audiences}:O.url;if(O.name==null){n.push(m);continue}i[O.name]=m}let a={},u=[];for(let g of e.ir.websocketServers){let O=g.audiences?{url:g.url,audiences:g.audiences}:g.url;if(g.name==null){u.push(O);continue}a[g.name]=O}let l=Object.keys(t).length,d=l>0,s=Object.keys(i).length>0,o=Object.keys(a).length>0;if(!d&&!s&&o&&e.ir.servers.length===0){for(let[g,O]of Object.entries(a))e.builder.addEnvironment({name:g,schema:O});e.builder.setDefaultEnvironment(Object.keys(a)[0]),e.builder.setDefaultUrl(ePi);return}if(n.length>0&&e.logger.error(`Skipping endpoint level servers ${n.map(g=>typeof g=="string"?g:g.url).join(", ")} because x-fern-server-name was not provided.`),!d){let g=e.ir.servers[0]?.url,O=e.ir.servers[0]?.audiences;if(g!=null){let m=O?{url:g,audiences:O}:g;t[vNE]=m}}let c=Object.values(t).map(g=>typeof g=="string"?g:g.url),b=r.filter(g=>{let O=typeof g=="string"?g:g.url;return!c.includes(O)});if(b.length>0&&e.logger.error(`Skipping top level servers ${b.map(g=>typeof g=="string"?g:g.url).join(", ")} because x-fern-server-name was not provided.`),s)if(l===1){let g=Object.keys(t)[0],O=Object.values(t)[0],m=typeof O=="string"?O:O.url;e.builder.addEnvironment({name:g,schema:{urls:{[ePi]:m,...JNi(i),...JNi(a)}}}),e.builder.setDefaultEnvironment(g),e.builder.setDefaultUrl(ePi)}else{let g=!0;for(let[O,m]of Object.entries(t))g?(e.builder.addEnvironment({name:O,schema:{urls:{[ePi]:typeof m=="string"?m:m.url,...JNi(i),...JNi(a)}}}),e.builder.setDefaultEnvironment(O),g=!1):e.builder.addEnvironment({name:O,schema:{urls:{[ePi]:typeof m=="string"?m:m.url,...JNi(i),...JNi(a)}}});e.builder.setDefaultUrl(ePi)}else{let g=!0;for(let[O,m]of Object.entries(t))g?(o?e.builder.addEnvironment({name:O,schema:{urls:{[ePi]:typeof m=="string"?m:m.url,...JNi(a)}}}):e.builder.addEnvironment({name:O,schema:m}),e.builder.setDefaultEnvironment(O),g=!1):o?e.builder.addEnvironment({name:O,schema:{urls:{[ePi]:typeof m=="string"?m:m.url,...JNi(a)}}}):e.builder.addEnvironment({name:O,schema:m});o&&e.builder.setDefaultUrl(ePi)}}function Mau(e){return WA(e).startsWith("optional")?e:typeof e=="string"?`optional<${e}>`:{...e,type:`optional<${e.type}>`}}var uSc=class{schema;count=0;constructor(t){this.schema=t}increment(){this.count+=1}},bNE=.75,gNE=new Set("authorization");function a1_(e){if(e.globalHeaderOverrides!=null){for(let[r,i]of Object.entries(e.globalHeaderOverrides.headers??{}))e.builder.addGlobalHeader({name:r,schema:i});return}let t=Object.fromEntries((e.ir.globalHeaders??[]).map(r=>[r.header,r]));for(let[r,i]of Object.entries(t)){let n="optional<string>";if(i.name==null&&i.env==null&&typeof i.schema=="string")n=i.schema;else if(i!=null){let a=i.schema?SKn(i.schema):void 0,u=a!=null?kmi(a):void 0,l=fy.of("api.yml");n={name:i.name,env:i.env,type:i.schema!=null?WA(Ng({schema:i.schema,context:e,fileContainingReference:u?PF(fy.of(S_(u)),l):l,namespace:u,declarationDepth:0}))??"optional<string>":"optional<string>"}}e.builder.addGlobalHeader({name:r,schema:n})}if(e.detectGlobalHeaders){let r={};for(let n of e.ir.endpoints)for(let a of n.headers){if(gNE.has(a.name.toLowerCase()))continue;let u=r[a.name];if(u==null){let l=t[a.name],d=wor({header:{...a,schema:l?.schema??a.schema,name:l?.name??a.name},fileContainingReference:fy.of(R3),context:e,namespace:void 0});u=new uSc(d),r[a.name]=u}u.increment()}let i=e.ir.endpoints.length*bNE;for(let[n,a]of Object.entries(r)){let u=t[n],l=a.count===e.ir.endpoints.length,d=a.count>=i;u==null&&(l?e.builder.addGlobalHeader({name:n,schema:a.schema}):d&&e.builder.addGlobalHeader({name:n,schema:Mau(a.schema)}))}}}function o1_(e){for(let t of e.ir.idempotencyHeaders??[]){let r=t.schema?SKn(t.schema):void 0,i=r!=null?kmi(r):void 0,n=wor({header:{...t,schema:t.schema??cv.primitive({description:void 0,availability:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0,schema:jw.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0})}),name:t.name??t.header,parameterNameOverride:void 0,description:void 0,availability:void 0,source:void 0},fileContainingReference:fy.of(R3),context:e,namespace:i});e.builder.addIdempotencyHeader({name:t.header,schema:Mau(n)})}}function uK(e){switch(e.type){case"primitive":return s1_(e.value);case"object":return c1_(e.properties);case"array":return l1_(e.value);case"map":return mNE(e.value);case"oneOf":return PNE(e.value);case"enum":return typeof e.value=="string"&&e.value.startsWith("$")?`\\${e.value}`:e.value;case"literal":return jNE(e.value);case"unknown":return uK(e.value);default:So(e)}}function u1_(e){switch(e.type){case"withStreaming":return e.sse?{stream:ONE(e.events)}:{stream:l1_(e.events)};case"withoutStreaming":return{body:uK(e.value)};default:So(e)}}function s1_(e){switch(e.type){case"int":return e.value;case"int64":return e.value;case"uint":return e.value;case"uint64":return e.value;case"float":return e.value;case"double":return e.value;case"string":return e.value.startsWith("$")?`\\${e.value}`:e.value;case"datetime":try{return!e.value.endsWith("Z")&&!e.value.includes("+")&&(e.value+="Z"),new Date(e.value).toISOString().replace(/\.\d{3}Z$/,"Z")}catch{return"2024-01-15T09:30:00Z"}case"date":return e.value;case"base64":case"boolean":return e.value;default:So(e)}}function c1_(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,uK(r)]))}function ONE(e){return e.map(t=>({event:"",data:uK(t)}))}function l1_(e){return e.map(t=>uK(t))}function mNE(e){return Object.fromEntries(e.map(t=>[s1_(t.key),uK(t.value)]))}function PNE(e){return e.type==="discriminated"?c1_(e.value):uK(e.value)}function jNE(e){switch(e.type){case"string":return e.value;case"boolean":return e.value;default:So(e)}}function f1_({endpointExample:e,context:t}){let r={};if(e.type!=="full")return e.value;e.name!=null&&(r.name=e.name),e.description!=null&&(r.docs=e.description),e.pathParameters!=null&&e.pathParameters.length>0&&(r["path-parameters"]=wNE(e.pathParameters)),e.queryParameters!=null&&e.queryParameters.length>0&&(r["query-parameters"]=SNE(e.queryParameters));let i=e.headers!=null&&e.headers.length>0,n=t.builder.getGlobalHeaders(),a=Object.keys(n).length>0,u=new Set(e.headers?.map(l=>l.name)??[]);if(i||a){let l=[];if(e.headers!=null)for(let d of e.headers)d.name!==t.builder.getAuthHeaderName()&&l.push(d);for(let[d,s]of Object.entries(n))if(!u.has(d))if(s!=null&&typeof s=="object"&&s.type!=null){let o=X3({type:s.type,_default:void 0,validation:void 0,visitor:{primitive:c=>c.toString(),map:c=>c.toString(),list:c=>c,optional:c=>c,nullable:c=>c,set:c=>c,named:c=>c,literal:c=>{if(c.type==="string")return c.string;if(c.type==="boolean")return c.boolean.toString()},unknown:$o}});o!=null&&l.push({name:d,value:xg.literal(zNi.string(o))})}else l.push({name:d,value:xg.primitive(h_.string(d))});r.headers=DNE({context:t,namedFullExamples:l})}return e.request!=null&&(r.request=uK(e.request)),e.response!=null&&(r.response=u1_(e.response)),e.codeSamples!=null&&e.codeSamples.length>0&&(r["code-samples"]=e.codeSamples.map(l=>l.type==="language"?{name:l.name??void 0,docs:l.description??void 0,language:l.language,code:l.code,install:l.install??void 0}:{name:l.name??void 0,docs:l.description??void 0,sdk:l.sdk,code:l.code}).filter(iv)),r}function wNE(e){let t={};return e.forEach(r=>{let i=uK(r.value);i!=null&&(t[r.parameterNameOverride??r.name]=i)}),t}function SNE(e){let t={};return e.forEach(r=>{let i=uK(r.value);Array.isArray(i)?t[r.name]=i[0]:i!=null&&(t[r.name]=i)}),t}function DNE({context:e,namedFullExamples:t}){let r={};return t.forEach(i=>{let n=uK(i.value);n!=null&&(r[i.name]=n)}),r}function d1_(e){return QH._visit(e,{get:()=>MF.HttpMethodSchema.Get,post:()=>MF.HttpMethodSchema.Post,put:()=>MF.HttpMethodSchema.Put,patch:()=>MF.HttpMethodSchema.Patch,delete:()=>MF.HttpMethodSchema.Delete,head:()=>MF.HttpMethodSchema.Head,options:()=>{throw new Error("OPTIONS is unsupported")},trace:()=>{throw new Error("TRACE is unsupported")},_other:()=>{throw new Error("Unknown http method is unsupported")}})}function p1_(e){return e==="POST"||e==="PUT"||e==="PATCH"}function _1_({endpoint:e,declarationFile:t,context:r}){let{nonRequestReferencedSchemas:i}=r.ir,n=[],a=new Set,u=e.path,l=Eau(e.sdkName,e.namespace),d={};for(let w of e.pathParameters)w.parameterNameOverride&&(u=u.replace(w.name,w.parameterNameOverride)),d[w.parameterNameOverride??w.name]=wau({pathParameter:w,context:r,fileContainingReference:t,namespace:l}),a.add(w.name);let s={};for(let w of e.queryParameters){let E=Dau({queryParameter:w,context:r,fileContainingReference:t,namespace:l});E!=null&&(s[w.name]=E,a.add(w.name))}let o;if(e.pagination!=null)switch(e.pagination.type){case"cursor":o={cursor:e.pagination.cursor,next_cursor:e.pagination.nextCursor,results:e.pagination.results};break;case"offset":o={offset:e.pagination.offset,step:e.pagination.step,results:e.pagination.results,"has-next-page":e.pagination.hasNextPage};break;case"custom":o={type:"custom",results:e.pagination.results};break;default:So(e.pagination)}let c={path:u,method:d1_(e.method),auth:e.authed,docs:e.description??void 0,pagination:o,source:e.source!=null?Zmi(e.source):void 0};!ANE({context:r,request:e.request})&&Object.keys(d).length>0&&(c["path-parameters"]=d),e.summary!=null&&(c["display-name"]=e.summary);let b={},g=r.builder.getGlobalHeaderNames(),O=r.builder.getAuthHeaderName();O!=null&&g.add(O);let m=e.headers.filter(w=>!g.has(w.name));for(let w of m){let E=wor({header:w,context:r,fileContainingReference:t,namespace:l});b[w.name]=E,a.add(typeof E=="string"?w.name:E.name??w.name)}if(e.request!=null){r.setInState($8.Request);let w=MNE({endpoint:e,context:r,declarationFile:t,request:e.request,generatedRequestName:e.generatedRequestName,requestNameOverride:e.requestNameOverride??void 0,pathParameters:r.inlinePathParameters&&Object.keys(d).length>0?d:void 0,queryParameters:Object.keys(s).length>0?s:void 0,nonRequestReferencedSchemas:Array.from(i),headers:Object.keys(b).length>0?b:void 0,usedNames:a,namespace:l});c.request=w.value,n=[...n,...w.schemaIdsToExclude??[]],r.unsetInState($8.Request)}else{let w=r.inlinePathParameters&&Object.keys(d).length>0,E=Object.keys(s).length>0,q=Object.keys(b).length>0,M={};(w||E||q)&&(M.name=e.requestNameOverride??e.generatedRequestName),w&&(M["path-parameters"]=d),E&&(M["query-parameters"]=s),q&&(M.headers=b),Object.keys(M).length>0&&(c.request=M)}if(e.response!=null&&e.response._visit({json:w=>{let E=Ng({schema:w.schema,context:r,fileContainingReference:t,namespace:l,declarationDepth:0});c.response={docs:w.description??void 0,type:WA(E)},w.statusCode!=null&&(c.response["status-code"]=w.statusCode),w.responseProperty!=null&&(c.response.property=w.responseProperty)},streamingJson:w=>{let E=Ng({schema:w.schema,context:r,fileContainingReference:t,namespace:l,declarationDepth:0});c["response-stream"]={docs:w.description??void 0,type:WA(E),format:"json"}},streamingSse:w=>{let E=Ng({schema:w.schema,context:r,fileContainingReference:t,namespace:l,declarationDepth:0});c["response-stream"]={docs:w.description??void 0,type:WA(E),format:"sse"}},file:w=>{c.response={docs:w.description??void 0,type:"file","status-code":w.statusCode}},bytes:w=>{c.response={docs:w.description??void 0,type:"bytes","status-code":w.statusCode}},streamingText:w=>{c["response-stream"]={docs:w.description??void 0,type:"text"}},text:w=>{c.response={docs:w.description??void 0,type:"text","status-code":w.statusCode}},_other:()=>{throw new Error("Unrecognized Response type: "+e.response?.type)}}),r.builder.getEnvironmentType()==="multi"){let w=r.getDefaultServerName(),E=e.servers[0];E==null?w!=null&&(c.url=w):c.url=E.name??void 0}return e.idempotent&&(c.idempotent=!0),e.availability!=null&&(c.availability=rx(e.availability)),Object.entries(e.errors).forEach(([w,E])=>{let q=E.generatedName,M=fy.of(fS);r.builder.enableUniqueErrorsPerEndpoint&&(q=`${e.generatedRequestName}${E.generatedName}`,E.schema!=null&&(E.schema.type!=="reference"&&E.schema.type!=="oneOf"?E.schema.generatedName=`${e.generatedRequestName}${E.schema.generatedName}`:E.schema.type==="oneOf"&&(E.schema.value.generatedName=`${e.generatedRequestName}${E.schema.value.generatedName}`)));let D={"status-code":parseInt(w)},C=Hw_({location:h1_,namespaceOverride:l});if(E.schema!=null){let I=Ng({schema:E.schema,context:r,fileContainingReference:C,declarationFile:C,namespace:l,declarationDepth:0});D.type=WA(I),D.docs=E.description}r.builder.addError(C,{name:q,schema:r.isErrorUnknownSchema(parseInt(w))?{...D,type:"unknown"}:D}),c.errors==null&&(c.errors=[]);let R=r.builder.addImport({file:t,fileToImport:C});c.errors.push(R!=null?`${R}.${q}`:q),D.type!=null&&E.examples?.forEach(I=>{let L={value:uK(I.example),name:I.name,docs:I.description};r.builder.addErrorExample(C,{name:q,example:L})})}),e.examples.length>0&&(c.examples=ENE({endpointExamples:e.examples,context:r})),r.ir.hasEndpointsMarkedInternal&&(e.internal==null||!e.internal)?c.audiences=[sSc,...e.audiences]:e.audiences.length>0&&(c.audiences=e.audiences),{value:c,schemaIdsToExclude:n}}function ENE({endpointExamples:e,context:t}){return e.map(r=>{try{return f1_({endpointExample:r,context:t})}catch(i){throw console.error(`Error building endpoint example: ${i}`),i}})}function MNE({endpoint:e,declarationFile:t,context:r,request:i,requestNameOverride:n,generatedRequestName:a,pathParameters:u,queryParameters:l,nonRequestReferencedSchemas:d,headers:s,usedNames:o,namespace:c}){if(i.type==="json"||i.type==="formUrlEncoded"){let b=i.schema.type==="reference"?i.schema.schema:void 0,g=i.schema.type==="reference"?r.getSchema(i.schema.schema,c):i.schema;if(g?.type!=="object"||b!=null&&d.includes(b)){let q=Ng({schema:i.schema,fileContainingReference:t,context:r,namespace:c,declarationDepth:0}),M={schemaIdsToExclude:[],value:{body:q}},D=Object.keys(u??{}).length>0,C=Object.keys(l??{}).length>0,R=Object.keys(s??{}).length>0;return D&&(M.value["path-parameters"]=u),C&&(M.value["query-parameters"]=l),R&&(M.value.headers=s),(D||C||R)&&(M.value.name=n??a),i.contentType!=null&&(M.value["content-type"]=i.contentType),i.description!=null&&(M.value.docs=i.description),M}let O=Object.fromEntries(g.properties.filter(q=>q.readonly==null?!0:!(p1_(e.method)&&q.readonly)).map(q=>{let M=Ng({schema:q.schema,fileContainingReference:t,context:r,namespace:c,declarationDepth:1}),D=q.nameOverride??q.key,C=rx(q.availability);if(!o.has(D)&&q.audiences.length<=0)return o.add(D),q.nameOverride!=null?[q.key,{type:WA(M),docs:DKn(M),name:q.nameOverride,availability:C}]:[q.key,C?{...typeof M=="string"?{type:M}:M,availability:C}:M];let R={type:WA(M),docs:DKn(M)};return o.has(D)&&(R.name=q.generatedName),q.audiences.length>0&&(R.audiences=q.audiences),C!=null&&(R.availability=C),o.add(D),[q.key,R]})),m=g.allOf.map(q=>{let M=Ng({schema:cv.reference(q),fileContainingReference:t,context:r,namespace:c,declarationDepth:0});return WA(M)}).filter(q=>q!=="unknown"),w={properties:O};m.length>0&&(w.extends=m),i.additionalProperties&&(w["extra-properties"]=!0);let E={name:n??g.nameOverride??g.generatedName,"path-parameters":u,"query-parameters":l,headers:s,body:w};return i.contentType!=null&&(E["content-type"]=i.contentType),i.description!=null&&(E.docs=i.description),{schemaIdsToExclude:b!=null?[b]:[],value:E}}else{if(i.type==="octetStream")return{schemaIdsToExclude:[],value:{body:"bytes","content-type":i.contentType??hq.APPLICATION_OCTET_STREAM,"query-parameters":l,...i.description?{docs:i.description}:{}}};if(i.type==="multipart"){let b=Object.fromEntries(i.properties.map(g=>{if(g.schema.type==="file"){let O=g.schema.isArray?"list<file>":"file";if(O=g.schema.isOptional?`optional<${O}>`:O,g.description!=null||g.contentType!=null){let m={type:O};if(g.description!=null&&(m.docs=g.description),g.contentType!=null){let w=g.contentType.split(",")[0];m["content-type"]=w}return[g.key,m]}return[g.key,O]}else{let O=Ng({schema:g.schema.value,fileContainingReference:t,context:r,namespace:c,declarationDepth:1});if(g.contentType||g.exploded||g.encoding){let m=typeof O=="string"?{type:O}:O;g.contentType!=null&&(m["content-type"]=g.contentType),g.encoding==="form"?m.style="form":g.encoding==="json"?m.style="json":g.exploded&&(m.style="exploded"),O=m}return[g.key,O]}}));return{schemaIdsToExclude:i.name==null?[]:[i.name],value:{name:n??i.name??a,"path-parameters":u,"query-parameters":l,headers:s,body:{properties:b},"content-type":hq.MULTIPART_FORM_DATA,...i.description?{docs:i.description}:{}}}}else So(i)}}function ANE({context:e,request:t}){if(!e.inlinePathParameters)return!1;if(t==null)return!0;switch(t.type){case"octetStream":return!1;case"multipart":return!0;case"json":return!0;case"formUrlEncoded":return!0;default:So(t)}}function qNE({location:e,namespaceOverride:t}){return t!=null?{...e,file:PF(fy.of(t),e.file)}:e}function TNE(e){let t=e.namespace,r=e.tags.filter(d=>d!==t)[0],i=e.operationId;if(i==null)return r!=null?{file:fy.of(`${S_(r)}.yml`),endpointId:e.summary!=null?S_(e.summary):S_(`${e.method}_${e.path.split("/").join("_")}`)}:e.summary!=null?{file:fy.of(fS),endpointId:S_(e.summary)}:{file:fy.of(fS),endpointId:S_(`${e.method}_${e.path.split("/").join("_")}`)};if(r==null)return{file:fy.of(fS),endpointId:i};let n=$5a(r),a=$5a(i);if(g8(n,a))return{file:fy.of("__package__.yml"),endpointId:r};let u=INE({operationId:i,tag:r,path:e.path,method:e.method});if(u!=null)return u;let l=[];for(let d=0;d<n.length;++d){let s=n[d];if(s!=null&&s===a[d])l.push(s);else{let o=S_(r);return{file:fy.of(`${o}.yml`),endpointId:i,tag:r}}}if(l.length>=a.length)throw new Error(`Cannot get file for endpoint ${JSON.stringify(e)}`);return{file:fy.of(S_(l.join("_"))+".yml"),endpointId:S_(a.slice(l.length).join("_")),tag:r}}function G5a(e){let t=e.tags[0];if(e.sdkName!=null){let r=G1c({sdkName:e.sdkName,namespaceOverride:e.namespace}),i=`${r}.yml`,n=r.toLowerCase()===t?.toLowerCase().replaceAll(" ","");return{file:fy.of(i),endpointId:e.sdkName.methodName,tag:n?t:void 0}}return qNE({namespaceOverride:e.namespace,location:TNE(e)})}function $5a(e){let t;return/^[a-z]+(?:[A-Z][a-z]+)*$/.test(e)?t=e.split(/(?=[A-Z])/):t=e.split(/[^a-zA-Z0-9]+/),t=t.map(r=>r.toLowerCase()),t=Gxe(t),t}var CNE=new RegExp("[^a-zA-Z0-9{}]+"),BNE=new RegExp("[{}]","g");function INE({operationId:e,tag:t,path:r,method:i}){let a=`${r.split(CNE).join("_").replaceAll(BNE,"_")}_${i.toLowerCase()}`;if(e.endsWith(a))return{file:fy.of(S_(t)+".yml"),endpointId:S_(e.slice(0,-1*a.length)),tag:t}}function y1_(e){let t=new Set,{endpoints:r,tags:i}=e.ir,n=[];for(let a of r){let{endpointId:u,file:l,tag:d}=G5a(a),s=l.split(".")[0];s!=null&&t.add(s);let o;if(a.sdkName!=null){let g=e.ir.groups;for(let O of a.sdkName.groupName){let m=typeof O=="string"?O:O.name,w=g[m];if(w==null)break;if(w.summary!=null||w.description!=null){o=g[m];break}}}let c=d==null?void 0:i.tagsById[d];e.setInState($8.Endpoint),e.setEndpointMethod(a.method);let b=_1_({context:e,endpoint:a,declarationFile:l});e.unsetEndpointMethod(),e.unsetInState($8.Endpoint),n=[...n,...b.schemaIdsToExclude],e.builder.addEndpoint(l,{name:u,schema:b.value,source:a.source!=null?Zmi(a.source):void 0}),(c?.id!=null||c?.description!=null)&&e.builder.setServiceInfo(l,{"display-name":o?.summary??c?.id,docs:o?.description??c?.description??void 0})}return{schemaIdsToExclude:n,sdkGroups:t}}function v1_(e){for(let[t,r]of Object.entries(e.ir.variables)){let i=r.groupName!=null?kmi(r.groupName):void 0,n=Ng({schema:cv.primitive(r),context:e,fileContainingReference:fy.of(fS),namespace:i,declarationDepth:0});e.builder.addVariable({name:t,schema:{type:WA(n),docs:r.description??void 0}})}}function b1_(e){for(let t of e.ir.webhooks){let r=xNE({webhook:t,context:e});if(r==null)continue;let i=Eau(t.sdkName,t.namespace),n={};for(let u of t.headers)n[u.name]=wor({header:u,context:e,fileContainingReference:r.file,namespace:i});let a={audiences:t.audiences,method:t.method,"display-name":t.summary??void 0,headers:n,payload:Ng({schema:t.payload,context:e,fileContainingReference:r.file,namespace:i,declarationDepth:0}),examples:t.examples!=null?t.examples.map(u=>({docs:u.description,name:u.name,payload:uK(u.payload)})):void 0};e.builder.addWebhook(r.file,{name:r.endpointId,schema:a}),t.description!=null&&(a.docs=t.description)}}function zNE({location:e,namespaceOverride:t}){if(e!=null)return t!=null?{...e,file:PF(fy.of(t),e.file)}:e}function RNE({webhook:e,context:t}){let r=e.tags[0],i=e.operationId;if(r==null)return{file:fy.of(fS),endpointId:i};let n=$5a(r),a=$5a(i);if(g8(n,a))return{file:fy.of("__package__.yml"),endpointId:r};let u=[];for(let l=0;l<n.length;++l){let d=n[l];if(d!=null&&d===a[l])u.push(d);else{let s=S_(r);return{file:fy.of(`${s}.yml`),endpointId:i,tag:r}}}if(u.length>=a.length){t.logger.warn(`Skipping webhook ${e.operationId} because couldn't compute file location`);return}return{file:fy.of(S_(u.join("_"))+".yml"),endpointId:S_(a.slice(u.length).join("_")),tag:r}}function xNE({webhook:e,context:t}){return e.sdkName!=null?{file:Ww_({sdkName:e.sdkName,namespaceOverride:e.namespace}),endpointId:e.sdkName.methodName}:zNE({namespaceOverride:e.namespace,location:RNE({webhook:e,context:t})})}var NNE=fy.of(fS);function O1_(e){switch(e.type){case"object":case"primitive":case"enum":case"array":case"map":case"reference":case"literal":case"optional":case"nullable":return g1_({namespace:e.namespace,groupName:e.groupName});case"oneOf":return g1_({namespace:e.value.namespace,groupName:e.value.groupName});case"unknown":return NNE;default:So(e)}}function g1_({namespace:e,groupName:t}){return e!=null&&t!=null?GNi([{type:"namespace",name:e},...t]):e!=null?GNi([{type:"namespace",name:e}]):GNi(t)}var sSc="external",h1_=fy.of(fS);function m1_({schemas:e,schemaIdsToExclude:t,namespace:r,context:i}){for(let[n,a]of Object.entries(e)){if(t.includes(n))continue;let u=O1_(a),l=Jw_({schema:a,context:i,declarationFile:u,namespace:r,declarationDepth:0});if(yzi(l.schema)){let d=WA(l.schema);if(d===(l.name??n)||d===`optional<${l.name??n}>`)continue}i.builder.addType(u,{name:l.name??n,schema:l.schema})}}function P1_(e){e.ir.apiVersion!=null&&e.builder.setApiVersion(e.ir.apiVersion),n1_(e),a1_(e),o1_(e),kw_(e),v1_(e),e.ir.basePath!=null&&e.builder.setBasePath(e.ir.basePath),e.ir.hasEndpointsMarkedInternal&&e.builder.addAudience(sSc);let t=y1_(e),r=t.sdkGroups;e.setInState($8.Webhook),b1_(e),e.unsetInState($8.Webhook),e.setInState($8.Channel);for(let n of Object.values(e.ir.channels)){let a=GNi(n.groupName);i1_({channel:n,context:e,declarationFile:a})}e.unsetInState($8.Channel);let i=FNE({context:e,schemaIdsToExcludeFromServices:t.schemaIdsToExclude});m1_({schemas:e.ir.groupedSchemas.rootSchemas,schemaIdsToExclude:i,namespace:void 0,context:e});for(let[n,a]of Object.entries(e.ir.groupedSchemas.namespacedSchemas))m1_({schemas:a,schemaIdsToExclude:i,namespace:n,context:e});return e.ir.tags.orderedTagIds!=null&&e.ir.tags.orderedTagIds.length>0&&e.ir.tags.orderedTagIds.every(a=>r.has(a))&&e.builder.addNavigation({navigation:e.ir.tags.orderedTagIds}),e.builder.build()}function FNE({context:e,schemaIdsToExcludeFromServices:t}){let r=e.getReferencedSchemaIds();if(r==null)return t;let i=new Set([...Object.keys(e.ir.groupedSchemas.rootSchemas),...Object.values(e.ir.groupedSchemas.namespacedSchemas).flatMap(a=>Object.keys(a))]),n=new Set(t);for(let a of i)r.includes(a)||n.add(a);return Array.from(n)}var Q5a=class{context;constructor(t){this.context=t}};var Aau=class e{files={};directories={};getAllFiles(){let t={},r=(i,n)=>{for(let[u,l]of Object.entries(i.files)){let d=n!=null?fy.of(`${n}${b$t}${u}`):fy.of(u);t[d]=l}let a=Object.keys(i.directories).sort();for(let u of a){let l=n!=null?`${n}${b$t}${u}`:u,d=i.directories[u];r(d,l)}};return r(this),t}getOrCreateFile(t){return this.getOrCreateFileRecursive(t.split(b$t))}getOrCreateFileRecursive(t){if(t.length===1)return this.files[fy.of(t[0])]??={};let[r,...i]=t;if(r==null)throw new Error(`Internal error; cannot add file with path: ${t}`);return this.directories[r]||(this.directories[r]=new e),this.directories[r].getOrCreateFileRecursive(i)}};var tan=class{enableUniqueErrorsPerEndpoint;root;rootApiFile;packageMarkerFile={};basePath=void 0;constructor(t){this.enableUniqueErrorsPerEndpoint=t,this.root=new Aau,this.rootApiFile={name:"api","error-discrimination":{strategy:"status-code"}}}setDisplayName({displayName:t}){this.rootApiFile["display-name"]=t}addNavigation({navigation:t}){this.packageMarkerFile.navigation=t}setServiceInfo(t,{auth:r,"base-path":i,"display-name":n,docs:a}){let u=this.getOrCreateFile(t);u.service==null&&(u.service={auth:!1,"base-path":"",endpoints:{}}),r!=null&&(u.service.auth=r),i!=null&&(u.service["base-path"]=i),n!=null&&(u.service["display-name"]=n),a!=null&&(u.docs=a)}addAudience(t){this.rootApiFile.audiences==null&&(this.rootApiFile.audiences=[]),this.rootApiFile.audiences.push(t)}setAuth(t){this.rootApiFile.auth=t}addAuthScheme({name:t,schema:r}){this.rootApiFile["auth-schemes"]==null&&(this.rootApiFile["auth-schemes"]={}),this.rootApiFile["auth-schemes"][t]==null&&(this.rootApiFile["auth-schemes"][t]=r)}setDefaultEnvironment(t){this.rootApiFile["default-environment"]=t}setDefaultUrl(t){this.rootApiFile["default-url"]=t}setBasePath(t){this.basePath=t}setApiVersion(t){this.rootApiFile.version=t}getEnvironmentType(){let t=Object.entries(this.rootApiFile.environments??{})[0];if(t!=null)return Krr(t[1],{singleBaseUrl:()=>"single",multipleBaseUrls:()=>"multi"})}addEnvironment({name:t,schema:r}){this.rootApiFile.environments==null&&(this.rootApiFile.environments={}),this.rootApiFile.environments[t]=r}getGlobalHeaderNames(){let t=Object.keys(this.rootApiFile.headers??{});if(this.rootApiFile["auth-schemes"]!=null)for(let i of Object.values(this.rootApiFile["auth-schemes"]))j1_(i)&&t.push(i.header);let r=this.getVersionHeader();return r!=null&&t.push(r),new Set(t)}getAuthHeaderName(){if(this.rootApiFile["auth-schemes"]!=null){for(let t of Object.values(this.rootApiFile["auth-schemes"]))if(j1_(t))return t.header;return"Authorization"}}addGlobalHeader({name:t,schema:r}){let i=this.getVersionHeader();i!=null&&i===t||(this.rootApiFile.headers==null&&(this.rootApiFile.headers={}),this.rootApiFile.headers[t]=r)}getGlobalHeaders(){return this.rootApiFile.headers??{}}addIdempotencyHeader({name:t,schema:r}){this.rootApiFile["idempotency-headers"]==null&&(this.rootApiFile["idempotency-headers"]={}),this.rootApiFile["idempotency-headers"][t]=r}addVariable({name:t,schema:r}){this.rootApiFile.variables==null&&(this.rootApiFile.variables={}),this.rootApiFile.variables[t]=r}addImport({file:t,fileToImport:r,alias:i}){if(t===r)return;let n=i??S_((iNe(r)+"/"+lki(r,{stripExtension:!0})).replaceAll("__package__","root"));if(t===fy.of(R3))return this.rootApiFile.imports==null&&(this.rootApiFile.imports={}),this.rootApiFile.imports[n]=mBo(iNe(w5n.of(`/${t}`)),w5n.of(`/${r}`)),n;let a=this.getOrCreateFile(t);return a.imports==null&&(a.imports={}),a.imports[n]=mBo(iNe(w5n.of(`/${t}`)),w5n.of(`/${r}`)),n}addType(t,{name:r,schema:i}){if(t===fy.of(R3))return;let n=this.getOrCreateFile(t);n.types==null&&(n.types={}),n.types[r]=i}addTypeExample(t,r,i){let n=this.getOrCreateFile(t);n.types==null&&(n.types={});let a=n.types[r];a!=null&&(typeof a=="string"?n.types[r]={type:a,examples:[i]}:(a.examples==null&&(a.examples=[]),a.examples.push(i)))}addError(t,{name:r,schema:i}){let n=this.getOrCreateFile(t);n.errors==null&&(n.errors={}),n.errors[r]==null?n.errors[r]=i:n.errors[r]?.type!==i.type&&(n.errors[r]={"status-code":i["status-code"],type:"unknown"})}addErrorExample(t,{name:r,example:i}){let n=this.getOrCreateFile(t);if(n.errors==null)return;let a=n.errors[r];if(a==null)return;a.examples==null&&(a.examples=[]),(a.examples.some(l=>g8(l,i))??!1)||a.examples?.push(i)}addEndpoint(t,{name:r,schema:i,source:n}){let a=this.getOrCreateFile(t);a.service==null&&(a.service={auth:!1,"base-path":"",endpoints:{}}),n!=null&&(a.service.source=n),a.service.endpoints[r]=i}addWebhook(t,{name:r,schema:i}){let n=this.getOrCreateFile(t);n.webhooks==null&&(n.webhooks={}),n.webhooks[r]=i}addChannel(t,{channel:r}){let i=this.getOrCreateFile(t);i.channel=r;let n=this.basePath;n!=null&&(i.channel.path=PF(n,r.path))}addChannelExample(t,{example:r}){let i=this.getOrCreateFile(t);i.channel==null&&(i.channel={path:"",auth:!1}),i.channel.messages==null&&(i.channel.messages={}),i.channel.examples==null&&(i.channel.examples=[]),i.channel.examples.push(r)}addChannelMessage(t,{messageId:r,message:i}){let n=this.getOrCreateFile(t);n.channel==null&&(n.channel={path:"",auth:!1}),n.channel.messages==null&&(n.channel.messages={}),n.channel.messages[r]=i}build(){let t=this.root.getAllFiles(),r=this.basePath;if(r!=null){this.packageMarkerFile.service!=null&&(this.packageMarkerFile.service={...this.packageMarkerFile.service,endpoints:Object.fromEntries(Object.entries(this.packageMarkerFile.service.endpoints).map(([n,a])=>[n,{...a,path:PF(r,a.path)}]))});for(let n of Object.values(t))n.service!=null&&(n.service={...n.service,endpoints:Object.fromEntries(Object.entries(n.service.endpoints).map(([a,u])=>[a,{...u,path:PF(r,u.path)}]))})}return{rootApiFile:this.rootApiFile,packageMarkerFile:this.packageMarkerFile,definitionFiles:t}}getOrCreateFile(t){return t===fS?this.packageMarkerFile:this.root.getOrCreateFile(t)}getVersionHeader(){if(this.rootApiFile.version!=null)return typeof this.rootApiFile.version.header=="string"?this.rootApiFile.version.header:this.rootApiFile.version.header.value}};function j1_(e){return e?.header!=null}var qau=class{logger;taskContext;ir;builder;environmentOverrides;authOverrides;globalHeaderOverrides;detectGlobalHeaders;objectQueryParameters;respectReadonlySchemas;respectNullableSchemas;onlyIncludeReferencedSchemas;inlinePathParameters;useBytesForBinaryResponse;respectForwardCompatibleEnums;enableUniqueErrorsPerEndpoint;defaultServerName=void 0;unknownSchema=new Set;referencedSchemaIds;endpointMethod;state=new Set;constructor({taskContext:t,ir:r,options:i,environmentOverrides:n,globalHeaderOverrides:a,authOverrides:u}){this.logger=t.logger,this.taskContext=t,this.ir=r,this.environmentOverrides=n,this.authOverrides=u,this.globalHeaderOverrides=a,this.detectGlobalHeaders=i?.detectGlobalHeaders??!0,this.objectQueryParameters=i?.objectQueryParameters??!1,this.respectReadonlySchemas=i?.respectReadonlySchemas??!1,this.respectNullableSchemas=i?.respectNullableSchemas??!1,this.onlyIncludeReferencedSchemas=i?.onlyIncludeReferencedSchemas??!1,this.inlinePathParameters=i?.inlinePathParameters??!1,this.useBytesForBinaryResponse=i?.useBytesForBinaryResponse??!1,this.respectForwardCompatibleEnums=i?.respectForwardCompatibleEnums??!1,this.referencedSchemaIds=i?.onlyIncludeReferencedSchemas?new Set:void 0,this.enableUniqueErrorsPerEndpoint=i?.enableUniqueErrorsPerEndpoint??!1,this.builder=new tan(this.enableUniqueErrorsPerEndpoint),r.title!=null&&this.builder.setDisplayName({displayName:r.title});let l={};if(!this.enableUniqueErrorsPerEndpoint)for(let d of r.endpoints)for(let[s,o]of Object.entries(d.errors)){let c=parseInt(s),b=l[c];b==null&&o.schema!=null?l[c]=o.schema:b!=null&&o.schema!=null&&fue(b,o.schema)||this.unknownSchema.add(c)}}getReferencedSchemaIds(){if(this.referencedSchemaIds!=null)return Array.from(this.referencedSchemaIds)}getSchema(t,r){return r==null?this.ir.groupedSchemas.rootSchemas[t]:this.ir.groupedSchemas.namespacedSchemas[r]?.[t]}getDefaultServerName(){return this.defaultServerName}setDefaultServerName(t){this.defaultServerName=t}isErrorUnknownSchema(t){return this.unknownSchema.has(t)}getEndpointMethod(){return this.endpointMethod}setEndpointMethod(t){this.endpointMethod=t}unsetEndpointMethod(){this.endpointMethod=void 0}isInState(t){return this.state.has(t)}setInState(t){this.state.add(t)}unsetInState(t){this.state.delete(t)}shouldMarkSchemaAsReferenced(){return this.onlyIncludeReferencedSchemas&&this.isInAnyState($8.Channel,$8.Endpoint,$8.Webhook)}markSchemaAsReferenced(t,r){switch(t.type){case"primitive":return;case"object":this.markObjectSchemaAsReferenced(t,r);return;case"array":this.markSchemaAsReferenced(t.value,r);return;case"map":this.markSchemaAsReferenced(t.value,r);return;case"optional":this.markSchemaAsReferenced(t.value,r);return;case"reference":this.markSchemaIdAsReferenced(t.schema,r);return;case"oneOf":this.markOneofSchemaAsReferenced(t.value,r);return;case"nullable":this.markSchemaAsReferenced(t.value,r);return;case"enum":return;case"literal":return;case"unknown":return;default:So(t)}}markObjectSchemaAsReferenced(t,r){for(let i of t.allOf)this.markSchemaIdAsReferenced(i.schema,r);for(let i of t.properties)this.markSchemaAsReferenced(i.schema,r)}markOneofSchemaAsReferenced(t,r){switch(t.type){case"discriminated":for(let i of Object.values(t.schemas))this.markSchemaAsReferenced(i,r);return;case"undiscriminated":for(let i of t.schemas)this.markSchemaAsReferenced(i,r);return;default:So(t)}}markSchemaIdAsReferenced(t,r){if(this.referencedSchemaIds!=null&&!this.referencedSchemaIds.has(t)){this.referencedSchemaIds.add(t);let i=this.getSchema(t,r);i!=null&&this.markSchemaAsReferenced(i,r)}}isInAnyState(...t){return t.some(r=>this.isInState(r))}};function cSc(e){let t=new qau(e);return P1_(t)}var Tau=class{args;constructor(t){this.args=t}convert({context:t,ir:r,settings:i,absoluteFilePath:n}){let a=cSc({taskContext:t,ir:r,options:x5a({overrides:{...i,respectReadonlySchemas:i?.respectReadonlySchemas??this.args.respectReadonlySchemas,respectNullableSchemas:i?.respectNullableSchemas??this.args.respectNullableSchemas,onlyIncludeReferencedSchemas:i?.onlyIncludeReferencedSchemas??this.args.onlyIncludeReferencedSchemas,inlinePathParameters:i?.inlinePathParameters??this.args.inlinePathParameters,objectQueryParameters:i?.objectQueryParameters??this.args.objectQueryParameters,useBytesForBinaryResponse:i?.useBytesForBinaryResponse??this.args.useBytesForBinaryResponse,respectForwardCompatibleEnums:i?.respectForwardCompatibleEnums??this.args.respectForwardCompatibleEnums}}),authOverrides:i?.auth!=null?{auth:i.auth}:this.args.generatorsConfiguration?.api?.auth!=null?{...this.args.generatorsConfiguration.api}:void 0,environmentOverrides:this.args.generatorsConfiguration?.api?.environments!=null?{...this.args.generatorsConfiguration?.api}:void 0,globalHeaderOverrides:this.args.generatorsConfiguration?.api?.headers!=null?{...this.args.generatorsConfiguration?.api}:void 0});return{absoluteFilePath:n??this.args.absoluteFilePath,rootApiFile:{defaultUrl:a.rootApiFile["default-url"],contents:a.rootApiFile,rawContents:wd.dump(a.rootApiFile)},namedDefinitionFiles:{..._d(a.definitionFiles,u=>({absoluteFilepath:n??this.args.absoluteFilePath,rawContents:wd.dump(u),contents:u})),[fy.of(fS)]:{absoluteFilepath:n??this.args.absoluteFilePath,rawContents:wd.dump(a.packageMarkerFile),contents:a.packageMarkerFile}},packageMarkers:{},importedDefinitions:{}}}};var J5a=class extends hQt{inlinePathParameters;objectQueryParameters;onlyIncludeReferencedSchemas;respectReadonlySchemas;respectNullableSchemas;exampleGeneration;useBytesForBinaryResponse;respectForwardCompatibleEnums;inlineAllOfSchemas;converter;constructor(t){super(t),this.inlinePathParameters=t.inlinePathParameters,this.objectQueryParameters=t.objectQueryParameters,this.onlyIncludeReferencedSchemas=t.onlyIncludeReferencedSchemas,this.respectReadonlySchemas=t.respectReadonlySchemas,this.respectNullableSchemas=t.respectNullableSchemas,this.exampleGeneration=t.exampleGeneration,this.useBytesForBinaryResponse=t.useBytesForBinaryResponse,this.respectForwardCompatibleEnums=t.respectForwardCompatibleEnums,this.inlineAllOfSchemas=t.inlineAllOfSchemas,this.converter=new Tau(t)}async getDefinition({context:t,absoluteFilePath:r,relativePathToDependency:i},n){let a=await this.getOpenAPIIr({context:t,relativePathToDependency:i},n);return this.converter.convert({context:t,ir:a,settings:n,absoluteFilePath:r})}async toFernWorkspace({context:t},r){let i=await this.getDefinition({context:t},r);return new ZAe({absoluteFilePath:this.absoluteFilePath,workspaceName:this.workspaceName,generatorsConfiguration:this.generatorsConfiguration,dependenciesConfiguration:{dependencies:{}},definition:i,cliVersion:this.cliVersion})}};var JH={BEARER_FORMAT:"x-bearer-format",ENUM_VAR_NAMES:"x-enum-varnames",INTERNAL:"x-internal",EXAMPLES:"x-examples",TAGS:"x-tags",REDOCLY_CODE_SAMPLES_KEBAB:"x-code-samples",REDOCLY_CODE_SAMPLES_CAMEL:"x-codeSamples"};var EKn={of(e){return e}};var w1_={properties:{"stream-condition":{type:"string"},response:"Schema","response-stream":"Schema"},required:["stream-condition","response","response-stream"],extensionsPrefix:"x-"},lSc={id:"",typeExtension:{oas3:e=>({...e,XFernStreaming:w1_,Operation:{...e.Operation,properties:{...e.Operation?.properties,"x-fern-streaming":"XFernStreaming"}}})}},Kf={SOURCE:EKn.of("source"),SDK_NAMESPACE:EKn.of("x-fern-sdk-namespace"),SDK_METHOD_NAME:EKn.of("x-fern-sdk-method-name"),SDK_GROUP_NAME:EKn.of("x-fern-sdk-group-name"),REQUEST_NAME_V1:"x-request-name",REQUEST_NAME_V2:"x-fern-request-name",TYPE_NAME:"x-fern-type-name",BOOLEAN_LITERAL:"x-fern-boolean-literal",SERVER_NAME_V1:"x-name",SERVER_NAME_V2:"x-fern-server-name",BASE_PATH:"x-fern-base-path",GROUPS:EKn.of("x-fern-groups"),OPENAPI_OVERIDES_FILEPATH:"x-fern-overrides-filepath",TYPE_DEFINITION:"x-fern-type",STREAMING:"x-fern-streaming",PAGINATION:"x-fern-pagination",WEBHOOK:"x-fern-webhook",ASYNC_CONFIG:"x-fern-async-config",SDK_VARIABLES:"x-fern-sdk-variables",SDK_VARIABLE:"x-fern-sdk-variable",PARAMETER_NAME:"x-fern-parameter-name",BASIC_AUTH_USERNAME_VARIABLE_NAME:"x-fern-username-variable-name",BASIC_AUTH_PASSWORD_VARIABLE_NAME:"x-fern-password-variable-name",BEARER_TOKEN_VARIABLE_NAME:"x-fern-token-variable-name",HEADER_VARIABLE_NAME:"x-fern-header-variable-name",FERN_ENUM:"x-fern-enum",AUDIENCES:"x-fern-audiences",IGNORE:"x-fern-ignore",AVAILABILITY:"x-fern-availability",RESPONSE_PROPERTY:"x-fern-sdk-return-value",RESOLUTIONS:"x-fern-resolutions",EXAMPLES:"x-fern-examples",FERN_BEARER_TOKEN:"x-fern-bearer",FERN_HEADER_AUTH:"x-fern-header",FERN_BASIC_AUTH:"x-fern-basic",FERN_GLOBAL_HEADERS:"x-fern-global-headers",FERN_IDEMPOTENCY_HEADERS:"x-fern-idempotency-headers",IDEMPOTENT:"x-fern-idempotent",FERN_PROPERTY_NAME:"x-fern-property-name",IS_UNDISCRIMINATED:"x-fern-undiscriminated",FERN_VERSION:"x-fern-version",ENCODING:"x-fern-encoding",TRANSPORT:"x-fern-transport",IS_DISCRIMINATED:"x-fern-discriminated"};var $F={disableExamples:!1,discriminatedUnionV2:!1,useTitlesAsName:!0,audiences:void 0,optionalAdditionalProperties:!0,coerceEnumsToLiterals:!0,respectReadonlySchemas:!1,respectNullableSchemas:!1,onlyIncludeReferencedSchemas:!1,inlinePathParameters:!1,preserveSchemaIds:!1,objectQueryParameters:!1,shouldUseUndiscriminatedUnionsWithLiterals:!1,shouldUseIdiomaticRequestNames:!1,filter:void 0,asyncApiNaming:"v1",exampleGeneration:void 0,defaultFormParameterEncoding:"json",useBytesForBinaryResponse:!1,respectForwardCompatibleEnums:!1,additionalPropertiesDefaultsTo:!1,typeDatesAsStrings:!0,preserveSingleSchemaOneOf:!1,inlineAllOfSchemas:!1};function gQt({options:e,overrides:t}){return{disableExamples:t?.disableExamples??$F.disableExamples,discriminatedUnionV2:t?.discriminatedUnionV2??e?.discriminatedUnionV2??$F.discriminatedUnionV2,useTitlesAsName:t?.useTitlesAsName??e?.useTitlesAsName??$F.useTitlesAsName,audiences:t?.audiences??e?.audiences??$F.audiences,optionalAdditionalProperties:t?.optionalAdditionalProperties??e?.optionalAdditionalProperties??$F.optionalAdditionalProperties,coerceEnumsToLiterals:t?.coerceEnumsToLiterals??e?.coerceEnumsToLiterals??$F.coerceEnumsToLiterals,respectReadonlySchemas:t?.respectReadonlySchemas??e?.respectReadonlySchemas??$F.respectReadonlySchemas,respectNullableSchemas:t?.respectNullableSchemas??e?.respectNullableSchemas??$F.respectNullableSchemas,onlyIncludeReferencedSchemas:t?.onlyIncludeReferencedSchemas??e?.onlyIncludeReferencedSchemas??$F.onlyIncludeReferencedSchemas,inlinePathParameters:t?.inlinePathParameters??e?.inlinePathParameters??$F.inlinePathParameters,preserveSchemaIds:t?.preserveSchemaIds??$F.preserveSchemaIds,shouldUseUndiscriminatedUnionsWithLiterals:t?.shouldUseUndiscriminatedUnionsWithLiterals??e?.shouldUseUndiscriminatedUnionsWithLiterals??$F.shouldUseUndiscriminatedUnionsWithLiterals,shouldUseIdiomaticRequestNames:t?.shouldUseIdiomaticRequestNames??e?.shouldUseIdiomaticRequestNames??$F.shouldUseIdiomaticRequestNames,objectQueryParameters:t?.objectQueryParameters??e?.objectQueryParameters??$F.objectQueryParameters,filter:t?.filter??e?.filter??$F.filter,asyncApiNaming:t?.asyncApiNaming??e?.asyncApiNaming??$F.asyncApiNaming,useBytesForBinaryResponse:t?.useBytesForBinaryResponse??e?.useBytesForBinaryResponse??$F.useBytesForBinaryResponse,exampleGeneration:t?.exampleGeneration??e?.exampleGeneration??void 0,defaultFormParameterEncoding:t?.defaultFormParameterEncoding??e?.defaultFormParameterEncoding??void 0,respectForwardCompatibleEnums:t?.respectForwardCompatibleEnums??e?.respectForwardCompatibleEnums??$F.respectForwardCompatibleEnums,additionalPropertiesDefaultsTo:t?.additionalPropertiesDefaultsTo??e?.additionalPropertiesDefaultsTo??$F.additionalPropertiesDefaultsTo,typeDatesAsStrings:t?.typeDatesAsStrings??e?.typeDatesAsStrings??$F.typeDatesAsStrings,preserveSingleSchemaOneOf:t?.preserveSingleSchemaOneOf??e?.preserveSingleSchemaOneOf??$F.preserveSingleSchemaOneOf,inlineAllOfSchemas:t?.inlineAllOfSchemas??e?.inlineAllOfSchemas??$F.inlineAllOfSchemas}}var S1_={naming:"v1"};function of(e,t){let r=Array.isArray(t)?t:[t];for(let i of r){let n=e[i];if(n!=null)return n}}function K5a(e,t,r,i,n=[]){try{let a=of(e,t);if(a!=null)return r.parse(a)}catch{let u=Gxe(n).join(" -> ");i.error(`${u.length>0?`${u}: `:""}Failed to parse ${t}`)}}function ran(e){let t=of(e,"examples");if(t!=null){if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null)return Object.values(t).map(r=>typeof r=="object"&&r!==null&&"value"in r?r.value:r)}return[]}function D1_({schema:e,logger:t}){return of(e,Kf.ENCODING)??void 0}function E1_(e){return of(e,Kf.FERN_ENUM)}function M1_({nameOverride:e,generatedName:t,title:r,schema:i,description:n,availability:a}){let u=of(i,Kf.SDK_NAMESPACE),l=of(i,Kf.SDK_GROUP_NAME),d=of(i,Kf.TYPE_DEFINITION);if(d!=null)return Y5a({fernType:d,nameOverride:e,generatedName:t,title:r,description:n,availability:a,namespace:u,groupName:typeof l=="string"?[l]:l})}function Y5a({fernType:e,nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l}){return X3({type:e,_default:void 0,validation:void 0,visitor:{primitive:d=>{switch(d.v1){case"BASE_64":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.base64({example:void 0})});case"BOOLEAN":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.boolean({default:void 0,example:void 0})});case"DATE":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.date({example:void 0})});case"DATE_TIME":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.datetime({example:void 0})});case"FLOAT":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.float({example:void 0})});case"DOUBLE":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.double({default:void 0,minimum:void 0,maximum:void 0,exclusiveMinimum:void 0,exclusiveMaximum:void 0,multipleOf:void 0,example:void 0})});case"UINT":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.uint({default:void 0,example:void 0})});case"INTEGER":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.int({default:void 0,minimum:void 0,maximum:void 0,exclusiveMinimum:void 0,exclusiveMaximum:void 0,multipleOf:void 0,example:void 0})});case"UINT_64":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.uint64({default:void 0,example:void 0})});case"LONG":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.int64({default:void 0,example:void 0})});case"STRING":case"UUID":case"BIG_INTEGER":return Al.primitive({nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,schema:ap.string({default:void 0,pattern:void 0,maxLength:void 0,minLength:void 0,example:void 0,format:void 0})});default:So(d.v1)}},unknown:()=>Al.unknown({nameOverride:t,generatedName:r,title:i,example:void 0,description:n,availability:a,namespace:u,groupName:l}),map:({keyType:d,valueType:s})=>d?.type==="primitive"&&s!=null?Al.map({nameOverride:t,generatedName:r,title:i,key:d,value:s,description:n,availability:a,namespace:u,groupName:l,encoding:void 0,example:void 0,inline:void 0}):void 0,list:d=>d!=null?Al.array({nameOverride:t,generatedName:r,title:i,value:d,description:n,availability:a,namespace:u,groupName:l,example:void 0,inline:void 0}):void 0,optional:d=>d!=null?Al.optional({nameOverride:t,generatedName:r,title:i,value:d,description:n,availability:a,namespace:u,groupName:l,inline:void 0}):void 0,nullable:d=>d!=null?Al.nullable({nameOverride:t,generatedName:r,title:i,value:d,description:n,availability:a,namespace:u,groupName:l,inline:void 0}):void 0,set:d=>d!=null?Al.array({nameOverride:t,generatedName:r,title:i,value:d,description:n,availability:a,namespace:u,groupName:l,example:void 0,inline:void 0}):void 0,literal:d=>Al.literal({nameOverride:t,generatedName:r,title:i,value:d._visit({string:s=>Kz.string(s),boolean:s=>Kz.boolean(s),_other:()=>{throw new Error("Unexpected literal type")}}),description:n,availability:a,namespace:u,groupName:l}),named:d=>Al.reference({schema:d,nameOverride:t,generatedName:r,title:i,description:n,availability:a,namespace:u,groupName:l,source:nK.openapi({file:"<memory>"})})}})}function A1_(e){let t=of(e,Kf.SOURCE);if(t!=null)return t.endsWith(".proto")?nK.protobuf({file:t}):nK.openapi({file:t})}function ian(e){if(e!=null&&typeof e=="boolean")return e}function Gd(e){return e.$ref!=null}function q1_({nameOverride:e,generatedName:t,title:r,breadcrumbs:i,additionalProperties:n,description:a,availability:u,wrapAsNullable:l,context:d,namespace:s,groupName:o,example:c,encoding:b,source:g}){return n===void 0&&(n=d.options.additionalPropertiesDefaultsTo),typeof n=="boolean"||MKn(n,d.options)?Cau({nameOverride:e,generatedName:t,title:r,wrapAsNullable:l,description:a,availability:u,keySchema:{nameOverride:void 0,generatedName:`${t}Key`,title:void 0,description:void 0,availability:void 0,schema:ap.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:void 0}),namespace:void 0,groupName:void 0},valueSchema:Al.unknown({nameOverride:void 0,generatedName:`${t}Value`,title:void 0,description:void 0,availability:void 0,example:void 0,namespace:void 0,groupName:void 0}),namespace:s,groupName:o,example:c,encoding:b}):Cau({nameOverride:e,generatedName:t,title:r,wrapAsNullable:l,description:a,availability:u,keySchema:{nameOverride:void 0,generatedName:`${t}Key`,title:void 0,description:void 0,availability:void 0,schema:ap.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:void 0}),namespace:void 0,groupName:void 0},valueSchema:T1_($b(n,d.options.optionalAdditionalProperties?l:!1,d,[...i,"Value"],g,s,void 0,void 0,void 0)),namespace:s,groupName:o,example:c,encoding:b})}function T1_(e){switch(e.type){case"array":case"enum":case"map":case"object":e.inline=!0;break;case"literal":case"primitive":case"reference":case"unknown":break;case"nullable":case"optional":e.inline=!0,e.value=T1_(e.value);break;case"oneOf":e.value.inline=!0;break;default:So(e)}return e}function Cau({nameOverride:e,generatedName:t,title:r,keySchema:i,valueSchema:n,wrapAsNullable:a,description:u,availability:l,namespace:d,groupName:s,example:o,encoding:c}){return a?Al.nullable({nameOverride:e,generatedName:t,title:r,value:Al.map({nameOverride:e,generatedName:t,title:r,description:u,availability:i.availability,key:i,value:n,namespace:d,groupName:s,encoding:c,example:o,inline:void 0}),description:u,availability:l,namespace:d,groupName:s,inline:void 0}):Al.map({nameOverride:e,generatedName:t,title:r,description:u,availability:l,key:i,value:n,namespace:d,groupName:s,encoding:c,example:o,inline:void 0})}function MKn(e,t){return e==null?t.additionalPropertiesDefaultsTo:typeof e=="boolean"?e:!Gd(e)&&Object.keys(e).length===0}function C1_({nameOverride:e,generatedName:t,title:r,breadcrumbs:i,item:n,description:a,availability:u,wrapAsNullable:l,context:d,namespace:s,groupName:o,example:c,source:b}){let g=n==null?Al.unknown({nameOverride:e,generatedName:t,title:r,description:void 0,availability:void 0,example:void 0,namespace:s,groupName:o}):$b(n,!1,d,[...i,"Item"],b,s);return LNE({nameOverride:e,generatedName:t,title:r,namespace:s,groupName:o,itemSchema:g,wrapAsNullable:l,description:a,availability:u,example:c})}function LNE({nameOverride:e,generatedName:t,title:r,itemSchema:i,wrapAsNullable:n,description:a,availability:u,namespace:l,groupName:d,example:s}){return n?Al.nullable({nameOverride:e,generatedName:t,title:r,value:Al.array({nameOverride:e,generatedName:t,title:r,value:i,description:a,availability:u,namespace:l,groupName:d,example:s,inline:void 0}),description:a,availability:u,namespace:l,groupName:d,inline:void 0}):Al.array({nameOverride:e,generatedName:t,title:r,value:i,description:a,availability:u,namespace:l,groupName:d,example:s,inline:void 0})}function sK(e){switch(of(e,Kf.AVAILABILITY)){case"deprecated":return $H.Deprecated;case"beta":return $H.Beta;case"generally-available":return $H.GenerallyAvailable;default:break}if(!Gd(e)&&e.deprecated)return $H.Deprecated}function fSc({nameOverride:e,generatedName:t,title:r,breadcrumbs:i,properties:n,description:a,availability:u,required:l,wrapAsNullable:d,discriminator:s,context:o,namespace:c,groupName:b,encoding:g,source:O}){let m=s.propertyName,w=Object.fromEntries(Object.entries(s.mapping??{}).map(([q,M])=>{let D=tPi({$ref:M},!1,o,[M],g,O,c);return o.markReferencedByDiscriminatedUnion({$ref:M},m,1),[q,D]})),E=Object.entries(n).filter(([q])=>q!==m).map(([q,M])=>{let D=l!=null&&l.includes(q),C=$b(M,!D,o,[...i,q],O,c);return{key:q,schema:C}});return B1_({nameOverride:e,generatedName:t,title:r,wrapAsNullable:d,properties:E,description:a,availability:u,discriminant:m,subtypes:w,namespace:c,groupName:b,source:O})}function dSc({nameOverride:e,generatedName:t,title:r,breadcrumbs:i,properties:n,description:a,availability:u,required:l,wrapAsNullable:d,discriminant:s,variants:o,context:c,namespace:b,groupName:g,encoding:O,source:m}){let w=Object.fromEntries(Object.entries(o).map(([q,M])=>{if(Gd(M)){let D=tPi(M,!1,c,[M.$ref],O,m,b);return c.markReferencedByDiscriminatedUnion(M,s,1),[q,D]}else{let D=AKn(M,!1,c,[...i,q],O,m,b,new Set([s]));return[q,D]}})),E=Object.entries(n).filter(([q])=>q!==s).map(([q,M])=>{let D=l!=null&&l.includes(q),C=$b(M,!D,c,[...i,q],m,b);return{key:q,schema:C}});return B1_({nameOverride:e,generatedName:t,title:r,wrapAsNullable:d,properties:E,description:a,availability:u,discriminant:s,subtypes:w,namespace:b,groupName:g,source:m})}function B1_({nameOverride:e,generatedName:t,title:r,wrapAsNullable:i,properties:n,description:a,availability:u,discriminant:l,subtypes:d,namespace:s,groupName:o,source:c}){return i?Al.nullable({nameOverride:e,generatedName:t,title:r,value:Al.oneOf(aee.discriminated({description:a,availability:u,discriminantProperty:l,nameOverride:e,generatedName:t,title:r,schemas:d,commonProperties:n,namespace:s,groupName:o,encoding:void 0,source:c,inline:void 0})),namespace:s,groupName:o,description:a,availability:u,inline:void 0}):Al.oneOf(aee.discriminated({description:a,availability:u,discriminantProperty:l,nameOverride:e,generatedName:t,title:r,schemas:d,commonProperties:n,namespace:s,groupName:o,encoding:void 0,source:c,inline:void 0}))}function I1_(e){if(e.proto!=null)return KJn.protobuf({typeName:e.proto.type})}function KNi({nameOverride:e,generatedName:t,title:r,fernEnum:i,enumVarNames:n,enumValues:a,_default:u,description:l,availability:d,wrapAsNullable:s,namespace:o,groupName:c,context:b,source:g,inline:O}){let m=VNE(n??[]),w=new Set(a),E=Array.from(w).map((M,D)=>{let C=i?.[M],R=m[D],G=jKn.test(M),I=C?.name??R,L=G?M:wKn(M);return I!=null&&!jKn.test(I)&&(b?.logger.warn(`Enum name override ${I} is not a valid name. Falling back on ${L}.`),I=void 0),{nameOverride:I,generatedName:L,value:M,description:C?.description,availability:d,casing:{snake:C?.casing?.snake??void 0,pascal:C?.casing?.pascal??void 0,screamingSnake:C?.casing?.screamingSnake??void 0,camel:C?.casing?.camel??void 0}}}),q=u!=null?E.find(M=>M.value===u):void 0;return UNE({wrapAsNullable:s,nameOverride:e,generatedName:t,title:r,values:E,_default:q,description:l,availability:d,namespace:o,groupName:c,source:g,inline:O})}function UNE({wrapAsNullable:e,nameOverride:t,generatedName:r,title:i,values:n,_default:a,description:u,availability:l,namespace:d,groupName:s,source:o,inline:c}){return e?Al.nullable({nameOverride:t,generatedName:r,title:i,value:Al.enum({nameOverride:t,generatedName:r,title:i,values:n,description:u,default:a,availability:l,example:void 0,namespace:d,groupName:s,source:o,inline:c}),description:u,availability:l,namespace:d,groupName:s,inline:c}):Al.enum({nameOverride:t,generatedName:r,title:i,values:n,description:u,availability:l,default:a,example:void 0,namespace:d,groupName:s,source:o,inline:c})}function VNE(e){if(e.length<=1||e[0]==null)return e;let t=e[0],r=0;for(;t[r]!=null&&e.every(i=>i[r]===t[r]);)r++;return e.map(i=>i.substring(r))}function z1_({nameOverride:e,generatedName:t,title:r,format:i,_default:n,minimum:a,maximum:u,exclusiveMinimum:l,exclusiveMaximum:d,multipleOf:s,description:o,availability:c,wrapAsNullable:b,example:g,namespace:O,groupName:m}){return i==="int64"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.int64({default:n,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="uint32"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.uint({default:n,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="uint64"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.uint64({default:n,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):G8({nameOverride:e,generatedName:t,title:r,primitive:ap.int({default:n,minimum:a,maximum:u,exclusiveMinimum:l,exclusiveMaximum:d,multipleOf:s,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m})}function R1_(e){return typeof e=="string"?Kz.string(e):typeof e=="boolean"?Kz.boolean(e):Kz.string(`${e}`)}function x1_({nameOverride:e,generatedName:t,title:r,wrapAsNullable:i,value:n,description:a,availability:u,namespace:l,groupName:d}){return i?Al.nullable({nameOverride:e,generatedName:t,title:r,value:Al.literal({nameOverride:e,generatedName:t,title:r,value:R1_(n),description:a,availability:u,namespace:l,groupName:d}),description:a,availability:u,namespace:l,groupName:d,inline:void 0}):Al.literal({nameOverride:e,generatedName:t,title:r,value:R1_(n),description:a,availability:u,namespace:l,groupName:d})}function pSc({nameOverride:e,generatedName:t,title:r,format:i,_default:n,minimum:a,maximum:u,exclusiveMinimum:l,exclusiveMaximum:d,multipleOf:s,description:o,availability:c,wrapAsNullable:b,example:g,namespace:O,groupName:m}){return i==null||i==="double"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.double({default:n,minimum:a,maximum:u,exclusiveMinimum:l,exclusiveMaximum:d,multipleOf:s,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="float"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.float({example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="int32"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.int({default:n,minimum:a,maximum:u,exclusiveMinimum:l,exclusiveMaximum:d,multipleOf:s,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="int64"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.int64({default:n,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="uint32"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.uint({default:n,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="uint64"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.uint64({default:n,example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):i==="time-delta"?G8({nameOverride:e,generatedName:t,title:r,primitive:ap.float({example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m}):G8({nameOverride:e,generatedName:t,title:r,primitive:ap.float({example:g}),wrapAsNullable:b,description:o,availability:c,namespace:O,groupName:m})}var WNE={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="schemas",applyStrategy:e=>{let t=[e[3]??""];return{refUnderProcessing:e.slice(4),newBreadcrumbs:t}}},HNE={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="responses",applyStrategy:e=>{let t=[e[3]??""];return e=e.slice(4),{refUnderProcessing:e.slice(4),newBreadcrumbs:t}}},$NE={isApplicable:e=>e[0]==="#"&&e[1]==="components"&&e[2]==="parameters",applyStrategy:e=>{let t=[e[3]??""];return e=e.slice(4),e[0]==="schema"&&(e=e.slice(1)),{refUnderProcessing:e,newBreadcrumbs:t}}},GNE={isApplicable:e=>e[0]==="properties",applyStrategy:e=>{let t=[e[1]??""];return{refUnderProcessing:e.slice(2),newBreadcrumbs:t}}},QNE={isApplicable:e=>e[0]==="items",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},JNE={isApplicable:e=>e[0]==="allOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},KNE={isApplicable:e=>e[0]==="anyOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})},YNE={isApplicable:e=>e[0]==="oneOf",applyStrategy:e=>({refUnderProcessing:e.slice(1),newBreadcrumbs:[]})};function Bau(e){let t=e.split("/").map(a=>a.replace(/~1/g,"/")),r=[],i=[WNE,HNE,$NE,GNE,QNE,JNE,KNE,YNE],n;do{n=t;for(let a of i)if(a.isApplicable(t)){let{refUnderProcessing:u,newBreadcrumbs:l}=a.applyStrategy(t);t=u,r=[...r,...l]}}while(t.join("")!==n.join(""));return r}function Q8(e,t){let i=e.map(n=>/^[^a-zA-Z0-9]+$/.test(n)?n:qB(S_(n))).join("");return/^\d/.test(i)?V5a(i)??i:i}function _Sc(e){let t=e.join("_");return S_(t)}function iA(e){switch(e.type){case"object":return cv.object({allOf:e.allOf,properties:e.properties.map(t=>ZNE(t)),allOfPropertyConflicts:e.allOfPropertyConflicts,description:e.description,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,additionalProperties:e.additionalProperties,availability:e.availability,source:e.source,inline:e.inline});case"array":return cv.array({description:e.description,availability:e.availability,value:iA(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"enum":return cv.enum({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,values:e.values,default:e.default,namespace:e.namespace,groupName:e.groupName,source:e.source,inline:e.inline});case"literal":return cv.literal({description:e.description,availability:e.availability,value:e.value,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"nullable":return cv.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:iA(e.value),namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"optional":return cv.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:iA(e.value),namespace:e.namespace,groupName:e.groupName,inline:e.inline});case"primitive":return cv.primitive({description:e.description,availability:e.availability,schema:N1_(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"map":return cv.map({description:e.description,availability:e.availability,key:cv.primitive({description:e.key.description,availability:e.key.availability,schema:N1_(e.key.schema),generatedName:e.key.generatedName,title:e.key.title,nameOverride:e.key.nameOverride,namespace:e.namespace,groupName:e.groupName}),value:iA(e.value),generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,inline:e.inline});case"reference":return cv.reference({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schema:e.schema,namespace:e.namespace,groupName:e.groupName,source:e.source});case"oneOf":return cv.oneOf(XNE(e.value));case"unknown":return cv.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName});default:So(e)}}function XNE(e){switch(e.type){case"discriminated":return Xmi.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:iA(t.schema)})),description:e.description,availability:e.availability,discriminantProperty:e.discriminantProperty,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schemas:Object.fromEntries(Object.entries(e.schemas).map(([t,r])=>[t,iA(r)])),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:e.inline});case"undiscriminated":return Xmi.undiscriminated({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schemas:e.schemas.map(t=>iA(t)),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:e.inline});default:So(e)}}function N1_(e){switch(e.type){case"string":return jw.string(e);case"base64":return jw.base64();case"boolean":return jw.boolean(e);case"date":return jw.date();case"datetime":return jw.datetime();case"double":return jw.double(e);case"float":return jw.float();case"int":return jw.int(e);case"int64":return jw.int64(e);case"uint":return jw.uint();case"uint64":return jw.uint64();default:So(e)}}function ZNE(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:iA(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability,readonly:e.readonly,writeonly:e.writeonly}}function Iau(e,t){return fue(iA(e),iA(t))}function F1_({nameOverride:e,generatedName:t,title:r,breadcrumbs:i,properties:n,description:a,required:u,wrapAsNullable:l,allOf:d,context:s,propertiesToExclude:o,namespace:c,groupName:b,fullExamples:g,additionalProperties:O,availability:m,source:w}){let E=[...u??[]],q={...n},M=[],D=[];for(let I of d)if(!s.options.inlineAllOfSchemas&&Gd(I)){let L=s.resolveSchemaReference(I);if(L.discriminator!=null&&L.discriminator.mapping!=null)continue;if(L.oneOf!=null||L.anyOf!=null){let Y=L.oneOf??L.anyOf;if(Y!=null){for(let K of Y){let X=Gd(K)?s.resolveSchemaReference(K):K,oe=$b(X,!1,s.DUMMY,i,w,c);oe.type==="object"&&M.push(...oe.properties.map(pe=>pe.schema.type!=="optional"&&pe.schema.type!=="nullable"?{...pe,schema:Al.optional({nameOverride:void 0,generatedName:"",title:void 0,value:pe.schema,description:void 0,availability:pe.availability,namespace:void 0,groupName:void 0,inline:void 0})}:pe))}continue}}let V=YNi(I);if(V==null)continue;D.push({schemaId:V,convertedSchema:hSc(I,[V],w,s.options.preserveSchemaIds),properties:L1_({schema:I,context:s,breadcrumbs:i,source:w,namespace:c})}),s.markSchemaAsReferencedByNonRequest(V)}else if(Gd(I)){let L=s.resolveSchemaReference(I),V=$b(L,!1,s,i,w,c);V.type==="object"&&M.push(...V.properties)}else{let L=I.required??[];M=M.map(Y=>(Y.schema.type==="optional"||Y.schema.type==="nullable")&&L.includes(Y.key)?{...Y,schema:Y.schema.value}:Y);let V=$b(I,!1,s,i,w,c);V.type==="object"&&M.push(...V.properties)}let C={};for(let I of D)for(let[L,V]of Object.entries(I.properties)){let Y=C[L];Y!=null?(Y.schemaIds.push(I.schemaId),Y.schemas.some(X=>Iau(X,V))||Y.schemas.push(V)):C[L]={schemaIds:[I.schemaId],schemas:[V]}}let R=[];for(let[I,L]of Object.entries(C))L.schemaIds.length>1&&R.push({propertyKey:I,allOfSchemaIds:L.schemaIds,conflictingTypeSignatures:L.schemas.length>1});let G=Object.entries(q).map(([I,L])=>{let V=of(L,Kf.AUDIENCES)??[],Y=sK(L),K=Gd(L)?!1:L.readOnly,X=Gd(L)?!1:L.writeOnly,oe=E.includes(I)&&!K,pe=of(L,Kf.FERN_PROPERTY_NAME),de=[...i,I],me=_Sc(de),Ue=oe?$b(L,!1,s,de,w,c):Al.optional({nameOverride:e,generatedName:me,title:r,description:void 0,availability:Y,value:$b(L,!1,s,de,w,c),namespace:c,groupName:b,inline:void 0}),vt={};for(let De of D){let Te=De.properties[I];Te!=null&&!Iau(Ue,Te)?vt[De.schemaId]={differentSchema:!0}:Te!=null&&(vt[De.schemaId]={differentSchema:!1})}return{key:I,schema:Ue,nameOverride:pe,audiences:V,conflict:vt,generatedName:_Sc([...i,I]),availability:Y,readonly:K,writeonly:X}});return G.push(...M.map(I=>{let L=I.conflict;for(let V of D){let Y=V.properties[I.key];Y!=null&&!Iau(I.schema,Y)?L[V.schemaId]={differentSchema:!0}:Y!=null&&(L[V.schemaId]={differentSchema:!1})}return{...I,conflict:L}})),kNE({nameOverride:e,generatedName:t,title:r,wrapAsNullable:l,properties:G.filter(I=>!o.has(I.key)),description:a,allOf:D.map(I=>I.convertedSchema),allOfPropertyConflicts:R,namespace:c,groupName:b,fullExamples:g,additionalProperties:O,availability:m,source:w,context:s})}function kNE({nameOverride:e,generatedName:t,title:r,wrapAsNullable:i,properties:n,description:a,allOf:u,allOfPropertyConflicts:l,namespace:d,groupName:s,fullExamples:o,additionalProperties:c,availability:b,source:g,context:O}){return i?Al.nullable({nameOverride:e,generatedName:t,title:r,value:Al.object({description:a,properties:n,nameOverride:e,generatedName:t,title:r,allOf:u,allOfPropertyConflicts:l,namespace:d,groupName:s,fullExamples:o,additionalProperties:MKn(c,O.options),availability:void 0,source:g,inline:void 0}),description:a,availability:b,namespace:d,groupName:s,inline:void 0}):Al.object({description:a,properties:n,nameOverride:e,generatedName:t,title:r,allOf:u,allOfPropertyConflicts:l,namespace:d,groupName:s,fullExamples:o,additionalProperties:MKn(c,O.options),availability:b,source:g,inline:void 0})}function L1_({schema:e,context:t,breadcrumbs:r,source:i,namespace:n}){let a={},[u,l]=Gd(e)?[t.resolveSchemaReference(e),Bau(e.$ref)]:[e,r];for(let d of u.allOf??[])a={...a,...L1_({schema:d,context:t,breadcrumbs:l,source:i,namespace:n})};for(let[d,s]of Object.entries(u.properties??{})){let o=$b(s,!1,t,[...l,d],i,n);a[d]=o}return a}function XNi({nameOverride:e,generatedName:t,title:r,breadcrumbs:i,description:n,availability:a,wrapAsNullable:u,context:l,subtypes:d,namespace:s,groupName:o,encoding:c,source:b,subtypePrefixOverrides:g}){let O=rFE({schemas:d}),m=d.flatMap((E,q)=>{if(!Gd(E)&&E.enum!=null&&l.options.coerceEnumsToLiterals&&E.type==="string")return E.enum.map(D=>Al.literal({nameOverride:void 0,generatedName:Q8([t,D],l.options.preserveSchemaIds),title:void 0,value:Kz.string(String(D)),namespace:s,groupName:void 0,description:void 0,availability:D.availability}));let M=O[q];if(g!=null){let D=g[q];D!=null&&"name"in D&&(M=D.name)}return[$b(E,!1,l,[...i,M??`${q}`],b,s)]}),w=eFE(m);return tFE({uniqueSubtypes:w,nameOverride:e,generatedName:t,title:r,wrapAsNullable:u,description:n,availability:a,namespace:s,groupName:o,context:l,encoding:c,source:b})}function eFE(e){let t=[];for(let r=0;r<e.length;++r){let i=e[r],n=!1;for(let a=r+1;a<e.length;++a){let u=e[a];if(i!=null&&u!=null&&fue(i,u)){n=!0;break}}i!=null&&!n&&t.push(i)}return t}function tFE({uniqueSubtypes:e,nameOverride:t,generatedName:r,title:i,wrapAsNullable:n,description:a,availability:u,namespace:l,groupName:d,context:s,encoding:o,source:c}){if(Object.entries(e).every(([g,O])=>O.type==="literal")){let g={},O=[];return Object.entries(e).forEach(([m,w])=>{w.type==="literal"&&w.value.type==="string"&&(O.push(w.value.value),w.description!=null&&(g[w.value.value]={description:w.description}))}),KNi({nameOverride:t,generatedName:r,title:i,wrapAsNullable:n,description:a,availability:u,fernEnum:g,enumVarNames:void 0,enumValues:O,_default:void 0,namespace:l,groupName:d,context:s,source:c,inline:void 0})}return e.length===1&&e[0]!=null&&!s.options.preserveSingleSchemaOneOf?e[0]:U1_({nameOverride:t,generatedName:r,title:i,wrapAsNullable:n,description:a,availability:u,subtypes:e,namespace:l,groupName:d,encoding:o,source:c})}function ySc({nameOverride:e,generatedName:t,title:r,description:i,availability:n,wrapAsNullable:a,context:u,namespace:l,groupName:d,discriminator:s,encoding:o,source:c}){let b=Object.entries(s.mapping??{}).map(([m,w],E)=>{let q={$ref:w},M=tPi(q,!1,u,[w],o,c,l);return u.markSchemaWithDiscriminantValue(q,s.propertyName,m),M.type==="object"&&(M.properties={[s.propertyName]:Al.literal({nameOverride:void 0,generatedName:Q8([t,m],u.options.preserveSchemaIds),title:void 0,value:Kz.string(m),namespace:void 0,groupName:void 0,description:void 0,availability:void 0}),...M.properties.filter(D=>D.key!==s.propertyName)}),M}),g=[];for(let m=0;m<b.length;++m){let w=b[m],E=!1;for(let q=m+1;q<b.length;++q){let M=b[q];if(w!=null&&M!=null&&fue(w,M)){E=!0;break}}w!=null&&!E&&g.push(w)}if(Object.entries(g).every(([m,w])=>w.type==="literal")){let m={},w=[];return Object.entries(g).forEach(([E,q])=>{q.type==="literal"&&q.value.type==="string"&&(w.push(q.value.value),q.description!=null&&(m[q.value.value]={description:q.description}))}),KNi({nameOverride:e,generatedName:t,title:r,wrapAsNullable:a,description:i,availability:n,fernEnum:m,enumVarNames:void 0,enumValues:w,_default:void 0,namespace:l,groupName:d,context:u,source:c,inline:void 0})}return g.length===1&&g[0]!=null&&!u.options.preserveSingleSchemaOneOf?g[0]:U1_({nameOverride:e,generatedName:t,title:r,wrapAsNullable:a,description:i,availability:n,subtypes:g,namespace:l,groupName:d,encoding:o,source:c})}function rFE({schemas:e}){let t={},r=0;for(let a of e){if(!Gd(a)){if(a.properties!=null&&Object.entries(a.properties).length>0){let u=Object.keys(a.properties),l={},d=u;for(let[s,o]of Object.entries(t)){let c=xAo(o,u);d=xAo(d,o),l[s]=c}l[r]=d,t=l}}r++}let i=[],n=0;for(let a of e){let u=t[n];if(u!=null&&u.length>0){let l=u.sort();if(l[0]!=null){i.push(l[0]),++n;continue}}Gd(a)?i.push($Ni(n)??`${n}`):a.type==="array"||a.type==="boolean"||a.type==="integer"||a.type==="number"||a.type==="string"?i.push(""):i.push($Ni(n)??`${n}`),++n}return i}function U1_({nameOverride:e,generatedName:t,title:r,wrapAsNullable:i,description:n,availability:a,subtypes:u,namespace:l,groupName:d,encoding:s,source:o}){return i?Al.nullable({nameOverride:e,generatedName:t,title:r,value:Al.oneOf(aee.undiscriminated({description:n,availability:a,nameOverride:e,generatedName:t,title:r,schemas:u,namespace:l,groupName:d,encoding:s,source:o,inline:void 0})),description:n,availability:a,namespace:l,groupName:d,inline:void 0}):Al.oneOf(aee.undiscriminated({description:n,availability:a,nameOverride:e,generatedName:t,title:r,schemas:u,namespace:l,groupName:d,encoding:s,source:o,inline:void 0}))}function qKn(e){if(e.default!=null&&typeof e.default=="string")return e.default}function zau({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="number")return e.example;let i=ran(e);for(let n of i??[])if(typeof n=="number")return n;if(r&&typeof r=="number")return r}function V1_({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="boolean")return e.example;let i=ran(e);for(let n of i??[])if(typeof n=="boolean")return n;if(r&&typeof r=="boolean")return r}function Sor({schema:e,logger:t,fallback:r}){if(e.example!=null&&typeof e.example=="string")return e.example;let i=ran(e);for(let n of i??[])if(typeof n=="string")return n;if(r&&typeof r=="string")return r}function W1_({schema:e,logger:t,fallback:r}){if(e.example!=null&&Array.isArray(e.example))return e.example;let i=ran(e);for(let n of i??[])if(Array.isArray(n))return n;if(r&&Array.isArray(r))return r}var nan="#/components/schemas/";function $b(e,t,r,i,n,a,u=!1,l=new Set,d){let s=A1_(e)??n,o=lFE({schema:e,logger:r.logger});if(Gd(e)){let c=YNi(e);return c!=null?(u?r.markSchemaAsReferencedByRequest(c):r.markSchemaAsReferencedByNonRequest(c),tPi(e,t,r,i,o,s,a)):AKn(r.resolveSchemaReference(e),t,r,Bau(e.$ref),o,s,a,l,u,d)}return AKn(e,t,r,i,o,s,a,l,u,d)}function tPi(e,t,r,i,n,a,u){let l=e.$ref.includes("properties")?AKn(r.resolveSchemaReference(e),t,r,i,n,a,u,new Set):Al.reference(hSc(e,i,a,r.options.preserveSchemaIds));return t?Al.nullable({title:void 0,nameOverride:void 0,generatedName:Q8(i,r.options.preserveSchemaIds),value:l,description:void 0,availability:void 0,namespace:void 0,groupName:void 0,inline:void 0}):l}function iFE(e){if(e!=null&&!e.includes(" ")&&/^[a-zA-Z]+$/.test(e))return e}function AKn(e,t,r,i,n,a,u,l=new Set,d=!1,s){typeof e=="string"&&(e={type:e});let o=of(e,Kf.TYPE_NAME)??(r.options.useTitlesAsName?iFE(e.title):void 0),c=of(e,Kf.SDK_GROUP_NAME)??of(e,JH.TAGS)?.[0],b=(typeof c=="string"?[c]:c)??[];b=r.resolveGroupName(b);let g=Q8(i,r.options.preserveSchemaIds),O=e.title,m=e.description,w=sK(e),E=[];e.example!=null&&E.push({name:void 0,value:e.example,description:void 0});let q=of(e,JH.EXAMPLES);q!=null&&Object.keys(q).length>0&&E.push(...Object.entries(q).map(([C,R])=>({name:R?.summary??C,value:R.value,description:R.description})));let M=ran(e);M!=null&&Object.keys(M).length>0&&E.push(...M.map(C=>({name:void 0,value:C,description:void 0})));let D=M1_({schema:e,description:m,title:O,nameOverride:o,generatedName:g,availability:w});if(D!=null)return D;if(Array.isArray(e.type)){let C=e.type.indexOf("null"),R=C!==-1;if(e.type.length===1)e.type=e.type[0];else if(e.type.length===2&&R)e.type.splice(C,1),e.type=e.type[0],e.nullable=!0;else if(R&&(e.type.splice(C,1),e.nullable=!0),e.oneOf==null)e.oneOf=[...new Set(e.type)];else{let G=new Set([...e.oneOf,...e.type]);e.oneOf=[...G]}}if(!t&&e.nullable===!0)return AKn(e,!0,r,i,n,a,u,l,d,s);if("const"in e&&(e.enum=[e.const]),e.enum!=null&&(e.type==="string"||e.type==null||e.type==="enum")){if(!Nau(e.enum))return G8({nameOverride:o,generatedName:g,title:O,primitive:ap.string({default:qKn(e),minLength:e.minLength,maxLength:e.maxLength,pattern:e.pattern,format:e.format,example:Sor({schema:e,logger:r.logger,fallback:s})}),namespace:u,groupName:b,wrapAsNullable:t,description:m,availability:w});let C=E1_(e);return e.enum.length===1&&e.enum[0]!=null&&C==null?x1_({nameOverride:o,generatedName:g,title:O,wrapAsNullable:t,value:e.enum[0],description:m,availability:w,namespace:u,groupName:b}):KNi({nameOverride:o,generatedName:g,title:O,fernEnum:C,enumVarNames:of(e,[JH.ENUM_VAR_NAMES]),enumValues:e.enum,_default:e.default,description:m,availability:w,wrapAsNullable:t,namespace:u,groupName:b,context:r,source:a,inline:void 0})}if(Nau(e.type)&&e.type.length>1){let C=e.type.includes("null"),R=e.type.filter(G=>G!=="null").map(G=>({type:G,nullable:C}));return XNi({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,description:m,availability:w,wrapAsNullable:t,context:r,subtypes:R,namespace:u,groupName:b,encoding:n,source:a})}if(e.type==="boolean"){let C=of(e,Kf.BOOLEAN_LITERAL);return C!=null?H1_({nameOverride:o,generatedName:g,title:O,literal:Kz.boolean(C),wrapAsNullable:t,description:m,availability:w,namespace:u,groupName:b}):G8({nameOverride:o,generatedName:g,title:O,primitive:ap.boolean({default:nFE(e.default),example:V1_({schema:e,logger:r.logger,fallback:s})}),wrapAsNullable:t,description:m,availability:w,namespace:u,groupName:b})}if(e.type==="number")return pSc({nameOverride:o,generatedName:g,title:O,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:ian(e.exclusiveMinimum),exclusiveMaximum:ian(e.exclusiveMaximum),multipleOf:e.multipleOf,description:m,availability:w,wrapAsNullable:t,example:zau({schema:e,logger:r.logger,fallback:s}),namespace:u,groupName:b});if(e.type==="integer")return z1_({nameOverride:o,generatedName:g,title:O,format:e.format,_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:ian(e.exclusiveMinimum),exclusiveMaximum:ian(e.exclusiveMaximum),multipleOf:e.multipleOf,description:m,availability:w,wrapAsNullable:t,example:zau({schema:e,logger:r.logger,fallback:s}),namespace:u,groupName:b});if(e.type==="float")return pSc({nameOverride:o,generatedName:g,title:O,format:"float",_default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:ian(e.exclusiveMinimum),exclusiveMaximum:ian(e.exclusiveMaximum),multipleOf:e.multipleOf,description:m,availability:w,wrapAsNullable:t,example:zau({schema:e,logger:r.logger,fallback:s}),namespace:u,groupName:b});if(e.type==="string"){if(e.format==="date-time")return G8({nameOverride:o,generatedName:g,title:O,primitive:ap.datetime({example:Sor({schema:e,logger:r.logger,fallback:s})}),wrapAsNullable:t,description:m,availability:w,namespace:u,groupName:b});if(e.format==="date"&&r.options.typeDatesAsStrings===!1)return G8({nameOverride:o,generatedName:g,title:O,primitive:ap.date({example:Sor({schema:e,logger:r.logger,fallback:s})}),wrapAsNullable:t,description:m,availability:w,namespace:u,groupName:b});if(e.format==="json-string")return Al.unknown({nameOverride:o,generatedName:g,title:O,description:m,availability:w,namespace:u,groupName:b,example:void 0});let C=Q1_(e,"const");return C!=null?H1_({nameOverride:o,generatedName:g,title:O,literal:Kz.string(C),wrapAsNullable:t,description:m,availability:w,namespace:u,groupName:b}):G8({nameOverride:o,generatedName:g,title:O,primitive:ap.string({default:qKn(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:Sor({schema:e,logger:r.logger,fallback:s})}),namespace:u,groupName:b,wrapAsNullable:t,description:m,availability:w})}if(e.type==="array")return C1_({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,item:e.items,description:m,availability:w,wrapAsNullable:t,context:r,namespace:u,groupName:b,example:W1_({schema:e,logger:r.logger,fallback:s}),source:a});if(e.additionalProperties!=null&&e.additionalProperties!==!1&&Rau(e))return q1_({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,additionalProperties:e.additionalProperties,description:m,availability:w,wrapAsNullable:t,context:r,namespace:u,groupName:b,encoding:n,example:e.example,source:a});if(e.oneOf!=null&&e.oneOf.length>0&&of(e,Kf.IS_DISCRIMINATED)===!1)return XNi({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,description:m,availability:w,wrapAsNullable:t,context:r,subtypes:e.oneOf,namespace:u,groupName:b,encoding:n,source:a});if(e.type==="object"&&e.discriminator!=null&&e.discriminator.mapping!=null)return r.options.discriminatedUnionV2?ySc({nameOverride:o,generatedName:g,title:O,description:m,availability:w,wrapAsNullable:t,context:r,namespace:u,groupName:b,discriminator:e.discriminator,encoding:n,source:a}):fSc({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,description:m,availability:w,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsNullable:t,context:r,namespace:u,groupName:b,encoding:n,source:a});if(e.oneOf!=null&&e.oneOf.length>0){let C=of(e,Kf.IS_UNDISCRIMINATED);if(e.discriminator!=null&&e.discriminator.mapping!=null&&Object.keys(e.discriminator.mapping).length>0)return r.options.discriminatedUnionV2||C?ySc({nameOverride:o,generatedName:g,title:O,description:m,availability:w,wrapAsNullable:t,context:r,namespace:u,groupName:b,discriminator:e.discriminator,encoding:n,source:a}):fSc({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,description:m,availability:w,discriminator:e.discriminator,properties:e.properties??{},required:e.required,wrapAsNullable:t,context:r,namespace:u,groupName:b,encoding:n,source:a});if(e.oneOf.length===1&&e.oneOf[0]!=null){if(r.options.preserveSingleSchemaOneOf)return XNi({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,description:m,availability:w,wrapAsNullable:t,context:r,subtypes:e.oneOf.filter(G=>Gd(G)||G.type!=="null"),encoding:n,namespace:u,groupName:b,source:a});let R=$b(e.oneOf[0],t,r,i,a,u,d);return TKn(R,m,u,b)}else if(e.oneOf.length>1){if(e.oneOf.length===2&&e.oneOf[0]!=null&&e.oneOf[1]!=null){let L=e.oneOf[0],V=e.oneOf[1];if(!Gd(L)&&L.type==="null")return $b(V,!0,r,i,a,u);if(!Gd(V)&&V.type==="null")return $b(L,!0,r,i,a,u)}let R=uFE({schemas:e.oneOf});if(R!=null)return KNi({nameOverride:o,generatedName:g,title:O,fernEnum:void 0,enumVarNames:void 0,enumValues:R,_default:e.default,description:m,availability:w,wrapAsNullable:t,namespace:u,groupName:b,context:r,source:a,inline:void 0});let G=$1_({schemas:e.oneOf,context:r});if(G!=null&&!r.options.discriminatedUnionV2&&!C)return dSc({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,properties:e.properties??{},required:e.required,description:m,availability:w,wrapAsNullable:t,discriminant:G.discriminant,variants:G.schemas,context:r,namespace:u,groupName:b,encoding:n,source:a});let I=e.oneOf.filter(L=>!Gd(L)&&L.type==="null").length>0;return XNi({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,description:m,availability:w,wrapAsNullable:t||I,context:r,subtypes:e.oneOf.filter(L=>Gd(L)||L.type!=="null"),encoding:n,namespace:u,groupName:b,source:a})}}if(e.anyOf!=null&&e.anyOf.length>0){if(e.anyOf.length===1&&e.anyOf[0]!=null){let G=$b(e.anyOf[0],t,r,i,a,u,d);return TKn(G,m,u,b)}if(e.anyOf.length===2){let[G,I]=e.anyOf;if(G!=null&&I!=null){if(!Gd(G)&&G.type==="null"){let L=$b(I,!0,r,i,a,u);return TKn(L,m,u,b)}else if(!Gd(I)&&I.type==="null"){let L=$b(G,!0,r,i,a,u);return TKn(L,m,u,b)}}}let C=$1_({schemas:e.anyOf,context:r});if(C!=null&&!r.options.discriminatedUnionV2)return dSc({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,properties:e.properties??{},required:e.required,description:m,availability:w,wrapAsNullable:t,discriminant:C.discriminant,variants:C.schemas,context:r,namespace:u,groupName:b,encoding:n,source:a});let R=e.anyOf.filter(G=>!Gd(G)&&G.type==="null").length>0;return XNi({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,description:m,availability:w,wrapAsNullable:t||R,context:r,subtypes:e.anyOf.filter(G=>Gd(G)||G.type!=="null"),encoding:n,namespace:u,groupName:b,source:a})}if(e.allOf!=null||e.properties!=null){let C=[];for(let G of e.allOf??[])(Gd(G)||Object.keys(G).length>0)&&C.push(G);if((e.properties==null||Rau(e))&&C.length===1&&C[0]!=null){let G=$b(C[0],t,r,i,a,u,d);return TKn(G,m,u,b)}let R=C.filter(G=>{let I=xau(G);return I||r.logger.warn(`Skipping non-object allOf element: ${JSON.stringify(G)}`),I});if((e.properties==null||Rau(e))&&R.length===1&&R[0]!=null){let G=$b(R[0],t,r,i,a,u,d);return TKn(G,m,u,b)}return F1_({nameOverride:o,generatedName:g,title:O,breadcrumbs:i,properties:e.properties??{},description:m,required:e.required,wrapAsNullable:t,allOf:R,context:r,propertiesToExclude:l,namespace:u,groupName:b,fullExamples:E,additionalProperties:e.additionalProperties,availability:w,encoding:n,source:a})}if(e.type==="object"&&aFE(e)&&oFE(e)&&Rau(e))return Cau({nameOverride:o,generatedName:g,title:O,description:m,availability:w,wrapAsNullable:t,keySchema:{nameOverride:void 0,generatedName:`${g}Key`,title:void 0,description:void 0,availability:void 0,schema:ap.string({default:qKn(e),pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:Sor({schema:e,logger:r.logger,fallback:s})}),namespace:u,groupName:b},valueSchema:Al.unknown({nameOverride:void 0,generatedName:`${g}Value`,title:void 0,description:void 0,availability:void 0,example:void 0,namespace:u,groupName:b}),namespace:u,groupName:b,encoding:n,example:e.example});if(e.type==null){let C=e.example??e.default;return Al.unknown({nameOverride:o,generatedName:g,title:O,description:m,availability:w,namespace:u,groupName:b,example:C})}throw new Error(`Failed to convert schema breadcrumbs=${JSON.stringify(i)} value=${JSON.stringify(e)}`)}function nFE(e){if(e!=null){if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase();if(t==="true")return!0;if(t==="false")return!1}}}function YNi(e){if(e.$ref.startsWith(nan))return e.$ref.replace(nan,"")}function hSc(e,t,r,i){let n=of(e,Kf.TYPE_NAME),a=Q8(t,i),u=e.description,l=sK(e),d=YNi(e);if(d==null)throw new Error(`Invalid schema reference ${JSON.stringify(e)}`);return cv.reference({generatedName:a,nameOverride:n,title:void 0,schema:d,description:u??void 0,availability:l,namespace:void 0,groupName:void 0,source:r})}function aFE(e){return e.oneOf==null||e.oneOf.length===0}function oFE(e){return e.allOf==null||e.allOf.length===0}function Rau(e){return e.properties==null||yq(e.properties)===0}function Nau(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function TKn(e,t,r,i){return e.type==="reference"?Al.reference({...e,description:t,availability:e.availability,namespace:r,groupName:i}):e.type==="optional"?Al.optional({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,namespace:r,groupName:i,inline:void 0}):e.type==="nullable"?Al.nullable({nameOverride:e.nameOverride,generatedName:e.generatedName,title:e.title,value:e.value,description:t,availability:e.availability,namespace:r,groupName:i,inline:void 0}):e}function xau(e){return Gd(e)||e.type==="object"||e.properties!=null?!0:e.allOf!=null?e.allOf.every(t=>xau(t)):e.oneOf!=null?e.oneOf.every(t=>xau(t)):e.anyOf!=null?e.anyOf.every(t=>xau(t)):!1}function H1_({literal:e,wrapAsNullable:t,namespace:r,groupName:i,description:n,availability:a,nameOverride:u,generatedName:l,title:d}){return t?Al.nullable({nameOverride:u,generatedName:l,title:d,value:Al.literal({nameOverride:u,generatedName:l,title:d,value:e,description:n,availability:a,namespace:r,groupName:i}),namespace:r,groupName:i,description:n,availability:a,inline:void 0}):Al.literal({nameOverride:u,generatedName:l,title:d,value:e,namespace:r,groupName:i,description:n,availability:a})}function G8({primitive:e,wrapAsNullable:t,namespace:r,groupName:i,description:n,availability:a,generatedName:u,nameOverride:l,title:d}){return i=typeof i=="string"?[i]:i,t?Al.nullable({nameOverride:l,generatedName:u,title:d,value:Al.primitive({nameOverride:l,generatedName:u,title:d,schema:e,description:n,availability:a,namespace:r,groupName:i}),namespace:r,groupName:i,description:n,availability:a,inline:void 0}):Al.primitive({nameOverride:l,generatedName:u,title:d,schema:e,description:n,availability:a,namespace:r,groupName:i})}function uFE({schemas:e}){let t=new Set;for(let r of e){if(Gd(r))return;if(r.enum!=null&&Nau(r.enum))r.enum.forEach(i=>t.add(i));else return}return Array.from(t)}function $1_({schemas:e,context:t}){let r={};for(let i of e){let n=G1_({schema:i,context:t});for(let[a,u]of Object.entries(n)){let l=r[a];l!=null?l[u]=i:r[a]={[u]:i}}}for(let[i,n]of Object.entries(r))if(Object.keys(n).length===e.length)return{discriminant:i,schemas:n}}function G1_({schema:e,context:t}){let r=Gd(e)?t.resolveSchemaReference(e):e;return sFE({schema:r,context:t})}function sFE({schema:e,context:t}){let r={};if(e.anyOf!=null){for(let i of e.anyOf){let n=G1_({schema:i,context:t});for(let[a,u]of Object.entries(n??{}))r[a]=u}return r}for(let[i,n]of Object.entries(e.properties??{})){let a=Gd(n)?t.resolveSchemaReference(n):n;a.type==="string"&&a.enum!=null&&Nau(a.enum)&&cFE(a.enum).length===1&&a.enum[0]!=null&&(r[i]=a.enum[0]);let u=Q1_(a,"const");a.type==="string"&&u!=null&&(r[i]=u),i==="type"&&a.example!=null&&(r[i]=a.example)}return r}function cFE(e){if(!e)return[];let t=new Set;return e.forEach(r=>{typeof r=="string"?t.add(r.toLowerCase()):t.add(r)}),Array.from(t)}function Q1_(e,t){let r=e[t];if(r!=null)return r}function lFE({schema:e,logger:t}){let r=D1_({schema:e,logger:t});if(r!=null)return I1_(r)}var CKn=class{document;taskContext;logger;DUMMY;options;namespace;static MESSAGE_REFERENCE_PREFIX="#/components/messages/";constructor({document:t,taskContext:r,options:i,namespace:n}){this.document=t,this.taskContext=r,this.logger=r.logger,this.DUMMY=this,this.options=i,this.namespace=n}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveTags(t,r){if(this.namespace==null&&t==null&&r!=null)return[r];let i=[];if(this.namespace!=null){let n={type:"namespace",name:this.namespace};i.push(n)}return i.concat(t??[])}resolveSchemaReference(t){if(!t.$ref.startsWith(nan))throw new Error(`Failed to resolve schema reference: ${t.$ref}`);let i=t.$ref.substring(nan.length).split("/"),n=this.document.components;if(n==null||n.schemas==null)throw new Error("Document does not have components.schemas.");let[a,u,l]=i;if(a==null||a==="")throw new Error(`${t.$ref} cannot be resolved. No schema key provided.`);let d=n.schemas[a];if(d==null)throw new Error(`Schema "${a}" is undefined in document.components.schemas.`);if(Gd(d)&&(d=this.resolveSchemaReference(d)),u==="properties"&&l!=null){let s=d.properties?.[l];if(s==null)throw new Error(`Property "${l}" not found on "${a}". Full ref: ${t.$ref}`);Gd(s)?d=this.resolveSchemaReference(s):d=s}return d}referenceExists(t){let r=t.substring(2).split("/").map(n=>n.replace(/~1/g,"/")),i=this.document;for(let n of r){if(typeof i!="object"||i==null)return!1;i=i[n]}return!0}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}markReferencedByDiscriminatedUnion(t,r,i){}markSchemaWithDiscriminantValue(t,r,i){}};var Fau=class extends CKn{getExampleMessageReference(t){return`#/components/messages/${t.messageId}`}resolveMessageReference(t){let r="#/components/messages/",i=this.document.components;if(i==null||i.messages==null||!t.$ref.startsWith(r))throw new Error(`Failed to resolve message reference: ${t.$ref} in v2 components`);let n=t.$ref.substring(r.length),a=i.messages[n];if(a==null)throw new Error(`${t.$ref} is undefined`);return a}};function BKn(e,t){let r={};if(e!=null)return{rootSchemas:r,namespacedSchemas:{[e]:t}};let i={};for(let[n,a]of Object.entries(t))switch(a.type){case"object":case"array":case"map":case"optional":case"enum":case"literal":case"reference":case"nullable":case"primitive":{if(a.namespace==null){r[n]=a;continue}let u=a.namespace;i[u]??={},i[u][n]=a;continue}case"oneOf":case"unknown":r[n]=a;continue;default:So(a)}return{rootSchemas:r,namespacedSchemas:i}}function ZNi(e){if(typeof e=="string")return xg.primitive(h_.string(e));if(typeof e=="number")return Number.isInteger(e)?xg.primitive(h_.int(e)):xg.primitive(h_.double(e));if(typeof e=="boolean")return xg.primitive(h_.boolean(e));if(Array.isArray(e)){let t=e.map(r=>ZNi(r));return t.length===0?void 0:xg.array(t.filter(r=>r!=null))}else if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string")){let t=[];for(let[r,i]of Object.entries(e)){let n=ZNi(i);n!=null&&t.push({key:h_.string(r),value:n})}return xg.map(t)}}function X5a(e){if(e!=null&&typeof e=="object"&&Object.keys(e).every(t=>typeof t=="string"))return e}function J1_(e){if(e!=null&&Array.isArray(e))return e}var kNi=class{schemas;nonRequestReferencedSchemas;context;constructor(t,r,i){this.schemas=t,this.nonRequestReferencedSchemas=r,this.context=i}buildExample({schema:t,exampleId:r,example:i,options:n,skipReadonly:a}){return this.buildExampleHelper({schema:t,visitedSchemaIds:new Set,exampleId:r,example:i,options:{...n,maxCheckerDepth:n.maxCheckerDepth??5},depth:0,skipReadonly:a??!1})}buildExampleHelper({exampleId:t,example:r,schema:i,depth:n,visitedSchemaIds:a,options:u,skipReadonly:l}){switch(i.type){case"enum":return typeof r=="string"&&K1_({schema:i,value:r})?xg.enum(r):i.values[0]!=null?xg.enum(i.values[0]?.value):void 0;case"literal":return xg.literal(i.value);case"nullable":{if(r==null&&!this.hasExample(i.value,0,a,u)&&(u.ignoreOptionals||this.exceedsMaxDepth(n,u)))return;let d=this.buildExampleHelper({schema:i.value,visitedSchemaIds:a,exampleId:t,example:r,depth:n,options:u,skipReadonly:l});return d!=null&&d.type==="array"&&d.value.length===0||d!=null&&d.type==="map"&&d.value.length===0||d!=null&&d.type==="object"&&Object.keys(d.properties).length===0?void 0:d}case"optional":{if(r==null&&!this.hasExample(i.value,0,a,u)&&(u.ignoreOptionals||this.exceedsMaxDepth(n,u))||Object.is(r,null))return;let d=this.buildExampleHelper({schema:i.value,visitedSchemaIds:a,exampleId:t,example:r,depth:n,options:u,skipReadonly:l});return d!=null&&d.type==="array"&&d.value.length===0||d!=null&&d.type==="map"&&d.value.length===0||d!=null&&d.type==="object"&&Object.keys(d.properties).length===0?void 0:d}case"primitive":{let d=this.buildExampleFromPrimitive({schema:i.schema,example:r,options:u});return xg.primitive(d)}case"reference":{let d=this.schemas[i.schema];if(d!=null&&!a.has(i.schema)){a.add(i.schema);let s=d?.type==="object"&&!this.nonRequestReferencedSchemas.has(i.schema),o=this.buildExampleHelper({example:r,schema:d,exampleId:t,visitedSchemaIds:a,depth:n,options:u,skipReadonly:s||this.context.options.respectReadonlySchemas?l:!1});return a.delete(i.schema),o}return}case"oneOf":switch(i.value.type){case"discriminated":{let d={},s={},o={},c=X5a(r),b=c?.[i.value.discriminantProperty],g=i.value.schemas[b],O=[],m=this.getDiscriminatedUnionVariantSchema(i.value,c);m!=null&&O.push(m),O.push(...Object.entries(i.value.schemas));for(let w of O)if(b!=null&&g!=null&&g.type==="object"){s=this.getAllProperties(g),o=this.getAllRequiredProperties(g),d[i.value.discriminantProperty]=xg.primitive(h_.string(b));break}else{let E=this.buildExampleHelper({exampleId:t,schema:w[1],example:void 0,visitedSchemaIds:a,depth:n,options:u,skipReadonly:l});if(E!=null){this.mergeExampleWith(E,d),d[i.value.discriminantProperty]=xg.primitive(h_.string(w[0]));break}}for(let w of i.value.commonProperties){s[w.key]={schema:w.schema,readonly:!1};let E=this.getResolvedSchema(w.schema);E.type!=="optional"&&E.type!=="nullable"&&(o[w.key]=w.schema)}for(let[w,E]of Object.entries(s)){let q=w in o;if(q&&c?.[w]!=null){let M=this.buildExampleHelper({schema:E.schema,exampleId:t,example:c[w],visitedSchemaIds:a,depth:n+1,options:u,skipReadonly:l});if(M!=null)d[w]=M;else return}else{let M=this.buildExampleHelper({exampleId:t,schema:E.schema,example:c?.[w],visitedSchemaIds:a,depth:n+1,options:u,skipReadonly:l});if(M!=null)d[w]=M;else if(q)return}}return xg.oneOf(RNi.discriminated(d))}case"undiscriminated":{let d=this.getUnDiscriminatedUnionVariantSchema(i.value,r);if(d!=null)return this.buildExampleHelper({exampleId:t,example:r,schema:d,visitedSchemaIds:a,depth:n,options:u,skipReadonly:l});break}}return;case"unknown":if(r!=null){let d=ZNi(r);if(d!=null)return xg.unknown(d)}return u.ignoreOptionals||this.exceedsMaxDepth(n,u)?void 0:u.isParameter?xg.primitive(h_.string(u.name??"string")):xg.map([{key:h_.string("key"),value:xg.primitive(h_.string("value"))}]);case"array":{let d=J1_(r),s=[];if(d!=null&&d.length>0)for(let o of d){let c=this.buildExampleHelper({exampleId:t,example:o,schema:i.value,depth:n+1,visitedSchemaIds:a,options:u,skipReadonly:l});c!=null&&s.push(c)}else if(i.example!=null&&i.example.length>0)for(let o of i.example){let c=this.buildExampleHelper({exampleId:t,example:o,schema:i.value,depth:n+1,visitedSchemaIds:a,options:u,skipReadonly:l});c!=null&&s.push(c)}else{let o=this.buildExampleHelper({exampleId:t,example:void 0,schema:i.value,depth:n+1,visitedSchemaIds:a,options:u,skipReadonly:l});o!=null&&s.push(o)}return xg.array(s)}case"map":{let d=X5a(r??i.example);if(d!=null&&Object.entries(d).length>0){let c=[];for(let[b,g]of Object.entries(d)){let O=this.buildExampleFromPrimitive({schema:i.key.schema,example:b,options:u}),m=this.buildExampleHelper({exampleId:t,example:g,schema:i.value,visitedSchemaIds:a,depth:n+1,options:u,skipReadonly:l});m!=null&&c.push({key:O,value:m})}return xg.map(c)}if(i.key.schema.type==="string"&&i.value.type==="unknown")return xg.map([{key:h_.string("key"),value:xg.unknown(xg.primitive(h_.string("value")))}]);let s=this.buildExampleFromPrimitive({schema:i.key.schema,example:void 0,options:{...u,name:"key"}}),o=this.buildExampleHelper({exampleId:t,example:void 0,schema:i.value,visitedSchemaIds:a,depth:n+1,options:{...u,name:"value"},skipReadonly:l});return o!=null?xg.map([{key:s,value:o}]):xg.map([])}case"object":{let d={},s=i.fullExamples?.find(g=>g.name===t)??i.fullExamples?.find(g=>g.name==null)??i.fullExamples?.[0],o=X5a(r)??(s!=null?X5a(s.value):{})??{},c=this.getAllProperties(i),b=this.getAllRequiredProperties(i);for(let[g,O]of Object.entries(c)){if(l&&O.readonly||O.schema._visit({optional:q=>typeof q.availability=="string"&&q.availability==="Deprecated",primitive:()=>!1,object:()=>!1,array:()=>!1,map:()=>!1,enum:()=>!1,reference:()=>!1,literal:()=>!1,oneOf:()=>!1,nullable:()=>!1,unknown:()=>!1,_other:()=>!1}))continue;let m=g in b,w=Object.keys(o).includes(g),E=this.buildExampleHelper({schema:O.schema,exampleId:t,example:o[g],visitedSchemaIds:a,depth:n+1,options:{...u,name:g},skipReadonly:l});if(m&&E!=null)d[g]=E;else{if(m)return;(w&&E!=null||!u.ignoreOptionals&&E!=null)&&(d[g]=E)}}if(i.additionalProperties){for(let[g,O]of Object.entries(o))if(!(g in d)){let m=this.buildExampleHelper({schema:Al.unknown({example:O,title:void 0,availability:void 0,description:void 0,generatedName:"",nameOverride:void 0,namespace:void 0,groupName:void 0}),exampleId:t,example:O,visitedSchemaIds:a,depth:n+1,options:{...u,name:g},skipReadonly:l});m!=null&&(d[g]=m)}}return xg.object({properties:d})}default:So(i)}}mergeExampleWith(t,r){t._visit({array:$o,enum:$o,literal:$o,map:i=>{for(let n of i){let a=n.key;a.type==="string"&&(r[a.value]=n.value)}},object:i=>{for(let[n,a]of Object.entries(i.properties))r[n]=a},oneOf:i=>{if(i.type==="discriminated")for(let[n,a]of Object.entries(i.value))r[n]=a;else this.mergeExampleWith(i.value,r)},primitive:$o,unknown:$o,_other:$o})}getObjectSchema(t){if(t.type==="object")return t;if(t.type==="reference"){let r=this.schemas[t.schema];if(r!=null)return this.getObjectSchema(r)}}getDiscriminatedUnionVariantSchema(t,r){let i=r?.[t.discriminantProperty];if(i==null||typeof i!="string")return Object.entries(t.schemas)[0];let n=t.schemas[i];return n==null?Object.entries(t.schemas)[0]:[i,n]}getUnDiscriminatedUnionVariantSchema(t,r){return r==null?t.schemas[0]:t.schemas.map(a=>({schema:a,heuristic:this.calcExampleHeuristic(a,r)})).sort((a,u)=>u.heuristic-a.heuristic)[0]?.schema}calcExampleHeuristic(t,r){switch(t.type){case"literal":return t.value.value===r?5:0;case"enum":return K1_({schema:t,value:r})?5:0;case"object":{if(!vw(r))return 0;let i=this.getAllProperties(t),n=0;for(let[a,u]of Object.entries(i))r[a]!=null?(n++,n+=this.calcExampleHeuristic(u.schema,r[a])):n--;return n}case"array":{if(!Array.isArray(r))return 0;let i=0;for(let n of r)i+=this.calcExampleHeuristic(t.value,n);return i}case"map":{if(!vw(r))return 0;let i=0;for(let[,n]of Object.entries(r))i+=this.calcExampleHeuristic(t.value,n);return i}case"nullable":case"optional":return this.calcExampleHeuristic(t.value,r);case"reference":{let i=this.getResolvedSchema(t);return i==null?0:this.calcExampleHeuristic(i,r)}case"oneOf":return Object.values(t.value.schemas).map(n=>this.calcExampleHeuristic(n,r)).sort((n,a)=>a-n)[0]??0;case"primitive":return r==null?0:t.schema._visit({int:()=>typeof r=="number",int64:()=>typeof r=="number",uint:()=>typeof r=="number",uint64:()=>typeof r=="number",float:()=>typeof r=="number",double:()=>typeof r=="number",string:()=>typeof r=="string",datetime:()=>typeof r=="string",date:()=>typeof r=="string",base64:()=>typeof r=="string",boolean:()=>typeof r=="boolean",_other:()=>!0})?1:-1;default:return 0}}hasExample(t,r,i=new Set,n){if(this.exceedsMaxCheckerDepth(r,n))return!1;switch(t.type){case"array":return this.hasExample(t.value,r+1,i,n);case"enum":return t.example!=null;case"literal":return!1;case"map":return t.example!=null||t.key.schema.example!=null&&this.hasExample(t.value,r+1,i,n);case"object":{if(t.fullExamples!=null&&t.fullExamples.length>0)return!0;for(let u of t.properties)if(this.hasExample(u.schema,r+1,i,n))return!0;return!1}case"primitive":return t.schema.example!=null;case"reference":{let a=this.schemas[t.schema];if(a!=null&&!i.has(t.schema)){i.add(t.schema);let u=this.hasExample(a,r,i,n);return i.delete(t.schema),u}return!1}case"unknown":return t.example!=null;case"oneOf":return Object.values(t.value.schemas).some(a=>this.hasExample(a,r,i,n));default:return!1}}exceedsMaxCheckerDepth(t,r){return t>(r.maxCheckerDepth??0)}exceedsMaxDepth(t,r){return t>(r.maxDepth??0)}getAllProperties(t){let r={};for(let i of t.properties)r[i.key]={schema:i.schema,readonly:i.readonly??!1};for(let i of t.allOf){let n=this.schemas[i.schema];if(n==null)continue;let a=this.getResolvedSchema(n);a.type==="object"&&(r={...this.getAllProperties(a),...r})}return r}getAllRequiredProperties(t){let r={};for(let i of t.properties){let n=this.getResolvedSchema(i.schema);n.type!=="optional"&&n.type!=="nullable"&&(r[i.key]=i.schema)}for(let i of t.allOf){let n=this.schemas[i.schema];if(n==null)continue;let a=this.getResolvedSchema(n);a.type==="object"&&(r={...this.getAllRequiredProperties(a),...r})}return r}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}buildExampleFromPrimitive({example:t,schema:r,options:i}){switch(r.type){case"string":return t!=null&&typeof t=="string"?h_.string(t):r.example!=null?h_.string(r.example):h_.string(i.name??Ch.STRING);case"base64":return t!=null&&typeof t=="string"?h_.base64(t):r.example!=null?h_.base64(r.example):h_.base64(Ch.BASE64);case"boolean":return t!=null&&typeof t=="boolean"?h_.boolean(t):r.example!=null?h_.boolean(r.example):h_.boolean(Ch.BOOLEAN);case"date":return t!=null&&typeof t=="string"?h_.date(t):r.example!=null?h_.date(r.example):h_.date(Ch.DATE);case"datetime":return t!=null&&typeof t=="string"?h_.datetime(t):r.example!=null?h_.datetime(r.example):h_.datetime(Ch.DATE_TIME);case"double":return t!=null&&typeof t=="number"?h_.double(t):r.example!=null?h_.double(r.example):h_.double(Ch.DOUBLE);case"float":return t!=null&&typeof t=="number"?h_.float(t):r.example!=null?h_.float(r.example):h_.float(Ch.FLOAT);case"int":return t!=null&&typeof t=="number"?h_.int(t):r.example!=null?h_.int(r.example):h_.int(Ch.INT);case"int64":return t!=null&&typeof t=="number"?h_.int64(t):r.example!=null?h_.int64(r.example):h_.int64(Ch.INT64);case"uint":return t!=null&&typeof t=="number"?h_.uint(t):r.example!=null?h_.uint(r.example):h_.uint(Ch.UINT);case"uint64":return t!=null&&typeof t=="number"?h_.uint64(t):r.example!=null?h_.uint64(r.example):h_.uint64(Ch.UINT64);default:So(r)}}};function K1_({schema:e,value:t}){return e.values.map(r=>r.value).includes(t)}function OQt(e){switch(e.type){case"object":return Al.object({allOf:e.allOf,properties:e.properties.map(t=>dFE(t)),allOfPropertyConflicts:e.allOfPropertyConflicts,description:e.description,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName,fullExamples:void 0,additionalProperties:e.additionalProperties,availability:e.availability,source:e.source,inline:void 0});case"array":return Al.array({description:e.description,availability:e.availability,value:OQt(e.value),generatedName:e.generatedName,title:e.title,namespace:e.namespace,nameOverride:e.nameOverride,groupName:e.groupName,example:void 0,inline:void 0});case"enum":return Al.enum({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,values:e.values,default:e.default,namespace:e.namespace,groupName:e.groupName,example:void 0,source:e.source,inline:void 0});case"literal":return Al.literal({description:e.description,availability:e.availability,value:e.value,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,namespace:e.namespace,groupName:e.groupName});case"nullable":return Al.nullable({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:OQt(e.value),namespace:e.namespace,groupName:e.groupName,inline:void 0});case"optional":return Al.optional({generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,description:e.description,availability:e.availability,value:OQt(e.value),namespace:e.namespace,groupName:e.groupName,inline:void 0});case"primitive":return Al.primitive({description:e.description,availability:e.availability,schema:Y1_(e.schema),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName});case"map":return Al.map({description:e.description,availability:e.availability,key:Al.primitive({description:e.key.description,availability:e.key.availability,schema:Y1_(e.key.schema),generatedName:e.key.generatedName,nameOverride:e.key.nameOverride,title:e.key.title,namespace:e.namespace,groupName:e.groupName}),value:OQt(e.value),generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,example:void 0,inline:void 0});case"reference":return Al.reference({description:e.description,availability:e.availability,generatedName:e.generatedName,title:e.title,nameOverride:e.nameOverride,schema:e.schema,namespace:e.namespace,groupName:e.groupName,source:e.source});case"oneOf":return Al.oneOf(fFE(e.value));case"unknown":return Al.unknown({nameOverride:e.nameOverride,generatedName:e.generatedName,title:void 0,example:void 0,namespace:void 0,groupName:void 0,description:void 0,availability:void 0});default:So(e)}}function fFE(e){switch(e.type){case"discriminated":return aee.discriminated({commonProperties:e.commonProperties.map(t=>({key:t.key,schema:OQt(t.schema)})),description:e.description,availability:e.availability,discriminantProperty:e.discriminantProperty,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:Object.fromEntries(Object.entries(e.schemas).map(([t,r])=>[t,OQt(r)])),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:void 0});case"undiscriminated":return aee.undiscriminated({description:e.description,availability:e.availability,generatedName:e.generatedName,nameOverride:e.nameOverride,title:e.title,schemas:e.schemas.map(t=>OQt(t)),namespace:e.namespace,groupName:e.groupName,encoding:e.encoding,source:e.source,inline:void 0});default:So(e)}}function Y1_(e){switch(e.type){case"string":return ap.string({default:e.default,pattern:e.pattern,format:e.format,minLength:e.minLength,maxLength:e.maxLength,example:void 0});case"base64":return ap.base64({example:void 0});case"boolean":return ap.boolean({default:e.default,example:void 0});case"date":return ap.date({example:void 0});case"datetime":return ap.datetime({example:void 0});case"double":return ap.double({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"float":return ap.float({example:void 0});case"int":return ap.int({default:e.default,minimum:e.minimum,maximum:e.maximum,exclusiveMinimum:e.exclusiveMinimum,exclusiveMaximum:e.exclusiveMaximum,multipleOf:e.multipleOf,example:void 0});case"int64":return ap.int64({default:e.default,example:void 0});case"uint":return ap.uint({default:void 0,example:void 0});case"uint64":return ap.uint64({default:void 0,example:void 0});default:So(e)}}function dFE(e){return{conflict:e.conflict,generatedName:e.generatedName,key:e.key,schema:OQt(e.schema),audiences:e.audiences,nameOverride:e.nameOverride,availability:e.availability,readonly:e.readonly,writeonly:e.writeonly}}function Lau(e){return e.type!=="optional"&&e.type!=="nullable"}function vSc(e){return e==="POST"||e==="PUT"||e==="PATCH"}function Z5a(e){if(e.type==="full")return e.request==null&&e.response==null&&e.queryParameters==null&&e.pathParameters==null&&e.headers==null;{let t=e.value;return t.request==null&&t.response==null&&t["query-parameters"]==null&&t["path-parameters"]==null&&t.headers==null}}var Uau=class{schemas;context;globalHeaders;exampleTypeFactory;logger;constructor(t,r,i){this.schemas=t,this.context=r,this.globalHeaders=i,this.schemas=t,this.exampleTypeFactory=new kNi(t,r.nonRequestReferencedSchemas,r),this.logger=r.logger}buildEndpointExample(t){this.logger.debug(`Building endpoint example for ${t.method.toUpperCase()} ${t.path}`);let r=_FE(t.request),i=hFE(t.response);if(r?.type==="unsupported"||i?.type==="unsupported")return[];let n=[];if(r!=null&&r.type==="present"){let c=this.isSchemaRequired(r.schema);if(r.examples.length===0){let b=this.exampleTypeFactory.buildExample({skipReadonly:vSc(t.method),schema:r.schema,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});b!=null&&n.push([void 0,b])}else for(let{name:b,value:g}of r.examples){let O=this.exampleTypeFactory.buildExample({skipReadonly:vSc(t.method),schema:r.schema,exampleId:b,example:g,options:{isParameter:!1,ignoreOptionals:!0}});O!=null&&n.push([b,O])}if(c&&n.length===0)return this.logger.trace(`Failed to generate required request example for ${t.method.toUpperCase()} ${t.path}`),[]}let a=[];if(i!=null&&i.type==="present"){let c=this.isSchemaRequired(i.schema);if(i.examples.length===0){let b=this.exampleTypeFactory.buildExample({skipReadonly:!1,schema:i.schema,exampleId:void 0,example:void 0,options:{maxDepth:this.context.options.exampleGeneration?.response?.["max-depth"]??3,isParameter:!1,ignoreOptionals:!1}});b!=null&&(t.response?.type==="json"?a.push([void 0,vQt.withoutStreaming(b)]):(t.response?.type==="streamingJson"||t.response?.type==="streamingSse")&&a.push([void 0,vQt.withStreaming({sse:t.response?.type==="streamingSse",events:[b]})]))}else for(let{name:b,value:g}of i.examples){let O=this.exampleTypeFactory.buildExample({skipReadonly:!1,schema:i.schema,exampleId:b,example:g,options:{maxDepth:this.context.options.exampleGeneration?.response?.["max-depth"]??3,isParameter:!1,ignoreOptionals:!1}});O!=null&&(t.response?.type==="json"?a.push([b,vQt.withoutStreaming(O)]):(t.response?.type==="streamingJson"||t.response?.type==="streamingSse")&&a.push([void 0,vQt.withStreaming({sse:t.response?.type==="streamingSse",events:[O]})]))}if(c&&a.length===0)return this.logger.trace(`Failed to generate required response example for ${t.method.toUpperCase()} ${t.path}`),[]}let u=[];for(let c of t.pathParameters){let b=this.isSchemaRequired(c.schema),g=this.exampleTypeFactory.buildExample({schema:c.schema,exampleId:void 0,example:void 0,options:{name:c.name,isParameter:!0,ignoreOptionals:!0}});if(g!=null&&!mQt(g)&&(this.logger.warn(`Expected a primitive example but got ${g.type} for path parameter ${c.name} for ${t.method.toUpperCase()} ${t.path}`),g=void 0),b&&g==null)return[];g!=null&&u.push({name:c.name,parameterNameOverride:c.parameterNameOverride,value:g})}let l=[];for(let c of t.queryParameters){let b=this.isSchemaRequired(c.schema),g=this.exampleTypeFactory.buildExample({schema:c.schema,exampleId:void 0,example:void 0,options:{name:c.name,isParameter:!0,ignoreOptionals:!0}});if(g!=null&&!mQt(g)&&(this.logger.warn(`Expected a primitive example but got ${g.type} for query parameter ${c.name} for ${t.method.toUpperCase()} ${t.path}`),g=void 0),b&&g==null)return[];g!=null&&l.push({name:c.name,value:g})}let d=[];for(let c of t.headers){let b=this.isSchemaRequired(c.schema),g=this.exampleTypeFactory.buildExample({schema:c.schema,exampleId:void 0,example:void 0,options:{name:c.name,isParameter:!0,ignoreOptionals:!0}});if(g!=null&&!mQt(g)&&(this.logger.warn(`Expected a primitive example but got ${g.type} for header ${c.name} for ${t.method.toUpperCase()} ${t.path}`),g=void 0),b&&g==null)return[];g!=null&&d.push({name:c.name,value:g})}for(let c of this.globalHeaders){let b=c.schema!=null?OQt(c.schema):Al.primitive({nameOverride:void 0,generatedName:"",title:void 0,description:void 0,availability:void 0,namespace:void 0,groupName:void 0,schema:ap.string({default:void 0,pattern:void 0,maxLength:void 0,minLength:void 0,example:void 0,format:void 0})}),g=this.exampleTypeFactory.buildExample({schema:b,exampleId:void 0,example:void 0,options:{name:c.header,isParameter:!0,ignoreOptionals:!0}});if(g!=null&&!mQt(g)&&(this.logger.warn(`Expected a primitive example but got ${g.type} for global header ${c.header} for ${t.method.toUpperCase()} ${t.path}`),g=void 0),g==null)return[];g!=null&&d.push({name:c.header,value:g})}let s=[];t.request!=null&&t.response!=null?s=pFE(n,a):t.request!=null?s=n.map(([c,b])=>({id:c,request:b,response:void 0})):t.response!=null&&(s=a.map(([c,b])=>({id:c,request:void 0,response:b})));let o=t.examples.filter(c=>Z5a(c)).flatMap(c=>{if(c.type==="unknown"){if(c.value!=null){let b=c.value["code-samples"];if(b!=null)return this.convertCodeSamples(b)}return}else return c.codeSamples}).filter(c=>iv(c));return s.length===0?[yQt.full({name:void 0,description:void 0,pathParameters:u,queryParameters:l,headers:d,request:void 0,response:void 0,codeSamples:o})]:s.map(({id:c,request:b,response:g})=>yQt.full({name:c,description:void 0,pathParameters:u,queryParameters:l,headers:d,request:b,response:g,codeSamples:o}))}convertCodeSamples(t){return t.map(r=>"language"in r?Kmi.language({name:r.name??void 0,description:r.docs??void 0,language:r.language,code:r.code,install:r.install??void 0}):Kmi.sdk({name:r.name??void 0,description:r.docs??void 0,sdk:r.sdk==="c#"?GH.Csharp:r.sdk,code:r.code})).filter(iv)}isSchemaRequired(t){return Lau(this.getResolvedSchema(t))}getResolvedSchema(t){return t}};function pFE(e,t){let r=[];if(e.length<=1){let[n,a]=e[0]??[];if(t.length===0)return r.push({id:n,request:a,response:void 0}),r;for(let[u,l]of t)r.push({id:u??n,request:a,response:l});return r}if(t.length<=1){let[n,a]=t[0]??[];if(t.length===0)return r.push({id:n,request:void 0,response:a}),r;for(let[u,l]of e)r.push({id:u??n,request:l,response:a});return r}let i=new Set;for(let[n,a]of e){let u=t.find(([d])=>d==null)?.[1]??t[0]?.[1];if(n==null){if(u==null)continue;r.push({id:void 0,request:a,response:u});continue}let l=!1;for(let d=0;d<t.length;d++){let[s,o]=t[d];s==null||i.has(d)||n===s&&(r.push({id:n,request:a,response:o}),s!=null&&i.add(d),l=!0)}!l&&u!=null&&r.push({id:n,request:a,response:u})}for(let n=0;n<t.length;n++){if(i.has(n))continue;let[a,u]=t[n],l=e.find(([d])=>d==null)?.[1]??e[0]?.[1];l!=null&&r.push({id:a,request:l,response:u})}return r}function _FE(e){if(e!=null)return e.type==="multipart"?{type:"present",schema:yFE(e),examples:[]}:e.type==="json"||e.type==="formUrlEncoded"?{type:"present",schema:e.schema,examples:e.fullExamples??[]}:{type:"unsupported"}}function hFE(e){if(e!=null)return e.type!=="json"&&e.type!=="streamingJson"&&e.type!=="streamingSse"?{type:"unsupported"}:{type:"present",schema:e.schema,examples:e.fullExamples??[]}}function mQt(e){switch(e.type){case"primitive":case"enum":case"literal":return!0;case"unknown":return mQt(e);case"array":case"object":case"map":return!1;case"oneOf":switch(e.value.type){case"discriminated":return!1;case"undiscriminated":return mQt(e.value.value);default:return!1}default:So(e)}}function yFE(e){return Al.object({properties:e.properties.map(t=>t.schema.type==="file"?null:{key:t.key,schema:OQt(t.schema.value),audiences:[],conflict:{},generatedName:t.key,nameOverride:void 0,availability:void 0,readonly:void 0,writeonly:void 0,inline:void 0}).filter(iv),allOf:[],allOfPropertyConflicts:[],fullExamples:void 0,description:e.description,nameOverride:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,additionalProperties:!1,availability:void 0,source:e.source,inline:void 0})}var IKn=class{exampleTypeFactory;schemas;constructor(t,r){this.exampleTypeFactory=new kNi(t,new Set,r),this.schemas=t}buildWebsocketSessionExamplesForExtension({context:t,extensionExamples:r,handshake:i,source:n,namespace:a}){let u=[];for(let l of r){let d=[];for(let c of i.queryParameters){let b=this.isSchemaRequired(c.schema),g=this.exampleTypeFactory.buildExample({schema:c.schema,exampleId:void 0,example:l.queryParameters?.[c.name],options:{name:c.name,isParameter:!0,ignoreOptionals:!0}});g!=null&&!mQt(g)&&(g=void 0),!(b&&g==null)&&g!=null&&d.push({name:c.name,value:g})}let s=[];for(let c of i.headers){let b=this.isSchemaRequired(c.schema),g=this.exampleTypeFactory.buildExample({schema:c.schema,exampleId:void 0,example:l.headers?.[c.name],options:{name:c.name,isParameter:!0,ignoreOptionals:!0}});g!=null&&!mQt(g)&&(g=void 0),!(b&&g==null)&&g!=null&&s.push({name:c.name,value:g})}let o=[];for(let c of l.messages){let b=t.getExampleMessageReference(c),g=t.resolveMessageReference({$ref:b}),O=Gd(g.payload)?t.resolveSchemaReference(g.payload):g.payload,m=this.exampleTypeFactory.buildExample({schema:$b(O,!1,t,[c.messageId],n,a),exampleId:void 0,example:c.value,options:{isParameter:!1,ignoreOptionals:!0}});m!=null&&o.push({messageType:c.type,payload:m,description:void 0})}u.push({name:l.summary,queryParameters:d,headers:s,description:l.description,messages:o})}return u}buildWebsocketSessionExample({handshake:t,messages:r}){let i={name:void 0,queryParameters:[],headers:[],description:void 0,messages:[]},n=[];for(let u of t.queryParameters){let l=this.isSchemaRequired(u.schema),d=this.exampleTypeFactory.buildExample({schema:u.schema,exampleId:void 0,example:void 0,options:{name:u.name,isParameter:!0,ignoreOptionals:!0}});if(d!=null&&!mQt(d)&&(d=void 0),l&&d==null)return;d!=null&&n.push({name:u.name,value:d})}let a=[];for(let u of t.headers){let l=this.isSchemaRequired(u.schema),d=this.exampleTypeFactory.buildExample({schema:u.schema,exampleId:void 0,example:void 0,options:{name:u.name,isParameter:!0,ignoreOptionals:!0}});if(d!=null&&!mQt(d)&&(d=void 0),l&&d==null)return;d!=null&&a.push({name:u.name,value:d})}for(let u of r){let l=this.exampleTypeFactory.buildExample({schema:u.payload,exampleId:void 0,example:void 0,options:{isParameter:!1,ignoreOptionals:!0}});l!=null&&i.messages.push({messageType:u.type,payload:l,description:void 0})}return i}isSchemaRequired(t){return Lau(this.getResolvedSchema(t))}getResolvedSchema(t){for(;t.type==="reference";){let r=this.schemas[t.schema];if(r==null)throw new Error(`Unexpected error: Failed to resolve schema reference: ${t.schema}`);t=r}return t}};var see={FERN_PARAMETER_OPTIONAL:"x-fern-optional",FERN_CHANNEL_ADDRESS:"x-fern-address",FERN_DISPLAY_NAME:"x-fern-display-name",FERN_SDK_GROUP_NAME:"x-fern-sdk-group-name",FERN_EXAMPLES:"x-fern-examples",BASE_PATH:"x-fern-base-path",FERN_ENUM:"x-fern-enum",IGNORE:"x-fern-ignore"};function Vau(e){return of(e,see.FERN_EXAMPLES)??[]}function Wau(e,t){return t.includes("://")?t:`${e}://${t}`}function Hau(e){return e.startsWith("/")?e:"/"+e}function k1_({context:e,breadcrumbs:t,source:r,asyncApiOptions:i,document:n}){let a={},u={};for(let[s,o]of Object.entries(n.components?.schemas??{})){let c=$b(o,!1,e,[s],r,e.namespace);a[s]=c}let l=new IKn(a,e),d={};for(let[s,o]of Object.entries(n.servers??{}))d[s]={name:s,url:Wau(o.protocol,o.url)};for(let[s,o]of Object.entries(n.channels??{})){let c=of(o,see.IGNORE);if(c!=null&&c){e.logger.debug(`Channel ${s} is marked with x-fern-ignore. Skipping.`);continue}let b=[];if(o.parameters!=null)for(let[E,q]of Object.entries(o.parameters??{}))b.push({name:E,description:q.description,parameterNameOverride:void 0,schema:q.schema!=null?$b(q.schema,!1,e,t,r,e.namespace):Al.primitive({schema:ap.string({default:void 0,pattern:void 0,format:void 0,maxLength:void 0,minLength:void 0,example:void 0}),description:void 0,availability:void 0,generatedName:"",title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}),variableReference:void 0,availability:sK(q),source:r});let g=[],O=[];if(o.bindings?.ws!=null){if(o.bindings.ws.headers!=null){let E=o.bindings.ws.headers.required??[];for(let[q,M]of Object.entries(o.bindings.ws.headers.properties??{})){if(Gd(M)){let D=e.resolveSchemaReference(M);g.push({name:q,schema:tPi(M,!1,e,t,void 0,r,e.namespace),description:D.description,parameterNameOverride:void 0,env:void 0,availability:sK(D),source:r});continue}g.push({name:q,schema:$b(M,!E.includes(q),e,[...t,q],r,e.namespace),description:M.description,parameterNameOverride:void 0,env:void 0,availability:sK(M),source:r})}}if(o.bindings.ws.query!=null){let E=o.bindings.ws.query.required??[];for(let[q,M]of Object.entries(o.bindings.ws.query.properties??{})){if(Gd(M)){let D=e.resolveSchemaReference(M);O.push({name:q,schema:tPi(M,!1,e,t,void 0,r,e.namespace),description:D.description,parameterNameOverride:void 0,availability:sK(D),source:r});continue}O.push({name:q,schema:$b(M,!E.includes(q),e,[...t,q],r,e.namespace),description:M.description,parameterNameOverride:void 0,availability:sK(M),source:r})}}}let m;o.publish!=null&&("oneOf"in o.publish.message?m=X1_({generatedName:o.publish.operationId??"PublishEvent",event:o.publish,breadcrumbs:t,context:e,source:r,options:e.options,asyncApiOptions:i}):m=Z1_({action:"Publish",channelPath:s,message:o.publish.message,context:e,source:r}));let w;if(o.subscribe!=null&&("oneOf"in o.subscribe.message?w=X1_({generatedName:o.subscribe.operationId??"SubscribeEvent",event:o.subscribe,breadcrumbs:t,context:e,source:r,options:e.options,asyncApiOptions:i}):w=Z1_({action:"Subscribe",channelPath:s,message:o.subscribe.message,context:e,source:r})),g.length>0||O.length>0||m!=null||w!=null){let E=Vau(o),q=[];if(E.length>0)q=l.buildWebsocketSessionExamplesForExtension({context:e,extensionExamples:E,handshake:{headers:g,queryParameters:O},source:r,namespace:e.namespace});else{let R=[];m!=null&&R.push({type:"publish",payload:m}),w!=null&&R.push({type:"subscribe",payload:w});let G=l.buildWebsocketSessionExample({handshake:{headers:g,queryParameters:O},messages:R});G!=null&&q.push(G)}let M=of(o,see.FERN_CHANNEL_ADDRESS),D=M??Hau(s),C=[];m!=null&&C.push({origin:"client",name:"publish",body:iA(m)}),w!=null&&C.push({origin:"server",name:"subscribe",body:iA(w)}),u[s]={audiences:of(o,Kf.AUDIENCES)??[],handshake:{headers:g.map(R=>({...R,schema:iA(R.schema),env:R.env})),queryParameters:O.map(R=>({...R,schema:iA(R.schema)})),pathParameters:b.map(R=>({...R,parameterNameOverride:void 0,schema:iA(R.schema)}))},groupName:e.resolveGroupName([of(o,see.FERN_SDK_GROUP_NAME)??s]),messages:C,servers:(o.servers?.map(R=>d[R])??Object.values(d)).filter(R=>R!=null),summary:of(o,see.FERN_DISPLAY_NAME),path:D,description:o.description,examples:q,source:r}}}return{groupedSchemas:BKn(e.namespace,a),channels:u??void 0,servers:Object.values(d),basePath:of(n,see.BASE_PATH)}}function X1_({generatedName:e,event:t,context:r,breadcrumbs:i,source:n,options:a,asyncApiOptions:u}){if("oneOf"in t.message&&t.message.oneOf!=null){let l=[],d=[];for(let s of t.message.oneOf){let o,c={type:"notFound"};if(Gd(s)){let b=r.resolveMessageReference(s);!Gd(b.payload)&&u.naming==="v2"?(c=b.name?{type:"name",name:b.name}:c,o={...b.payload,title:b.name??b.payload.title,description:b.name??b.payload.description}):o=b.payload}else o=s;d.push(c),l.push(o)}return XNi({description:t.description??t.message.description,availability:sK(t.message),subtypes:l,nameOverride:t.operationId,generatedName:e,title:t.message.title,groupName:void 0,wrapAsNullable:!1,breadcrumbs:i,context:r,encoding:void 0,source:n,namespace:r.namespace,subtypePrefixOverrides:u.naming==="v2"?d:[]})}}function Z1_({action:e,channelPath:t,message:r,context:i,source:n}){if(r.payload!=null){let a=r.payload;return Gd(r.payload)&&(a=i.resolveSchemaReference(r.payload)),$b(a,!1,i,[t,e],n,i.namespace)}}var $au=class extends CKn{getExampleMessageReference(t){return`#/channels/${t.channelId}/messages/${t.messageId}`}resolveParameterReference(t){let r="#/components/parameters/";if(this.document.components==null||this.document.components.parameters==null||!t.$ref.startsWith(r))throw new Error(`Failed to resolve ${t.$ref}`);let i=t.$ref.substring(r.length),n=this.document.components.parameters[i];if(n==null)throw new Error(`${t.$ref} is undefined`);return"$ref"in n?this.resolveParameterReference(n):n}resolveMessageReference(t){let r="#/channels/",i="#/components/messages/";if(t.$ref.startsWith(r)){let l=t.$ref.split("/"),d=l[2],s=l[4];if(d==null||s==null||!this.document.channels?.[d])throw new Error(`Failed to resolve message reference ${t.$ref} in channel ${d}`);let c=this.document.channels[d].messages?.[s];if(c==null)throw new Error(`${t.$ref} is undefined`);return"$ref"in c?this.resolveMessageReference(c):{name:s,...c}}let n=this.document.components;if(!t.$ref.startsWith(i)||!n?.messages)throw new Error(`Failed to resolve message reference: ${t.$ref} in v3 components`);let a=t.$ref.substring(i.length),u=n.messages[a];if(u==null)throw new Error(`${t.$ref} is undefined`);return{name:a,...u}}isMessageWithPayload(t){return t!=null&&typeof t=="object"&&"payload"in t}isReferenceObject(t){return t!=null&&typeof t=="object"&&"$ref"in t}};var eS_="#/channels/",tS_="#/servers/",bSc="$message.";function iS_({context:e,breadcrumbs:t,source:r,asyncApiOptions:i,document:n}){let a={},u={},l={},d=[],s={};for(let[O,m]of Object.entries(n.components?.schemas??{}))a[O]=$b(m,!1,e,[O],r,e.namespace);for(let[O,m]of Object.entries(n.channels??{}))if(u[O]||(u[O]={}),m.messages){for(let[w,E]of Object.entries(m.messages))if(e.isReferenceObject(E)||e.isMessageWithPayload(E))if(l[w]||(l[w]=[]),e.isReferenceObject(E)){let q=e.resolveMessageReference(E);l[w].push({channelId:O,payload:q.payload})}else l[w].push({channelId:O,payload:E.payload})}for(let[O,m]of Object.entries(l))if(m.length===1){let w=m[0],E=w.channelId;u[E]=u[E]||{},u[E][O]=$b(w.payload,!1,e,[O],r,e.namespace)}else{d.push(O);for(let{channelId:w,payload:E}of m){let q=`${w}_${O}`;u[w]||(u[w]={}),u[w][q]=$b(E,!1,e,[q],r,e.namespace)}}let o=Object.values(u).reduce((O,m)=>({...O,...m}),{}),c=new IKn(o,e),b={};for(let[O,m]of Object.entries(n.servers??{}))b[O]={name:O,url:Wau(m.protocol,m.host)};let g={};for(let[O,m]of Object.entries(n.operations??{})){if(of(m,see.IGNORE))continue;let w=vFE(m);if(g[w]||(g[w]={subscribe:[],publish:[],__parsedMessages:[]}),m.action==="receive")g[w].subscribe.push(...m.messages);else if(m.action==="send")g[w].publish.push(...m.messages);else throw new Error(`Operation ${O} has an invalid action: ${m.action}`)}for(let[O,m]of Object.entries(g)){let w=[];w.push(...rS_({messages:m.subscribe,channelPath:O,origin:"server",messageSchemas:u[O]??{},duplicatedMessageIds:d,context:e})),w.push(...rS_({messages:m.publish,channelPath:O,origin:"client",messageSchemas:u[O]??{},duplicatedMessageIds:d,context:e})),g[O]!=null&&(g[O].__parsedMessages=w)}for(let[O,m]of Object.entries(n.channels??{})){if(of(m,see.IGNORE))continue;let w=[],E=[],q=[];if(m.parameters!=null)for(let[M,D]of Object.entries(m.parameters)){let C=e.isReferenceObject(D)?e.resolveParameterReference(D):D,{type:R,parameterKey:G}=C.location!=null?bFE(C.location):{type:m.address?.includes(`={${M}}`)?"query":"path",parameterKey:M},I=of(C,see.FERN_PARAMETER_OPTIONAL),L=qB(S_(O))+qB(S_(M)),V={...C,type:"string",title:L,example:C.examples?.[0],default:C.default,enum:C.enum,required:void 0},Y=$b(V,!1,e,[G],r,e.namespace);I&&(Y=Al.optional({value:Y,description:void 0,availability:void 0,generatedName:"",title:L,namespace:void 0,groupName:void 0,nameOverride:void 0,inline:void 0}));let K={name:G,description:C.description,parameterNameOverride:void 0,schema:Y,variableReference:void 0,availability:sK(D),source:r};R==="header"?w.push({...K,env:void 0}):R==="path"?E.push(K):(R==="payload"||R==="query")&&q.push(K)}if(w.length>0||q.length>0||g[O]!=null&&(g[O].publish!=null||g[O].subscribe!=null)){let M=Vau(m),D=g[O]?.__parsedMessages??[],C=[];if(M.length>0)C=c.buildWebsocketSessionExamplesForExtension({context:e,extensionExamples:M,handshake:{headers:w,queryParameters:q},source:r,namespace:e.namespace});else{let R=[],{examplePublishMessage:G,exampleSubscribeMessage:I}=OFE({messages:D,messageSchemas:u[O]??{}});G!=null&&R.push(G),I!=null&&R.push(I);let L=c.buildWebsocketSessionExample({handshake:{headers:w,queryParameters:q},messages:R});L!=null&&C.push(L)}s[O]={audiences:of(m,Kf.AUDIENCES)??[],handshake:{headers:w.map(R=>({...R,schema:iA(R.schema),env:R.env})),queryParameters:q.map(R=>({...R,schema:iA(R.schema)})),pathParameters:E.map(R=>({...R,parameterNameOverride:void 0,schema:iA(R.schema)}))},groupName:e.resolveGroupName([of(m,see.FERN_SDK_GROUP_NAME)??O]),messages:D,summary:of(m,see.FERN_DISPLAY_NAME),servers:m.servers?.map(R=>gFE(b,R))??Object.values(b),path:m.address?.split("?")[0]??Hau(O),description:m.description,examples:C,source:r}}}return{groupedSchemas:BKn(e.namespace,a),channels:s,servers:Object.values(b),basePath:of(n,see.BASE_PATH)}}function vFE(e){if(!e.channel.$ref.startsWith(eS_))throw new Error(`Failed to resolve channel path from operation ${e.channel.$ref}`);return e.channel.$ref.substring(eS_.length)}function bFE(e){try{let[t,r]=e.split("#/");if(t==null||r==null)throw new Error(`Invalid location format: ${e}; unable to parse message type and parameter key`);if(!t.startsWith(bSc))throw new Error(`Invalid location format: ${e}; expected ${bSc} prefix`);let i=t.substring(bSc.length);if(i!=="header"&&i!=="path"&&i!=="payload")throw new Error(`Invalid message type: ${i}. Must be one of: header, path, payload`);return{type:i,parameterKey:r}}catch{throw new Error(`Invalid location format: ${e}; see here for more details: https://www.asyncapi.com/docs/reference/specification/v3.0.0#runtimeExpression`)}}function gFE(e,t){if(!t.$ref.startsWith(tS_))throw new Error(`Failed to resolve server name from server ref ${t.$ref}`);let r=t.$ref.substring(tS_.length),i=e[r];if(i==null)throw new Error(`Failed to find server with name ${r}`);return i}function rS_({messages:e,channelPath:t,origin:r,messageSchemas:i,duplicatedMessageIds:n,context:a}){let u=[];return e.forEach((l,d)=>{let o=a.resolveMessageReference(l).name;n.includes(o)&&(o=`${t}_${o}`);let c=i[o];c!=null&&u.push({origin:r,name:o??`${r}Message${d+1}`,body:iA(c)})}),u}function OFE({messages:e,messageSchemas:t}){let r=e.find(u=>u.origin==="client")?.name,i=e.find(u=>u.origin==="server")?.name,n=r!=null?t[r]:void 0,a=i!=null?t[i]:void 0;return{examplePublishMessage:n!=null&&r!=null?{type:r,payload:n}:void 0,exampleSubscribeMessage:a!=null&&i!=null?{type:i,payload:a}:void 0}}function nS_({document:e,taskContext:t,options:r,source:i,asyncApiOptions:n,namespace:a}){let u=[];if(a!=null&&u.push(a),parseFloat(e.asyncapi)<3){let l=e;l.tags?.[0]!=null?u.push(l.tags[0].name):n.naming!=="v2"&&u.push("websocket");let d=new Fau({document:l,taskContext:t,options:r,namespace:a});return k1_({context:d,breadcrumbs:u,source:i,asyncApiOptions:n,document:l})}else{let l=e,d=new $au({document:l,taskContext:t,options:r,namespace:a});return iS_({context:d,breadcrumbs:u,source:i,asyncApiOptions:n,document:l})}}function aS_(e){return of(e,Kf.ASYNC_CONFIG)}var oS_="$request.";function uS_(e){let t=of(e,Kf.STREAMING);if(t!=null)return typeof t=="boolean"?t?{type:"stream",format:"json"}:void 0:t["stream-condition"]==null&&t.format!=null?{type:"stream",format:t.format}:{type:"streamCondition",format:t.format??"json",streamDescription:t["stream-description"],streamConditionProperty:mFE(t["stream-condition"]),responseStream:t["response-stream"],response:t.response}}function mFE(e){return e.startsWith(oS_)?e.slice(oS_.length):e}function sS_(e){let t=e;if(t.cursor!=null)return t7e.cursor({cursor:t.cursor,nextCursor:t.next_cursor,results:t.results});if("offset"in e){let r=e;return t7e.offset({offset:r.offset,results:r.results,step:r.step,hasNextPage:r["has-next-page"]})}if("type"in e&&e.type==="custom"){let r=e;return t7e.custom({results:r.results})}throw new Error("Invalid pagination extension")}function cS_(e,t){let r=of(t,Kf.PAGINATION);if(r!=null){if(typeof r=="boolean"){let i=of(e,Kf.PAGINATION);if(typeof i=="boolean")throw new Error("Global pagination extension is a boolean, expected an object. Only endpoints may declare a boolean for x-fern-pagination.");return i==null?void 0:sS_(i)}return sS_(r)}}function lS_(e){let t=PFE(e),r={};return gSc({obj:t,occurrences:r,breadcrumbs:[]}),r}function gSc({obj:e,occurrences:t,breadcrumbs:r}){if(e!=null){if(Array.isArray(e)){for(let i of e)gSc({obj:i,occurrences:t,breadcrumbs:r});return}if(typeof e=="object"){if(e.$ref!=null&&typeof e.$ref=="string"){let i=e.$ref;t[i]==null?t[i]=1:t[i]+=1;return}for(let i in e)gSc({obj:e[i],occurrences:t,breadcrumbs:[...r,i]})}}}function PFE(e){return{...e,paths:Object.fromEntries(Object.entries(e.paths??{}).map(([t,r])=>[t,{...r,get:r?.get!=null?k5a(r.get):void 0,put:r?.put!=null?k5a(r.put):void 0,post:r?.post!=null?k5a(r.post):void 0,patch:r?.patch!=null?k5a(r.patch):void 0,delete:r?.delete!=null?k5a(r.delete):void 0}]))}}function k5a(e){return{...e,requestBody:e.requestBody!=null?Gd(e.requestBody)?e.requestBody:jFE(e.requestBody):void 0}}function jFE(e){let t,r;for(let i in e.content){let n=hq.parse(i);n!=null&&(n.isJSON()?t=e.content[i]:n.isMultipart()&&(r=e.content[i]))}return r!=null&&t!=null?{...e,content:{[hq.MULTIPART_FORM_DATA]:r}}:e}var Gau=class{endpoints;parser=new Aen;constructor({context:t,options:r}){this.endpoints=r.filter?.endpoints?new Set(this.validateAndFilterEndpoints({context:t,endpoints:r.filter.endpoints})):void 0}skipEndpoint({method:t,path:r}){return this.endpoints!=null&&!this.endpoints.has(`${t} ${r}`)}hasEndpoints(){return this.endpoints!=null}validateAndFilterEndpoints({context:t,endpoints:r}){let i=[];for(let n of r){let a=this.parser.tryParse(n);if(a==null){t.logger.debug(`Ignoring configured filter endpoint "${n}"; expected format "POST /users/get"`);continue}i.push(`${a.method} ${a.path}`)}return i}};var fS_="#/components/parameters/",dS_="#/components/responses/",pS_="#/components/examples/",_S_="#/components/requestBodies/",zKn=class{logger;document;taskContext;authHeaders;refOccurrences;DUMMY;options;source;filter;namespace;constructor({document:t,taskContext:r,authHeaders:i,options:n,source:a,namespace:u}){this.document=t,this.logger=r.logger,this.taskContext=r,this.authHeaders=i,this.refOccurrences=lS_(t),this.options=n,this.source=a,this.filter=new Gau({context:r,options:n}),this.DUMMY=this.getDummy(),this.namespace=u}getNumberOfOccurrencesForRef(t){return this.refOccurrences[t.$ref]??0}resolveTagsToTagIds(t){let r=[];return this.namespace!=null&&r.push(this.namespace),r.concat(t??[])}resolveTags(t){let r=[];if(this.namespace!=null){let i={type:"namespace",name:this.namespace};r.push(i)}return r.concat(t??[])}resolveGroupName(t){return this.namespace!=null?[{type:"namespace",name:this.namespace},...t]:t}resolveSchemaReference(t){let r=t.$ref.substring(2).split("/").map(n=>n.replace(/~1/g,"/")),i=this.document;for(let n of r){if(typeof i!="object"||i==null)return{"x-fern-type":"unknown"};if(Array.isArray(i)){let a=parseInt(n,10);if(isNaN(a)||a<0||a>=i.length)return{"x-fern-type":"unknown"};i=i[a]}else i=i[n]}return i==null?(this.logger.warn(`Encountered undefined reference: ${t.$ref}`),{"x-fern-type":"unknown"}):(Gd(i)&&(i=this.resolveSchemaReference(i)),i)}resolveParameterReference(t){if(this.document.components==null||this.document.components.parameters==null||!t.$ref.startsWith(fS_))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(fS_.length),i=this.document.components.parameters[r];if(i==null)throw new Error(`${t.$ref} is undefined`);return Gd(i)?this.resolveParameterReference(i):i}resolveRequestBodyReference(t){if(this.document.components==null||this.document.components.requestBodies==null||!t.$ref.startsWith(_S_))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(_S_.length),i=this.document.components.requestBodies[r];if(i==null)throw new Error(`${t.$ref} is undefined`);return Gd(i)?this.resolveRequestBodyReference(i):i}resolveResponseReference(t){if(this.document.components==null||this.document.components.responses==null||!t.$ref.startsWith(dS_))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(dS_.length),i=this.document.components.responses[r];if(i==null)throw new Error(`${t.$ref} is undefined`);return Gd(i)?this.resolveResponseReference(i):i}resolveExampleReference(t){if(this.document.components==null||this.document.components.examples==null||!t.$ref.startsWith(pS_))throw new Error(`Failed to resolve ${t.$ref}`);let r=t.$ref.substring(pS_.length),i=this.document.components.examples[r];if(i==null)throw new Error(`${t.$ref} is undefined`);return Gd(i)?this.resolveExampleReference(i):i}referenceExists(t){let r=t.substring(2).split("/").map(n=>n.replace(/~1/g,"/")),i=this.document;for(let n of r){if(typeof i!="object"||i==null)return!1;i=i[n]}return!0}};var aan=class extends zKn{constructor({document:t,taskContext:r,options:i,source:n,namespace:a}){super({document:t,taskContext:r,authHeaders:new Set,options:i,source:n,namespace:a})}getDummy(){return this}markSchemaAsReferencedByNonRequest(t){}markSchemaAsReferencedByRequest(t){}getReferencedSchemas(){return new Set}markReferencedByDiscriminatedUnion(t,r,i){}getReferencesFromDiscriminatedUnion(t){}excludeSchema(t){}isSchemaExcluded(t){return!1}markSchemaWithDiscriminantValue(t,r,i){}getDiscriminatedUnionMetadata(t){}};var wFE=Su.object({lang:Su.string(),label:Su.optional(Su.string()),source:Su.string()}),OSc=Su.array(wFE);var hS_={README_EXT:"x-readme"};function SFE(e){if(!Array.isArray(e))return!1;for(let t of e)if(!vw(t)||typeof t.language!="string"||typeof t.code!="string")return!1;return!0}function yS_(e){let t=of(e,hS_.README_EXT);if(!vw(t))return[];let r=t["code-samples"];if(!SFE(r))return[];let i=[];for(let n of r)i.push({name:n.name,language:n.language,code:n.code,install:n.install,docs:void 0});return i}function vS_(e,t,r){let n=(of(t,Kf.EXAMPLES)??[]).filter(s=>{let o=MF.serialization.ExampleEndpointCallSchema.parse(s);return o.ok||r.logger.error(`Failed to parse x-fern-example in ${e.path}/${e.method}`),o.ok}),a=K5a(t,JH.REDOCLY_CODE_SAMPLES_KEBAB,OSc,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],l=[...K5a(t,JH.REDOCLY_CODE_SAMPLES_CAMEL,OSc,r.logger,[...e.baseBreadcrumbs,`${e.method} ${e.path}`])??[],...a];l.length>0&&n.push({"code-samples":l.map(s=>({name:s.label??s.lang,language:s.lang,code:s.source,install:void 0,docs:void 0}))});let d=yS_(t);return d.length>0&&n.push({"code-samples":d}),n.map(yQt.unknown)}function bS_(e){let t=of(e,Kf.AVAILABILITY);if(t==="ga"||t==="generally-available")return $H.GenerallyAvailable;if(t==="beta"||t==="pre-release")return $H.Beta;if(t==="deprecated")return $H.Deprecated;if(e.deprecated)return $H.Deprecated}function Qau(e){return{url:DFE({url:e.url,variables:e.variables??{}}),description:e.description,name:EFE(e),audiences:of(e,Kf.AUDIENCES)}}function DFE({url:e,variables:t}){let r=Object.fromEntries(Object.entries(t).map(([i,n])=>[i,n.default]));for(let[i,n]of Object.entries(r))e=e.replace(`{${i}}`,encodeURIComponent(n));return e}function EFE(e){let t=of(e,[Kf.SERVER_NAME_V1,Kf.SERVER_NAME_V2]);if(t!=null)return t;if(e.description?.toLowerCase()==="production")return"Production";if(e.description?.toLowerCase()==="sandbox")return"Sandbox"}function gS_(e){return of(e,Kf.PARAMETER_NAME)}function OS_(e){return of(e,Kf.SDK_VARIABLE)}function Jau({path:e,httpMethod:t,parameters:r,context:i,requestBreadcrumbs:n,source:a}){let u={pathParameters:[],queryParameters:[],headers:[]};for(let l of r){let d=of(l,Kf.IGNORE);if(d!=null&&d){i.logger.debug(`${t.toUpperCase()} ${e} has a parameter marked with x-fern-ignore. Skipping.`);continue}let s=Gd(l)?i.resolveParameterReference(l):l,o=s.required??!1,c=sK(s),b=[...n,s.name],g=Q8(b,i.options.preserveSchemaIds),O=s.schema!=null?$b(s.schema,!o,i,b,a,i.namespace,!1,new Set,Sor({schema:s,logger:i.logger})):o?Al.primitive({nameOverride:void 0,generatedName:g,title:void 0,schema:ap.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:Sor({schema:s,logger:i.logger})}),description:void 0,availability:c,namespace:void 0,groupName:void 0}):Al.optional({nameOverride:void 0,generatedName:g,title:void 0,value:Al.primitive({nameOverride:void 0,generatedName:g,title:void 0,schema:ap.string({default:void 0,pattern:void 0,format:void 0,minLength:void 0,maxLength:void 0,example:Sor({schema:s,logger:i.logger})}),description:void 0,availability:void 0,namespace:void 0,groupName:void 0}),description:void 0,availability:c,namespace:void 0,groupName:void 0,inline:void 0});if(s.in==="header"&&s.schema!=null&&!Gd(s.schema)&&s.schema.default!=null){let w=s.schema.default;typeof w=="string"&&w.length>0&&(O=Al.literal({nameOverride:void 0,generatedName:g,title:void 0,value:Kz.string(w),description:void 0,availability:c,namespace:void 0,groupName:void 0}))}let m={name:s.name,schema:O,description:s.description,parameterNameOverride:gS_(s),availability:c,source:a};s.in==="query"?u.queryParameters.push(m):s.in==="path"?u.pathParameters.push({...m,variableReference:OS_(s)}):s.in==="header"?!MFE.has(s.name.toLowerCase())&&!i.authHeaders.has(s.name)?u.headers.push({...m,env:void 0}):i.logger.debug(`Ignoring ${s.name} header, in ${t.toUpperCase()} ${e}`):i.logger.warn(`Skipping ${s.in} parameter, ${s.name}, in ${t.toUpperCase()} ${e}`)}return u}var MFE=new Set(["user-agent","content-length","content-type","x-forwarded-for","cookie","origin","content-disposition","x-ping-custom-domain"]);function mS_(e,t){for(let r of Object.keys(e))if(r.includes("text/event-stream")){let i=e[r];if(i==null)continue;let n=i.schema;return{contentType:r,schema:n??{},examples:e9a(i,t)}}}function AFE(e){return e.includes("json")||e==="*/*"}function mSc({content:e,context:t}){for(let[r,i]of Object.entries(e))if(Kau({mediaType:r,mediaTypeObject:i,context:t})!=null)return[r,i]}function Kau({mediaType:e,mediaTypeObject:t,context:r}){if(!AFE(e))return;let i=t.schema;return{contentType:e.includes("*")?void 0:e,schema:i??{},examples:e9a(t,r)}}function Yau({content:e,context:t}){let r=mSc({content:e,context:t});if(!r)return;let[i,n]=r;return Kau({mediaType:i,mediaTypeObject:n,context:t})}function PS_(e,t){for(let r of Object.keys(e)){let i=e[r];if(i==null)continue;return{schema:i.schema??{},examples:e9a(i,t)}}}function e9a(e,t){let r=[];e.example!=null&&r.push({name:void 0,value:e.example,description:void 0});let i=of(e,JH.EXAMPLES);return i!=null&&Object.keys(i).length>0&&r.push(...Object.entries(i).map(([n,a])=>({name:a.summary??n,value:a.value,description:a.description}))),e.examples!=null&&Object.keys(e.examples).length>0&&r.push(...Object.entries(e.examples).map(([n,a])=>{let u=Gd(a)?t.resolveExampleReference(a):a;return{name:u.summary??n,value:u.value,description:u.description}})),r}function qFE({content:e,context:t}){for(let[r,i]of Object.entries(e))if(wS_({mediaType:r,mediaTypeObject:i,context:t}))return[r,i]}function wS_({mediaType:e,mediaTypeObject:t,context:r}){if(hq.parse(e)?.isURLEncoded())return{schema:t.schema,contentType:e,examples:e9a(t,r)}}function TFE({content:e}){for(let[t,r]of Object.entries(e))if(SS_({mediaType:t,mediaTypeObject:r}))return[t,r]}function SS_({mediaType:e,mediaTypeObject:t}){if(hq.parse(e)?.isMultipart())return{schema:t.schema,encoding:t.encoding}}function DS_({mediaType:e}){return hq.parse(e)?.isBinary()??!1}function CFE({content:e}){for(let[t,r]of Object.entries(e))if(DS_({mediaType:t}))return[t,r]}function BFE(e,t){let r=Gd(e)?PSc(e,t):{id:void 0,schema:e};return Object.entries(r.schema.properties??{}).find(([i,n])=>!Gd(n)&&n.type==="string"&&n.format==="binary")!=null}function Zau({content:e,description:t,document:r,context:i,requestBreadcrumbs:n,source:a,namespace:u}){let l=CFE({content:e});if(l){let[b,g]=l;return Dor({mediaType:b,mediaTypeObject:g,description:t,document:r,context:i,requestBreadcrumbs:n,source:a,namespace:u})}let d=TFE({content:e}),s=mSc({content:e,context:i}),o=IFE({json:s,multipart:d,document:r,visitor:{json:([b,g])=>Dor({mediaType:b,mediaTypeObject:g,description:t,document:r,context:i,requestBreadcrumbs:n,source:a,namespace:u}),multipart:([b,g])=>Dor({mediaType:b,mediaTypeObject:g,description:t,document:r,context:i,requestBreadcrumbs:n,source:a,namespace:u}),neither:()=>{}}});if(o)return o;let c=qFE({content:e,context:i});if(c){let[b,g]=c;return Dor({mediaType:b,mediaTypeObject:g,description:t,document:r,context:i,requestBreadcrumbs:n,source:a,namespace:u})}}function IFE({json:e,multipart:t,document:r,visitor:i}){if(!e&&!t)return i.neither();let[,n]=e??[void 0,void 0],[,a]=t??[void 0,void 0];return!n?.schema&&!a?.schema?i.neither():n?.schema&&a?.schema?n.schema&&BFE(n.schema,r)?i.multipart(t):i.json(e):n?.schema?i.json(e):a?.schema?i.multipart(t):i.neither()}function Dor({mediaType:e,mediaTypeObject:t,description:r,document:i,context:n,requestBreadcrumbs:a,source:u,namespace:l}){let d=zFE({mediaTypeObject:t});if(DS_({mediaType:e}))return nee.octetStream({description:r,source:u,sdkMethodName:d,contentType:e});let s=SS_({mediaType:e,mediaTypeObject:t}),o=s?.schema,c=s?.encoding;if(o){let O=Gd(o)?PSc(o,i):{id:void 0,schema:o},m=$b(O.schema,!1,n,a,u,l,!1),w=[];if(m.type==="object")for(let E of m.properties){let{isFile:q,isOptional:M,isArray:D,description:C}=Xau({schema:E.schema});if(q){let R=jS_(E.key,c);w.push({key:E.key,schema:Ymi.file({isOptional:M,isArray:D,description:C}),description:C,contentType:R,exploded:!1,encoding:R==null?n.options.defaultFormParameterEncoding:void 0})}else{let R=jS_(E.key,c);w.push({key:E.key,schema:Ymi.json(E.schema),description:void 0,contentType:R,exploded:c?.[E.key]?.explode,encoding:R==null?n.options.defaultFormParameterEncoding:xFE(R)})}}return nee.multipart({name:Gd(o)&&n.getNumberOfOccurrencesForRef(o)===1?O.id:void 0,description:O.schema.description,properties:w,source:u,sdkMethodName:d})}let b=Kau({mediaType:e,mediaTypeObject:t,context:n});if(b){let O=$b(b.schema,!1,n,a,u,l,!0);return nee.json({description:void 0,schema:O,contentType:b.contentType,fullExamples:b.examples,additionalProperties:!Gd(b.schema)&&MKn(b.schema.additionalProperties,n.options),source:u,sdkMethodName:d})}let g=wS_({mediaType:e,mediaTypeObject:t,context:n});if(g!=null&&g.schema!=null){let O=$b(g.schema,!1,n,a,u,l,!1);return nee.formUrlEncoded({schema:O,description:r,contentType:g.contentType,source:u,fullExamples:g.examples,additionalProperties:!1,sdkMethodName:d})}}function zFE({mediaTypeObject:e}){return of(e,Kf.SDK_METHOD_NAME)}var RFE={"application/json":"json"};function xFE(e){return e?RFE[e]:void 0}function PSc(e,t){if(!e.$ref.startsWith(nan))throw new Error(`Failed to resolve schema reference because of unsupported prefix: ${e.$ref}`);let r=YNi(e);if(r==null)throw new Error(`Failed to resolve schema reference because missing schema id: ${e.$ref}`);let i=t.components?.schemas?.[r];if(i==null)throw new Error(`Failed to resolve schema reference because missing: ${e.$ref}`);return Gd(i)?PSc(i,t):{id:r,schema:i}}function Xau({schema:e,isOptional:t,isArray:r,description:i}){return FFE(e)?Xau({schema:e.value,isOptional:!0,isArray:r,description:e.description}):LFE(e)?Xau({schema:e.value,isOptional:t,isArray:r,description:e.description}):UFE(e)?Xau({schema:e.value,isOptional:t,isArray:!0,description:e.description}):NFE(e)?{isFile:!0,isOptional:t??!1,isArray:r??!1,description:i??e.description}:{isFile:!1,isOptional:t??!1,isArray:r??!1,description:void 0}}function NFE(e){return e.type==="primitive"&&e.schema.type==="string"&&e.schema.format==="binary"}function FFE(e){return e.type==="optional"}function LFE(e){return e.type==="nullable"}function UFE(e){return e.type==="array"}function jS_(e,t){return t?.[e]?.contentType}var jSc={400:"BadRequestError",401:"UnauthorizedError",402:"PaymentRequiredError",403:"ForbiddenError",404:"NotFoundError",405:"MethodNotAllowedError",406:"NotAcceptableError",407:"ProxyAuthenticationRequiredError",408:"RequestTimeoutError",409:"ConflictError",410:"GoneError",411:"LengthRequiredError",412:"PreconditionFailedError",413:"ContentTooLargeError",414:"URITooLongError",415:"UnsupportedMediaTypeError",416:"RangeNotSatisfiableError",417:"ExpectationFailedError",418:"ImATeapotError",419:"AuthenticationTimeoutError",420:"MethodFailureError",421:"MisdirectedRequestError",422:"UnprocessableEntityError",423:"LockedError",424:"FailedDependencyError",425:"TooEarlyError",426:"UpgradeRequiredError",428:"PreconditionError",429:"TooManyRequestsError",430:"RequestHeaderFieldsTooLargeError",431:"RequestHeaderFieldsTooLargeError",444:"NoResponseError",449:"RetryWithError",450:"BlockedByWindowsParentalControlsError",451:"UnavailableForLegalReasonsError",498:"InvalidTokenError",499:"ClientClosedRequestError",500:"InternalServerError",501:"NotImplementedError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError",505:"HTTPVersionNotSupportedError",506:"VariantAlsoNegotiatesError",507:"InsufficientStorageError",508:"LoopDetectedError",509:"BandwidthLimitExceededError",510:"NotExtendedError",511:"NetworkAuthenticationRequiredError"},ES_=new Set(Object.values(jSc));var VFE=["200","201","202","204"];function AS_({operationContext:e,responses:t,context:r,responseBreadcrumbs:i,responseStatusCode:n,streamFormat:a,source:u}){if(t==null)return{value:void 0,errors:{}};let l=WFE({responses:t,context:r,source:u,namespace:r.namespace}),d=!1,s;for(let o of n!=null?[n]:VFE){let c=t[o];c!=null&&(d=!0,s==null&&(s=MS_({operationContext:e,response:c,context:r,responseBreadcrumbs:i,streamFormat:a,source:u,namespace:r.namespace,statusCode:typeof o=="string"?parseInt(o):o})))}if(s==null&&!d&&t.default!=null&&(s=MS_({operationContext:e,response:t.default,context:r,responseBreadcrumbs:i,streamFormat:a,source:u,namespace:r.namespace})),s!=null)switch(s.type){case"json":return{value:s,errors:l};case"streamingJson":case"streamingSse":return{value:s,errors:l};case"bytes":case"file":case"text":case"streamingText":return{value:s,errors:l};default:So(s)}return{value:void 0,errors:l}}function MS_({operationContext:e,streamFormat:t,response:r,context:i,responseBreadcrumbs:n,source:a,namespace:u,statusCode:l}){let d=Gd(r)?i.resolveResponseReference(r):r;if(d.content!=null&&Object.entries(d.content).find(([b,g])=>{if(g.schema==null)return!1;let O=Gd(g.schema)?i.resolveSchemaReference(g.schema):g.schema;return O.type==="string"&&O.format==="binary"}))return i.options.useBytesForBinaryResponse&&t==null?iB.bytes({description:d.description,source:a,statusCode:l}):iB.file({description:d.description,source:a,statusCode:l});let s=mS_(d.content??{},i);if(s!=null&&t!=null)switch(t){case"json":return iB.streamingJson({statusCode:l,description:d.description,responseProperty:of(e.operation,Kf.RESPONSE_PROPERTY),fullExamples:s.examples,schema:$b(s.schema,!1,i,n,a,u),source:a});case"sse":return iB.streamingSse({description:d.description,responseProperty:void 0,fullExamples:s.examples,schema:$b(s.schema,!1,i,n,a,u),source:a,statusCode:l})}let o=Yau({context:i,content:d.content??{}});if(o){if(t!=null)switch(t){case"json":return iB.streamingJson({description:d.description,responseProperty:void 0,fullExamples:o.examples,schema:$b(o.schema,!1,i,n,a,u),source:a,statusCode:l});case"sse":return iB.streamingSse({description:d.description,responseProperty:void 0,fullExamples:o.examples,schema:$b(o.schema,!1,i,n,a,u),source:a,statusCode:l})}return iB.json({description:d.description,schema:$b(o.schema,!1,i,n,a,u),responseProperty:of(e.operation,Kf.RESPONSE_PROPERTY),fullExamples:o.examples,source:a,statusCode:l})}for(let[c,b]of Object.entries(d.content??{})){let g=hq.parse(c);if(g!=null){if(g.isOctetStream()||g.isPDF()||g.isAudio()||g.isImage()||g.isVideo()||g.isMultiPartMixed())return iB.file({description:d.description,source:a,statusCode:l});if(g.isPlainText()){let O=b.schema;if(O==null)return iB.text({description:d.description,source:a,statusCode:l});let m=Gd(O)?i.resolveSchemaReference(O):O;return m.type==="string"&&m.format==="byte"?iB.file({description:d.description,source:a,statusCode:l}):iB.text({description:d.description,source:a,statusCode:l})}}}}function WFE({responses:e,context:t,source:r,namespace:i}){let n={};for(let[a,u]of Object.entries(e)){if(a==="default")continue;let l=parseInt(a);if(l<400||l>600)continue;let d=Gd(u)?t.resolveResponseReference(u):u,s=PS_(d.content??{},t),o=jSc[l];if(o==null){t.logger.warn(`No error name found for status code ${a}`);continue}n[l]={statusCode:l,nameOverride:void 0,generatedName:o,description:d.description,schema:$b(s?.schema??{},!1,t,[o,"Body"],r,i),fullExamples:s?.examples,source:r}}return n}function rPi({operationContext:e,context:t,responseStatusCode:r,suffix:i,streamFormat:n,source:a}){let{document:u,operation:l,path:d,method:s,baseBreadcrumbs:o}=e,c=of(l,Kf.IDEMPOTENT),b=of(l,[Kf.REQUEST_NAME_V1,Kf.REQUEST_NAME_V2]),g=[...o,"Request"],O=Jau({parameters:[...e.pathItemParameters,...e.operationParameters],context:t,requestBreadcrumbs:g,path:d,httpMethod:s,source:a}),m=/{([^}]+)}/g,E=[...d.matchAll(m)].map(I=>I[1]).filter(I=>!O.pathParameters.some(L=>L.name===I));if(E.length>0)for(let I of E)O.pathParameters.push({name:I??"",variableReference:void 0,parameterNameOverride:void 0,availability:void 0,source:a,schema:Al.primitive({schema:ap.string({default:void 0,example:void 0,format:void 0,maxLength:void 0,minLength:void 0,pattern:void 0}),description:void 0,generatedName:"",nameOverride:void 0,namespace:void 0,groupName:void 0,availability:void 0,title:void 0}),description:void 0});let q=(()=>{if(e.method==="GET")return[void 0];if(!l.requestBody)return[void 0];let I=Gd(l.requestBody)?t.resolveRequestBodyReference(l.requestBody):l.requestBody,L=Object.values(I.content).every(Y=>HFE({mediaTypeObject:Y})!=null),V=[];if(L)return V.push(...Object.entries(I.content).map(([Y,K])=>{let X=Dor({mediaType:Y,mediaTypeObject:K,description:I.description,document:u,context:new aan({document:t.document,taskContext:t.taskContext,options:t.options,source:t.source,namespace:t.namespace}),requestBreadcrumbs:g,source:a,namespace:t.namespace});return qS_({context:t,convertedParameters:O})&&X!=null&&(X.type==="json"||X.type==="formUrlEncoded")&&X.schema.type!=="object"&&l.requestBody!=null?X=Dor({mediaType:Y,mediaTypeObject:K,description:I.description,document:u,context:t,requestBreadcrumbs:[...g,"Body"],source:a,namespace:t.namespace}):l.requestBody!=null&&(X=Dor({mediaType:Y,mediaTypeObject:K,description:I.description,document:u,context:t,requestBreadcrumbs:[...g],source:a,namespace:t.namespace})),X}).filter(Y=>Y!=null)),V.length===0?[void 0]:V;{let Y=Zau({content:I.content,description:I.description,document:u,context:new aan({document:t.document,taskContext:t.taskContext,options:t.options,source:t.source,namespace:t.namespace}),requestBreadcrumbs:g,source:a,namespace:t.namespace});return qS_({context:t,convertedParameters:O})&&Y!=null&&(Y.type==="json"||Y.type==="formUrlEncoded")&&Y.schema.type!=="object"&&l.requestBody!=null?Y=Zau({content:I.content,description:I.description,document:u,context:t,requestBreadcrumbs:[...g,"Body"],source:a,namespace:t.namespace}):l.requestBody!=null&&(Y=Zau({content:I.content,description:I.description,document:u,context:t,requestBreadcrumbs:[...g],source:a,namespace:t.namespace})),[Y]}})(),M=[...o,"Response"],D=AS_({operationContext:e,streamFormat:n,responses:l.responses,context:t,responseBreadcrumbs:M,responseStatusCode:r,source:a}),C=bS_(l),R=vS_(e,l,t),G=of(l,Kf.SERVER_NAME_V2);return q.map(I=>({summary:l.summary,internal:of(l,JH.INTERNAL),idempotent:c,audiences:of(l,Kf.AUDIENCES)??[],operationId:l.operationId!=null&&i!=null?l.operationId+"_"+i:l.operationId,tags:t.resolveTagsToTagIds(l.tags),namespace:t.namespace,sdkName:$FE({operationContext:e,request:I}),pathParameters:O.pathParameters,queryParameters:O.queryParameters,headers:O.headers,requestNameOverride:b??void 0,generatedRequestName:Q8(g,t.options.preserveSchemaIds),request:I,response:D.value,errors:D.errors,servers:G!=null?[{name:G,url:void 0,audiences:void 0}]:(l.servers??[]).map(L=>Qau(L)),description:l.description,authed:GFE(l,u),availability:C,method:s,path:d,examples:R,pagination:e.pagination,source:a}))}function HFE({mediaTypeObject:e}){return of(e,Kf.SDK_METHOD_NAME)}function $FE({operationContext:e,request:t}){return!t||!t.sdkMethodName?e.sdkMethodName:e.sdkMethodName?{groupName:[...e.sdkMethodName.groupName],methodName:t.sdkMethodName??e.sdkMethodName.methodName}:{groupName:[],methodName:t.sdkMethodName}}function GFE(e,t){return e.security!=null?Object.keys(e.security).length>0:t.security!=null?Object.keys(t.security).length>0:!1}function qS_({context:e,convertedParameters:t}){return e.options.inlinePathParameters&&t.pathParameters.length>0||t.queryParameters.length>0||t.headers.length>0}function CS_({operationContext:e,context:t,asyncExtension:r,source:i}){let{operation:n,pathItemParameters:a,operationParameters:u}=e,l=r.discriminant.name,d=r.discriminant.value,s=r["response-status-code"],o=TS_({context:t,headerToIgnore:l,parameters:a}),c=TS_({context:t,headerToIgnore:l,parameters:u}),b=rPi({operationContext:{...e,pathItemParameters:o,operationParameters:c,operation:{...n,responses:Object.fromEntries(Object.entries(n.responses).filter(([O])=>parseInt(O)!==s))}},context:t,streamFormat:void 0,source:i}),g=rPi({operationContext:{...e,pathItemParameters:o,operationParameters:c,baseBreadcrumbs:[...e.baseBreadcrumbs,"async"]},context:t,suffix:"async",responseStatusCode:s,streamFormat:void 0,source:i});return g.forEach(O=>{O.headers.push({name:l,schema:Al.literal({nameOverride:void 0,generatedName:Q8([l],t.options.preserveSchemaIds),title:void 0,description:void 0,availability:void 0,value:Kz.string(d),namespace:void 0,groupName:void 0}),description:void 0,parameterNameOverride:void 0,env:void 0,availability:void 0,source:i})}),{sync:b,async:g}}function TS_({context:e,headerToIgnore:t,parameters:r}){return r.filter(i=>{let n=Gd(i)?e.resolveParameterReference(i):i;return!(n.in==="header"&&n.name===t)})}var wSc="stream";function RS_({operationContext:e,context:t,streamingExtension:r}){switch(r.type){case"stream":return{streaming:rPi({operationContext:e,context:t,streamFormat:r.format,source:t.source}),nonStreaming:[]};case"streamCondition":{let i=BS_({context:t,operation:e.operation,streamingExtension:r,isStreaming:!0});if(i?.schemaReference!=null){let s=YNi(i.schemaReference);s!=null&&t.excludeSchema(s)}let n=IS_({operation:e.operation,response:r.responseStream}),a=rPi({operationContext:{...e,sdkMethodName:e.sdkMethodName!=null?{groupName:e.sdkMethodName.groupName,methodName:e.sdkMethodName.methodName+"_"+wSc}:void 0,operation:{...e.operation,description:r.streamDescription??e.operation.description,requestBody:i?.requestBody,responses:n},baseBreadcrumbs:[...e.baseBreadcrumbs,wSc]},context:t,streamFormat:r.format,suffix:wSc,source:t.source});a.forEach(s=>{s.examples=s.examples.filter(o=>zS_(o,t)!==!1)});let u=BS_({context:t,operation:e.operation,streamingExtension:r,isStreaming:!1}),l=IS_({operation:e.operation,response:r.response}),d=rPi({streamFormat:void 0,operationContext:{...e,operation:{...e.operation,requestBody:u?.requestBody,responses:l}},context:t,source:t.source});return d.forEach(s=>{s.examples=s.examples.filter(o=>zS_(o,t)!==!0)}),{streaming:a,nonStreaming:d}}default:So(r)}}function BS_({context:e,operation:t,streamingExtension:r,isStreaming:i}){if(t.requestBody==null)return;let n=Gd(t.requestBody)?e.resolveRequestBodyReference(t.requestBody):t.requestBody,a=Yau({content:n.content,context:e});if(a==null)return;let u=Gd(a.schema)?e.resolveSchemaReference(a.schema):a.schema;if(u.allOf==null&&u.properties==null)return;let l=u.properties?.[r.streamConditionProperty];l!=null&&Gd(l)&&(l=void 0);let d={...u,properties:{...u.properties,[r.streamConditionProperty]:{type:"boolean","x-fern-boolean-literal":i,...l??{}}},title:void 0,required:[...u.required??[],r.streamConditionProperty]};return{requestBody:{content:{[hq.APPLICATION_JSON]:{schema:d}}},schemaReference:Gd(a.schema)?a.schema:void 0}}function IS_({operation:e,response:t}){return{...e.responses,200:{description:"",content:{[hq.APPLICATION_JSON]:{schema:t}}}}}function zS_(e,t){return e._visit({unknown:r=>{let i=MF.serialization.ExampleEndpointCallSchema.parse(r);if(i.ok&&i.value.response!=null)return i.value.response.stream!=null},full:()=>{},_other:()=>{}})}function xS_({context:e,operationContext:t,source:r}){let{document:i,operation:n,path:a,method:u,baseBreadcrumbs:l,sdkMethodName:d}=t,s=[...l,"Payload"],o=Jau({parameters:[...t.pathItemParameters,...t.operationParameters],context:e,requestBreadcrumbs:s,path:a,httpMethod:u,source:r});if(n.requestBody==null)return e.logger.error(`Skipping webhook ${u.toUpperCase()} ${a}: Missing a request body`),[];let c=n.operationId;if(c==null)return e.logger.error(`Skipping webhook ${a} because no operation id present`),[];if(u!=="POST"&&u!=="GET")return e.logger.error(`Skipping webhook ${u.toUpperCase()} ${a}: Not POST or GET`),[];let b=Gd(n.requestBody)?e.resolveRequestBodyReference(n.requestBody):n.requestBody;return Object.entries(b.content).map(([g,O])=>Dor({mediaType:g,mediaTypeObject:O,description:b.description,document:i,context:e,requestBreadcrumbs:[...l,"Payload"],source:r,namespace:e.namespace})).filter(g=>g!=null).map(g=>{if(g==null||g.type!=="json"&&g.type!=="formUrlEncoded"){e.logger.error(`Skipping webhook ${a} because non-json and non-formUrlEncoded request body`);return}return{summary:n.summary,audiences:of(n,Kf.AUDIENCES)??[],sdkName:d,namespace:e.namespace,method:u,operationId:c,tags:e.resolveTagsToTagIds(n.tags),headers:o.headers,generatedPayloadName:Q8(s,e.options.preserveSchemaIds),payload:g.schema,description:n.description,examples:QFE(g.fullExamples),source:r}}).filter(g=>g!=null)}function QFE(e){if(e==null)return[];let t=[];for(let r of e){let i=ZNi(r.value);i!=null&&t.push({description:r.description,name:r.name,payload:i})}return t}function SSc({context:e,pathItemContext:t,operation:r,convertToWebhook:i}){let n=of(r,Kf.IGNORE);if(n!=null&&n){e.logger.debug(`${t.method.toUpperCase()} ${t.path} is marked with x-fern-ignore. Skipping.`);return}let a=JFE(r,e),u=cS_(e.document,r),l={...t,sdkMethodName:a,baseBreadcrumbs:KFE({operation:r,sdkMethodName:a,httpMethod:t.method,path:t.path,shouldUseIdiomaticRequestNames:e.options.shouldUseIdiomaticRequestNames}),operation:r,operationParameters:r.parameters??[],pagination:u};if(i)return{type:"webhook",value:xS_({context:e,operationContext:l,source:e.source})};let d=uS_(r);if(d!=null){let c=RS_({context:e,operationContext:l,streamingExtension:d});return c!=null?{type:"streaming",streaming:c.streaming,nonStreaming:c.nonStreaming}:void 0}let s=aS_(r);if(s!=null){let c=CS_({context:e,operationContext:l,asyncExtension:s,source:e.source});return{type:"async",async:c.async,sync:c.sync}}return{type:"http",value:rPi({context:e,operationContext:l,streamFormat:void 0,source:e.source})}}function JFE(e,t){let r=of(e,Kf.SDK_METHOD_NAME),i=of(e,Kf.SDK_GROUP_NAME)??[];if(r!=null){let n=typeof i=="string"?[i]:i;return n=t.resolveGroupName(n),{groupName:n,methodName:r}}}function KFE({sdkMethodName:e,operation:t,httpMethod:r,path:i,shouldUseIdiomaticRequestNames:n}){let a=[];if(e!=null){if(n&&a.push(e.methodName),e.groupName.length>0){let u=e.groupName[e.groupName.length-1];u!=null&&a.push(typeof u=="string"?u:u.name)}n||a.push(e.methodName)}else t.operationId!=null?a.push(t.operationId):a.push(S_(`${r}_${i.split("/").join("_")}`));return a}function NS_(e,t,r,i){let n=[],a=LS_(t),u={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let l of a){if(i.filter.skipEndpoint({method:l.method,path:e})){i.logger.debug(`Skipping endpoint "${l.method} ${e}"`);continue}let d=YFE({operation:l.operation}),s=SSc({context:i,pathItemContext:{...u,method:l.method},operation:l.operation,convertToWebhook:d});s&&n.push(s)}return n}function FS_(e,t,r,i){let n=[],a=LS_(t),u={document:r,pathItem:t,path:e,pathItemParameters:t.parameters??[]};for(let l of a){if(i.filter.skipEndpoint({method:l.method,path:e})){i.logger.debug(`Skipping endpoint "${l.method} ${e}"`);continue}let d=SSc({context:i,pathItemContext:{...u,method:l.method},operation:l.operation,convertToWebhook:!0});d&&n.push(d)}return n}function LS_(e){let t=[];return e.get!=null&&t.push({method:QH.Get,operation:e.get}),e.post!=null&&t.push({method:QH.Post,operation:e.post}),e.put!=null&&t.push({method:QH.Put,operation:e.put}),e.delete!=null&&t.push({method:QH.Delete,operation:e.delete}),e.patch!=null&&t.push({method:QH.Patch,operation:e.patch}),e.head!=null&&t.push({method:QH.Head,operation:e.head}),t}function YFE({operation:e}){return of(e,[Kf.WEBHOOK])??!1}function US_(e){let t=of(e,Kf.BASIC_AUTH_USERNAME_VARIABLE_NAME),r=of(e,Kf.BASIC_AUTH_PASSWORD_VARIABLE_NAME);return{usernameVariable:t,passwordVariable:r}}function VS_(e){return of(e,Kf.FERN_BASIC_AUTH)}function DSc(e,t){if(Gd(e))throw new Error(`Converting referenced security schemes is unsupported: ${JSON.stringify(e)}`);return XFE(e,t)}function XFE(e,t){if(e.type==="apiKey"&&e.in==="header"){let r=of(e,JH.BEARER_FORMAT),i=of(e,Kf.FERN_HEADER_AUTH);return JL.header({headerName:e.name,prefix:r!=null?"Bearer":i?.prefix,headerVariableName:i?.name??of(e,Kf.HEADER_VARIABLE_NAME),headerEnvVar:i?.env})}else if(e.type==="http"&&e.scheme?.toLowerCase()==="bearer"){let r=of(e,Kf.FERN_BEARER_TOKEN);return JL.bearer({tokenVariableName:r?.name??of(e,Kf.BEARER_TOKEN_VARIABLE_NAME),tokenEnvVar:r?.env})}else if(e.type==="http"&&e.scheme?.toLowerCase()==="basic"){let r=VS_(e),i=US_(e);return JL.basic({usernameVariableName:r?.username?.name??i.usernameVariable,usernameEnvVar:r?.username?.env,passwordVariableName:r?.password?.name??i.passwordVariable,passwordEnvVar:r?.password?.env})}else{if(e.type==="openIdConnect")return JL.bearer({tokenVariableName:void 0,tokenEnvVar:void 0});if(e.type==="oauth2")return JL.oauth({scopesEnum:ZFE(e,t)})}}function ZFE(e,t){let r=e.flows.authorizationCode?.scopes??e.flows.clientCredentials?.scopes??e.flows.implicit?.scopes??e.flows.password?.scopes;if(r!=null){let i=KNi({nameOverride:void 0,generatedName:"OauthScope",title:void 0,enumValues:Object.keys(r),fernEnum:Object.fromEntries(Object.entries(r).map(([a,u])=>[a,{description:u}])),_default:void 0,description:void 0,availability:void 0,enumVarNames:void 0,wrapAsNullable:!1,namespace:void 0,groupName:void 0,context:void 0,source:t,inline:void 0}),n=iA(i);if(n.type==="enum")return n}}function WS_(e){return of(e,Kf.BASE_PATH)}var kFE=Su.record(Su.string(),Su.object({summary:Su.string().optional(),description:Su.string().optional()}));function HS_({document:e,context:t}){return K5a(e,Kf.GROUPS,kFE,t.logger)}function $S_({context:e,document:t}){return of(t,Kf.FERN_VERSION)??void 0}function GS_(e){let t=of(e,Kf.FERN_GLOBAL_HEADERS),r=[];for(let i of t??[])r.push({...i,schema:i.type!=null?Y5a({fernType:i.type,description:void 0,availability:void 0,generatedName:i.name??i.header,title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function QS_(e){let t=of(e,Kf.FERN_IDEMPOTENCY_HEADERS),r=[];for(let i of t??[])r.push({...i,schema:i.type!=null?Y5a({fernType:i.type,description:void 0,availability:void 0,generatedName:i.name??i.header,title:void 0,namespace:void 0,groupName:void 0,nameOverride:void 0}):void 0});return r}function JS_(e,t){let r=of(e,Kf.SDK_VARIABLES);return r==null?{}:Object.fromEntries(Object.entries(r).map(([i,n])=>{if(n.type==="string")return[i,{nameOverride:void 0,generatedName:Q8([i],t),title:n.title,schema:jw.string({default:qKn(n),pattern:n.pattern,format:n.format,minLength:n.minLength,maxLength:n.maxLength}),description:n.description,availability:void 0,namespace:void 0,groupName:void 0}];throw new Error(`Variable ${i} has unsupported schema ${JSON.stringify(n)}`)}))}var e3E="webhooks";function KS_(e){return of(e,e3E)??{}}var kau=class extends zKn{nonRequestReferencedSchemas=new Set;twoOrMoreRequestsReferencedSchemas=new Set;singleRequestReferencedSchemas=new Set;discriminatedUnionReferences={};discriminatedUnionMetadata={};schemasToExclude=new Set;constructor({document:t,taskContext:r,authHeaders:i,options:n,source:a,namespace:u}){super({document:t,taskContext:r,authHeaders:i,options:n,source:a,namespace:u})}getDummy(){return new aan({document:this.document,taskContext:this.taskContext,options:this.options,source:this.source,namespace:this.namespace})}markSchemaAsReferencedByNonRequest(t){this.nonRequestReferencedSchemas.add(t)}markSchemaAsReferencedByRequest(t){this.singleRequestReferencedSchemas.has(t)?this.twoOrMoreRequestsReferencedSchemas.add(t):this.singleRequestReferencedSchemas.add(t)}getReferencedSchemas(){return new Set([...this.nonRequestReferencedSchemas,...this.twoOrMoreRequestsReferencedSchemas])}markReferencedByDiscriminatedUnion(t,r,i){let n=this.discriminatedUnionReferences[t.$ref];n!=null?(n.discriminants.add(r),n.numReferences+=i):this.discriminatedUnionReferences[t.$ref]={discriminants:new Set([r]),numReferences:i}}getReferencesFromDiscriminatedUnion(t){return this.discriminatedUnionReferences[t.$ref]}markSchemaWithDiscriminantValue(t,r,i){let n=this.discriminatedUnionMetadata[t.$ref];n!=null?n.discriminants.set(r,i):this.discriminatedUnionMetadata[t.$ref]={discriminants:new Map([[r,i]])}}getDiscriminatedUnionMetadata(t){return this.discriminatedUnionMetadata[t.$ref]}excludeSchema(t){this.schemasToExclude.add(t)}isSchemaExcluded(t){return this.schemasToExclude.has(t)}};function YS_(e){return of(e,Kf.RESOLUTIONS)}function XS_({openapi:e}){let t=YS_(e);if(t==null)return e;let r={};for(let i of t){let n=`#/components/schemas/${i.name}`;for(let a of i.resolutions)e=t3E({openapi:e,schemaReference:a,schemaName:i.name}),e=ZS_({openapi:e,replaceReference:a,schemaReference:n,replacedReferences:r}),r={...r,...Object.fromEntries(i.resolutions.map(u=>[n,u]))}}return e}function t3E({openapi:e,schemaReference:t,schemaName:r}){let i=t.replace("#/","").split("/").map(a=>a.replaceAll("~1","/")),n=e;for(let a of i){let u=n[a];if(u==null)return e;n=u}return e.components==null&&(e.components={}),e.components.schemas==null&&(e.components.schemas={}),e.components.schemas[r]=n,e}function ZS_({openapi:e,replaceReference:t,schemaReference:r,replacedReferences:i}){let n=Object.keys(i).filter(d=>t.startsWith(d)).sort((d,s)=>s.length-d.length)[0];if(n!=null){let d=i[n];if(d!=null){let s=r.replace(n,d);return ZS_({openapi:e,replaceReference:t,schemaReference:s,replacedReferences:{}})}}let a=t.replace("#/","").split("/").map(d=>d.replaceAll("~1","/")),u=e;for(let d of a.slice(0,-1)){let s=u[d];if(s==null)return e;u=s}let l=a[a.length-1];return l==null||(u[l]={$ref:r}),e}function eD_({openApi:e,taskContext:t,options:r,source:i,namespace:n}){e=XS_({openapi:e});let a=Object.fromEntries(Object.entries(e.components?.securitySchemes??{}).map(([I,L])=>DSc(L,i)==null?[]:[I,DSc(L,i)])),u=new Set(...Object.entries(a).map(([I,L])=>L.type==="basic"||L.type==="bearer"?"Authorization":L.type==="header"?L.headerName:null)),l=JS_(e,r.preserveSchemaIds),d=GS_(e),s=QS_(e),o=r.audiences??[],c=[],b=[],g=new kau({document:e,taskContext:t,authHeaders:u,options:r,source:i,namespace:n});g.filter.hasEndpoints()&&t.logger.debug("Endpoint filter applied..."),Object.entries(e.paths??{}).forEach(([I,L])=>{if(L==null)return;t.logger.debug(`Converting path ${I}`);let V=NS_(I,L,e,g);for(let Y of V){let K=kS_({operation:Y});if(!(o.length>0&&!o.some(X=>K.includes(X))))switch(Y.type){case"async":c.push(...Y.sync),c.push(...Y.async);break;case"http":c.push(...Y.value);break;case"streaming":c.push(...Y.streaming),Y.nonStreaming&&c.push(...Y.nonStreaming);break;case"webhook":b.push(...Y.value);break;default:So(Y)}}}),Object.entries(KS_(e)).forEach(([I,L])=>{if(L==null)return;t.logger.debug(`Converting path ${I}`);let V=FS_(I,L,e,g);for(let Y of V){let K=kS_({operation:Y});o.length>0&&!o.some(X=>K.includes(X))||b.push(...Y.value)}});let O=Object.fromEntries(Object.entries(e.components?.schemas??{}).map(([I,L])=>{let V=of(L,Kf.SDK_NAMESPACE);if(!Gd(L)){let Y=of(L,Kf.IGNORE);if(Y!=null&&Y)return[];if(ES_.has(I))return[I,$b({...L,"x-fern-type-name":`${I}Body`},!1,g,[I],i,V??n)]}return[I,$b(L,!1,g,[I],i,V??n)]}).filter(I=>I.length>0)),m=r3E(O,g,i),w=i3E(m,g),E={};for(let[I,L]of Object.entries(w)){let V=iA(L);g.isSchemaExcluded(I)||(E[I]=V,t.logger.debug(`Converted schema ${I}`))}let q=new kNi(w,g.nonRequestReferencedSchemas,g),M=b.map(I=>{let V=I.examples;if(!r.disableExamples&&V.length===0){let Y=q.buildExample({schema:I.payload,exampleId:void 0,example:void 0,skipReadonly:!1,options:{ignoreOptionals:!1,isParameter:!1}});Y!=null&&(V=[{name:void 0,description:void 0,payload:Y}])}return{...I,payload:iA(I.payload),examples:V}}),D=new Uau(w,g,d),C=c.map(I=>{let L=I.examples,V=L;if(!r.disableExamples&&(L.length===0||L.every(Z5a))){let X=D.buildEndpointExample(I);X.length>0&&(V=[...X,...L.filter(oe=>!Z5a(oe))])}let Y=I.request,K=I.response;return{...I,request:Y?.type==="json"||Y?.type==="formUrlEncoded"?{...Y,schema:iA(Y.schema)}:Y,response:K?.type==="json"?{...K,schema:iA(K.schema)}:K,queryParameters:I.queryParameters.map(X=>({description:X.description,name:X.name,schema:iA(X.schema),parameterNameOverride:X.parameterNameOverride,availability:X.availability,source:X.source})),pathParameters:I.pathParameters.map(X=>({description:X.description,name:X.name,schema:iA(X.schema),parameterNameOverride:X.parameterNameOverride,variableReference:X.variableReference,availability:X.availability,source:X.source})),headers:I.headers.map(X=>({description:X.description,name:X.name,schema:iA(X.schema),parameterNameOverride:X.parameterNameOverride,env:X.env,availability:X.availability,source:X.source})),examples:V,errors:_d(I.errors,X=>{let oe=X.fullExamples?.map(pe=>{let de=ZNi(pe.value);if(de!=null)return{name:pe.name,description:pe.description,example:de}}).filter(iv);if(oe?.length===0){let pe=q.buildExample({schema:X.schema,example:void 0,exampleId:void 0,skipReadonly:!1,options:{ignoreOptionals:!1,isParameter:!1}});pe!=null&&oe.push({name:void 0,description:void 0,example:pe})}return{generatedName:X.generatedName,nameOverride:X.nameOverride,schema:iA(X.schema),description:X.description,source:X.source,examples:oe}})}}),R=HS_({document:e,context:g});return{apiVersion:$S_({context:g,document:e}),basePath:WS_(e),title:e.info.title??"",description:e.info.description,groups:Object.fromEntries(Object.entries(R??{}).map(([I,L])=>[I,{summary:L.summary??void 0,description:L.description??void 0}])),servers:(e.servers??[]).map(I=>Qau(I)),websocketServers:[],tags:{tagsById:Object.fromEntries((e.tags??[]).map(I=>[I.name,{id:I.name,description:I.description}])),orderedTagIds:e.tags?.map(I=>I.name)},endpoints:C,webhooks:M,channels:{},groupedSchemas:BKn(n,E),securitySchemes:a,hasEndpointsMarkedInternal:C.some(I=>I.internal),nonRequestReferencedSchemas:g.getReferencedSchemas(),variables:l,globalHeaders:d,idempotencyHeaders:s}}function r3E(e,t,r){let i={};for(let[n,a]of Object.entries(e)){if(a.type!=="object"){i[n]=a;continue}let u={$ref:`#/components/schemas/${n}`},l=t.getReferencesFromDiscriminatedUnion(u);if(l==null){i[n]=a;continue}let d={...a,type:"object",properties:a.properties.filter(o=>!l.discriminants.has(o.key)),allOfPropertyConflicts:a.allOfPropertyConflicts.filter(o=>!l.discriminants.has(o.propertyKey)),source:r};i[n]=d;let s=tD_({schema:a,schemas:e});for(let o of[...new Set(s)]){let c=i[o]??e[o];c==null||c.type!=="object"||(i[o]={...c,type:"object",properties:c.properties.filter(b=>!l.discriminants.has(b.key)),allOfPropertyConflicts:c.allOfPropertyConflicts.filter(b=>!l.discriminants.has(b.propertyKey))})}}return i}function i3E(e,t){let r={};for(let[i,n]of Object.entries(e)){if(n.type!=="object"){r[i]=n;continue}let a={$ref:`#/components/schemas/${i}`},u=t.getDiscriminatedUnionMetadata(a);if(u==null){r[i]=n;continue}let l=[];for(let s of n.properties)if(u.discriminants.has(s.key)){let o=u.discriminants.get(s.key);o!=null&&l.push({...s,schema:Al.literal({nameOverride:void 0,generatedName:Q8([n.generatedName,o],t.options.preserveSchemaIds),title:void 0,value:Kz.string(o),namespace:void 0,groupName:void 0,description:void 0,availability:n.availability})})}else l.push(s);let d={...n,type:"object",properties:l};r[i]=d}return r}function tD_({schema:e,schemas:t}){let r=[];for(let i of e.allOf){r.push(i.schema);let n=t[i.schema];n!=null&&n.type==="object"&&r.push(...tD_({schema:n,schemas:t}))}return r}function eou(e){return[...new Set(e)]}function kS_({operation:e}){let t=[];switch(e.type){case"async":t=eou(e.async.flatMap(r=>r.audiences));break;case"http":t=eou(e.value.flatMap(r=>r.audiences));break;case"streaming":t=eou(e.streaming.flatMap(r=>r.audiences));break;case"webhook":t=eou(e.value.flatMap(r=>r.audiences));break;default:So(e)}return t}function oan({context:e,documents:t,options:r}){let i={apiVersion:void 0,title:void 0,description:void 0,basePath:void 0,servers:[],websocketServers:[],tags:{tagsById:{},orderedTagIds:void 0},hasEndpointsMarkedInternal:!1,endpoints:[],webhooks:[],channels:{},groupedSchemas:{rootSchemas:{},namespacedSchemas:{}},variables:{},nonRequestReferencedSchemas:new Set,securitySchemes:{},globalHeaders:[],idempotencyHeaders:[],groups:{}};for(let n of t){let a=n.source!=null?n.source:nK.openapi({file:"<memory>"});switch(n.type){case"openapi":{let u=eD_({taskContext:e,openApi:n.value,options:gQt({options:n.settings,overrides:r}),source:a,namespace:n.namespace});i=a3E(i,u);break}case"asyncapi":{let u=nS_({document:n.value,taskContext:e,options:gQt({options:n.settings,overrides:r}),source:a,asyncApiOptions:n3E({options:n.settings}),namespace:n.namespace});u.servers!=null&&(i.websocketServers=[...i.websocketServers,...u.servers.map(l=>({...l,audiences:void 0,description:void 0}))]),u.channels!=null&&(i.channels={...i.channels,...u.channels}),u.groupedSchemas!=null&&(i.groupedSchemas=rD_(i.groupedSchemas,u.groupedSchemas)),u.basePath!=null&&(i.basePath=u.basePath);break}default:So(n)}}return i}function n3E({options:e,overrides:t}){return{naming:t?.naming??e?.asyncApiNaming??S1_.naming}}function a3E(e,t){return{apiVersion:e.apiVersion??t.apiVersion,title:e.title??t.title,description:e.description??t.description,basePath:e.basePath??t.basePath,servers:[...e.servers,...t.servers],websocketServers:[...e.websocketServers,...t.websocketServers],tags:{tagsById:{...e.tags.tagsById,...t.tags.tagsById},orderedTagIds:e.tags.orderedTagIds==null&&t.tags.orderedTagIds==null?void 0:[...e.tags.orderedTagIds??[],...t.tags.orderedTagIds??[]]},hasEndpointsMarkedInternal:e.hasEndpointsMarkedInternal||t.hasEndpointsMarkedInternal,endpoints:[...e.endpoints,...t.endpoints],webhooks:[...e.webhooks,...t.webhooks],channels:{...e.channels,...t.channels},groupedSchemas:rD_(e.groupedSchemas,t.groupedSchemas),variables:{...e.variables,...t.variables},nonRequestReferencedSchemas:new Set([...e.nonRequestReferencedSchemas,...t.nonRequestReferencedSchemas]),securitySchemes:{...e.securitySchemes,...t.securitySchemes},globalHeaders:e.globalHeaders!=null?[...e.globalHeaders,...t.globalHeaders??[]]:void 0,idempotencyHeaders:e.idempotencyHeaders!=null?[...e.idempotencyHeaders,...t.idempotencyHeaders??[]]:void 0,groups:{...e.groups,...t.groups}}}function rD_(e,t){e.rootSchemas={...e.rootSchemas,...t.rootSchemas};for(let[r,i]of Object.entries(t.namespacedSchemas))e.namespacedSchemas[r]!=null?e.namespacedSchemas[r]={...e.namespacedSchemas[r],...i}:e.namespacedSchemas[r]=i;return e}var Ez_=si(Ycu(),1),Xcu={config:new Ez_.Config({apis:{},styleguide:{plugins:[lSc],rules:{struct:"warn"}}},void 0),dereference:!1,removeUnusedComponents:!1,keepUrlRefs:!0};function CYn(e){if(e.settings==null&&e.raw?.api?.auth==null)return;let t={detectGlobalHeaders:!0};return e.settings?.unions==="v1"&&(t.discriminatedUnionV2=!0),e.raw?.api?.auth!=null&&(t.auth=e.raw?.api?.auth),t}function aLa(e){return e.swagger!=null}function Fqc(e){return e.openapi!=null}function oLa({options:e,overrides:t}={}){return{...gQt({options:e,overrides:t}),...x5a({options:e,overrides:t})}}function EFi(e,t={}){return{...Object.fromEntries(I3(e.namedDefinitionFiles).map(([r,i])=>[r,{...i,defaultUrl:t.defaultURL}])),...I3(e.importedDefinitions).reduce((r,[i,n])=>({...r,...Dza(EFi(n.definition,{defaultURL:n.url}),(a,u)=>PF(i,fy.of(u)))}),{})}}function uLa(e,t={}){return{...Object.fromEntries(I3(e.packageMarkers).map(([r,i])=>[r,{...i,defaultUrl:t.defaultURL}])),...I3(e.importedDefinitions).reduce((r,[i,n])=>({...r,...Dza(uLa(n.definition,{defaultURL:n.url}),(a,u)=>PF(i,fy.of(u)))}),{})}}function OPi(e){return{...uLa(e),...EFi(e)}}function gue(e,t){return OPi(e.definition)[t]?.contents}function m7(e,t){for(let[r,i]of I3(OPi(e.definition)))t(r,i.contents,{isPackageMarker:lki(r)===fS,defaultUrl:i.defaultUrl})}function Can(e,t){for(let[r,i]of I3(uLa(e.definition)))t(r,i.contents)}function p7e({breadcrumbs:e=[],title:t,subtitle:r}){let i=[];return e.length>0&&i.push(Ds.blue(e.join(" -> "))),i.push(t),r!=null&&i.push(Ds.dim(r)),i.join(`
|