fern-api 3.35.1 → 3.35.2

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.
Files changed (2) hide show
  1. package/cli.cjs +8 -8
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1145,7 +1145,7 @@ ${qI_.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&ZPc(th
1145
1145
  `+o_n.default.red(">> ")+t),this.screen.render(r,i)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?o_n.default.cyan(VI_(t,this.opt.mask)):o_n.default.italic(o_n.default.dim("[hidden]")):this.opt.mask?VI_(t,this.opt.mask):o_n.default.italic(o_n.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 HHo=ce(GT(),1);var VC_=ce(qjc(),1),WHo=require("child_process"),x2n=require("fs"),VHo=ce(require("path"),1),WC_=ce(require("os"),1),GC_=require("crypto"),b0c=ce(UC_(),1);var QHo=class extends Error{originalError;constructor(t){super(`Failed to create temporary file. ${t.message}`),this.originalError=t}};var vWa=class extends Error{originalError;constructor(t){super(`Failed to launch editor. ${t.message}`),this.originalError=t}};var UHo=class extends Error{originalError;constructor(t){super(`Failed to read temporary file. ${t.message}`),this.originalError=t}};var LHo=class extends Error{originalError;constructor(t){super(`Failed to remove temporary file. ${t.message}`),this.originalError=t}};function GHo(e="",t,r){let i=new v0c(e,r);i.runAsync((n,a)=>{if(n)setImmediate(t,n,void 0);else try{i.cleanup(),setImmediate(t,void 0,a)}catch(o){setImmediate(t,o,void 0)}})}function LC_(e){return e?e.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function DxM(e){let t=[],r="";for(let i=0;i<e.length;i++){let n=e.charAt(i);i>0&&n===" "&&e[i-1]!=="\\"&&r.length>0?(t.push(r),r=""):r=`${r}${n}`}return r.length>0&&t.push(r),t}var v0c=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(t="",r){this.text=t,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(t){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(t,void 0,this.text)}catch(r){setImmediate(t,r,void 0)}})}catch(r){setImmediate(t,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let t=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=DxM(t).map(n=>n.replace("\\ "," ")),i=r.shift();this.editor={args:r,bin:i}}createTemporaryFile(){try{let t=this.fileOptions.dir??WC_.default.tmpdir(),r=(0,GC_.randomUUID)(),i=LC_(this.fileOptions.prefix),n=LC_(this.fileOptions.postfix),a=`${i}${r}${n}`,o=VHo.default.resolve(t,a),c=VHo.default.resolve(t)+VHo.default.sep;if(!o.startsWith(c))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let d={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(d.mode=this.fileOptions.mode),(0,x2n.writeFileSync)(this.tempFile,this.text,d)}catch(t){throw new QHo(t)}}readTemporaryFile(){try{let t=(0,x2n.readFileSync)(this.tempFile);if(t.length===0)this.text="";else{let r=(0,VC_.detect)(t)??"utf8";b0c.default.encodingExists(r)||(r="utf8"),this.text=b0c.default.decode(t,r)}}catch(t){throw new UHo(t)}}removeTemporaryFile(){try{(0,x2n.unlinkSync)(this.tempFile)}catch(t){throw new LHo(t)}}launchEditor(){try{let t=(0,WHo.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=t.status??0}catch(t){throw new vWa(t)}}launchEditorAsync(t){try{(0,WHo.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",i=>{this.lastExitStatus=i,setImmediate(t)})}catch(r){throw new vWa(r)}}};var HC_=ce(Wbe(),1);var gWa=class extends HT{_run(t){this.done=t,this.editorResult=new HC_.Subject;let r=S4(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"?HHo.default.dim("Received"):HHo.default.dim("Press <enter> to launch your preferred editor."),t&&(r=HHo.default.red(">> ")+t),this.screen.render(i,r)}startExternalEditor(){this.rl.pause(),GHo(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 YC_=require("stream");var JC_=ce(require("readline"),1),$C_=ce(KC_(),1),l_n=class{constructor(t){this.rl||=JC_.default.createInterface(IxM(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 IxM(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 $C_.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var OWa=class extends l_n{constructor(t={}){super(t),this.log=new YC_.Writable({write:(r,i,n)=>{this.writeLog(r),n()}}),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return iWa(this.rl,this.bottomBar.split(`
1146
1146
  `).length),this}updateBottomBar(t){return iWa(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+`
1147
1147
  `}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&&pHo(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var WO=ce(Wbe(),1),kC_=ce(j8a(),1);var xHo=ce(Wbe(),1),XC_=ce(j8a(),1),KHo=function(e,t,r){return typeof e[t]!="function"?(0,xHo.of)(e):(0,xHo.from)((0,XC_.default)(e[t])(r).then(i=>(e[t]=i,e)))};var ZC_={set:(e,t="",r)=>{let i=e;t.split(".").forEach((n,a,o)=>{n==="__proto__"||n==="constructor"||(a===o.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((o,c)=>o!=null?o[c]:o,e),n=i(/[,[\]]+?/)||i(/[,.[\]]+?/);return n===void 0||n===e?r:n}},K2n=class extends l_n{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,WO.from)(t):(0,WO.isObservable)(t)?i=t:Object.values(t).every(n=>typeof n=="object"&&!Array.isArray(n)&&n!=null)?i=(0,WO.from)(Object.entries(t).map(([n,a])=>({name:n,...a}))):i=(0,WO.from)([t]),this.process=i.pipe((0,WO.concatMap)(this.processQuestion.bind(this)),(0,WO.publish)()),this.process.connect(),this.process.pipe((0,WO.reduce)((n,a)=>(ZC_.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,WO.defer)(()=>(0,WO.of)(t).pipe((0,WO.concatMap)(this.setDefaultType.bind(this)),(0,WO.concatMap)(this.filterIfRunnable.bind(this)),(0,WO.concatMap)(()=>KHo(t,"message",this.answers)),(0,WO.concatMap)(()=>KHo(t,"default",this.answers)),(0,WO.concatMap)(()=>KHo(t,"choices",this.answers)),(0,WO.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,WO.defer)(()=>(0,WO.from)(this.activePrompt.run().then(i=>({name:t.name,answer:i}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,WO.defer)(()=>(0,WO.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&ZC_.get(this.answers,t.name)!==void 0)return WO.EMPTY;if(t.when===!1)return WO.EMPTY;if(typeof t.when!="function")return(0,WO.of)(t);let{answers:r}=this;return(0,WO.defer)(()=>(0,WO.from)((0,kC_.default)(t.when)(r).then(i=>{if(i)return t})).pipe((0,WO.filter)(i=>i!=null)))}};function eq_(e){let t=function(r,i){let n;try{n=new K2n(t.prompts,e)}catch(o){return Promise.reject(o)}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",aWa),this.registerPrompt("input",a_n),this.registerPrompt("number",oWa),this.registerPrompt("confirm",uWa),this.registerPrompt("rawlist",sWa),this.registerPrompt("expand",cWa),this.registerPrompt("checkbox",lWa),this.registerPrompt("password",fWa),this.registerPrompt("editor",gWa)},t.restoreDefaultPrompts(),t}var O0c=eq_();function qxM(e,t){O0c.registerPrompt(e,t)}function TxM(){O0c.restoreDefaultPrompts()}var RxM={prompt:O0c,ui:{BottomBar:OWa,Prompt:K2n},createPromptModule:eq_,registerPrompt:qxM,restoreDefaultPrompts:TxM,Separator:kJ},JHo=RxM;var J2n=require("path");function rq_(){let e=zxM();return async t=>{for(let r of t)r.module=e(r.filename);return t}}function zxM(e=process.argv[1]?(0,J2n.dirname)(process.argv[1]):process.cwd(),t=J2n.sep==="\\"){let r=t?tq_(e):e;return i=>{if(!i)return;let n=t?tq_(i):i,{dir:a,base:o,ext:c}=J2n.posix.parse(n);(c===".js"||c===".mjs"||c===".cjs")&&(o=o.slice(0,-1*c.length));let d=decodeURIComponent(o);a||(a=".");let s=a.lastIndexOf("/node_modules");if(s>-1)return`${a.slice(s+14).replace(/\//g,".")}:${d}`;if(a.startsWith(r)){let u=a.slice(r.length+1).replace(/\//g,".");return u?`${u}:${d}`:d}return d}}function tq_(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var A0c=e=>{if("flags"in e){let t=iq_(e.flags),r=nq_(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([n,a])=>[n,aq_(a)])),i=Object.fromEntries(Object.entries(t).map(([n,a])=>[n,NxM(n,a,r[n])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:i}}};function NxM(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 iq_=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,f_n(r)]).filter(([,t])=>t!==void 0)),nq_=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?aq_(i):void 0]}))};var f_n=e=>e===void 0?void 0:e.variant??e.enabled,aq_=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};var $Ho="0123456789abcdef",YHo=class e{constructor(t){this.bytes=t}static ofInner(t){if(t.length===16)return new e(t);throw new TypeError("not 128-bit length")}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/256,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;default: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)}throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let r=0;r<this.bytes.length;r++)t+=$Ho.charAt(this.bytes[r]>>>4),t+=$Ho.charAt(15&this.bytes[r]),(r===3||r===5||r===7||r===9)&&(t+="-");return t}toHex(){let t="";for(let r=0;r<this.bytes.length;r++)t+=$Ho.charAt(this.bytes[r]>>>4),t+=$Ho.charAt(15&this.bytes[r]);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}},m0c=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??FxM()}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))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return YHo.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}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,YHo.ofInner(t)}},FxM=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}),oq_,IJt=()=>QxM().toString(),QxM=()=>(oq_||(oq_=new m0c)).generate();var UxM=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],uq_=function(e,t=[]){if(!e)return!1;let r=e.toLowerCase();return UxM.concat(t).some(i=>{let n=i.toLowerCase();return r.indexOf(n)!==-1})};var t$=(function(e){return 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.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e})({});var VxM=Array.isArray,sq_=Object.prototype,cO9=sq_.hasOwnProperty,P0c=sq_.toString,cq_=VxM||function(e){return P0c.call(e)==="[object Array]"};var $2n=e=>e===void 0,AWa=e=>P0c.call(e)=="[object String]",lq_=e=>AWa(e)&&e.trim().length===0;var fq_=e=>P0c.call(e)=="[object Number]";var j0c=e=>e instanceof Error;function WxM(e,t){try{return e instanceof t}catch{return!1}}function mWa(e){return e===null||typeof e!="object"}function d_n(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function dq_(e){return d_n(e,"ErrorEvent")}function XHo(e){return!$2n(Event)&&WxM(e,Event)}function pq_(e){return d_n(e,"Object")}function PWa(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),fq_(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),PWa(n||r,t,r,i))}var GxM=864e5,ZHo=class{constructor(t){this._buckets={},this._onBucketRateLimited=t._onBucketRateLimited,this._bucketSize=PWa(t.bucketSize,0,100,t._logger),this._refillRate=PWa(t.refillRate,0,this._bucketSize,t._logger),this._refillInterval=PWa(t.refillInterval,0,GxM,t._logger)}_applyRefill(t,r){let i=r-t.lastAccess,n=Math.floor(i/this._refillInterval);if(n>0){let a=n*this._refillRate;t.tokens=Math.min(t.tokens+a,this._bucketSize),t.lastAccess=t.lastAccess+n*this._refillInterval}}consumeRateLimit(t){let r=Date.now(),i=String(t),n=this._buckets[i];return n?this._applyRefill(n,r):(n={tokens:this._bucketSize,lastAccess:r},this._buckets[i]=n),n.tokens===0?!0:(n.tokens--,n.tokens===0&&this._onBucketRateLimited?.(t),n.tokens===0)}stop(){this._buckets={}}};var kHo=class{add(t){let r=IJt();return this.promiseByIds[r]=t,t.catch(()=>{}).finally(()=>{delete this.promiseByIds[r]}),t}async join(){let t=Object.values(this.promiseByIds),r=t.length;for(;r>0;)await Promise.all(t),t=Object.values(this.promiseByIds),r=t.length}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={}}};function HxM(e=console){return{log:e.log.bind(e),warn:e.warn.bind(e),error:e.error.bind(e),debug:e.debug.bind(e)}}var _q_=(e,t,r)=>{function i(a,...o){t(()=>{let c=r[a];c(e,...o)})}return{info:(...a)=>{i("log",...a)},warn:(...a)=>{i("warn",...a)},error:(...a)=>{i("error",...a)},critical:(...a)=>{r.error(e,...a)},createLogger:a=>_q_(`${e} ${a}`,t,r)}},xxM=e=>e();function hq_(e,t=xxM){return _q_(e,t,HxM())}var X2n="Mobile",t7o="iOS",Y2n="Android",yq_="Tablet",AO9=Y2n+" "+yq_;var KxM="Apple",mO9=KxM+" Watch",bq_="Safari",r7o="BlackBerry",vq_="Samsung",JxM=vq_+"Browser",$xM=vq_+" Internet",i7o="Chrome",YxM=i7o+" OS",XxM=i7o+" "+t7o,gq_="Internet Explorer",ZxM=gq_+" "+X2n,E0c="Opera",PO9=E0c+" Mini",Oq_="Edge",kxM="Microsoft "+Oq_,S0c="Firefox",eKM=S0c+" "+t7o,M0c="Nintendo",D0c="PlayStation",e7o="Xbox",tKM=Y2n+" "+X2n,rKM=X2n+" "+bq_,jWa="Windows",iKM=jWa+" Phone";var Aq_="Generic",jO9=Aq_+" "+X2n.toLowerCase(),wO9=Aq_+" "+yq_.toLowerCase(),nKM="Konqueror",vG="(\\d+(\\.\\d+)?)",w0c=new RegExp("Version/"+vG),EO9=new RegExp(e7o,"i"),SO9=new RegExp(D0c+" \\w+","i"),MO9=new RegExp(M0c+" \\w+","i"),aKM=new RegExp(r7o+"|PlayBook|BB10","i"),oKM={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000","5.1":"XP","5.2":"XP","6.0":"Vista","6.1":"7","6.2":"8","6.3":"8.1","6.4":"10","10.0":"10"};var DO9={[ZxM]:[new RegExp("rv:"+vG)],[kxM]:[new RegExp(Oq_+"?\\/"+vG)],[i7o]:[new RegExp("("+i7o+"|CrMo)\\/"+vG)],[XxM]:[new RegExp("CriOS\\/"+vG)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+vG)],[bq_]:[w0c],[rKM]:[w0c],[E0c]:[new RegExp("("+E0c+"|OPR)\\/"+vG)],[S0c]:[new RegExp(S0c+"\\/"+vG)],[eKM]:[new RegExp("FxiOS\\/"+vG)],[nKM]:[new RegExp("Konqueror[:/]?"+vG,"i")],[r7o]:[new RegExp(r7o+" "+vG),w0c],[tKM]:[new RegExp("android\\s"+vG,"i")],[$xM]:[new RegExp(JxM+"\\/"+vG)],[gq_]:[new RegExp("(rv:|MSIE )"+vG)],Mozilla:[new RegExp("rv:"+vG)]};var BO9=[[new RegExp(e7o+"; "+e7o+" (.*?)[);]","i"),e=>[e7o,e&&e[1]||""]],[new RegExp(M0c,"i"),[M0c,""]],[new RegExp(D0c,"i"),[D0c,""]],[aKM,[r7o,""]],[new RegExp(jWa,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[iKM,""];if(new RegExp(X2n).test(t)&&!/IEMobile\b/.test(t))return[jWa+" "+X2n,""];let r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){let i=r[1],n=oKM[i]||"";return/arm/i.test(t)&&(n="RT"),[jWa,n]}return[jWa,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){let t=[e[3],e[4],e[5]||"0"];return[t7o,t.join(".")]}return[t7o,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=$2n(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Y2n+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Y2n+")","i"),e=>{if(e&&e[2]){let t=[e[2],e[3],e[4]||"0"];return[Y2n,t.join(".")]}return[Y2n,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];if(e&&e[1]){let r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[YxM,""]],[/Linux|debian/i,["Linux",""]]];var mq_="utf8";function Pq_(e,t){if(!e||typeof e!="string"||uKM(e))throw new Error(t)}function uKM(e){return e.trim().length===0}function jq_(e){return e?.replace(/\/+$/,"")}async function wq_(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 n7o(){return new Date().toISOString()}function p_n(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}var Eq_=e=>e instanceof Error;function B0c(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var a7o=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)}};function Sq_(){return"CompressionStream"in globalThis}async function I0c(e,t=!0){try{let i=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return await new Response(i).blob()}catch(r){return t&&console.error("Failed to gzip compress data",r),null}}var Z2n=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()}},wWa=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};async function Mq_(e){if(e instanceof Z2n){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 C0c(e){return typeof e=="object"&&(e instanceof Z2n||e instanceof wWa)}function Dq_(e){return typeof e=="object"&&e instanceof Z2n&&e.status===413}var EWa=class{constructor(t,r={}){this.flushPromise=null,this.shutdownPromise=null,this.promiseQueue=new kHo,this._events=new a7o,this._isInitialized=!1,Pq_(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=jq_(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.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:C0c},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.evaluationEnvironments=r?.evaluationEnvironments,this._initPromise=Promise.resolve(),this._isInitialized=!0,this._logger=hq_("[PostHog]",this.logMsgIfDebug.bind(this)),this.disableCompression=!Sq_()||(r?.disableCompression??!1)}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(t$.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(t$.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(t$.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(i,n)=>this._logger.info(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){return this.promiseQueue.add(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,o){this.wrap(()=>{let c=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:i||{},...o||{}}});this.enqueue("capture",c,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._logger.error("Remote config could not be loaded",n),this._events.emit("error",n)})}async getFlags(t,r={},i={},n={},a={},o=!0){await this._initPromise;let c=o?"&config=true":"",d=`${this.host}/flags/?v=2${c}`,s={token:this.apiKey,distinct_id:t,groups:r,person_properties:i,group_properties:n,...a};this.evaluationEnvironments&&this.evaluationEnvironments.length>0&&(s.evaluation_environments=this.evaluationEnvironments);let u={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(s)};return this._logger.info("Flags URL",d),this.fetchWithRetry(d,u,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(f=>f.json()).then(f=>A0c(f)).catch(f=>{this._events.emit("error",f)})}async getFeatureFlagStateless(t,r,i={},n={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailStateless(t,r,i,n,a,o);if(c===void 0)return{response:void 0,requestId:void 0};let d=f_n(c.response);return d===void 0&&(d=!1),{response:d,requestId:c.requestId}}async getFeatureFlagDetailStateless(t,r,i={},n={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(r,i,n,a,o,[t]);return c===void 0?void 0:{response:c.flags[t],requestId:c.requestId,evaluatedAt:c.evaluatedAt}}async getFeatureFlagPayloadStateless(t,r,i={},n={},a={},o){await this._initPromise;let c=await this.getFeatureFlagPayloadsStateless(r,i,n,a,o,[t]);if(!c)return;let d=c[t];return d===void 0?null:d}async getFeatureFlagPayloadsStateless(t,r={},i={},n={},a,o){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a,o)).payloads}async getFeatureFlagsStateless(t,r={},i={},n={},a,o){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a,o)}async getFeatureFlagsAndPayloadsStateless(t,r={},i={},n={},a,o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(t,r,i,n,a,o);return c?{flags:c.featureFlags,payloads:c.featureFlagPayloads,requestId:c.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},i={},n={},a,o){await this._initPromise;let c={};(a??this.disableGeoip)&&(c.geoip_disable=!0),o&&(c.flag_keys_to_evaluate=o);let d=await this.getFlags(t,r,i,n,c);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("feature_flags")?(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._logger.info("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 o=`Surveys API could not be loaded: ${a.status}`,c=new Error(o);this._logger.error(c),this._events.emit("error",new Error(o));return}return a.json()}).catch(a=>{this._logger.error("Surveys API could not be loaded",a),this._events.emit("error",a)}))?.surveys;return n&&this._logger.info("Surveys fetched from API: ",JSON.stringify(n)),n??[]}get props(){return this._props||(this._props=this.getPersistedProperty(t$.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(t$.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(t$.Props,this.props)})}enqueue(t,r,i){this.wrap(()=>{if(this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let n=this.prepareMessage(t,r,i),a=this.getPersistedProperty(t$.Queue)||[];a.length>=this.maxQueueSize&&(a.shift(),this._logger.info("Queue is full, the oldest event is dropped.")),a.push({message:n}),this.setPersistedProperty(t$.Queue,a),this._events.emit(t,n),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=p_n(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,i){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized||await this._initPromise,this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let n={api_key:this.apiKey,batch:[this.prepareMessage(t,r,i)],sent_at:n7o()};this.historicalMigration&&(n.historical_migration=!0);let a=JSON.stringify(n),o=`${this.host}/batch/`,c=this.disableCompression?null:await I0c(a,this.isDebug),d={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...c!==null&&{"Content-Encoding":"gzip"}},body:c||a};try{await this.fetchWithRetry(o,d)}catch(s){this._events.emit("error",s)}}prepareMessage(t,r,i){let n={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:i?.timestamp?i?.timestamp:n7o(),uuid:i?.uuid?i.uuid:IJt()};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 Mq_(t)})}async flush(){let t=B0c([this.flushPromise]).then(()=>this._flush());return this.flushPromise=t,this.addPendingPromise(t),B0c([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(t$.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(_=>_.message),o=()=>{let h=(this.getPersistedProperty(t$.Queue)||[]).slice(n.length);this.setPersistedProperty(t$.Queue,h),t=h},c={api_key:this.apiKey,batch:a,sent_at:n7o()};this.historicalMigration&&(c.historical_migration=!0);let d=JSON.stringify(c),s=`${this.host}/batch/`,u=this.disableCompression?null:await I0c(d,this.isDebug),f={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...u!==null&&{"Content-Encoding":"gzip"}},body:u||d},p={retryCheck:_=>Dq_(_)?!1:C0c(_)};try{await this.fetchWithRetry(s,f,p)}catch(_){if(Dq_(_)&&a.length>1){this.maxBatchSize=Math.max(1,Math.floor(a.length/2)),this._logger.warn(`Received 413 when sending batch of size ${a.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw _ instanceof wWa||o(),this._events.emit("error",_),_}o(),r.push(...a)}this._events.emit("flush",r)}async fetchWithRetry(t,r,i,n){AbortSignal.timeout??=function(c){let d=new AbortController;return setTimeout(()=>d.abort(),c),d.signal};let a=r.body?r.body:"",o=-1;try{o=a instanceof Blob?a.size:Buffer.byteLength(a,mq_)}catch{a instanceof Blob?o=a.size:o=new TextEncoder().encode(a).length}return await wq_(async()=>{let c=null;try{c=await this.fetch(t,{signal:AbortSignal.timeout(n??this.requestTimeout),...r})}catch(s){throw new wWa(s)}if(!(r.mode==="no-cors")&&(c.status<200||c.status>=400))throw new Z2n(c,o);return c},{...this._retryOptions,...i})}async _shutdown(t=3e4){await this._initPromise;let r=!1;this.clearFlushTimer();let i=async()=>{try{for(await this.promiseQueue.join();!((this.getPersistedProperty(t$.Queue)||[]).length===0||(await this.flush(),r)););}catch(n){if(!C0c(n))throw n;await Mq_(n)}};return Promise.race([new Promise((n,a)=>{p_n(()=>{this._logger.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._logger.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}};var r$={};Zt(r$,{DOMExceptionCoercer:()=>T0c,ErrorCoercer:()=>R0c,ErrorEventCoercer:()=>z0c,ErrorPropertiesBuilder:()=>q0c,EventCoercer:()=>Q0c,ObjectCoercer:()=>F0c,PrimitiveCoercer:()=>U0c,PromiseRejectionEventCoercer:()=>L0c,ReduceableCache:()=>V0c,StringCoercer:()=>N0c,chromeStackLineParser:()=>Cq_,createStackParser:()=>AKM,geckoStackLineParser:()=>Tq_,nodeStackLineParser:()=>Fq_,opera10StackLineParser:()=>Rq_,opera11StackLineParser:()=>zq_,reverseAndStripFrames:()=>Lq_,winjsStackLineParser:()=>qq_});var o7o,Bq_,u7o;function Iq_(e){let t=globalThis._posthogChunkIds;if(!t)return;let r=Object.keys(t);return u7o&&r.length===Bq_||(Bq_=r.length,u7o=r.reduce((i,n)=>{o7o||(o7o={});let a=o7o[n];if(a)i[a[0]]=a[1];else{let o=e(n);for(let c=o.length-1;c>=0;c--){let s=o[c]?.filename,u=t[n];if(s&&u){i[s]=u,o7o[n]=[s,u];break}}}return i},{})),u7o}var sKM=4,q0c=class{constructor(t,r,i=[]){this.coercers=t,this.stackParser=r,this.modifiers=i}buildFromUnknown(t,r={}){let n=r&&r.mechanism||{handled:!0,type:"generic"},o=this.buildCoercingContext(n,r,0).apply(t),c=this.buildParsingContext(),d=this.parseStacktrace(o,c);return{$exception_list:this.convertToExceptionList(d,n),$exception_level:"error"}}async modifyFrames(t){for(let r of t)r.stacktrace&&r.stacktrace.frames&&cq_(r.stacktrace.frames)&&(r.stacktrace.frames=await this.applyModifiers(r.stacktrace.frames));return t}coerceFallback(t){return{type:"Error",value:"Unknown error",stack:t.syntheticException?.stack,synthetic:!0}}parseStacktrace(t,r){let i;t.cause!=null&&(i=this.parseStacktrace(t.cause,r));let n;return t.stack!=""&&t.stack!=null&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),r.chunkIdMap)),{...t,cause:i,stack:n}}applyChunkIds(t,r){return t.map(i=>(i.filename&&r&&(i.chunk_id=r[i.filename]),i))}applyCoercers(t,r){for(let i of this.coercers)if(i.match(t))return i.coerce(t,r);return this.coerceFallback(r)}async applyModifiers(t){let r=t;for(let i of this.modifiers)r=await i(r);return r}convertToExceptionList(t,r){let i={type:t.type,value:t.value,mechanism:{type:r.type??"generic",handled:r.handled??!0,synthetic:t.synthetic??!1}};t.stack&&(i.stacktrace={type:"raw",frames:t.stack});let n=[i];return t.cause!=null&&n.push(...this.convertToExceptionList(t.cause,{...r,handled:!0})),n}buildParsingContext(){return{chunkIdMap:Iq_(this.stackParser)}}buildCoercingContext(t,r,i=0){let n=(o,c)=>{if(c<=sKM){let d=this.buildCoercingContext(t,r,c);return this.applyCoercers(o,d)}};return{...r,syntheticException:i==0?r.syntheticException:void 0,mechanism:t,apply:o=>n(o,i),next:o=>n(o,i+1)}}};var D4="?";function CJt(e,t,r,i,n){let a={platform:e,filename:t,function:r==="<anonymous>"?D4:r,in_app:!0};return $2n(i)||(a.lineno=i),$2n(n)||(a.colno=n),a}var s7o=(e,t)=>{let r=e.indexOf("safari-extension")!==-1,i=e.indexOf("safari-web-extension")!==-1;return r||i?[e.indexOf("@")!==-1?e.split("@")[0]:D4,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var cKM=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,lKM=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fKM=/\((\S*)(?::(\d+))(?::(\d+))\)/,Cq_=(e,t)=>{let r=cKM.exec(e);if(r){let[,n,a,o]=r;return CJt(t,n,D4,+a,+o)}let i=lKM.exec(e);if(i){if(i[2]&&i[2].indexOf("eval")===0){let c=fKM.exec(i[2]);c&&(i[2]=c[1],i[3]=c[2],i[4]=c[3])}let[a,o]=s7o(i[1]||D4,i[2]);return CJt(t,o,a,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}};var dKM=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,qq_=(e,t)=>{let r=dKM.exec(e);return r?CJt(t,r[2],r[1]||D4,+r[3],r[4]?+r[4]:void 0):void 0};var pKM=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,_KM=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Tq_=(e,t)=>{let r=pKM.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){let o=_KM.exec(r[3]);o&&(r[1]=r[1]||"eval",r[3]=o[1],r[4]=o[2],r[5]="")}let n=r[3],a=r[1]||D4;return[a,n]=s7o(a,n),CJt(t,n,a,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}};var hKM=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Rq_=(e,t)=>{let r=hKM.exec(e);return r?CJt(t,r[2],r[3]||D4,+r[1]):void 0},yKM=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,zq_=(e,t)=>{let r=yKM.exec(e);return r?CJt(t,r[5],r[3]||r[4]||D4,+r[1],+r[2]):void 0};var bKM=/^\s*[-]{4,}$/,vKM=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,Fq_=(e,t)=>{let r=e.match(vKM);if(r){let i,n,a,o,c;if(r[1]){a=r[1];let u=a.lastIndexOf(".");if(a[u-1]==="."&&u--,u>0){i=a.slice(0,u),n=a.slice(u+1);let f=i.indexOf(".Module");f>0&&(a=a.slice(f+1),i=i.slice(0,f))}o=void 0}n&&(o=i,c=n),n==="<anonymous>"&&(c=void 0,a=void 0),a===void 0&&(c=c||D4,a=o?`${o}.${c}`:c);let d=r[2]?.startsWith("file://")?r[2].slice(7):r[2],s=r[5]==="native";return d?.match(/\/[A-Z]:/)&&(d=d.slice(1)),!d&&r[5]&&!s&&(d=r[5]),{filename:d?decodeURI(d):void 0,module:void 0,function:a,lineno:Nq_(r[3]),colno:Nq_(r[4]),in_app:gKM(d||"",s),platform:t}}if(e.match(bKM))return{filename:e,platform:t}};function gKM(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 Nq_(e){return parseInt(e||"",10)||void 0}var Qq_=/\(error: (.*)\)/,Uq_=50;function Lq_(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,Uq_).map(r=>({...r,filename:r.filename||OKM(t).filename,function:r.function||D4}))}function OKM(e){return e[e.length-1]||{}}function AKM(e,...t){return(r,i=0)=>{let n=[],a=r.split(`
1148
- `);for(let o=i;o<a.length;o++){let c=a[o];if(c.length>1024)continue;let d=Qq_.test(c)?c.replace(Qq_,"$1"):c;if(!d.match(/\S*Error: /)){for(let s of t){let u=s(d,e);if(u){n.push(u);break}}if(n.length>=Uq_)break}}return Lq_(n)}}var T0c=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){let i=AWa(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){let r=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${r}: ${t.message}`:r}isDOMException(t){return d_n(t,"DOMException")}isDOMError(t){return d_n(t,"DOMError")}};var R0c=class{match(t){return j0c(t)}coerce(t,r){return{type:this.getType(t),value:this.getMessage(t,r),stack:this.getStack(t),cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,r){let i=t.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(t){return t.stacktrace||t.stack||void 0}};var z0c=class{constructor(){}match(t){return dq_(t)&&t.error!=null}coerce(t,r){let i=r.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:r.syntheticException?.stack,synthetic:!0}}};var mKM=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,N0c=class{match(t){return typeof t=="string"}coerce(t,r){let[i,n]=this.getInfos(t);return{type:i??"Error",value:n??t,stack:r.syntheticException?.stack,synthetic:!0}}getInfos(t){let r="Error",i=t,n=t.match(mKM);return n&&(r=n[1],i=n[2]),[r,i]}};var Vq_=["fatal","error","warning","log","info","debug"];function c7o(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let i=r.length;i>0;i--){let n=r.slice(0,i).join(", ");if(!(n.length>t))return i===r.length||n.length<=t?n:`${n.slice(0,t)}...`}return""}var F0c=class{match(t){return typeof t=="object"&&t!==null}coerce(t,r){let i=this.getErrorPropertyFromObject(t);return i?r.apply(i):{type:this.getType(t),value:this.getValue(t),stack:r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return XHo(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;let r=this.getObjectClassName(t),i=c7o(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${i}`}isSeverityLevel(t){return AWa(t)&&!lq_(t)&&Vq_.indexOf(t)>=0}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(Eq_(i))return i}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var Q0c=class{match(t){return XHo(t)}coerce(t,r){let i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${c7o(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var U0c=class{match(t){return mWa(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var L0c=class{match(t){return d_n(t,"PromiseRejectionEvent")}coerce(t,r){let i=this.getUnhandledRejectionReason(t);return mWa(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:r.syntheticException?.stack,synthetic:!0}:r.apply(i)}getUnhandledRejectionReason(t){if(mWa(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}};var V0c=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)}}};var Hq_=require("fs"),xq_=require("readline"),l7o=new r$.ReduceableCache(25),Kq_=new r$.ReduceableCache(20),W0c=7,PKM=1e3,jKM=1e4;async function Jq_(e){let t={};for(let n=e.length-1;n>=0;n--){let a=e[n],o=a?.filename;if(!a||typeof o!="string"||typeof a.lineno!="number"||MKM(o)||DKM(a))continue;t[o]||(t[o]=[]),t[o].push(a.lineno)}let r=Object.keys(t);if(r.length==0)return e;let i=[];for(let n of r){if(Kq_.get(n))continue;let a=t[n];if(!a)continue;a.sort((d,s)=>d-s);let o=IKM(a);if(o.every(d=>BKM(n,d)))continue;let c=CKM(l7o,n,{});i.push(wKM(n,o,c))}return await Promise.all(i).catch(()=>{}),e&&e.length>0&&EKM(e,l7o),l7o.reduce(),e}function wKM(e,t,r){return new Promise(i=>{let n=(0,Hq_.createReadStream)(e),a=(0,xq_.createInterface)({input:n});function o(){n.destroy(),i()}let c=0,d=0,s=t[d];if(s===void 0)return void o();let u=s[0],f=s[1];function p(){Kq_.set(e,1),a.close(),a.removeAllListeners(),o()}n.on("error",p),a.on("error",p),a.on("close",o),a.on("line",_=>{if(c++,!(c<u)&&(r[c]=qKM(_,0),c>=f)){if(d===t.length-1){a.close(),a.removeAllListeners();return}d++;let h=t[d];if(h===void 0){a.close(),a.removeAllListeners();return}u=h[0],f=h[1]}})})}function EKM(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;SKM(r.lineno,r,i)}}function SKM(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let n=$q_(e);n<e;n++){let a=r[n];if(a===void 0)return void Wq_(t);t.pre_context.push(a)}if(r[e]===void 0)return void Wq_(t);t.context_line=r[e];let i=Yq_(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 Wq_(e){delete e.pre_context,delete e.context_line,delete e.post_context}function MKM(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function DKM(e){return e.lineno!==void 0&&e.lineno>jKM||e.colno!==void 0&&e.colno>PKM}function BKM(e,t){let r=l7o.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 IKM(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let i=Gq_(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+W0c:(n.push(i),i=Gq_(a)),t++}return n}function Gq_(e){return[$q_(e),Yq_(e)]}function $q_(e){return Math.max(1,e-W0c)}function Yq_(e){return e+W0c}function CKM(e,t,r){let i=e.get(t);return i===void 0?(e.set(t,r),r):i}function qKM(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}function TKM(e,t){let r=!1;return Object.assign(i=>{let a=global.process.listeners("uncaughtException").filter(o=>o.name!=="domainUncaughtExceptionClear"&&o._posthogErrorHandler!==!0).length===0;e(i,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&a&&(r=!0,t(i))},{_posthogErrorHandler:!0})}function Xq_(e,t){globalThis.process?.on("uncaughtException",TKM(e,t))}function Zq_(e){globalThis.process?.on("unhandledRejection",t=>e(t,{mechanism:{type:"onunhandledrejection",handled:!1}}))}var RKM=2e3,pFi=class e{constructor(t,r,i){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=i,this._rateLimiter=new ZHo({refillRate:1,bucketSize:10,refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static async buildEventMessage(t,r,i,n){let a={...n};i||(a.$process_person_profile=!1);let o=this.errorPropertiesBuilder.buildFromUnknown(t,r);return o.$exception_list=await this.errorPropertiesBuilder.modifyFrames(o.$exception_list),{event:"$exception",distinctId:i||IJt(),properties:{...o,...a}}}startAutocaptureIfEnabled(){this.isEnabled()&&(Xq_(this.onException.bind(this),this.onFatalError.bind(this)),Zq_(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{let i=await e.buildEventMessage(t,r),a=i.properties?.$exception_list[0]?.type??"Exception";return this._rateLimiter.consumeRateLimit(a)?void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:a}):this.client.capture(i)})())}async onFatalError(t){console.error(t),await this.client.shutdown(RKM),process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}};var kq_="5.17.4";async function e1_(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("SubtleCrypto API not available");let r=await t.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("")}var zKM=6e4,NKM=1152921504606847e3,FKM=["is_not"],k2n=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},s0=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},qJt=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},f7o=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:i,timeout:n,host:a,customHeaders:o,...c}){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=c.fetch||fetch,this.onError=c.onError,this.customHeaders=o,this.onLoad=c.onLoad,this.cacheProvider=c.cacheProvider,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,i={},n={},a={}){await this.loadFeatureFlags();let o,c;if(!this.loadedSuccessfullyOnce)return o;if(c=this.featureFlagsByKey[t],c!==void 0)try{o=(await this.computeFlagAndPayloadLocally(c,r,i,n,a)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${o}`))}catch(d){d instanceof qJt||d instanceof s0?this.logMsgIfDebug(()=>console.debug(`${d.name} when computing flag locally: ${t}: ${d.message}`)):d instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${d}`))}return o}async getAllFlagsAndPayloads(t,r={},i={},n={},a){await this.loadFeatureFlags();let o={},c={},d=this.featureFlags.length==0,s=a?a.map(f=>this.featureFlagsByKey[f]).filter(Boolean):this.featureFlags,u={};return await Promise.all(s.map(async f=>{try{let{value:p,payload:_}=await this.computeFlagAndPayloadLocally(f,t,r,i,n,void 0,u);o[f.key]=p,_&&(c[f.key]=_)}catch(p){p instanceof qJt||p instanceof s0?this.logMsgIfDebug(()=>console.debug(`${p.name} when computing flag locally: ${f.key}: ${p.message}`)):p instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${f.key}: ${p}`)),d=!0}})),{response:o,payloads:c,fallbackToFlags:d}}async computeFlagAndPayloadLocally(t,r,i={},n={},a={},o,c,d=!1){if(d||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};let s;s=o!==void 0?o:await this.computeFlagValueLocally(t,r,i,n,a,c);let u=this.getFeatureFlagPayload(t.key,s);return{value:s,payload:u}}async computeFlagValueLocally(t,r,i={},n={},a={},o={}){if(t.ensure_experience_continuity)throw new s0("Flag has experience continuity enabled");if(!t.active)return!1;let d=(t.filters||{}).aggregation_group_type_index;if(d==null)return await this.matchFeatureFlagProperties(t,r,n,o);{let s=this.groupTypeMapping[String(d)];if(!s)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${d} for feature flag ${t.key}`)),new s0("Flag has unknown group type index");if(!(s in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;let u=a[s];return await this.matchFeatureFlagProperties(t,i[s],u,o)}}getFeatureFlagPayload(t,r){let i=null;if(r!==!1&&r!=null&&(typeof r=="boolean"?i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]||null:typeof r=="string"&&(i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]||null),i!=null)){if(typeof i=="object")return i;if(typeof i=="string")try{return JSON.parse(i)}catch{}return i}return null}async evaluateFlagDependency(t,r,i,n){let a=t.key;if(!this.featureFlagsByKey)throw new s0("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new s0(`Flag dependency property for '${a}' is missing required 'dependency_chain' field`);let o=t.dependency_chain;if(!Array.isArray(o))throw new s0(`Flag dependency property for '${a}' has an invalid 'dependency_chain' (expected array, got ${typeof o})`);if(o.length===0)throw new s0(`Circular dependency detected for flag '${a}' (empty dependency chain)`);for(let d of o){if(!(d in n)){let u=this.featureFlagsByKey[d];if(u)if(u.active)try{let f=await this.matchFeatureFlagProperties(u,r,i,n);n[d]=f}catch(f){throw new s0(`Error evaluating flag dependency '${d}' for flag '${a}': ${f}`)}else n[d]=!1;else throw new s0(`Missing flag dependency '${d}' for flag '${a}'`)}if(n[d]==null)throw new s0(`Dependency '${d}' could not be evaluated`)}let c=n[a];return this.flagEvaluatesToExpectedValue(t.value,c)}flagEvaluatesToExpectedValue(t,r){return typeof t=="boolean"?t===r||typeof r=="string"&&r!==""&&t===!0:typeof t=="string"?r===t:!1}async matchFeatureFlagProperties(t,r,i,n={}){let a=t.filters||{},o=a.groups||[],c=!1,d;for(let s of o)try{if(await this.isConditionMatch(t,r,s,i,n)){let u=s.variant,f=a.multivariate?.variants||[];d=u&&f.some(p=>p.key===u)?u:await this.getMatchingVariant(t,r)||!0;break}}catch(u){if(u instanceof qJt)throw u;if(u instanceof s0)c=!0;else throw u}if(d!==void 0)return d;if(c)throw new s0("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,i,n,a={}){let o=i.rollout_percentage,c=d=>{this.logMsgIfDebug(()=>console.warn(d))};if((i.properties||[]).length>0){for(let d of i.properties){let s=d.type,u=!1;if(u=s==="cohort"?a1_(d,n,this.cohorts,this.debugMode):s==="flag"?await this.evaluateFlagDependency(d,r,n,a):n1_(d,n,c),!u)return!1}if(o==null)return!0}return!(o!=null&&await t1_(t.key,r)>o/100)}async getMatchingVariant(t,r){let i=await t1_(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(c=>{n=i+c.rollout_percentage/100,r.push({valueMin:i,valueMax:n,key:c.key}),i=n}),r}updateFlagState(t){this.featureFlags=t.flags,this.featureFlagsByKey=t.flags.reduce((r,i)=>(r[i.key]=i,r),{}),this.groupTypeMapping=t.groupTypeMapping,this.cohorts=t.cohorts,this.loadedSuccessfullyOnce=!0}async loadFromCache(t){if(!this.cacheProvider)return!1;try{let r=await this.cacheProvider.getFlagDefinitions();return r?(this.updateFlagState(r),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${t} (${r.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),!0):!1}catch(r){return this.onError?.(new Error(`Failed to load from cache: ${r}`)),!1}}async loadFeatureFlags(t=!1){if(!(this.loadedSuccessfullyOnce&&!t))return this.loadingPromise||(this.loadingPromise=this._loadFeatureFlags().catch(r=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${r}`))).finally(()=>{this.loadingPromise=void 0})),this.loadingPromise}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getPollingInterval(){return this.shouldBeginExponentialBackoff?Math.min(zKM,this.pollingInterval*2**this.backOffCount):this.pollingInterval}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval());try{let t=!0;if(this.cacheProvider)try{t=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(i){this.onError?.(new Error(`Error in shouldFetchFlagDefinitions: ${i}`))}if(!t&&(await this.loadFromCache("Loaded flags from cache (skipped fetch)")||this.loadedSuccessfullyOnce))return;let r=await this._requestFeatureFlagDefinitions();if(!r)return;switch(r.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=r.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0;return;case 401:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new k2n(`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 k2n(`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 k2n(`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 i=await r.json()??{};if(!("flags"in i))return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(i)}`));this.flagsEtag=r.headers?.get("ETag")??void 0;let n={flags:i.flags??[],groupTypeMapping:i.group_type_mapping||{},cohorts:i.cohorts||{}};if(this.updateFlagState(n),this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(n)}catch(a){this.onError?.(new Error(`Failed to store in cache: ${a}`))}this.onLoad?.(this.featureFlags.length);break}default:return}}catch(t){t instanceof k2n&&this.onError?.(t)}}getPersonalApiKeyRequestOptions(t="GET",r){let i={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};return r&&(i["If-None-Match"]=r),{method:t,headers:i}}_requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),i=null;if(this.timeout&&typeof this.timeout=="number"){let n=new AbortController;i=p_n(()=>{n.abort()},this.timeout),r.signal=n.signal}try{let n=this.fetch;return n(t,r)}finally{clearTimeout(i)}}async stopPoller(t=3e4){if(clearTimeout(this.poller),this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await Promise.race([r,new Promise((i,n)=>setTimeout(()=>n(new Error(`Cache shutdown timeout after ${t}ms`)),t))])}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};async function t1_(e,t,r=""){let i=await e1_(`${e}.${t}${r}`);return parseInt(i.slice(0,15),16)/NKM}function n1_(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 s0("Operator is_not_set is not supported")}else throw new s0(`Property ${i} not found in propertyValues`);let o=t[i];if(o==null&&!FKM.includes(a))return r&&r(`Property ${i} cannot have a value of null/undefined with the ${a} operator`),!1;function c(s,u){return Array.isArray(s)?s.map(f=>String(f).toLowerCase()).includes(String(u).toLowerCase()):String(s).toLowerCase()===String(u).toLowerCase()}function d(s,u,f){if(f==="gt")return s>u;if(f==="gte")return s>=u;if(f==="lt")return s<u;if(f==="lte")return s<=u;throw new Error(`Invalid operator: ${f}`)}switch(a){case"exact":return c(n,o);case"is_not":return!c(n,o);case"is_set":return i in t;case"icontains":return String(o).toLowerCase().includes(String(n).toLowerCase());case"not_icontains":return!String(o).toLowerCase().includes(String(n).toLowerCase());case"regex":return r1_(String(n))&&String(o).match(String(n))!==null;case"not_regex":return r1_(String(n))&&String(o).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||o==null?d(String(o),String(n),a):typeof o=="string"?d(o,String(n),a):d(o,s,a)}case"is_date_after":case"is_date_before":{if(typeof n=="boolean")throw new s0("Date operations cannot be performed on boolean values");let s=UKM(String(n));if(s==null&&(s=i1_(n)),s==null)throw new s0(`Invalid date: ${n}`);let u=i1_(o);return["is_date_before"].includes(a)?u<s:u>s}default:throw new s0(`Unknown operator: ${a}`)}}function QKM(e,t){if(!(e in t))throw new qJt(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}function a1_(e,t,r,i=!1){let n=String(e.value);QKM(n,r);let a=r[n];return o1_(a,t,r,i)}function o1_(e,t,r,i=!1){if(!e)return!0;let n=e.type,a=e.values;if(!a||a.length===0)return!0;let o=!1;if("values"in a[0]){for(let c of a)try{let d=o1_(c,t,r,i);if(n==="AND"){if(!d)return!1}else if(d)return!0}catch(d){if(d instanceof qJt)throw d;if(d instanceof s0)i&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new s0("Can't match cohort without a given cohort property value");return n==="AND"}for(let c of a)try{let d;if(c.type==="cohort")d=a1_(c,t,r,i);else if(c.type==="flag"){i&&console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${c.key||"unknown"}'`);continue}else d=n1_(c,t);let s=c.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 qJt)throw d;if(d instanceof s0)i&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new s0("can't match cohort without a given cohort property value");return n==="AND"}function r1_(e){try{return new RegExp(e),!0}catch{return!1}}function i1_(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 s0(`${e} is in an invalid date format`)}throw new s0(`The date provided ${e} must be a string, number, or date object`)}function UKM(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),i=new Date(new Date().toISOString());if(!r)return null;{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()-7*n);else if(a=="m")i.setUTCMonth(i.getUTCMonth()-n);else{if(a!="y")return null;i.setUTCFullYear(i.getUTCFullYear()-n)}return i}}var d7o=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};var LKM=100,u1_=3e4,VKM=5e4,p7o=class extends EWa{constructor(t,r={}){if(super(t,r),this._memoryStorage=new d7o,this.options=r,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,LKM):u1_,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.');r.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new f7o({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:n=>{this._events.emit("error",n)},onLoad:n=>{this._events.emit("localEvaluationFlagsLoaded",n)},customHeaders:this.getCustomHeaders(),cacheProvider:r.flagDefinitionCacheProvider}))}this.errorTracking=new pFi(this,r,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||VKM}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):fetch(t,r)}getLibraryVersion(){return kq_}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._logger.warn("Called capture() with a string as the first argument when an object was expected."),this.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:i,properties:n,options:a})=>super.captureStateless(r,i,n,{timestamp:a.timestamp,disableGeoip:a.disableGeoip,uuid:a.uuid})).catch(r=>{r&&console.error(r)}))}async captureImmediate(t){return typeof t=="string"&&this._logger.warn("Called captureImmediate() with a string as the first argument when an object was expected."),this.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:i,properties:n,options:a})=>super.captureStatelessImmediate(r,i,n,{timestamp:a.timestamp,disableGeoip:a.disableGeoip,uuid:a.uuid})).catch(r=>{r&&console.error(r)}))}identify({distinctId:t,properties:r={},disableGeoip:i}){let{$set:n,$set_once:a,$anon_distinct_id:o,...c}=r,u={$set:n||c,$set_once:a||{},$anon_distinct_id:o??void 0};super.identifyStateless(t,u,{disableGeoip:i})}async identifyImmediate({distinctId:t,properties:r={},disableGeoip:i}){let{$set:n,$set_once:a,$anon_distinct_id:o,...c}=r,u={$set:n||c,$set_once:a||{},$anon_distinct_id:o??void 0};super.identifyStatelessImmediate(t,u,{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=u1_){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:o,sendFeatureFlagEvents:c,personProperties:d,groupProperties:s}=i||{},u=this.addLocalPersonAndGroupProperties(r,n,d,s);d=u.allPersonProperties,s=u.allGroupProperties,o==null&&(o=!1),c==null&&(c=this.options.sendFeatureFlagEvent??!0);let f=await this.featureFlagsPoller?.getFeatureFlag(t,r,n,d,s),p=f!==void 0,_,h,y;if(!p&&!o){let v=await super.getFeatureFlagDetailStateless(t,r,n,d,s,a);if(v===void 0)return;y=v.response,f=f_n(y),_=v?.requestId,h=v?.evaluatedAt}let b=`${t}_${f}`;return c&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(b))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(b):this.distinctIdHasSentFlagCalls[r]=[b],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:f,$feature_flag_id:y?.metadata?.id,$feature_flag_version:y?.metadata?.version,$feature_flag_reason:y?.reason?.description??y?.reason?.code,locally_evaluated:p,[`$feature/${t}`]:f,$feature_flag_request_id:_,$feature_flag_evaluated_at:h},groups:n,disableGeoip:a})),f}async getFeatureFlagPayload(t,r,i,n){let{groups:a,disableGeoip:o}=n||{},{onlyEvaluateLocally:c,personProperties:d,groupProperties:s}=n||{},u=this.addLocalPersonAndGroupProperties(r,a,d,s);d=u.allPersonProperties,s=u.allGroupProperties;let f;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let h=this.featureFlagsPoller?.featureFlagsByKey[t];if(h)try{let y=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(h,r,a,d,s,i);y&&(i=y.value,f=y.payload)}catch(y){if(y instanceof qJt||y instanceof s0)this._logger?.info(`${y.name} when computing flag locally: ${h.key}: ${y.message}`);else throw y}}return c==null&&(c=!1),!(f!==void 0)&&!c&&(f=await super.getFeatureFlagPayloadStateless(t,r,a,d,s,o)),f}async getRemoteConfigPayload(t){if(!this.options.personalApiKey)throw new Error("Personal API key is required for remote config payload decryption");let r=await this._requestRemoteConfigPayload(t);if(!r)return;let i=await r.json();if(typeof i=="string")try{return JSON.parse(i)}catch{}return i}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,flagKeys:a}=r||{},{onlyEvaluateLocally:o,personProperties:c,groupProperties:d}=r||{},s=this.addLocalPersonAndGroupProperties(t,i,c,d);c=s.allPersonProperties,d=s.allGroupProperties,o==null&&(o=!1);let u=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,i,c,d,a),f={},p={},_=!0;if(u&&(f=u.response,p=u.payloads,_=u.fallbackToFlags),_&&!o){let h=await super.getFeatureFlagsAndPayloadsStateless(t,i,c,d,n,a);f={...f,...h.flags||{}},p={...p,...h.payloads||{}}}return{featureFlags:f,featureFlagPayloads:p}}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)}withContext(t,r,i){return this.context?this.context.run(t,r,i):r()}getContext(){return this.context?.get()}async _shutdown(t){return this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown(),super._shutdown(t)}async _requestRemoteConfigPayload(t){if(!this.options.personalApiKey)return;let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config?token=${encodeURIComponent(this.apiKey)}`,i={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},n=null;if(this.options.requestTimeout&&typeof this.options.requestTimeout=="number"){let a=new AbortController;n=p_n(()=>{a.abort()},this.options.requestTimeout),i.signal=a.signal}try{return await this.fetch(r,i)}catch(a){this._events.emit("error",a);return}finally{n&&clearTimeout(n)}}extractPropertiesFromEvent(t,r){if(!t)return{personProperties:{},groupProperties:{}};let i={},n={};for(let[a,o]of Object.entries(t))if(pq_(o)&&r&&a in r){let c={};for(let[d,s]of Object.entries(o))c[String(d)]=String(s);n[String(a)]=c}else i[String(a)]=String(o);return{personProperties:i,groupProperties:n}}async getFeatureFlagsForEvent(t,r,i,n){let a=n?.personProperties||{},o=n?.groupProperties||{},c=n?.flagKeys;if(n?.onlyEvaluateLocally??!1)if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let s={};for(let[u,f]of Object.entries(r||{}))s[u]=String(f);return await this.getAllFlags(t,{groups:s,personProperties:a,groupProperties:o,disableGeoip:i,onlyEvaluateLocally:!0,flagKeys:c})}else return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let s={};for(let[u,f]of Object.entries(r||{}))s[u]=String(f);return await this.getAllFlags(t,{groups:s,personProperties:a,groupProperties:o,disableGeoip:i,onlyEvaluateLocally:!0,flagKeys:c})}return(await super.getFeatureFlagsStateless(t,r,a,o,i)).flags}addLocalPersonAndGroupProperties(t,r,i,n){let a={distinct_id:t,...i||{}},o={};if(r)for(let c of Object.keys(r))o[c]={$group_key:r[c],...n?.[c]||{}};return{allPersonProperties:a,allGroupProperties:o}}captureException(t,r,i){let n=new Error("PostHog syntheticException");this.addPendingPromise(pFi.buildEventMessage(t,{syntheticException:n},r,i).then(a=>this.capture(a)))}async captureExceptionImmediate(t,r,i){let n=new Error("PostHog syntheticException");this.addPendingPromise(pFi.buildEventMessage(t,{syntheticException:n},r,i).then(a=>this.captureImmediate(a)))}async prepareEventMessage(t){let{distinctId:r,event:i,properties:n,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s}=t,u=this.context?.get(),f=r||u?.distinctId,p={...u?.properties||{},...n||{}};f||(f=IJt(),p.$process_person_profile=!1),u?.sessionId&&!p.$session_id&&(p.$session_id=u.sessionId);let _=this._runBeforeSend({distinctId:f,event:i,properties:p,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s});if(!_)return Promise.reject(null);let h=await Promise.resolve().then(async()=>{if(o){let y=typeof o=="object"?o:void 0;return await this.getFeatureFlagsForEvent(_.distinctId,a,d,y)}return _.event,{}}).then(y=>{let b={};if(y)for(let[O,A]of Object.entries(y))b[`$feature/${O}`]=A;let v=Object.keys(y||{}).filter(O=>y?.[O]!==!1).sort();return v.length>0&&(b.$active_feature_flags=v),b}).catch(()=>({})).then(y=>({...y,..._.properties||{},$groups:_.groups||a}));return _.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof h.$raw_user_agent=="string"&&uq_(h.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(_.event="$bot_pageview",h.$browser_type="bot"),{distinctId:_.distinctId,event:_.event,properties:h,options:{timestamp:_.timestamp,disableGeoip:_.disableGeoip,uuid:_.uuid}}}_runBeforeSend(t){let r=this.options.before_send;if(!r)return t;let i=Array.isArray(r)?r:[r],n=t;for(let a of i){if(n=a(n),!n)return this._logger.info(`Event '${t.event}' was rejected in beforeSend function`),null;if(!n.properties||Object.keys(n.properties).length===0){let o=`Event '${n.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(o)}}return n}};var s1_=require("async_hooks"),_7o=class{constructor(){this.storage=new s1_.AsyncLocalStorage}get(){return this.storage.getStore()}run(t,r,i){if(i?.fresh===!0)return this.storage.run(t,r);{let a=this.get()||{},o={distinctId:t.distinctId??a.distinctId,sessionId:t.sessionId??a.sessionId,properties:{...a.properties||{},...t.properties||{}}};return this.storage.run(o,r)}}};var c1_="posthog-node";function WKM(e,{organization:t,projectId:r,prefix:i,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}={}){return o=>{if(!(n==="*"||n.includes(o.level)))return o;o.tags||(o.tags={});let d=o.tags[G0c.POSTHOG_ID_TAG];if(d===void 0)return o;let s=e.options.host??"https://us.i.posthog.com",u=new URL(`/project/${e.apiKey}/person/${d}`,s).toString();o.tags["PostHog Person URL"]=u;let f=o.exception?.values||[],p=f.map(h=>({...h,stacktrace:h.stacktrace?{...h.stacktrace,type:"raw",frames:(h.stacktrace.frames||[]).map(y=>({...y,platform:"node:javascript"}))}:void 0})),_={$exception_message:f[0]?.value||o.message,$exception_type:f[0]?.type,$exception_level:o.level,$exception_list:p,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:f[0]?.value||o.message,$sentry_exception_type:f[0]?.type,$sentry_tags:o.tags};return t&&r&&(_.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+o.event_id),a&&e.capture({event:"$exception",distinctId:d,properties:_}),o}}var G0c=class{static#e=this.POSTHOG_ID_TAG="posthog_distinct_id";constructor(t,r,i,n,a){this.name=c1_,this.name=c1_,this.setupOnce=function(o,c){let d=c()?.getClient()?.getDsn()?.projectId;o(WKM(t,{organization:r,projectId:d,prefix:i,severityAllowList:n,sendExceptionsToPostHog:a??!0}))}}};pFi.errorPropertiesBuilder=new r$.ErrorPropertiesBuilder([new r$.EventCoercer,new r$.ErrorCoercer,new r$.ObjectCoercer,new r$.StringCoercer,new r$.PrimitiveCoercer],r$.createStackParser("node:javascript",r$.nodeStackLineParser),[rq_(),Jq_]);var ekn=class extends p7o{getLibraryId(){return"posthog-node"}initializeContext(){return new _7o}};var h7o=class{posthog;constructor({posthogApiKey:t}){this.posthog=new ekn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"3.35.1",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var SWa=class{async sendEvent(){}async identify(){}async flush(){}};var tkn=require("fs/promises"),p1_=require("os"),_1_=require("path");var l1_=ce(require("crypto")),b7o=new Uint8Array(256),y7o=b7o.length;function H0c(){return y7o>b7o.length-16&&(l1_.default.randomFillSync(b7o),y7o=0),b7o.slice(y7o,y7o+=16)}var B4=[];for(let e=0;e<256;++e)B4.push((e+256).toString(16).slice(1));function f1_(e,t=0){return B4[e[t+0]]+B4[e[t+1]]+B4[e[t+2]]+B4[e[t+3]]+"-"+B4[e[t+4]]+B4[e[t+5]]+"-"+B4[e[t+6]]+B4[e[t+7]]+"-"+B4[e[t+8]]+B4[e[t+9]]+"-"+B4[e[t+10]]+B4[e[t+11]]+B4[e[t+12]]+B4[e[t+13]]+B4[e[t+14]]+B4[e[t+15]]}var d1_=ce(require("crypto")),x0c={randomUUID:d1_.default.randomUUID};function GKM(e,t,r){if(x0c.randomUUID&&!t&&!e)return x0c.randomUUID();e=e||{};let i=e.random||(e.rng||H0c)();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 f1_(i)}var Hbe=GKM;var HKM="id",xKM=".fern",MWa=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new ekn(r),this.userId=t==null?void 0:Fvc(t),this.token=t}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){let r=await this.getUserEmail();this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"3.35.1",...t,...t.properties,usingAccessToken:!1,...r!=null?{userEmail:r}:{}}})}async flush(){await this.posthog.flush()}userEmail;async getUserEmail(){if(this.userEmail!==null){if(this.userEmail!=null)return this.userEmail;if(this.token==null){this.userEmail=null;return}try{let t=await O4({token:this.token.value}).user.getMyself();if(t.ok&&t.body.email!=null)return this.userEmail=t.body.email,this.userEmail}catch{}this.userEmail=null}}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Ct(Ir.of((0,p1_.homedir)()),Xe.of(xKM),Xe.of(HKM));await mi(t)||(await(0,tkn.mkdir)((0,_1_.dirname)(t),{recursive:!0}),await(0,tkn.writeFile)(t,Hbe())),this.persistedDistinctId=(await(0,tkn.readFile)(t)).toString()}return this.persistedDistinctId}};var K0c;async function rkn(){return K0c==null&&(K0c=await KKM()),K0c}async function KKM(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new SWa;let r=await F8o();return r!=null?new MWa({token:r,posthogApiKey:e}):await fZn()!=null?new h7o({posthogApiKey:e}):new MWa({token:void 0,posthogApiKey:e})}catch{return new SWa}}function DWa(e,t){return function(){return e.apply(t,arguments)}}var{toString:JKM}=Object.prototype,{getPrototypeOf:$0c}=Object,{iterator:g7o,toStringTag:y1_}=Symbol,O7o=(e=>t=>{let r=JKM.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),$Vt=e=>(e=e.toLowerCase(),t=>O7o(t)===e),A7o=e=>t=>typeof t===e,{isArray:nkn}=Array,ikn=A7o("undefined");function BWa(e){return e!==null&&!ikn(e)&&e.constructor!==null&&!ikn(e.constructor)&&i$(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var b1_=$Vt("ArrayBuffer");function $KM(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&b1_(e.buffer),t}var YKM=A7o("string"),i$=A7o("function"),v1_=A7o("number"),IWa=e=>e!==null&&typeof e=="object",XKM=e=>e===!0||e===!1,v7o=e=>{if(O7o(e)!=="object")return!1;let t=$0c(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(y1_ in e)&&!(g7o in e)},ZKM=e=>{if(!IWa(e)||BWa(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},kKM=$Vt("Date"),eJM=$Vt("File"),tJM=$Vt("Blob"),rJM=$Vt("FileList"),iJM=e=>IWa(e)&&i$(e.pipe),nJM=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||i$(e.append)&&((t=O7o(e))==="formdata"||t==="object"&&i$(e.toString)&&e.toString()==="[object FormData]"))},aJM=$Vt("URLSearchParams"),[oJM,uJM,sJM,cJM]=["ReadableStream","Request","Response","Headers"].map($Vt),lJM=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function CWa(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),nkn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(BWa(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(i=0;i<o;i++)c=a[i],t.call(null,e[c],c,e)}}function g1_(e,t){if(BWa(e))return null;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 __n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,O1_=e=>!ikn(e)&&e!==__n;function J0c(){let{caseless:e,skipUndefined:t}=O1_(this)&&this||{},r={},i=(n,a)=>{let o=e&&g1_(r,a)||a;v7o(r[o])&&v7o(n)?r[o]=J0c(r[o],n):v7o(n)?r[o]=J0c({},n):nkn(n)?r[o]=n.slice():(!t||!ikn(n))&&(r[o]=n)};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&CWa(arguments[n],i);return r}var fJM=(e,t,r,{allOwnKeys:i}={})=>(CWa(t,(n,a)=>{r&&i$(n)?e[a]=DWa(n,r):e[a]=n},{allOwnKeys:i}),e),dJM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pJM=(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)},_JM=(e,t,r,i)=>{let n,a,o,c={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)o=n[a],(!i||i(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&$0c(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},hJM=(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},yJM=e=>{if(!e)return null;if(nkn(e))return e;let t=e.length;if(!v1_(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},bJM=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&$0c(Uint8Array)),vJM=(e,t)=>{let i=(e&&e[g7o]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},gJM=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},OJM=$Vt("HTMLFormElement"),AJM=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),h1_=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),mJM=$Vt("RegExp"),A1_=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};CWa(r,(n,a)=>{let o;(o=t(n,a,e))!==!1&&(i[a]=o||n)}),Object.defineProperties(e,i)},PJM=e=>{A1_(e,(t,r)=>{if(i$(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(i$(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+"'")})}})},jJM=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return nkn(e)?i(e):i(String(e).split(t)),r},wJM=()=>{},EJM=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function SJM(e){return!!(e&&i$(e.append)&&e[y1_]==="FormData"&&e[g7o])}var MJM=e=>{let t=new Array(10),r=(i,n)=>{if(IWa(i)){if(t.indexOf(i)>=0)return;if(BWa(i))return i;if(!("toJSON"in i)){t[n]=i;let a=nkn(i)?[]:{};return CWa(i,(o,c)=>{let d=r(o,n+1);!ikn(d)&&(a[c]=d)}),t[n]=void 0,a}}return i};return r(e,0)},DJM=$Vt("AsyncFunction"),BJM=e=>e&&(IWa(e)||i$(e))&&i$(e.then)&&i$(e.catch),m1_=((e,t)=>e?setImmediate:t?((r,i)=>(__n.addEventListener("message",({source:n,data:a})=>{n===__n&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),__n.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",i$(__n.postMessage)),IJM=typeof queueMicrotask<"u"?queueMicrotask.bind(__n):typeof process<"u"&&process.nextTick||m1_,CJM=e=>e!=null&&i$(e[g7o]),rr={isArray:nkn,isArrayBuffer:b1_,isBuffer:BWa,isFormData:nJM,isArrayBufferView:$KM,isString:YKM,isNumber:v1_,isBoolean:XKM,isObject:IWa,isPlainObject:v7o,isEmptyObject:ZKM,isReadableStream:oJM,isRequest:uJM,isResponse:sJM,isHeaders:cJM,isUndefined:ikn,isDate:kKM,isFile:eJM,isBlob:tJM,isRegExp:mJM,isFunction:i$,isStream:iJM,isURLSearchParams:aJM,isTypedArray:bJM,isFileList:rJM,forEach:CWa,merge:J0c,extend:fJM,trim:lJM,stripBOM:dJM,inherits:pJM,toFlatObject:_JM,kindOf:O7o,kindOfTest:$Vt,endsWith:hJM,toArray:yJM,forEachEntry:vJM,matchAll:gJM,isHTMLForm:OJM,hasOwnProperty:h1_,hasOwnProp:h1_,reduceDescriptors:A1_,freezeMethods:PJM,toObjectSet:jJM,toCamelCase:AJM,noop:wJM,toFiniteNumber:EJM,findKey:g1_,global:__n,isContextDefined:O1_,isSpecCompliantForm:SJM,toJSONObject:MJM,isAsyncFn:DJM,isThenable:BJM,setImmediate:m1_,asap:IJM,isIterable:CJM};function akn(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)}rr.inherits(akn,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:rr.toJSONObject(this.config),code:this.code,status:this.status}}});var P1_=akn.prototype,j1_={};["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=>{j1_[e]={value:e}});Object.defineProperties(akn,j1_);Object.defineProperty(P1_,"isAxiosError",{value:!0});akn.from=(e,t,r,i,n,a)=>{let o=Object.create(P1_);rr.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return akn.call(o,c,d,r,i,n),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var Ma=akn;var w1_=ce(EXn(),1),m7o=w1_.default;function Y0c(e){return rr.isPlainObject(e)||rr.isArray(e)}function S1_(e){return rr.endsWith(e,"[]")?e.slice(0,-2):e}function E1_(e,t,r){return e?e.concat(t).map(function(n,a){return n=S1_(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function qJM(e){return rr.isArray(e)&&!e.some(Y0c)}var TJM=rr.toFlatObject(rr,{},null,function(t){return/^is[A-Z]/.test(t)});function RJM(e,t,r){if(!rr.isObject(e))throw new TypeError("target must be an object");t=t||new(m7o||FormData),r=rr.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!rr.isUndefined(b[y])});let i=r.metaTokens,n=r.visitor||u,a=r.dots,o=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&rr.isSpecCompliantForm(t);if(!rr.isFunction(n))throw new TypeError("visitor must be a function");function s(h){if(h===null)return"";if(rr.isDate(h))return h.toISOString();if(rr.isBoolean(h))return h.toString();if(!d&&rr.isBlob(h))throw new Ma("Blob is not supported. Use a Buffer instead.");return rr.isArrayBuffer(h)||rr.isTypedArray(h)?d&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,b){let v=h;if(h&&!b&&typeof h=="object"){if(rr.endsWith(y,"{}"))y=i?y:y.slice(0,-2),h=JSON.stringify(h);else if(rr.isArray(h)&&qJM(h)||(rr.isFileList(h)||rr.endsWith(y,"[]"))&&(v=rr.toArray(h)))return y=S1_(y),v.forEach(function(A,g){!(rr.isUndefined(A)||A===null)&&t.append(o===!0?E1_([y],g,a):o===null?y:y+"[]",s(A))}),!1}return Y0c(h)?!0:(t.append(E1_(b,y,a),s(h)),!1)}let f=[],p=Object.assign(TJM,{defaultVisitor:u,convertValue:s,isVisitable:Y0c});function _(h,y){if(!rr.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),rr.forEach(h,function(v,O){(!(rr.isUndefined(v)||v===null)&&n.call(t,v,rr.isString(O)?O.trim():O,y,p))===!0&&_(v,y?y.concat(O):[O])}),f.pop()}}if(!rr.isObject(e))throw new TypeError("data must be an object");return _(e),t}var M7i=RJM;function M1_(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function D1_(e,t){this._pairs=[],e&&M7i(e,this,t)}var B1_=D1_.prototype;B1_.append=function(t,r){this._pairs.push([t,r])};B1_.toString=function(t){let r=t?function(i){return t.call(this,i,M1_)}:M1_;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var I1_=D1_;function zJM(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function h_n(e,t,r){if(!t)return e;let i=r&&r.encode||zJM;rr.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,a;if(n?a=n(t,r):a=rr.isURLSearchParams(t)?t.toString():new I1_(t,r).toString(i),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var X0c=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){rr.forEach(this.handlers,function(i){i!==null&&t(i)})}},Z0c=X0c;var okn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var R1_=ce(require("crypto"),1);var C1_=ce(require("url"),1),q1_=C1_.default.URLSearchParams;var k0c="abcdefghijklmnopqrstuvwxyz",T1_="0123456789",z1_={DIGIT:T1_,ALPHA:k0c,ALPHA_DIGIT:k0c+k0c.toUpperCase()+T1_},NJM=(e=16,t=z1_.ALPHA_DIGIT)=>{let r="",{length:i}=t,n=new Uint32Array(e);R1_.default.randomFillSync(n);for(let a=0;a<e;a++)r+=t[n[a]%i];return r},N1_={isNode:!0,classes:{URLSearchParams:q1_,FormData:m7o,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:z1_,generateString:NJM,protocols:["http","https","file","data"]};var rwc={};Zt(rwc,{hasBrowserEnv:()=>twc,hasStandardBrowserEnv:()=>FJM,hasStandardBrowserWebWorkerEnv:()=>QJM,navigator:()=>ewc,origin:()=>UJM});var twc=typeof window<"u"&&typeof document<"u",ewc=typeof navigator=="object"&&navigator||void 0,FJM=twc&&(!ewc||["ReactNative","NativeScript","NS"].indexOf(ewc.product)<0),QJM=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",UJM=twc&&window.location.href||"http://localhost";var YA={...rwc,...N1_};function iwc(e,t){return M7i(e,new YA.classes.URLSearchParams,{visitor:function(r,i,n,a){return YA.isNode&&rr.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function LJM(e){return rr.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function VJM(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 WJM(e){function t(r,i,n,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=a>=r.length;return o=!o&&rr.isArray(n)?n.length:o,d?(rr.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i,!c):((!n[o]||!rr.isObject(n[o]))&&(n[o]=[]),t(r,i,n[o],a)&&rr.isArray(n[o])&&(n[o]=VJM(n[o])),!c)}if(rr.isFormData(e)&&rr.isFunction(e.entries)){let r={};return rr.forEachEntry(e,(i,n)=>{t(LJM(i),n,r,0)}),r}return null}var P7o=WJM;function GJM(e,t,r){if(rr.isString(e))try{return(t||JSON.parse)(e),rr.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var nwc={transitional:okn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=rr.isObject(t);if(a&&rr.isHTMLForm(t)&&(t=new FormData(t)),rr.isFormData(t))return n?JSON.stringify(P7o(t)):t;if(rr.isArrayBuffer(t)||rr.isBuffer(t)||rr.isStream(t)||rr.isFile(t)||rr.isBlob(t)||rr.isReadableStream(t))return t;if(rr.isArrayBufferView(t))return t.buffer;if(rr.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return iwc(t,this.formSerializer).toString();if((c=rr.isFileList(t))||i.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return M7i(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),GJM(t)):t}],transformResponse:[function(t){let r=this.transitional||nwc.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(rr.isResponse(t)||rr.isReadableStream(t))return t;if(t&&rr.isString(t)&&(i&&!this.responseType||n)){let o=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?Ma.from(c,Ma.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:YA.classes.FormData,Blob:YA.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};rr.forEach(["delete","get","head","post","put","patch"],e=>{nwc.headers[e]={}});var ukn=nwc;var HJM=rr.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"]),F1_=e=>{let t={},r,i,n;return e&&e.split(`
1148
+ `);for(let o=i;o<a.length;o++){let c=a[o];if(c.length>1024)continue;let d=Qq_.test(c)?c.replace(Qq_,"$1"):c;if(!d.match(/\S*Error: /)){for(let s of t){let u=s(d,e);if(u){n.push(u);break}}if(n.length>=Uq_)break}}return Lq_(n)}}var T0c=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){let i=AWa(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){let r=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${r}: ${t.message}`:r}isDOMException(t){return d_n(t,"DOMException")}isDOMError(t){return d_n(t,"DOMError")}};var R0c=class{match(t){return j0c(t)}coerce(t,r){return{type:this.getType(t),value:this.getMessage(t,r),stack:this.getStack(t),cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,r){let i=t.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(t){return t.stacktrace||t.stack||void 0}};var z0c=class{constructor(){}match(t){return dq_(t)&&t.error!=null}coerce(t,r){let i=r.apply(t.error);return i||{type:"ErrorEvent",value:t.message,stack:r.syntheticException?.stack,synthetic:!0}}};var mKM=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,N0c=class{match(t){return typeof t=="string"}coerce(t,r){let[i,n]=this.getInfos(t);return{type:i??"Error",value:n??t,stack:r.syntheticException?.stack,synthetic:!0}}getInfos(t){let r="Error",i=t,n=t.match(mKM);return n&&(r=n[1],i=n[2]),[r,i]}};var Vq_=["fatal","error","warning","log","info","debug"];function c7o(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let i=r.length;i>0;i--){let n=r.slice(0,i).join(", ");if(!(n.length>t))return i===r.length||n.length<=t?n:`${n.slice(0,t)}...`}return""}var F0c=class{match(t){return typeof t=="object"&&t!==null}coerce(t,r){let i=this.getErrorPropertyFromObject(t);return i?r.apply(i):{type:this.getType(t),value:this.getValue(t),stack:r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return XHo(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;let r=this.getObjectClassName(t),i=c7o(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${i}`}isSeverityLevel(t){return AWa(t)&&!lq_(t)&&Vq_.indexOf(t)>=0}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(Eq_(i))return i}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var Q0c=class{match(t){return XHo(t)}coerce(t,r){let i=t.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${c7o(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var U0c=class{match(t){return mWa(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var L0c=class{match(t){return d_n(t,"PromiseRejectionEvent")}coerce(t,r){let i=this.getUnhandledRejectionReason(t);return mWa(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:r.syntheticException?.stack,synthetic:!0}:r.apply(i)}getUnhandledRejectionReason(t){if(mWa(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}};var V0c=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)}}};var Hq_=require("fs"),xq_=require("readline"),l7o=new r$.ReduceableCache(25),Kq_=new r$.ReduceableCache(20),W0c=7,PKM=1e3,jKM=1e4;async function Jq_(e){let t={};for(let n=e.length-1;n>=0;n--){let a=e[n],o=a?.filename;if(!a||typeof o!="string"||typeof a.lineno!="number"||MKM(o)||DKM(a))continue;t[o]||(t[o]=[]),t[o].push(a.lineno)}let r=Object.keys(t);if(r.length==0)return e;let i=[];for(let n of r){if(Kq_.get(n))continue;let a=t[n];if(!a)continue;a.sort((d,s)=>d-s);let o=IKM(a);if(o.every(d=>BKM(n,d)))continue;let c=CKM(l7o,n,{});i.push(wKM(n,o,c))}return await Promise.all(i).catch(()=>{}),e&&e.length>0&&EKM(e,l7o),l7o.reduce(),e}function wKM(e,t,r){return new Promise(i=>{let n=(0,Hq_.createReadStream)(e),a=(0,xq_.createInterface)({input:n});function o(){n.destroy(),i()}let c=0,d=0,s=t[d];if(s===void 0)return void o();let u=s[0],f=s[1];function p(){Kq_.set(e,1),a.close(),a.removeAllListeners(),o()}n.on("error",p),a.on("error",p),a.on("close",o),a.on("line",_=>{if(c++,!(c<u)&&(r[c]=qKM(_,0),c>=f)){if(d===t.length-1){a.close(),a.removeAllListeners();return}d++;let h=t[d];if(h===void 0){a.close(),a.removeAllListeners();return}u=h[0],f=h[1]}})})}function EKM(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;SKM(r.lineno,r,i)}}function SKM(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let n=$q_(e);n<e;n++){let a=r[n];if(a===void 0)return void Wq_(t);t.pre_context.push(a)}if(r[e]===void 0)return void Wq_(t);t.context_line=r[e];let i=Yq_(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 Wq_(e){delete e.pre_context,delete e.context_line,delete e.post_context}function MKM(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function DKM(e){return e.lineno!==void 0&&e.lineno>jKM||e.colno!==void 0&&e.colno>PKM}function BKM(e,t){let r=l7o.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 IKM(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let i=Gq_(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+W0c:(n.push(i),i=Gq_(a)),t++}return n}function Gq_(e){return[$q_(e),Yq_(e)]}function $q_(e){return Math.max(1,e-W0c)}function Yq_(e){return e+W0c}function CKM(e,t,r){let i=e.get(t);return i===void 0?(e.set(t,r),r):i}function qKM(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}function TKM(e,t){let r=!1;return Object.assign(i=>{let a=global.process.listeners("uncaughtException").filter(o=>o.name!=="domainUncaughtExceptionClear"&&o._posthogErrorHandler!==!0).length===0;e(i,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&a&&(r=!0,t(i))},{_posthogErrorHandler:!0})}function Xq_(e,t){globalThis.process?.on("uncaughtException",TKM(e,t))}function Zq_(e){globalThis.process?.on("unhandledRejection",t=>e(t,{mechanism:{type:"onunhandledrejection",handled:!1}}))}var RKM=2e3,pFi=class e{constructor(t,r,i){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=i,this._rateLimiter=new ZHo({refillRate:1,bucketSize:10,refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static async buildEventMessage(t,r,i,n){let a={...n};i||(a.$process_person_profile=!1);let o=this.errorPropertiesBuilder.buildFromUnknown(t,r);return o.$exception_list=await this.errorPropertiesBuilder.modifyFrames(o.$exception_list),{event:"$exception",distinctId:i||IJt(),properties:{...o,...a}}}startAutocaptureIfEnabled(){this.isEnabled()&&(Xq_(this.onException.bind(this),this.onFatalError.bind(this)),Zq_(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{let i=await e.buildEventMessage(t,r),a=i.properties?.$exception_list[0]?.type??"Exception";return this._rateLimiter.consumeRateLimit(a)?void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:a}):this.client.capture(i)})())}async onFatalError(t){console.error(t),await this.client.shutdown(RKM),process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}};var kq_="5.17.4";async function e1_(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("SubtleCrypto API not available");let r=await t.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("")}var zKM=6e4,NKM=1152921504606847e3,FKM=["is_not"],k2n=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},s0=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},qJt=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},f7o=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:i,timeout:n,host:a,customHeaders:o,...c}){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=c.fetch||fetch,this.onError=c.onError,this.customHeaders=o,this.onLoad=c.onLoad,this.cacheProvider=c.cacheProvider,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,i={},n={},a={}){await this.loadFeatureFlags();let o,c;if(!this.loadedSuccessfullyOnce)return o;if(c=this.featureFlagsByKey[t],c!==void 0)try{o=(await this.computeFlagAndPayloadLocally(c,r,i,n,a)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${o}`))}catch(d){d instanceof qJt||d instanceof s0?this.logMsgIfDebug(()=>console.debug(`${d.name} when computing flag locally: ${t}: ${d.message}`)):d instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${d}`))}return o}async getAllFlagsAndPayloads(t,r={},i={},n={},a){await this.loadFeatureFlags();let o={},c={},d=this.featureFlags.length==0,s=a?a.map(f=>this.featureFlagsByKey[f]).filter(Boolean):this.featureFlags,u={};return await Promise.all(s.map(async f=>{try{let{value:p,payload:_}=await this.computeFlagAndPayloadLocally(f,t,r,i,n,void 0,u);o[f.key]=p,_&&(c[f.key]=_)}catch(p){p instanceof qJt||p instanceof s0?this.logMsgIfDebug(()=>console.debug(`${p.name} when computing flag locally: ${f.key}: ${p.message}`)):p instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${f.key}: ${p}`)),d=!0}})),{response:o,payloads:c,fallbackToFlags:d}}async computeFlagAndPayloadLocally(t,r,i={},n={},a={},o,c,d=!1){if(d||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};let s;s=o!==void 0?o:await this.computeFlagValueLocally(t,r,i,n,a,c);let u=this.getFeatureFlagPayload(t.key,s);return{value:s,payload:u}}async computeFlagValueLocally(t,r,i={},n={},a={},o={}){if(t.ensure_experience_continuity)throw new s0("Flag has experience continuity enabled");if(!t.active)return!1;let d=(t.filters||{}).aggregation_group_type_index;if(d==null)return await this.matchFeatureFlagProperties(t,r,n,o);{let s=this.groupTypeMapping[String(d)];if(!s)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${d} for feature flag ${t.key}`)),new s0("Flag has unknown group type index");if(!(s in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;let u=a[s];return await this.matchFeatureFlagProperties(t,i[s],u,o)}}getFeatureFlagPayload(t,r){let i=null;if(r!==!1&&r!=null&&(typeof r=="boolean"?i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]||null:typeof r=="string"&&(i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]||null),i!=null)){if(typeof i=="object")return i;if(typeof i=="string")try{return JSON.parse(i)}catch{}return i}return null}async evaluateFlagDependency(t,r,i,n){let a=t.key;if(!this.featureFlagsByKey)throw new s0("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new s0(`Flag dependency property for '${a}' is missing required 'dependency_chain' field`);let o=t.dependency_chain;if(!Array.isArray(o))throw new s0(`Flag dependency property for '${a}' has an invalid 'dependency_chain' (expected array, got ${typeof o})`);if(o.length===0)throw new s0(`Circular dependency detected for flag '${a}' (empty dependency chain)`);for(let d of o){if(!(d in n)){let u=this.featureFlagsByKey[d];if(u)if(u.active)try{let f=await this.matchFeatureFlagProperties(u,r,i,n);n[d]=f}catch(f){throw new s0(`Error evaluating flag dependency '${d}' for flag '${a}': ${f}`)}else n[d]=!1;else throw new s0(`Missing flag dependency '${d}' for flag '${a}'`)}if(n[d]==null)throw new s0(`Dependency '${d}' could not be evaluated`)}let c=n[a];return this.flagEvaluatesToExpectedValue(t.value,c)}flagEvaluatesToExpectedValue(t,r){return typeof t=="boolean"?t===r||typeof r=="string"&&r!==""&&t===!0:typeof t=="string"?r===t:!1}async matchFeatureFlagProperties(t,r,i,n={}){let a=t.filters||{},o=a.groups||[],c=!1,d;for(let s of o)try{if(await this.isConditionMatch(t,r,s,i,n)){let u=s.variant,f=a.multivariate?.variants||[];d=u&&f.some(p=>p.key===u)?u:await this.getMatchingVariant(t,r)||!0;break}}catch(u){if(u instanceof qJt)throw u;if(u instanceof s0)c=!0;else throw u}if(d!==void 0)return d;if(c)throw new s0("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,i,n,a={}){let o=i.rollout_percentage,c=d=>{this.logMsgIfDebug(()=>console.warn(d))};if((i.properties||[]).length>0){for(let d of i.properties){let s=d.type,u=!1;if(u=s==="cohort"?a1_(d,n,this.cohorts,this.debugMode):s==="flag"?await this.evaluateFlagDependency(d,r,n,a):n1_(d,n,c),!u)return!1}if(o==null)return!0}return!(o!=null&&await t1_(t.key,r)>o/100)}async getMatchingVariant(t,r){let i=await t1_(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(c=>{n=i+c.rollout_percentage/100,r.push({valueMin:i,valueMax:n,key:c.key}),i=n}),r}updateFlagState(t){this.featureFlags=t.flags,this.featureFlagsByKey=t.flags.reduce((r,i)=>(r[i.key]=i,r),{}),this.groupTypeMapping=t.groupTypeMapping,this.cohorts=t.cohorts,this.loadedSuccessfullyOnce=!0}async loadFromCache(t){if(!this.cacheProvider)return!1;try{let r=await this.cacheProvider.getFlagDefinitions();return r?(this.updateFlagState(r),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${t} (${r.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),!0):!1}catch(r){return this.onError?.(new Error(`Failed to load from cache: ${r}`)),!1}}async loadFeatureFlags(t=!1){if(!(this.loadedSuccessfullyOnce&&!t))return this.loadingPromise||(this.loadingPromise=this._loadFeatureFlags().catch(r=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${r}`))).finally(()=>{this.loadingPromise=void 0})),this.loadingPromise}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getPollingInterval(){return this.shouldBeginExponentialBackoff?Math.min(zKM,this.pollingInterval*2**this.backOffCount):this.pollingInterval}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval());try{let t=!0;if(this.cacheProvider)try{t=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(i){this.onError?.(new Error(`Error in shouldFetchFlagDefinitions: ${i}`))}if(!t&&(await this.loadFromCache("Loaded flags from cache (skipped fetch)")||this.loadedSuccessfullyOnce))return;let r=await this._requestFeatureFlagDefinitions();if(!r)return;switch(r.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=r.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0;return;case 401:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new k2n(`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 k2n(`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 k2n(`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 i=await r.json()??{};if(!("flags"in i))return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(i)}`));this.flagsEtag=r.headers?.get("ETag")??void 0;let n={flags:i.flags??[],groupTypeMapping:i.group_type_mapping||{},cohorts:i.cohorts||{}};if(this.updateFlagState(n),this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(n)}catch(a){this.onError?.(new Error(`Failed to store in cache: ${a}`))}this.onLoad?.(this.featureFlags.length);break}default:return}}catch(t){t instanceof k2n&&this.onError?.(t)}}getPersonalApiKeyRequestOptions(t="GET",r){let i={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};return r&&(i["If-None-Match"]=r),{method:t,headers:i}}_requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),i=null;if(this.timeout&&typeof this.timeout=="number"){let n=new AbortController;i=p_n(()=>{n.abort()},this.timeout),r.signal=n.signal}try{let n=this.fetch;return n(t,r)}finally{clearTimeout(i)}}async stopPoller(t=3e4){if(clearTimeout(this.poller),this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await Promise.race([r,new Promise((i,n)=>setTimeout(()=>n(new Error(`Cache shutdown timeout after ${t}ms`)),t))])}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};async function t1_(e,t,r=""){let i=await e1_(`${e}.${t}${r}`);return parseInt(i.slice(0,15),16)/NKM}function n1_(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 s0("Operator is_not_set is not supported")}else throw new s0(`Property ${i} not found in propertyValues`);let o=t[i];if(o==null&&!FKM.includes(a))return r&&r(`Property ${i} cannot have a value of null/undefined with the ${a} operator`),!1;function c(s,u){return Array.isArray(s)?s.map(f=>String(f).toLowerCase()).includes(String(u).toLowerCase()):String(s).toLowerCase()===String(u).toLowerCase()}function d(s,u,f){if(f==="gt")return s>u;if(f==="gte")return s>=u;if(f==="lt")return s<u;if(f==="lte")return s<=u;throw new Error(`Invalid operator: ${f}`)}switch(a){case"exact":return c(n,o);case"is_not":return!c(n,o);case"is_set":return i in t;case"icontains":return String(o).toLowerCase().includes(String(n).toLowerCase());case"not_icontains":return!String(o).toLowerCase().includes(String(n).toLowerCase());case"regex":return r1_(String(n))&&String(o).match(String(n))!==null;case"not_regex":return r1_(String(n))&&String(o).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||o==null?d(String(o),String(n),a):typeof o=="string"?d(o,String(n),a):d(o,s,a)}case"is_date_after":case"is_date_before":{if(typeof n=="boolean")throw new s0("Date operations cannot be performed on boolean values");let s=UKM(String(n));if(s==null&&(s=i1_(n)),s==null)throw new s0(`Invalid date: ${n}`);let u=i1_(o);return["is_date_before"].includes(a)?u<s:u>s}default:throw new s0(`Unknown operator: ${a}`)}}function QKM(e,t){if(!(e in t))throw new qJt(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}function a1_(e,t,r,i=!1){let n=String(e.value);QKM(n,r);let a=r[n];return o1_(a,t,r,i)}function o1_(e,t,r,i=!1){if(!e)return!0;let n=e.type,a=e.values;if(!a||a.length===0)return!0;let o=!1;if("values"in a[0]){for(let c of a)try{let d=o1_(c,t,r,i);if(n==="AND"){if(!d)return!1}else if(d)return!0}catch(d){if(d instanceof qJt)throw d;if(d instanceof s0)i&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new s0("Can't match cohort without a given cohort property value");return n==="AND"}for(let c of a)try{let d;if(c.type==="cohort")d=a1_(c,t,r,i);else if(c.type==="flag"){i&&console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${c.key||"unknown"}'`);continue}else d=n1_(c,t);let s=c.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 qJt)throw d;if(d instanceof s0)i&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new s0("can't match cohort without a given cohort property value");return n==="AND"}function r1_(e){try{return new RegExp(e),!0}catch{return!1}}function i1_(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 s0(`${e} is in an invalid date format`)}throw new s0(`The date provided ${e} must be a string, number, or date object`)}function UKM(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),i=new Date(new Date().toISOString());if(!r)return null;{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()-7*n);else if(a=="m")i.setUTCMonth(i.getUTCMonth()-n);else{if(a!="y")return null;i.setUTCFullYear(i.getUTCFullYear()-n)}return i}}var d7o=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};var LKM=100,u1_=3e4,VKM=5e4,p7o=class extends EWa{constructor(t,r={}){if(super(t,r),this._memoryStorage=new d7o,this.options=r,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,LKM):u1_,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.');r.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new f7o({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:n=>{this._events.emit("error",n)},onLoad:n=>{this._events.emit("localEvaluationFlagsLoaded",n)},customHeaders:this.getCustomHeaders(),cacheProvider:r.flagDefinitionCacheProvider}))}this.errorTracking=new pFi(this,r,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||VKM}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):fetch(t,r)}getLibraryVersion(){return kq_}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._logger.warn("Called capture() with a string as the first argument when an object was expected."),this.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:i,properties:n,options:a})=>super.captureStateless(r,i,n,{timestamp:a.timestamp,disableGeoip:a.disableGeoip,uuid:a.uuid})).catch(r=>{r&&console.error(r)}))}async captureImmediate(t){return typeof t=="string"&&this._logger.warn("Called captureImmediate() with a string as the first argument when an object was expected."),this.addPendingPromise(this.prepareEventMessage(t).then(({distinctId:r,event:i,properties:n,options:a})=>super.captureStatelessImmediate(r,i,n,{timestamp:a.timestamp,disableGeoip:a.disableGeoip,uuid:a.uuid})).catch(r=>{r&&console.error(r)}))}identify({distinctId:t,properties:r={},disableGeoip:i}){let{$set:n,$set_once:a,$anon_distinct_id:o,...c}=r,u={$set:n||c,$set_once:a||{},$anon_distinct_id:o??void 0};super.identifyStateless(t,u,{disableGeoip:i})}async identifyImmediate({distinctId:t,properties:r={},disableGeoip:i}){let{$set:n,$set_once:a,$anon_distinct_id:o,...c}=r,u={$set:n||c,$set_once:a||{},$anon_distinct_id:o??void 0};super.identifyStatelessImmediate(t,u,{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=u1_){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:o,sendFeatureFlagEvents:c,personProperties:d,groupProperties:s}=i||{},u=this.addLocalPersonAndGroupProperties(r,n,d,s);d=u.allPersonProperties,s=u.allGroupProperties,o==null&&(o=!1),c==null&&(c=this.options.sendFeatureFlagEvent??!0);let f=await this.featureFlagsPoller?.getFeatureFlag(t,r,n,d,s),p=f!==void 0,_,h,y;if(!p&&!o){let v=await super.getFeatureFlagDetailStateless(t,r,n,d,s,a);if(v===void 0)return;y=v.response,f=f_n(y),_=v?.requestId,h=v?.evaluatedAt}let b=`${t}_${f}`;return c&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(b))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(b):this.distinctIdHasSentFlagCalls[r]=[b],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:f,$feature_flag_id:y?.metadata?.id,$feature_flag_version:y?.metadata?.version,$feature_flag_reason:y?.reason?.description??y?.reason?.code,locally_evaluated:p,[`$feature/${t}`]:f,$feature_flag_request_id:_,$feature_flag_evaluated_at:h},groups:n,disableGeoip:a})),f}async getFeatureFlagPayload(t,r,i,n){let{groups:a,disableGeoip:o}=n||{},{onlyEvaluateLocally:c,personProperties:d,groupProperties:s}=n||{},u=this.addLocalPersonAndGroupProperties(r,a,d,s);d=u.allPersonProperties,s=u.allGroupProperties;let f;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let h=this.featureFlagsPoller?.featureFlagsByKey[t];if(h)try{let y=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(h,r,a,d,s,i);y&&(i=y.value,f=y.payload)}catch(y){if(y instanceof qJt||y instanceof s0)this._logger?.info(`${y.name} when computing flag locally: ${h.key}: ${y.message}`);else throw y}}return c==null&&(c=!1),!(f!==void 0)&&!c&&(f=await super.getFeatureFlagPayloadStateless(t,r,a,d,s,o)),f}async getRemoteConfigPayload(t){if(!this.options.personalApiKey)throw new Error("Personal API key is required for remote config payload decryption");let r=await this._requestRemoteConfigPayload(t);if(!r)return;let i=await r.json();if(typeof i=="string")try{return JSON.parse(i)}catch{}return i}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,flagKeys:a}=r||{},{onlyEvaluateLocally:o,personProperties:c,groupProperties:d}=r||{},s=this.addLocalPersonAndGroupProperties(t,i,c,d);c=s.allPersonProperties,d=s.allGroupProperties,o==null&&(o=!1);let u=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,i,c,d,a),f={},p={},_=!0;if(u&&(f=u.response,p=u.payloads,_=u.fallbackToFlags),_&&!o){let h=await super.getFeatureFlagsAndPayloadsStateless(t,i,c,d,n,a);f={...f,...h.flags||{}},p={...p,...h.payloads||{}}}return{featureFlags:f,featureFlagPayloads:p}}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)}withContext(t,r,i){return this.context?this.context.run(t,r,i):r()}getContext(){return this.context?.get()}async _shutdown(t){return this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown(),super._shutdown(t)}async _requestRemoteConfigPayload(t){if(!this.options.personalApiKey)return;let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config?token=${encodeURIComponent(this.apiKey)}`,i={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},n=null;if(this.options.requestTimeout&&typeof this.options.requestTimeout=="number"){let a=new AbortController;n=p_n(()=>{a.abort()},this.options.requestTimeout),i.signal=a.signal}try{return await this.fetch(r,i)}catch(a){this._events.emit("error",a);return}finally{n&&clearTimeout(n)}}extractPropertiesFromEvent(t,r){if(!t)return{personProperties:{},groupProperties:{}};let i={},n={};for(let[a,o]of Object.entries(t))if(pq_(o)&&r&&a in r){let c={};for(let[d,s]of Object.entries(o))c[String(d)]=String(s);n[String(a)]=c}else i[String(a)]=String(o);return{personProperties:i,groupProperties:n}}async getFeatureFlagsForEvent(t,r,i,n){let a=n?.personProperties||{},o=n?.groupProperties||{},c=n?.flagKeys;if(n?.onlyEvaluateLocally??!1)if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let s={};for(let[u,f]of Object.entries(r||{}))s[u]=String(f);return await this.getAllFlags(t,{groups:s,personProperties:a,groupProperties:o,disableGeoip:i,onlyEvaluateLocally:!0,flagKeys:c})}else return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let s={};for(let[u,f]of Object.entries(r||{}))s[u]=String(f);return await this.getAllFlags(t,{groups:s,personProperties:a,groupProperties:o,disableGeoip:i,onlyEvaluateLocally:!0,flagKeys:c})}return(await super.getFeatureFlagsStateless(t,r,a,o,i)).flags}addLocalPersonAndGroupProperties(t,r,i,n){let a={distinct_id:t,...i||{}},o={};if(r)for(let c of Object.keys(r))o[c]={$group_key:r[c],...n?.[c]||{}};return{allPersonProperties:a,allGroupProperties:o}}captureException(t,r,i){let n=new Error("PostHog syntheticException");this.addPendingPromise(pFi.buildEventMessage(t,{syntheticException:n},r,i).then(a=>this.capture(a)))}async captureExceptionImmediate(t,r,i){let n=new Error("PostHog syntheticException");this.addPendingPromise(pFi.buildEventMessage(t,{syntheticException:n},r,i).then(a=>this.captureImmediate(a)))}async prepareEventMessage(t){let{distinctId:r,event:i,properties:n,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s}=t,u=this.context?.get(),f=r||u?.distinctId,p={...u?.properties||{},...n||{}};f||(f=IJt(),p.$process_person_profile=!1),u?.sessionId&&!p.$session_id&&(p.$session_id=u.sessionId);let _=this._runBeforeSend({distinctId:f,event:i,properties:p,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s});if(!_)return Promise.reject(null);let h=await Promise.resolve().then(async()=>{if(o){let y=typeof o=="object"?o:void 0;return await this.getFeatureFlagsForEvent(_.distinctId,a,d,y)}return _.event,{}}).then(y=>{let b={};if(y)for(let[O,A]of Object.entries(y))b[`$feature/${O}`]=A;let v=Object.keys(y||{}).filter(O=>y?.[O]!==!1).sort();return v.length>0&&(b.$active_feature_flags=v),b}).catch(()=>({})).then(y=>({...y,..._.properties||{},$groups:_.groups||a}));return _.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof h.$raw_user_agent=="string"&&uq_(h.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(_.event="$bot_pageview",h.$browser_type="bot"),{distinctId:_.distinctId,event:_.event,properties:h,options:{timestamp:_.timestamp,disableGeoip:_.disableGeoip,uuid:_.uuid}}}_runBeforeSend(t){let r=this.options.before_send;if(!r)return t;let i=Array.isArray(r)?r:[r],n=t;for(let a of i){if(n=a(n),!n)return this._logger.info(`Event '${t.event}' was rejected in beforeSend function`),null;if(!n.properties||Object.keys(n.properties).length===0){let o=`Event '${n.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(o)}}return n}};var s1_=require("async_hooks"),_7o=class{constructor(){this.storage=new s1_.AsyncLocalStorage}get(){return this.storage.getStore()}run(t,r,i){if(i?.fresh===!0)return this.storage.run(t,r);{let a=this.get()||{},o={distinctId:t.distinctId??a.distinctId,sessionId:t.sessionId??a.sessionId,properties:{...a.properties||{},...t.properties||{}}};return this.storage.run(o,r)}}};var c1_="posthog-node";function WKM(e,{organization:t,projectId:r,prefix:i,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}={}){return o=>{if(!(n==="*"||n.includes(o.level)))return o;o.tags||(o.tags={});let d=o.tags[G0c.POSTHOG_ID_TAG];if(d===void 0)return o;let s=e.options.host??"https://us.i.posthog.com",u=new URL(`/project/${e.apiKey}/person/${d}`,s).toString();o.tags["PostHog Person URL"]=u;let f=o.exception?.values||[],p=f.map(h=>({...h,stacktrace:h.stacktrace?{...h.stacktrace,type:"raw",frames:(h.stacktrace.frames||[]).map(y=>({...y,platform:"node:javascript"}))}:void 0})),_={$exception_message:f[0]?.value||o.message,$exception_type:f[0]?.type,$exception_level:o.level,$exception_list:p,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:f[0]?.value||o.message,$sentry_exception_type:f[0]?.type,$sentry_tags:o.tags};return t&&r&&(_.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+o.event_id),a&&e.capture({event:"$exception",distinctId:d,properties:_}),o}}var G0c=class{static#e=this.POSTHOG_ID_TAG="posthog_distinct_id";constructor(t,r,i,n,a){this.name=c1_,this.name=c1_,this.setupOnce=function(o,c){let d=c()?.getClient()?.getDsn()?.projectId;o(WKM(t,{organization:r,projectId:d,prefix:i,severityAllowList:n,sendExceptionsToPostHog:a??!0}))}}};pFi.errorPropertiesBuilder=new r$.ErrorPropertiesBuilder([new r$.EventCoercer,new r$.ErrorCoercer,new r$.ObjectCoercer,new r$.StringCoercer,new r$.PrimitiveCoercer],r$.createStackParser("node:javascript",r$.nodeStackLineParser),[rq_(),Jq_]);var ekn=class extends p7o{getLibraryId(){return"posthog-node"}initializeContext(){return new _7o}};var h7o=class{posthog;constructor({posthogApiKey:t}){this.posthog=new ekn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"3.35.2",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var SWa=class{async sendEvent(){}async identify(){}async flush(){}};var tkn=require("fs/promises"),p1_=require("os"),_1_=require("path");var l1_=ce(require("crypto")),b7o=new Uint8Array(256),y7o=b7o.length;function H0c(){return y7o>b7o.length-16&&(l1_.default.randomFillSync(b7o),y7o=0),b7o.slice(y7o,y7o+=16)}var B4=[];for(let e=0;e<256;++e)B4.push((e+256).toString(16).slice(1));function f1_(e,t=0){return B4[e[t+0]]+B4[e[t+1]]+B4[e[t+2]]+B4[e[t+3]]+"-"+B4[e[t+4]]+B4[e[t+5]]+"-"+B4[e[t+6]]+B4[e[t+7]]+"-"+B4[e[t+8]]+B4[e[t+9]]+"-"+B4[e[t+10]]+B4[e[t+11]]+B4[e[t+12]]+B4[e[t+13]]+B4[e[t+14]]+B4[e[t+15]]}var d1_=ce(require("crypto")),x0c={randomUUID:d1_.default.randomUUID};function GKM(e,t,r){if(x0c.randomUUID&&!t&&!e)return x0c.randomUUID();e=e||{};let i=e.random||(e.rng||H0c)();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 f1_(i)}var Hbe=GKM;var HKM="id",xKM=".fern",MWa=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new ekn(r),this.userId=t==null?void 0:Fvc(t),this.token=t}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){let r=await this.getUserEmail();this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"3.35.2",...t,...t.properties,usingAccessToken:!1,...r!=null?{userEmail:r}:{}}})}async flush(){await this.posthog.flush()}userEmail;async getUserEmail(){if(this.userEmail!==null){if(this.userEmail!=null)return this.userEmail;if(this.token==null){this.userEmail=null;return}try{let t=await O4({token:this.token.value}).user.getMyself();if(t.ok&&t.body.email!=null)return this.userEmail=t.body.email,this.userEmail}catch{}this.userEmail=null}}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Ct(Ir.of((0,p1_.homedir)()),Xe.of(xKM),Xe.of(HKM));await mi(t)||(await(0,tkn.mkdir)((0,_1_.dirname)(t),{recursive:!0}),await(0,tkn.writeFile)(t,Hbe())),this.persistedDistinctId=(await(0,tkn.readFile)(t)).toString()}return this.persistedDistinctId}};var K0c;async function rkn(){return K0c==null&&(K0c=await KKM()),K0c}async function KKM(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new SWa;let r=await F8o();return r!=null?new MWa({token:r,posthogApiKey:e}):await fZn()!=null?new h7o({posthogApiKey:e}):new MWa({token:void 0,posthogApiKey:e})}catch{return new SWa}}function DWa(e,t){return function(){return e.apply(t,arguments)}}var{toString:JKM}=Object.prototype,{getPrototypeOf:$0c}=Object,{iterator:g7o,toStringTag:y1_}=Symbol,O7o=(e=>t=>{let r=JKM.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),$Vt=e=>(e=e.toLowerCase(),t=>O7o(t)===e),A7o=e=>t=>typeof t===e,{isArray:nkn}=Array,ikn=A7o("undefined");function BWa(e){return e!==null&&!ikn(e)&&e.constructor!==null&&!ikn(e.constructor)&&i$(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var b1_=$Vt("ArrayBuffer");function $KM(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&b1_(e.buffer),t}var YKM=A7o("string"),i$=A7o("function"),v1_=A7o("number"),IWa=e=>e!==null&&typeof e=="object",XKM=e=>e===!0||e===!1,v7o=e=>{if(O7o(e)!=="object")return!1;let t=$0c(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(y1_ in e)&&!(g7o in e)},ZKM=e=>{if(!IWa(e)||BWa(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},kKM=$Vt("Date"),eJM=$Vt("File"),tJM=$Vt("Blob"),rJM=$Vt("FileList"),iJM=e=>IWa(e)&&i$(e.pipe),nJM=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||i$(e.append)&&((t=O7o(e))==="formdata"||t==="object"&&i$(e.toString)&&e.toString()==="[object FormData]"))},aJM=$Vt("URLSearchParams"),[oJM,uJM,sJM,cJM]=["ReadableStream","Request","Response","Headers"].map($Vt),lJM=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function CWa(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),nkn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(BWa(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(i=0;i<o;i++)c=a[i],t.call(null,e[c],c,e)}}function g1_(e,t){if(BWa(e))return null;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 __n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,O1_=e=>!ikn(e)&&e!==__n;function J0c(){let{caseless:e,skipUndefined:t}=O1_(this)&&this||{},r={},i=(n,a)=>{let o=e&&g1_(r,a)||a;v7o(r[o])&&v7o(n)?r[o]=J0c(r[o],n):v7o(n)?r[o]=J0c({},n):nkn(n)?r[o]=n.slice():(!t||!ikn(n))&&(r[o]=n)};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&CWa(arguments[n],i);return r}var fJM=(e,t,r,{allOwnKeys:i}={})=>(CWa(t,(n,a)=>{r&&i$(n)?e[a]=DWa(n,r):e[a]=n},{allOwnKeys:i}),e),dJM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pJM=(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)},_JM=(e,t,r,i)=>{let n,a,o,c={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)o=n[a],(!i||i(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&$0c(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},hJM=(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},yJM=e=>{if(!e)return null;if(nkn(e))return e;let t=e.length;if(!v1_(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},bJM=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&$0c(Uint8Array)),vJM=(e,t)=>{let i=(e&&e[g7o]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},gJM=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},OJM=$Vt("HTMLFormElement"),AJM=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),h1_=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),mJM=$Vt("RegExp"),A1_=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};CWa(r,(n,a)=>{let o;(o=t(n,a,e))!==!1&&(i[a]=o||n)}),Object.defineProperties(e,i)},PJM=e=>{A1_(e,(t,r)=>{if(i$(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(i$(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+"'")})}})},jJM=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return nkn(e)?i(e):i(String(e).split(t)),r},wJM=()=>{},EJM=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function SJM(e){return!!(e&&i$(e.append)&&e[y1_]==="FormData"&&e[g7o])}var MJM=e=>{let t=new Array(10),r=(i,n)=>{if(IWa(i)){if(t.indexOf(i)>=0)return;if(BWa(i))return i;if(!("toJSON"in i)){t[n]=i;let a=nkn(i)?[]:{};return CWa(i,(o,c)=>{let d=r(o,n+1);!ikn(d)&&(a[c]=d)}),t[n]=void 0,a}}return i};return r(e,0)},DJM=$Vt("AsyncFunction"),BJM=e=>e&&(IWa(e)||i$(e))&&i$(e.then)&&i$(e.catch),m1_=((e,t)=>e?setImmediate:t?((r,i)=>(__n.addEventListener("message",({source:n,data:a})=>{n===__n&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),__n.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",i$(__n.postMessage)),IJM=typeof queueMicrotask<"u"?queueMicrotask.bind(__n):typeof process<"u"&&process.nextTick||m1_,CJM=e=>e!=null&&i$(e[g7o]),rr={isArray:nkn,isArrayBuffer:b1_,isBuffer:BWa,isFormData:nJM,isArrayBufferView:$KM,isString:YKM,isNumber:v1_,isBoolean:XKM,isObject:IWa,isPlainObject:v7o,isEmptyObject:ZKM,isReadableStream:oJM,isRequest:uJM,isResponse:sJM,isHeaders:cJM,isUndefined:ikn,isDate:kKM,isFile:eJM,isBlob:tJM,isRegExp:mJM,isFunction:i$,isStream:iJM,isURLSearchParams:aJM,isTypedArray:bJM,isFileList:rJM,forEach:CWa,merge:J0c,extend:fJM,trim:lJM,stripBOM:dJM,inherits:pJM,toFlatObject:_JM,kindOf:O7o,kindOfTest:$Vt,endsWith:hJM,toArray:yJM,forEachEntry:vJM,matchAll:gJM,isHTMLForm:OJM,hasOwnProperty:h1_,hasOwnProp:h1_,reduceDescriptors:A1_,freezeMethods:PJM,toObjectSet:jJM,toCamelCase:AJM,noop:wJM,toFiniteNumber:EJM,findKey:g1_,global:__n,isContextDefined:O1_,isSpecCompliantForm:SJM,toJSONObject:MJM,isAsyncFn:DJM,isThenable:BJM,setImmediate:m1_,asap:IJM,isIterable:CJM};function akn(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)}rr.inherits(akn,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:rr.toJSONObject(this.config),code:this.code,status:this.status}}});var P1_=akn.prototype,j1_={};["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=>{j1_[e]={value:e}});Object.defineProperties(akn,j1_);Object.defineProperty(P1_,"isAxiosError",{value:!0});akn.from=(e,t,r,i,n,a)=>{let o=Object.create(P1_);rr.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return akn.call(o,c,d,r,i,n),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var Ma=akn;var w1_=ce(EXn(),1),m7o=w1_.default;function Y0c(e){return rr.isPlainObject(e)||rr.isArray(e)}function S1_(e){return rr.endsWith(e,"[]")?e.slice(0,-2):e}function E1_(e,t,r){return e?e.concat(t).map(function(n,a){return n=S1_(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function qJM(e){return rr.isArray(e)&&!e.some(Y0c)}var TJM=rr.toFlatObject(rr,{},null,function(t){return/^is[A-Z]/.test(t)});function RJM(e,t,r){if(!rr.isObject(e))throw new TypeError("target must be an object");t=t||new(m7o||FormData),r=rr.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!rr.isUndefined(b[y])});let i=r.metaTokens,n=r.visitor||u,a=r.dots,o=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&rr.isSpecCompliantForm(t);if(!rr.isFunction(n))throw new TypeError("visitor must be a function");function s(h){if(h===null)return"";if(rr.isDate(h))return h.toISOString();if(rr.isBoolean(h))return h.toString();if(!d&&rr.isBlob(h))throw new Ma("Blob is not supported. Use a Buffer instead.");return rr.isArrayBuffer(h)||rr.isTypedArray(h)?d&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,b){let v=h;if(h&&!b&&typeof h=="object"){if(rr.endsWith(y,"{}"))y=i?y:y.slice(0,-2),h=JSON.stringify(h);else if(rr.isArray(h)&&qJM(h)||(rr.isFileList(h)||rr.endsWith(y,"[]"))&&(v=rr.toArray(h)))return y=S1_(y),v.forEach(function(A,g){!(rr.isUndefined(A)||A===null)&&t.append(o===!0?E1_([y],g,a):o===null?y:y+"[]",s(A))}),!1}return Y0c(h)?!0:(t.append(E1_(b,y,a),s(h)),!1)}let f=[],p=Object.assign(TJM,{defaultVisitor:u,convertValue:s,isVisitable:Y0c});function _(h,y){if(!rr.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),rr.forEach(h,function(v,O){(!(rr.isUndefined(v)||v===null)&&n.call(t,v,rr.isString(O)?O.trim():O,y,p))===!0&&_(v,y?y.concat(O):[O])}),f.pop()}}if(!rr.isObject(e))throw new TypeError("data must be an object");return _(e),t}var M7i=RJM;function M1_(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function D1_(e,t){this._pairs=[],e&&M7i(e,this,t)}var B1_=D1_.prototype;B1_.append=function(t,r){this._pairs.push([t,r])};B1_.toString=function(t){let r=t?function(i){return t.call(this,i,M1_)}:M1_;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var I1_=D1_;function zJM(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function h_n(e,t,r){if(!t)return e;let i=r&&r.encode||zJM;rr.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,a;if(n?a=n(t,r):a=rr.isURLSearchParams(t)?t.toString():new I1_(t,r).toString(i),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var X0c=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){rr.forEach(this.handlers,function(i){i!==null&&t(i)})}},Z0c=X0c;var okn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var R1_=ce(require("crypto"),1);var C1_=ce(require("url"),1),q1_=C1_.default.URLSearchParams;var k0c="abcdefghijklmnopqrstuvwxyz",T1_="0123456789",z1_={DIGIT:T1_,ALPHA:k0c,ALPHA_DIGIT:k0c+k0c.toUpperCase()+T1_},NJM=(e=16,t=z1_.ALPHA_DIGIT)=>{let r="",{length:i}=t,n=new Uint32Array(e);R1_.default.randomFillSync(n);for(let a=0;a<e;a++)r+=t[n[a]%i];return r},N1_={isNode:!0,classes:{URLSearchParams:q1_,FormData:m7o,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:z1_,generateString:NJM,protocols:["http","https","file","data"]};var rwc={};Zt(rwc,{hasBrowserEnv:()=>twc,hasStandardBrowserEnv:()=>FJM,hasStandardBrowserWebWorkerEnv:()=>QJM,navigator:()=>ewc,origin:()=>UJM});var twc=typeof window<"u"&&typeof document<"u",ewc=typeof navigator=="object"&&navigator||void 0,FJM=twc&&(!ewc||["ReactNative","NativeScript","NS"].indexOf(ewc.product)<0),QJM=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",UJM=twc&&window.location.href||"http://localhost";var YA={...rwc,...N1_};function iwc(e,t){return M7i(e,new YA.classes.URLSearchParams,{visitor:function(r,i,n,a){return YA.isNode&&rr.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function LJM(e){return rr.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function VJM(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 WJM(e){function t(r,i,n,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=a>=r.length;return o=!o&&rr.isArray(n)?n.length:o,d?(rr.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i,!c):((!n[o]||!rr.isObject(n[o]))&&(n[o]=[]),t(r,i,n[o],a)&&rr.isArray(n[o])&&(n[o]=VJM(n[o])),!c)}if(rr.isFormData(e)&&rr.isFunction(e.entries)){let r={};return rr.forEachEntry(e,(i,n)=>{t(LJM(i),n,r,0)}),r}return null}var P7o=WJM;function GJM(e,t,r){if(rr.isString(e))try{return(t||JSON.parse)(e),rr.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var nwc={transitional:okn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=rr.isObject(t);if(a&&rr.isHTMLForm(t)&&(t=new FormData(t)),rr.isFormData(t))return n?JSON.stringify(P7o(t)):t;if(rr.isArrayBuffer(t)||rr.isBuffer(t)||rr.isStream(t)||rr.isFile(t)||rr.isBlob(t)||rr.isReadableStream(t))return t;if(rr.isArrayBufferView(t))return t.buffer;if(rr.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return iwc(t,this.formSerializer).toString();if((c=rr.isFileList(t))||i.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return M7i(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),GJM(t)):t}],transformResponse:[function(t){let r=this.transitional||nwc.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(rr.isResponse(t)||rr.isReadableStream(t))return t;if(t&&rr.isString(t)&&(i&&!this.responseType||n)){let o=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?Ma.from(c,Ma.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:YA.classes.FormData,Blob:YA.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};rr.forEach(["delete","get","head","post","put","patch"],e=>{nwc.headers[e]={}});var ukn=nwc;var HJM=rr.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"]),F1_=e=>{let t={},r,i,n;return e&&e.split(`
1149
1149
  `).forEach(function(o){n=o.indexOf(":"),r=o.substring(0,n).trim().toLowerCase(),i=o.substring(n+1).trim(),!(!r||t[r]&&HJM[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t};var Q1_=Symbol("internals");function qWa(e){return e&&String(e).trim().toLowerCase()}function j7o(e){return e===!1||e==null?e:rr.isArray(e)?e.map(j7o):String(e)}function xJM(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 KJM=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function awc(e,t,r,i,n){if(rr.isFunction(i))return i.call(this,t,r);if(n&&(t=r),!!rr.isString(t)){if(rr.isString(i))return t.indexOf(i)!==-1;if(rr.isRegExp(i))return i.test(t)}}function JJM(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function $JM(e,t){let r=rr.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(n,a,o){return this[i].call(this,t,n,a,o)},configurable:!0})})}var skn=class{constructor(t){t&&this.set(t)}set(t,r,i){let n=this;function a(c,d,s){let u=qWa(d);if(!u)throw new Error("header name must be a non-empty string");let f=rr.findKey(n,u);(!f||n[f]===void 0||s===!0||s===void 0&&n[f]!==!1)&&(n[f||d]=j7o(c))}let o=(c,d)=>rr.forEach(c,(s,u)=>a(s,u,d));if(rr.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(rr.isString(t)&&(t=t.trim())&&!KJM(t))o(F1_(t),r);else if(rr.isObject(t)&&rr.isIterable(t)){let c={},d,s;for(let u of t){if(!rr.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[s=u[0]]=(d=c[s])?rr.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}o(c,r)}else t!=null&&a(r,t,i);return this}get(t,r){if(t=qWa(t),t){let i=rr.findKey(this,t);if(i){let n=this[i];if(!r)return n;if(r===!0)return xJM(n);if(rr.isFunction(r))return r.call(this,n,i);if(rr.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=qWa(t),t){let i=rr.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||awc(this,this[i],i,r)))}return!1}delete(t,r){let i=this,n=!1;function a(o){if(o=qWa(o),o){let c=rr.findKey(i,o);c&&(!r||awc(i,i[c],c,r))&&(delete i[c],n=!0)}}return rr.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||awc(this,this[a],a,t,!0))&&(delete this[a],n=!0)}return n}normalize(t){let r=this,i={};return rr.forEach(this,(n,a)=>{let o=rr.findKey(i,a);if(o){r[o]=j7o(n),delete r[a];return}let c=t?JJM(a):String(a).trim();c!==a&&delete r[a],r[c]=j7o(n),i[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return rr.forEach(this,(i,n)=>{i!=null&&i!==!1&&(r[n]=t&&rr.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(`
1150
1150
  `)}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[Q1_]=this[Q1_]={accessors:{}}).accessors,n=this.prototype;function a(o){let c=qWa(o);i[c]||($JM(n,o),i[c]=!0)}return rr.isArray(t)?t.forEach(a):a(t),this}};skn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);rr.reduceDescriptors(skn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});rr.freezeMethods(skn);var JM=skn;function TWa(e,t){let r=this||ukn,i=t||r,n=JM.from(i.headers),a=i.data;return rr.forEach(e,function(c){a=c.call(r,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function RWa(e){return!!(e&&e.__CANCEL__)}function U1_(e,t,r){Ma.call(this,e??"canceled",Ma.ERR_CANCELED,t,r),this.name="CanceledError"}rr.inherits(U1_,Ma,{__CANCEL__:!0});var xbe=U1_;function TJt(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new Ma("Request failed with status code "+r.status,[Ma.ERR_BAD_REQUEST,Ma.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function owc(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function uwc(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function y_n(e,t,r){let i=!owc(t);return e&&(i||r==!1)?uwc(e,t):t}var lT_=ce(swc(),1),fT_=ce(require("http"),1),dT_=ce(require("https"),1),pT_=ce(require("util"),1),_T_=ce(J1_(),1),hFi=ce(require("zlib"),1);var g_n="1.12.2";function UWa(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var d$M=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Awc(e,t,r){let i=r&&r.Blob||YA.classes.Blob,n=UWa(e);if(t===void 0&&i&&(t=!0),n==="data"){e=n.length?e.slice(n.length+1):e;let a=d$M.exec(e);if(!a)throw new Ma("Invalid URL",Ma.ERR_INVALID_URL);let o=a[1],c=a[2],d=a[3],s=Buffer.from(decodeURIComponent(d),c?"base64":"utf8");if(t){if(!i)throw new Ma("Blob is not supported",Ma.ERR_NOT_SUPPORT);return new i([s],{type:o})}return s}throw new Ma("Unsupported protocol "+n,Ma.ERR_NOT_SUPPORT)}var A_n=ce(require("stream"),1);var $1_=ce(require("stream"),1);var mwc=Symbol("internals"),Pwc=class extends $1_.default.Transform{constructor(t){t=rr.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,n)=>!rr.isUndefined(n[i])),super({readableHighWaterMark:t.chunkSize});let r=this[mwc]={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[mwc];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,i){let n=this[mwc],a=n.maxRate,o=this.readableHighWaterMark,c=n.timeWindow,d=1e3/c,s=a/d,u=n.minChunkSize!==!1?Math.max(n.minChunkSize,s*.01):0,f=(_,h)=>{let y=Buffer.byteLength(_);n.bytesSeen+=y,n.bytes+=y,n.isCaptured&&this.emit("progress",n.bytesSeen),this.push(_)?process.nextTick(h):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(h)}},p=(_,h)=>{let y=Buffer.byteLength(_),b=null,v=o,O,A=0;if(a){let g=Date.now();(!n.ts||(A=g-n.ts)>=c)&&(n.ts=g,O=s-n.bytes,n.bytes=O<0?-O:0,A=0),O=s-n.bytes}if(a){if(O<=0)return setTimeout(()=>{h(null,_)},c-A);O<v&&(v=O)}v&&y>v&&y-v>u&&(b=_.subarray(v),_=_.subarray(0,v)),f(_,b?()=>{process.nextTick(h,null,b)}:h)};p(t,function _(h,y){if(h)return i(h);y?p(y,_):i(null)})}},jwc=Pwc;var hT_=require("events");var X1_=ce(require("util"),1),Z1_=require("stream");var{asyncIterator:Y1_}=Symbol,p$M=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Y1_]?yield*e[Y1_]():yield e},w7o=p$M;var _$M=YA.ALPHABET.ALPHA_DIGIT+"-_",LWa=typeof TextEncoder=="function"?new TextEncoder:new X1_.default.TextEncoder,O_n=`\r
1151
1151
  `,h$M=LWa.encode(O_n),y$M=2,wwc=class{constructor(t,r){let{escapeName:i}=this.constructor,n=rr.isString(r),a=`Content-Disposition: form-data; name="${i(t)}"${!n&&r.name?`; filename="${i(r.name)}"`:""}${O_n}`;n?r=LWa.encode(String(r).replace(/\r?\n|\r\n?/g,O_n)):a+=`Content-Type: ${r.type||"application/octet-stream"}${O_n}`,this.headers=LWa.encode(a+O_n),this.contentLength=n?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+y$M,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;rr.isTypedArray(t)?yield t:yield*w7o(t),yield h$M}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},b$M=(e,t,r)=>{let{tag:i="form-data-boundary",size:n=25,boundary:a=i+"-"+YA.generateString(n,_$M)}=r||{};if(!rr.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=LWa.encode("--"+a+O_n),c=LWa.encode("--"+a+"--"+O_n),d=c.byteLength,s=Array.from(e.entries()).map(([f,p])=>{let _=new wwc(f,p);return d+=_.size,_});d+=o.byteLength*s.length,d=rr.toFiniteNumber(d);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(d)&&(u["Content-Length"]=d),t&&t(u),Z1_.Readable.from((async function*(){for(let f of s)yield o,yield*f.encode();yield c})())},k1_=b$M;var eT_=ce(require("stream"),1),Ewc=class extends eT_.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)}},tT_=Ewc;var v$M=(e,t)=>rr.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,rT_=v$M;function g$M(e,t){e=e||10;let r=new Array(e),i=new Array(e),n=0,a=0,o;return t=t!==void 0?t:1e3,function(d){let s=Date.now(),u=i[a];o||(o=s),r[n]=d,i[n]=s;let f=a,p=0;for(;f!==n;)p+=r[f++],f=f%e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),s-o<t)return;let _=u&&s-u;return _?Math.round(p*1e3/_):void 0}}var iT_=g$M;function O$M(e,t){let r=0,i=1e3/t,n,a,o=(s,u=Date.now())=>{r=u,n=null,a&&(clearTimeout(a),a=null),e(...s)};return[(...s)=>{let u=Date.now(),f=u-r;f>=i?o(s,u):(n=s,a||(a=setTimeout(()=>{a=null,o(n)},i-f)))},()=>n&&o(n)]}var nT_=O$M;var _Fi=(e,t,r=3)=>{let i=0,n=iT_(50,250);return nT_(a=>{let o=a.loaded,c=a.lengthComputable?a.total:void 0,d=o-i,s=n(d),u=o<=c;i=o;let f={loaded:o,total:c,progress:c?o/c:void 0,bytes:d,rate:s||void 0,estimated:s&&c&&u?(c-o)/s:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(f)},r)},lkn=(e,t)=>{let r=e!=null;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},fkn=e=>(...t)=>rr.asap(()=>e(...t));function Swc(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let r=e.slice(5,t),i=e.slice(t+1);if(/;base64/i.test(r)){let a=i.length,o=i.length;for(let p=0;p<o;p++)if(i.charCodeAt(p)===37&&p+2<o){let _=i.charCodeAt(p+1),h=i.charCodeAt(p+2);(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(a-=2,p+=2)}let c=0,d=o-1,s=p=>p>=2&&i.charCodeAt(p-2)===37&&i.charCodeAt(p-1)===51&&(i.charCodeAt(p)===68||i.charCodeAt(p)===100);d>=0&&(i.charCodeAt(d)===61?(c++,d--):s(d)&&(c++,d-=3)),c===1&&d>=0&&(i.charCodeAt(d)===61||s(d))&&c++;let f=Math.floor(a/4)*3-(c||0);return f>0?f:0}return Buffer.byteLength(i,"utf8")}var aT_={flush:hFi.default.constants.Z_SYNC_FLUSH,finishFlush:hFi.default.constants.Z_SYNC_FLUSH},A$M={flush:hFi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:hFi.default.constants.BROTLI_OPERATION_FLUSH},oT_=rr.isFunction(hFi.default.createBrotliDecompress),{http:m$M,https:P$M}=_T_.default,j$M=/https:?/,uT_=YA.protocols.map(e=>e+":"),sT_=(e,[t,r])=>(e.on("end",r).on("error",r),t);function w$M(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function yT_(e,t,r){let i=t;if(!i&&i!==!1){let n=lT_.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){yT_(a,t,a.href)}}var E$M=typeof process<"u"&&rr.kindOf(process)==="process",S$M=e=>new Promise((t,r)=>{let i,n,a=(d,s)=>{n||(n=!0,i&&i(d,s))},o=d=>{a(d),t(d)},c=d=>{a(d,!0),r(d)};e(o,c,d=>i=d).catch(c)}),M$M=({address:e,family:t})=>{if(!rr.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},cT_=(e,t)=>M$M(rr.isObject(e)?e:{address:e,family:t}),bT_=E$M&&function(t){return S$M(async function(i,n,a){let{data:o,lookup:c,family:d}=t,{responseType:s,responseEncoding:u}=t,f=t.method.toUpperCase(),p,_=!1,h;if(c){let ee=rT_(c,me=>rr.isArray(me)?me:[me]);c=(me,ve,H)=>{ee(me,ve,(G,Ee,ue)=>{if(G)return H(G);let ge=rr.isArray(Ee)?Ee.map(We=>cT_(We)):[cT_(Ee,ue)];ve.all?H(G,ge):H(G,ge[0].address,ge[0].family)})}}let y=new hT_.EventEmitter,b=()=>{t.cancelToken&&t.cancelToken.unsubscribe(v),t.signal&&t.signal.removeEventListener("abort",v),y.removeAllListeners()};a((ee,me)=>{p=!0,me&&(_=!0,b())});function v(ee){y.emit("abort",!ee||ee.type?new xbe(null,t,h):ee)}y.once("abort",n),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(v),t.signal&&(t.signal.aborted?v():t.signal.addEventListener("abort",v)));let O=y_n(t.baseURL,t.url,t.allowAbsoluteUrls),A=new URL(O,YA.hasBrowserEnv?YA.origin:void 0),g=A.protocol||uT_[0];if(g==="data:"){if(t.maxContentLength>-1){let me=String(t.url||O||"");if(Swc(me)>t.maxContentLength)return n(new Ma("maxContentLength size of "+t.maxContentLength+" exceeded",Ma.ERR_BAD_RESPONSE,t))}let ee;if(f!=="GET")return TJt(i,n,{status:405,statusText:"method not allowed",headers:{},config:t});try{ee=Awc(t.url,s==="blob",{Blob:t.env&&t.env.Blob})}catch(me){throw Ma.from(me,Ma.ERR_BAD_REQUEST,t)}return s==="text"?(ee=ee.toString(u),(!u||u==="utf8")&&(ee=rr.stripBOM(ee))):s==="stream"&&(ee=A_n.default.Readable.from(ee)),TJt(i,n,{data:ee,status:200,statusText:"OK",headers:new JM,config:t})}if(uT_.indexOf(g)===-1)return n(new Ma("Unsupported protocol "+g,Ma.ERR_BAD_REQUEST,t));let m=JM.from(t.headers).normalize();m.set("User-Agent","axios/"+g_n,!1);let{onUploadProgress:j,onDownloadProgress:S}=t,w=t.maxRate,D,B;if(rr.isSpecCompliantForm(o)){let ee=m.getContentType(/boundary=([-_\w\d]{10,70})/i);o=k1_(o,me=>{m.set(me)},{tag:`axios-${g_n}-boundary`,boundary:ee&&ee[1]||void 0})}else if(rr.isFormData(o)&&rr.isFunction(o.getHeaders)){if(m.set(o.getHeaders()),!m.hasContentLength())try{let ee=await pT_.default.promisify(o.getLength).call(o);Number.isFinite(ee)&&ee>=0&&m.setContentLength(ee)}catch{}}else if(rr.isBlob(o)||rr.isFile(o))o.size&&m.setContentType(o.type||"application/octet-stream"),m.setContentLength(o.size||0),o=A_n.default.Readable.from(w7o(o));else if(o&&!rr.isStream(o)){if(!Buffer.isBuffer(o))if(rr.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(rr.isString(o))o=Buffer.from(o,"utf-8");else return n(new Ma("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Ma.ERR_BAD_REQUEST,t));if(m.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return n(new Ma("Request body larger than maxBodyLength limit",Ma.ERR_BAD_REQUEST,t))}let q=rr.toFiniteNumber(m.getContentLength());rr.isArray(w)?(D=w[0],B=w[1]):D=B=w,o&&(j||D)&&(rr.isStream(o)||(o=A_n.default.Readable.from(o,{objectMode:!1})),o=A_n.default.pipeline([o,new jwc({maxRate:rr.toFiniteNumber(D)})],rr.noop),j&&o.on("progress",sT_(o,lkn(q,_Fi(fkn(j),!1,3)))));let U;if(t.auth){let ee=t.auth.username||"",me=t.auth.password||"";U=ee+":"+me}if(!U&&A.username){let ee=A.username,me=A.password;U=ee+":"+me}U&&m.delete("authorization");let R;try{R=h_n(A.pathname+A.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(ee){let me=new Error(ee.message);return me.config=t,me.url=t.url,me.exists=!0,n(me)}m.set("Accept-Encoding","gzip, compress, deflate"+(oT_?", br":""),!1);let N={path:R,method:f,headers:m.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:U,protocol:g,family:d,beforeRedirect:w$M,beforeRedirects:{}};!rr.isUndefined(c)&&(N.lookup=c),t.socketPath?N.socketPath=t.socketPath:(N.hostname=A.hostname.startsWith("[")?A.hostname.slice(1,-1):A.hostname,N.port=A.port,yT_(N,t.proxy,g+"//"+A.hostname+(A.port?":"+A.port:"")+N.path));let F,x=j$M.test(N.protocol);if(N.agent=x?t.httpsAgent:t.httpAgent,t.transport?F=t.transport:t.maxRedirects===0?F=x?dT_.default:fT_.default:(t.maxRedirects&&(N.maxRedirects=t.maxRedirects),t.beforeRedirect&&(N.beforeRedirects.config=t.beforeRedirect),F=x?P$M:m$M),t.maxBodyLength>-1?N.maxBodyLength=t.maxBodyLength:N.maxBodyLength=1/0,t.insecureHTTPParser&&(N.insecureHTTPParser=t.insecureHTTPParser),h=F.request(N,function(me){if(h.destroyed)return;let ve=[me],H=+me.headers["content-length"];if(S||B){let We=new jwc({maxRate:rr.toFiniteNumber(B)});S&&We.on("progress",sT_(We,lkn(H,_Fi(fkn(S),!0,3)))),ve.push(We)}let G=me,Ee=me.req||h;if(t.decompress!==!1&&me.headers["content-encoding"])switch((f==="HEAD"||me.statusCode===204)&&delete me.headers["content-encoding"],(me.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":ve.push(hFi.default.createUnzip(aT_)),delete me.headers["content-encoding"];break;case"deflate":ve.push(new tT_),ve.push(hFi.default.createUnzip(aT_)),delete me.headers["content-encoding"];break;case"br":oT_&&(ve.push(hFi.default.createBrotliDecompress(A$M)),delete me.headers["content-encoding"])}G=ve.length>1?A_n.default.pipeline(ve,rr.noop):ve[0];let ue=A_n.default.finished(G,()=>{ue(),b()}),ge={status:me.statusCode,statusText:me.statusMessage,headers:new JM(me.headers),config:t,request:Ee};if(s==="stream")ge.data=G,TJt(i,n,ge);else{let We=[],se=0;G.on("data",function(Fe){We.push(Fe),se+=Fe.length,t.maxContentLength>-1&&se>t.maxContentLength&&(_=!0,G.destroy(),n(new Ma("maxContentLength size of "+t.maxContentLength+" exceeded",Ma.ERR_BAD_RESPONSE,t,Ee)))}),G.on("aborted",function(){if(_)return;let Fe=new Ma("stream has been aborted",Ma.ERR_BAD_RESPONSE,t,Ee);G.destroy(Fe),n(Fe)}),G.on("error",function(Fe){h.destroyed||n(Ma.from(Fe,null,t,Ee))}),G.on("end",function(){try{let Fe=We.length===1?We[0]:Buffer.concat(We);s!=="arraybuffer"&&(Fe=Fe.toString(u),(!u||u==="utf8")&&(Fe=rr.stripBOM(Fe))),ge.data=Fe}catch(Fe){return n(Ma.from(Fe,null,t,ge.request,ge))}TJt(i,n,ge)})}y.once("abort",We=>{G.destroyed||(G.emit("error",We),G.destroy())})}),y.once("abort",ee=>{n(ee),h.destroy(ee)}),h.on("error",function(me){n(Ma.from(me,null,t,h))}),h.on("socket",function(me){me.setKeepAlive(!0,1e3*60)}),t.timeout){let ee=parseInt(t.timeout,10);if(Number.isNaN(ee)){n(new Ma("error trying to parse `config.timeout` to int",Ma.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(ee,function(){if(p)return;let ve=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",H=t.transitional||okn;t.timeoutErrorMessage&&(ve=t.timeoutErrorMessage),n(new Ma(ve,H.clarifyTimeoutError?Ma.ETIMEDOUT:Ma.ECONNABORTED,t,h)),v()})}if(rr.isStream(o)){let ee=!1,me=!1;o.on("end",()=>{ee=!0}),o.once("error",ve=>{me=!0,h.destroy(ve)}),o.on("close",()=>{!ee&&!me&&v(new xbe("Request stream has been aborted",t,h))}),o.pipe(h)}else h.end(o)})};var vT_=YA.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,YA.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(YA.origin),YA.navigator&&/(msie|trident)/i.test(YA.navigator.userAgent)):()=>!0;var gT_=YA.hasStandardBrowserEnv?{write(e,t,r,i,n,a){let o=[e+"="+encodeURIComponent(t)];rr.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),rr.isString(i)&&o.push("path="+i),rr.isString(n)&&o.push("domain="+n),a===!0&&o.push("secure"),document.cookie=o.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 OT_=e=>e instanceof JM?{...e}:e;function YVt(e,t){t=t||{};let r={};function i(s,u,f,p){return rr.isPlainObject(s)&&rr.isPlainObject(u)?rr.merge.call({caseless:p},s,u):rr.isPlainObject(u)?rr.merge({},u):rr.isArray(u)?u.slice():u}function n(s,u,f,p){if(rr.isUndefined(u)){if(!rr.isUndefined(s))return i(void 0,s,f,p)}else return i(s,u,f,p)}function a(s,u){if(!rr.isUndefined(u))return i(void 0,u)}function o(s,u){if(rr.isUndefined(u)){if(!rr.isUndefined(s))return i(void 0,s)}else return i(void 0,u)}function c(s,u,f){if(f in t)return i(s,u);if(f in e)return i(void 0,s)}let d={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(s,u,f)=>n(OT_(s),OT_(u),f,!0)};return rr.forEach(Object.keys({...e,...t}),function(u){let f=d[u]||n,p=f(e[u],t[u],u);rr.isUndefined(p)&&f!==c||(r[u]=p)}),r}var E7o=e=>{let t=YVt({},e),{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:a,headers:o,auth:c}=t;if(t.headers=o=JM.from(o),t.url=h_n(y_n(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),rr.isFormData(r)){if(YA.hasStandardBrowserEnv||YA.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(rr.isFunction(r.getHeaders)){let d=r.getHeaders(),s=["content-type","content-length"];Object.entries(d).forEach(([u,f])=>{s.includes(u.toLowerCase())&&o.set(u,f)})}}if(YA.hasStandardBrowserEnv&&(i&&rr.isFunction(i)&&(i=i(t)),i||i!==!1&&vT_(t.url))){let d=n&&a&&gT_.read(a);d&&o.set(n,d)}return t};var D$M=typeof XMLHttpRequest<"u",AT_=D$M&&function(e){return new Promise(function(r,i){let n=E7o(e),a=n.data,o=JM.from(n.headers).normalize(),{responseType:c,onUploadProgress:d,onDownloadProgress:s}=n,u,f,p,_,h;function y(){_&&_(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(n.method.toUpperCase(),n.url,!0),b.timeout=n.timeout;function v(){if(!b)return;let A=JM.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),m={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:A,config:e,request:b};TJt(function(S){r(S),y()},function(S){i(S),y()},m),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(i(new Ma("Request aborted",Ma.ECONNABORTED,e,b)),b=null)},b.onerror=function(g){let m=g&&g.message?g.message:"Network Error",j=new Ma(m,Ma.ERR_NETWORK,e,b);j.event=g||null,i(j),b=null},b.ontimeout=function(){let g=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",m=n.transitional||okn;n.timeoutErrorMessage&&(g=n.timeoutErrorMessage),i(new Ma(g,m.clarifyTimeoutError?Ma.ETIMEDOUT:Ma.ECONNABORTED,e,b)),b=null},a===void 0&&o.setContentType(null),"setRequestHeader"in b&&rr.forEach(o.toJSON(),function(g,m){b.setRequestHeader(m,g)}),rr.isUndefined(n.withCredentials)||(b.withCredentials=!!n.withCredentials),c&&c!=="json"&&(b.responseType=n.responseType),s&&([p,h]=_Fi(s,!0),b.addEventListener("progress",p)),d&&b.upload&&([f,_]=_Fi(d),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",_)),(n.cancelToken||n.signal)&&(u=A=>{b&&(i(!A||A.type?new xbe(null,e,b):A),b.abort(),b=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));let O=UWa(n.url);if(O&&YA.protocols.indexOf(O)===-1){i(new Ma("Unsupported protocol "+O+":",Ma.ERR_BAD_REQUEST,e));return}b.send(a||null)})};var B$M=(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,c();let u=s instanceof Error?s:this.reason;i.abort(u instanceof Ma?u:new xbe(u instanceof Error?u.message:u))}},o=t&&setTimeout(()=>{o=null,a(new Ma(`timeout ${t} of ms exceeded`,Ma.ETIMEDOUT))},t),c=()=>{e&&(o&&clearTimeout(o),o=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=()=>rr.asap(c),d}},mT_=B$M;var I$M=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},C$M=async function*(e,t){for await(let r of q$M(e))yield*I$M(r,t)},q$M=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()}},Mwc=(e,t,r,i)=>{let n=C$M(e,t),a=0,o,c=d=>{o||(o=!0,i&&i(d))};return new ReadableStream({async pull(d){try{let{done:s,value:u}=await n.next();if(s){c(),d.close();return}let f=u.byteLength;if(r){let p=a+=f;r(p)}d.enqueue(new Uint8Array(u))}catch(s){throw c(s),s}},cancel(d){return c(d),n.return()}},{highWaterMark:2})};var PT_=64*1024,{isFunction:S7o}=rr,T$M=(({Request:e,Response:t})=>({Request:e,Response:t}))(rr.global),{ReadableStream:jT_,TextEncoder:wT_}=rr.global,ET_=(e,...t)=>{try{return!!e(...t)}catch{return!1}},R$M=e=>{e=rr.merge.call({skipUndefined:!0},T$M,e);let{fetch:t,Request:r,Response:i}=e,n=t?S7o(t):typeof fetch=="function",a=S7o(r),o=S7o(i);if(!n)return!1;let c=n&&S7o(jT_),d=n&&(typeof wT_=="function"?(h=>y=>h.encode(y))(new wT_):async h=>new Uint8Array(await new r(h).arrayBuffer())),s=a&&c&&ET_(()=>{let h=!1,y=new r(YA.origin,{body:new jT_,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!y}),u=o&&c&&ET_(()=>rr.isReadableStream(new i("").body)),f={stream:u&&(h=>h.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!f[h]&&(f[h]=(y,b)=>{let v=y&&y[h];if(v)return v.call(y);throw new Ma(`Response type '${h}' is not supported`,Ma.ERR_NOT_SUPPORT,b)})});let p=async h=>{if(h==null)return 0;if(rr.isBlob(h))return h.size;if(rr.isSpecCompliantForm(h))return(await new r(YA.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(rr.isArrayBufferView(h)||rr.isArrayBuffer(h))return h.byteLength;if(rr.isURLSearchParams(h)&&(h=h+""),rr.isString(h))return(await d(h)).byteLength},_=async(h,y)=>{let b=rr.toFiniteNumber(h.getContentLength());return b??p(y)};return async h=>{let{url:y,method:b,data:v,signal:O,cancelToken:A,timeout:g,onDownloadProgress:m,onUploadProgress:j,responseType:S,headers:w,withCredentials:D="same-origin",fetchOptions:B}=E7o(h),q=t||fetch;S=S?(S+"").toLowerCase():"text";let U=mT_([O,A&&A.toAbortSignal()],g),R=null,N=U&&U.unsubscribe&&(()=>{U.unsubscribe()}),F;try{if(j&&s&&b!=="get"&&b!=="head"&&(F=await _(w,v))!==0){let G=new r(y,{method:"POST",body:v,duplex:"half"}),Ee;if(rr.isFormData(v)&&(Ee=G.headers.get("content-type"))&&w.setContentType(Ee),G.body){let[ue,ge]=lkn(F,_Fi(fkn(j)));v=Mwc(G.body,PT_,ue,ge)}}rr.isString(D)||(D=D?"include":"omit");let x=a&&"credentials"in r.prototype,ee={...B,signal:U,method:b.toUpperCase(),headers:w.normalize().toJSON(),body:v,duplex:"half",credentials:x?D:void 0};R=a&&new r(y,ee);let me=await(a?q(R,B):q(y,ee)),ve=u&&(S==="stream"||S==="response");if(u&&(m||ve&&N)){let G={};["status","statusText","headers"].forEach(We=>{G[We]=me[We]});let Ee=rr.toFiniteNumber(me.headers.get("content-length")),[ue,ge]=m&&lkn(Ee,_Fi(fkn(m),!0))||[];me=new i(Mwc(me.body,PT_,ue,()=>{ge&&ge(),N&&N()}),G)}S=S||"text";let H=await f[rr.findKey(f,S)||"text"](me,h);return!ve&&N&&N(),await new Promise((G,Ee)=>{TJt(G,Ee,{data:H,headers:JM.from(me.headers),status:me.status,statusText:me.statusText,config:h,request:R})})}catch(x){throw N&&N(),x&&x.name==="TypeError"&&/Load failed|fetch/i.test(x.message)?Object.assign(new Ma("Network Error",Ma.ERR_NETWORK,h,R),{cause:x.cause||x}):Ma.from(x,x&&x.code,h,R)}}},z$M=new Map,Dwc=e=>{let t=e?e.env:{},{fetch:r,Request:i,Response:n}=t,a=[i,n,r],o=a.length,c=o,d,s,u=z$M;for(;c--;)d=a[c],s=u.get(d),s===void 0&&u.set(d,s=c?new Map:R$M(t)),u=s;return s},cw9=Dwc();var Bwc={http:bT_,xhr:AT_,fetch:{get:Dwc}};rr.forEach(Bwc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var ST_=e=>`- ${e}`,F$M=e=>rr.isFunction(e)||e===null||e===!1,M7o={getAdapter:(e,t)=>{e=rr.isArray(e)?e:[e];let{length:r}=e,i,n,a={};for(let o=0;o<r;o++){i=e[o];let c;if(n=i,!F$M(i)&&(n=Bwc[(c=String(i)).toLowerCase()],n===void 0))throw new Ma(`Unknown adapter '${c}'`);if(n&&(rr.isFunction(n)||(n=n.get(t))))break;a[c||"#"+o]=n}if(!n){let o=Object.entries(a).map(([d,s])=>`adapter ${d} `+(s===!1?"is not supported by the environment":"is not available in the build")),c=r?o.length>1?`since :
@@ -1389,7 +1389,7 @@ ${g}${O}${m}${rna}`});function gsu({message:e,error:t,logger:r,logLevel:i=oc.Err
1389
1389
  Run ${It.cyan("fern generator upgrade")} to upgrade your generators.`),n.length>2&&(r+=`
1390
1390
  Run ${It.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),I7i(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function f4c({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:i=!0}){if(!gth(e))return;let n=t??"",a=e.filter(c=>c.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let o=a.sort((c,d)=>c.generatorName.localeCompare(d.generatorName)||c.currentVersion.localeCompare(d.currentVersion));for(let c of o)n+=`
1391
1391
  ${await wBD(c.generatorName)} (${c.apiName!=null?"API: "+c.apiName+", ":""}Group: ${c.generatorGroup}) `+It.dim(c.currentVersion)+It.reset(" \u2192 ")+It.green(c.latestVersion);return n+=`
1392
- `,i?I7i(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function wBD(e){let r=await new vth.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 EBD({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await Ath({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,u,f)=>{c.versions[s]==null&&(c.versions[s]={});let p=CGi(u.name,f),_=await jVt({generatorName:p,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:n,includeMajor:a,context:f});_!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:_})},generatorFilter:r,groupFilter:i}),c}let o={type:"multiApi",versions:{}};return await Ath({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,d,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][d]==null&&(o.versions[c][d]={});let f=CGi(s.name,u),p=await jVt({generatorName:f,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:u});p!=null&&(o.versions[c][d][s.name]={previousVersion:s.version,latestVersion:p})},generatorFilter:r,groupFilter:i}),o}async function Ath({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await Ube({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(c==null||c.groups==null)return;let d=i!=null?aN(i):void 0;for(let s of c.groups)if(!(n!=null&&s.groupName!==n))for(let u of s.generators)d!=null&&u.name!==d||await r(a.workspaceName,s.groupName,u,o)})}))}function mth(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${n} has an upgrade available...`);let d=S$(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),i.push({generatorName:o,generatorGroup:n,apiName:t,isUpgradeAvailable:d,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return i}async function Psu({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let o=[];if(e!=null){let c=await EBD({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(c.type==="multiApi")for(let[d,s]of Object.entries(c.versions))o.push(...mth(s,d,t.logger));else o.push(...mth(c.versions,void 0,t.logger))}return o}var eHa=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${n} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var ona=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var d4c=(()=>{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})(),Pth=typeof globalThis.AbortController=="function",jth=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",wth=typeof globalThis.ReadableStream=="function",Eth=typeof globalThis.FormData=="function",jsu=["get","post","put","patch","head","delete"],SBD=()=>{};SBD();var Sth={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},wsu=2147483647,Mth=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Esu=Symbol("stop"),Dth={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Bth={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 MBD=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,i]of e)t+=Mth,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},Ith=(e,t,r)=>{let i,n=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),i){n+=i.byteLength;let c=t===0?0:n/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,n),transferredBytes:n},i)}i=a},flush(){i&&(n+=i.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},i))}}))},Cth=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(Ith(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},qth=(e,t,r)=>{if(!e.body)return e;let i=MBD(r??e.body);return new Request(e,{duplex:"half",body:Ith(e.body,i,t)})};var una=e=>e!==null&&typeof e=="object";var tHa=(...e)=>{for(let t of e)if((!una(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return h4c({},...e)},p4c=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,o]of n.entries())i&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function Ssu(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:h4c(e[r]??[],t[r]??[])}var _4c=(e={},t={})=>({beforeRequest:Ssu(e,t,"beforeRequest"),beforeRetry:Ssu(e,t,"beforeRetry"),afterResponse:Ssu(e,t,"afterResponse"),beforeError:Ssu(e,t,"beforeError")}),h4c=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(una(n)){for(let[a,o]of Object.entries(n))una(o)&&a in t&&(o=h4c(t[a],o)),t={...t,[a]:o};una(n.hooks)&&(i=_4c(i,n.hooks),t.hooks=i),una(n.headers)&&(r=p4c(r,n.headers),t.headers=r)}return t};var Rth=e=>jsu.includes(e)?e.toUpperCase():e,DBD=["get","put","head","delete","options","trace"],BBD=[408,413,429,500,502,503,504],IBD=[413,429,503],Tth={limit:2,methods:DBD,statusCodes:BBD,afterStatusCodes:IBD,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},zth=(e={})=>{if(typeof e=="number")return{...Tth,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{...Tth,...e}};async function y4c(e,t,r,i){return new Promise((n,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new ona(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(o)})})}async function b4c(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 Nth=(e,t)=>{let r={};for(let i in t)!(i in Bth)&&!(i in Dth)&&!(i in e)&&(r[i]=t[i]);return r},Fth=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;var rHa=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>wsu)throw new RangeError(`The \`timeout\` option cannot be greater than ${wsu}`);await Promise.resolve();let c=await i._fetch();for(let d of i._options.hooks.afterResponse){let s=await d(i.request,i._options,i._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(i._decorateResponse(c),!c.ok&&i._options.throwHttpErrors){let d=new eHa(c,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(!wth)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Cth(c.clone(),i._options.onDownloadProgress)}return c},o=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n()).finally(async()=>{let c=i._originalRequest,d=[];c&&!c.bodyUsed&&d.push(c.body?.cancel()),i.request.bodyUsed||d.push(i.request.body?.cancel()),await Promise.all(d)});for(let[c,d]of Object.entries(Sth))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||d);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;constructor(t,r={}){if(this._input=t,this._options={...r,headers:p4c(this._input.headers,r.headers),hooks:_4c({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Rth(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:zth(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(Pth&&jth){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(d4c&&(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),Fth(this._options.searchParams)){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(Eth&&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(!d4c)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=qth(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof ona)throw t;if(t instanceof eHa){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),wsu);if(this._retryCount<1)throw r;await b4c(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})===Esu)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let i=await r(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let t=Nth(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):y4c(this._originalRequest,t,this.abortController,this._options)}};var v4c=e=>{let t=(r,i)=>rHa.create(r,tHa(e,i));for(let r of jsu)t[r]=(i,n)=>rHa.create(i,tHa(e,n,{method:r}));return t.create=r=>v4c(tHa(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),v4c(tHa(e,r))),t.stop=Esu,t},CBD=v4c(),Qth=CBD;var srh=ce(urh(),1);function P4c(e){let t=(0,srh.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var rih=ce(tih(),1),iih=ce(pbe(),1),z4c=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},N4c=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function F4c(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??P4c(n),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,rih.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,c&&(d.authorization=`${c.type} ${c.token}`);let s;try{s=await Qth(o,{headers:d,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new z4c(e):f}if(t.allVersions)return s;let u=new N4c(e,r);if(s["dist-tags"][r]){let{time:f}=s;s=s.versions[s["dist-tags"][r]],s.time=f}else if(r){let f=!!s.versions[r];if(i&&!f)for(let[_,h]of Object.entries(s.versions))h.deprecated&&delete s.versions[_];if(!f){let _=Object.keys(s.versions);if(r=iih.default.maxSatisfying(_,r),!r)throw u}let{time:p}=s;if(s=s.versions[r],s.time=p,!s)throw u}return s}async function sHa(e,t){let{version:r}=await F4c(e.toLowerCase(),t);return r}async function jKi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:sHa(e.packageName,{version:t?"prerelease":"latest"})}var nih=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],Qsu=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=oc.Info;isLocal;constructor(t,r,{isLocal:i}){this.ttyAwareLogger=new msu(t,r),this.isLocal=i??!1;let n=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(n==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:n,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"3.35.1"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${It.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new US}failWithoutThrowing(t,r){this.didSucceed=!1,gsu({message:t,error:r,logger:this.logger})}async exit({code:t}={}){!this._suppressUpgradeMessage&&!this.isLocal&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await rkn()).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 Oth({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
1392
+ `,i?I7i(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function wBD(e){let r=await new vth.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 EBD({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await Ath({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,u,f)=>{c.versions[s]==null&&(c.versions[s]={});let p=CGi(u.name,f),_=await jVt({generatorName:p,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:n,includeMajor:a,context:f});_!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:_})},generatorFilter:r,groupFilter:i}),c}let o={type:"multiApi",versions:{}};return await Ath({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,d,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][d]==null&&(o.versions[c][d]={});let f=CGi(s.name,u),p=await jVt({generatorName:f,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:u});p!=null&&(o.versions[c][d][s.name]={previousVersion:s.version,latestVersion:p})},generatorFilter:r,groupFilter:i}),o}async function Ath({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await Ube({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(c==null||c.groups==null)return;let d=i!=null?aN(i):void 0;for(let s of c.groups)if(!(n!=null&&s.groupName!==n))for(let u of s.generators)d!=null&&u.name!==d||await r(a.workspaceName,s.groupName,u,o)})}))}function mth(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${n} has an upgrade available...`);let d=S$(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),i.push({generatorName:o,generatorGroup:n,apiName:t,isUpgradeAvailable:d,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return i}async function Psu({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let o=[];if(e!=null){let c=await EBD({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(c.type==="multiApi")for(let[d,s]of Object.entries(c.versions))o.push(...mth(s,d,t.logger));else o.push(...mth(c.versions,void 0,t.logger))}return o}var eHa=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${n} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var ona=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var d4c=(()=>{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})(),Pth=typeof globalThis.AbortController=="function",jth=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",wth=typeof globalThis.ReadableStream=="function",Eth=typeof globalThis.FormData=="function",jsu=["get","post","put","patch","head","delete"],SBD=()=>{};SBD();var Sth={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},wsu=2147483647,Mth=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Esu=Symbol("stop"),Dth={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Bth={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 MBD=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,i]of e)t+=Mth,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},Ith=(e,t,r)=>{let i,n=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),i){n+=i.byteLength;let c=t===0?0:n/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,n),transferredBytes:n},i)}i=a},flush(){i&&(n+=i.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},i))}}))},Cth=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(Ith(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},qth=(e,t,r)=>{if(!e.body)return e;let i=MBD(r??e.body);return new Request(e,{duplex:"half",body:Ith(e.body,i,t)})};var una=e=>e!==null&&typeof e=="object";var tHa=(...e)=>{for(let t of e)if((!una(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return h4c({},...e)},p4c=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,o]of n.entries())i&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function Ssu(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:h4c(e[r]??[],t[r]??[])}var _4c=(e={},t={})=>({beforeRequest:Ssu(e,t,"beforeRequest"),beforeRetry:Ssu(e,t,"beforeRetry"),afterResponse:Ssu(e,t,"afterResponse"),beforeError:Ssu(e,t,"beforeError")}),h4c=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(una(n)){for(let[a,o]of Object.entries(n))una(o)&&a in t&&(o=h4c(t[a],o)),t={...t,[a]:o};una(n.hooks)&&(i=_4c(i,n.hooks),t.hooks=i),una(n.headers)&&(r=p4c(r,n.headers),t.headers=r)}return t};var Rth=e=>jsu.includes(e)?e.toUpperCase():e,DBD=["get","put","head","delete","options","trace"],BBD=[408,413,429,500,502,503,504],IBD=[413,429,503],Tth={limit:2,methods:DBD,statusCodes:BBD,afterStatusCodes:IBD,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},zth=(e={})=>{if(typeof e=="number")return{...Tth,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{...Tth,...e}};async function y4c(e,t,r,i){return new Promise((n,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new ona(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(o)})})}async function b4c(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 Nth=(e,t)=>{let r={};for(let i in t)!(i in Bth)&&!(i in Dth)&&!(i in e)&&(r[i]=t[i]);return r},Fth=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;var rHa=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>wsu)throw new RangeError(`The \`timeout\` option cannot be greater than ${wsu}`);await Promise.resolve();let c=await i._fetch();for(let d of i._options.hooks.afterResponse){let s=await d(i.request,i._options,i._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(i._decorateResponse(c),!c.ok&&i._options.throwHttpErrors){let d=new eHa(c,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(!wth)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Cth(c.clone(),i._options.onDownloadProgress)}return c},o=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n()).finally(async()=>{let c=i._originalRequest,d=[];c&&!c.bodyUsed&&d.push(c.body?.cancel()),i.request.bodyUsed||d.push(i.request.body?.cancel()),await Promise.all(d)});for(let[c,d]of Object.entries(Sth))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||d);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;constructor(t,r={}){if(this._input=t,this._options={...r,headers:p4c(this._input.headers,r.headers),hooks:_4c({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Rth(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:zth(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(Pth&&jth){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(d4c&&(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),Fth(this._options.searchParams)){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(Eth&&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(!d4c)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=qth(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof ona)throw t;if(t instanceof eHa){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),wsu);if(this._retryCount<1)throw r;await b4c(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})===Esu)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let i=await r(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let t=Nth(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):y4c(this._originalRequest,t,this.abortController,this._options)}};var v4c=e=>{let t=(r,i)=>rHa.create(r,tHa(e,i));for(let r of jsu)t[r]=(i,n)=>rHa.create(i,tHa(e,n,{method:r}));return t.create=r=>v4c(tHa(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),v4c(tHa(e,r))),t.stop=Esu,t},CBD=v4c(),Qth=CBD;var srh=ce(urh(),1);function P4c(e){let t=(0,srh.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var rih=ce(tih(),1),iih=ce(pbe(),1),z4c=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},N4c=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function F4c(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??P4c(n),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,rih.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,c&&(d.authorization=`${c.type} ${c.token}`);let s;try{s=await Qth(o,{headers:d,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new z4c(e):f}if(t.allVersions)return s;let u=new N4c(e,r);if(s["dist-tags"][r]){let{time:f}=s;s=s.versions[s["dist-tags"][r]],s.time=f}else if(r){let f=!!s.versions[r];if(i&&!f)for(let[_,h]of Object.entries(s.versions))h.deprecated&&delete s.versions[_];if(!f){let _=Object.keys(s.versions);if(r=iih.default.maxSatisfying(_,r),!r)throw u}let{time:p}=s;if(s=s.versions[r],s.time=p,!s)throw u}return s}async function sHa(e,t){let{version:r}=await F4c(e.toLowerCase(),t);return r}async function jKi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:sHa(e.packageName,{version:t?"prerelease":"latest"})}var nih=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],Qsu=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=oc.Info;isLocal;constructor(t,r,{isLocal:i}){this.ttyAwareLogger=new msu(t,r),this.isLocal=i??!1;let n=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(n==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:n,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"3.35.2"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${It.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new US}failWithoutThrowing(t,r){this.didSucceed=!1,gsu({message:t,error:r,logger:this.logger})}async exit({code:t}={}){!this._suppressUpgradeMessage&&!this.isLocal&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await rkn()).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 Oth({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
1393
1393
  `)||(r+=`
1394
1394
  `),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=xZs(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 JGa(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 US}finally{i.finish()}return n}async instrumentPostHogEvent(t){this.isLocal||(await rkn()).sendEvent(t)}logger=mHt((t,...r)=>this.log(t,...r));stderr=mHt((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=aih(t.type==="docs"?"docs":t.workspaceName??"api"),i=1+(this.longestWorkspaceName!=null?aih(this.longestWorkspaceName):r).length,n=r.padEnd(i),a=nih[this.numTasks++%nih.length],o=It.hex(a)(n);return{...this.constructTaskInit(),logPrefix:o}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===_w.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=>tGi.indexOf(n.level)>=tGi.indexOf(this.logLevel));this.ttyAwareLogger.log(i,{includeDebugInfo:this.logLevel===oc.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 jKi({cliEnvironment:this.environment,includePreReleases:t}),i=S$(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(i?"Upgrade available.":"No upgrade available."));let n={isUpgradeAvailable:i,latestVersion:r},a=await Psu({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:n,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){try{return await kUc({message:t,choices:[{name:"No",value:!1},{name:"Yes",value:!0}],default:r,theme:{prefix:It.yellow("?"),style:{answer:n=>It.cyan(n),message:n=>It.bold(n),highlight:n=>It.cyan(n)}}})}catch(i){throw i?.name==="ExitPromptError"?(this.logger.info(`
1395
1395
  Cancelled by user.`),new US):i}}async getInput(t){return await $Uc({message:t.message,default:t.default})}};function aih(e){return`[${e}]:`}var S3t=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}};function Usu(e,t,r,i){if(typeof r!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(t)?t.reverse().reduce((n,a)=>Usu.bind(null,e,a,n,i),r)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((n,a)=>a.hook.bind(null,n,i),r)():r(i))}function oih(e,t,r,i){let n=i;e.registry[r]||(e.registry[r]=[]),t==="before"&&(i=(a,o)=>Promise.resolve().then(n.bind(null,o)).then(a.bind(null,o))),t==="after"&&(i=(a,o)=>{let c;return Promise.resolve().then(a.bind(null,o)).then(d=>(c=d,n(c,o))).then(()=>c)}),t==="error"&&(i=(a,o)=>Promise.resolve().then(a.bind(null,o)).catch(c=>n(c,o))),e.registry[r].push({hook:i,orig:n})}function uih(e,t,r){if(!e.registry[t])return;let i=e.registry[t].map(n=>n.orig).indexOf(r);i!==-1&&e.registry[t].splice(i,1)}var sih=Function.bind,cih=sih.bind(sih);function lih(e,t,r){let i=cih(uih,null).apply(null,r?[t,r]:[t]);e.api={remove:i},e.remove=i,["before","error","after","wrap"].forEach(n=>{let a=r?[t,n,r]:[t,n];e[n]=e.api[n]=cih(oih,null).apply(null,a)})}function FID(){let e=Symbol("Singular"),t={registry:{}},r=Usu.bind(null,t,e);return lih(r,t,e),r}function QID(){let e={registry:{}},t=Usu.bind(null,e);return lih(t,e),t}var fih={Singular:FID,Collection:QID};var UID="0.0.0-development",LID=`octokit-endpoint.js/${UID} ${lN()}`,VID={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":LID},mediaType:{format:""}};function WID(e){return e?Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}):{}}function GID(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}function _ih(e,t){let r=Object.assign({},e);return Object.keys(t).forEach(i=>{GID(t[i])?i in e?r[i]=_ih(e[i],t[i]):Object.assign(r,{[i]:t[i]}):Object.assign(r,{[i]:t[i]})}),r}function dih(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function U4c(e,t,r){if(typeof t=="string"){let[n,a]=t.split(" ");r=Object.assign(a?{method:n,url:a}:{url:n},r)}else r=Object.assign({},t);r.headers=WID(r.headers),dih(r),dih(r.headers);let i=_ih(e||{},r);return r.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(i.mediaType.previews=e.mediaType.previews.filter(n=>!i.mediaType.previews.includes(n)).concat(i.mediaType.previews)),i.mediaType.previews=(i.mediaType.previews||[]).map(n=>n.replace(/-preview/,""))),i}function HID(e,t){let r=/\?/.test(e)?"&":"?",i=Object.keys(t);return i.length===0?e:e+r+i.map(n=>n==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${n}=${encodeURIComponent(t[n])}`).join("&")}var xID=/\{[^{}}]+\}/g;function KID(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function JID(e){let t=e.match(xID);return t?t.map(KID).reduce((r,i)=>r.concat(i),[]):[]}function pih(e,t){let r={__proto__:null};for(let i of Object.keys(e))t.indexOf(i)===-1&&(r[i]=e[i]);return r}function hih(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function hna(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function cHa(e,t,r){return t=e==="+"||e==="#"?hih(t):hna(t),r?hna(r)+"="+t:t}function _na(e){return e!=null}function Q4c(e){return e===";"||e==="&"||e==="?"}function $ID(e,t,r,i){var n=e[r],a=[];if(_na(n)&&n!=="")if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")n=n.toString(),i&&i!=="*"&&(n=n.substring(0,parseInt(i,10))),a.push(cHa(t,n,Q4c(t)?r:""));else if(i==="*")Array.isArray(n)?n.filter(_na).forEach(function(o){a.push(cHa(t,o,Q4c(t)?r:""))}):Object.keys(n).forEach(function(o){_na(n[o])&&a.push(cHa(t,n[o],o))});else{let o=[];Array.isArray(n)?n.filter(_na).forEach(function(c){o.push(cHa(t,c))}):Object.keys(n).forEach(function(c){_na(n[c])&&(o.push(hna(c)),o.push(cHa(t,n[c].toString())))}),Q4c(t)?a.push(hna(r)+"="+o.join(",")):o.length!==0&&a.push(o.join(","))}else t===";"?_na(n)&&a.push(hna(r)):n===""&&(t==="&"||t==="?")?a.push(hna(r)+"="):n===""&&a.push("");return a}function YID(e){return{expand:XID.bind(null,e)}}function XID(e,t){var r=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,n,a){if(n){let c="",d=[];if(r.indexOf(n.charAt(0))!==-1&&(c=n.charAt(0),n=n.substr(1)),n.split(/,/g).forEach(function(s){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);d.push($ID(t,c,u[1],u[2]||u[3]))}),c&&c!=="+"){var o=",";return c==="?"?o="&":c!=="#"&&(o=c),(d.length!==0?c:"")+d.join(o)}else return d.join(",")}else return hih(a)}),e==="/"?e:e.replace(/\/$/,"")}function yih(e){let t=e.method.toUpperCase(),r=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},e.headers),n,a=pih(e,["method","baseUrl","url","headers","request","mediaType"]),o=JID(r);r=YID(r).expand(a),/^http/.test(r)||(r=e.baseUrl+r);let c=Object.keys(e).filter(u=>o.includes(u)).concat("baseUrl"),d=pih(a,c);if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=i.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];i.accept=u.concat(e.mediaType.previews).map(f=>{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${f}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?r=HID(r,d):"data"in d?n=d.data:Object.keys(d).length&&(n=d),!i["content-type"]&&typeof n<"u"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof n>"u"&&(n=""),Object.assign({method:t,url:r,headers:i},typeof n<"u"?{body:n}:null,e.request?{request:e.request}:null)}function ZID(e,t,r){return yih(U4c(e,t,r))}function bih(e,t){let r=U4c(e,t),i=ZID.bind(null,r);return Object.assign(i,{DEFAULTS:r,defaults:bih.bind(null,r),merge:U4c.bind(null,r),parse:yih})}var vih=bih(null,VID);var jih=ce(mih(),1);var M3t=class extends Error{name;status;request;response;constructor(t,r,i){super(t),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0),"response"in i&&(this.response=i.response);let n=Object.assign({},i.request);i.request.headers.authorization&&(n.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),n.url=n.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=n}};var kID="10.0.6",eCD={headers:{"user-agent":`octokit-request.js/${kID} ${lN()}`}};function tCD(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}async function Pih(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=e.request?.log||console,i=e.request?.parseSuccessResponseBody!==!1,n=tCD(e.body)||Array.isArray(e.body)?JSON.stringify(e.body):e.body,a=Object.fromEntries(Object.entries(e.headers).map(([f,p])=>[f,String(p)])),o;try{o=await t(e.url,{method:e.method,body:n,redirect:e.request?.redirect,headers:a,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(f){let p="Unknown Error";if(f instanceof Error){if(f.name==="AbortError")throw f.status=500,f;p=f.message,f.name==="TypeError"&&"cause"in f&&(f.cause instanceof Error?p=f.cause.message:typeof f.cause=="string"&&(p=f.cause))}let _=new M3t(p,500,{request:e});throw _.cause=f,_}let c=o.status,d=o.url,s={};for(let[f,p]of o.headers)s[f]=p;let u={url:d,status:c,headers:s,data:""};if("deprecation"in s){let f=s.link&&s.link.match(/<([^<>]+)>; rel="deprecation"/),p=f&&f.pop();r.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${s.sunset}${p?`. See ${p}`:""}`)}if(c===204||c===205)return u;if(e.method==="HEAD"){if(c<400)return u;throw new M3t(o.statusText,c,{response:u,request:e})}if(c===304)throw u.data=await L4c(o),new M3t("Not modified",c,{response:u,request:e});if(c>=400)throw u.data=await L4c(o),new M3t(iCD(u.data),c,{response:u,request:e});return u.data=i?await L4c(o):o.body,u}async function L4c(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(()=>"");let r=(0,jih.safeParse)(t);if(rCD(r)){let i="";try{return i=await e.text(),JSON.parse(i)}catch{return i}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?e.text().catch(()=>""):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function rCD(e){return e.type==="application/json"||e.type==="application/scim+json"}function iCD(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){let t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(r=>JSON.stringify(r)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function V4c(e,t){let r=e.defaults(t);return Object.assign(function(n,a){let o=r.merge(n,a);if(!o.request||!o.request.hook)return Pih(r.parse(o));let c=(d,s)=>Pih(r.parse(r.merge(d,s)));return Object.assign(c,{endpoint:r,defaults:V4c.bind(null,r)}),o.request.hook(c,o)},{endpoint:r,defaults:V4c.bind(null,r)})}var vA=V4c(vih,eCD);var nCD="0.0.0-development";function aCD(e){return`Request failed due to following response errors:
@@ -1740,7 +1740,7 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
1740
1740
  `;)b++;let O=a.slice(v,b).trim();if(a[b]==="="){for(b++;b<h&&(a[b]===" "||a[b]===`
1741
1741
  `);)b++;if(a[b]==='"'||a[b]==="'"){let A=a[b];b++;let g=b;for(;b<h&&a[b]!==A;)a[b]==="\\"?b+=2:b++;let m=a.slice(g,b);if(b++,O==="src"||O==="icon"&&kJi(m)){let j=c(m);j&&p.push({start:g,end:g+m.length,replacement:j})}else if(O==="href"){let j=oua({href:m,markdownFilesToPathName:r,metadata:i});j&&j.type==="replace"&&p.push({start:g,end:g+m.length,replacement:j.slug})}}}}b<h&&a[b]===">"&&b++,_=b;continue}_++}u=Zvu(a,p);let y=performance.now()-f;n.logger.debug(`Streaming replacement completed in ${y.toFixed(0)}ms: ${p.length} edits applied`)}else{let f=ZJi(a),p=Nwh(a),_=[];Fi(f,y=>{let b=y;return b.type==="image"||b.type==="link"||b.type==="mdxJsxFlowElement"||b.type==="mdxJsxTextElement"||b.type==="mdxFlowExpression"||b.type==="mdxTextExpression"},y=>{if(y.position==null)return;let{start:b,length:v}=Fwh(p,y.position),O=a.slice(b,b+v),A=O;function g(S){let w=c(S);S&&w&&(A=A.replace(S,w))}function m(S){let w=oua({href:S,markdownFilesToPathName:r,metadata:i});S!=null&&w!=null&&w.type==="replace"&&(A=A.replace(S,w.slug))}function j(S){aua(S,{src:w=>g(rC(J3t(w.value))),icon:w=>{let D=rC(J3t(w.value));kJi(D)&&g(D)},href:w=>m(rC(J3t(w.value)))})}if(y.type==="image"){let S=rC(y.url);g(rC(S))}if(y.type==="link"&&m(rC(y.url)),mvu(y)){let S=y.attributes.filter($3t).find(q=>q.name==="src");g(rC(bYt(S?.value)));let w=y.attributes.filter($3t).find(q=>q.name==="icon"),D=rC(bYt(w?.value));kJi(D)&&g(D);let B=y.attributes.find(q=>q.type==="mdxJsxAttribute"&&q.name==="href");m(rC(bYt(B?.value))),y.attributes.forEach(q=>{$3t(q)&&typeof q.value!="string"&&q.value!=null&&q.value.data?.estree?j(q.value.data.estree):jvu(q)&&q.data?.estree&&j(q.data.estree)})}return Pvu(y)&&y.data?.estree&&j(y.data.estree),A!==O&&_.push({start:b,end:b+v,replacement:A}),na}),u=Zvu(a,_)}return oKa.default.stringify(u,o)}function rC(e){if(typeof e=="string")return e.replace(/#.*$/,"")}function ssB(e){return e.replace(/\\([()])/g,"$1")}function Qwh(e,t,r){for(let i of t){let n=e[i];if(n!=null){if(typeof n=="object")n.type==="fileId"&&(e[i]={type:"fileId",value:li.FileId(r(n.value)??n.value)});else if(typeof n=="string"){let a=r(n);e[i]=a?{type:"fileId",value:li.FileId(a)}:{type:"url",value:li.Url(n)}}}}}var csB=zt.union([zt.string(),zt.object({light:zt.string().optional(),dark:zt.string().optional()})]);function u7c(e,t){let r=t(e);return r?{type:"fileId",value:li.FileId(r)}:{type:"url",value:li.Url(e)}}function Uwh(e,t){let r=csB.safeParse(e.logo);if(!r.success)return;let i=r.data;typeof i=="string"?e.logo=u7c(i,t):(i.light!=null&&(e.logo.light=u7c(i.light,t)),i.dark!=null&&(e.logo.dark=u7c(i.dark,t)))}var Lwh=require("fs/promises");async function lsB(e){return(await(0,Lwh.readFile)(e)).toString()}function fsB(e){return e.startsWith("http://")||e.startsWith("https://")}function dsB(e,t){let r=e.split(`
1742
1742
  `),i=new Set,n=t.trim();n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1));let a=n.split(",");for(let d of a){let s=d.trim(),u=s.match(/^(\d+)-(\d+)$/);if(u){let p=parseInt(u[1]??"1",10),_=parseInt(u[2]??"1",10);for(let h=p;h<=_;h++)i.add(h-1);continue}let f=s.match(/^(\d+)$/);if(f){let p=parseInt(f[1]??"1",10);i.add(p-1);continue}if(s!=="")return e}return i.size===0?e:Array.from(i).sort((d,s)=>d-s).filter(d=>d>=0&&d<r.length).map(d=>r[d]??"").join(`
1743
- `)}async function f7c({markdown:e,absolutePathToFernFolder:t,absolutePathToMarkdownFile:r,context:i,fileLoader:n=lsB}){if(!e.includes("<Code"))return e;let a=/([ \t]*)<Code(?:\s+[^>]*?)?\s+src={?['"]([^'"]+)['"](?! \+)}?((?:\s+[^>]*)?)\/>/g,o=e,c;for(;(c=a.exec(e))!=null;){let d=c[0],s=c[1],u=c[2];if(d==null||u==null)throw new Error(`Failed to parse regex "${c}" in ${r}`);try{let f,p,_;if(fsB(u))try{let S=await fetch(u);if(!S.ok){i.logger.warn(`Failed to fetch code from URL "${u}" (status ${S.status}) referenced in ${r}`);break}f=await S.text();let D=new URL(u).pathname;p=D.split(".").pop(),_=D.split("/").pop()}catch(S){i.logger.warn(`Failed to fetch code from URL "${u}" referenced in ${r}: ${S}`);break}else{let S=Uu(u.startsWith("/")?t:en(r),Xe.of(u.replace(/^\//,"")));f=await n(S),p=S.split(".").pop(),_=S.split("/").pop()}let h=new Map,y=/(\w+)=(?:{([^}]+)}|"([^"]+)")/g,b=d?.split("src=")[0]?.trim()??"",v;for(;(v=y.exec(b))!==null;){let S=v[1],w=v[2]||v[3],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}let O=c[3]?.trim()||"";for(y.lastIndex=0;(v=y.exec(O))!==null;){let S=v[1],w=v[2]||v[3],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}h.delete("src");let A=h.get("language");A&&(p=A.value,h.delete("language"));let g=h.get("title");g&&(_=g.value,h.delete("title"));let m=h.get("lines");m&&(f=dsB(f,m.value),h.delete("lines"));let j="";p!=null&&(j+=p),_!=null&&(g?.fromCurlyBraces?j+=` title={${_}}`:j+=` title={"${_}"}`);for(let[S,w]of h)if(w.fromCurlyBraces)j+=` ${S}={${w.value}}`;else{let D=w.value.trim();/^-?\d+(\.\d+)?$/.test(D)?j+=` ${S}={${D}}`:D==="true"||D==="false"?j+=` ${S}={${D}}`:j+=` ${S}={${JSON.stringify(w.value)}}`}f=`\`\`\`${j}
1743
+ `)}async function f7c({markdown:e,absolutePathToFernFolder:t,absolutePathToMarkdownFile:r,context:i,fileLoader:n=lsB}){if(!e.includes("<Code"))return e;let a=/([ \t]*)<Code(?:\s+[^>]*?)?\s+src={?['"]([^'"]+)['"](?! \+)}?((?:\s+[^>]*)?)\/>/g,o=e,c;for(;(c=a.exec(e))!=null;){let d=c[0],s=c[1],u=c[2];if(d==null||u==null)throw new Error(`Failed to parse regex "${c}" in ${r}`);try{let f,p,_;if(fsB(u))try{let S=await fetch(u);if(!S.ok){i.logger.warn(`Failed to fetch code from URL "${u}" (status ${S.status}) referenced in ${r}`);break}f=await S.text();let D=new URL(u).pathname;p=D.split(".").pop(),_=D.split("/").pop()}catch(S){i.logger.warn(`Failed to fetch code from URL "${u}" referenced in ${r}: ${S}`);break}else{let S=Uu(u.startsWith("/")?t:en(r),Xe.of(u.replace(/^\//,"")));f=await n(S),p=S.split(".").pop(),_=S.split("/").pop()}let h=new Map,y=/(\w+)=(?:{([^}]+)}|"([^"]+)"|(\d+)(?=\s|\/|>|$))/g,b=d?.split("src=")[0]?.trim()??"",v;for(;(v=y.exec(b))!==null;){let S=v[1],w=v[2]||v[3]||v[4],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}let O=c[3]?.trim()||"";for(y.lastIndex=0;(v=y.exec(O))!==null;){let S=v[1],w=v[2]||v[3]||v[4],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}h.delete("src");let A=h.get("language");A&&(p=A.value,h.delete("language"));let g=h.get("title");g&&(_=g.value,h.delete("title"));let m=h.get("lines");m&&(f=dsB(f,m.value),h.delete("lines"));let j="";p!=null&&(j+=p),_!=null&&(g?.fromCurlyBraces?j+=` title={${_}}`:j+=` title={"${_}"}`);for(let[S,w]of h)if(w.fromCurlyBraces)j+=` ${S}={${w.value}}`;else{let D=w.value.trim();/^-?\d+(\.\d+)?$/.test(D)?j+=` ${S}={${D}}`:D==="true"||D==="false"?j+=` ${S}={${D}}`:j+=` ${S}={${JSON.stringify(w.value)}}`}f=`\`\`\`${j}
1744
1744
  ${f}
1745
1745
  \`\`\``,f=f.split(`
1746
1746
  `).map(S=>s+S).join(`
@@ -1781,7 +1781,7 @@ A valid API configuration was not found at the path: fern/apis/${t.apiName}.
1781
1781
  Learn more about project structure:
1782
1782
  https://buildwithfern.com/learn/docs/getting-started/project-structure#api-definitions`:`Failed to load API Definition referenced in docs.
1783
1783
  Learn more about project structure:
1784
- https://buildwithfern.com/learn/docs/getting-started/project-structure#api-definitions`;throw new Error(r)}async toRootNode(){let t=Rt.V1.SlugGenerator.init(Rt.slugjoin(this.getDocsBasePath())),r=this.#e.get("root"),i=await this.toRootChild(t);return{type:"root",version:"v1",id:r,child:i,slug:t.get(),title:this.parsedDocsConfig.title??"Documentation",hidden:!1,icon:void 0,pointsTo:void 0,authed:void 0,viewers:void 0,orphaned:void 0,roles:this.parsedDocsConfig.roles?.map(n=>Rt.RoleId(n)),featureFlags:void 0}}async toRootChild(t){return vln(this.parsedDocsConfig.navigation)._visit({untabbed:r=>this.toUnversionedNode({landingPage:this.parsedDocsConfig.landingPage,navigationConfig:r,parentSlug:t}),tabbed:r=>this.toUnversionedNode({landingPage:this.parsedDocsConfig.landingPage,navigationConfig:r,parentSlug:t}),versioned:r=>this.toVersionedNode(r,t),productgroup:r=>this.toProductGroupNode({landingPageConfig:this.parsedDocsConfig.landingPage,productGroup:r,parentSlug:t})})}toLandingPageNode(t,r){let i=Rt.PageId(this.toRelativeFilepath(t.absolutePath)),n=r.apply({urlSlug:t.slug??NE(t.title),fullSlug:this.markdownFilesToFullSlugs.get(t.absolutePath)?.split("/")});return{type:"landingPage",id:this.#e.get(i),title:t.title,slug:n.get(),icon:this.resolveIconFileId(t.icon),hidden:t.hidden,viewers:t.viewers,orphaned:t.orphaned,pageId:i,authed:void 0,noindex:t.noindex||this.markdownFilesToNoIndex.get(t.absolutePath),featureFlags:t.featureFlags}}async toUnversionedNode({landingPage:t,navigationConfig:r,parentSlug:i}){let n=this.#e.get("unversioned"),a=t!=null?this.toLandingPageNode(t,i):void 0,o=r.type==="tabbed"?await this.convertTabbedNavigation(n,r.items,i):await this.toSidebarRootNode(n,r.items,i);return{type:"unversioned",id:n,landingPage:a,child:o}}async toVersionedNode(t,r){let i=this.#e.get("versioned"),n=t.versions[0];if(n?.hidden===!0)throw new Error(`The default version "${n.version}" cannot be hidden. Please set a non-hidden version as the first version in your versions list, or remove the hidden flag from the default version.`);return{id:i,type:"versioned",children:await Promise.all(t.versions.map((a,o)=>this.toVersionNode(a,r,o===0)))}}async toProductGroupNode({productGroup:t,landingPageConfig:r,parentSlug:i}){let n=this.#e.get("productgroup"),a=r!=null?this.toLandingPageNode(r,i):void 0;return{id:n,type:"productgroup",landingPage:a,children:await Promise.all(t.products.map(o=>this.toProductNode(o,i)))}}async toProductNode(t,r){if(t.type==="internal"){let i=r.setProductSlug(t.slug??NE(t.product)),n;switch(t.navigation.type){case"tabbed":n={type:"unversioned",id:this.#e.get(t.product),landingPage:void 0,child:await this.convertTabbedNavigation(this.#e.get(t.product),t.navigation.items,i)};break;case"untabbed":n={type:"unversioned",id:this.#e.get(t.product),landingPage:void 0,child:await this.toSidebarRootNode(this.#e.get(t.product),t.navigation.items,i)};break;case"versioned":n=await this.toVersionedNode(t.navigation,i);break;default:vt(t.navigation)}return{type:"product",id:this.#e.get(t.product),productId:Rt.V1.ProductId(t.product),title:t.product,subtitle:t.subtitle??"",slug:i.get(),child:n,default:!1,hidden:void 0,authed:void 0,icon:this.resolveIconFileId(t.icon),image:t.image!=null?this.getFileId(t.image):void 0,pointsTo:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,announcement:t.announcement!=null?{text:t.announcement.message}:void 0}}else return{type:"productLink",id:this.#e.get(t.product),productId:Rt.V1.ProductId(t.product),title:t.product,subtitle:t.subtitle??"",href:iG.Url(t.href??""),target:t.target,default:!1,hidden:void 0,authed:void 0,icon:this.resolveIconFileId(t.icon),image:t.image!=null?this.getFileId(t.image):void 0,viewers:t.viewers,orphaned:t.orphaned}}async toVersionNode(t,r,i){let n=this.#e.get(t.version),a=r.setVersionSlug(t.slug??NE(t.version)),o=t.navigation.type==="tabbed"?await this.convertTabbedNavigation(n,t.navigation.items,a):await this.toSidebarRootNode(n,t.navigation.items,a);return{type:"version",id:n,versionId:Rt.VersionId(t.version),title:t.version,slug:a.get(),child:o,default:i,availability:t.availability!=null?JlB(t.availability):void 0,landingPage:t.landingPage?this.toLandingPageNode(t.landingPage,a):void 0,hidden:t.hidden,authed:void 0,viewers:t.viewers,orphaned:t.orphaned,icon:void 0,pointsTo:void 0,featureFlags:t.featureFlags,announcement:t.announcement!=null?{text:t.announcement.message}:void 0}}async toSidebarRootNode(t,r,i){let n=this.#e.get(`${t}/root`),a=await Promise.all(r.map(c=>this.toNavigationChild({prefix:n,item:c,parentSlug:i}))),o=[];return a.forEach(c=>{if(c.type==="apiReference"){o.push(c);return}if(c.type==="section"&&!c.collapsed){o.push(c);return}let d=o.length>0?o[o.length-1]:void 0,s;d?.type==="sidebarGroup"?s=d:(s={id:this.#e.get(`${n}/group`),type:"sidebarGroup",children:[]},o.push(s)),s.children.push(c)}),{type:"sidebarRoot",id:n,children:o}}async toSidebarRootNodeWithVariants(t,r,i){let n=this.#e.get(`${t}/root`);return{type:"sidebarRoot",id:n,children:[{type:"varianted",id:n,children:await Promise.all(r.map(a=>this.toVariantNode(a,n,i)))}]}}async toVariantNode(t,r,i){let n=this.#e.get(`${r}/variant/${t.slug??NE(t.title)}`),a=i.apply({urlSlug:t.slug??NE(t.title),skipUrlSlug:t.skipUrlSlug}),o=await Promise.all(t.layout.map(c=>this.toVariantChild(c,n,a)));return{type:"variant",id:n,variantId:Rt.V1.VariantId(t.title),subtitle:t.subtitle??"",default:t.default??!1,image:void 0,children:o,title:t.title,slug:a.get(),icon:this.resolveIconFileId(t.icon),hidden:t.hidden,authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,pointsTo:void 0}}async toVariantChild(t,r,i){return vln(t)._visit({page:async n=>this.toPageNode({item:n,parentSlug:i}),apiSection:async n=>this.toApiSectionNode({item:n,parentSlug:i}),section:async n=>this.toSectionNode({prefix:r,item:n,parentSlug:i}),link:async n=>this.toLinkNode(n),changelog:async n=>this.toChangelogNode(n,i)})}async toNavigationChild({prefix:t,item:r,parentSlug:i,hideChildren:n,parentAvailability:a}){return vln(r)._visit({page:async o=>this.toPageNode({item:o,parentSlug:i,hideChildren:n,parentAvailability:a}),apiSection:async o=>this.toApiSectionNode({item:o,parentSlug:i,hideChildren:n,parentAvailability:a}),section:async o=>this.toSectionNode({prefix:t,item:o,parentSlug:i,hideChildren:n,parentAvailability:a}),link:async o=>this.toLinkNode(o),changelog:async o=>this.toChangelogNode(o,i,n)})}async toApiSectionNode({item:t,parentSlug:r,hideChildren:i,parentAvailability:n}){let a=QSh(t.snippetsConfiguration),o,c=await this.getFernWorkspaceForApiSection(t).toFernWorkspace({context:this.taskContext},{enableUniqueErrorsPerEndpoint:!0,detectGlobalHeaders:!1,objectQueryParameters:!0,preserveSchemaIds:!0}),d=this.parsedDocsConfig.experimental?.openapiParserV3,s=d==null||d;if(s)try{o=await this.getOpenApiWorkspaceForApiSection(t).getIntermediateRepresentation({context:this.taskContext,audiences:t.audiences,enableUniqueErrorsPerEndpoint:!0,generateV1Examples:!1,logWarnings:!1})}catch{}let u;if(t.tagDescriptionPages&&s)try{let b=await this.getOpenApiWorkspaceForApiSection(t).getOpenAPIIr({context:this.taskContext});b.tags.tagsById&&(u=Object.fromEntries(Object.entries(b.tags.tagsById).filter(([v,O])=>O.description&&O.description.trim().length>0).map(([v,O])=>[v,{id:String(O.id),description:O.description}])))}catch(y){this.taskContext.logger.warn("Failed to extract OpenAPI tags for tag description pages",String(y))}o==null&&(o=eS({workspace:c,audiences:t.audiences,generationLanguage:void 0,keywords:void 0,smartCasing:!1,exampleGeneration:{disabled:!1,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!0},readme:void 0,version:void 0,packageName:void 0,context:this.taskContext,sourceResolver:new kE(this.taskContext,c)})),this.docsWorkspace.config.settings?.substituteEnvVars&&(o=MT(o,{onError:y=>this.taskContext.failAndThrow(`Error substituting environment variables in API spec: ${y}`)},{substituteAsEmpty:!1}));let f=await this.registerApi({ir:o,snippetsConfig:a,playgroundConfig:{oauth:t.playground?.oauth},apiName:t.apiName,workspace:c}),p=OKa({ir:o,apiDefinitionId:f,playgroundConfig:{oauth:t.playground?.oauth},context:this.taskContext}),_=new Egu(t,p,r,this.docsWorkspace,this.taskContext,this.markdownFilesToFullSlugs,this.markdownFilesToNoIndex,this.markdownFilesToTags,this.#e,this.collectedFileIds,c,i,n??t.availability,u),h=_.getTagDescriptionContent();for(let[y,b]of h.entries()){let v=y.split("/").pop()||y,O=Xe.of(v),A=b;this.docsWorkspace.config.settings?.substituteEnvVars&&(A=MT(b,{onError:g=>this.taskContext.logger.error(`Error in tag description environment variable substitution: ${g}`)},{substituteAsEmpty:!1})),this.rawMarkdownFiles[O]=A,this.parsedDocsConfig.pages[O]=A}return _.get()}async toChangelogNode(t,r,i){return new pvn(this.markdownFilesToFullSlugs,this.markdownFilesToNoIndex,this.markdownFilesToTags,t.changelog,this.docsWorkspace,this.#e).toChangelogNode({parentSlug:r,title:t.title,icon:this.resolveIconFileId(t.icon),viewers:t.viewers,hidden:i||t.hidden,slug:t.slug})}async toLinkNode(t){return{type:"link",id:this.#e.get(t.url),title:t.text,url:Rt.V1.Url(t.url),icon:this.resolveIconFileId(t.icon),target:t.target}}async toPageNode({item:t,parentSlug:r,hideChildren:i,parentAvailability:n}){let a=Rt.PageId(this.toRelativeFilepath(t.absolutePath)),o=r.apply({urlSlug:t.slug??NE(t.title),fullSlug:this.markdownFilesToFullSlugs.get(t.absolutePath)?.split("/")});return{id:this.#e.get(a),type:"page",slug:o.get(),title:this.markdownFilesToSidebarTitle.get(t.absolutePath)??t.title,icon:this.resolveIconFileId(t.icon),hidden:i||t.hidden,viewers:t.viewers,orphaned:t.orphaned,pageId:a,authed:void 0,noindex:t.noindex||this.markdownFilesToNoIndex.get(t.absolutePath),featureFlags:t.featureFlags,availability:t.availability??n}}async toSectionNode({prefix:t,item:r,parentSlug:i,hideChildren:n,parentAvailability:a}){let o=this.toRelativeFilepath(r.overviewAbsolutePath),c=o?Rt.PageId(o):void 0,d=this.#e.get(c??`${t}/section`),s=i.apply({urlSlug:r.slug??NE(r.title),fullSlug:r.overviewAbsolutePath?this.markdownFilesToFullSlugs.get(r.overviewAbsolutePath)?.split("/"):void 0,skipUrlSlug:r.skipUrlSlug}),u=r.overviewAbsolutePath!=null?this.markdownFilesToNoIndex.get(r.overviewAbsolutePath):void 0,f=n||r.hidden;return{id:d,type:"section",overviewPageId:c,slug:s.get(),title:r.overviewAbsolutePath!=null?this.markdownFilesToSidebarTitle.get(r.overviewAbsolutePath)??r.title:r.title,icon:this.resolveIconFileId(r.icon),collapsed:r.collapsed,hidden:f,viewers:r.viewers,orphaned:r.orphaned,children:await Promise.all(r.contents.map(p=>this.toNavigationChild({prefix:d,item:p,parentSlug:s,hideChildren:f,parentAvailability:r.availability??a}))),authed:void 0,pointsTo:void 0,noindex:u,featureFlags:r.featureFlags,availability:r.availability??a}}async convertTabbedNavigation(t,r,i){let n=this.#e.get(`${t}/tabbed`);return{type:"tabbed",id:n,children:await Promise.all(r.map(a=>this.toTabChild(n,a,i)))}}async toTabChild(t,r,i){return vln(r.child)._visit({link:({href:n,target:a})=>this.toTabLinkNode(r,n,a),layout:({layout:n})=>this.toTabNode(t,r,n,i),changelog:({changelog:n})=>this.toTabChangelogNode(r,n,i),variants:({variants:n})=>this.toTabNodeWithVariants(t,r,n,i)})}async toTabChangelogNode(t,r,i){return new pvn(this.markdownFilesToFullSlugs,this.markdownFilesToNoIndex,this.markdownFilesToTags,r,this.docsWorkspace,this.#e).toChangelogNode({parentSlug:i,title:t.title,icon:this.resolveIconFileId(t.icon),viewers:t.viewers,hidden:t.hidden,slug:t.slug})}async toTabLinkNode(t,r,i){return{type:"link",id:this.#e.get(r),title:t.title,url:Rt.V1.Url(r),target:i,icon:this.resolveIconFileId(t.icon)}}async toTabNode(t,r,i,n){let a=this.#e.get(`${t}/tab`),o=n.apply({urlSlug:r.slug??NE(r.title),skipUrlSlug:r.skipUrlSlug});return{type:"tab",id:a,title:r.title,slug:o.get(),icon:this.resolveIconFileId(r.icon),hidden:r.hidden,authed:void 0,viewers:r.viewers,orphaned:r.orphaned,pointsTo:void 0,child:await this.toSidebarRootNode(a,i,o),featureFlags:r.featureFlags}}async toTabNodeWithVariants(t,r,i,n){let a=this.#e.get(`${t}/tab`),o=n.apply({urlSlug:r.slug??NE(r.title),skipUrlSlug:r.skipUrlSlug});return{type:"tab",id:a,title:r.title,slug:o.get(),icon:this.resolveIconFileId(r.icon),hidden:r.hidden,authed:void 0,viewers:r.viewers,orphaned:r.orphaned,pointsTo:void 0,child:await this.toSidebarRootNodeWithVariants(a,i,o),featureFlags:r.featureFlags}}getFileId(t){if(t==null)return;let r=this.collectedFileIds.get(t);return r==null?this.taskContext.failAndThrow("Failed to locate file after uploading: "+t):iG.FileId(r)}resolveIconFileId(t){if(t!=null)return this.collectedFileIds.has(t)?`file:${this.getFileId(t)}`:t}convertPageActions(){if(this.parsedDocsConfig.pageActions!=null)return{default:this.parsedDocsConfig.pageActions.default,options:{askAi:this.parsedDocsConfig.pageActions.options.askAi,copyPage:this.parsedDocsConfig.pageActions.options.copyPage,viewAsMarkdown:this.parsedDocsConfig.pageActions.options.viewAsMarkdown,openAi:this.parsedDocsConfig.pageActions.options.openAi,claude:this.parsedDocsConfig.pageActions.options.claude,cursor:this.parsedDocsConfig.pageActions.options.cursor,vscode:this.parsedDocsConfig.pageActions.options.vscode,custom:this.parsedDocsConfig.pageActions.options.custom.map(t=>({title:t.title,subtitle:t.subtitle,url:t.url,icon:this.resolveIconFileId(t.icon),default:t.default}))}}}convertColorConfigImageReferences(){let{colors:t}=this.parsedDocsConfig;if(t!=null)return t.type==="dark"?{...t,...this.convertLogoAndBackgroundImage({theme:"dark"})}:t.type==="light"?{...t,...this.convertLogoAndBackgroundImage({theme:"light"}),type:"light"}:{...t,dark:{...t.dark,...this.convertLogoAndBackgroundImage({theme:"dark"})},light:{...t.light,...this.convertLogoAndBackgroundImage({theme:"light"})}}}convertLogoAndBackgroundImage({theme:t}){let{logo:r,backgroundImage:i}=this.parsedDocsConfig,n=r?.[t],a=i?.[t];return{logo:this.getFileId(n),backgroundImage:this.getFileId(a)}}convertDocsTypographyConfiguration(){if(this.parsedDocsConfig.typography!=null)return{headingsFont:this.convertFont(this.parsedDocsConfig.typography.headingsFont,"headings"),bodyFont:this.convertFont(this.parsedDocsConfig.typography.bodyFont,"body"),codeFont:this.convertFont(this.parsedDocsConfig.typography.codeFont,"code")}}convertFont(t,r){if(t==null||t.variants[0]==null)return;let i=this.getFileId(t.variants[0].absolutePath);return{type:"custom",name:t.name??`font:${r}:${i}`,variants:t.variants.map(n=>({fontFile:this.getFileId(n.absolutePath),weight:n.weight,style:n.style!=null?[n.style]:void 0})),display:t.display,fallback:t.fallback,fontVariationSettings:t.fontVariationSettings}}convertJavascriptConfiguration(){if(this.parsedDocsConfig.js!=null)return{files:this.parsedDocsConfig.js.files.map(({absolutePath:t,strategy:r})=>({fileId:this.getFileId(t),strategy:r})).filter(ds),remote:this.parsedDocsConfig.js.remote?.map(t=>({...t,url:iG.Url(t.url)})),inline:void 0}}convertMetadata(){if(this.parsedDocsConfig.metadata==null)return;let{"og:image":t,"og:logo":r,"twitter:image":i,...n}=this.parsedDocsConfig.metadata;return{...n,"og:image":this.convertFileIdOrUrl(t),"og:logo":this.convertFileIdOrUrl(r),"twitter:image":this.convertFileIdOrUrl(i)}}convertFileIdOrUrl(t){if(t!=null)return vln(t,"type")._visit({filepath:({value:r})=>({type:"fileId",value:this.getFileId(r)}),url:({value:r})=>({type:"url",value:iG.Url(r)}),_other:()=>this.taskContext.failAndThrow("Invalid metadata configuration")})}};function KlB(e,t){if(e?.github==null)return;let{owner:r,repo:i,branch:n="main",host:a="https://github.com"}=e.github;return`${tH(a)}/${r}/${i}/blob/${n}/fern/${t}?plain=1`}function JlB(e){switch(e){case"beta":return Rt.V1.NavigationV1Availability.Beta;case"deprecated":return Rt.V1.NavigationV1Availability.Deprecated;case"ga":return Rt.V1.NavigationV1Availability.GenerallyAvailable;case"stable":return Rt.V1.NavigationV1Availability.Stable;default:vt(e)}}async function rL(e){return(await Promise.all(e.apiWorkspaces.map(async t=>t instanceof ZE?t:null))).filter(ds)}async function U7c(e,t,r){if(e instanceof SEe){t.logger.info("Skipping, API is specified as a Fern Definition.");return}else if(!(e instanceof ZE))return;let i=await e.getIntermediateRepresentation({context:t,audiences:r,enableUniqueErrorsPerEndpoint:!0,generateV1Examples:!1,logWarnings:!1});return eH({ir:i,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},playgroundConfig:{oauth:!0},context:t})}var Ys={};Zt(Ys,{AlgoliaSearchIndex:()=>aMh,ApiDefinitionId:()=>EMh,ApiId:()=>BMh,Availability:()=>HMh,DocsConfigId:()=>IMh,EndpointId:()=>qMh,EndpointPathLiteral:()=>WMh,EnvironmentId:()=>CMh,FileId:()=>FMh,HttpMethod:()=>GMh,IndexSegmentId:()=>oMh,JqString:()=>UMh,OrgId:()=>MMh,PageId:()=>NMh,PayloadLocation:()=>vDh,PropertyKey:()=>LMh,PullRequestState:()=>pDh,RoleId:()=>VMh,TokenId:()=>DMh,TypeId:()=>zMh,Url:()=>QMh,VersionId:()=>SMh,WebSocketId:()=>TMh,WebhookId:()=>RMh,algolia:()=>L7c,api:()=>X7c,commons:()=>Z7c,diff:()=>xMh,docs:()=>uxc,generators:()=>cxc,git:()=>lxc,navigation:()=>pxc,sdks:()=>hxc,snippets:()=>yDh,snippetsFactory:()=>bDh,templates:()=>yxc,tokens:()=>gDh});var L7c={};Zt(L7c,{AlgoliaSearchIndex:()=>aMh,IndexSegmentId:()=>oMh});function aMh(e){return e}function oMh(e){return e}var X7c={};Zt(X7c,{latest:()=>G7c,v1:()=>Y7c});var G7c={};Zt(G7c,{AuthSchemeId:()=>uMh,WebhookHttpMethod:()=>fMh,auth:()=>V7c,commons:()=>sMh,endpoint:()=>cMh,type_:()=>lMh,webhook:()=>W7c,websocket:()=>dMh});var V7c={};Zt(V7c,{AuthSchemeId:()=>uMh});function uMh(e){return e}var sMh={};var cMh={};var lMh={};var W7c={};Zt(W7c,{WebhookHttpMethod:()=>fMh});var fMh={Get:"GET",Post:"POST"};var dMh={};var Y7c={};Zt(Y7c,{SubpackageId:()=>mMh,WebSocketMessageId:()=>PMh,WebSocketMessageOrigin:()=>jMh,WebhookHttpMethod:()=>wMh,commons:()=>$7c,db:()=>H7c,read:()=>K7c,register:()=>J7c});var H7c={};Zt(H7c,{endpoint:()=>pMh});var pMh={};var K7c={};Zt(K7c,{SupportedLanguage:()=>_Mh,endpoint:()=>x7c,type_:()=>hMh,webhook:()=>yMh,websocket:()=>bMh});var x7c={};Zt(x7c,{SupportedLanguage:()=>_Mh});var _Mh={Curl:"curl",Python:"python",Javascript:"javascript",Js:"js",Node:"node",Typescript:"typescript",Ts:"ts",Go:"go",Ruby:"ruby",Csharp:"csharp"};var hMh={};var yMh={};var bMh={};var J7c={};Zt(J7c,{SourceId:()=>$lB,endpoint:()=>vMh,type_:()=>gMh,webhook:()=>OMh,websocket:()=>AMh});var vMh={};var gMh={};var OMh={};var AMh={};function $lB(e){return e}var $7c={};Zt($7c,{SubpackageId:()=>mMh,WebSocketMessageId:()=>PMh,WebSocketMessageOrigin:()=>jMh,WebhookHttpMethod:()=>wMh});function mMh(e){return e}function PMh(e){return e}var jMh={Client:"client",Server:"server"};var wMh={Get:"GET",Post:"POST"};var Z7c={};Zt(Z7c,{ApiDefinitionId:()=>EMh,ApiId:()=>BMh,Availability:()=>HMh,DocsConfigId:()=>IMh,EndpointId:()=>qMh,EndpointPathLiteral:()=>WMh,EnvironmentId:()=>CMh,FileId:()=>FMh,HttpMethod:()=>GMh,JqString:()=>UMh,OrgId:()=>MMh,PageId:()=>NMh,PropertyKey:()=>LMh,RoleId:()=>VMh,TokenId:()=>DMh,TypeId:()=>zMh,Url:()=>QMh,VersionId:()=>SMh,WebSocketId:()=>TMh,WebhookId:()=>RMh});function EMh(e){return e}function SMh(e){return e}function MMh(e){return e}function DMh(e){return e}function BMh(e){return e}function IMh(e){return e}function CMh(e){return e}function qMh(e){return e}function TMh(e){return e}function RMh(e){return e}function zMh(e){return e}function NMh(e){return e}function FMh(e){return e}function QMh(e){return e}function UMh(e){return e}function LMh(e){return e}function VMh(e){return e}function WMh(e){return e}var GMh={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE"};var HMh={Stable:"Stable",GenerallyAvailable:"GenerallyAvailable",InDevelopment:"InDevelopment",PreRelease:"PreRelease",Deprecated:"Deprecated",Beta:"Beta"};var xMh={};var uxc={};Zt(uxc,{latest:()=>txc,v1:()=>axc,v2:()=>oxc});var txc={};Zt(txc,{Layout:()=>JMh,MdxEngine:()=>YlB,TwitterCardSetting:()=>$Mh,commons:()=>KMh,frontmatter:()=>k7c,seo:()=>exc});var YlB={NextMdxRemote:"next-mdx-remote",MdxBundler:"mdx-bundler"};var KMh={};var k7c={};Zt(k7c,{Layout:()=>JMh});var JMh={Guide:"guide",Overview:"overview",Reference:"reference",Page:"page",Custom:"custom"};var exc={};Zt(exc,{TwitterCardSetting:()=>$Mh});var $Mh={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"};var axc={};Zt(axc,{commons:()=>nxc,db:()=>YMh,read:()=>XMh,write:()=>rxc});var YMh={};var XMh={};var rxc={};Zt(rxc,{DocsRegistrationId:()=>ZlB,FilePath:()=>XlB});function XlB(e){return e}function ZlB(e){return e}var nxc={};Zt(nxc,{ContentAlignment:()=>tDh,FontDisplay:()=>oDh,FontStyle:()=>aDh,HeaderPosition:()=>rDh,JsScriptStrategy:()=>nDh,ProgrammingLanguage:()=>ZMh,SearchbarPlacement:()=>kMh,TabsPlacement:()=>eDh,TwitterCardSetting:()=>iDh,commons:()=>ixc});var ixc={};Zt(ixc,{ContentAlignment:()=>tDh,FontDisplay:()=>oDh,FontStyle:()=>aDh,HeaderPosition:()=>rDh,JsScriptStrategy:()=>nDh,ProgrammingLanguage:()=>ZMh,SearchbarPlacement:()=>kMh,TabsPlacement:()=>eDh,TwitterCardSetting:()=>iDh});var ZMh={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 kMh={Header:"HEADER",HeaderTabs:"HEADER_TABS",Sidebar:"SIDEBAR"};var eDh={Header:"HEADER",Sidebar:"SIDEBAR"};var tDh={Center:"CENTER",Left:"LEFT"};var rDh={Fixed:"FIXED",Absolute:"ABSOLUTE"};var iDh={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"};var nDh={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"};var aDh={Normal:"normal",Italic:"italic"};var oDh={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"};var oxc={};Zt(oxc,{read:()=>uDh,write:()=>sDh});var uDh={};var sDh={};var cxc={};Zt(cxc,{ChangelogEntryType:()=>lDh,GeneratorId:()=>klB,GeneratorLanguage:()=>efB,ReleaseType:()=>fDh,cli:()=>cDh,commons:()=>sxc,versions:()=>dDh});var cDh={};var sxc={};Zt(sxc,{ChangelogEntryType:()=>lDh,ReleaseType:()=>fDh});var lDh={Fix:"fix",Feat:"feat",Chore:"chore",Break:"break",Internal:"internal"};var fDh={Ga:"GA",Rc:"RC"};var dDh={};function klB(e){return e}var efB={Python:"python",Go:"go",Java:"java",Typescript:"typescript",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust"};var lxc={};Zt(lxc,{PullRequestState:()=>pDh});var pDh={Open:"open",Closed:"closed",Merged:"merged"};var pxc={};Zt(pxc,{latest:()=>fxc,v1:()=>dxc});var fxc={};Zt(fxc,{NodeId:()=>ifB,ProductId:()=>nfB,Slug:()=>tfB,TabId:()=>rfB});function tfB(e){return e}function rfB(e){return e}function ifB(e){return e}function nfB(e){return e}var dxc={};Zt(dxc,{NavigationV1Availability:()=>cfB,NodeId:()=>ufB,ProductId:()=>sfB,Slug:()=>afB,TabId:()=>ofB});function afB(e){return e}function ofB(e){return e}function ufB(e){return e}function sfB(e){return e}var cfB={Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Beta:"beta",Deprecated:"deprecated"};var hxc={};Zt(hxc,{Language:()=>_Dh,VersionBump:()=>hDh,versions:()=>_xc});var _xc={};Zt(_xc,{Language:()=>_Dh,VersionBump:()=>hDh});var _Dh={Go:"Go",TypeScript:"TypeScript",Java:"Java",Python:"Python",Csharp:"Csharp",Ruby:"Ruby"};var hDh={Major:"MAJOR",Minor:"MINOR",Patch:"PATCH"};var yDh={};var bDh={};var yxc={};Zt(yxc,{PayloadLocation:()=>vDh});var vDh={Body:"BODY",Query:"QUERY",Path:"PATH",Headers:"HEADERS",Relative:"RELATIVE",Auth:"AUTH"};var gDh={};var Rgu=class{warnings=[];errors=[];error(t){this.errors.push(t)}warning(t){this.warnings.push(t)}};function No(e){return e!=null}var ADh=ce(TFa(),1);var ODh=["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"];function EYt(e){return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.replace(/_/g," "),e=e.replace(/-/g," "),(0,ADh.default)(e,{special:ODh}).replace(/V\s(\d)/g,"V$1")}function mDh({endpoints:e,webhookEndpoints:t}){let r={};return Object.values({...e,...t}).forEach(i=>{let n=[];i.namespace?.forEach(a=>{let o=[...n,a],c=Ys.api.v1.SubpackageId(o.join("."));r[c]={id:c,name:a,displayName:EYt(a)},n.push(a)})}),r}var zgu=class{input;context;constructor(t,r){this.input=t,this.context=r}errors(){return this.context.errors.errors}warnings(){return this.context.errors.warnings}};function PDh(e){return`#/${e.map(t=>t.replaceAll(/~/g,"~0").replaceAll(/\//g,"~1")).join("/")}`}var po=class extends zgu{context;accessPath;pathId;constructor({input:t,context:r,accessPath:i,pathId:n}){if(super(t,r),this.context=r,this.accessPath=[...i],this.pathId=n,n!=null){let a=Array.isArray(this.pathId)?this.pathId:[this.pathId];a.every((o,c)=>o===this.accessPath[this.accessPath.length-a.length+c])||this.accessPath.push(...a)}r.logger.debug(`Processing ${PDh(this.accessPath)}`)}safeParse(...t){try{this.parse(...t)}catch{this.context.errors.error({message:"Error converting node. Please contact support if the error persists",path:this.accessPath})}}},iC=class extends po{},K$=class extends iC{seenSchemas;constructor(t){super(t),this.seenSchemas=new Set(t.seenSchemas)}};var jDh="x-fern-base-path",wDh="x-fern-availability",Ngu="x-fern-sdk-group-name",EDh="x-fern-global-headers",SDh="x-fern-sdk-method-name";var MDh="x-fern-webhook",DDh="x-fern-access-token-locator",BDh="x-fern-basic",IDh="x-fern-username-variable-name",CDh="x-fern-password-variable-name",qDh="x-fern-bearer",TDh="x-fern-token-variable-name",RDh="x-fern-header",zDh="x-fern-header-variable-name",NDh="x-fern-server-name",FDh="x-fern-examples";var Fgu=class extends po{serverName;constructor(t){super(t),this.safeParse()}parse(){this.serverName=this.input[NDh]}convert(){if(this.serverName!=null)return this.serverName}};var Qgu=class extends po{url;serverName;constructor(t){super(t),this.safeParse()}parse(){this.url=Object.entries(this.input.variables??{}).reduce((t,[r,i])=>t.replace(`{${r}}`,i.default),this.input.url)??this.input.url,this.serverName=new Fgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId})}convert(){let t=this.serverName?.convert()??this.url;if(!(this.url==null||t==null))return{id:Ys.EnvironmentId(t),baseUrl:this.url}}};function i$i(e,t,r,i){let n=e??[],a=new Set(n.map(c=>c.url)),o=(t??[]).filter(c=>!a.has(c.url)).map((c,d)=>new Qgu({input:c,context:r,accessPath:i,pathId:["servers",`${d}`]}));return[...n,...o]}function zv(e){return typeof e=="object"&&No(e)&&"$ref"in e&&typeof e.$ref=="string"}function iL(e,t,r){let i=e.$ref.substring(2).split("/").map(a=>a.replace(/~1/g,"/")),n=t;for(let a of i){if(typeof n!="object"||n==null)return r;n=n[a]}return n==null?r:(zv(n)&&(n=iL(n,t,r)),n)}function Ugu(e,t){let r=t.components?.securitySchemes?.[e];if(r!=null)return zv(r)?iL(r,t,void 0):r}var DBh=ce(VS());var Lgu=class extends po{username;password;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[BDh];this.username=t?.username,this.password=t?.password}convert(){return{username:this.username,password:this.password}}};var Vgu=class extends po{passwordVariableName;constructor(t){super(t),this.safeParse()}parse(){this.passwordVariableName=this.input[CDh]}convert(){return this.passwordVariableName}};var Wgu=class extends po{usernameVariableName;constructor(t){super(t),this.safeParse()}parse(){this.usernameVariableName=this.input[IDh]}convert(){return this.usernameVariableName}};var Ggu=class extends po{bearerTokenVariableName;bearerTokenEnvVar;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[qDh];this.bearerTokenVariableName=t?.name,this.bearerTokenEnvVar=t?.env}convert(){return{tokenVariableName:this.bearerTokenVariableName,tokenEnvVar:this.bearerTokenEnvVar}}};var Hgu=class extends po{tokenVariableName;constructor(t){super(t),this.safeParse()}parse(){this.tokenVariableName=this.input[TDh]}convert(){return this.tokenVariableName}};function QDh(e){return typeof e=="object"&&e!=null&&"in"in e&&e.in==="header"}var UDh="x-bearer-format",LDh="x-code-samples",VDh="x-codeSamples";var xgu=class extends po{bearerFormat;constructor(t){super(t),this.safeParse()}parse(){this.bearerFormat=this.input[UDh]}convert(){return this.bearerFormat}};var Kgu=class extends po{headerVariableName;headerEnvVar;headerPrefix;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[RDh];this.headerVariableName=t?.name,this.headerEnvVar=t?.env,this.headerPrefix=t?.prefix}convert(){return{name:this.headerVariableName,env:this.headerEnvVar,prefix:this.headerPrefix}}};var Jgu=class extends po{headerVariableName;constructor(t){super(t),this.safeParse()}parse(){this.headerVariableName=this.input[zDh]}convert(){return this.headerVariableName}};function WDh(e){return e.type==="apiKey"}var mua=class extends po{headerName;headerBearerFormatNode;headerAuthNode;headerVariableNameNode;constructor(t){super(t),this.safeParse()}parse(){WDh(this.input)&&(this.headerName=this.input.name),this.headerAuthNode=new Kgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.headerVariableNameNode=new Jgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.headerBearerFormatNode=new xgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId})}convert(){let t=this.headerAuthNode?.convert();if(t!=null)return{type:"header",nameOverride:t?.name,headerWireValue:this.headerName??"Authorization",prefix:t?.prefix??this.headerBearerFormatNode?.convert()}}};function $gu(e){return e}function Ygu(e){return e==="__proto__"}function Xgu(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function Pua(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function AKa(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(AKa).join(",");let t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function Zgu(e){if(Array.isArray(e))return e.map(Pua);if(typeof e=="symbol")return[e];e=AKa(e);let t=[],r=e.length;if(r===0)return t;let i=0,n="",a="",o=!1;for(e.charCodeAt(0)===46&&(t.push(""),i++);i<r;){let c=e[i];a?c==="\\"&&i+1<r?(i++,n+=e[i]):c===a?a="":n+=c:o?c==='"'||c==="'"?a=c:c==="]"?(o=!1,t.push(n),n=""):n+=c:c==="["?(o=!0,n&&(t.push(n),n="")):c==="."?n&&(t.push(n),n=""):n+=c,i++}return n&&t.push(n),t}function mKa(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(Ygu(t))return r;let i=e[t];return i===void 0?Xgu(t)?mKa(e,Zgu(t),r):r:i}case"number":case"symbol":{typeof t=="number"&&(t=Pua(t));let i=e[t];return i===void 0?r:i}default:{if(Array.isArray(t))return lfB(e,t,r);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),Ygu(t))return r;let i=e[t];return i===void 0?r:i}}}function lfB(e,t,r){if(t.length===0)return r;let i=e;for(let n=0;n<t.length;n++){if(i==null||Ygu(t[n]))return r;i=i[t[n]]}return i===void 0?r:i}function GDh(e){return function(t){return mKa(t,e)}}function HDh(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function kgu(e){return e==null||typeof e!="object"&&typeof e!="function"}function bxc(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function gxc(e,t,r){return typeof r!="function"?gxc(e,t,()=>{}):vxc(e,t,function i(n,a,o,c,d,s){let u=r(n,a,o,c,d,s);return u!==void 0?!!u:vxc(n,a,i,s)},new Map)}function vxc(e,t,r,i){if(t===e)return!0;switch(typeof t){case"object":return ffB(e,t,r,i);case"function":return Object.keys(t).length>0?vxc(e,{...t},r,i):bxc(e,t);default:return HDh(e)?typeof t=="string"?t==="":!0:bxc(e,t)}}function ffB(e,t,r,i){if(t==null)return!0;if(Array.isArray(t))return xDh(e,t,r,i);if(t instanceof Map)return dfB(e,t,r,i);if(t instanceof Set)return pfB(e,t,r,i);let n=Object.keys(t);if(e==null)return n.length===0;if(n.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let a=0;a<n.length;a++){let o=n[a];if(!kgu(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!r(e[o],t[o],o,e,t,i))return!1}return!0}finally{i?.delete(t)}}function dfB(e,t,r,i){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[n,a]of t.entries()){let o=e.get(n);if(r(o,a,n,e,t,i)===!1)return!1}return!0}function xDh(e,t,r,i){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let n=new Set;for(let a=0;a<t.length;a++){let o=t[a],c=!1;for(let d=0;d<e.length;d++){if(n.has(d))continue;let s=e[d],u=!1;if(r(s,o,a,e,t,i)&&(u=!0),u){n.add(d),c=!0;break}}if(!c)return!1}return!0}function pfB(e,t,r,i){return t.size===0?!0:e instanceof Set?xDh([...e],[...t],r,i):!1}function eOu(e,t){return gxc(e,t,()=>{})}function KDh(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function tOu(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var JDh="[object RegExp]",rOu="[object String]",iOu="[object Number]",nOu="[object Boolean]",aOu="[object Arguments]",$Dh="[object Symbol]",YDh="[object Date]",XDh="[object Map]",ZDh="[object Set]",kDh="[object Array]";var eBh="[object ArrayBuffer]",tBh="[object Object]";var rBh="[object DataView]",iBh="[object Uint8Array]",nBh="[object Uint8ClampedArray]",aBh="[object Uint16Array]",oBh="[object Uint32Array]";var uBh="[object Int8Array]",sBh="[object Int16Array]",cBh="[object Int32Array]";var lBh="[object Float32Array]",fBh="[object Float64Array]";function dBh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pBh(e,t){return n$i(e,void 0,e,new Map,t)}function n$i(e,t,r,i=new Map,n=void 0){let a=n?.(e,t,r,i);if(a!==void 0)return a;if(kgu(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){let o=new Array(e.length);i.set(e,o);for(let c=0;c<e.length;c++)o[c]=n$i(e[c],c,r,i,n);return Object.hasOwn(e,"index")&&(o.index=e.index),Object.hasOwn(e,"input")&&(o.input=e.input),o}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let o=new RegExp(e.source,e.flags);return o.lastIndex=e.lastIndex,o}if(e instanceof Map){let o=new Map;i.set(e,o);for(let[c,d]of e)o.set(c,n$i(d,c,r,i,n));return o}if(e instanceof Set){let o=new Set;i.set(e,o);for(let c of e)o.add(n$i(c,void 0,r,i,n));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(dBh(e)){let o=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,o);for(let c=0;c<e.length;c++)o[c]=n$i(e[c],c,r,i,n);return o}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let o=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,o),n8t(o,e,r,i,n),o}if(typeof File<"u"&&e instanceof File){let o=new File([e],e.name,{type:e.type});return i.set(e,o),n8t(o,e,r,i,n),o}if(typeof Blob<"u"&&e instanceof Blob){let o=new Blob([e],{type:e.type});return i.set(e,o),n8t(o,e,r,i,n),o}if(e instanceof Error){let o=new e.constructor;return i.set(e,o),o.message=e.message,o.name=e.name,o.stack=e.stack,o.cause=e.cause,n8t(o,e,r,i,n),o}if(e instanceof Boolean){let o=new Boolean(e.valueOf());return i.set(e,o),n8t(o,e,r,i,n),o}if(e instanceof Number){let o=new Number(e.valueOf());return i.set(e,o),n8t(o,e,r,i,n),o}if(e instanceof String){let o=new String(e.valueOf());return i.set(e,o),n8t(o,e,r,i,n),o}if(typeof e=="object"&&_fB(e)){let o=Object.create(Object.getPrototypeOf(e));return i.set(e,o),n8t(o,e,r,i,n),o}return e}function n8t(e,t,r=e,i,n){let a=[...Object.keys(t),...KDh(t)];for(let o=0;o<a.length;o++){let c=a[o],d=Object.getOwnPropertyDescriptor(e,c);(d==null||d.writable)&&(e[c]=n$i(t[c],c,r,i,n))}}function _fB(e){switch(tOu(e)){case aOu:case kDh:case eBh:case rBh:case nOu:case YDh:case lBh:case fBh:case uBh:case sBh:case cBh:case XDh:case iOu:case tBh:case JDh:case ZDh:case rOu:case $Dh:case iBh:case nBh:case aBh:case oBh:return!0;default:return!1}}function _Bh(e){return n$i(e,void 0,e,new Map,void 0)}function hBh(e){return e=_Bh(e),t=>eOu(t,e)}function yBh(e,t){return pBh(e,(r,i,n,a)=>{let o=t?.(r,i,n,a);if(o!==void 0)return o;if(typeof e=="object")switch(Object.prototype.toString.call(e)){case iOu:case rOu:case nOu:{let c=new e.constructor(e?.valueOf());return n8t(c,e),c}case aOu:{let c={};return n8t(c,e),c.length=e.length,c[Symbol.iterator]=e[Symbol.iterator],c}default:return}})}function bBh(e){return yBh(e)}var hfB=/^(?:0|[1-9]\d*)$/;function vBh(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return hfB.test(e)}}function gBh(e){return e!==null&&typeof e=="object"&&tOu(e)==="[object Arguments]"}function OBh(e,t){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&Xgu(t)&&e?.[t]==null?r=Zgu(t):r=[t],r.length===0)return!1;let i=e;for(let n=0;n<r.length;n++){let a=r[n];if((i==null||!Object.hasOwn(i,a))&&!((Array.isArray(i)||gBh(i))&&vBh(a)&&a<i.length))return!1;i=i[a]}return!0}function ABh(e,t){switch(typeof e){case"object":{Object.is(e?.valueOf(),-0)&&(e="-0");break}case"number":{e=Pua(e);break}}return t=bBh(t),function(r){let i=mKa(r,e);return i===void 0?OBh(r,e):t===void 0?i===void 0:eOu(i,t)}}function mBh(e){if(e==null)return $gu;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?ABh(e[0],e[1]):hBh(e);case"string":case"symbol":case"number":return GDh(e)}}function PBh(e,t){let r={},i=Object.keys(e);for(let n=0;n<i.length;n++){let a=i[n],o=e[a];r[a]=t(o,a,e)}return r}function oOu(e,t=$gu){return e==null?{}:PBh(e,mBh(t))}function jBh(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}var yfB=new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+","gu");function wBh(e){return Array.from(e.match(yfB)??[])}function EBh(e){let t=wBh(e);if(t.length===0)return"";let[r,...i]=t;return`${r.toLowerCase()}${i.map(n=>jBh(n)).join("")}`}function SBh(e){return typeof e!="string"&&(e=AKa(e)),e.replace(/['\u2019]/g,"")}function a8t(e){return EBh(SBh(e))}function RP(e){if(e!=null)return Array.isArray(e)?e:[e]}function uOu({namespace:e,path:t,method:r,sdkMethodName:i,operationId:n,displayName:a,isWebhook:o}){if(t==null)return;let c=r!=null&&t!=null?`${r}_${t.split("/").join("_")}`:r??t.split("/").join("_");if(!(i==null&&n==null&&a==null&&c==null))return`${bfB(o)}${vfB(e)}.${gfB(i,n,a,c)}`}function bfB(e){return e?"webhook_":"endpoint_"}function vfB(e){return e!=null?RP(e)?.map(t=>a8t(t)).join("/"):""}function gfB(e,t,r,i){return e||t||a8t(r??"")||a8t(i??"")}function MBh(e){return e.length===0?!1:/^\$?(\.[\w*]+|\[['"][\w*]+['"]?\]|\[['"]?[\d*]+['"]?\]|\[[\d:]+\])*$/.test(e)}var sOu=class extends po{accessTokenLocator;constructor(t){super(t),this.safeParse()}parse(){this.accessTokenLocator=this.input[DDh],this.accessTokenLocator!=null&&(MBh(this.accessTokenLocator)||(this.context.errors.error({message:"Invalid access token locator, must be a valid jq path",path:this.accessPath}),this.accessTokenLocator=void 0))}convert(){return this.accessTokenLocator}};var cOu=class extends po{authorizationUrl;headerAuthNode;accessTokenLocatorNode;constructor(t){super(t),this.safeParse()}parse(){if(this.input.flows.clientCredentials!=null){let t=this.input.flows.clientCredentials;this.authorizationUrl=t.tokenUrl,this.authorizationUrl==null&&this.context.errors.error({message:"Expected 'tokenUrl' property to be specified",path:this.accessPath}),this.headerAuthNode=new mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.accessTokenLocatorNode=new sOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.authorizationUrl==null&&this.context.errors.error({message:"Expected 'tokenUrl' property to be specified",path:this.accessPath}),this.accessTokenLocatorNode?.accessTokenLocator==null&&this.context.errors.error({message:"Expected 'x-fern-access-token-locator' property to be specified",path:this.accessPath})}}convert(){let t=this.accessTokenLocatorNode?.convert();if(t==null||this.authorizationUrl==null)return{type:"bearerAuth",tokenName:void 0};let r=uOu({namespace:void 0,path:this.authorizationUrl,method:"POST",sdkMethodName:void 0,operationId:void 0,displayName:void 0,isWebhook:void 0});if(r!=null)return{type:"oAuth",value:{type:"clientCredentials",value:{type:"referencedEndpoint",endpointId:Ys.EndpointId(r),accessTokenLocator:Ys.JqString(t),headerName:this.headerAuthNode?.convert()?.headerWireValue,tokenPrefix:this.headerAuthNode?.convert()?.prefix}}}}};var jua=class extends po{authScheme;headerAuthNode;bearerTokenNode;bearerTokenVariableNameNode;basicAuthNode;basicUsernameVariableNameNode;basicPasswordVariableNameNode;oauth2Node;constructor(t){super(t),this.safeParse()}parse(){switch(this.input.type){case"http":switch(this.input.scheme){case"basic":{this.authScheme="basic",this.basicAuthNode=new Lgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.basicUsernameVariableNameNode=new Wgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.basicPasswordVariableNameNode=new Vgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),(this.basicAuthNode==null||this.basicAuthNode.username==null&&this.basicUsernameVariableNameNode?.usernameVariableName==null||this.basicAuthNode.password==null&&this.basicPasswordVariableNameNode?.passwordVariableName==null)&&this.context.errors.warning({message:"Basic auth should specify either a username or a username variable name",path:this.accessPath});break}case"bearer":{this.authScheme="bearer",this.bearerTokenNode=new Ggu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.bearerTokenVariableNameNode=new Hgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});break}default:{this.context.errors.warning({message:`Unsupported HTTP auth scheme: ${this.input.scheme}`,path:this.accessPath});break}}break;case"apiKey":{QDh(this.input)?(this.authScheme="header",this.headerAuthNode=new mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId})):this.context.errors.error({message:`Unsupported API key location: ${this.input.in}`,path:this.accessPath});break}case"oauth2":{this.authScheme="oauth",this.oauth2Node=new cOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});break}case"openIdConnect":{this.authScheme="bearer";break}}}convert(){switch(this.authScheme){case"basic":{let t=this.basicAuthNode?.convert();return{type:"basicAuth",usernameName:t?.username?.name??this.basicUsernameVariableNameNode?.convert(),passwordName:t?.password?.name??this.basicPasswordVariableNameNode?.convert()}}case"bearer":return{type:"bearerAuth",tokenName:this.bearerTokenNode?.convert()?.tokenVariableName??this.bearerTokenVariableNameNode?.convert()};case"header":return this.headerAuthNode?.convert();case"oauth":return this.oauth2Node?.convert();case void 0:return;default:new DBh.UnreachableCaseError(this.authScheme);return}}};var wua=class extends po{authNodesMap;constructor(t){super(t),this.safeParse()}parse(){this.input.map((t,r)=>Object.keys(t).map(i=>{let n=Ugu(i,this.context.document);if(n==null){this.context.errors.warning({message:`No auth scheme found for ${i}. Inline security schemes are not supported.`,path:this.accessPath});return}let a=new jua({input:n,context:this.context,accessPath:this.accessPath,pathId:["security",`${r}`]});a.convert()!=null?(this.authNodesMap??={},this.authNodesMap[i]=a):this.context.errors.warning({message:`No auth scheme found for ${i}`,path:this.accessPath})}))}convert(){return Object.fromEntries(Object.entries(this.authNodesMap??{}).map(([t,r])=>{let i=r.convert();if(i!=null)return[t,i]}).filter(No))}};var lOu=class extends po{basePath;constructor(t){super(t),this.safeParse()}parse(){this.basePath=this.input[jDh],this.basePath!=null?(this.basePath.startsWith("/")&&(this.basePath=this.basePath.slice(1)),this.basePath.endsWith("/")&&(this.basePath=this.basePath.slice(0,-1))):this.basePath=void 0}convert(){return this.basePath}};function BBh(e){return"required"in e&&typeof e.required=="boolean"?e.required:!1}function IBh(e,t){return{type:"alias",value:{type:"optional",shape:e,default:t}}}function Eua(e,t){return e==null?void 0:Object.entries(e).map(([i,n])=>RP(n.convert())?.map(o=>((t!=null&&!t.includes(i)||t==null&&!BBh(n))&&(o=IBh(o,o.type==="enum"?o.default:void 0)),{key:Ys.PropertyKey(i),valueShape:o,description:n.description,availability:n.availability?.convert()})).filter(No)).filter(No).reduce((i,n)=>i.flatMap(a=>n.length>0?n.map(o=>[...a,o]):[[...a]]),[[]])}function fOu(e,t){return zv(e)?iL(e,t,void 0):e}function a$i(e,t){return e!=null&&e!==""?e:t!=null&&t!==""?t:void 0}function CBh(e,t){let r={...e};for(let[i,n]of Object.entries(t??{}))r[i]=[...r[i]??[],...n];return Object.keys(r).length>0?r:void 0}function qBh(e,t){if(e==null)return t;if(t==null)return e;let r=[];for(let i of e)for(let n of t)r.push({path:i.path??n.path,responseStatusCode:i.responseStatusCode??n.responseStatusCode,name:i.name??n.name,description:i.description??n.description,pathParameters:i.pathParameters??n.pathParameters,queryParameters:i.queryParameters??n.queryParameters,headers:i.headers??n.headers,requestBody:i.requestBody??n.requestBody,responseBody:i.responseBody??n.responseBody,snippets:{...n.snippets,...i.snippets}});return r}var TBh=ce(VS());var Oxc=["decimal","decimal128","double-int","double","float","sf-decimal"],Axc=["int16","int32","int64","int8","sf-integer","uint8"],mxc=["base64url","binary","byte","char","commonmark","date-time","date","decimal","decimal128","duration","email","hostname","html","http-date","idn-email","idn-hostname","int64","ipv4","ipv6","iri-reference","iri","json-pointer","media-range","password","regex","relative-json-pointer","sf-binary","sf-boolean","sf-string","sf-token","time","uri-reference","uri-template","uri","uuid"],Pxc=["beta","pre-release","in-development","generally-available","deprecated"];function nC(e,t){return zv(e)?iL(e,t,{type:"unknown","x-fern-type":"unknown",additionalProperties:!1}):e}var FEe=class extends po{availability;constructor(t){super(t),this.safeParse()}parse(){if(nC(this.input,this.context.document)?.deprecated)this.availability="deprecated";else{let r=this.input[wDh];r!=null&&(Pxc.includes(r)?this.availability=r:(this.context.errors.warning({message:`Expected one of: ${Pxc.join(", ")}. Received: ${r}`,path:this.accessPath}),this.availability=void 0))}}convert(){switch(this.availability){case"beta":case"pre-release":return Ys.Availability.Beta;case"in-development":return Ys.Availability.InDevelopment;case"generally-available":return Ys.Availability.GenerallyAvailable;case"deprecated":return Ys.Availability.Deprecated;case void 0:return;default:new TBh.UnreachableCaseError(this.availability);return}}};var pOu=ce(VS());function RBh(e){return typeof e=="object"&&e!=null&&"language"in e}function zBh(e){return typeof e=="object"&&e!=null&&"sdk"in e}function NBh(e){return typeof e=="object"&&e!=null&&("error"in e||"body"in e)}function FBh(e){return typeof e=="object"&&e!=null&&"stream"in e&&Array.isArray(e.stream)}function dOu(e){return typeof e=="object"&&e!=null&&"event"in e}function jxc(e){return typeof e=="object"&&e!=null&&"stream"in e&&Array.isArray(e.stream)&&e.stream.every(dOu)}function o$i(e){return typeof e=="object"&&e!=null&&"filename"in e&&"data"in e&&typeof e.filename=="string"&&typeof e.data=="string"}function QBh(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}var _Ou=class extends po{path;successResponseStatusCode;requestBodyByContentType;responseBodies;examples;constructor(t,r,i,n,a){super(t),this.path=r,this.successResponseStatusCode=i,this.requestBodyByContentType=n,this.responseBodies=a,this.safeParse()}parse(){this.examples=this.input[FDh]}convertFormDataExampleRequest(t,r){if(t.fields!=null)switch(t.contentType){case"form-data":return{type:"form",value:Object.fromEntries(Object.entries(t.fields).map(([n,a])=>{let o=typeof r=="object"?r[n]:void 0;switch(a.multipartType){case"file":return o$i(o)?[n,{type:"filenameWithData",filename:o.filename,data:Ys.FileId(o.data)}]:o!=null?[n,{type:"filename",value:o}]:void 0;case"files":{if(Array.isArray(o)){if(o.every(c=>o$i(c)))return[n,{type:"filenamesWithData",value:o.map(c=>({filename:c.filename,data:Ys.FileId(c.data)}))}];if(o.every(c=>typeof c=="string"))return[n,{type:"filenames",value:o}]}return}case"property":return[n,{type:"json",value:o}];case void 0:return;default:new pOu.UnreachableCaseError(a.multipartType);return}}).filter(No))};case"json":return{type:"json",value:r};case"bytes":return typeof r=="string"?{type:"bytes",value:{type:"base64",value:r}}:void 0;default:return}}convert(){if(this.examples==null)return;this.requestBodyByContentType!=null&&Object.keys(this.requestBodyByContentType).length>1&&this.context.logger.warn(`Multiple request bodies found for #/${[this.accessPath,this.pathId,"x-fern-examples"].join("/")}. Coercing to first request body until supported.`);let t=Object.keys(this.requestBodyByContentType??{})[0];return this.examples.flatMap(r=>(this.responseBodies??[]).map(i=>{let n=t!=null?this.requestBodyByContentType?.[t]:void 0,a;if(n!=null)switch(n.contentType){case"form-data":a=QBh(r.request)?this.convertFormDataExampleRequest(n,r.request):void 0;break;case"json":a=r.request!=null?{type:"json",value:r.request}:void 0;break;case"bytes":a=typeof r.request=="string"&&r.request!=null?{type:"bytes",value:{type:"base64",value:r.request}}:void 0;break;case void 0:break;default:new pOu.UnreachableCaseError(n.contentType);break}let o;switch(i.contentType){case"application/json":{NBh(r.response)&&(o={type:"json",value:r.response.body});break}case"text/event-stream":{jxc(r.response)&&(o={type:"sse",value:r.response.stream.map(f=>({event:f.event,data:f.data}))});break}case"application/octet-stream":!jxc(r.response)&&FBh(r.response)&&(o={type:"stream",value:r.response.stream});break;case void 0:break;default:new pOu.UnreachableCaseError(i.contentType);break}let c={};r["code-samples"]?.forEach(f=>{RBh(f)?f.language!=null&&(c[f.language]??=[],c[f.language]?.push({name:f.name,language:f.language,install:f.install,code:f.code,generated:!1,description:f.docs})):zBh(f)&&f.sdk!=null&&(c[f.sdk]??=[],c[f.sdk]?.push({name:f.name,language:f.sdk,install:void 0,code:f.code,generated:!1,description:f.docs}))});let d=Object.fromEntries(Object.entries(r["path-parameters"]??{}).map(([f,p])=>[Ys.PropertyKey(f),p])),s=Object.fromEntries(Object.entries(r["query-parameters"]??{}).map(([f,p])=>[Ys.PropertyKey(f),p])),u=Object.fromEntries(Object.entries(r.headers??{}).map(([f,p])=>[Ys.PropertyKey(f),p]));return{path:this.path,responseStatusCode:this.successResponseStatusCode,name:r.name,description:r.docs,pathParameters:Object.keys(d).length>0?d:void 0,queryParameters:Object.keys(s).length>0?s:void 0,headers:Object.keys(u).length>0?u:void 0,requestBody:a,responseBody:o,snippets:c}}))}};var PKa=class extends po{groupName;constructor(t){super(t),this.safeParse()}parse(){this.groupName=this.input[Ngu]}convert(){if(this.groupName==null)return;let t;return Array.isArray(this.groupName)?t=this.groupName:t=[this.groupName],t.map(r=>Ys.api.v1.SubpackageId(a8t(r)))}};var hOu=class extends po{sdkMethodName;constructor(t){super(t),this.safeParse()}parse(){this.sdkMethodName=this.input[SDh]}convert(){return this.sdkMethodName}};var yOu=class extends po{isWebhook;constructor(t){super(t),this.safeParse()}parse(){this.isWebhook=this.input[MDh]}convert(){return this.isWebhook}};var bOu=class extends po{codeSamples;constructor(t){super(t),this.safeParse()}parse(){this.codeSamples=[...this.input[LDh]??[],...this.input[VDh]??[]],this.codeSamples.forEach(t=>{[...Object.values(Ys.api.v1.read.SupportedLanguage),"Kotlin","Swift","PHP"].map(r=>r.toLowerCase()).includes(t.lang.toLowerCase())||this.context.errors.warning({message:`Unsupported language: ${t.lang}. This may not render correctly.`,path:this.accessPath})})}convert(){let t={};if(this.codeSamples?.forEach(r=>{t[r.lang.toLowerCase()]??=[],t[r.lang.toLowerCase()]?.push({name:r.label,language:r.lang,code:r.source,install:void 0,generated:!1,description:void 0})}),Object.keys(t).length!==0)return t}};var _vn=ce(VS());function wxc(e,t){return zv(e)?iL(e,t,void 0):e}function UBh(e,t){return e.replace(/{(\w+)}/g,(r,i)=>t[i]!=null&&typeof t[i]=="string"||typeof t[i]=="number"||typeof t[i]=="boolean"?`${t[i]}`:r)}var aF="",SYt=class extends po{path;responseStatusCode;name;shapes;resolvedRequestInput;resolvedResponseInput;summary;constructor(t,r,i,n,a){super(t),this.path=r,this.responseStatusCode=i,this.name=n,this.shapes=a,this.safeParse()}validateFormDataRequestExample(){return typeof this.resolvedRequestInput?.value!="object"?!1:Object.entries(this.shapes.requestBody?.fields??{}).reduce((t,[r,i])=>{let n=this.resolvedRequestInput?.value[r];switch(i.multipartType){case"file":return t&&(o$i(n)||typeof n=="string");case"files":return t&&Array.isArray(n)&&n.every(a=>o$i(a)||typeof a=="string");case"property":return t;case void 0:return t&&!1;default:return new _vn.UnreachableCaseError(i.multipartType),t}},!0)}parse(){let t=this.shapes.requestBody?.schema?.example({includeOptionals:!1,override:void 0});this.resolvedRequestInput=wxc(this.input?.requestExample,this.context.document)??(t!=null?{value:t}:void 0);let r=this.shapes.responseBody?.schema?.example({includeOptionals:!1,override:void 0});if(this.resolvedResponseInput=wxc(this.input?.responseExample,this.context.document)??(r!=null?{value:r}:void 0),this.summary=this.input?.requestExample?.summary??this.input?.responseExample?.summary,this.shapes.requestBody!=null&&this.resolvedRequestInput!=null)switch(this.shapes.requestBody?.contentType){case"json":{if(typeof this.resolvedRequestInput.value!="object"){this.context.errors.error({message:"Invalid example, expected object for json",path:this.accessPath});return}break}case"bytes":{if(typeof this.resolvedRequestInput.value!="string"){this.context.errors.error({message:"Invalid example, expected string for bytes",path:this.accessPath});return}break}case"form-data":{if(!this.validateFormDataRequestExample()){this.context.errors.error({message:"Invalid example, expected valid form-data",path:this.accessPath});return}break}case void 0:break;default:new _vn.UnreachableCaseError(this.shapes.requestBody?.contentType),this.context.errors.error({message:"Invalid example, unsupported content type",path:this.accessPath});return}if(this.shapes.responseBody!=null&&this.resolvedResponseInput!=null)switch(this.shapes.responseBody?.contentType){case"application/json":if(this.resolvedResponseInput!=null&&typeof this.resolvedResponseInput!="object"||this.resolvedResponseInput.value!=null&&typeof this.resolvedResponseInput.value!="object"){this.context.errors.error({message:"Invalid example, expected object for json",path:this.accessPath});return}break;case"text/event-stream":if(this.resolvedResponseInput.value!=null&&!Array.isArray(this.resolvedResponseInput.value)&&!this.resolvedResponseInput.value.every(dOu)){this.context.errors.error({message:"Invalid example, expected array of SSE events for event-stream",path:this.accessPath});return}break;case"application/octet-stream":if(this.resolvedResponseInput.value!=null&&typeof this.resolvedResponseInput.value!="string"&&!Array.isArray(this.resolvedResponseInput.value)){this.context.errors.error({message:"Invalid example, expected string or array for octet-stream",path:this.accessPath});return}break;case void 0:break;default:new _vn.UnreachableCaseError(this.shapes.responseBody?.contentType);return}}convertFormDataExampleRequest(){if(!(this.resolvedRequestInput==null||this.shapes.requestBody?.fields==null))switch(this.shapes.requestBody?.contentType){case"form-data":return{type:"form",value:Object.fromEntries(Object.entries(this.shapes.requestBody.fields).map(([r,i])=>{let n=this.resolvedRequestInput?.value?.[r];switch(i.multipartType){case"file":return o$i(n)?[r,{type:"filenameWithData",filename:n.filename,data:Ys.FileId(n.data)}]:[r,{type:"filename",value:n}];case"files":{if(Array.isArray(n)){if(n.every(a=>o$i(a)))return[r,{type:"filenamesWithData",value:n.map(a=>({filename:a.filename,data:Ys.FileId(a.data)}))}];if(n.every(a=>typeof a=="string"))return[r,{type:"filenames",value:n}]}return}case"property":return[r,{type:"json",value:n}];case void 0:return;default:new _vn.UnreachableCaseError(i.multipartType);return}}).filter(No))};case"json":return{type:"json",value:this.resolvedRequestInput.value};case"bytes":return typeof this.resolvedRequestInput.value=="string"?{type:"bytes",value:{type:"base64",value:this.resolvedRequestInput.value}}:void 0;default:return}}convertDescription(){if(this.resolvedRequestInput!=null&&this.resolvedResponseInput!=null)return this.resolvedResponseInput.description;if(this.resolvedRequestInput!=null)return this.resolvedRequestInput.description;if(this.resolvedResponseInput!=null)return this.resolvedResponseInput.description}convert(){let t;if(this.shapes.requestBody!=null&&this.resolvedRequestInput!=null)switch(this.shapes.requestBody.contentType){case"form-data":t=this.convertFormDataExampleRequest();break;case"json":t={type:"json",value:this.resolvedRequestInput.value};break;case"bytes":t={type:"bytes",value:{type:"base64",value:this.resolvedRequestInput.value}};break;case void 0:break;default:new _vn.UnreachableCaseError(this.shapes.requestBody?.contentType);break}let r;if(this.shapes.responseBody!=null&&this.resolvedResponseInput!=null)switch(this.shapes.responseBody.contentType){case"application/json":{r={type:"json",value:this.resolvedResponseInput?.value??this.resolvedResponseInput};break}case"text/event-stream":r={type:"sse",value:this.resolvedResponseInput?.value};break;case"application/octet-stream":r={type:typeof this.resolvedResponseInput?.value=="string"?"filename":"stream",value:this.resolvedResponseInput?.value??this.resolvedResponseInput};break;case void 0:r={type:"json",value:this.resolvedResponseInput?.value??this.resolvedResponseInput};break;default:new _vn.UnreachableCaseError(this.shapes.responseBody?.contentType);break}let i=Object.fromEntries(Object.entries(this.shapes.pathParameters??{}).map(([o,c])=>[o,c.example({includeOptionals:!1,override:o})]));i=Object.keys(i).length>0?i:void 0;let n=Object.fromEntries(Object.entries(this.shapes.queryParameters??{}).map(([o,c])=>c.required||c.inputExample!=null?[o,c.example({includeOptionals:!1,override:o})]:void 0).filter(No));n=Object.keys(n).length>0?n:void 0;let a=Object.fromEntries(Object.entries(this.shapes.requestHeaders??{}).map(([o,c])=>c.required||c.inputExample!=null?[o,c.example({includeOptionals:!1,override:o})]:void 0).filter(No));if(a=Object.keys(a).length>0?a:void 0,!(this.path==null&&t==null&&r==null&&a==null&&n==null&&i==null))return{path:UBh(this.path,i??{}),responseStatusCode:this.responseStatusCode,name:this.name!=null?EYt(this.name):this.summary!=null?EYt(this.summary):void 0,description:this.convertDescription(),pathParameters:i,queryParameters:n,headers:a,requestBody:t,responseBody:r,snippets:void 0}}};function LBh(e,t){return zv(e)?iL(e,t,void 0):e}var eIh=ce(VS());var VBh="#/components/schemas/";function Sua(e){if(e.$ref.startsWith(VBh))return e.$ref.replace(VBh,"")}function yUi(e){if(e!=null)return{type:"alias",value:{type:"nullable",shape:e}}}function u$i(e){return typeof e.type=="string"&&e.type==="array"}function WBh(e){return e.type==="boolean"}function GBh(e){return e.type==="integer"}function s$i(e){return!Array.isArray(e.type)&&!u$i(e)}function HBh(e){return e!=null&&Array.isArray(e)&&e.every(t=>t.type==="null"||s$i(t)||u$i(t))}function xBh(e){return"nullable"in e&&typeof e.nullable=="boolean"}function KBh(e){return e.type==="null"}function JBh(e){return e.type==="number"}function Exc(e){return e.type==null||typeof e.type=="string"&&e.type==="object"}function $Bh(e){return e.type==="string"}var vOu=class extends K${item;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.safeParse()}parse(){this.item=new G0({input:this.input.items,context:this.context,accessPath:this.accessPath,pathId:"items",seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName}),this.input.items==null&&this.context.errors.error({message:"Expected 'items' property to be specified",path:this.accessPath})}convert(){return RP(this.item?.convert())?.map(r=>({type:"alias",value:{type:"list",itemShape:r}}))}example(t){return this.input.example??this.input.examples?.[0]??[this.item?.example(t)]}};var gOu=class extends iC{constValue;description;availability;constructor(t){super(t),this.safeParse()}parse(){this.input.const!=null&&(typeof this.input.const=="string"||typeof this.input.const=="number"||typeof this.input.const=="boolean")?this.constValue=this.input.const.toString():this.context.errors.warning({message:`Unsupported const type: ${typeof this.input}`,path:this.accessPath}),this.description=this.input.description,this.availability=new FEe({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-availability"})}convert(){if(this.constValue!=null)return{type:"enum",default:this.constValue,values:[{value:this.constValue,description:this.description,availability:this.availability?.convert()}]}}example(){return this.input.example??this.input.examples?.[0]??this.constValue}};var OOu=class extends K${typeNodes;nullable;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.parse()}parse(){this.typeNodes=this.input.map(t=>{if(t.type==="null")this.nullable=!0;else return new G0({input:t,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:this.nullable,schemaName:this.schemaName})}).filter(No)}convert(){if(this.typeNodes==null)return;let i=this.typeNodes.map(n=>RP(n.convert())?.map(o=>({displayName:n.name,shape:o,description:n.description,availability:n.availability?.convert()}))).filter(No).reduce((n,a)=>n.flatMap(o=>a.length>0?a.map(c=>[...o,c]):[[...o]]),[[]]).map(n=>({type:"undiscriminatedUnion",variants:n}));return this.nullable?i.map(yUi).filter(No):i}example(t){return this.nullable?null:this.typeNodes?.[0]?.example(t)}};function AOu(e){return e!=null&&e.length>0?e:[void 0]}var Mua=class extends K${description;extends=[];properties;extraProperties;requiredProperties;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.safeParse()}parse(){this.extends=[],this.requiredProperties=this.input.required,this.properties=Object.fromEntries(Object.entries(this.input.properties??{}).map(([t,r])=>[t,new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:["properties",t],seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})])),this.extraProperties=this.input.additionalProperties!=null?typeof this.input.additionalProperties=="boolean"?this.input.additionalProperties?this.input.title:void 0:new G0({input:this.input.additionalProperties,context:this.context,accessPath:this.accessPath,pathId:["additionalProperties"],seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName}):void 0,this.input.allOf!=null&&(this.extends=this.extends.concat(this.input.allOf.map((t,r)=>{if(zv(t))return Sua(t);this.properties={...this.properties,...Object.fromEntries(Object.entries(t.properties??{}).map(([i,n])=>[i,new G0({input:n,context:this.context,accessPath:this.accessPath,pathId:["allOf",r.toString(),"properties",i],seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})]))}}).filter(No))),this.description=this.input.description}convertProperties(){if(this.properties!=null)return Eua(this.properties,this.requiredProperties)}convertExtraProperties(){return this.extraProperties==null?void 0:typeof this.extraProperties=="string"?[{type:"map",keyShape:{type:"alias",value:{type:"primitive",value:{type:"string",format:void 0,regex:void 0,minLength:void 0,maxLength:void 0,default:void 0}}},valueShape:{type:"alias",value:{type:"unknown",displayName:this.extraProperties}}}]:RP(this.extraProperties.convert())?.map(r=>({type:"map",keyShape:{type:"alias",value:{type:"primitive",value:{type:"string",format:void 0,regex:void 0,minLength:void 0,maxLength:void 0,default:void 0}}},valueShape:r})).filter(No)}convert(){let t=this.convertProperties();if(t==null)return;let r=this.convertExtraProperties();return t.flatMap(i=>AOu(r).map(n=>(this.extends==null||this.extends.length===0)&&i.length===0&&n!=null?{type:"alias",value:n}:{type:"object",extends:this.extends.map(a=>Ys.TypeId(a)),properties:i,extraProperties:n}))}example({includeOptionals:t}){let r={...this.properties};return this.input.allOf?.forEach(i=>{let n=nC(i,this.context.document);n!=null&&(r={...r,...Object.fromEntries(Object.entries(n.properties??{}).map(([a,o])=>[a,new G0({input:o,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})]))})}),this.input.example??this.input.examples?.[0]??(!t&&this.requiredProperties!=null&&this.requiredProperties.length>0?this.requiredProperties?.reduce((i,n)=>{let a=r?.[n];return i[n]=a?.example({includeOptionals:t,override:n}),i},{}):Object.entries(r).reduce((i,[n,a])=>(i[n]=a?.example({includeOptionals:t,override:n}),i),{}))}};var mOu=class extends K${isNullable;discriminated;discriminant;discriminatedMapping;undiscriminatedMapping;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.safeParse()}parse(){if(this.input.oneOf!=null||this.input.anyOf!=null)if(this.isNullable=(this.input.oneOf??this.input.anyOf)?.some(t=>nC(t,this.context.document)?.type==="null"),this.input.discriminator==null)this.discriminated=!1,this.undiscriminatedMapping=(this.input.oneOf??this.input.anyOf)?.map(t=>nC(t,this.context.document)?.type!=="null"?new G0({input:t,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName}):void 0).filter(No);else{let t=this.input.discriminator.mapping;if(t!=null){this.discriminated=!0,this.discriminant=this.input.discriminator.propertyName,this.discriminatedMapping={};let r=this.discriminatedMapping;Object.entries(t).map(([i,n])=>{let a=nC({$ref:n},this.context.document);if(a==null){this.context.errors.warning({message:`Expected schema reference. Received undefined reference: ${n}`,path:[...this.accessPath,"discriminator","mapping",i]});return}r[i]=new G0({input:a,context:this.context,accessPath:[...this.accessPath,"discriminator","mapping",i],pathId:i,seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})})}}}convert(){if(!this.discriminated&&this.undiscriminatedMapping?.length===1){let n=this.undiscriminatedMapping?.flatMap(a=>a.convert()).filter(No);return this.isNullable&&n!=null?n.map(yUi).filter(No):n}let t=0,r=this.discriminated&&this.discriminant!=null&&this.discriminatedMapping!=null?{type:"discriminatedUnion",discriminant:Ys.PropertyKey(this.discriminant),variants:Object.entries(this.discriminatedMapping).flatMap(([n,a])=>RP(a.convert())?.map(c=>{if(!(c==null||c.type!=="object"))return{discriminantValue:n,displayName:a.name??EYt(n),availability:a.availability?.convert(),description:a.description,...c}}).filter(No)).filter(No)}:this.undiscriminatedMapping!=null?{type:"undiscriminatedUnion",variants:this.undiscriminatedMapping.flatMap(n=>RP(n.convert())?.map(o=>{if(o==null)return;t+=1;let c=o.type==="object"?EYt(`${this.schemaName??"Variant"} ${t}`):void 0;return{displayName:n.name??(o.type==="alias"&&o.value.type==="id"?EYt(o.value.id):c),shape:o,description:n.description,availability:n.availability?.convert()}}).filter(No)).filter(No)}:void 0,i=this.isNullable?yUi(r):r;return i!=null?[i]:void 0}example(t){return this.input.example??this.input.examples?.[0]??this.undiscriminatedMapping?.[0]?.example(t)??Object.values(this.discriminatedMapping??{})[0]?.example(t)}};var POu=class extends iC{default;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){this.input.default!=null&&typeof this.input.default!="boolean"&&this.context.errors.warning({message:`Expected default value to be a boolean. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default}convert(){return{type:"alias",value:{type:"primitive",value:{type:"boolean",default:this.default}}}}example(){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:!1)}};var c$i=class extends iC{default;values=[];nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){if(this.input.enum!=null){let t=!0;this.values=this.input.enum.map((r,i)=>{if(t){if(zv(r)){let n=nC(r,this.context.document);r=typeof n=="string"?n:typeof n?.default=="string"?n?.default:typeof n?.example=="string"?n.example:void 0}if(typeof r!="string"){this.context.errors.error({message:`Expected enum values to be strings. Received ${r}`,path:[...this.accessPath,`enum[${i}]`]}),t=!1;return}return r}}).filter(No),this.values=Array.from(new Set(this.values))}this.default=this.input.default}convert(){return{type:"enum",values:this.values.map(t=>({value:t,description:void 0,availability:void 0})),default:this.default}}example(){return this.input.example??this.input.examples?.[0]??this.default??this.values[0]??(this.nullable?null:void 0)}};var YBh=ce(VS());function OfB(e){return Axc.includes(e)}var jOu=class extends iC{format;minimum;maximum;default;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){this.minimum=this.input.minimum,this.maximum=this.input.maximum,this.input.default!=null&&typeof this.input.default!="number"&&this.context.errors.warning({message:`Expected default value to be an integer. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default,this.input.format!=null&&(OfB(this.input.format)?this.format=this.input.format:this.context.errors.warning({message:`Expected format to be one of ${Axc.join(", ")}. Received ${this.input.format}`,path:this.accessPath}))}convert(){let t="integer";if(this.format!=null)switch(this.format){case"int64":t="long";break;case"int8":case"int16":case"int32":case"uint8":case"sf-integer":case void 0:t="integer";break;default:new YBh.UnreachableCaseError(this.format);break}return{type:"alias",value:{type:"primitive",value:{type:t,minimum:this.minimum,maximum:this.maximum,default:this.default}}}}example(){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:0)}};var wOu=class extends iC{displayName;shape;constructor(t){super(t),this.safeParse()}parse(){this.displayName=this.input.title}convert(){return yUi({type:"alias",value:{type:"unknown",displayName:this.displayName}})}example(){return null}};var XBh=ce(VS());function AfB(e){return Oxc.includes(e)}var EOu=class extends iC{format;minimum;maximum;default;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){this.minimum=this.input.minimum,this.maximum=this.input.maximum,this.input.default!=null&&typeof this.input.default!="number"&&this.context.errors.warning({message:`Expected default value to be a number. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default,this.input.format!=null&&(AfB(this.input.format)?this.format=this.input.format:this.context.errors.warning({message:`Expected format to be one of ${Oxc.join(", ")}. Received ${this.input.format}`,path:this.accessPath}))}convert(){let t="double";if(this.format!=null)switch(this.format){case"decimal":case"decimal128":case"double-int":case"double":case"float":case"sf-decimal":case void 0:t="double";break;default:new XBh.UnreachableCaseError(this.format);break}return{type:"alias",value:{type:"primitive",value:{type:t,minimum:this.minimum,maximum:this.maximum,default:this.default}}}}example(){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:0)}};var ZBh=ce(VS());function mfB(e){return mxc.includes(e)}var SOu=class extends iC{format;regex;default;minLength;maxLength;enum;mimeType;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}mapToFdrType(t){switch(t){case"base64url":case"binary":case"byte":case"sf-binary":return"base64";case"date-time":return"datetime";case"int64":return"bigInteger";case"date":return"date";case"uuid":return"uuid";case"char":case"commonmark":case"decimal":case"decimal128":case"duration":case"email":case"hostname":case"html":case"http-date":case"idn-email":case"idn-hostname":case"ipv4":case"ipv6":case"iri-reference":case"iri":case"json-pointer":case"media-range":case"password":case"regex":case"relative-json-pointer":case"sf-boolean":case"sf-string":case"sf-token":case"time":case"uri-reference":case"uri-template":case"uri":case void 0:return"string";default:return new ZBh.UnreachableCaseError(t),"string"}}parse(){this.regex=this.input.pattern,this.minLength=this.input.minLength,this.maxLength=this.input.maxLength,this.mimeType=this.input.contentMediaType,this.input.default!=null&&typeof this.input.default!="string"&&this.context.errors.warning({message:`Expected default value to be a string. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default,this.input.format!=null&&(mfB(this.input.format)?this.format=this.input.format:this.context.errors.warning({message:`Expected format to be one of ${mxc.join(", ")}. Received ${this.input.format}`,path:this.accessPath})),this.input.enum!=null&&(this.enum=new c$i({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"enum",nullable:this.nullable}))}convert(){if(this.enum!=null)return this.enum.convert();let t="string";return this.format!=null&&(t=this.mapToFdrType(this.format)),{type:"alias",value:{type:"primitive",value:t==="base64"?{type:t,mimeType:this.mimeType,default:this.default}:{type:t,format:t==="string"?this.format:void 0,regex:this.regex,minLength:this.minLength,maxLength:this.maxLength,default:this.default}}}}example({override:t}){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:t??"string")}};var kBh=ce(VS());var MOu=class extends iC{displayName;shape;constructor(t){super(t),this.safeParse()}parse(){(0,kBh.noop)()}convert(){return{type:"alias",value:{type:"unknown",displayName:void 0}}}example(){}};var hvn=class extends K${description;availability;schemaId;maybeEnumConverterNode;nullable;schemaName;constructor(t){super(t),this.nullable=t.nullable,this.schemaName=t.schemaName,this.description=t.description,this.availability=t.availability,this.safeParse()}parse(){this.schemaId=Sua(this.input);let t=nC(this.input,this.context.document);t?.enum!=null&&s$i(t)&&(this.maybeEnumConverterNode=new c$i({input:t,context:this.context,accessPath:this.accessPath,pathId:this.schemaId??"",nullable:this.nullable})),this.schemaId==null&&this.context.errors.error({message:`Unprocessable reference: ${this.input.$ref}`,path:this.accessPath})}convert(){if(this.schemaId!=null)return{type:"alias",value:{type:"id",id:Ys.TypeId(this.schemaId),default:this.maybeEnumConverterNode?.default!=null?{type:"enum",value:this.maybeEnumConverterNode.default}:void 0}}}example(t){let r=nC(this.input,this.context.document);if(r!=null)return new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:this.schemaId??"",seenSchemas:this.seenSchemas,nullable:this.nullable,schemaName:this.schemaName}).example(t)}};var G0=class e extends K${typeShapeNode;description;name;examples;availability;nullable;schemaName;constructor(t){super(t),this.nullable=t.nullable,this.schemaName=t.schemaName,this.safeParse()}parse(){if(this.description=this.input.description,this.availability=new FEe({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-availability"}),s$i(this.input)&&xBh(this.input)&&(this.nullable=this.input.nullable!=null?this.input.nullable:this.nullable),zv(this.input)){let t=Sua(this.input);if(t==null){this.context.errors.error({message:"Reference object does not have a valid schema ID",path:this.accessPath});return}if(this.seenSchemas.has(t)){this.context.errors.warning({message:"Circular or deeply nested schema found, terminating",path:this.accessPath});return}this.seenSchemas.add(t),this.typeShapeNode=new hvn({input:this.input,context:this.context,accessPath:this.accessPath,pathId:t,seenSchemas:this.seenSchemas,nullable:this.nullable,schemaName:this.schemaName,description:this.description,availability:this.availability})}else if(this.name=this.input.title,this.examples=this.input.example,this.input.const!=null)this.typeShapeNode=new gOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});else if(HBh(this.input))this.typeShapeNode=new OOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName});else if(s$i(this.input)&&(this.input.oneOf!=null||this.input.anyOf!=null))this.typeShapeNode=new mOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName});else if(Exc(this.input)&&this.input.allOf!=null)this.typeShapeNode=new Mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName});else if(s$i(this.input)&&this.input.enum!=null)this.typeShapeNode=new c$i({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable});else if(typeof this.input.type=="string"||Array.isArray(this.input.type)&&this.input.type.length===1){if(this.input.type=Array.isArray(this.input.type)?this.input.type[0]:this.input.type,!Array.isArray(this.input.type))switch(this.input.type){case"object":Exc(this.input)&&(this.typeShapeNode=new Mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName}));break;case"array":u$i(this.input)&&(this.typeShapeNode=new vOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName}));break;case"boolean":WBh(this.input)&&(this.typeShapeNode=new POu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"integer":GBh(this.input)&&(this.typeShapeNode=new jOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"number":JBh(this.input)&&(this.typeShapeNode=new EOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"string":$Bh(this.input)&&(this.typeShapeNode=new SOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"null":KBh(this.input)&&(this.typeShapeNode=new wOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}));break;case void 0:break;default:new eIh.UnreachableCaseError(this.input.type);break}}else if(Array.isArray(this.input.type)&&this.input.type.includes("null")&&this.input.type.length===2){let t=this.input.type.filter(r=>r!=="null")[0];t!=="array"&&(this.typeShapeNode=new e({input:{...this.input,type:t},context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:!0,schemaName:this.schemaName}))}else this.input.properties!=null&&(this.typeShapeNode=new Mua({input:{...this.input,type:"object"},context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName}));this.typeShapeNode==null&&(this.typeShapeNode=new MOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),!zv(this.input)&&(!u$i(this.input)&&this.input==null||u$i(this.input)&&this.input.items==null)&&this.context.errors.error({message:"Expected type declaration. Received: null",path:this.accessPath}))}convert(){let t=this.typeShapeNode?.convert();if(t==null)return;let r=RP(t)?.map(i=>this.nullable?yUi(i):i).filter(No);return Array.isArray(t)&&t.length>1?r:r?.[0]}example(t){return this.availability?.availability!=="deprecated"?this.typeShapeNode?.example(t):void 0}};function l$i(e){if(e!=null)return Eua(e,Object.entries(e??{}).map(([t,r])=>r.required?t:void 0).filter(No))}var MYt=class extends iC{availability;required;schema;description;inputExample;constructor(t){super(t),this.safeParse(t.parameterName)}parse(t){this.description=this.input.description;let r;zv(this.input)?r=this.input:this.input.schema!=null?(r=this.input.schema,this.required=this.input.required):(r={type:"string"},this.required=!1),this.availability=new FEe({input:r,context:this.context,accessPath:this.accessPath,pathId:"availability"}),this.schema=new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:"schema",seenSchemas:new Set,nullable:void 0,schemaName:t});let i=LBh(this.input,this.context.document);this.inputExample=i?.example??Object.values(i?.examples??{})[0]}convert(){return this.schema?.convert()}example(t){return this.inputExample??this.schema?.example(t)}};function tIh(e,t){return zv(e)?iL(e,t,void 0):e}var Sxc=ce(VS());function DOu(e){let{uniqueId:t,type:r,contextTypes:i,description:n,availability:a}=e;i[Ys.TypeId(t)]={name:t,shape:r,description:n,availability:a}}var rIh=ce(IZs(),1),Dua=class e{type;subtype;essence;parameters;mimeType;input;constructor(t,r,i,n,a,o){this.type=t,this.subtype=r,this.essence=i,this.parameters=n,this.mimeType=a,this.input=o}static APPLICATION_JSON="application/json";static APPLICATION_OCTET_STREAM="application/octet-stream";static MULTIPART_FORM_DATA="multipart/form-data";static parse(t){if(t==null)return null;let r=rIh.default.parse(t);return r==null?null:new e(r.type,r.subtype,r.essence,r.parameters,r,t)}toString(){return this.input}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.subtype==="csv"}isMarkdown(){return this.isText()&&this.subtype==="markdown"}isPlainText(){return this.isText()&&this.subtype==="plain"}isEventStream(){return this.isText()&&this.subtype==="event-stream"}isMultiPartFormData(){return this.isMultipart()&&this.subtype==="form-data"}isJSON(){return this.isApplication()&&this.subtype==="json"}containsJSON(){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"}isGzip(){return this.isApplication()&&this.subtype==="gzip"}isTar(){return this.isApplication()&&this.subtype==="tar"}isBrotli(){return this.isApplication()&&this.subtype==="br"}isDeflate(){return this.isApplication()&&this.subtype==="deflate"}isProtobuf(){return this.isApplication()&&this.subtype==="protobuf"}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"}isGIF(){return this.isImage()&&this.subtype==="gif"}isMPEG(){return this.isAudio()&&this.subtype==="mpeg"}isWAV(){return this.isAudio()&&this.subtype==="wav"}isHTML(){return this.mimeType.isHTML()}isXML(){return this.mimeType.isXML()}isJavaScript(){return this.mimeType.isJavaScript()}};function PfB(e){return typeof e.securitySchemes=="object"&&e.securitySchemes!=null}var BOu=class extends po{typeSchemas;securitySchemes;constructor(t){super(t),this.safeParse()}parse(){this.input.schemas!=null&&(this.typeSchemas=Object.fromEntries(Object.entries(this.input.schemas).map(([t,r])=>[t,new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:t,seenSchemas:new Set,nullable:void 0,schemaName:t})]))),PfB(this.input)&&this.input.securitySchemes!=null&&(this.securitySchemes=Object.fromEntries(Object.entries(this.input.securitySchemes??{}).map(([t,r],i)=>{let n;if(zv(r)?n=Ugu(r.$ref,this.context.document):n=r,n!=null)return[t,new jua({input:n,context:this.context,accessPath:this.accessPath,pathId:["securitySchemes",`${i}`]})]}).filter(No)))}convert(){return{auths:this.securitySchemes!=null?Object.fromEntries(Object.entries(this.securitySchemes??{}).map(([t,r])=>{let i=r.convert();if(i!=null)return[Ys.api.latest.AuthSchemeId(t),i]}).filter(No)):void 0,types:this.typeSchemas!=null?Object.fromEntries(Object.entries(this.typeSchemas).map(([t,r])=>{let i=r.name??t,n=RP(r.convert());return n==null?[t,void 0]:[Ys.TypeId(t),{name:i,shape:n[0],description:r.description,availability:void 0}]}).filter(([t,r])=>No(r))):void 0}}};var IOu=class extends G0{multipartType;contentType;constructor(t){super(t),this.safeParse()}parse(){super.parse();let t=nC(this.input,this.context.document);if(t==null){this.context.errors.error({message:`Expected multipart form data property definition. ${zv(this.input)?`Received undefined reference: ${this.input.$ref}`:""}`,path:this.accessPath});return}if(t.type==="string"&&t.format==="binary")this.multipartType="file",this.contentType=t.contentMediaType;else if(t.type==="array"){let r=nC(t.items,this.context.document);r?.type==="string"&&r?.format==="binary"?(this.multipartType="files",this.contentType=r?.contentMediaType):(this.context.errors.warning({message:"Expected multipart form data files definition with array type with internal string type and binary format.",path:this.accessPath}),this.multipartType=void 0,this.contentType=void 0)}else this.multipartType="property",this.contentType=t.contentMediaType}};var COu=class extends po{description;method;path;schema;isOptional;contentType;availability;requiredFields;fields;examples;constructor(t){super(t),this.method=t.method,this.path=t.path,this.safeParse(t)}parse({contentType:t}){if(this.input.schema!=null){let i=nC(this.input.schema,this.context.document);this.availability=new FEe({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"availability"}),this.schema=zv(this.input.schema)?new hvn({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"schema",seenSchemas:new Set,nullable:!1,schemaName:"Request Body",description:this.input.schema.description,availability:this.availability}):void 0;let n=Dua.parse(t);n?.containsJSON()?(this.contentType="json",this.schema=this.schema??new G0({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"schema",seenSchemas:new Set,nullable:void 0,schemaName:"Request Body"})):n?.isOctetStream()?(this.contentType="bytes",this.isOptional=i?.required==null):n?.isMultiPartFormData()?(this.contentType="form-data",this.requiredFields=i?.required,this.fields=Object.fromEntries(Object.entries(i?.properties??{}).map(([a,o])=>{if(o!=null)return[a,new IOu({input:o,context:this.context,accessPath:this.accessPath,pathId:`schema.${a}`,seenSchemas:new Set,nullable:void 0,schemaName:a})]}).filter(No))):this.context.errors.warning({message:`Expected request body of reference or object with json, streaming or form-data content types. Received: ${t}`,path:this.accessPath})}let r=this.schema?.example({includeOptionals:!0,override:void 0});this.examples={...this.input.example!=null?{[aF]:{value:this.input.example}}:{},...this.input.examples},r!=null&&Object.keys(this.examples).length===0&&(this.examples={[aF]:{value:r}})}convertJsonLike(){let t=this.schema?.convert();return t==null?void 0:RP(t)?.map(i=>{let n=i.type;switch(n){case"object":case"alias":return i;case"enum":case"undiscriminatedUnion":case"discriminatedUnion":{let a=a8t([this.method,this.path,this.contentType,"request"].join("_"));return DOu({uniqueId:a,type:i,contextTypes:this.context.generatedTypes,description:this.schema?.description,availability:this.schema?.availability?.convert()}),{type:"alias",value:{type:"id",id:Ys.TypeId(a),default:i.type==="enum"&&i.default!=null?{type:"enum",value:i.default}:void 0}}}case void 0:return;default:new Sxc.UnreachableCaseError(n);return}}).filter(No)}convert(){if(this.schema instanceof hvn)return this.schema.convert();switch(this.contentType){case"json":return this.convertJsonLike();case"bytes":return{type:"bytes",isOptional:this.isOptional??!1,contentType:this.contentType};case"form-data":return Object.entries(this.fields??{}).map(([i,n])=>{switch(n.multipartType){case"file":return[{type:n.multipartType,key:Ys.PropertyKey(i),isOptional:this.requiredFields?.includes(i)==null,contentType:n.contentType,description:n.description,availability:n.availability?.convert()}];case"files":return[{type:n.multipartType,key:Ys.PropertyKey(i),isOptional:this.requiredFields?.includes(i)==null,contentType:n.contentType,description:n.description,availability:n.availability?.convert()}];case"property":{let a=RP(n.convert()),o=n.multipartType;return a?.map(c=>({type:o,key:Ys.PropertyKey(i),contentType:n.contentType,exploded:void 0,valueShape:c,description:n.description,availability:n.availability?.convert()}))}case void 0:return[];default:return new Sxc.UnreachableCaseError(n.multipartType),[]}}).filter(No).reduce((i,n)=>i.flatMap(a=>n.length>0?n.map(o=>[...a,o]):[[...a]]),[[]]).map(i=>({type:"formData",fields:i,availability:this.availability?.convert(),description:this.description}));case void 0:return this.convertJsonLike();default:return}}};var qOu=class extends po{description;requestBodiesByContentType;constructor(t){super(t),this.safeParse(t)}parse({method:t,path:r}){let i=tIh(this.input,this.context.document);if(i==null){this.context.errors.error({message:"Expected request body. Received: null",path:this.accessPath});return}Object.entries(i.content).forEach(([n,a])=>{this.requestBodiesByContentType??={},this.requestBodiesByContentType[n]=new COu({input:a,context:this.context,accessPath:this.accessPath,pathId:"content",contentType:n,method:t,path:r})})}convert(){return Object.entries(this.requestBodiesByContentType??{}).flatMap(([t,r])=>RP(r.convert())?.map(n=>({description:this.description,contentType:t,body:n}))).filter(No)}convertToWebhookPayload(){return Object.values(this.requestBodiesByContentType??{}).flatMap(t=>RP(t.convert())?.map(i=>{if(!(i.type!=="alias"&&i.type!=="object"))return{description:this.description,shape:i}})).filter(No)}webhookExample(){return{payload:this.requestBodiesByContentType?.["application/json"]?.schema?.example({includeOptionals:!0,override:void 0})}}};var iIh={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};function nIh(e,t){if(zv(e)){let r=iL(e,t,void 0);return r==null?void 0:{...r,...e}}return e}var TOu=ce(VS());var aIh="application/json";var oIh="application/octet-stream";function uIh(e,t){return e===t||t===aF||e===aF}var jKa=class extends po{streamingFormat;path;method;statusCode;requests;shapes;schema;contentType;unsupportedContentType;contentSubtype;examples;empty;constructor(t,r,i,n,a,o,c,d){super(t),this.streamingFormat=i,this.path=n,this.method=a,this.statusCode=o,this.requests=c,this.shapes=d,this.safeParse(r)}matchRequestResponseExamplesByName(t,r,i){for(let n of t)for(let[a,o]of Object.entries(n?.examples??{}))for(let[c,d]of Object.entries(r))for(let s of d)uIh(c,a)&&(i.add(c),this.examples?.push(new SYt({input:{requestExample:o,responseExample:s},context:this.context,accessPath:this.accessPath,pathId:a!=null&&a!==""?["examples",a]:"examples"},this.path,this.statusCode,a$i(a,c),{requestBody:n,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}matchExamplesByIndex(t,r){let i=0;for(let n of t){let a=0;for(let[o,c]of r){if(a===i){let[d,s,u]=n??[void 0,void 0,void 0];this.examples?.push(...c.map(f=>new SYt({input:{requestExample:u,responseExample:f},context:this.context,accessPath:this.accessPath,pathId:s!=null&&s!==""?["examples",s]:"examples"},this.path,this.statusCode,a$i(s,o),{requestBody:d,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}a++}i++}if(t.length>r.length)for(let n of t.slice(r.length)){let[a,o]=r[r.length-1]??[void 0,void 0],[c,d,s]=n??[void 0,void 0,void 0];this.examples?.push(...(o??[void 0]).map(u=>new SYt({input:{requestExample:s,responseExample:u},context:this.context,accessPath:this.accessPath,pathId:d!=null&&d!==""?["examples",d]:"examples"},this.path,this.statusCode,a$i(d,a),{requestBody:c,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}if(r.length>t.length){let[n,a,o]=t[t.length-1]??[void 0,void 0,void 0];for(let[c,d]of r.slice(t.length))this.examples?.push(...d.map(s=>new SYt({input:{requestExample:o,responseExample:s},context:this.context,accessPath:this.accessPath,pathId:a!=null&&a!==""?["examples",a]:"examples"},this.path,this.statusCode,a$i(a,c),{requestBody:n,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}}pushResponseExample(t,r,i,n){let a=t[aF];if(a!=null)for(let o of a)this.examples?.push(new SYt({input:{requestExample:n,responseExample:o},context:this.context,accessPath:this.accessPath,pathId:i!=null&&i!==""?["examples",i]:"examples"},this.path,this.statusCode,a$i(i,void 0),{requestBody:r,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders}))}addGlobalFallbackExample(t,r){if(t==null||t.length===0)this.pushResponseExample(r,void 0,void 0,void 0);else for(let i of t)if(Object.keys(i.examples??{}).length===0)this.pushResponseExample(r,i,void 0,void 0);else for(let[n,a]of Object.entries(i.examples??{}))this.pushResponseExample(r,i,n,a)}parse(t){if(t==="empty")this.empty=!0;else{let c=Dua.parse(t);if(c?.isJSON()||c?.isEventStream())this.contentType=aIh,this.input.schema==null?(this.streamingFormat==null||this.streamingFormat==="json")&&this.context.errors.error({message:"Expected schema for JSON response body. Received null",path:this.accessPath}):this.schema=new G0({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"type",seenSchemas:new Set,nullable:void 0,schemaName:"Response Body"});else if(c?.isOctetStream())this.contentType=oIh,this.contentSubtype=nC(this.input.schema,this.context.document)?.contentMediaType;else if(this.unsupportedContentType=t,this.input.schema==null){this.context.errors.error({message:"Expected schema for plain text response body. Received null",path:this.accessPath});return}else this.schema=new G0({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:new Set,nullable:void 0,schemaName:"Response Body"})}let r={};this.input.examples!=null&&(r=oOu(this.input.examples,c=>[c])),this.input.example!=null&&Object.keys(r).length===0&&(r[aF]??=[],r[aF]=[{value:this.input.example}]);let i=nC(this.input.schema,this.context.document);if(i!=null&&(i.examples!=null&&Object.keys(r).length===0&&(r=oOu(i.examples,c=>[c])),i.example!=null&&Object.keys(r).length===0&&(r[aF]??=[],r[aF]?.push({value:i.example}))),Object.keys(r).length===0){let c=this.schema?.example({includeOptionals:!0,override:void 0});r[aF]??=[],r[aF]?.push(c!=null?{value:c}:void 0)}this.examples??=[];let n=new Set;this.matchRequestResponseExamplesByName(this.requests,r,n);let a=[];for(let c of this.requests)a.push(...Object.entries(c.examples??{}).filter(([d])=>!n.has(d)&&d!==aF).map(([d,s])=>[c,d,s]));let o=Object.entries(r).filter(([c,d])=>!n.has(c)&&No(d)&&c!==aF);Object.keys(r).every(c=>c===aF)||this.matchExamplesByIndex(a,o),!n.has(aF)&&this.examples.length===0&&this.addGlobalFallbackExample(this.requests,r),this.examples.length===0&&(this.examples=void 0)}convertStreamingFormat(){switch(this.streamingFormat){case"json":return RP(this.schema?.convert())?.map(r=>({type:"stream",terminator:"[DATA]",shape:r}));case"sse":return{type:"streamingText"};case void 0:return;default:new TOu.UnreachableCaseError(this.streamingFormat);return}}convertJsonLike(){return RP(this.schema?.convert())?.map(r=>{let i=r.type;switch(i){case"alias":return r;case"discriminatedUnion":case"undiscriminatedUnion":case"enum":{let n=a8t([this.method,this.path,this.statusCode,"response"].join("_"));return DOu({uniqueId:n,type:r,contextTypes:this.context.generatedTypes,description:this.schema?.description,availability:this.schema?.availability?.convert()}),{type:"alias",value:{type:"id",id:Ys.TypeId(n),default:r.type==="enum"&&r.default!=null?{type:"enum",value:r.default}:void 0}}}case"object":return r;default:new TOu.UnreachableCaseError(i);return}}).filter(No)}convert(){if(this.empty)return{type:"empty"};if(this.contentType!=null)switch(this.contentType){case"application/json":return this.streamingFormat==null?this.convertJsonLike():this.convertStreamingFormat();case"application/octet-stream":return{type:"fileDownload",contentType:this.contentSubtype};case"text/event-stream":return this.convertStreamingFormat();case void 0:return;default:new TOu.UnreachableCaseError(this.contentType);return}else return this.unsupportedContentType!=null?this.convertJsonLike():void 0}};var wKa=class extends po{path;method;statusCode;requests;shapes;headers;responses;description;constructor(t,r,i,n,a,o){super(t),this.path=r,this.method=i,this.statusCode=n,this.requests=a,this.shapes=o,this.safeParse()}parse(t){this.description=this.input.description;let r=nIh(this.input,this.context.document);if(r==null){this.context.errors.error({message:zv(this.input)?`Undefined reference: ${this.input.$ref}`:"Expected response, received null",path:this.accessPath});return}Object.entries(r.headers??{}).forEach(([i,n])=>{this.headers??={},this.headers[i]=new MYt({input:n,context:this.context,accessPath:this.accessPath,pathId:"headers",parameterName:i})}),r.content==null?(this.responses??=[],this.responses.push(new jKa({input:{},context:this.context,accessPath:this.accessPath,pathId:["content"]},"empty",t,this.path,this.method,this.statusCode,this.requests,this.shapes))):Object.entries(r.content??{}).forEach(([i,n])=>{this.responses??=[],this.responses.push(new jKa({input:n,context:this.context,accessPath:this.accessPath,pathId:["content",i]},i,t,this.path,this.method,this.statusCode,this.requests,this.shapes))})}convert(){return this.responses?.flatMap(t=>t.convert()).filter(No)}};var ROu=class extends po{path;method;requests;shapes;responsesByStatusCode;errorsByStatusCode;constructor(t,r,i,n,a){super(t),this.path=r,this.method=i,this.requests=n,this.shapes=a,this.safeParse()}parse(){let t=this.input.default;Object.entries(this.input).forEach(([r,i])=>{r!=="default"&&(parseInt(r)>=400?(this.errorsByStatusCode??={},this.errorsByStatusCode[r]=new wKa({input:{...t,...i},context:this.context,accessPath:this.accessPath,pathId:"errors"},this.path,this.method,parseInt(r),[],this.shapes)):(this.responsesByStatusCode??={},this.responsesByStatusCode[r]=new wKa({input:i,context:this.context,accessPath:this.accessPath,pathId:"responses"},this.path,this.method,parseInt(r),this.requests,this.shapes)))})}convertResponseObjectToHttpResponses(){return Object.entries(this.responsesByStatusCode??{}).flatMap(([t,r])=>{let i=r.convert();if(i!=null)return AOu(l$i(r.headers)).flatMap(n=>i?.map(a=>({headers:n,response:{statusCode:parseInt(t),body:a,description:r.description},examples:(r.responses??[]).flatMap(o=>(o.examples??[]).map(c=>c.convert()).filter(No))})))}).filter(No)}convertResponseObjectToErrors(){return Object.entries(this.errorsByStatusCode??{}).flatMap(([t,r])=>r.responses?.flatMap(i=>{let n=i.schema,a=RP(n?.convert());if(n!=null)return a?.map(o=>({statusCode:parseInt(t),shape:o,description:r.description??n.description,availability:n.availability?.convert(),name:n.name??iIh[parseInt(t)]??"UNKNOWN ERROR",examples:i.examples?.map(c=>{let d=c.convert();if(d!=null&&d.responseBody?.type==="json")return{name:d.name,description:d.description,responseBody:d.responseBody}}).filter(No)})).filter(No)})).filter(No)}convert(){return{responses:this.convertResponseObjectToHttpResponses(),errors:this.convertResponseObjectToErrors()}}};var f$i=class extends po{servers;globalAuth;path;method;basePath;isWebhook;endpointIds;description;displayName;operationId;pathParameters;queryParameters;requestHeaders;requests;responses;availability;auth;namespaces;xFernExamplesNode;redocExamplesNode;emptyResponseExamples;constructor(t){super(t),this.servers=t.servers,this.globalAuth=t.globalAuth,this.path=t.path,this.method=t.method,this.basePath=t.basePath,this.isWebhook=t.isWebhook,this.safeParse()}pushEmptyResponseExample(t,r,i){this.emptyResponseExamples??=[],this.emptyResponseExamples.push(new SYt({input:{requestExample:t,responseExample:void 0},context:this.context,accessPath:this.accessPath,pathId:"examples"},this.path,200,a$i(i,void 0),{requestBody:r,pathParameters:this.pathParameters,queryParameters:this.queryParameters,requestHeaders:this.requestHeaders}))}parse(){if(this.isWebhook&&this.method!=="POST"&&this.method!=="GET"){this.context.errors.error({message:`Webhook method must be POST or GET. Received: ${this.method}`,path:this.accessPath});return}this.description=this.input.description,this.displayName=this.input.summary,this.operationId=this.input.operationId,this.availability=new FEe({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-availability"}),this.servers=i$i(this.servers,this.input.servers,this.context,this.accessPath),this.isWebhook=new yOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}).isWebhook||this.isWebhook,this.input.parameters?.map((i,n)=>{if(zv(i)){let a=fOu(i,this.context.document);if(a!=null)i=a;else{this.context.errors.warning({message:`Expected parameter reference to resolve to an object. Received undefined reference: ${i.$ref}`,path:[...this.accessPath,`parameters[${n}]`]});return}}i.in==="path"?i.schema!=null&&(this.pathParameters??={},this.pathParameters[i.name]=new MYt({input:i,context:this.context,accessPath:this.accessPath,pathId:["parameters",`${n}`],parameterName:i.name})):i.in==="query"?i.schema!=null&&(this.queryParameters??={},this.queryParameters[i.name]=new MYt({input:i,context:this.context,accessPath:this.accessPath,pathId:["parameters",`${n}`],parameterName:i.name})):i.in==="header"&&i.schema!=null&&(this.requestHeaders??={},this.requestHeaders[i.name]=new MYt({input:i,context:this.context,accessPath:this.accessPath,pathId:["parameters",`${n}`],parameterName:i.name}))});for(let i of this.extractPathParameterIds()??[])this.pathParameters?.[i]==null&&this.context.errors.warning({message:`Path parameter not defined: ${i}`,path:[...this.accessPath,"parameters"]});if(this.redocExamplesNode=new bOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-code-samples"}),this.requests=this.input.requestBody!=null?new qOu({input:this.input.requestBody,context:this.context,accessPath:this.accessPath,pathId:"requestBody",method:this.method,path:this.path}):void 0,this.responses=this.input.responses!=null?new ROu({input:this.input.responses,context:this.context,accessPath:this.accessPath,pathId:"responses"},this.path,this.method,Object.values(this.requests?.requestBodiesByContentType??{}),{pathParameters:this.pathParameters,queryParameters:this.queryParameters,requestHeaders:this.requestHeaders}):void 0,this.responses==null){let i=this.requests?.requestBodiesByContentType;i==null||Object.keys(i).length===0?this.pushEmptyResponseExample(void 0,void 0,void 0):Object.values(i).forEach(n=>{if(Object.keys(n.examples??{}).length===0){let a=n.schema?.example({includeOptionals:!1,override:void 0});a!=null&&this.pushEmptyResponseExample({value:a},n,void 0)}else Object.entries(n.examples??{}).forEach(([a,o])=>{this.pushEmptyResponseExample(o,n,a)})})}let t=200;this.responses?.responsesByStatusCode!=null&&(t=Number(Object.keys(this.responses.responsesByStatusCode)?.filter(i=>Number(i)>=200&&Number(i)<300)[0])),this.globalAuth!=null&&(this.auth=this.globalAuth),this.input.security!=null&&(this.auth=new wua({input:this.input.security,context:this.context,accessPath:this.accessPath,pathId:"security"})),this.namespaces=[new PKa({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-group-name"})],this.namespaces?.every(i=>i.groupName==null)&&this.input.tags!=null&&(this.namespaces=this.input.tags.slice(0,1).map((i,n)=>new PKa({input:{[Ngu]:i},context:this.context,accessPath:this.accessPath,pathId:["tags",`${n}`]})));let r=new hOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-sdk-method-name"});this.endpointIds=this.namespaces.map(i=>uOu({namespace:RP(i?.groupName),path:this.path,method:this.method,sdkMethodName:r.sdkMethodName,operationId:this.input.operationId,displayName:this.displayName,isWebhook:this.isWebhook})).filter(No),this.xFernExamplesNode=new _Ou({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-examples"},this.path,t,this.requests?.requestBodiesByContentType,this.responses?.responsesByStatusCode?.[t]?.responses)}extractPathParameterIds(){if(this.path!=null)return this.path.split("/").map(t=>{if(t.startsWith("{")&&t.endsWith("}"))return t.slice(1,-1).trim()}).filter(No)}convertPathToPathParts(){if(this.path===void 0)return;let t=this.path.startsWith("/")?this.path.slice(1):this.path,r=this.basePath?.convert();return(r?[r,...t.split("/")]:t.split("/")).reduce((n,a)=>(n.push({type:"literal",value:"/"}),a.startsWith("{")&&a.endsWith("}")?n.push({type:"pathParameter",value:Ys.PropertyKey(a.slice(1,-1).trim())}):n.push({type:"literal",value:a}),n),[])}convert(){if(this.path==null||this.endpointIds==null)return;let{responses:t,errors:r}=this.responses?.convert()??{responses:void 0,errors:void 0},i=this.emptyResponseExamples?.map(u=>u.convert()).filter(No),n=qBh(this.xFernExamplesNode?.convert(),[...i??[],...t?.flatMap(u=>u.examples)??[]])?.map(u=>({...u,snippets:CBh(u.snippets,this.redocExamplesNode?.convert())}));if(this.isWebhook)return this.endpointIds.map((u,f)=>{if(!(this.method!=="POST"&&this.method!=="GET"))return{id:Ys.WebhookId(u),description:this.description,availability:this.availability?.convert(),displayName:this.displayName,operationId:this.operationId,namespace:this.namespaces?.[f]?.convert(),method:this.method,path:this.convertPathToPathParts()?.map(p=>p.value.toString())??[],queryParameters:l$i(this.queryParameters)?.flat(),headers:l$i(this.requestHeaders)?.flat(),payloads:this.requests?.convertToWebhookPayload(),examples:[this.requests?.webhookExample()].filter(No)}}).filter(No);let a=this.servers?.map(u=>u.convert()).filter(No),o=this.convertPathToPathParts();if(o==null)return;let c,d=this.auth?.convert();d!=null&&(c=Object.keys(d));let s=t?.flatMap(u=>u.headers).filter(No);return this.endpointIds.map((u,f)=>({id:Ys.EndpointId(u),description:this.description,availability:this.availability?.convert(),namespace:this.namespaces?.[f]?.convert()?.map(p=>Ys.api.v1.SubpackageId(p)),displayName:this.displayName,operationId:this.operationId,method:this.method,path:o,auth:c?.map(p=>Ys.api.latest.AuthSchemeId(p)),defaultEnvironment:a?.[0]?.id,environments:a,pathParameters:l$i(this.pathParameters)?.flat(),queryParameters:l$i(this.queryParameters)?.flat(),requestHeaders:l$i(this.requestHeaders)?.flat(),responseHeaders:s!=null&&s.length>0?s:void 0,requests:this.requests?.convert(),responses:t?.map(p=>p.response),errors:r,examples:n,snippetTemplates:void 0,protocol:{type:"rest"}}))}};var Bua=class extends po{description;get;post;put;patch;delete;path;constructor(t){super(t),this.safeParse(t)}parse({servers:t,globalAuth:r,basePath:i,isWebhook:n}){this.description=this.input.description;let a=i$i(t,this.input.servers,this.context,this.accessPath),o=Array.isArray(this.pathId)?this.pathId.join("/"):this.pathId;this.input.get!=null&&(this.get=new f$i({input:this.input.get,context:this.context,accessPath:this.accessPath,pathId:"get",servers:a,globalAuth:r,path:o,method:"GET",basePath:i,isWebhook:n})),this.input.post!=null&&(this.post=new f$i({input:this.input.post,context:this.context,accessPath:this.accessPath,pathId:"post",servers:a,globalAuth:r,path:o,method:"POST",basePath:i,isWebhook:n})),this.input.put!=null&&(this.put=new f$i({input:this.input.put,context:this.context,accessPath:this.accessPath,pathId:"put",servers:a,globalAuth:r,path:o,method:"PUT",basePath:i,isWebhook:!1})),this.input.patch!=null&&(this.patch=new f$i({input:this.input.patch,context:this.context,accessPath:this.accessPath,pathId:"patch",servers:a,globalAuth:r,path:o,method:"PATCH",basePath:i,isWebhook:!1})),this.input.delete!=null&&(this.delete=new f$i({input:this.input.delete,context:this.context,accessPath:this.accessPath,pathId:"delete",servers:a,globalAuth:r,path:o,method:"DELETE",basePath:i,isWebhook:!1}))}convert(){return[...this.get?.convert()??[],...this.post?.convert()??[],...this.put?.convert()??[],...this.patch?.convert()??[],...this.delete?.convert()??[]].filter(No)}};function zOu(e){return"payloads"in e}var NOu=class extends po{paths;constructor(t){super(t),this.safeParse(t)}parse({servers:t,globalAuth:r,basePath:i}){this.paths=Object.entries(this.input).map(([n,a])=>{if(a!=null)return new Bua({input:a,context:this.context,accessPath:this.accessPath,pathId:n,servers:i$i(t,a.servers,this.context,this.accessPath),globalAuth:r,basePath:i,isWebhook:void 0})}).filter(No)}convert(){if(this.paths==null)return;let t={},r={};return this.paths.forEach(i=>{let n=i.convert();n?.forEach(a=>{zOu(a)?r[Ys.WebhookId(a.id)]=a:t[Ys.EndpointId(a.id)]=a})}),{endpoints:t,webhookEndpoints:r}}};var FOu=class extends po{globalHeaders;requiredProperties;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[EDh]?.map(r=>{let{header:i,...n}=r;return(n.optional!=null&&!n.optional||fOu(n,this.context.document)?.required)&&(this.requiredProperties??=[],this.requiredProperties?.push(i)),[i,new MYt({input:n,context:this.context,accessPath:this.accessPath,pathId:this.pathId,parameterName:i})]});t!=null&&(this.globalHeaders=Object.fromEntries(t))}convert(){return Eua(this.globalHeaders,this.requiredProperties)?.flat()}};function sIh(e,t){if(zv(e)){let r=iL(e,t,void 0);return r==null?void 0:{...r,...e}}return e}var QOu=class extends po{webhooks;constructor(t){super(t),this.safeParse(t)}parse({servers:t,globalAuth:r,basePath:i}){this.webhooks=Object.entries(this.input??{}).map(([n,a])=>{let o=sIh(a,this.context.document);if(o!=null)return new Bua({input:o,context:this.context,accessPath:this.accessPath,pathId:n,servers:t,globalAuth:r,basePath:i,isWebhook:!0})}).filter(No)}convert(){return this.webhooks?.reduce((t,r)=>(r.convert()?.forEach(i=>{zOu(i)&&(t[Ys.WebhookId(i.id)]=i)}),t),{})}};var UOu=class extends po{paths;webhooks;components;auth;globalHeaders;constructor(t){super(t),this.safeParse()}parse(){let t=i$i(void 0,this.input.servers,this.context,this.accessPath);this.input.security!=null&&(this.auth=new wua({input:this.input.security,context:this.context,accessPath:this.accessPath,pathId:"security"}));let r=new lOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});this.input.paths==null&&this.input.webhooks==null&&this.context.errors.warning({message:"Expected 'paths' or 'webhooks' property to be specified",path:this.accessPath}),this.input.paths!=null&&(this.paths=new NOu({input:this.input.paths,context:this.context,accessPath:this.accessPath,pathId:"paths",basePath:r,servers:t,globalAuth:this.auth})),this.input.webhooks!=null&&(this.webhooks=new QOu({input:this.input.webhooks,context:this.context,accessPath:this.accessPath,pathId:"webhooks",basePath:r,servers:t,globalAuth:this.auth})),this.input.components!=null&&(this.components=new BOu({input:this.input.components,context:this.context,accessPath:this.accessPath,pathId:"components"})),this.globalHeaders=new FOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-global-headers"})}convert(){let t=Hbe(),{webhookEndpoints:r,endpoints:i}=this.paths?.convert()??{},n={...this.webhooks?.convert()??{},...r??{}},a=mDh({endpoints:i,webhookEndpoints:n}),{types:o,auths:c}=this.components?.convert()??{};return{id:Ys.ApiDefinitionId(t),endpoints:i??{},websockets:{},webhooks:n,types:{...o,...this.context.generatedTypes},subpackages:a,auths:{...c,...this.auth?.convert()??{}},globalHeaders:this.globalHeaders?.convert(),snippetsConfiguration:void 0}}};async function Mxc(e,t){if(e instanceof SEe){t.logger.info("Skipping, API is specified as a Fern Definition.");return}else if(!(e instanceof ZE))return;let r=new K3t(e.absoluteFilePath),i=await DEe({context:t,specs:e.specs}),n=await r.loadDocuments({context:t,specs:i}),a;for(let o of n){if(o.type!=="openapi")continue;let c={document:o.value,logger:t.logger,errors:new Rgu,generatedTypes:{}},d=new UOu({input:o.value,context:c,accessPath:[],pathId:e.workspaceName??"openapi parser"});a=KZs(a,d.convert())}return a}var E4h=ce(Ixc(),1),S4h=ce(MAu(),1),Zmu=require("fs/promises"),M4h=ce(require("http"),1),D4h=ce(require("path"),1);var dRh=require("events"),qAu=ce(require("fs"),1),wvn=ce(require("path"),1);var JTh=ce(require("os"),1),$Th=300,v$i=20,JKa=1e7,YTh=JTh.default.platform();var HvB=YTh==="darwin",XKc=YTh==="win32",g$i=HvB||XKc,XTh=3e3,ZTh=2e4,ZKc=1250;var CYt;(function(e){e[e.DIR=1]="DIR",e[e.FILE=2]="FILE"})(CYt||(CYt={}));var jvn;(function(e){e.CHANGE="change",e.RENAME="rename"})(jvn||(jvn={}));var $Ka;(function(e){e.CHANGE="change",e.ERROR="error"})($Ka||($Ka={}));var Hl;(function(e){e.ADD="add",e.ADD_DIR="addDir",e.CHANGE="change",e.RENAME="rename",e.RENAME_DIR="renameDir",e.UNLINK="unlink",e.UNLINK_DIR="unlinkDir"})(Hl||(Hl={}));var nH;(function(e){e.ALL="all",e.CLOSE="close",e.ERROR="error",e.READY="ready"})(nH||(nH={}));var xvB=(e,t=1,r)=>{t=Math.max(1,t);let i=r?.leading??!1,n=r?.trailing??!0,a=Math.max(r?.maxWait??1/0,t),o,c,d=0,s=0,u=()=>{let g=Date.now(),m=g-d,j=g-s,S=m>=t||j>=a;return[g,S]},f=g=>{if(s=g,!o)return;let m=o;o=void 0,e.apply(void 0,m)},p=()=>{O(0)},_=()=>{c&&(p(),f(Date.now()))},h=g=>{if(s=g,i)return f(g)},y=g=>{if(n&&o)return f(g);o=void 0},b=()=>{c=void 0;let[g,m]=u();return m?y(g):v(g)},v=g=>{let m=g-d,j=g-s,S=t-m,w=a-j,D=Math.min(S,w);return O(D)},O=g=>{c&&clearTimeout(c),!(g<=0)&&(c=setTimeout(b,g))},A=(...g)=>{let[m,j]=u(),S=!!c;if(o=g,d=m,(j||!c)&&O(t),j)return S?f(m):h(m)};return A.cancel=p,A.flush=_,A},DAu=xvB;var rJc=ce(require("fs"),1),IAu=ce(require("path"),1);var KO=ce(require("fs"),1),nL=require("util");var vUi=(e,t)=>function(...i){return e.apply(void 0,i).catch(t)},qYt=(e,t)=>function(...i){try{return e.apply(void 0,i)}catch(n){return t(n)}};var kKc=ce(require("process"),1),kTh=kKc.default.getuid?!kKc.default.getuid():!1,eRh=1e4,X$=()=>{};var YKa={isChangeErrorOk:e=>{if(!YKa.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!kTh&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!YKa.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!YKa.isNodeError(e))throw e;if(!YKa.isChangeErrorOk(e))throw e}},aC=YKa;var eJc=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=eRh,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=()=>this.remove(i),i=()=>t(r);this.add(i)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},tRh=new eJc;var gUi=(e,t)=>function(i){return function n(...a){return tRh.schedule().then(o=>{let c=s=>(o(),s),d=s=>{if(o(),Date.now()>=i)throw s;if(t(s)){let u=Math.round(100*Math.random());return new Promise(p=>setTimeout(p,u)).then(()=>n.apply(void 0,a))}throw s};return e.apply(void 0,a).then(c,d)})}},OUi=(e,t)=>function(i){return function n(...a){try{return e.apply(void 0,a)}catch(o){if(Date.now()>i)throw o;if(t(o))return n.apply(void 0,a);throw o}}};var KvB={attempt:{chmod:vUi((0,nL.promisify)(KO.default.chmod),aC.onChangeError),chown:vUi((0,nL.promisify)(KO.default.chown),aC.onChangeError),close:vUi((0,nL.promisify)(KO.default.close),X$),fsync:vUi((0,nL.promisify)(KO.default.fsync),X$),mkdir:vUi((0,nL.promisify)(KO.default.mkdir),X$),realpath:vUi((0,nL.promisify)(KO.default.realpath),X$),stat:vUi((0,nL.promisify)(KO.default.stat),X$),unlink:vUi((0,nL.promisify)(KO.default.unlink),X$),chmodSync:qYt(KO.default.chmodSync,aC.onChangeError),chownSync:qYt(KO.default.chownSync,aC.onChangeError),closeSync:qYt(KO.default.closeSync,X$),existsSync:qYt(KO.default.existsSync,X$),fsyncSync:qYt(KO.default.fsync,X$),mkdirSync:qYt(KO.default.mkdirSync,X$),realpathSync:qYt(KO.default.realpathSync,X$),statSync:qYt(KO.default.statSync,X$),unlinkSync:qYt(KO.default.unlinkSync,X$)},retry:{close:gUi((0,nL.promisify)(KO.default.close),aC.isRetriableError),fsync:gUi((0,nL.promisify)(KO.default.fsync),aC.isRetriableError),open:gUi((0,nL.promisify)(KO.default.open),aC.isRetriableError),readFile:gUi((0,nL.promisify)(KO.default.readFile),aC.isRetriableError),rename:gUi((0,nL.promisify)(KO.default.rename),aC.isRetriableError),stat:gUi((0,nL.promisify)(KO.default.stat),aC.isRetriableError),write:gUi((0,nL.promisify)(KO.default.write),aC.isRetriableError),writeFile:gUi((0,nL.promisify)(KO.default.writeFile),aC.isRetriableError),closeSync:OUi(KO.default.closeSync,aC.isRetriableError),fsyncSync:OUi(KO.default.fsyncSync,aC.isRetriableError),openSync:OUi(KO.default.openSync,aC.isRetriableError),readFileSync:OUi(KO.default.readFileSync,aC.isRetriableError),renameSync:OUi(KO.default.renameSync,aC.isRetriableError),statSync:OUi(KO.default.statSync,aC.isRetriableError),writeSync:OUi(KO.default.writeSync,aC.isRetriableError),writeFileSync:OUi(KO.default.writeFileSync,aC.isRetriableError)}},rRh=KvB;var BAu=ce(require("fs"),1),XKa=ce(require("path"),1);var tJc=()=>{};var JvB=()=>{let e=tJc,t=tJc,r=!1,i=!1;return{promise:new Promise((d,s)=>{e=u=>(r=!0,d(u)),t=u=>(i=!0,s(u))}),resolve:e,reject:t,isPending:()=>!r&&!i,isResolved:()=>r,isRejected:()=>i}},iRh=JvB;var $vB=()=>{let{promise:e,resolve:t,isPending:r}=iRh(),i=0,n=()=>{i+=1},a=()=>{i-=1,!i&&t()};return(()=>{n(),queueMicrotask(a)})(),{promise:e,isPending:r,increment:n,decrement:a}},nRh=$vB;var aRh={then:e=>{e()}};var oRh=e=>Array.isArray(e)?e:[e],uRh=e=>typeof e=="function";var YvB=(e,t)=>{let r=t?.followSymlinks??!1,i=t?.depth??1/0,n=t?.limit??1/0,a=t?.ignore??[],o=oRh(a).map(H=>uRh(H)?H:G=>H.test(G)),c=H=>o.some(G=>G(H)),d=t?.signal??{aborted:!1},s=t?.onDirents||(()=>{}),u=[],f=new Set,p={},_=[],h=new Set,y={},b=[],v=new Set,O={},A={},g=new Set,m={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{},map:{}},j={directories:u,directoriesNames:f,directoriesNamesToPaths:p,files:_,filesNames:h,filesNamesToPaths:y,symlinks:b,symlinksNames:v,symlinksNamesToPaths:O,map:A},{promise:S,increment:w,decrement:D}=nRh(),B=0,q=(H,G,Ee,ue)=>{g.has(G)||B>=n||(B+=1,H.directories.push(G),H.directoriesNames.add(Ee),u.push(G),f.add(Ee),p.propertyIsEnumerable(Ee)||(p[Ee]=[]),p[Ee].push(G),g.add(G),!(ue>=i)&&(B>=n||ee(G,ue+1)))},U=(H,G,Ee)=>{g.has(G)||B>=n||(B+=1,H.files.push(G),H.filesNames.add(Ee),_.push(G),h.add(Ee),y.propertyIsEnumerable(Ee)||(y[Ee]=[]),y[Ee].push(G),g.add(G))},R=(H,G,Ee,ue)=>{g.has(G)||B>=n||(B+=1,H.symlinks.push(G),H.symlinksNames.add(Ee),b.push(G),v.add(Ee),O.propertyIsEnumerable(Ee)||(O[Ee]=[]),O[Ee].push(G),g.add(G),r&&(ue>=i||B>=n||me(G,ue+1)))},N=(H,G,Ee,ue,ge)=>{d.aborted||c(G)||(ue.isDirectory()?q(H,G,Ee,ge):ue.isFile()?U(H,G,Ee):ue.isSymbolicLink()&&R(H,G,Ee,ge))},F=(H,G,Ee,ue)=>{if(d.aborted)return;let ge=G===XKa.default.sep?"":XKa.default.sep,We=Ee.name,se=`${G}${ge}${We}`;c(se)||(Ee.isDirectory()?q(H,se,We,ue):Ee.isFile()?U(H,se,We):Ee.isSymbolicLink()&&R(H,se,We,ue))},x=(H,G,Ee,ue)=>{for(let ge=0,We=Ee.length;ge<We;ge++)F(H,G,Ee[ge],ue)},ee=(H,G)=>{d.aborted||G>i||B>=n||(w(),BAu.default.readdir(H,{withFileTypes:!0},(Ee,ue)=>{if(Ee||d.aborted||!ue.length)return D();(s(ue)||aRh).then(()=>{let We=A[H]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};x(We,H,ue,G),D()})}))},me=(H,G)=>{w(),BAu.default.realpath(H,(Ee,ue)=>{if(Ee||d.aborted)return D();BAu.default.stat(ue,(ge,We)=>{if(ge||d.aborted)return D();let se=XKa.default.basename(ue),ne=A[H]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};N(ne,ue,se,We,G),D()})})};return(async(H,G=1)=>(H=XKa.default.normalize(H),g.add(H),ee(H,G),await S,d.aborted?m:j))(e)},sRh=YvB;var TYt={lang:{debounce:DAu,attempt:e=>{try{return e()}catch(t){return TYt.lang.castError(t)}},castArray:e=>TYt.lang.isArray(e)?e:[e],castError:e=>TYt.lang.isError(e)?e:TYt.lang.isString(e)?new Error(e):new Error("Unknown error"),defer:e=>setTimeout(e,0),isArray:e=>Array.isArray(e),isError:e=>e instanceof Error,isFunction:e=>typeof e=="function",isNaN:e=>Number.isNaN(e),isNumber:e=>typeof e=="number",isPrimitive:e=>{if(e===null)return!0;let t=typeof e;return t!=="object"&&t!=="function"},isShallowEqual:(e,t)=>{if(e===t)return!0;if(TYt.lang.isNaN(e))return TYt.lang.isNaN(t);if(TYt.lang.isPrimitive(e)||TYt.lang.isPrimitive(t))return e===t;for(let r in e)if(!(r in t))return!1;for(let r in t)if(e[r]!==t[r])return!1;return!0},isSet:e=>e instanceof Set,isString:e=>typeof e=="string",isUndefined:e=>e===void 0,noop:()=>{},uniq:e=>e.length<2?e:Array.from(new Set(e))},fs:{getDepth:e=>Math.max(0,e.split(IAu.default.sep).length-1),getRealPath:(e,t)=>{try{return t?rJc.default.realpathSync.native(e):rJc.default.realpathSync(e)}catch{return}},isSubPath:(e,t)=>t.startsWith(e)&&t[e.length]===IAu.default.sep&&t.length-e.length>IAu.default.sep.length,poll:(e,t=ZTh)=>rRh.retry.stat(t)(e,{bigint:!0}).catch(TYt.lang.noop),readdir:async(e,t,r=1/0,i=1/0,n,a)=>{if(a&&r===1&&e in a){let o=a[e];return[o.directories,o.files]}else{let o=await sRh(e,{depth:r,limit:i,ignore:t,signal:n});return[o.directories,o.files]}}}},Mp=TYt;var CAu=ce(require("path"),1);var iJc=class{constructor(t,r,i){this.base=i,this.watcher=t,this.handler=r.handler,this.fswatcher=r.watcher,this.options=r.options,this.folderPath=r.folderPath,this.filePath=r.filePath,this.handlerBatched=this.base?this.base.onWatcherEvent.bind(this.base):this._makeHandlerBatched(this.options.debounce)}_isSubRoot(t){return this.filePath?t===this.filePath:t===this.folderPath||Mp.fs.isSubPath(this.folderPath,t)}_makeHandlerBatched(t=$Th){return(()=>{let r=this.watcher._readyWait,i=[],n=new Set,a=async(c,d)=>{let s=this.options.ignoreInitial?[]:c,u=await this.eventsPopulate([...d]),f=this.eventsDeduplicate([...s,...u]);this.onTargetEvents(f)},o=Mp.lang.debounce(()=>{this.watcher.isClosed()||(r=a(i,n),i=[],n=new Set)},t);return async(c,d="",s=!1)=>{s?await this.eventsPopulate([d],i,!0):n.add(d),r.then(o)}})()}eventsDeduplicate(t){if(t.length<2)return t;let r={};return t.reduce((i,n)=>{let[a,o]=n,c=r[o];return a===c||a===Hl.CHANGE&&c===Hl.ADD||(r[o]=a,i.push(n)),i},[])}async eventsPopulate(t,r=[],i=!1){return await Promise.all(t.map(async n=>{let a=await this.watcher._poller.update(n,this.options.pollingTimeout);await Promise.all(a.map(async o=>{r.push([o,n]),o===Hl.ADD_DIR?await this.eventsPopulateAddDir(t,n,r,i):o===Hl.UNLINK_DIR&&await this.eventsPopulateUnlinkDir(t,n,r,i)}))})),r}async eventsPopulateAddDir(t,r,i=[],n=!1){if(n)return i;let a=this.options.recursive?this.options.depth??v$i:Math.min(1,this.options.depth??v$i),o=this.options.limit??JKa,[c,d]=await Mp.fs.readdir(r,this.options.ignore,a,o,this.watcher._closeSignal),s=[...c,...d];return await Promise.all(s.map(u=>{if(!this.watcher.isIgnored(u,this.options.ignore)&&!t.includes(u))return this.eventsPopulate([u],i,!0)})),i}async eventsPopulateUnlinkDir(t,r,i=[],n=!1){if(n)return i;for(let a of this.watcher._poller.stats.keys())Mp.fs.isSubPath(r,a)&&(t.includes(a)||await this.eventsPopulate([a],i,!0));return i}onTargetAdd(t){this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAdd(t,this.options.renameTimeout):this.watcher.event(Hl.ADD,t))}onTargetAddDir(t){t!==this.folderPath&&this.options.recursive&&!g$i&&this.options.native!==!1&&this.watcher.watchDirectory(t,this.options,this.handler,void 0,this.base||this),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAddDir(t,this.options.renameTimeout):this.watcher.event(Hl.ADD_DIR,t))}onTargetChange(t){this._isSubRoot(t)&&this.watcher.event(Hl.CHANGE,t)}onTargetUnlink(t){this.watcher.watchersClose(CAu.default.dirname(t),t,!1),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlink(t,this.options.renameTimeout):this.watcher.event(Hl.UNLINK,t))}onTargetUnlinkDir(t){this.watcher.watchersClose(CAu.default.dirname(t),t,!1),this.watcher.watchersClose(t),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlinkDir(t,this.options.renameTimeout):this.watcher.event(Hl.UNLINK_DIR,t))}onTargetEvent(t){let[r,i]=t;r===Hl.ADD?this.onTargetAdd(i):r===Hl.ADD_DIR?this.onTargetAddDir(i):r===Hl.CHANGE?this.onTargetChange(i):r===Hl.UNLINK?this.onTargetUnlink(i):r===Hl.UNLINK_DIR&&this.onTargetUnlinkDir(i)}onTargetEvents(t){for(let r of t)this.onTargetEvent(r)}onWatcherEvent(t,r,i=!1){return this.handlerBatched(t,r,i)}onWatcherChange(t=jvn.CHANGE,r){if(this.watcher.isClosed())return;let i=CAu.default.resolve(this.folderPath,r||"");this.filePath&&i!==this.folderPath&&i!==this.filePath||this.watcher.isIgnored(i,this.options.ignore)||this.onWatcherEvent(t,i)}onWatcherError(t){XKc&&t.code==="EPERM"?this.onWatcherChange(jvn.CHANGE,""):this.watcher.error(t)}async init(){await this.initWatcherEvents(),await this.initInitialEvents()}async initWatcherEvents(){let t=this.onWatcherChange.bind(this);this.fswatcher.on($Ka.CHANGE,t);let r=this.onWatcherError.bind(this);this.fswatcher.on($Ka.ERROR,r)}async initInitialEvents(){let t=!this.watcher.isReady();if(this.filePath){if(this.watcher._poller.stats.has(this.filePath))return;await this.onWatcherEvent(jvn.CHANGE,this.filePath,t)}else{let r=this.options.recursive&&g$i&&this.options.native!==!1?this.options.depth??v$i:Math.min(1,this.options.depth??v$i),i=this.options.limit??JKa,[n,a]=await Mp.fs.readdir(this.folderPath,this.options.ignore,r,i,this.watcher._closeSignal,this.options.readdirMap),o=[this.folderPath,...n,...a];await Promise.all(o.map(c=>{if(!this.watcher._poller.stats.has(c)&&!this.watcher.isIgnored(c,this.options.ignore))return this.onWatcherEvent(jvn.CHANGE,c,t)}))}}},cRh=iJc;var aH={interval:100,intervalId:void 0,fns:new Map,init:()=>{aH.intervalId||(aH.intervalId=setInterval(aH.resolve,aH.interval))},reset:()=>{aH.intervalId&&(clearInterval(aH.intervalId),delete aH.intervalId)},add:(e,t)=>{aH.fns.set(e,Date.now()+t),aH.init()},remove:e=>{aH.fns.delete(e)},resolve:()=>{if(!aH.fns.size)return aH.reset();let e=Date.now();for(let[t,r]of aH.fns)r>=e||(aH.remove(t),t())}},ZKa=aH;var kKa=class e{constructor(t){this._watcher=t,this.reset()}getLockAdd(t,r=ZKc){let{ino:i,targetPath:n,events:a,locks:o}=t,c=()=>{let f=this._watcher._poller.paths.find(i||-1,p=>p!==n);if(f&&f!==n){if(Mp.fs.getRealPath(n,!0)===f)return;this._watcher.event(a.rename,f,n)}else this._watcher.event(a.add,n)};if(!i)return c();let d=()=>{o.add.delete(i),ZKa.remove(s)},s=()=>{d(),c()};ZKa.add(s,r);let u=()=>{let f=o.unlink.get(i);if(!f)return;d();let p=f();n===p?a.change&&this._watcher._poller.stats.has(n)&&this._watcher.event(a.change,n):this._watcher.event(a.rename,p,n)};o.add.set(i,u),u()}getLockUnlink(t,r=ZKc){let{ino:i,targetPath:n,events:a,locks:o}=t,c=()=>{this._watcher.event(a.unlink,n)};if(!i)return c();let d=()=>{o.unlink.delete(i),ZKa.remove(s)},s=()=>{d(),c()};ZKa.add(s,r);let u=()=>(d(),n);o.unlink.set(i,u),o.add.get(i)?.()}getLockTargetAdd(t,r){let i=this._watcher._poller.getIno(t,Hl.ADD,CYt.FILE);return this.getLockAdd({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetAddDir(t,r){let i=this._watcher._poller.getIno(t,Hl.ADD_DIR,CYt.DIR);return this.getLockAdd({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}getLockTargetUnlink(t,r){let i=this._watcher._poller.getIno(t,Hl.UNLINK,CYt.FILE);return this.getLockUnlink({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetUnlinkDir(t,r){let i=this._watcher._poller.getIno(t,Hl.UNLINK_DIR,CYt.DIR);return this.getLockUnlink({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}reset(){this._locksAdd=new Map,this._locksAddDir=new Map,this._locksUnlink=new Map,this._locksUnlinkDir=new Map,this._locksDir={add:this._locksAddDir,unlink:this._locksUnlinkDir},this._locksFile={add:this._locksAdd,unlink:this._locksUnlink}}};kKa.DIR_EVENTS={add:Hl.ADD_DIR,rename:Hl.RENAME_DIR,unlink:Hl.UNLINK_DIR};kKa.FILE_EVENTS={add:Hl.ADD,change:Hl.CHANGE,rename:Hl.RENAME,unlink:Hl.UNLINK};var lRh=kKa;var nJc=class{constructor(){this.map=new Map}clear(){this.map.clear()}delete(t,r){if(Mp.lang.isUndefined(r))return this.map.delete(t);if(this.map.has(t)){let i=this.map.get(t);if(Mp.lang.isSet(i)){let n=i.delete(r);return i.size||this.map.delete(t),n}else if(i===r)return this.map.delete(t),!0}return!1}find(t,r){if(this.map.has(t)){let i=this.map.get(t);if(Mp.lang.isSet(i))return Array.from(i).find(r);if(r(i))return i}}get(t){return this.map.get(t)}has(t,r){if(Mp.lang.isUndefined(r))return this.map.has(t);if(this.map.has(t)){let i=this.map.get(t);return Mp.lang.isSet(i)?i.has(r):i===r}return!1}set(t,r){if(this.map.has(t)){let i=this.map.get(t);Mp.lang.isSet(i)?i.add(r):i!==r&&this.map.set(t,new Set([i,r]))}else this.map.set(t,r);return this}},aJc=nJc;var oJc=class{constructor(t){this.ino=t.ino<=Number.MAX_SAFE_INTEGER?Number(t.ino):t.ino,this.size=Number(t.size),this.atimeMs=Number(t.atimeMs),this.mtimeMs=Number(t.mtimeMs),this.ctimeMs=Number(t.ctimeMs),this.birthtimeMs=Number(t.birthtimeMs),this._isFile=t.isFile(),this._isDirectory=t.isDirectory(),this._isSymbolicLink=t.isSymbolicLink()}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}},fRh=oJc;var uJc=class{constructor(){this.inos={},this.paths=new aJc,this.stats=new Map}getIno(t,r,i){let n=this.inos[r];if(!n)return;let a=n[t];if(a&&!(i&&a[1]!==i))return a[0]}getStats(t){return this.stats.get(t)}async poll(t,r){let i=await Mp.fs.poll(t,r);if(!(!i||!(i.isFile()||i.isDirectory())))return new fRh(i)}reset(){this.inos={},this.paths=new aJc,this.stats=new Map}async update(t,r){let i=this.getStats(t),n=await this.poll(t,r);if(this.updateStats(t,n),!i&&n){if(n.isFile())return this.updateIno(t,Hl.ADD,n),[Hl.ADD];if(n.isDirectory())return this.updateIno(t,Hl.ADD_DIR,n),[Hl.ADD_DIR]}else if(i&&!n){if(i.isFile())return this.updateIno(t,Hl.UNLINK,i),[Hl.UNLINK];if(i.isDirectory())return this.updateIno(t,Hl.UNLINK_DIR,i),[Hl.UNLINK_DIR]}else if(i&&n){if(i.isFile()){if(n.isFile())return i.ino===n.ino&&!i.size&&!n.size?[]:(this.updateIno(t,Hl.CHANGE,n),[Hl.CHANGE]);if(n.isDirectory())return this.updateIno(t,Hl.UNLINK,i),this.updateIno(t,Hl.ADD_DIR,n),[Hl.UNLINK,Hl.ADD_DIR]}else if(i.isDirectory()){if(n.isFile())return this.updateIno(t,Hl.UNLINK_DIR,i),this.updateIno(t,Hl.ADD,n),[Hl.UNLINK_DIR,Hl.ADD];if(n.isDirectory())return i.ino===n.ino?[]:(this.updateIno(t,Hl.UNLINK_DIR,i),this.updateIno(t,Hl.ADD_DIR,n),[Hl.UNLINK_DIR,Hl.ADD_DIR])}}return[]}updateIno(t,r,i){let n=this.inos[r]=this.inos[r]||(this.inos[r]={}),a=i.isFile()?CYt.FILE:CYt.DIR;n[t]=[i.ino,a]}updateStats(t,r){if(r)this.paths.set(r.ino,t),this.stats.set(t,r);else{let i=this.stats.get(t)?.ino||-1;this.paths.delete(i,t),this.stats.delete(t)}}},sJc=uJc;var cJc=class e extends dRh.EventEmitter{constructor(t,r,i){super(),this._closed=!1,this._ready=!1,this._closeAborter=new AbortController,this._closeSignal=this._closeAborter.signal,this.on(nH.CLOSE,()=>this._closeAborter.abort()),this._closeWait=new Promise(n=>this.on(nH.CLOSE,n)),this._readyWait=new Promise(n=>this.on(nH.READY,n)),this._locker=new lRh(this),this._roots=new Set,this._poller=new sJc,this._pollers=new Set,this._subwatchers=new Set,this._watchers={},this._watchersLock=Promise.resolve(),this._watchersRestorable={},this.watch(t,r,i)}isClosed(){return this._closed}isIgnored(t,r){return!!r&&(Mp.lang.isFunction(r)?!!r(t):r.test(t))}isReady(){return this._ready}close(){return this._locker.reset(),this._poller.reset(),this._roots.clear(),this.watchersClose(),this.isClosed()?!1:(this._closed=!0,this.emit(nH.CLOSE))}error(t){if(this.isClosed())return!1;let r=Mp.lang.castError(t);return this.emit(nH.ERROR,r)}event(t,r,i){return this.isClosed()?!1:(this.emit(nH.ALL,t,r,i),this.emit(t,r,i))}ready(){return this.isClosed()||this.isReady()?!1:(this._ready=!0,this.emit(nH.READY))}pollerExists(t,r){for(let i of this._pollers)if(i.targetPath===t&&Mp.lang.isShallowEqual(i.options,r))return!0;return!1}subwatcherExists(t,r){for(let i of this._subwatchers)if(i.targetPath===t&&Mp.lang.isShallowEqual(i.options,r))return!0;return!1}watchersClose(t,r,i=!0){if(t){let n=this._watchers[t];if(n)for(let a of[...n])r&&a.filePath!==r||this.watcherClose(a);if(i)for(let a in this._watchers)Mp.fs.isSubPath(t,a)&&this.watchersClose(a,r,!1)}else for(let n in this._watchers)this.watchersClose(n,r,!1)}watchersLock(t){return this._watchersLock.then(()=>this._watchersLock=new Promise(async r=>{await t(),r()}))}watchersRestore(){delete this._watchersRestoreTimeout;let t=Object.entries(this._watchersRestorable);this._watchersRestorable={};for(let[r,i]of t)this.watchPath(r,i.options,i.handler)}async watcherAdd(t,r){let{folderPath:i}=t;(this._watchers[i]=this._watchers[i]||[]).push(t);let a=new cRh(this,t,r);return await a.init(),a}watcherClose(t){t.watcher.close();let r=this._watchers[t.folderPath];if(r){let a=r.indexOf(t);r.splice(a,1),r.length||delete this._watchers[t.folderPath]}let i=t.filePath||t.folderPath;this._roots.has(i)&&(this._watchersRestorable[i]=t,this._watchersRestoreTimeout||(this._watchersRestoreTimeout=Mp.lang.defer(()=>this.watchersRestore())))}watcherExists(t,r,i,n){if(this._watchers[t]?.find(c=>c.handler===i&&(!c.filePath||c.filePath===n)&&c.options.ignore===r.ignore&&!!c.options.native==!!r.native&&(!r.recursive||c.options.recursive)))return!0;let o=wvn.default.dirname(t);for(let c=1;c<1/0;c++){if(this._watchers[o]?.find(u=>(c===1||u.options.recursive&&c<=(u.options.depth??v$i))&&u.handler===i&&(!u.filePath||u.filePath===n)&&u.options.ignore===r.ignore&&!!u.options.native==!!r.native&&(!r.recursive||u.options.recursive&&g$i&&u.options.native!==!1)))return!0;if(!g$i)break;let s=wvn.default.dirname(t);if(o===s)break;o=s}return!1}async watchDirectories(t,r,i,n,a){if(this.isClosed())return;t=Mp.lang.uniq(t).sort();let o;for(let c of t)if(!this.isIgnored(c,r.ignore)&&!this.watcherExists(c,r,i,n))try{let d=!r.recursive||g$i&&r.native!==!1?r:{...r,recursive:!1},u={watcher:qAu.default.watch(c,d),handler:i,options:r,folderPath:c,filePath:n},f=o=await this.watcherAdd(u,a);if(this._roots.has(n||c)){let _={...r,ignoreInitial:!0,recursive:!1},h=wvn.default.dirname(c),y=c;await this.watchDirectories([h],_,i,y,f)}}catch(d){this.error(d)}return o}async watchDirectory(t,r,i,n,a){if(!this.isClosed()&&!this.isIgnored(t,r.ignore)){if(!r.recursive||g$i&&r.native!==!1)return this.watchersLock(()=>this.watchDirectories([t],r,i,n,a));{r={...r,recursive:!0};let o=r.depth??v$i,c=r.limit??JKa,[d]=await Mp.fs.readdir(t,r.ignore,o,c,this._closeSignal,r.readdirMap);return this.watchersLock(async()=>{let s=await this.watchDirectories([t],r,i,n,a);if(d.length){let u=Mp.fs.getDepth(t);for(let f of d){let p=Mp.fs.getDepth(f),_=Math.max(0,o-(p-u)),h={...r,depth:_};await this.watchDirectories([f],h,i,n,a||s)}}})}}}async watchFileOnce(t,r,i){if(this.isClosed()||(r={...r,ignoreInitial:!1},this.subwatcherExists(t,r)))return;let n={targetPath:t,options:r},a=(s,u)=>{u===t&&(d(),i())},o=new e(a),c=()=>{this._subwatchers.add(n),this.on(nH.CLOSE,d),o.watchFile(t,r,a)},d=()=>{this._subwatchers.delete(n),this.removeListener(nH.CLOSE,d),o.close()};return c()}async watchFile(t,r,i){if(this.isClosed()||this.isIgnored(t,r.ignore))return;r={...r,recursive:!1};let n=wvn.default.dirname(t);return this.watchDirectory(n,r,i,t)}async watchPollingOnce(t,r,i){if(this.isClosed())return;let n=!1,a=new sJc,o=await this.watchPolling(t,r,async()=>{n||!(await a.update(t,r.pollingTimeout)).length||n||(n=!0,o(),i())})}async watchPolling(t,r,i){if(this.isClosed())return Mp.lang.noop;if(this.pollerExists(t,r))return Mp.lang.noop;let n={...r,interval:r.pollingInterval??XTh},a={targetPath:t,options:r},o=()=>{this._pollers.add(a),this.on(nH.CLOSE,c),qAu.default.watchFile(t,n,i)},c=()=>{this._pollers.delete(a),this.removeListener(nH.CLOSE,c),qAu.default.unwatchFile(t,i)};return Mp.lang.attempt(o),()=>Mp.lang.attempt(c)}async watchUnknownChild(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchFileOnce(t,r,n)}async watchUnknownTarget(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchPollingOnce(t,r,n)}async watchPaths(t,r,i){if(this.isClosed())return;if(t=Mp.lang.uniq(t).sort(),t.every((a,o)=>t.every((c,d)=>d===o||!Mp.fs.isSubPath(a,c))))await Promise.all(t.map(a=>this.watchPath(a,r,i)));else for(let a of t)await this.watchPath(a,r,i)}async watchPath(t,r,i){if(this.isClosed()||(t=wvn.default.resolve(t),this.isIgnored(t,r.ignore)))return;let n=await Mp.fs.poll(t,r.pollingTimeout);if(n){if(n.isFile())return this.watchFile(t,r,i);if(n.isDirectory())return this.watchDirectory(t,r,i);this.error(`"${t}" is not supported`)}else{let a=wvn.default.dirname(t);return(await Mp.fs.poll(a,r.pollingTimeout))?.isDirectory()?this.watchUnknownChild(t,r,i):this.watchUnknownTarget(t,r,i)}}async watch(t,r,i=Mp.lang.noop){if(Mp.lang.isFunction(t))return this.watch([],{},t);if(Mp.lang.isUndefined(t))return this.watch([],r,i);if(Mp.lang.isFunction(r))return this.watch(t,{},r);if(Mp.lang.isUndefined(r))return this.watch(t,{},i);if(this.isClosed())return;this.isReady()&&(r.readdirMap=void 0);let n=Mp.lang.castArray(t);n.forEach(a=>this._roots.add(a)),await this.watchPaths(n,r,i),!this.isClosed()&&(i!==Mp.lang.noop&&this.on(nH.ALL,i),r.readdirMap=void 0,this.ready())}},TAu=cJc;yXo();var xua=require("fs/promises"),pRh=require("os"),_Rh=ce(require("path"),1),XvB=".fern",ZvB="logs";function kvB(){return"cli@3.35.1"}var eJa=class{logFilePath=null;initialized=!1;sessionStartTime;constructor(){this.sessionStartTime=Date.now()}async initialize(){if(this.initialized)return;let t=Ct(Ir.of((0,pRh.homedir)()),Xe.of(XvB)),r=Ct(t,Xe.of(ZvB));await mi(r)||await(0,xua.mkdir)(r,{recursive:!0});let n=`${new Date().toISOString().replace(/[:.]/g,"-")}.debug.log`;this.logFilePath=Ct(r,Xe.of(n));let a=["================================================================================","Fern Docs Dev Debug Log",`Session started: ${new Date().toISOString()}`,`Log file: ${_Rh.default.basename(this.logFilePath)}`,"================================================================================",""].join(`
1784
+ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-definitions`;throw new Error(r)}async toRootNode(){let t=Rt.V1.SlugGenerator.init(Rt.slugjoin(this.getDocsBasePath())),r=this.#e.get("root"),i=await this.toRootChild(t);return{type:"root",version:"v1",id:r,child:i,slug:t.get(),title:this.parsedDocsConfig.title??"Documentation",hidden:!1,icon:void 0,pointsTo:void 0,authed:void 0,viewers:void 0,orphaned:void 0,roles:this.parsedDocsConfig.roles?.map(n=>Rt.RoleId(n)),featureFlags:void 0}}async toRootChild(t){return vln(this.parsedDocsConfig.navigation)._visit({untabbed:r=>this.toUnversionedNode({landingPage:this.parsedDocsConfig.landingPage,navigationConfig:r,parentSlug:t}),tabbed:r=>this.toUnversionedNode({landingPage:this.parsedDocsConfig.landingPage,navigationConfig:r,parentSlug:t}),versioned:r=>this.toVersionedNode(r,t),productgroup:r=>this.toProductGroupNode({landingPageConfig:this.parsedDocsConfig.landingPage,productGroup:r,parentSlug:t})})}toLandingPageNode(t,r){let i=Rt.PageId(this.toRelativeFilepath(t.absolutePath)),n=r.apply({urlSlug:t.slug??NE(t.title),fullSlug:this.markdownFilesToFullSlugs.get(t.absolutePath)?.split("/")});return{type:"landingPage",id:this.#e.get(i),title:t.title,slug:n.get(),icon:this.resolveIconFileId(t.icon),hidden:t.hidden,viewers:t.viewers,orphaned:t.orphaned,pageId:i,authed:void 0,noindex:t.noindex||this.markdownFilesToNoIndex.get(t.absolutePath),featureFlags:t.featureFlags}}async toUnversionedNode({landingPage:t,navigationConfig:r,parentSlug:i}){let n=this.#e.get("unversioned"),a=t!=null?this.toLandingPageNode(t,i):void 0,o=r.type==="tabbed"?await this.convertTabbedNavigation(n,r.items,i):await this.toSidebarRootNode(n,r.items,i);return{type:"unversioned",id:n,landingPage:a,child:o}}async toVersionedNode(t,r){let i=this.#e.get("versioned"),n=t.versions[0];if(n?.hidden===!0)throw new Error(`The default version "${n.version}" cannot be hidden. Please set a non-hidden version as the first version in your versions list, or remove the hidden flag from the default version.`);return{id:i,type:"versioned",children:await Promise.all(t.versions.map((a,o)=>this.toVersionNode(a,r,o===0)))}}async toProductGroupNode({productGroup:t,landingPageConfig:r,parentSlug:i}){let n=this.#e.get("productgroup"),a=r!=null?this.toLandingPageNode(r,i):void 0;return{id:n,type:"productgroup",landingPage:a,children:await Promise.all(t.products.map(o=>this.toProductNode(o,i)))}}async toProductNode(t,r){if(t.type==="internal"){let i=r.setProductSlug(t.slug??NE(t.product)),n;switch(t.navigation.type){case"tabbed":n={type:"unversioned",id:this.#e.get(t.product),landingPage:void 0,child:await this.convertTabbedNavigation(this.#e.get(t.product),t.navigation.items,i)};break;case"untabbed":n={type:"unversioned",id:this.#e.get(t.product),landingPage:void 0,child:await this.toSidebarRootNode(this.#e.get(t.product),t.navigation.items,i)};break;case"versioned":n=await this.toVersionedNode(t.navigation,i);break;default:vt(t.navigation)}return{type:"product",id:this.#e.get(t.product),productId:Rt.V1.ProductId(t.product),title:t.product,subtitle:t.subtitle??"",slug:i.get(),child:n,default:!1,hidden:void 0,authed:void 0,icon:this.resolveIconFileId(t.icon),image:t.image!=null?this.getFileId(t.image):void 0,pointsTo:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,announcement:t.announcement!=null?{text:t.announcement.message}:void 0}}else return{type:"productLink",id:this.#e.get(t.product),productId:Rt.V1.ProductId(t.product),title:t.product,subtitle:t.subtitle??"",href:iG.Url(t.href??""),target:t.target,default:!1,hidden:void 0,authed:void 0,icon:this.resolveIconFileId(t.icon),image:t.image!=null?this.getFileId(t.image):void 0,viewers:t.viewers,orphaned:t.orphaned}}async toVersionNode(t,r,i){let n=this.#e.get(t.version),a=r.setVersionSlug(t.slug??NE(t.version)),o=t.navigation.type==="tabbed"?await this.convertTabbedNavigation(n,t.navigation.items,a):await this.toSidebarRootNode(n,t.navigation.items,a);return{type:"version",id:n,versionId:Rt.VersionId(t.version),title:t.version,slug:a.get(),child:o,default:i,availability:t.availability!=null?JlB(t.availability):void 0,landingPage:t.landingPage?this.toLandingPageNode(t.landingPage,a):void 0,hidden:t.hidden,authed:void 0,viewers:t.viewers,orphaned:t.orphaned,icon:void 0,pointsTo:void 0,featureFlags:t.featureFlags,announcement:t.announcement!=null?{text:t.announcement.message}:void 0}}async toSidebarRootNode(t,r,i){let n=this.#e.get(`${t}/root`),a=await Promise.all(r.map(c=>this.toNavigationChild({prefix:n,item:c,parentSlug:i}))),o=[];return a.forEach(c=>{if(c.type==="apiReference"){o.push(c);return}if(c.type==="section"&&!c.collapsed){o.push(c);return}let d=o.length>0?o[o.length-1]:void 0,s;d?.type==="sidebarGroup"?s=d:(s={id:this.#e.get(`${n}/group`),type:"sidebarGroup",children:[]},o.push(s)),s.children.push(c)}),{type:"sidebarRoot",id:n,children:o}}async toSidebarRootNodeWithVariants(t,r,i){let n=this.#e.get(`${t}/root`);return{type:"sidebarRoot",id:n,children:[{type:"varianted",id:n,children:await Promise.all(r.map(a=>this.toVariantNode(a,n,i)))}]}}async toVariantNode(t,r,i){let n=this.#e.get(`${r}/variant/${t.slug??NE(t.title)}`),a=i.apply({urlSlug:t.slug??NE(t.title),skipUrlSlug:t.skipUrlSlug}),o=await Promise.all(t.layout.map(c=>this.toVariantChild(c,n,a)));return{type:"variant",id:n,variantId:Rt.V1.VariantId(t.title),subtitle:t.subtitle??"",default:t.default??!1,image:void 0,children:o,title:t.title,slug:a.get(),icon:this.resolveIconFileId(t.icon),hidden:t.hidden,authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,pointsTo:void 0}}async toVariantChild(t,r,i){return vln(t)._visit({page:async n=>this.toPageNode({item:n,parentSlug:i}),apiSection:async n=>this.toApiSectionNode({item:n,parentSlug:i}),section:async n=>this.toSectionNode({prefix:r,item:n,parentSlug:i}),link:async n=>this.toLinkNode(n),changelog:async n=>this.toChangelogNode(n,i)})}async toNavigationChild({prefix:t,item:r,parentSlug:i,hideChildren:n,parentAvailability:a}){return vln(r)._visit({page:async o=>this.toPageNode({item:o,parentSlug:i,hideChildren:n,parentAvailability:a}),apiSection:async o=>this.toApiSectionNode({item:o,parentSlug:i,hideChildren:n,parentAvailability:a}),section:async o=>this.toSectionNode({prefix:t,item:o,parentSlug:i,hideChildren:n,parentAvailability:a}),link:async o=>this.toLinkNode(o),changelog:async o=>this.toChangelogNode(o,i,n)})}async toApiSectionNode({item:t,parentSlug:r,hideChildren:i,parentAvailability:n}){let a=QSh(t.snippetsConfiguration),o,c=await this.getFernWorkspaceForApiSection(t).toFernWorkspace({context:this.taskContext},{enableUniqueErrorsPerEndpoint:!0,detectGlobalHeaders:!1,objectQueryParameters:!0,preserveSchemaIds:!0}),d=this.parsedDocsConfig.experimental?.openapiParserV3,s=d==null||d;if(s)try{o=await this.getOpenApiWorkspaceForApiSection(t).getIntermediateRepresentation({context:this.taskContext,audiences:t.audiences,enableUniqueErrorsPerEndpoint:!0,generateV1Examples:!1,logWarnings:!1})}catch{}let u;if(t.tagDescriptionPages&&s)try{let b=await this.getOpenApiWorkspaceForApiSection(t).getOpenAPIIr({context:this.taskContext});b.tags.tagsById&&(u=Object.fromEntries(Object.entries(b.tags.tagsById).filter(([v,O])=>O.description&&O.description.trim().length>0).map(([v,O])=>[v,{id:String(O.id),description:O.description}])))}catch(y){this.taskContext.logger.warn("Failed to extract OpenAPI tags for tag description pages",String(y))}o==null&&(o=eS({workspace:c,audiences:t.audiences,generationLanguage:void 0,keywords:void 0,smartCasing:!1,exampleGeneration:{disabled:!1,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!0},readme:void 0,version:void 0,packageName:void 0,context:this.taskContext,sourceResolver:new kE(this.taskContext,c)})),this.docsWorkspace.config.settings?.substituteEnvVars&&(o=MT(o,{onError:y=>this.taskContext.failAndThrow(`Error substituting environment variables in API spec: ${y}`)},{substituteAsEmpty:!1}));let f=await this.registerApi({ir:o,snippetsConfig:a,playgroundConfig:{oauth:t.playground?.oauth},apiName:t.apiName,workspace:c}),p=OKa({ir:o,apiDefinitionId:f,playgroundConfig:{oauth:t.playground?.oauth},context:this.taskContext}),_=new Egu(t,p,r,this.docsWorkspace,this.taskContext,this.markdownFilesToFullSlugs,this.markdownFilesToNoIndex,this.markdownFilesToTags,this.#e,this.collectedFileIds,c,i,n??t.availability,u),h=_.getTagDescriptionContent();for(let[y,b]of h.entries()){let v=y.split("/").pop()||y,O=Xe.of(v),A=b;this.docsWorkspace.config.settings?.substituteEnvVars&&(A=MT(b,{onError:g=>this.taskContext.logger.error(`Error in tag description environment variable substitution: ${g}`)},{substituteAsEmpty:!1})),this.rawMarkdownFiles[O]=A,this.parsedDocsConfig.pages[O]=A}return _.get()}async toChangelogNode(t,r,i){return new pvn(this.markdownFilesToFullSlugs,this.markdownFilesToNoIndex,this.markdownFilesToTags,t.changelog,this.docsWorkspace,this.#e).toChangelogNode({parentSlug:r,title:t.title,icon:this.resolveIconFileId(t.icon),viewers:t.viewers,hidden:i||t.hidden,slug:t.slug})}async toLinkNode(t){return{type:"link",id:this.#e.get(t.url),title:t.text,url:Rt.V1.Url(t.url),icon:this.resolveIconFileId(t.icon),target:t.target}}async toPageNode({item:t,parentSlug:r,hideChildren:i,parentAvailability:n}){let a=Rt.PageId(this.toRelativeFilepath(t.absolutePath)),o=r.apply({urlSlug:t.slug??NE(t.title),fullSlug:this.markdownFilesToFullSlugs.get(t.absolutePath)?.split("/")});return{id:this.#e.get(a),type:"page",slug:o.get(),title:this.markdownFilesToSidebarTitle.get(t.absolutePath)??t.title,icon:this.resolveIconFileId(t.icon),hidden:i||t.hidden,viewers:t.viewers,orphaned:t.orphaned,pageId:a,authed:void 0,noindex:t.noindex||this.markdownFilesToNoIndex.get(t.absolutePath),featureFlags:t.featureFlags,availability:t.availability??n}}async toSectionNode({prefix:t,item:r,parentSlug:i,hideChildren:n,parentAvailability:a}){let o=this.toRelativeFilepath(r.overviewAbsolutePath),c=o?Rt.PageId(o):void 0,d=this.#e.get(c??`${t}/section`),s=i.apply({urlSlug:r.slug??NE(r.title),fullSlug:r.overviewAbsolutePath?this.markdownFilesToFullSlugs.get(r.overviewAbsolutePath)?.split("/"):void 0,skipUrlSlug:r.skipUrlSlug}),u=r.overviewAbsolutePath!=null?this.markdownFilesToNoIndex.get(r.overviewAbsolutePath):void 0,f=n||r.hidden;return{id:d,type:"section",overviewPageId:c,slug:s.get(),title:r.overviewAbsolutePath!=null?this.markdownFilesToSidebarTitle.get(r.overviewAbsolutePath)??r.title:r.title,icon:this.resolveIconFileId(r.icon),collapsed:r.collapsed,hidden:f,viewers:r.viewers,orphaned:r.orphaned,children:await Promise.all(r.contents.map(p=>this.toNavigationChild({prefix:d,item:p,parentSlug:s,hideChildren:f,parentAvailability:r.availability??a}))),authed:void 0,pointsTo:void 0,noindex:u,featureFlags:r.featureFlags,availability:r.availability??a}}async convertTabbedNavigation(t,r,i){let n=this.#e.get(`${t}/tabbed`);return{type:"tabbed",id:n,children:await Promise.all(r.map(a=>this.toTabChild(n,a,i)))}}async toTabChild(t,r,i){return vln(r.child)._visit({link:({href:n,target:a})=>this.toTabLinkNode(r,n,a),layout:({layout:n})=>this.toTabNode(t,r,n,i),changelog:({changelog:n})=>this.toTabChangelogNode(r,n,i),variants:({variants:n})=>this.toTabNodeWithVariants(t,r,n,i)})}async toTabChangelogNode(t,r,i){return new pvn(this.markdownFilesToFullSlugs,this.markdownFilesToNoIndex,this.markdownFilesToTags,r,this.docsWorkspace,this.#e).toChangelogNode({parentSlug:i,title:t.title,icon:this.resolveIconFileId(t.icon),viewers:t.viewers,hidden:t.hidden,slug:t.slug})}async toTabLinkNode(t,r,i){return{type:"link",id:this.#e.get(r),title:t.title,url:Rt.V1.Url(r),target:i,icon:this.resolveIconFileId(t.icon)}}async toTabNode(t,r,i,n){let a=this.#e.get(`${t}/tab`),o=n.apply({urlSlug:r.slug??NE(r.title),skipUrlSlug:r.skipUrlSlug});return{type:"tab",id:a,title:r.title,slug:o.get(),icon:this.resolveIconFileId(r.icon),hidden:r.hidden,authed:void 0,viewers:r.viewers,orphaned:r.orphaned,pointsTo:void 0,child:await this.toSidebarRootNode(a,i,o),featureFlags:r.featureFlags}}async toTabNodeWithVariants(t,r,i,n){let a=this.#e.get(`${t}/tab`),o=n.apply({urlSlug:r.slug??NE(r.title),skipUrlSlug:r.skipUrlSlug});return{type:"tab",id:a,title:r.title,slug:o.get(),icon:this.resolveIconFileId(r.icon),hidden:r.hidden,authed:void 0,viewers:r.viewers,orphaned:r.orphaned,pointsTo:void 0,child:await this.toSidebarRootNodeWithVariants(a,i,o),featureFlags:r.featureFlags}}getFileId(t){if(t==null)return;let r=this.collectedFileIds.get(t);return r==null?this.taskContext.failAndThrow("Failed to locate file after uploading: "+t):iG.FileId(r)}resolveIconFileId(t){if(t!=null)return this.collectedFileIds.has(t)?`file:${this.getFileId(t)}`:t}convertPageActions(){if(this.parsedDocsConfig.pageActions!=null)return{default:this.parsedDocsConfig.pageActions.default,options:{askAi:this.parsedDocsConfig.pageActions.options.askAi,copyPage:this.parsedDocsConfig.pageActions.options.copyPage,viewAsMarkdown:this.parsedDocsConfig.pageActions.options.viewAsMarkdown,openAi:this.parsedDocsConfig.pageActions.options.openAi,claude:this.parsedDocsConfig.pageActions.options.claude,cursor:this.parsedDocsConfig.pageActions.options.cursor,vscode:this.parsedDocsConfig.pageActions.options.vscode,custom:this.parsedDocsConfig.pageActions.options.custom.map(t=>({title:t.title,subtitle:t.subtitle,url:t.url,icon:this.resolveIconFileId(t.icon),default:t.default}))}}}convertColorConfigImageReferences(){let{colors:t}=this.parsedDocsConfig;if(t!=null)return t.type==="dark"?{...t,...this.convertLogoAndBackgroundImage({theme:"dark"})}:t.type==="light"?{...t,...this.convertLogoAndBackgroundImage({theme:"light"}),type:"light"}:{...t,dark:{...t.dark,...this.convertLogoAndBackgroundImage({theme:"dark"})},light:{...t.light,...this.convertLogoAndBackgroundImage({theme:"light"})}}}convertLogoAndBackgroundImage({theme:t}){let{logo:r,backgroundImage:i}=this.parsedDocsConfig,n=r?.[t],a=i?.[t];return{logo:this.getFileId(n),backgroundImage:this.getFileId(a)}}convertDocsTypographyConfiguration(){if(this.parsedDocsConfig.typography!=null)return{headingsFont:this.convertFont(this.parsedDocsConfig.typography.headingsFont,"headings"),bodyFont:this.convertFont(this.parsedDocsConfig.typography.bodyFont,"body"),codeFont:this.convertFont(this.parsedDocsConfig.typography.codeFont,"code")}}convertFont(t,r){if(t==null||t.variants[0]==null)return;let i=this.getFileId(t.variants[0].absolutePath);return{type:"custom",name:t.name??`font:${r}:${i}`,variants:t.variants.map(n=>({fontFile:this.getFileId(n.absolutePath),weight:n.weight,style:n.style!=null?[n.style]:void 0})),display:t.display,fallback:t.fallback,fontVariationSettings:t.fontVariationSettings}}convertJavascriptConfiguration(){if(this.parsedDocsConfig.js!=null)return{files:this.parsedDocsConfig.js.files.map(({absolutePath:t,strategy:r})=>({fileId:this.getFileId(t),strategy:r})).filter(ds),remote:this.parsedDocsConfig.js.remote?.map(t=>({...t,url:iG.Url(t.url)})),inline:void 0}}convertMetadata(){if(this.parsedDocsConfig.metadata==null)return;let{"og:image":t,"og:logo":r,"twitter:image":i,...n}=this.parsedDocsConfig.metadata;return{...n,"og:image":this.convertFileIdOrUrl(t),"og:logo":this.convertFileIdOrUrl(r),"twitter:image":this.convertFileIdOrUrl(i)}}convertFileIdOrUrl(t){if(t!=null)return vln(t,"type")._visit({filepath:({value:r})=>({type:"fileId",value:this.getFileId(r)}),url:({value:r})=>({type:"url",value:iG.Url(r)}),_other:()=>this.taskContext.failAndThrow("Invalid metadata configuration")})}};function KlB(e,t){if(e?.github==null)return;let{owner:r,repo:i,branch:n="main",host:a="https://github.com"}=e.github;return`${tH(a)}/${r}/${i}/blob/${n}/fern/${t}?plain=1`}function JlB(e){switch(e){case"beta":return Rt.V1.NavigationV1Availability.Beta;case"deprecated":return Rt.V1.NavigationV1Availability.Deprecated;case"ga":return Rt.V1.NavigationV1Availability.GenerallyAvailable;case"stable":return Rt.V1.NavigationV1Availability.Stable;default:vt(e)}}async function rL(e){return(await Promise.all(e.apiWorkspaces.map(async t=>t instanceof ZE?t:null))).filter(ds)}async function U7c(e,t,r){if(e instanceof SEe){t.logger.info("Skipping, API is specified as a Fern Definition.");return}else if(!(e instanceof ZE))return;let i=await e.getIntermediateRepresentation({context:t,audiences:r,enableUniqueErrorsPerEndpoint:!0,generateV1Examples:!1,logWarnings:!1});return eH({ir:i,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},playgroundConfig:{oauth:!0},context:t})}var Ys={};Zt(Ys,{AlgoliaSearchIndex:()=>aMh,ApiDefinitionId:()=>EMh,ApiId:()=>BMh,Availability:()=>HMh,DocsConfigId:()=>IMh,EndpointId:()=>qMh,EndpointPathLiteral:()=>WMh,EnvironmentId:()=>CMh,FileId:()=>FMh,HttpMethod:()=>GMh,IndexSegmentId:()=>oMh,JqString:()=>UMh,OrgId:()=>MMh,PageId:()=>NMh,PayloadLocation:()=>vDh,PropertyKey:()=>LMh,PullRequestState:()=>pDh,RoleId:()=>VMh,TokenId:()=>DMh,TypeId:()=>zMh,Url:()=>QMh,VersionId:()=>SMh,WebSocketId:()=>TMh,WebhookId:()=>RMh,algolia:()=>L7c,api:()=>X7c,commons:()=>Z7c,diff:()=>xMh,docs:()=>uxc,generators:()=>cxc,git:()=>lxc,navigation:()=>pxc,sdks:()=>hxc,snippets:()=>yDh,snippetsFactory:()=>bDh,templates:()=>yxc,tokens:()=>gDh});var L7c={};Zt(L7c,{AlgoliaSearchIndex:()=>aMh,IndexSegmentId:()=>oMh});function aMh(e){return e}function oMh(e){return e}var X7c={};Zt(X7c,{latest:()=>G7c,v1:()=>Y7c});var G7c={};Zt(G7c,{AuthSchemeId:()=>uMh,WebhookHttpMethod:()=>fMh,auth:()=>V7c,commons:()=>sMh,endpoint:()=>cMh,type_:()=>lMh,webhook:()=>W7c,websocket:()=>dMh});var V7c={};Zt(V7c,{AuthSchemeId:()=>uMh});function uMh(e){return e}var sMh={};var cMh={};var lMh={};var W7c={};Zt(W7c,{WebhookHttpMethod:()=>fMh});var fMh={Get:"GET",Post:"POST"};var dMh={};var Y7c={};Zt(Y7c,{SubpackageId:()=>mMh,WebSocketMessageId:()=>PMh,WebSocketMessageOrigin:()=>jMh,WebhookHttpMethod:()=>wMh,commons:()=>$7c,db:()=>H7c,read:()=>K7c,register:()=>J7c});var H7c={};Zt(H7c,{endpoint:()=>pMh});var pMh={};var K7c={};Zt(K7c,{SupportedLanguage:()=>_Mh,endpoint:()=>x7c,type_:()=>hMh,webhook:()=>yMh,websocket:()=>bMh});var x7c={};Zt(x7c,{SupportedLanguage:()=>_Mh});var _Mh={Curl:"curl",Python:"python",Javascript:"javascript",Js:"js",Node:"node",Typescript:"typescript",Ts:"ts",Go:"go",Ruby:"ruby",Csharp:"csharp"};var hMh={};var yMh={};var bMh={};var J7c={};Zt(J7c,{SourceId:()=>$lB,endpoint:()=>vMh,type_:()=>gMh,webhook:()=>OMh,websocket:()=>AMh});var vMh={};var gMh={};var OMh={};var AMh={};function $lB(e){return e}var $7c={};Zt($7c,{SubpackageId:()=>mMh,WebSocketMessageId:()=>PMh,WebSocketMessageOrigin:()=>jMh,WebhookHttpMethod:()=>wMh});function mMh(e){return e}function PMh(e){return e}var jMh={Client:"client",Server:"server"};var wMh={Get:"GET",Post:"POST"};var Z7c={};Zt(Z7c,{ApiDefinitionId:()=>EMh,ApiId:()=>BMh,Availability:()=>HMh,DocsConfigId:()=>IMh,EndpointId:()=>qMh,EndpointPathLiteral:()=>WMh,EnvironmentId:()=>CMh,FileId:()=>FMh,HttpMethod:()=>GMh,JqString:()=>UMh,OrgId:()=>MMh,PageId:()=>NMh,PropertyKey:()=>LMh,RoleId:()=>VMh,TokenId:()=>DMh,TypeId:()=>zMh,Url:()=>QMh,VersionId:()=>SMh,WebSocketId:()=>TMh,WebhookId:()=>RMh});function EMh(e){return e}function SMh(e){return e}function MMh(e){return e}function DMh(e){return e}function BMh(e){return e}function IMh(e){return e}function CMh(e){return e}function qMh(e){return e}function TMh(e){return e}function RMh(e){return e}function zMh(e){return e}function NMh(e){return e}function FMh(e){return e}function QMh(e){return e}function UMh(e){return e}function LMh(e){return e}function VMh(e){return e}function WMh(e){return e}var GMh={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE"};var HMh={Stable:"Stable",GenerallyAvailable:"GenerallyAvailable",InDevelopment:"InDevelopment",PreRelease:"PreRelease",Deprecated:"Deprecated",Beta:"Beta"};var xMh={};var uxc={};Zt(uxc,{latest:()=>txc,v1:()=>axc,v2:()=>oxc});var txc={};Zt(txc,{Layout:()=>JMh,MdxEngine:()=>YlB,TwitterCardSetting:()=>$Mh,commons:()=>KMh,frontmatter:()=>k7c,seo:()=>exc});var YlB={NextMdxRemote:"next-mdx-remote",MdxBundler:"mdx-bundler"};var KMh={};var k7c={};Zt(k7c,{Layout:()=>JMh});var JMh={Guide:"guide",Overview:"overview",Reference:"reference",Page:"page",Custom:"custom"};var exc={};Zt(exc,{TwitterCardSetting:()=>$Mh});var $Mh={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"};var axc={};Zt(axc,{commons:()=>nxc,db:()=>YMh,read:()=>XMh,write:()=>rxc});var YMh={};var XMh={};var rxc={};Zt(rxc,{DocsRegistrationId:()=>ZlB,FilePath:()=>XlB});function XlB(e){return e}function ZlB(e){return e}var nxc={};Zt(nxc,{ContentAlignment:()=>tDh,FontDisplay:()=>oDh,FontStyle:()=>aDh,HeaderPosition:()=>rDh,JsScriptStrategy:()=>nDh,ProgrammingLanguage:()=>ZMh,SearchbarPlacement:()=>kMh,TabsPlacement:()=>eDh,TwitterCardSetting:()=>iDh,commons:()=>ixc});var ixc={};Zt(ixc,{ContentAlignment:()=>tDh,FontDisplay:()=>oDh,FontStyle:()=>aDh,HeaderPosition:()=>rDh,JsScriptStrategy:()=>nDh,ProgrammingLanguage:()=>ZMh,SearchbarPlacement:()=>kMh,TabsPlacement:()=>eDh,TwitterCardSetting:()=>iDh});var ZMh={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 kMh={Header:"HEADER",HeaderTabs:"HEADER_TABS",Sidebar:"SIDEBAR"};var eDh={Header:"HEADER",Sidebar:"SIDEBAR"};var tDh={Center:"CENTER",Left:"LEFT"};var rDh={Fixed:"FIXED",Absolute:"ABSOLUTE"};var iDh={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"};var nDh={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"};var aDh={Normal:"normal",Italic:"italic"};var oDh={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"};var oxc={};Zt(oxc,{read:()=>uDh,write:()=>sDh});var uDh={};var sDh={};var cxc={};Zt(cxc,{ChangelogEntryType:()=>lDh,GeneratorId:()=>klB,GeneratorLanguage:()=>efB,ReleaseType:()=>fDh,cli:()=>cDh,commons:()=>sxc,versions:()=>dDh});var cDh={};var sxc={};Zt(sxc,{ChangelogEntryType:()=>lDh,ReleaseType:()=>fDh});var lDh={Fix:"fix",Feat:"feat",Chore:"chore",Break:"break",Internal:"internal"};var fDh={Ga:"GA",Rc:"RC"};var dDh={};function klB(e){return e}var efB={Python:"python",Go:"go",Java:"java",Typescript:"typescript",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust"};var lxc={};Zt(lxc,{PullRequestState:()=>pDh});var pDh={Open:"open",Closed:"closed",Merged:"merged"};var pxc={};Zt(pxc,{latest:()=>fxc,v1:()=>dxc});var fxc={};Zt(fxc,{NodeId:()=>ifB,ProductId:()=>nfB,Slug:()=>tfB,TabId:()=>rfB});function tfB(e){return e}function rfB(e){return e}function ifB(e){return e}function nfB(e){return e}var dxc={};Zt(dxc,{NavigationV1Availability:()=>cfB,NodeId:()=>ufB,ProductId:()=>sfB,Slug:()=>afB,TabId:()=>ofB});function afB(e){return e}function ofB(e){return e}function ufB(e){return e}function sfB(e){return e}var cfB={Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Beta:"beta",Deprecated:"deprecated"};var hxc={};Zt(hxc,{Language:()=>_Dh,VersionBump:()=>hDh,versions:()=>_xc});var _xc={};Zt(_xc,{Language:()=>_Dh,VersionBump:()=>hDh});var _Dh={Go:"Go",TypeScript:"TypeScript",Java:"Java",Python:"Python",Csharp:"Csharp",Ruby:"Ruby"};var hDh={Major:"MAJOR",Minor:"MINOR",Patch:"PATCH"};var yDh={};var bDh={};var yxc={};Zt(yxc,{PayloadLocation:()=>vDh});var vDh={Body:"BODY",Query:"QUERY",Path:"PATH",Headers:"HEADERS",Relative:"RELATIVE",Auth:"AUTH"};var gDh={};var Rgu=class{warnings=[];errors=[];error(t){this.errors.push(t)}warning(t){this.warnings.push(t)}};function No(e){return e!=null}var ADh=ce(TFa(),1);var ODh=["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"];function EYt(e){return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.replace(/_/g," "),e=e.replace(/-/g," "),(0,ADh.default)(e,{special:ODh}).replace(/V\s(\d)/g,"V$1")}function mDh({endpoints:e,webhookEndpoints:t}){let r={};return Object.values({...e,...t}).forEach(i=>{let n=[];i.namespace?.forEach(a=>{let o=[...n,a],c=Ys.api.v1.SubpackageId(o.join("."));r[c]={id:c,name:a,displayName:EYt(a)},n.push(a)})}),r}var zgu=class{input;context;constructor(t,r){this.input=t,this.context=r}errors(){return this.context.errors.errors}warnings(){return this.context.errors.warnings}};function PDh(e){return`#/${e.map(t=>t.replaceAll(/~/g,"~0").replaceAll(/\//g,"~1")).join("/")}`}var po=class extends zgu{context;accessPath;pathId;constructor({input:t,context:r,accessPath:i,pathId:n}){if(super(t,r),this.context=r,this.accessPath=[...i],this.pathId=n,n!=null){let a=Array.isArray(this.pathId)?this.pathId:[this.pathId];a.every((o,c)=>o===this.accessPath[this.accessPath.length-a.length+c])||this.accessPath.push(...a)}r.logger.debug(`Processing ${PDh(this.accessPath)}`)}safeParse(...t){try{this.parse(...t)}catch{this.context.errors.error({message:"Error converting node. Please contact support if the error persists",path:this.accessPath})}}},iC=class extends po{},K$=class extends iC{seenSchemas;constructor(t){super(t),this.seenSchemas=new Set(t.seenSchemas)}};var jDh="x-fern-base-path",wDh="x-fern-availability",Ngu="x-fern-sdk-group-name",EDh="x-fern-global-headers",SDh="x-fern-sdk-method-name";var MDh="x-fern-webhook",DDh="x-fern-access-token-locator",BDh="x-fern-basic",IDh="x-fern-username-variable-name",CDh="x-fern-password-variable-name",qDh="x-fern-bearer",TDh="x-fern-token-variable-name",RDh="x-fern-header",zDh="x-fern-header-variable-name",NDh="x-fern-server-name",FDh="x-fern-examples";var Fgu=class extends po{serverName;constructor(t){super(t),this.safeParse()}parse(){this.serverName=this.input[NDh]}convert(){if(this.serverName!=null)return this.serverName}};var Qgu=class extends po{url;serverName;constructor(t){super(t),this.safeParse()}parse(){this.url=Object.entries(this.input.variables??{}).reduce((t,[r,i])=>t.replace(`{${r}}`,i.default),this.input.url)??this.input.url,this.serverName=new Fgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId})}convert(){let t=this.serverName?.convert()??this.url;if(!(this.url==null||t==null))return{id:Ys.EnvironmentId(t),baseUrl:this.url}}};function i$i(e,t,r,i){let n=e??[],a=new Set(n.map(c=>c.url)),o=(t??[]).filter(c=>!a.has(c.url)).map((c,d)=>new Qgu({input:c,context:r,accessPath:i,pathId:["servers",`${d}`]}));return[...n,...o]}function zv(e){return typeof e=="object"&&No(e)&&"$ref"in e&&typeof e.$ref=="string"}function iL(e,t,r){let i=e.$ref.substring(2).split("/").map(a=>a.replace(/~1/g,"/")),n=t;for(let a of i){if(typeof n!="object"||n==null)return r;n=n[a]}return n==null?r:(zv(n)&&(n=iL(n,t,r)),n)}function Ugu(e,t){let r=t.components?.securitySchemes?.[e];if(r!=null)return zv(r)?iL(r,t,void 0):r}var DBh=ce(VS());var Lgu=class extends po{username;password;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[BDh];this.username=t?.username,this.password=t?.password}convert(){return{username:this.username,password:this.password}}};var Vgu=class extends po{passwordVariableName;constructor(t){super(t),this.safeParse()}parse(){this.passwordVariableName=this.input[CDh]}convert(){return this.passwordVariableName}};var Wgu=class extends po{usernameVariableName;constructor(t){super(t),this.safeParse()}parse(){this.usernameVariableName=this.input[IDh]}convert(){return this.usernameVariableName}};var Ggu=class extends po{bearerTokenVariableName;bearerTokenEnvVar;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[qDh];this.bearerTokenVariableName=t?.name,this.bearerTokenEnvVar=t?.env}convert(){return{tokenVariableName:this.bearerTokenVariableName,tokenEnvVar:this.bearerTokenEnvVar}}};var Hgu=class extends po{tokenVariableName;constructor(t){super(t),this.safeParse()}parse(){this.tokenVariableName=this.input[TDh]}convert(){return this.tokenVariableName}};function QDh(e){return typeof e=="object"&&e!=null&&"in"in e&&e.in==="header"}var UDh="x-bearer-format",LDh="x-code-samples",VDh="x-codeSamples";var xgu=class extends po{bearerFormat;constructor(t){super(t),this.safeParse()}parse(){this.bearerFormat=this.input[UDh]}convert(){return this.bearerFormat}};var Kgu=class extends po{headerVariableName;headerEnvVar;headerPrefix;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[RDh];this.headerVariableName=t?.name,this.headerEnvVar=t?.env,this.headerPrefix=t?.prefix}convert(){return{name:this.headerVariableName,env:this.headerEnvVar,prefix:this.headerPrefix}}};var Jgu=class extends po{headerVariableName;constructor(t){super(t),this.safeParse()}parse(){this.headerVariableName=this.input[zDh]}convert(){return this.headerVariableName}};function WDh(e){return e.type==="apiKey"}var mua=class extends po{headerName;headerBearerFormatNode;headerAuthNode;headerVariableNameNode;constructor(t){super(t),this.safeParse()}parse(){WDh(this.input)&&(this.headerName=this.input.name),this.headerAuthNode=new Kgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.headerVariableNameNode=new Jgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.headerBearerFormatNode=new xgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId})}convert(){let t=this.headerAuthNode?.convert();if(t!=null)return{type:"header",nameOverride:t?.name,headerWireValue:this.headerName??"Authorization",prefix:t?.prefix??this.headerBearerFormatNode?.convert()}}};function $gu(e){return e}function Ygu(e){return e==="__proto__"}function Xgu(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function Pua(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function AKa(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(AKa).join(",");let t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function Zgu(e){if(Array.isArray(e))return e.map(Pua);if(typeof e=="symbol")return[e];e=AKa(e);let t=[],r=e.length;if(r===0)return t;let i=0,n="",a="",o=!1;for(e.charCodeAt(0)===46&&(t.push(""),i++);i<r;){let c=e[i];a?c==="\\"&&i+1<r?(i++,n+=e[i]):c===a?a="":n+=c:o?c==='"'||c==="'"?a=c:c==="]"?(o=!1,t.push(n),n=""):n+=c:c==="["?(o=!0,n&&(t.push(n),n="")):c==="."?n&&(t.push(n),n=""):n+=c,i++}return n&&t.push(n),t}function mKa(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(Ygu(t))return r;let i=e[t];return i===void 0?Xgu(t)?mKa(e,Zgu(t),r):r:i}case"number":case"symbol":{typeof t=="number"&&(t=Pua(t));let i=e[t];return i===void 0?r:i}default:{if(Array.isArray(t))return lfB(e,t,r);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),Ygu(t))return r;let i=e[t];return i===void 0?r:i}}}function lfB(e,t,r){if(t.length===0)return r;let i=e;for(let n=0;n<t.length;n++){if(i==null||Ygu(t[n]))return r;i=i[t[n]]}return i===void 0?r:i}function GDh(e){return function(t){return mKa(t,e)}}function HDh(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function kgu(e){return e==null||typeof e!="object"&&typeof e!="function"}function bxc(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function gxc(e,t,r){return typeof r!="function"?gxc(e,t,()=>{}):vxc(e,t,function i(n,a,o,c,d,s){let u=r(n,a,o,c,d,s);return u!==void 0?!!u:vxc(n,a,i,s)},new Map)}function vxc(e,t,r,i){if(t===e)return!0;switch(typeof t){case"object":return ffB(e,t,r,i);case"function":return Object.keys(t).length>0?vxc(e,{...t},r,i):bxc(e,t);default:return HDh(e)?typeof t=="string"?t==="":!0:bxc(e,t)}}function ffB(e,t,r,i){if(t==null)return!0;if(Array.isArray(t))return xDh(e,t,r,i);if(t instanceof Map)return dfB(e,t,r,i);if(t instanceof Set)return pfB(e,t,r,i);let n=Object.keys(t);if(e==null)return n.length===0;if(n.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let a=0;a<n.length;a++){let o=n[a];if(!kgu(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!r(e[o],t[o],o,e,t,i))return!1}return!0}finally{i?.delete(t)}}function dfB(e,t,r,i){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[n,a]of t.entries()){let o=e.get(n);if(r(o,a,n,e,t,i)===!1)return!1}return!0}function xDh(e,t,r,i){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let n=new Set;for(let a=0;a<t.length;a++){let o=t[a],c=!1;for(let d=0;d<e.length;d++){if(n.has(d))continue;let s=e[d],u=!1;if(r(s,o,a,e,t,i)&&(u=!0),u){n.add(d),c=!0;break}}if(!c)return!1}return!0}function pfB(e,t,r,i){return t.size===0?!0:e instanceof Set?xDh([...e],[...t],r,i):!1}function eOu(e,t){return gxc(e,t,()=>{})}function KDh(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function tOu(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var JDh="[object RegExp]",rOu="[object String]",iOu="[object Number]",nOu="[object Boolean]",aOu="[object Arguments]",$Dh="[object Symbol]",YDh="[object Date]",XDh="[object Map]",ZDh="[object Set]",kDh="[object Array]";var eBh="[object ArrayBuffer]",tBh="[object Object]";var rBh="[object DataView]",iBh="[object Uint8Array]",nBh="[object Uint8ClampedArray]",aBh="[object Uint16Array]",oBh="[object Uint32Array]";var uBh="[object Int8Array]",sBh="[object Int16Array]",cBh="[object Int32Array]";var lBh="[object Float32Array]",fBh="[object Float64Array]";function dBh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pBh(e,t){return n$i(e,void 0,e,new Map,t)}function n$i(e,t,r,i=new Map,n=void 0){let a=n?.(e,t,r,i);if(a!==void 0)return a;if(kgu(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){let o=new Array(e.length);i.set(e,o);for(let c=0;c<e.length;c++)o[c]=n$i(e[c],c,r,i,n);return Object.hasOwn(e,"index")&&(o.index=e.index),Object.hasOwn(e,"input")&&(o.input=e.input),o}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let o=new RegExp(e.source,e.flags);return o.lastIndex=e.lastIndex,o}if(e instanceof Map){let o=new Map;i.set(e,o);for(let[c,d]of e)o.set(c,n$i(d,c,r,i,n));return o}if(e instanceof Set){let o=new Set;i.set(e,o);for(let c of e)o.add(n$i(c,void 0,r,i,n));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(dBh(e)){let o=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,o);for(let c=0;c<e.length;c++)o[c]=n$i(e[c],c,r,i,n);return o}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let o=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,o),n8t(o,e,r,i,n),o}if(typeof File<"u"&&e instanceof File){let o=new File([e],e.name,{type:e.type});return i.set(e,o),n8t(o,e,r,i,n),o}if(typeof Blob<"u"&&e instanceof Blob){let o=new Blob([e],{type:e.type});return i.set(e,o),n8t(o,e,r,i,n),o}if(e instanceof Error){let o=new e.constructor;return i.set(e,o),o.message=e.message,o.name=e.name,o.stack=e.stack,o.cause=e.cause,n8t(o,e,r,i,n),o}if(e instanceof Boolean){let o=new Boolean(e.valueOf());return i.set(e,o),n8t(o,e,r,i,n),o}if(e instanceof Number){let o=new Number(e.valueOf());return i.set(e,o),n8t(o,e,r,i,n),o}if(e instanceof String){let o=new String(e.valueOf());return i.set(e,o),n8t(o,e,r,i,n),o}if(typeof e=="object"&&_fB(e)){let o=Object.create(Object.getPrototypeOf(e));return i.set(e,o),n8t(o,e,r,i,n),o}return e}function n8t(e,t,r=e,i,n){let a=[...Object.keys(t),...KDh(t)];for(let o=0;o<a.length;o++){let c=a[o],d=Object.getOwnPropertyDescriptor(e,c);(d==null||d.writable)&&(e[c]=n$i(t[c],c,r,i,n))}}function _fB(e){switch(tOu(e)){case aOu:case kDh:case eBh:case rBh:case nOu:case YDh:case lBh:case fBh:case uBh:case sBh:case cBh:case XDh:case iOu:case tBh:case JDh:case ZDh:case rOu:case $Dh:case iBh:case nBh:case aBh:case oBh:return!0;default:return!1}}function _Bh(e){return n$i(e,void 0,e,new Map,void 0)}function hBh(e){return e=_Bh(e),t=>eOu(t,e)}function yBh(e,t){return pBh(e,(r,i,n,a)=>{let o=t?.(r,i,n,a);if(o!==void 0)return o;if(typeof e=="object")switch(Object.prototype.toString.call(e)){case iOu:case rOu:case nOu:{let c=new e.constructor(e?.valueOf());return n8t(c,e),c}case aOu:{let c={};return n8t(c,e),c.length=e.length,c[Symbol.iterator]=e[Symbol.iterator],c}default:return}})}function bBh(e){return yBh(e)}var hfB=/^(?:0|[1-9]\d*)$/;function vBh(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return hfB.test(e)}}function gBh(e){return e!==null&&typeof e=="object"&&tOu(e)==="[object Arguments]"}function OBh(e,t){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&Xgu(t)&&e?.[t]==null?r=Zgu(t):r=[t],r.length===0)return!1;let i=e;for(let n=0;n<r.length;n++){let a=r[n];if((i==null||!Object.hasOwn(i,a))&&!((Array.isArray(i)||gBh(i))&&vBh(a)&&a<i.length))return!1;i=i[a]}return!0}function ABh(e,t){switch(typeof e){case"object":{Object.is(e?.valueOf(),-0)&&(e="-0");break}case"number":{e=Pua(e);break}}return t=bBh(t),function(r){let i=mKa(r,e);return i===void 0?OBh(r,e):t===void 0?i===void 0:eOu(i,t)}}function mBh(e){if(e==null)return $gu;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?ABh(e[0],e[1]):hBh(e);case"string":case"symbol":case"number":return GDh(e)}}function PBh(e,t){let r={},i=Object.keys(e);for(let n=0;n<i.length;n++){let a=i[n],o=e[a];r[a]=t(o,a,e)}return r}function oOu(e,t=$gu){return e==null?{}:PBh(e,mBh(t))}function jBh(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}var yfB=new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+","gu");function wBh(e){return Array.from(e.match(yfB)??[])}function EBh(e){let t=wBh(e);if(t.length===0)return"";let[r,...i]=t;return`${r.toLowerCase()}${i.map(n=>jBh(n)).join("")}`}function SBh(e){return typeof e!="string"&&(e=AKa(e)),e.replace(/['\u2019]/g,"")}function a8t(e){return EBh(SBh(e))}function RP(e){if(e!=null)return Array.isArray(e)?e:[e]}function uOu({namespace:e,path:t,method:r,sdkMethodName:i,operationId:n,displayName:a,isWebhook:o}){if(t==null)return;let c=r!=null&&t!=null?`${r}_${t.split("/").join("_")}`:r??t.split("/").join("_");if(!(i==null&&n==null&&a==null&&c==null))return`${bfB(o)}${vfB(e)}.${gfB(i,n,a,c)}`}function bfB(e){return e?"webhook_":"endpoint_"}function vfB(e){return e!=null?RP(e)?.map(t=>a8t(t)).join("/"):""}function gfB(e,t,r,i){return e||t||a8t(r??"")||a8t(i??"")}function MBh(e){return e.length===0?!1:/^\$?(\.[\w*]+|\[['"][\w*]+['"]?\]|\[['"]?[\d*]+['"]?\]|\[[\d:]+\])*$/.test(e)}var sOu=class extends po{accessTokenLocator;constructor(t){super(t),this.safeParse()}parse(){this.accessTokenLocator=this.input[DDh],this.accessTokenLocator!=null&&(MBh(this.accessTokenLocator)||(this.context.errors.error({message:"Invalid access token locator, must be a valid jq path",path:this.accessPath}),this.accessTokenLocator=void 0))}convert(){return this.accessTokenLocator}};var cOu=class extends po{authorizationUrl;headerAuthNode;accessTokenLocatorNode;constructor(t){super(t),this.safeParse()}parse(){if(this.input.flows.clientCredentials!=null){let t=this.input.flows.clientCredentials;this.authorizationUrl=t.tokenUrl,this.authorizationUrl==null&&this.context.errors.error({message:"Expected 'tokenUrl' property to be specified",path:this.accessPath}),this.headerAuthNode=new mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.accessTokenLocatorNode=new sOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.authorizationUrl==null&&this.context.errors.error({message:"Expected 'tokenUrl' property to be specified",path:this.accessPath}),this.accessTokenLocatorNode?.accessTokenLocator==null&&this.context.errors.error({message:"Expected 'x-fern-access-token-locator' property to be specified",path:this.accessPath})}}convert(){let t=this.accessTokenLocatorNode?.convert();if(t==null||this.authorizationUrl==null)return{type:"bearerAuth",tokenName:void 0};let r=uOu({namespace:void 0,path:this.authorizationUrl,method:"POST",sdkMethodName:void 0,operationId:void 0,displayName:void 0,isWebhook:void 0});if(r!=null)return{type:"oAuth",value:{type:"clientCredentials",value:{type:"referencedEndpoint",endpointId:Ys.EndpointId(r),accessTokenLocator:Ys.JqString(t),headerName:this.headerAuthNode?.convert()?.headerWireValue,tokenPrefix:this.headerAuthNode?.convert()?.prefix}}}}};var jua=class extends po{authScheme;headerAuthNode;bearerTokenNode;bearerTokenVariableNameNode;basicAuthNode;basicUsernameVariableNameNode;basicPasswordVariableNameNode;oauth2Node;constructor(t){super(t),this.safeParse()}parse(){switch(this.input.type){case"http":switch(this.input.scheme){case"basic":{this.authScheme="basic",this.basicAuthNode=new Lgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.basicUsernameVariableNameNode=new Wgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.basicPasswordVariableNameNode=new Vgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),(this.basicAuthNode==null||this.basicAuthNode.username==null&&this.basicUsernameVariableNameNode?.usernameVariableName==null||this.basicAuthNode.password==null&&this.basicPasswordVariableNameNode?.passwordVariableName==null)&&this.context.errors.warning({message:"Basic auth should specify either a username or a username variable name",path:this.accessPath});break}case"bearer":{this.authScheme="bearer",this.bearerTokenNode=new Ggu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),this.bearerTokenVariableNameNode=new Hgu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});break}default:{this.context.errors.warning({message:`Unsupported HTTP auth scheme: ${this.input.scheme}`,path:this.accessPath});break}}break;case"apiKey":{QDh(this.input)?(this.authScheme="header",this.headerAuthNode=new mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId})):this.context.errors.error({message:`Unsupported API key location: ${this.input.in}`,path:this.accessPath});break}case"oauth2":{this.authScheme="oauth",this.oauth2Node=new cOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});break}case"openIdConnect":{this.authScheme="bearer";break}}}convert(){switch(this.authScheme){case"basic":{let t=this.basicAuthNode?.convert();return{type:"basicAuth",usernameName:t?.username?.name??this.basicUsernameVariableNameNode?.convert(),passwordName:t?.password?.name??this.basicPasswordVariableNameNode?.convert()}}case"bearer":return{type:"bearerAuth",tokenName:this.bearerTokenNode?.convert()?.tokenVariableName??this.bearerTokenVariableNameNode?.convert()};case"header":return this.headerAuthNode?.convert();case"oauth":return this.oauth2Node?.convert();case void 0:return;default:new DBh.UnreachableCaseError(this.authScheme);return}}};var wua=class extends po{authNodesMap;constructor(t){super(t),this.safeParse()}parse(){this.input.map((t,r)=>Object.keys(t).map(i=>{let n=Ugu(i,this.context.document);if(n==null){this.context.errors.warning({message:`No auth scheme found for ${i}. Inline security schemes are not supported.`,path:this.accessPath});return}let a=new jua({input:n,context:this.context,accessPath:this.accessPath,pathId:["security",`${r}`]});a.convert()!=null?(this.authNodesMap??={},this.authNodesMap[i]=a):this.context.errors.warning({message:`No auth scheme found for ${i}`,path:this.accessPath})}))}convert(){return Object.fromEntries(Object.entries(this.authNodesMap??{}).map(([t,r])=>{let i=r.convert();if(i!=null)return[t,i]}).filter(No))}};var lOu=class extends po{basePath;constructor(t){super(t),this.safeParse()}parse(){this.basePath=this.input[jDh],this.basePath!=null?(this.basePath.startsWith("/")&&(this.basePath=this.basePath.slice(1)),this.basePath.endsWith("/")&&(this.basePath=this.basePath.slice(0,-1))):this.basePath=void 0}convert(){return this.basePath}};function BBh(e){return"required"in e&&typeof e.required=="boolean"?e.required:!1}function IBh(e,t){return{type:"alias",value:{type:"optional",shape:e,default:t}}}function Eua(e,t){return e==null?void 0:Object.entries(e).map(([i,n])=>RP(n.convert())?.map(o=>((t!=null&&!t.includes(i)||t==null&&!BBh(n))&&(o=IBh(o,o.type==="enum"?o.default:void 0)),{key:Ys.PropertyKey(i),valueShape:o,description:n.description,availability:n.availability?.convert()})).filter(No)).filter(No).reduce((i,n)=>i.flatMap(a=>n.length>0?n.map(o=>[...a,o]):[[...a]]),[[]])}function fOu(e,t){return zv(e)?iL(e,t,void 0):e}function a$i(e,t){return e!=null&&e!==""?e:t!=null&&t!==""?t:void 0}function CBh(e,t){let r={...e};for(let[i,n]of Object.entries(t??{}))r[i]=[...r[i]??[],...n];return Object.keys(r).length>0?r:void 0}function qBh(e,t){if(e==null)return t;if(t==null)return e;let r=[];for(let i of e)for(let n of t)r.push({path:i.path??n.path,responseStatusCode:i.responseStatusCode??n.responseStatusCode,name:i.name??n.name,description:i.description??n.description,pathParameters:i.pathParameters??n.pathParameters,queryParameters:i.queryParameters??n.queryParameters,headers:i.headers??n.headers,requestBody:i.requestBody??n.requestBody,responseBody:i.responseBody??n.responseBody,snippets:{...n.snippets,...i.snippets}});return r}var TBh=ce(VS());var Oxc=["decimal","decimal128","double-int","double","float","sf-decimal"],Axc=["int16","int32","int64","int8","sf-integer","uint8"],mxc=["base64url","binary","byte","char","commonmark","date-time","date","decimal","decimal128","duration","email","hostname","html","http-date","idn-email","idn-hostname","int64","ipv4","ipv6","iri-reference","iri","json-pointer","media-range","password","regex","relative-json-pointer","sf-binary","sf-boolean","sf-string","sf-token","time","uri-reference","uri-template","uri","uuid"],Pxc=["beta","pre-release","in-development","generally-available","deprecated"];function nC(e,t){return zv(e)?iL(e,t,{type:"unknown","x-fern-type":"unknown",additionalProperties:!1}):e}var FEe=class extends po{availability;constructor(t){super(t),this.safeParse()}parse(){if(nC(this.input,this.context.document)?.deprecated)this.availability="deprecated";else{let r=this.input[wDh];r!=null&&(Pxc.includes(r)?this.availability=r:(this.context.errors.warning({message:`Expected one of: ${Pxc.join(", ")}. Received: ${r}`,path:this.accessPath}),this.availability=void 0))}}convert(){switch(this.availability){case"beta":case"pre-release":return Ys.Availability.Beta;case"in-development":return Ys.Availability.InDevelopment;case"generally-available":return Ys.Availability.GenerallyAvailable;case"deprecated":return Ys.Availability.Deprecated;case void 0:return;default:new TBh.UnreachableCaseError(this.availability);return}}};var pOu=ce(VS());function RBh(e){return typeof e=="object"&&e!=null&&"language"in e}function zBh(e){return typeof e=="object"&&e!=null&&"sdk"in e}function NBh(e){return typeof e=="object"&&e!=null&&("error"in e||"body"in e)}function FBh(e){return typeof e=="object"&&e!=null&&"stream"in e&&Array.isArray(e.stream)}function dOu(e){return typeof e=="object"&&e!=null&&"event"in e}function jxc(e){return typeof e=="object"&&e!=null&&"stream"in e&&Array.isArray(e.stream)&&e.stream.every(dOu)}function o$i(e){return typeof e=="object"&&e!=null&&"filename"in e&&"data"in e&&typeof e.filename=="string"&&typeof e.data=="string"}function QBh(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}var _Ou=class extends po{path;successResponseStatusCode;requestBodyByContentType;responseBodies;examples;constructor(t,r,i,n,a){super(t),this.path=r,this.successResponseStatusCode=i,this.requestBodyByContentType=n,this.responseBodies=a,this.safeParse()}parse(){this.examples=this.input[FDh]}convertFormDataExampleRequest(t,r){if(t.fields!=null)switch(t.contentType){case"form-data":return{type:"form",value:Object.fromEntries(Object.entries(t.fields).map(([n,a])=>{let o=typeof r=="object"?r[n]:void 0;switch(a.multipartType){case"file":return o$i(o)?[n,{type:"filenameWithData",filename:o.filename,data:Ys.FileId(o.data)}]:o!=null?[n,{type:"filename",value:o}]:void 0;case"files":{if(Array.isArray(o)){if(o.every(c=>o$i(c)))return[n,{type:"filenamesWithData",value:o.map(c=>({filename:c.filename,data:Ys.FileId(c.data)}))}];if(o.every(c=>typeof c=="string"))return[n,{type:"filenames",value:o}]}return}case"property":return[n,{type:"json",value:o}];case void 0:return;default:new pOu.UnreachableCaseError(a.multipartType);return}}).filter(No))};case"json":return{type:"json",value:r};case"bytes":return typeof r=="string"?{type:"bytes",value:{type:"base64",value:r}}:void 0;default:return}}convert(){if(this.examples==null)return;this.requestBodyByContentType!=null&&Object.keys(this.requestBodyByContentType).length>1&&this.context.logger.warn(`Multiple request bodies found for #/${[this.accessPath,this.pathId,"x-fern-examples"].join("/")}. Coercing to first request body until supported.`);let t=Object.keys(this.requestBodyByContentType??{})[0];return this.examples.flatMap(r=>(this.responseBodies??[]).map(i=>{let n=t!=null?this.requestBodyByContentType?.[t]:void 0,a;if(n!=null)switch(n.contentType){case"form-data":a=QBh(r.request)?this.convertFormDataExampleRequest(n,r.request):void 0;break;case"json":a=r.request!=null?{type:"json",value:r.request}:void 0;break;case"bytes":a=typeof r.request=="string"&&r.request!=null?{type:"bytes",value:{type:"base64",value:r.request}}:void 0;break;case void 0:break;default:new pOu.UnreachableCaseError(n.contentType);break}let o;switch(i.contentType){case"application/json":{NBh(r.response)&&(o={type:"json",value:r.response.body});break}case"text/event-stream":{jxc(r.response)&&(o={type:"sse",value:r.response.stream.map(f=>({event:f.event,data:f.data}))});break}case"application/octet-stream":!jxc(r.response)&&FBh(r.response)&&(o={type:"stream",value:r.response.stream});break;case void 0:break;default:new pOu.UnreachableCaseError(i.contentType);break}let c={};r["code-samples"]?.forEach(f=>{RBh(f)?f.language!=null&&(c[f.language]??=[],c[f.language]?.push({name:f.name,language:f.language,install:f.install,code:f.code,generated:!1,description:f.docs})):zBh(f)&&f.sdk!=null&&(c[f.sdk]??=[],c[f.sdk]?.push({name:f.name,language:f.sdk,install:void 0,code:f.code,generated:!1,description:f.docs}))});let d=Object.fromEntries(Object.entries(r["path-parameters"]??{}).map(([f,p])=>[Ys.PropertyKey(f),p])),s=Object.fromEntries(Object.entries(r["query-parameters"]??{}).map(([f,p])=>[Ys.PropertyKey(f),p])),u=Object.fromEntries(Object.entries(r.headers??{}).map(([f,p])=>[Ys.PropertyKey(f),p]));return{path:this.path,responseStatusCode:this.successResponseStatusCode,name:r.name,description:r.docs,pathParameters:Object.keys(d).length>0?d:void 0,queryParameters:Object.keys(s).length>0?s:void 0,headers:Object.keys(u).length>0?u:void 0,requestBody:a,responseBody:o,snippets:c}}))}};var PKa=class extends po{groupName;constructor(t){super(t),this.safeParse()}parse(){this.groupName=this.input[Ngu]}convert(){if(this.groupName==null)return;let t;return Array.isArray(this.groupName)?t=this.groupName:t=[this.groupName],t.map(r=>Ys.api.v1.SubpackageId(a8t(r)))}};var hOu=class extends po{sdkMethodName;constructor(t){super(t),this.safeParse()}parse(){this.sdkMethodName=this.input[SDh]}convert(){return this.sdkMethodName}};var yOu=class extends po{isWebhook;constructor(t){super(t),this.safeParse()}parse(){this.isWebhook=this.input[MDh]}convert(){return this.isWebhook}};var bOu=class extends po{codeSamples;constructor(t){super(t),this.safeParse()}parse(){this.codeSamples=[...this.input[LDh]??[],...this.input[VDh]??[]],this.codeSamples.forEach(t=>{[...Object.values(Ys.api.v1.read.SupportedLanguage),"Kotlin","Swift","PHP"].map(r=>r.toLowerCase()).includes(t.lang.toLowerCase())||this.context.errors.warning({message:`Unsupported language: ${t.lang}. This may not render correctly.`,path:this.accessPath})})}convert(){let t={};if(this.codeSamples?.forEach(r=>{t[r.lang.toLowerCase()]??=[],t[r.lang.toLowerCase()]?.push({name:r.label,language:r.lang,code:r.source,install:void 0,generated:!1,description:void 0})}),Object.keys(t).length!==0)return t}};var _vn=ce(VS());function wxc(e,t){return zv(e)?iL(e,t,void 0):e}function UBh(e,t){return e.replace(/{(\w+)}/g,(r,i)=>t[i]!=null&&typeof t[i]=="string"||typeof t[i]=="number"||typeof t[i]=="boolean"?`${t[i]}`:r)}var aF="",SYt=class extends po{path;responseStatusCode;name;shapes;resolvedRequestInput;resolvedResponseInput;summary;constructor(t,r,i,n,a){super(t),this.path=r,this.responseStatusCode=i,this.name=n,this.shapes=a,this.safeParse()}validateFormDataRequestExample(){return typeof this.resolvedRequestInput?.value!="object"?!1:Object.entries(this.shapes.requestBody?.fields??{}).reduce((t,[r,i])=>{let n=this.resolvedRequestInput?.value[r];switch(i.multipartType){case"file":return t&&(o$i(n)||typeof n=="string");case"files":return t&&Array.isArray(n)&&n.every(a=>o$i(a)||typeof a=="string");case"property":return t;case void 0:return t&&!1;default:return new _vn.UnreachableCaseError(i.multipartType),t}},!0)}parse(){let t=this.shapes.requestBody?.schema?.example({includeOptionals:!1,override:void 0});this.resolvedRequestInput=wxc(this.input?.requestExample,this.context.document)??(t!=null?{value:t}:void 0);let r=this.shapes.responseBody?.schema?.example({includeOptionals:!1,override:void 0});if(this.resolvedResponseInput=wxc(this.input?.responseExample,this.context.document)??(r!=null?{value:r}:void 0),this.summary=this.input?.requestExample?.summary??this.input?.responseExample?.summary,this.shapes.requestBody!=null&&this.resolvedRequestInput!=null)switch(this.shapes.requestBody?.contentType){case"json":{if(typeof this.resolvedRequestInput.value!="object"){this.context.errors.error({message:"Invalid example, expected object for json",path:this.accessPath});return}break}case"bytes":{if(typeof this.resolvedRequestInput.value!="string"){this.context.errors.error({message:"Invalid example, expected string for bytes",path:this.accessPath});return}break}case"form-data":{if(!this.validateFormDataRequestExample()){this.context.errors.error({message:"Invalid example, expected valid form-data",path:this.accessPath});return}break}case void 0:break;default:new _vn.UnreachableCaseError(this.shapes.requestBody?.contentType),this.context.errors.error({message:"Invalid example, unsupported content type",path:this.accessPath});return}if(this.shapes.responseBody!=null&&this.resolvedResponseInput!=null)switch(this.shapes.responseBody?.contentType){case"application/json":if(this.resolvedResponseInput!=null&&typeof this.resolvedResponseInput!="object"||this.resolvedResponseInput.value!=null&&typeof this.resolvedResponseInput.value!="object"){this.context.errors.error({message:"Invalid example, expected object for json",path:this.accessPath});return}break;case"text/event-stream":if(this.resolvedResponseInput.value!=null&&!Array.isArray(this.resolvedResponseInput.value)&&!this.resolvedResponseInput.value.every(dOu)){this.context.errors.error({message:"Invalid example, expected array of SSE events for event-stream",path:this.accessPath});return}break;case"application/octet-stream":if(this.resolvedResponseInput.value!=null&&typeof this.resolvedResponseInput.value!="string"&&!Array.isArray(this.resolvedResponseInput.value)){this.context.errors.error({message:"Invalid example, expected string or array for octet-stream",path:this.accessPath});return}break;case void 0:break;default:new _vn.UnreachableCaseError(this.shapes.responseBody?.contentType);return}}convertFormDataExampleRequest(){if(!(this.resolvedRequestInput==null||this.shapes.requestBody?.fields==null))switch(this.shapes.requestBody?.contentType){case"form-data":return{type:"form",value:Object.fromEntries(Object.entries(this.shapes.requestBody.fields).map(([r,i])=>{let n=this.resolvedRequestInput?.value?.[r];switch(i.multipartType){case"file":return o$i(n)?[r,{type:"filenameWithData",filename:n.filename,data:Ys.FileId(n.data)}]:[r,{type:"filename",value:n}];case"files":{if(Array.isArray(n)){if(n.every(a=>o$i(a)))return[r,{type:"filenamesWithData",value:n.map(a=>({filename:a.filename,data:Ys.FileId(a.data)}))}];if(n.every(a=>typeof a=="string"))return[r,{type:"filenames",value:n}]}return}case"property":return[r,{type:"json",value:n}];case void 0:return;default:new _vn.UnreachableCaseError(i.multipartType);return}}).filter(No))};case"json":return{type:"json",value:this.resolvedRequestInput.value};case"bytes":return typeof this.resolvedRequestInput.value=="string"?{type:"bytes",value:{type:"base64",value:this.resolvedRequestInput.value}}:void 0;default:return}}convertDescription(){if(this.resolvedRequestInput!=null&&this.resolvedResponseInput!=null)return this.resolvedResponseInput.description;if(this.resolvedRequestInput!=null)return this.resolvedRequestInput.description;if(this.resolvedResponseInput!=null)return this.resolvedResponseInput.description}convert(){let t;if(this.shapes.requestBody!=null&&this.resolvedRequestInput!=null)switch(this.shapes.requestBody.contentType){case"form-data":t=this.convertFormDataExampleRequest();break;case"json":t={type:"json",value:this.resolvedRequestInput.value};break;case"bytes":t={type:"bytes",value:{type:"base64",value:this.resolvedRequestInput.value}};break;case void 0:break;default:new _vn.UnreachableCaseError(this.shapes.requestBody?.contentType);break}let r;if(this.shapes.responseBody!=null&&this.resolvedResponseInput!=null)switch(this.shapes.responseBody.contentType){case"application/json":{r={type:"json",value:this.resolvedResponseInput?.value??this.resolvedResponseInput};break}case"text/event-stream":r={type:"sse",value:this.resolvedResponseInput?.value};break;case"application/octet-stream":r={type:typeof this.resolvedResponseInput?.value=="string"?"filename":"stream",value:this.resolvedResponseInput?.value??this.resolvedResponseInput};break;case void 0:r={type:"json",value:this.resolvedResponseInput?.value??this.resolvedResponseInput};break;default:new _vn.UnreachableCaseError(this.shapes.responseBody?.contentType);break}let i=Object.fromEntries(Object.entries(this.shapes.pathParameters??{}).map(([o,c])=>[o,c.example({includeOptionals:!1,override:o})]));i=Object.keys(i).length>0?i:void 0;let n=Object.fromEntries(Object.entries(this.shapes.queryParameters??{}).map(([o,c])=>c.required||c.inputExample!=null?[o,c.example({includeOptionals:!1,override:o})]:void 0).filter(No));n=Object.keys(n).length>0?n:void 0;let a=Object.fromEntries(Object.entries(this.shapes.requestHeaders??{}).map(([o,c])=>c.required||c.inputExample!=null?[o,c.example({includeOptionals:!1,override:o})]:void 0).filter(No));if(a=Object.keys(a).length>0?a:void 0,!(this.path==null&&t==null&&r==null&&a==null&&n==null&&i==null))return{path:UBh(this.path,i??{}),responseStatusCode:this.responseStatusCode,name:this.name!=null?EYt(this.name):this.summary!=null?EYt(this.summary):void 0,description:this.convertDescription(),pathParameters:i,queryParameters:n,headers:a,requestBody:t,responseBody:r,snippets:void 0}}};function LBh(e,t){return zv(e)?iL(e,t,void 0):e}var eIh=ce(VS());var VBh="#/components/schemas/";function Sua(e){if(e.$ref.startsWith(VBh))return e.$ref.replace(VBh,"")}function yUi(e){if(e!=null)return{type:"alias",value:{type:"nullable",shape:e}}}function u$i(e){return typeof e.type=="string"&&e.type==="array"}function WBh(e){return e.type==="boolean"}function GBh(e){return e.type==="integer"}function s$i(e){return!Array.isArray(e.type)&&!u$i(e)}function HBh(e){return e!=null&&Array.isArray(e)&&e.every(t=>t.type==="null"||s$i(t)||u$i(t))}function xBh(e){return"nullable"in e&&typeof e.nullable=="boolean"}function KBh(e){return e.type==="null"}function JBh(e){return e.type==="number"}function Exc(e){return e.type==null||typeof e.type=="string"&&e.type==="object"}function $Bh(e){return e.type==="string"}var vOu=class extends K${item;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.safeParse()}parse(){this.item=new G0({input:this.input.items,context:this.context,accessPath:this.accessPath,pathId:"items",seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName}),this.input.items==null&&this.context.errors.error({message:"Expected 'items' property to be specified",path:this.accessPath})}convert(){return RP(this.item?.convert())?.map(r=>({type:"alias",value:{type:"list",itemShape:r}}))}example(t){return this.input.example??this.input.examples?.[0]??[this.item?.example(t)]}};var gOu=class extends iC{constValue;description;availability;constructor(t){super(t),this.safeParse()}parse(){this.input.const!=null&&(typeof this.input.const=="string"||typeof this.input.const=="number"||typeof this.input.const=="boolean")?this.constValue=this.input.const.toString():this.context.errors.warning({message:`Unsupported const type: ${typeof this.input}`,path:this.accessPath}),this.description=this.input.description,this.availability=new FEe({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-availability"})}convert(){if(this.constValue!=null)return{type:"enum",default:this.constValue,values:[{value:this.constValue,description:this.description,availability:this.availability?.convert()}]}}example(){return this.input.example??this.input.examples?.[0]??this.constValue}};var OOu=class extends K${typeNodes;nullable;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.parse()}parse(){this.typeNodes=this.input.map(t=>{if(t.type==="null")this.nullable=!0;else return new G0({input:t,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:this.nullable,schemaName:this.schemaName})}).filter(No)}convert(){if(this.typeNodes==null)return;let i=this.typeNodes.map(n=>RP(n.convert())?.map(o=>({displayName:n.name,shape:o,description:n.description,availability:n.availability?.convert()}))).filter(No).reduce((n,a)=>n.flatMap(o=>a.length>0?a.map(c=>[...o,c]):[[...o]]),[[]]).map(n=>({type:"undiscriminatedUnion",variants:n}));return this.nullable?i.map(yUi).filter(No):i}example(t){return this.nullable?null:this.typeNodes?.[0]?.example(t)}};function AOu(e){return e!=null&&e.length>0?e:[void 0]}var Mua=class extends K${description;extends=[];properties;extraProperties;requiredProperties;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.safeParse()}parse(){this.extends=[],this.requiredProperties=this.input.required,this.properties=Object.fromEntries(Object.entries(this.input.properties??{}).map(([t,r])=>[t,new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:["properties",t],seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})])),this.extraProperties=this.input.additionalProperties!=null?typeof this.input.additionalProperties=="boolean"?this.input.additionalProperties?this.input.title:void 0:new G0({input:this.input.additionalProperties,context:this.context,accessPath:this.accessPath,pathId:["additionalProperties"],seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName}):void 0,this.input.allOf!=null&&(this.extends=this.extends.concat(this.input.allOf.map((t,r)=>{if(zv(t))return Sua(t);this.properties={...this.properties,...Object.fromEntries(Object.entries(t.properties??{}).map(([i,n])=>[i,new G0({input:n,context:this.context,accessPath:this.accessPath,pathId:["allOf",r.toString(),"properties",i],seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})]))}}).filter(No))),this.description=this.input.description}convertProperties(){if(this.properties!=null)return Eua(this.properties,this.requiredProperties)}convertExtraProperties(){return this.extraProperties==null?void 0:typeof this.extraProperties=="string"?[{type:"map",keyShape:{type:"alias",value:{type:"primitive",value:{type:"string",format:void 0,regex:void 0,minLength:void 0,maxLength:void 0,default:void 0}}},valueShape:{type:"alias",value:{type:"unknown",displayName:this.extraProperties}}}]:RP(this.extraProperties.convert())?.map(r=>({type:"map",keyShape:{type:"alias",value:{type:"primitive",value:{type:"string",format:void 0,regex:void 0,minLength:void 0,maxLength:void 0,default:void 0}}},valueShape:r})).filter(No)}convert(){let t=this.convertProperties();if(t==null)return;let r=this.convertExtraProperties();return t.flatMap(i=>AOu(r).map(n=>(this.extends==null||this.extends.length===0)&&i.length===0&&n!=null?{type:"alias",value:n}:{type:"object",extends:this.extends.map(a=>Ys.TypeId(a)),properties:i,extraProperties:n}))}example({includeOptionals:t}){let r={...this.properties};return this.input.allOf?.forEach(i=>{let n=nC(i,this.context.document);n!=null&&(r={...r,...Object.fromEntries(Object.entries(n.properties??{}).map(([a,o])=>[a,new G0({input:o,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})]))})}),this.input.example??this.input.examples?.[0]??(!t&&this.requiredProperties!=null&&this.requiredProperties.length>0?this.requiredProperties?.reduce((i,n)=>{let a=r?.[n];return i[n]=a?.example({includeOptionals:t,override:n}),i},{}):Object.entries(r).reduce((i,[n,a])=>(i[n]=a?.example({includeOptionals:t,override:n}),i),{}))}};var mOu=class extends K${isNullable;discriminated;discriminant;discriminatedMapping;undiscriminatedMapping;schemaName;constructor(t){super(t),this.schemaName=t.schemaName,this.safeParse()}parse(){if(this.input.oneOf!=null||this.input.anyOf!=null)if(this.isNullable=(this.input.oneOf??this.input.anyOf)?.some(t=>nC(t,this.context.document)?.type==="null"),this.input.discriminator==null)this.discriminated=!1,this.undiscriminatedMapping=(this.input.oneOf??this.input.anyOf)?.map(t=>nC(t,this.context.document)?.type!=="null"?new G0({input:t,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName}):void 0).filter(No);else{let t=this.input.discriminator.mapping;if(t!=null){this.discriminated=!0,this.discriminant=this.input.discriminator.propertyName,this.discriminatedMapping={};let r=this.discriminatedMapping;Object.entries(t).map(([i,n])=>{let a=nC({$ref:n},this.context.document);if(a==null){this.context.errors.warning({message:`Expected schema reference. Received undefined reference: ${n}`,path:[...this.accessPath,"discriminator","mapping",i]});return}r[i]=new G0({input:a,context:this.context,accessPath:[...this.accessPath,"discriminator","mapping",i],pathId:i,seenSchemas:this.seenSchemas,nullable:void 0,schemaName:this.schemaName})})}}}convert(){if(!this.discriminated&&this.undiscriminatedMapping?.length===1){let n=this.undiscriminatedMapping?.flatMap(a=>a.convert()).filter(No);return this.isNullable&&n!=null?n.map(yUi).filter(No):n}let t=0,r=this.discriminated&&this.discriminant!=null&&this.discriminatedMapping!=null?{type:"discriminatedUnion",discriminant:Ys.PropertyKey(this.discriminant),variants:Object.entries(this.discriminatedMapping).flatMap(([n,a])=>RP(a.convert())?.map(c=>{if(!(c==null||c.type!=="object"))return{discriminantValue:n,displayName:a.name??EYt(n),availability:a.availability?.convert(),description:a.description,...c}}).filter(No)).filter(No)}:this.undiscriminatedMapping!=null?{type:"undiscriminatedUnion",variants:this.undiscriminatedMapping.flatMap(n=>RP(n.convert())?.map(o=>{if(o==null)return;t+=1;let c=o.type==="object"?EYt(`${this.schemaName??"Variant"} ${t}`):void 0;return{displayName:n.name??(o.type==="alias"&&o.value.type==="id"?EYt(o.value.id):c),shape:o,description:n.description,availability:n.availability?.convert()}}).filter(No)).filter(No)}:void 0,i=this.isNullable?yUi(r):r;return i!=null?[i]:void 0}example(t){return this.input.example??this.input.examples?.[0]??this.undiscriminatedMapping?.[0]?.example(t)??Object.values(this.discriminatedMapping??{})[0]?.example(t)}};var POu=class extends iC{default;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){this.input.default!=null&&typeof this.input.default!="boolean"&&this.context.errors.warning({message:`Expected default value to be a boolean. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default}convert(){return{type:"alias",value:{type:"primitive",value:{type:"boolean",default:this.default}}}}example(){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:!1)}};var c$i=class extends iC{default;values=[];nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){if(this.input.enum!=null){let t=!0;this.values=this.input.enum.map((r,i)=>{if(t){if(zv(r)){let n=nC(r,this.context.document);r=typeof n=="string"?n:typeof n?.default=="string"?n?.default:typeof n?.example=="string"?n.example:void 0}if(typeof r!="string"){this.context.errors.error({message:`Expected enum values to be strings. Received ${r}`,path:[...this.accessPath,`enum[${i}]`]}),t=!1;return}return r}}).filter(No),this.values=Array.from(new Set(this.values))}this.default=this.input.default}convert(){return{type:"enum",values:this.values.map(t=>({value:t,description:void 0,availability:void 0})),default:this.default}}example(){return this.input.example??this.input.examples?.[0]??this.default??this.values[0]??(this.nullable?null:void 0)}};var YBh=ce(VS());function OfB(e){return Axc.includes(e)}var jOu=class extends iC{format;minimum;maximum;default;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){this.minimum=this.input.minimum,this.maximum=this.input.maximum,this.input.default!=null&&typeof this.input.default!="number"&&this.context.errors.warning({message:`Expected default value to be an integer. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default,this.input.format!=null&&(OfB(this.input.format)?this.format=this.input.format:this.context.errors.warning({message:`Expected format to be one of ${Axc.join(", ")}. Received ${this.input.format}`,path:this.accessPath}))}convert(){let t="integer";if(this.format!=null)switch(this.format){case"int64":t="long";break;case"int8":case"int16":case"int32":case"uint8":case"sf-integer":case void 0:t="integer";break;default:new YBh.UnreachableCaseError(this.format);break}return{type:"alias",value:{type:"primitive",value:{type:t,minimum:this.minimum,maximum:this.maximum,default:this.default}}}}example(){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:0)}};var wOu=class extends iC{displayName;shape;constructor(t){super(t),this.safeParse()}parse(){this.displayName=this.input.title}convert(){return yUi({type:"alias",value:{type:"unknown",displayName:this.displayName}})}example(){return null}};var XBh=ce(VS());function AfB(e){return Oxc.includes(e)}var EOu=class extends iC{format;minimum;maximum;default;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}parse(){this.minimum=this.input.minimum,this.maximum=this.input.maximum,this.input.default!=null&&typeof this.input.default!="number"&&this.context.errors.warning({message:`Expected default value to be a number. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default,this.input.format!=null&&(AfB(this.input.format)?this.format=this.input.format:this.context.errors.warning({message:`Expected format to be one of ${Oxc.join(", ")}. Received ${this.input.format}`,path:this.accessPath}))}convert(){let t="double";if(this.format!=null)switch(this.format){case"decimal":case"decimal128":case"double-int":case"double":case"float":case"sf-decimal":case void 0:t="double";break;default:new XBh.UnreachableCaseError(this.format);break}return{type:"alias",value:{type:"primitive",value:{type:t,minimum:this.minimum,maximum:this.maximum,default:this.default}}}}example(){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:0)}};var ZBh=ce(VS());function mfB(e){return mxc.includes(e)}var SOu=class extends iC{format;regex;default;minLength;maxLength;enum;mimeType;nullable;constructor(t){super(t),this.nullable=t.nullable,this.safeParse()}mapToFdrType(t){switch(t){case"base64url":case"binary":case"byte":case"sf-binary":return"base64";case"date-time":return"datetime";case"int64":return"bigInteger";case"date":return"date";case"uuid":return"uuid";case"char":case"commonmark":case"decimal":case"decimal128":case"duration":case"email":case"hostname":case"html":case"http-date":case"idn-email":case"idn-hostname":case"ipv4":case"ipv6":case"iri-reference":case"iri":case"json-pointer":case"media-range":case"password":case"regex":case"relative-json-pointer":case"sf-boolean":case"sf-string":case"sf-token":case"time":case"uri-reference":case"uri-template":case"uri":case void 0:return"string";default:return new ZBh.UnreachableCaseError(t),"string"}}parse(){this.regex=this.input.pattern,this.minLength=this.input.minLength,this.maxLength=this.input.maxLength,this.mimeType=this.input.contentMediaType,this.input.default!=null&&typeof this.input.default!="string"&&this.context.errors.warning({message:`Expected default value to be a string. Received ${this.input.default}`,path:this.accessPath}),this.default=this.input.default,this.input.format!=null&&(mfB(this.input.format)?this.format=this.input.format:this.context.errors.warning({message:`Expected format to be one of ${mxc.join(", ")}. Received ${this.input.format}`,path:this.accessPath})),this.input.enum!=null&&(this.enum=new c$i({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"enum",nullable:this.nullable}))}convert(){if(this.enum!=null)return this.enum.convert();let t="string";return this.format!=null&&(t=this.mapToFdrType(this.format)),{type:"alias",value:{type:"primitive",value:t==="base64"?{type:t,mimeType:this.mimeType,default:this.default}:{type:t,format:t==="string"?this.format:void 0,regex:this.regex,minLength:this.minLength,maxLength:this.maxLength,default:this.default}}}}example({override:t}){return this.input.example??this.input.examples?.[0]??this.default??(this.nullable?null:t??"string")}};var kBh=ce(VS());var MOu=class extends iC{displayName;shape;constructor(t){super(t),this.safeParse()}parse(){(0,kBh.noop)()}convert(){return{type:"alias",value:{type:"unknown",displayName:void 0}}}example(){}};var hvn=class extends K${description;availability;schemaId;maybeEnumConverterNode;nullable;schemaName;constructor(t){super(t),this.nullable=t.nullable,this.schemaName=t.schemaName,this.description=t.description,this.availability=t.availability,this.safeParse()}parse(){this.schemaId=Sua(this.input);let t=nC(this.input,this.context.document);t?.enum!=null&&s$i(t)&&(this.maybeEnumConverterNode=new c$i({input:t,context:this.context,accessPath:this.accessPath,pathId:this.schemaId??"",nullable:this.nullable})),this.schemaId==null&&this.context.errors.error({message:`Unprocessable reference: ${this.input.$ref}`,path:this.accessPath})}convert(){if(this.schemaId!=null)return{type:"alias",value:{type:"id",id:Ys.TypeId(this.schemaId),default:this.maybeEnumConverterNode?.default!=null?{type:"enum",value:this.maybeEnumConverterNode.default}:void 0}}}example(t){let r=nC(this.input,this.context.document);if(r!=null)return new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:this.schemaId??"",seenSchemas:this.seenSchemas,nullable:this.nullable,schemaName:this.schemaName}).example(t)}};var G0=class e extends K${typeShapeNode;description;name;examples;availability;nullable;schemaName;constructor(t){super(t),this.nullable=t.nullable,this.schemaName=t.schemaName,this.safeParse()}parse(){if(this.description=this.input.description,this.availability=new FEe({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-availability"}),s$i(this.input)&&xBh(this.input)&&(this.nullable=this.input.nullable!=null?this.input.nullable:this.nullable),zv(this.input)){let t=Sua(this.input);if(t==null){this.context.errors.error({message:"Reference object does not have a valid schema ID",path:this.accessPath});return}if(this.seenSchemas.has(t)){this.context.errors.warning({message:"Circular or deeply nested schema found, terminating",path:this.accessPath});return}this.seenSchemas.add(t),this.typeShapeNode=new hvn({input:this.input,context:this.context,accessPath:this.accessPath,pathId:t,seenSchemas:this.seenSchemas,nullable:this.nullable,schemaName:this.schemaName,description:this.description,availability:this.availability})}else if(this.name=this.input.title,this.examples=this.input.example,this.input.const!=null)this.typeShapeNode=new gOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});else if(HBh(this.input))this.typeShapeNode=new OOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName});else if(s$i(this.input)&&(this.input.oneOf!=null||this.input.anyOf!=null))this.typeShapeNode=new mOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName});else if(Exc(this.input)&&this.input.allOf!=null)this.typeShapeNode=new Mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName});else if(s$i(this.input)&&this.input.enum!=null)this.typeShapeNode=new c$i({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable});else if(typeof this.input.type=="string"||Array.isArray(this.input.type)&&this.input.type.length===1){if(this.input.type=Array.isArray(this.input.type)?this.input.type[0]:this.input.type,!Array.isArray(this.input.type))switch(this.input.type){case"object":Exc(this.input)&&(this.typeShapeNode=new Mua({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName}));break;case"array":u$i(this.input)&&(this.typeShapeNode=new vOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName}));break;case"boolean":WBh(this.input)&&(this.typeShapeNode=new POu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"integer":GBh(this.input)&&(this.typeShapeNode=new jOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"number":JBh(this.input)&&(this.typeShapeNode=new EOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"string":$Bh(this.input)&&(this.typeShapeNode=new SOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId,nullable:this.nullable}));break;case"null":KBh(this.input)&&(this.typeShapeNode=new wOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}));break;case void 0:break;default:new eIh.UnreachableCaseError(this.input.type);break}}else if(Array.isArray(this.input.type)&&this.input.type.includes("null")&&this.input.type.length===2){let t=this.input.type.filter(r=>r!=="null")[0];t!=="array"&&(this.typeShapeNode=new e({input:{...this.input,type:t},context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,nullable:!0,schemaName:this.schemaName}))}else this.input.properties!=null&&(this.typeShapeNode=new Mua({input:{...this.input,type:"object"},context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:this.seenSchemas,schemaName:this.schemaName}));this.typeShapeNode==null&&(this.typeShapeNode=new MOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}),!zv(this.input)&&(!u$i(this.input)&&this.input==null||u$i(this.input)&&this.input.items==null)&&this.context.errors.error({message:"Expected type declaration. Received: null",path:this.accessPath}))}convert(){let t=this.typeShapeNode?.convert();if(t==null)return;let r=RP(t)?.map(i=>this.nullable?yUi(i):i).filter(No);return Array.isArray(t)&&t.length>1?r:r?.[0]}example(t){return this.availability?.availability!=="deprecated"?this.typeShapeNode?.example(t):void 0}};function l$i(e){if(e!=null)return Eua(e,Object.entries(e??{}).map(([t,r])=>r.required?t:void 0).filter(No))}var MYt=class extends iC{availability;required;schema;description;inputExample;constructor(t){super(t),this.safeParse(t.parameterName)}parse(t){this.description=this.input.description;let r;zv(this.input)?r=this.input:this.input.schema!=null?(r=this.input.schema,this.required=this.input.required):(r={type:"string"},this.required=!1),this.availability=new FEe({input:r,context:this.context,accessPath:this.accessPath,pathId:"availability"}),this.schema=new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:"schema",seenSchemas:new Set,nullable:void 0,schemaName:t});let i=LBh(this.input,this.context.document);this.inputExample=i?.example??Object.values(i?.examples??{})[0]}convert(){return this.schema?.convert()}example(t){return this.inputExample??this.schema?.example(t)}};function tIh(e,t){return zv(e)?iL(e,t,void 0):e}var Sxc=ce(VS());function DOu(e){let{uniqueId:t,type:r,contextTypes:i,description:n,availability:a}=e;i[Ys.TypeId(t)]={name:t,shape:r,description:n,availability:a}}var rIh=ce(IZs(),1),Dua=class e{type;subtype;essence;parameters;mimeType;input;constructor(t,r,i,n,a,o){this.type=t,this.subtype=r,this.essence=i,this.parameters=n,this.mimeType=a,this.input=o}static APPLICATION_JSON="application/json";static APPLICATION_OCTET_STREAM="application/octet-stream";static MULTIPART_FORM_DATA="multipart/form-data";static parse(t){if(t==null)return null;let r=rIh.default.parse(t);return r==null?null:new e(r.type,r.subtype,r.essence,r.parameters,r,t)}toString(){return this.input}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.subtype==="csv"}isMarkdown(){return this.isText()&&this.subtype==="markdown"}isPlainText(){return this.isText()&&this.subtype==="plain"}isEventStream(){return this.isText()&&this.subtype==="event-stream"}isMultiPartFormData(){return this.isMultipart()&&this.subtype==="form-data"}isJSON(){return this.isApplication()&&this.subtype==="json"}containsJSON(){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"}isGzip(){return this.isApplication()&&this.subtype==="gzip"}isTar(){return this.isApplication()&&this.subtype==="tar"}isBrotli(){return this.isApplication()&&this.subtype==="br"}isDeflate(){return this.isApplication()&&this.subtype==="deflate"}isProtobuf(){return this.isApplication()&&this.subtype==="protobuf"}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"}isGIF(){return this.isImage()&&this.subtype==="gif"}isMPEG(){return this.isAudio()&&this.subtype==="mpeg"}isWAV(){return this.isAudio()&&this.subtype==="wav"}isHTML(){return this.mimeType.isHTML()}isXML(){return this.mimeType.isXML()}isJavaScript(){return this.mimeType.isJavaScript()}};function PfB(e){return typeof e.securitySchemes=="object"&&e.securitySchemes!=null}var BOu=class extends po{typeSchemas;securitySchemes;constructor(t){super(t),this.safeParse()}parse(){this.input.schemas!=null&&(this.typeSchemas=Object.fromEntries(Object.entries(this.input.schemas).map(([t,r])=>[t,new G0({input:r,context:this.context,accessPath:this.accessPath,pathId:t,seenSchemas:new Set,nullable:void 0,schemaName:t})]))),PfB(this.input)&&this.input.securitySchemes!=null&&(this.securitySchemes=Object.fromEntries(Object.entries(this.input.securitySchemes??{}).map(([t,r],i)=>{let n;if(zv(r)?n=Ugu(r.$ref,this.context.document):n=r,n!=null)return[t,new jua({input:n,context:this.context,accessPath:this.accessPath,pathId:["securitySchemes",`${i}`]})]}).filter(No)))}convert(){return{auths:this.securitySchemes!=null?Object.fromEntries(Object.entries(this.securitySchemes??{}).map(([t,r])=>{let i=r.convert();if(i!=null)return[Ys.api.latest.AuthSchemeId(t),i]}).filter(No)):void 0,types:this.typeSchemas!=null?Object.fromEntries(Object.entries(this.typeSchemas).map(([t,r])=>{let i=r.name??t,n=RP(r.convert());return n==null?[t,void 0]:[Ys.TypeId(t),{name:i,shape:n[0],description:r.description,availability:void 0}]}).filter(([t,r])=>No(r))):void 0}}};var IOu=class extends G0{multipartType;contentType;constructor(t){super(t),this.safeParse()}parse(){super.parse();let t=nC(this.input,this.context.document);if(t==null){this.context.errors.error({message:`Expected multipart form data property definition. ${zv(this.input)?`Received undefined reference: ${this.input.$ref}`:""}`,path:this.accessPath});return}if(t.type==="string"&&t.format==="binary")this.multipartType="file",this.contentType=t.contentMediaType;else if(t.type==="array"){let r=nC(t.items,this.context.document);r?.type==="string"&&r?.format==="binary"?(this.multipartType="files",this.contentType=r?.contentMediaType):(this.context.errors.warning({message:"Expected multipart form data files definition with array type with internal string type and binary format.",path:this.accessPath}),this.multipartType=void 0,this.contentType=void 0)}else this.multipartType="property",this.contentType=t.contentMediaType}};var COu=class extends po{description;method;path;schema;isOptional;contentType;availability;requiredFields;fields;examples;constructor(t){super(t),this.method=t.method,this.path=t.path,this.safeParse(t)}parse({contentType:t}){if(this.input.schema!=null){let i=nC(this.input.schema,this.context.document);this.availability=new FEe({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"availability"}),this.schema=zv(this.input.schema)?new hvn({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"schema",seenSchemas:new Set,nullable:!1,schemaName:"Request Body",description:this.input.schema.description,availability:this.availability}):void 0;let n=Dua.parse(t);n?.containsJSON()?(this.contentType="json",this.schema=this.schema??new G0({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"schema",seenSchemas:new Set,nullable:void 0,schemaName:"Request Body"})):n?.isOctetStream()?(this.contentType="bytes",this.isOptional=i?.required==null):n?.isMultiPartFormData()?(this.contentType="form-data",this.requiredFields=i?.required,this.fields=Object.fromEntries(Object.entries(i?.properties??{}).map(([a,o])=>{if(o!=null)return[a,new IOu({input:o,context:this.context,accessPath:this.accessPath,pathId:`schema.${a}`,seenSchemas:new Set,nullable:void 0,schemaName:a})]}).filter(No))):this.context.errors.warning({message:`Expected request body of reference or object with json, streaming or form-data content types. Received: ${t}`,path:this.accessPath})}let r=this.schema?.example({includeOptionals:!0,override:void 0});this.examples={...this.input.example!=null?{[aF]:{value:this.input.example}}:{},...this.input.examples},r!=null&&Object.keys(this.examples).length===0&&(this.examples={[aF]:{value:r}})}convertJsonLike(){let t=this.schema?.convert();return t==null?void 0:RP(t)?.map(i=>{let n=i.type;switch(n){case"object":case"alias":return i;case"enum":case"undiscriminatedUnion":case"discriminatedUnion":{let a=a8t([this.method,this.path,this.contentType,"request"].join("_"));return DOu({uniqueId:a,type:i,contextTypes:this.context.generatedTypes,description:this.schema?.description,availability:this.schema?.availability?.convert()}),{type:"alias",value:{type:"id",id:Ys.TypeId(a),default:i.type==="enum"&&i.default!=null?{type:"enum",value:i.default}:void 0}}}case void 0:return;default:new Sxc.UnreachableCaseError(n);return}}).filter(No)}convert(){if(this.schema instanceof hvn)return this.schema.convert();switch(this.contentType){case"json":return this.convertJsonLike();case"bytes":return{type:"bytes",isOptional:this.isOptional??!1,contentType:this.contentType};case"form-data":return Object.entries(this.fields??{}).map(([i,n])=>{switch(n.multipartType){case"file":return[{type:n.multipartType,key:Ys.PropertyKey(i),isOptional:this.requiredFields?.includes(i)==null,contentType:n.contentType,description:n.description,availability:n.availability?.convert()}];case"files":return[{type:n.multipartType,key:Ys.PropertyKey(i),isOptional:this.requiredFields?.includes(i)==null,contentType:n.contentType,description:n.description,availability:n.availability?.convert()}];case"property":{let a=RP(n.convert()),o=n.multipartType;return a?.map(c=>({type:o,key:Ys.PropertyKey(i),contentType:n.contentType,exploded:void 0,valueShape:c,description:n.description,availability:n.availability?.convert()}))}case void 0:return[];default:return new Sxc.UnreachableCaseError(n.multipartType),[]}}).filter(No).reduce((i,n)=>i.flatMap(a=>n.length>0?n.map(o=>[...a,o]):[[...a]]),[[]]).map(i=>({type:"formData",fields:i,availability:this.availability?.convert(),description:this.description}));case void 0:return this.convertJsonLike();default:return}}};var qOu=class extends po{description;requestBodiesByContentType;constructor(t){super(t),this.safeParse(t)}parse({method:t,path:r}){let i=tIh(this.input,this.context.document);if(i==null){this.context.errors.error({message:"Expected request body. Received: null",path:this.accessPath});return}Object.entries(i.content).forEach(([n,a])=>{this.requestBodiesByContentType??={},this.requestBodiesByContentType[n]=new COu({input:a,context:this.context,accessPath:this.accessPath,pathId:"content",contentType:n,method:t,path:r})})}convert(){return Object.entries(this.requestBodiesByContentType??{}).flatMap(([t,r])=>RP(r.convert())?.map(n=>({description:this.description,contentType:t,body:n}))).filter(No)}convertToWebhookPayload(){return Object.values(this.requestBodiesByContentType??{}).flatMap(t=>RP(t.convert())?.map(i=>{if(!(i.type!=="alias"&&i.type!=="object"))return{description:this.description,shape:i}})).filter(No)}webhookExample(){return{payload:this.requestBodiesByContentType?.["application/json"]?.schema?.example({includeOptionals:!0,override:void 0})}}};var iIh={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};function nIh(e,t){if(zv(e)){let r=iL(e,t,void 0);return r==null?void 0:{...r,...e}}return e}var TOu=ce(VS());var aIh="application/json";var oIh="application/octet-stream";function uIh(e,t){return e===t||t===aF||e===aF}var jKa=class extends po{streamingFormat;path;method;statusCode;requests;shapes;schema;contentType;unsupportedContentType;contentSubtype;examples;empty;constructor(t,r,i,n,a,o,c,d){super(t),this.streamingFormat=i,this.path=n,this.method=a,this.statusCode=o,this.requests=c,this.shapes=d,this.safeParse(r)}matchRequestResponseExamplesByName(t,r,i){for(let n of t)for(let[a,o]of Object.entries(n?.examples??{}))for(let[c,d]of Object.entries(r))for(let s of d)uIh(c,a)&&(i.add(c),this.examples?.push(new SYt({input:{requestExample:o,responseExample:s},context:this.context,accessPath:this.accessPath,pathId:a!=null&&a!==""?["examples",a]:"examples"},this.path,this.statusCode,a$i(a,c),{requestBody:n,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}matchExamplesByIndex(t,r){let i=0;for(let n of t){let a=0;for(let[o,c]of r){if(a===i){let[d,s,u]=n??[void 0,void 0,void 0];this.examples?.push(...c.map(f=>new SYt({input:{requestExample:u,responseExample:f},context:this.context,accessPath:this.accessPath,pathId:s!=null&&s!==""?["examples",s]:"examples"},this.path,this.statusCode,a$i(s,o),{requestBody:d,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}a++}i++}if(t.length>r.length)for(let n of t.slice(r.length)){let[a,o]=r[r.length-1]??[void 0,void 0],[c,d,s]=n??[void 0,void 0,void 0];this.examples?.push(...(o??[void 0]).map(u=>new SYt({input:{requestExample:s,responseExample:u},context:this.context,accessPath:this.accessPath,pathId:d!=null&&d!==""?["examples",d]:"examples"},this.path,this.statusCode,a$i(d,a),{requestBody:c,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}if(r.length>t.length){let[n,a,o]=t[t.length-1]??[void 0,void 0,void 0];for(let[c,d]of r.slice(t.length))this.examples?.push(...d.map(s=>new SYt({input:{requestExample:o,responseExample:s},context:this.context,accessPath:this.accessPath,pathId:a!=null&&a!==""?["examples",a]:"examples"},this.path,this.statusCode,a$i(a,c),{requestBody:n,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders})))}}pushResponseExample(t,r,i,n){let a=t[aF];if(a!=null)for(let o of a)this.examples?.push(new SYt({input:{requestExample:n,responseExample:o},context:this.context,accessPath:this.accessPath,pathId:i!=null&&i!==""?["examples",i]:"examples"},this.path,this.statusCode,a$i(i,void 0),{requestBody:r,responseBody:this,pathParameters:this.shapes.pathParameters,queryParameters:this.shapes.queryParameters,requestHeaders:this.shapes.requestHeaders}))}addGlobalFallbackExample(t,r){if(t==null||t.length===0)this.pushResponseExample(r,void 0,void 0,void 0);else for(let i of t)if(Object.keys(i.examples??{}).length===0)this.pushResponseExample(r,i,void 0,void 0);else for(let[n,a]of Object.entries(i.examples??{}))this.pushResponseExample(r,i,n,a)}parse(t){if(t==="empty")this.empty=!0;else{let c=Dua.parse(t);if(c?.isJSON()||c?.isEventStream())this.contentType=aIh,this.input.schema==null?(this.streamingFormat==null||this.streamingFormat==="json")&&this.context.errors.error({message:"Expected schema for JSON response body. Received null",path:this.accessPath}):this.schema=new G0({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:"type",seenSchemas:new Set,nullable:void 0,schemaName:"Response Body"});else if(c?.isOctetStream())this.contentType=oIh,this.contentSubtype=nC(this.input.schema,this.context.document)?.contentMediaType;else if(this.unsupportedContentType=t,this.input.schema==null){this.context.errors.error({message:"Expected schema for plain text response body. Received null",path:this.accessPath});return}else this.schema=new G0({input:this.input.schema,context:this.context,accessPath:this.accessPath,pathId:this.pathId,seenSchemas:new Set,nullable:void 0,schemaName:"Response Body"})}let r={};this.input.examples!=null&&(r=oOu(this.input.examples,c=>[c])),this.input.example!=null&&Object.keys(r).length===0&&(r[aF]??=[],r[aF]=[{value:this.input.example}]);let i=nC(this.input.schema,this.context.document);if(i!=null&&(i.examples!=null&&Object.keys(r).length===0&&(r=oOu(i.examples,c=>[c])),i.example!=null&&Object.keys(r).length===0&&(r[aF]??=[],r[aF]?.push({value:i.example}))),Object.keys(r).length===0){let c=this.schema?.example({includeOptionals:!0,override:void 0});r[aF]??=[],r[aF]?.push(c!=null?{value:c}:void 0)}this.examples??=[];let n=new Set;this.matchRequestResponseExamplesByName(this.requests,r,n);let a=[];for(let c of this.requests)a.push(...Object.entries(c.examples??{}).filter(([d])=>!n.has(d)&&d!==aF).map(([d,s])=>[c,d,s]));let o=Object.entries(r).filter(([c,d])=>!n.has(c)&&No(d)&&c!==aF);Object.keys(r).every(c=>c===aF)||this.matchExamplesByIndex(a,o),!n.has(aF)&&this.examples.length===0&&this.addGlobalFallbackExample(this.requests,r),this.examples.length===0&&(this.examples=void 0)}convertStreamingFormat(){switch(this.streamingFormat){case"json":return RP(this.schema?.convert())?.map(r=>({type:"stream",terminator:"[DATA]",shape:r}));case"sse":return{type:"streamingText"};case void 0:return;default:new TOu.UnreachableCaseError(this.streamingFormat);return}}convertJsonLike(){return RP(this.schema?.convert())?.map(r=>{let i=r.type;switch(i){case"alias":return r;case"discriminatedUnion":case"undiscriminatedUnion":case"enum":{let n=a8t([this.method,this.path,this.statusCode,"response"].join("_"));return DOu({uniqueId:n,type:r,contextTypes:this.context.generatedTypes,description:this.schema?.description,availability:this.schema?.availability?.convert()}),{type:"alias",value:{type:"id",id:Ys.TypeId(n),default:r.type==="enum"&&r.default!=null?{type:"enum",value:r.default}:void 0}}}case"object":return r;default:new TOu.UnreachableCaseError(i);return}}).filter(No)}convert(){if(this.empty)return{type:"empty"};if(this.contentType!=null)switch(this.contentType){case"application/json":return this.streamingFormat==null?this.convertJsonLike():this.convertStreamingFormat();case"application/octet-stream":return{type:"fileDownload",contentType:this.contentSubtype};case"text/event-stream":return this.convertStreamingFormat();case void 0:return;default:new TOu.UnreachableCaseError(this.contentType);return}else return this.unsupportedContentType!=null?this.convertJsonLike():void 0}};var wKa=class extends po{path;method;statusCode;requests;shapes;headers;responses;description;constructor(t,r,i,n,a,o){super(t),this.path=r,this.method=i,this.statusCode=n,this.requests=a,this.shapes=o,this.safeParse()}parse(t){this.description=this.input.description;let r=nIh(this.input,this.context.document);if(r==null){this.context.errors.error({message:zv(this.input)?`Undefined reference: ${this.input.$ref}`:"Expected response, received null",path:this.accessPath});return}Object.entries(r.headers??{}).forEach(([i,n])=>{this.headers??={},this.headers[i]=new MYt({input:n,context:this.context,accessPath:this.accessPath,pathId:"headers",parameterName:i})}),r.content==null?(this.responses??=[],this.responses.push(new jKa({input:{},context:this.context,accessPath:this.accessPath,pathId:["content"]},"empty",t,this.path,this.method,this.statusCode,this.requests,this.shapes))):Object.entries(r.content??{}).forEach(([i,n])=>{this.responses??=[],this.responses.push(new jKa({input:n,context:this.context,accessPath:this.accessPath,pathId:["content",i]},i,t,this.path,this.method,this.statusCode,this.requests,this.shapes))})}convert(){return this.responses?.flatMap(t=>t.convert()).filter(No)}};var ROu=class extends po{path;method;requests;shapes;responsesByStatusCode;errorsByStatusCode;constructor(t,r,i,n,a){super(t),this.path=r,this.method=i,this.requests=n,this.shapes=a,this.safeParse()}parse(){let t=this.input.default;Object.entries(this.input).forEach(([r,i])=>{r!=="default"&&(parseInt(r)>=400?(this.errorsByStatusCode??={},this.errorsByStatusCode[r]=new wKa({input:{...t,...i},context:this.context,accessPath:this.accessPath,pathId:"errors"},this.path,this.method,parseInt(r),[],this.shapes)):(this.responsesByStatusCode??={},this.responsesByStatusCode[r]=new wKa({input:i,context:this.context,accessPath:this.accessPath,pathId:"responses"},this.path,this.method,parseInt(r),this.requests,this.shapes)))})}convertResponseObjectToHttpResponses(){return Object.entries(this.responsesByStatusCode??{}).flatMap(([t,r])=>{let i=r.convert();if(i!=null)return AOu(l$i(r.headers)).flatMap(n=>i?.map(a=>({headers:n,response:{statusCode:parseInt(t),body:a,description:r.description},examples:(r.responses??[]).flatMap(o=>(o.examples??[]).map(c=>c.convert()).filter(No))})))}).filter(No)}convertResponseObjectToErrors(){return Object.entries(this.errorsByStatusCode??{}).flatMap(([t,r])=>r.responses?.flatMap(i=>{let n=i.schema,a=RP(n?.convert());if(n!=null)return a?.map(o=>({statusCode:parseInt(t),shape:o,description:r.description??n.description,availability:n.availability?.convert(),name:n.name??iIh[parseInt(t)]??"UNKNOWN ERROR",examples:i.examples?.map(c=>{let d=c.convert();if(d!=null&&d.responseBody?.type==="json")return{name:d.name,description:d.description,responseBody:d.responseBody}}).filter(No)})).filter(No)})).filter(No)}convert(){return{responses:this.convertResponseObjectToHttpResponses(),errors:this.convertResponseObjectToErrors()}}};var f$i=class extends po{servers;globalAuth;path;method;basePath;isWebhook;endpointIds;description;displayName;operationId;pathParameters;queryParameters;requestHeaders;requests;responses;availability;auth;namespaces;xFernExamplesNode;redocExamplesNode;emptyResponseExamples;constructor(t){super(t),this.servers=t.servers,this.globalAuth=t.globalAuth,this.path=t.path,this.method=t.method,this.basePath=t.basePath,this.isWebhook=t.isWebhook,this.safeParse()}pushEmptyResponseExample(t,r,i){this.emptyResponseExamples??=[],this.emptyResponseExamples.push(new SYt({input:{requestExample:t,responseExample:void 0},context:this.context,accessPath:this.accessPath,pathId:"examples"},this.path,200,a$i(i,void 0),{requestBody:r,pathParameters:this.pathParameters,queryParameters:this.queryParameters,requestHeaders:this.requestHeaders}))}parse(){if(this.isWebhook&&this.method!=="POST"&&this.method!=="GET"){this.context.errors.error({message:`Webhook method must be POST or GET. Received: ${this.method}`,path:this.accessPath});return}this.description=this.input.description,this.displayName=this.input.summary,this.operationId=this.input.operationId,this.availability=new FEe({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-availability"}),this.servers=i$i(this.servers,this.input.servers,this.context,this.accessPath),this.isWebhook=new yOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId}).isWebhook||this.isWebhook,this.input.parameters?.map((i,n)=>{if(zv(i)){let a=fOu(i,this.context.document);if(a!=null)i=a;else{this.context.errors.warning({message:`Expected parameter reference to resolve to an object. Received undefined reference: ${i.$ref}`,path:[...this.accessPath,`parameters[${n}]`]});return}}i.in==="path"?i.schema!=null&&(this.pathParameters??={},this.pathParameters[i.name]=new MYt({input:i,context:this.context,accessPath:this.accessPath,pathId:["parameters",`${n}`],parameterName:i.name})):i.in==="query"?i.schema!=null&&(this.queryParameters??={},this.queryParameters[i.name]=new MYt({input:i,context:this.context,accessPath:this.accessPath,pathId:["parameters",`${n}`],parameterName:i.name})):i.in==="header"&&i.schema!=null&&(this.requestHeaders??={},this.requestHeaders[i.name]=new MYt({input:i,context:this.context,accessPath:this.accessPath,pathId:["parameters",`${n}`],parameterName:i.name}))});for(let i of this.extractPathParameterIds()??[])this.pathParameters?.[i]==null&&this.context.errors.warning({message:`Path parameter not defined: ${i}`,path:[...this.accessPath,"parameters"]});if(this.redocExamplesNode=new bOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-code-samples"}),this.requests=this.input.requestBody!=null?new qOu({input:this.input.requestBody,context:this.context,accessPath:this.accessPath,pathId:"requestBody",method:this.method,path:this.path}):void 0,this.responses=this.input.responses!=null?new ROu({input:this.input.responses,context:this.context,accessPath:this.accessPath,pathId:"responses"},this.path,this.method,Object.values(this.requests?.requestBodiesByContentType??{}),{pathParameters:this.pathParameters,queryParameters:this.queryParameters,requestHeaders:this.requestHeaders}):void 0,this.responses==null){let i=this.requests?.requestBodiesByContentType;i==null||Object.keys(i).length===0?this.pushEmptyResponseExample(void 0,void 0,void 0):Object.values(i).forEach(n=>{if(Object.keys(n.examples??{}).length===0){let a=n.schema?.example({includeOptionals:!1,override:void 0});a!=null&&this.pushEmptyResponseExample({value:a},n,void 0)}else Object.entries(n.examples??{}).forEach(([a,o])=>{this.pushEmptyResponseExample(o,n,a)})})}let t=200;this.responses?.responsesByStatusCode!=null&&(t=Number(Object.keys(this.responses.responsesByStatusCode)?.filter(i=>Number(i)>=200&&Number(i)<300)[0])),this.globalAuth!=null&&(this.auth=this.globalAuth),this.input.security!=null&&(this.auth=new wua({input:this.input.security,context:this.context,accessPath:this.accessPath,pathId:"security"})),this.namespaces=[new PKa({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-group-name"})],this.namespaces?.every(i=>i.groupName==null)&&this.input.tags!=null&&(this.namespaces=this.input.tags.slice(0,1).map((i,n)=>new PKa({input:{[Ngu]:i},context:this.context,accessPath:this.accessPath,pathId:["tags",`${n}`]})));let r=new hOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-sdk-method-name"});this.endpointIds=this.namespaces.map(i=>uOu({namespace:RP(i?.groupName),path:this.path,method:this.method,sdkMethodName:r.sdkMethodName,operationId:this.input.operationId,displayName:this.displayName,isWebhook:this.isWebhook})).filter(No),this.xFernExamplesNode=new _Ou({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-examples"},this.path,t,this.requests?.requestBodiesByContentType,this.responses?.responsesByStatusCode?.[t]?.responses)}extractPathParameterIds(){if(this.path!=null)return this.path.split("/").map(t=>{if(t.startsWith("{")&&t.endsWith("}"))return t.slice(1,-1).trim()}).filter(No)}convertPathToPathParts(){if(this.path===void 0)return;let t=this.path.startsWith("/")?this.path.slice(1):this.path,r=this.basePath?.convert();return(r?[r,...t.split("/")]:t.split("/")).reduce((n,a)=>(n.push({type:"literal",value:"/"}),a.startsWith("{")&&a.endsWith("}")?n.push({type:"pathParameter",value:Ys.PropertyKey(a.slice(1,-1).trim())}):n.push({type:"literal",value:a}),n),[])}convert(){if(this.path==null||this.endpointIds==null)return;let{responses:t,errors:r}=this.responses?.convert()??{responses:void 0,errors:void 0},i=this.emptyResponseExamples?.map(u=>u.convert()).filter(No),n=qBh(this.xFernExamplesNode?.convert(),[...i??[],...t?.flatMap(u=>u.examples)??[]])?.map(u=>({...u,snippets:CBh(u.snippets,this.redocExamplesNode?.convert())}));if(this.isWebhook)return this.endpointIds.map((u,f)=>{if(!(this.method!=="POST"&&this.method!=="GET"))return{id:Ys.WebhookId(u),description:this.description,availability:this.availability?.convert(),displayName:this.displayName,operationId:this.operationId,namespace:this.namespaces?.[f]?.convert(),method:this.method,path:this.convertPathToPathParts()?.map(p=>p.value.toString())??[],queryParameters:l$i(this.queryParameters)?.flat(),headers:l$i(this.requestHeaders)?.flat(),payloads:this.requests?.convertToWebhookPayload(),examples:[this.requests?.webhookExample()].filter(No)}}).filter(No);let a=this.servers?.map(u=>u.convert()).filter(No),o=this.convertPathToPathParts();if(o==null)return;let c,d=this.auth?.convert();d!=null&&(c=Object.keys(d));let s=t?.flatMap(u=>u.headers).filter(No);return this.endpointIds.map((u,f)=>({id:Ys.EndpointId(u),description:this.description,availability:this.availability?.convert(),namespace:this.namespaces?.[f]?.convert()?.map(p=>Ys.api.v1.SubpackageId(p)),displayName:this.displayName,operationId:this.operationId,method:this.method,path:o,auth:c?.map(p=>Ys.api.latest.AuthSchemeId(p)),defaultEnvironment:a?.[0]?.id,environments:a,pathParameters:l$i(this.pathParameters)?.flat(),queryParameters:l$i(this.queryParameters)?.flat(),requestHeaders:l$i(this.requestHeaders)?.flat(),responseHeaders:s!=null&&s.length>0?s:void 0,requests:this.requests?.convert(),responses:t?.map(p=>p.response),errors:r,examples:n,snippetTemplates:void 0,protocol:{type:"rest"}}))}};var Bua=class extends po{description;get;post;put;patch;delete;path;constructor(t){super(t),this.safeParse(t)}parse({servers:t,globalAuth:r,basePath:i,isWebhook:n}){this.description=this.input.description;let a=i$i(t,this.input.servers,this.context,this.accessPath),o=Array.isArray(this.pathId)?this.pathId.join("/"):this.pathId;this.input.get!=null&&(this.get=new f$i({input:this.input.get,context:this.context,accessPath:this.accessPath,pathId:"get",servers:a,globalAuth:r,path:o,method:"GET",basePath:i,isWebhook:n})),this.input.post!=null&&(this.post=new f$i({input:this.input.post,context:this.context,accessPath:this.accessPath,pathId:"post",servers:a,globalAuth:r,path:o,method:"POST",basePath:i,isWebhook:n})),this.input.put!=null&&(this.put=new f$i({input:this.input.put,context:this.context,accessPath:this.accessPath,pathId:"put",servers:a,globalAuth:r,path:o,method:"PUT",basePath:i,isWebhook:!1})),this.input.patch!=null&&(this.patch=new f$i({input:this.input.patch,context:this.context,accessPath:this.accessPath,pathId:"patch",servers:a,globalAuth:r,path:o,method:"PATCH",basePath:i,isWebhook:!1})),this.input.delete!=null&&(this.delete=new f$i({input:this.input.delete,context:this.context,accessPath:this.accessPath,pathId:"delete",servers:a,globalAuth:r,path:o,method:"DELETE",basePath:i,isWebhook:!1}))}convert(){return[...this.get?.convert()??[],...this.post?.convert()??[],...this.put?.convert()??[],...this.patch?.convert()??[],...this.delete?.convert()??[]].filter(No)}};function zOu(e){return"payloads"in e}var NOu=class extends po{paths;constructor(t){super(t),this.safeParse(t)}parse({servers:t,globalAuth:r,basePath:i}){this.paths=Object.entries(this.input).map(([n,a])=>{if(a!=null)return new Bua({input:a,context:this.context,accessPath:this.accessPath,pathId:n,servers:i$i(t,a.servers,this.context,this.accessPath),globalAuth:r,basePath:i,isWebhook:void 0})}).filter(No)}convert(){if(this.paths==null)return;let t={},r={};return this.paths.forEach(i=>{let n=i.convert();n?.forEach(a=>{zOu(a)?r[Ys.WebhookId(a.id)]=a:t[Ys.EndpointId(a.id)]=a})}),{endpoints:t,webhookEndpoints:r}}};var FOu=class extends po{globalHeaders;requiredProperties;constructor(t){super(t),this.safeParse()}parse(){let t=this.input[EDh]?.map(r=>{let{header:i,...n}=r;return(n.optional!=null&&!n.optional||fOu(n,this.context.document)?.required)&&(this.requiredProperties??=[],this.requiredProperties?.push(i)),[i,new MYt({input:n,context:this.context,accessPath:this.accessPath,pathId:this.pathId,parameterName:i})]});t!=null&&(this.globalHeaders=Object.fromEntries(t))}convert(){return Eua(this.globalHeaders,this.requiredProperties)?.flat()}};function sIh(e,t){if(zv(e)){let r=iL(e,t,void 0);return r==null?void 0:{...r,...e}}return e}var QOu=class extends po{webhooks;constructor(t){super(t),this.safeParse(t)}parse({servers:t,globalAuth:r,basePath:i}){this.webhooks=Object.entries(this.input??{}).map(([n,a])=>{let o=sIh(a,this.context.document);if(o!=null)return new Bua({input:o,context:this.context,accessPath:this.accessPath,pathId:n,servers:t,globalAuth:r,basePath:i,isWebhook:!0})}).filter(No)}convert(){return this.webhooks?.reduce((t,r)=>(r.convert()?.forEach(i=>{zOu(i)&&(t[Ys.WebhookId(i.id)]=i)}),t),{})}};var UOu=class extends po{paths;webhooks;components;auth;globalHeaders;constructor(t){super(t),this.safeParse()}parse(){let t=i$i(void 0,this.input.servers,this.context,this.accessPath);this.input.security!=null&&(this.auth=new wua({input:this.input.security,context:this.context,accessPath:this.accessPath,pathId:"security"}));let r=new lOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:this.pathId});this.input.paths==null&&this.input.webhooks==null&&this.context.errors.warning({message:"Expected 'paths' or 'webhooks' property to be specified",path:this.accessPath}),this.input.paths!=null&&(this.paths=new NOu({input:this.input.paths,context:this.context,accessPath:this.accessPath,pathId:"paths",basePath:r,servers:t,globalAuth:this.auth})),this.input.webhooks!=null&&(this.webhooks=new QOu({input:this.input.webhooks,context:this.context,accessPath:this.accessPath,pathId:"webhooks",basePath:r,servers:t,globalAuth:this.auth})),this.input.components!=null&&(this.components=new BOu({input:this.input.components,context:this.context,accessPath:this.accessPath,pathId:"components"})),this.globalHeaders=new FOu({input:this.input,context:this.context,accessPath:this.accessPath,pathId:"x-fern-global-headers"})}convert(){let t=Hbe(),{webhookEndpoints:r,endpoints:i}=this.paths?.convert()??{},n={...this.webhooks?.convert()??{},...r??{}},a=mDh({endpoints:i,webhookEndpoints:n}),{types:o,auths:c}=this.components?.convert()??{};return{id:Ys.ApiDefinitionId(t),endpoints:i??{},websockets:{},webhooks:n,types:{...o,...this.context.generatedTypes},subpackages:a,auths:{...c,...this.auth?.convert()??{}},globalHeaders:this.globalHeaders?.convert(),snippetsConfiguration:void 0}}};async function Mxc(e,t){if(e instanceof SEe){t.logger.info("Skipping, API is specified as a Fern Definition.");return}else if(!(e instanceof ZE))return;let r=new K3t(e.absoluteFilePath),i=await DEe({context:t,specs:e.specs}),n=await r.loadDocuments({context:t,specs:i}),a;for(let o of n){if(o.type!=="openapi")continue;let c={document:o.value,logger:t.logger,errors:new Rgu,generatedTypes:{}},d=new UOu({input:o.value,context:c,accessPath:[],pathId:e.workspaceName??"openapi parser"});a=KZs(a,d.convert())}return a}var E4h=ce(Ixc(),1),S4h=ce(MAu(),1),Zmu=require("fs/promises"),M4h=ce(require("http"),1),D4h=ce(require("path"),1);var dRh=require("events"),qAu=ce(require("fs"),1),wvn=ce(require("path"),1);var JTh=ce(require("os"),1),$Th=300,v$i=20,JKa=1e7,YTh=JTh.default.platform();var HvB=YTh==="darwin",XKc=YTh==="win32",g$i=HvB||XKc,XTh=3e3,ZTh=2e4,ZKc=1250;var CYt;(function(e){e[e.DIR=1]="DIR",e[e.FILE=2]="FILE"})(CYt||(CYt={}));var jvn;(function(e){e.CHANGE="change",e.RENAME="rename"})(jvn||(jvn={}));var $Ka;(function(e){e.CHANGE="change",e.ERROR="error"})($Ka||($Ka={}));var Hl;(function(e){e.ADD="add",e.ADD_DIR="addDir",e.CHANGE="change",e.RENAME="rename",e.RENAME_DIR="renameDir",e.UNLINK="unlink",e.UNLINK_DIR="unlinkDir"})(Hl||(Hl={}));var nH;(function(e){e.ALL="all",e.CLOSE="close",e.ERROR="error",e.READY="ready"})(nH||(nH={}));var xvB=(e,t=1,r)=>{t=Math.max(1,t);let i=r?.leading??!1,n=r?.trailing??!0,a=Math.max(r?.maxWait??1/0,t),o,c,d=0,s=0,u=()=>{let g=Date.now(),m=g-d,j=g-s,S=m>=t||j>=a;return[g,S]},f=g=>{if(s=g,!o)return;let m=o;o=void 0,e.apply(void 0,m)},p=()=>{O(0)},_=()=>{c&&(p(),f(Date.now()))},h=g=>{if(s=g,i)return f(g)},y=g=>{if(n&&o)return f(g);o=void 0},b=()=>{c=void 0;let[g,m]=u();return m?y(g):v(g)},v=g=>{let m=g-d,j=g-s,S=t-m,w=a-j,D=Math.min(S,w);return O(D)},O=g=>{c&&clearTimeout(c),!(g<=0)&&(c=setTimeout(b,g))},A=(...g)=>{let[m,j]=u(),S=!!c;if(o=g,d=m,(j||!c)&&O(t),j)return S?f(m):h(m)};return A.cancel=p,A.flush=_,A},DAu=xvB;var rJc=ce(require("fs"),1),IAu=ce(require("path"),1);var KO=ce(require("fs"),1),nL=require("util");var vUi=(e,t)=>function(...i){return e.apply(void 0,i).catch(t)},qYt=(e,t)=>function(...i){try{return e.apply(void 0,i)}catch(n){return t(n)}};var kKc=ce(require("process"),1),kTh=kKc.default.getuid?!kKc.default.getuid():!1,eRh=1e4,X$=()=>{};var YKa={isChangeErrorOk:e=>{if(!YKa.isNodeError(e))return!1;let{code:t}=e;return t==="ENOSYS"||!kTh&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!YKa.isNodeError(e))return!1;let{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!YKa.isNodeError(e))throw e;if(!YKa.isChangeErrorOk(e))throw e}},aC=YKa;var eJc=class{constructor(){this.interval=25,this.intervalId=void 0,this.limit=eRh,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{let r=()=>this.remove(i),i=()=>t(r);this.add(i)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(let t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.add(t),t()}}}}},tRh=new eJc;var gUi=(e,t)=>function(i){return function n(...a){return tRh.schedule().then(o=>{let c=s=>(o(),s),d=s=>{if(o(),Date.now()>=i)throw s;if(t(s)){let u=Math.round(100*Math.random());return new Promise(p=>setTimeout(p,u)).then(()=>n.apply(void 0,a))}throw s};return e.apply(void 0,a).then(c,d)})}},OUi=(e,t)=>function(i){return function n(...a){try{return e.apply(void 0,a)}catch(o){if(Date.now()>i)throw o;if(t(o))return n.apply(void 0,a);throw o}}};var KvB={attempt:{chmod:vUi((0,nL.promisify)(KO.default.chmod),aC.onChangeError),chown:vUi((0,nL.promisify)(KO.default.chown),aC.onChangeError),close:vUi((0,nL.promisify)(KO.default.close),X$),fsync:vUi((0,nL.promisify)(KO.default.fsync),X$),mkdir:vUi((0,nL.promisify)(KO.default.mkdir),X$),realpath:vUi((0,nL.promisify)(KO.default.realpath),X$),stat:vUi((0,nL.promisify)(KO.default.stat),X$),unlink:vUi((0,nL.promisify)(KO.default.unlink),X$),chmodSync:qYt(KO.default.chmodSync,aC.onChangeError),chownSync:qYt(KO.default.chownSync,aC.onChangeError),closeSync:qYt(KO.default.closeSync,X$),existsSync:qYt(KO.default.existsSync,X$),fsyncSync:qYt(KO.default.fsync,X$),mkdirSync:qYt(KO.default.mkdirSync,X$),realpathSync:qYt(KO.default.realpathSync,X$),statSync:qYt(KO.default.statSync,X$),unlinkSync:qYt(KO.default.unlinkSync,X$)},retry:{close:gUi((0,nL.promisify)(KO.default.close),aC.isRetriableError),fsync:gUi((0,nL.promisify)(KO.default.fsync),aC.isRetriableError),open:gUi((0,nL.promisify)(KO.default.open),aC.isRetriableError),readFile:gUi((0,nL.promisify)(KO.default.readFile),aC.isRetriableError),rename:gUi((0,nL.promisify)(KO.default.rename),aC.isRetriableError),stat:gUi((0,nL.promisify)(KO.default.stat),aC.isRetriableError),write:gUi((0,nL.promisify)(KO.default.write),aC.isRetriableError),writeFile:gUi((0,nL.promisify)(KO.default.writeFile),aC.isRetriableError),closeSync:OUi(KO.default.closeSync,aC.isRetriableError),fsyncSync:OUi(KO.default.fsyncSync,aC.isRetriableError),openSync:OUi(KO.default.openSync,aC.isRetriableError),readFileSync:OUi(KO.default.readFileSync,aC.isRetriableError),renameSync:OUi(KO.default.renameSync,aC.isRetriableError),statSync:OUi(KO.default.statSync,aC.isRetriableError),writeSync:OUi(KO.default.writeSync,aC.isRetriableError),writeFileSync:OUi(KO.default.writeFileSync,aC.isRetriableError)}},rRh=KvB;var BAu=ce(require("fs"),1),XKa=ce(require("path"),1);var tJc=()=>{};var JvB=()=>{let e=tJc,t=tJc,r=!1,i=!1;return{promise:new Promise((d,s)=>{e=u=>(r=!0,d(u)),t=u=>(i=!0,s(u))}),resolve:e,reject:t,isPending:()=>!r&&!i,isResolved:()=>r,isRejected:()=>i}},iRh=JvB;var $vB=()=>{let{promise:e,resolve:t,isPending:r}=iRh(),i=0,n=()=>{i+=1},a=()=>{i-=1,!i&&t()};return(()=>{n(),queueMicrotask(a)})(),{promise:e,isPending:r,increment:n,decrement:a}},nRh=$vB;var aRh={then:e=>{e()}};var oRh=e=>Array.isArray(e)?e:[e],uRh=e=>typeof e=="function";var YvB=(e,t)=>{let r=t?.followSymlinks??!1,i=t?.depth??1/0,n=t?.limit??1/0,a=t?.ignore??[],o=oRh(a).map(H=>uRh(H)?H:G=>H.test(G)),c=H=>o.some(G=>G(H)),d=t?.signal??{aborted:!1},s=t?.onDirents||(()=>{}),u=[],f=new Set,p={},_=[],h=new Set,y={},b=[],v=new Set,O={},A={},g=new Set,m={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{},map:{}},j={directories:u,directoriesNames:f,directoriesNamesToPaths:p,files:_,filesNames:h,filesNamesToPaths:y,symlinks:b,symlinksNames:v,symlinksNamesToPaths:O,map:A},{promise:S,increment:w,decrement:D}=nRh(),B=0,q=(H,G,Ee,ue)=>{g.has(G)||B>=n||(B+=1,H.directories.push(G),H.directoriesNames.add(Ee),u.push(G),f.add(Ee),p.propertyIsEnumerable(Ee)||(p[Ee]=[]),p[Ee].push(G),g.add(G),!(ue>=i)&&(B>=n||ee(G,ue+1)))},U=(H,G,Ee)=>{g.has(G)||B>=n||(B+=1,H.files.push(G),H.filesNames.add(Ee),_.push(G),h.add(Ee),y.propertyIsEnumerable(Ee)||(y[Ee]=[]),y[Ee].push(G),g.add(G))},R=(H,G,Ee,ue)=>{g.has(G)||B>=n||(B+=1,H.symlinks.push(G),H.symlinksNames.add(Ee),b.push(G),v.add(Ee),O.propertyIsEnumerable(Ee)||(O[Ee]=[]),O[Ee].push(G),g.add(G),r&&(ue>=i||B>=n||me(G,ue+1)))},N=(H,G,Ee,ue,ge)=>{d.aborted||c(G)||(ue.isDirectory()?q(H,G,Ee,ge):ue.isFile()?U(H,G,Ee):ue.isSymbolicLink()&&R(H,G,Ee,ge))},F=(H,G,Ee,ue)=>{if(d.aborted)return;let ge=G===XKa.default.sep?"":XKa.default.sep,We=Ee.name,se=`${G}${ge}${We}`;c(se)||(Ee.isDirectory()?q(H,se,We,ue):Ee.isFile()?U(H,se,We):Ee.isSymbolicLink()&&R(H,se,We,ue))},x=(H,G,Ee,ue)=>{for(let ge=0,We=Ee.length;ge<We;ge++)F(H,G,Ee[ge],ue)},ee=(H,G)=>{d.aborted||G>i||B>=n||(w(),BAu.default.readdir(H,{withFileTypes:!0},(Ee,ue)=>{if(Ee||d.aborted||!ue.length)return D();(s(ue)||aRh).then(()=>{let We=A[H]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};x(We,H,ue,G),D()})}))},me=(H,G)=>{w(),BAu.default.realpath(H,(Ee,ue)=>{if(Ee||d.aborted)return D();BAu.default.stat(ue,(ge,We)=>{if(ge||d.aborted)return D();let se=XKa.default.basename(ue),ne=A[H]={directories:[],directoriesNames:new Set,directoriesNamesToPaths:{},files:[],filesNames:new Set,filesNamesToPaths:{},symlinks:[],symlinksNames:new Set,symlinksNamesToPaths:{}};N(ne,ue,se,We,G),D()})})};return(async(H,G=1)=>(H=XKa.default.normalize(H),g.add(H),ee(H,G),await S,d.aborted?m:j))(e)},sRh=YvB;var TYt={lang:{debounce:DAu,attempt:e=>{try{return e()}catch(t){return TYt.lang.castError(t)}},castArray:e=>TYt.lang.isArray(e)?e:[e],castError:e=>TYt.lang.isError(e)?e:TYt.lang.isString(e)?new Error(e):new Error("Unknown error"),defer:e=>setTimeout(e,0),isArray:e=>Array.isArray(e),isError:e=>e instanceof Error,isFunction:e=>typeof e=="function",isNaN:e=>Number.isNaN(e),isNumber:e=>typeof e=="number",isPrimitive:e=>{if(e===null)return!0;let t=typeof e;return t!=="object"&&t!=="function"},isShallowEqual:(e,t)=>{if(e===t)return!0;if(TYt.lang.isNaN(e))return TYt.lang.isNaN(t);if(TYt.lang.isPrimitive(e)||TYt.lang.isPrimitive(t))return e===t;for(let r in e)if(!(r in t))return!1;for(let r in t)if(e[r]!==t[r])return!1;return!0},isSet:e=>e instanceof Set,isString:e=>typeof e=="string",isUndefined:e=>e===void 0,noop:()=>{},uniq:e=>e.length<2?e:Array.from(new Set(e))},fs:{getDepth:e=>Math.max(0,e.split(IAu.default.sep).length-1),getRealPath:(e,t)=>{try{return t?rJc.default.realpathSync.native(e):rJc.default.realpathSync(e)}catch{return}},isSubPath:(e,t)=>t.startsWith(e)&&t[e.length]===IAu.default.sep&&t.length-e.length>IAu.default.sep.length,poll:(e,t=ZTh)=>rRh.retry.stat(t)(e,{bigint:!0}).catch(TYt.lang.noop),readdir:async(e,t,r=1/0,i=1/0,n,a)=>{if(a&&r===1&&e in a){let o=a[e];return[o.directories,o.files]}else{let o=await sRh(e,{depth:r,limit:i,ignore:t,signal:n});return[o.directories,o.files]}}}},Mp=TYt;var CAu=ce(require("path"),1);var iJc=class{constructor(t,r,i){this.base=i,this.watcher=t,this.handler=r.handler,this.fswatcher=r.watcher,this.options=r.options,this.folderPath=r.folderPath,this.filePath=r.filePath,this.handlerBatched=this.base?this.base.onWatcherEvent.bind(this.base):this._makeHandlerBatched(this.options.debounce)}_isSubRoot(t){return this.filePath?t===this.filePath:t===this.folderPath||Mp.fs.isSubPath(this.folderPath,t)}_makeHandlerBatched(t=$Th){return(()=>{let r=this.watcher._readyWait,i=[],n=new Set,a=async(c,d)=>{let s=this.options.ignoreInitial?[]:c,u=await this.eventsPopulate([...d]),f=this.eventsDeduplicate([...s,...u]);this.onTargetEvents(f)},o=Mp.lang.debounce(()=>{this.watcher.isClosed()||(r=a(i,n),i=[],n=new Set)},t);return async(c,d="",s=!1)=>{s?await this.eventsPopulate([d],i,!0):n.add(d),r.then(o)}})()}eventsDeduplicate(t){if(t.length<2)return t;let r={};return t.reduce((i,n)=>{let[a,o]=n,c=r[o];return a===c||a===Hl.CHANGE&&c===Hl.ADD||(r[o]=a,i.push(n)),i},[])}async eventsPopulate(t,r=[],i=!1){return await Promise.all(t.map(async n=>{let a=await this.watcher._poller.update(n,this.options.pollingTimeout);await Promise.all(a.map(async o=>{r.push([o,n]),o===Hl.ADD_DIR?await this.eventsPopulateAddDir(t,n,r,i):o===Hl.UNLINK_DIR&&await this.eventsPopulateUnlinkDir(t,n,r,i)}))})),r}async eventsPopulateAddDir(t,r,i=[],n=!1){if(n)return i;let a=this.options.recursive?this.options.depth??v$i:Math.min(1,this.options.depth??v$i),o=this.options.limit??JKa,[c,d]=await Mp.fs.readdir(r,this.options.ignore,a,o,this.watcher._closeSignal),s=[...c,...d];return await Promise.all(s.map(u=>{if(!this.watcher.isIgnored(u,this.options.ignore)&&!t.includes(u))return this.eventsPopulate([u],i,!0)})),i}async eventsPopulateUnlinkDir(t,r,i=[],n=!1){if(n)return i;for(let a of this.watcher._poller.stats.keys())Mp.fs.isSubPath(r,a)&&(t.includes(a)||await this.eventsPopulate([a],i,!0));return i}onTargetAdd(t){this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAdd(t,this.options.renameTimeout):this.watcher.event(Hl.ADD,t))}onTargetAddDir(t){t!==this.folderPath&&this.options.recursive&&!g$i&&this.options.native!==!1&&this.watcher.watchDirectory(t,this.options,this.handler,void 0,this.base||this),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetAddDir(t,this.options.renameTimeout):this.watcher.event(Hl.ADD_DIR,t))}onTargetChange(t){this._isSubRoot(t)&&this.watcher.event(Hl.CHANGE,t)}onTargetUnlink(t){this.watcher.watchersClose(CAu.default.dirname(t),t,!1),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlink(t,this.options.renameTimeout):this.watcher.event(Hl.UNLINK,t))}onTargetUnlinkDir(t){this.watcher.watchersClose(CAu.default.dirname(t),t,!1),this.watcher.watchersClose(t),this._isSubRoot(t)&&(this.options.renameDetection?this.watcher._locker.getLockTargetUnlinkDir(t,this.options.renameTimeout):this.watcher.event(Hl.UNLINK_DIR,t))}onTargetEvent(t){let[r,i]=t;r===Hl.ADD?this.onTargetAdd(i):r===Hl.ADD_DIR?this.onTargetAddDir(i):r===Hl.CHANGE?this.onTargetChange(i):r===Hl.UNLINK?this.onTargetUnlink(i):r===Hl.UNLINK_DIR&&this.onTargetUnlinkDir(i)}onTargetEvents(t){for(let r of t)this.onTargetEvent(r)}onWatcherEvent(t,r,i=!1){return this.handlerBatched(t,r,i)}onWatcherChange(t=jvn.CHANGE,r){if(this.watcher.isClosed())return;let i=CAu.default.resolve(this.folderPath,r||"");this.filePath&&i!==this.folderPath&&i!==this.filePath||this.watcher.isIgnored(i,this.options.ignore)||this.onWatcherEvent(t,i)}onWatcherError(t){XKc&&t.code==="EPERM"?this.onWatcherChange(jvn.CHANGE,""):this.watcher.error(t)}async init(){await this.initWatcherEvents(),await this.initInitialEvents()}async initWatcherEvents(){let t=this.onWatcherChange.bind(this);this.fswatcher.on($Ka.CHANGE,t);let r=this.onWatcherError.bind(this);this.fswatcher.on($Ka.ERROR,r)}async initInitialEvents(){let t=!this.watcher.isReady();if(this.filePath){if(this.watcher._poller.stats.has(this.filePath))return;await this.onWatcherEvent(jvn.CHANGE,this.filePath,t)}else{let r=this.options.recursive&&g$i&&this.options.native!==!1?this.options.depth??v$i:Math.min(1,this.options.depth??v$i),i=this.options.limit??JKa,[n,a]=await Mp.fs.readdir(this.folderPath,this.options.ignore,r,i,this.watcher._closeSignal,this.options.readdirMap),o=[this.folderPath,...n,...a];await Promise.all(o.map(c=>{if(!this.watcher._poller.stats.has(c)&&!this.watcher.isIgnored(c,this.options.ignore))return this.onWatcherEvent(jvn.CHANGE,c,t)}))}}},cRh=iJc;var aH={interval:100,intervalId:void 0,fns:new Map,init:()=>{aH.intervalId||(aH.intervalId=setInterval(aH.resolve,aH.interval))},reset:()=>{aH.intervalId&&(clearInterval(aH.intervalId),delete aH.intervalId)},add:(e,t)=>{aH.fns.set(e,Date.now()+t),aH.init()},remove:e=>{aH.fns.delete(e)},resolve:()=>{if(!aH.fns.size)return aH.reset();let e=Date.now();for(let[t,r]of aH.fns)r>=e||(aH.remove(t),t())}},ZKa=aH;var kKa=class e{constructor(t){this._watcher=t,this.reset()}getLockAdd(t,r=ZKc){let{ino:i,targetPath:n,events:a,locks:o}=t,c=()=>{let f=this._watcher._poller.paths.find(i||-1,p=>p!==n);if(f&&f!==n){if(Mp.fs.getRealPath(n,!0)===f)return;this._watcher.event(a.rename,f,n)}else this._watcher.event(a.add,n)};if(!i)return c();let d=()=>{o.add.delete(i),ZKa.remove(s)},s=()=>{d(),c()};ZKa.add(s,r);let u=()=>{let f=o.unlink.get(i);if(!f)return;d();let p=f();n===p?a.change&&this._watcher._poller.stats.has(n)&&this._watcher.event(a.change,n):this._watcher.event(a.rename,p,n)};o.add.set(i,u),u()}getLockUnlink(t,r=ZKc){let{ino:i,targetPath:n,events:a,locks:o}=t,c=()=>{this._watcher.event(a.unlink,n)};if(!i)return c();let d=()=>{o.unlink.delete(i),ZKa.remove(s)},s=()=>{d(),c()};ZKa.add(s,r);let u=()=>(d(),n);o.unlink.set(i,u),o.add.get(i)?.()}getLockTargetAdd(t,r){let i=this._watcher._poller.getIno(t,Hl.ADD,CYt.FILE);return this.getLockAdd({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetAddDir(t,r){let i=this._watcher._poller.getIno(t,Hl.ADD_DIR,CYt.DIR);return this.getLockAdd({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}getLockTargetUnlink(t,r){let i=this._watcher._poller.getIno(t,Hl.UNLINK,CYt.FILE);return this.getLockUnlink({ino:i,targetPath:t,events:e.FILE_EVENTS,locks:this._locksFile},r)}getLockTargetUnlinkDir(t,r){let i=this._watcher._poller.getIno(t,Hl.UNLINK_DIR,CYt.DIR);return this.getLockUnlink({ino:i,targetPath:t,events:e.DIR_EVENTS,locks:this._locksDir},r)}reset(){this._locksAdd=new Map,this._locksAddDir=new Map,this._locksUnlink=new Map,this._locksUnlinkDir=new Map,this._locksDir={add:this._locksAddDir,unlink:this._locksUnlinkDir},this._locksFile={add:this._locksAdd,unlink:this._locksUnlink}}};kKa.DIR_EVENTS={add:Hl.ADD_DIR,rename:Hl.RENAME_DIR,unlink:Hl.UNLINK_DIR};kKa.FILE_EVENTS={add:Hl.ADD,change:Hl.CHANGE,rename:Hl.RENAME,unlink:Hl.UNLINK};var lRh=kKa;var nJc=class{constructor(){this.map=new Map}clear(){this.map.clear()}delete(t,r){if(Mp.lang.isUndefined(r))return this.map.delete(t);if(this.map.has(t)){let i=this.map.get(t);if(Mp.lang.isSet(i)){let n=i.delete(r);return i.size||this.map.delete(t),n}else if(i===r)return this.map.delete(t),!0}return!1}find(t,r){if(this.map.has(t)){let i=this.map.get(t);if(Mp.lang.isSet(i))return Array.from(i).find(r);if(r(i))return i}}get(t){return this.map.get(t)}has(t,r){if(Mp.lang.isUndefined(r))return this.map.has(t);if(this.map.has(t)){let i=this.map.get(t);return Mp.lang.isSet(i)?i.has(r):i===r}return!1}set(t,r){if(this.map.has(t)){let i=this.map.get(t);Mp.lang.isSet(i)?i.add(r):i!==r&&this.map.set(t,new Set([i,r]))}else this.map.set(t,r);return this}},aJc=nJc;var oJc=class{constructor(t){this.ino=t.ino<=Number.MAX_SAFE_INTEGER?Number(t.ino):t.ino,this.size=Number(t.size),this.atimeMs=Number(t.atimeMs),this.mtimeMs=Number(t.mtimeMs),this.ctimeMs=Number(t.ctimeMs),this.birthtimeMs=Number(t.birthtimeMs),this._isFile=t.isFile(),this._isDirectory=t.isDirectory(),this._isSymbolicLink=t.isSymbolicLink()}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}},fRh=oJc;var uJc=class{constructor(){this.inos={},this.paths=new aJc,this.stats=new Map}getIno(t,r,i){let n=this.inos[r];if(!n)return;let a=n[t];if(a&&!(i&&a[1]!==i))return a[0]}getStats(t){return this.stats.get(t)}async poll(t,r){let i=await Mp.fs.poll(t,r);if(!(!i||!(i.isFile()||i.isDirectory())))return new fRh(i)}reset(){this.inos={},this.paths=new aJc,this.stats=new Map}async update(t,r){let i=this.getStats(t),n=await this.poll(t,r);if(this.updateStats(t,n),!i&&n){if(n.isFile())return this.updateIno(t,Hl.ADD,n),[Hl.ADD];if(n.isDirectory())return this.updateIno(t,Hl.ADD_DIR,n),[Hl.ADD_DIR]}else if(i&&!n){if(i.isFile())return this.updateIno(t,Hl.UNLINK,i),[Hl.UNLINK];if(i.isDirectory())return this.updateIno(t,Hl.UNLINK_DIR,i),[Hl.UNLINK_DIR]}else if(i&&n){if(i.isFile()){if(n.isFile())return i.ino===n.ino&&!i.size&&!n.size?[]:(this.updateIno(t,Hl.CHANGE,n),[Hl.CHANGE]);if(n.isDirectory())return this.updateIno(t,Hl.UNLINK,i),this.updateIno(t,Hl.ADD_DIR,n),[Hl.UNLINK,Hl.ADD_DIR]}else if(i.isDirectory()){if(n.isFile())return this.updateIno(t,Hl.UNLINK_DIR,i),this.updateIno(t,Hl.ADD,n),[Hl.UNLINK_DIR,Hl.ADD];if(n.isDirectory())return i.ino===n.ino?[]:(this.updateIno(t,Hl.UNLINK_DIR,i),this.updateIno(t,Hl.ADD_DIR,n),[Hl.UNLINK_DIR,Hl.ADD_DIR])}}return[]}updateIno(t,r,i){let n=this.inos[r]=this.inos[r]||(this.inos[r]={}),a=i.isFile()?CYt.FILE:CYt.DIR;n[t]=[i.ino,a]}updateStats(t,r){if(r)this.paths.set(r.ino,t),this.stats.set(t,r);else{let i=this.stats.get(t)?.ino||-1;this.paths.delete(i,t),this.stats.delete(t)}}},sJc=uJc;var cJc=class e extends dRh.EventEmitter{constructor(t,r,i){super(),this._closed=!1,this._ready=!1,this._closeAborter=new AbortController,this._closeSignal=this._closeAborter.signal,this.on(nH.CLOSE,()=>this._closeAborter.abort()),this._closeWait=new Promise(n=>this.on(nH.CLOSE,n)),this._readyWait=new Promise(n=>this.on(nH.READY,n)),this._locker=new lRh(this),this._roots=new Set,this._poller=new sJc,this._pollers=new Set,this._subwatchers=new Set,this._watchers={},this._watchersLock=Promise.resolve(),this._watchersRestorable={},this.watch(t,r,i)}isClosed(){return this._closed}isIgnored(t,r){return!!r&&(Mp.lang.isFunction(r)?!!r(t):r.test(t))}isReady(){return this._ready}close(){return this._locker.reset(),this._poller.reset(),this._roots.clear(),this.watchersClose(),this.isClosed()?!1:(this._closed=!0,this.emit(nH.CLOSE))}error(t){if(this.isClosed())return!1;let r=Mp.lang.castError(t);return this.emit(nH.ERROR,r)}event(t,r,i){return this.isClosed()?!1:(this.emit(nH.ALL,t,r,i),this.emit(t,r,i))}ready(){return this.isClosed()||this.isReady()?!1:(this._ready=!0,this.emit(nH.READY))}pollerExists(t,r){for(let i of this._pollers)if(i.targetPath===t&&Mp.lang.isShallowEqual(i.options,r))return!0;return!1}subwatcherExists(t,r){for(let i of this._subwatchers)if(i.targetPath===t&&Mp.lang.isShallowEqual(i.options,r))return!0;return!1}watchersClose(t,r,i=!0){if(t){let n=this._watchers[t];if(n)for(let a of[...n])r&&a.filePath!==r||this.watcherClose(a);if(i)for(let a in this._watchers)Mp.fs.isSubPath(t,a)&&this.watchersClose(a,r,!1)}else for(let n in this._watchers)this.watchersClose(n,r,!1)}watchersLock(t){return this._watchersLock.then(()=>this._watchersLock=new Promise(async r=>{await t(),r()}))}watchersRestore(){delete this._watchersRestoreTimeout;let t=Object.entries(this._watchersRestorable);this._watchersRestorable={};for(let[r,i]of t)this.watchPath(r,i.options,i.handler)}async watcherAdd(t,r){let{folderPath:i}=t;(this._watchers[i]=this._watchers[i]||[]).push(t);let a=new cRh(this,t,r);return await a.init(),a}watcherClose(t){t.watcher.close();let r=this._watchers[t.folderPath];if(r){let a=r.indexOf(t);r.splice(a,1),r.length||delete this._watchers[t.folderPath]}let i=t.filePath||t.folderPath;this._roots.has(i)&&(this._watchersRestorable[i]=t,this._watchersRestoreTimeout||(this._watchersRestoreTimeout=Mp.lang.defer(()=>this.watchersRestore())))}watcherExists(t,r,i,n){if(this._watchers[t]?.find(c=>c.handler===i&&(!c.filePath||c.filePath===n)&&c.options.ignore===r.ignore&&!!c.options.native==!!r.native&&(!r.recursive||c.options.recursive)))return!0;let o=wvn.default.dirname(t);for(let c=1;c<1/0;c++){if(this._watchers[o]?.find(u=>(c===1||u.options.recursive&&c<=(u.options.depth??v$i))&&u.handler===i&&(!u.filePath||u.filePath===n)&&u.options.ignore===r.ignore&&!!u.options.native==!!r.native&&(!r.recursive||u.options.recursive&&g$i&&u.options.native!==!1)))return!0;if(!g$i)break;let s=wvn.default.dirname(t);if(o===s)break;o=s}return!1}async watchDirectories(t,r,i,n,a){if(this.isClosed())return;t=Mp.lang.uniq(t).sort();let o;for(let c of t)if(!this.isIgnored(c,r.ignore)&&!this.watcherExists(c,r,i,n))try{let d=!r.recursive||g$i&&r.native!==!1?r:{...r,recursive:!1},u={watcher:qAu.default.watch(c,d),handler:i,options:r,folderPath:c,filePath:n},f=o=await this.watcherAdd(u,a);if(this._roots.has(n||c)){let _={...r,ignoreInitial:!0,recursive:!1},h=wvn.default.dirname(c),y=c;await this.watchDirectories([h],_,i,y,f)}}catch(d){this.error(d)}return o}async watchDirectory(t,r,i,n,a){if(!this.isClosed()&&!this.isIgnored(t,r.ignore)){if(!r.recursive||g$i&&r.native!==!1)return this.watchersLock(()=>this.watchDirectories([t],r,i,n,a));{r={...r,recursive:!0};let o=r.depth??v$i,c=r.limit??JKa,[d]=await Mp.fs.readdir(t,r.ignore,o,c,this._closeSignal,r.readdirMap);return this.watchersLock(async()=>{let s=await this.watchDirectories([t],r,i,n,a);if(d.length){let u=Mp.fs.getDepth(t);for(let f of d){let p=Mp.fs.getDepth(f),_=Math.max(0,o-(p-u)),h={...r,depth:_};await this.watchDirectories([f],h,i,n,a||s)}}})}}}async watchFileOnce(t,r,i){if(this.isClosed()||(r={...r,ignoreInitial:!1},this.subwatcherExists(t,r)))return;let n={targetPath:t,options:r},a=(s,u)=>{u===t&&(d(),i())},o=new e(a),c=()=>{this._subwatchers.add(n),this.on(nH.CLOSE,d),o.watchFile(t,r,a)},d=()=>{this._subwatchers.delete(n),this.removeListener(nH.CLOSE,d),o.close()};return c()}async watchFile(t,r,i){if(this.isClosed()||this.isIgnored(t,r.ignore))return;r={...r,recursive:!1};let n=wvn.default.dirname(t);return this.watchDirectory(n,r,i,t)}async watchPollingOnce(t,r,i){if(this.isClosed())return;let n=!1,a=new sJc,o=await this.watchPolling(t,r,async()=>{n||!(await a.update(t,r.pollingTimeout)).length||n||(n=!0,o(),i())})}async watchPolling(t,r,i){if(this.isClosed())return Mp.lang.noop;if(this.pollerExists(t,r))return Mp.lang.noop;let n={...r,interval:r.pollingInterval??XTh},a={targetPath:t,options:r},o=()=>{this._pollers.add(a),this.on(nH.CLOSE,c),qAu.default.watchFile(t,n,i)},c=()=>{this._pollers.delete(a),this.removeListener(nH.CLOSE,c),qAu.default.unwatchFile(t,i)};return Mp.lang.attempt(o),()=>Mp.lang.attempt(c)}async watchUnknownChild(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchFileOnce(t,r,n)}async watchUnknownTarget(t,r,i){if(this.isClosed())return;let n=()=>this.watchPath(t,r,i);return this.watchPollingOnce(t,r,n)}async watchPaths(t,r,i){if(this.isClosed())return;if(t=Mp.lang.uniq(t).sort(),t.every((a,o)=>t.every((c,d)=>d===o||!Mp.fs.isSubPath(a,c))))await Promise.all(t.map(a=>this.watchPath(a,r,i)));else for(let a of t)await this.watchPath(a,r,i)}async watchPath(t,r,i){if(this.isClosed()||(t=wvn.default.resolve(t),this.isIgnored(t,r.ignore)))return;let n=await Mp.fs.poll(t,r.pollingTimeout);if(n){if(n.isFile())return this.watchFile(t,r,i);if(n.isDirectory())return this.watchDirectory(t,r,i);this.error(`"${t}" is not supported`)}else{let a=wvn.default.dirname(t);return(await Mp.fs.poll(a,r.pollingTimeout))?.isDirectory()?this.watchUnknownChild(t,r,i):this.watchUnknownTarget(t,r,i)}}async watch(t,r,i=Mp.lang.noop){if(Mp.lang.isFunction(t))return this.watch([],{},t);if(Mp.lang.isUndefined(t))return this.watch([],r,i);if(Mp.lang.isFunction(r))return this.watch(t,{},r);if(Mp.lang.isUndefined(r))return this.watch(t,{},i);if(this.isClosed())return;this.isReady()&&(r.readdirMap=void 0);let n=Mp.lang.castArray(t);n.forEach(a=>this._roots.add(a)),await this.watchPaths(n,r,i),!this.isClosed()&&(i!==Mp.lang.noop&&this.on(nH.ALL,i),r.readdirMap=void 0,this.ready())}},TAu=cJc;yXo();var xua=require("fs/promises"),pRh=require("os"),_Rh=ce(require("path"),1),XvB=".fern",ZvB="logs";function kvB(){return"cli@3.35.2"}var eJa=class{logFilePath=null;initialized=!1;sessionStartTime;constructor(){this.sessionStartTime=Date.now()}async initialize(){if(this.initialized)return;let t=Ct(Ir.of((0,pRh.homedir)()),Xe.of(XvB)),r=Ct(t,Xe.of(ZvB));await mi(r)||await(0,xua.mkdir)(r,{recursive:!0});let n=`${new Date().toISOString().replace(/[:.]/g,"-")}.debug.log`;this.logFilePath=Ct(r,Xe.of(n));let a=["================================================================================","Fern Docs Dev Debug Log",`Session started: ${new Date().toISOString()}`,`Log file: ${_Rh.default.basename(this.logFilePath)}`,"================================================================================",""].join(`
1785
1785
  `);await(0,xua.writeFile)(this.logFilePath,a,"utf-8"),this.initialized=!0}getLogFilePath(){return this.logFilePath}async writeEntry(t){if(!this.initialized||!this.logFilePath)return;let r=JSON.stringify(t)+`
1786
1786
  `;try{await(0,xua.appendFile)(this.logFilePath,r,"utf-8")}catch{}}async logFrontendMetrics(t){let r={timestamp:t.timestamp,source:t.source,level:t.level,eventType:this.getEventType(t.payload,t.isAggregate),isAggregate:t.isAggregate,data:t.payload};await this.writeEntry(r)}async logCliMetric(t,r="info"){let i={timestamp:t.timestamp,source:kvB(),level:r,eventType:t.type,data:{durationMs:t.durationMs,metadata:t.metadata}};await this.writeEntry(i)}async logCliMemory(){let t=process.memoryUsage(),r={type:"cli_memory",timestamp:new Date().toISOString(),metadata:{heapUsed:t.heapUsed,heapTotal:t.heapTotal,external:t.external,rss:t.rss,heapUsedMB:Math.round(t.heapUsed/1024/1024*100)/100,heapTotalMB:Math.round(t.heapTotal/1024/1024*100)/100,rssMB:Math.round(t.rss/1024/1024*100)/100}};await this.logCliMetric(r)}async logCliReloadStart(){let t={type:"cli_reload_start",timestamp:new Date().toISOString()};await this.logCliMetric(t)}async logCliReloadFinish(t,r){let i={type:"cli_reload_finish",timestamp:new Date().toISOString(),durationMs:t,metadata:r};await this.logCliMetric(i)}async logCliDocsGeneration(t,r){let i={type:"cli_docs_generation",timestamp:new Date().toISOString(),durationMs:t,metadata:r};await this.logCliMetric(i)}async logCliValidation(t,r){let i={type:"cli_validation",timestamp:new Date().toISOString(),durationMs:t,metadata:{success:r}};await this.logCliMetric(i)}getEventType(t,r){return r?"aggregate_summary":"type"in t&&typeof t.type=="string"?t.type:"unknown"}static isMetricsMessage(t){if(typeof t!="object"||t===null)return!1;let r=t;return r.type==="metrics"&&typeof r.timestamp=="string"&&typeof r.source=="string"}};var z$c=ce(vJc(),1),o4h=ce(wmu(),1),Z$=require("fs/promises"),u4h=require("os"),s4h=ce(Z9(),1),c4h=ce(n4h(),1),Vmu=process.platform==="win32",R$c=It.cyan("[docs]:"),gPB="etag",OPB=23,a4h=e=>e.padEnd(OPB," "),APB="preview",mPB="app-preview",PPB="bundle",jPB=".next",wPB="standalone",EPB=".fern",SPB="packages/fern-docs/bundle/.next/server/instrumentation.js",MPB=".npmrc",DPB=".pnpmfile.cjs",BPB="pnpm-workspace.yaml",IPB='Cannot find matching keyid: {"signatures":';function CPB(){return Ct(Ir.of((0,u4h.homedir)()),Xe.of(EPB))}function csa({app:e=!1}){return Ct(CPB(),Xe.of(e?mPB:APB))}function M$i({app:e=!1}){return Ct(csa({app:e}),Xe.of(e?jPB:PPB))}function jJa({app:e=!1}){return Ct(M$i({app:e}),Xe.of(wPB))}function qPB({app:e=!1}){return Ct(jJa({app:e}),Xe.of(SPB))}function TPB({app:e=!1}){return Ct(jJa({app:e}),Xe.of(BPB))}function RPB({app:e=!1}){return Ct(jJa({app:e}),Xe.of(DPB))}function zPB({app:e=!1}){return Ct(jJa({app:e}),Xe.of(MPB))}function Cvn(e){return new Error(`${e}. Please reach out to support@buildwithfern.com.`)}function NPB({app:e=!1}){return Ct(csa({app:e}),Xe.of(gPB))}var FPB=`module.exports = {
1787
1787
  hooks: {
@@ -1814,7 +1814,7 @@ Please wait while the installation completes. This may take a few minutes depend
1814
1814
  `;)b++;let O=a.slice(v,b).trim();if(a[b]==="="){for(b++;b<h&&(a[b]===" "||a[b]===`
1815
1815
  `);)b++;if(a[b]==='"'||a[b]==="'"){let A=a[b];b++;let g=b;for(;b<h&&a[b]!==A;)a[b]==="\\"?b+=2:b++;let m=a.slice(g,b);if(b++,O==="src"||O==="icon"&&D$i(m)){let j=c(m);j&&p.push({start:g,end:g+m.length,replacement:j})}else if(O==="href"){let j=Wmu({href:m,markdownFilesToPathName:r,metadata:i});j&&j.type==="replace"&&p.push({start:g,end:g+m.length,replacement:j.slug})}}}}b<h&&a[b]===">"&&b++,_=b;continue}_++}u=Gmu(a,p);let y=performance.now()-f;n.logger.debug(`Streaming replacement completed in ${y.toFixed(0)}ms: ${p.length} edits applied`)}else{let f=U$c(a),p=_4h(a),_=[];Fi(f,y=>{let b=y;return b.type==="image"||b.type==="link"||b.type==="mdxJsxFlowElement"||b.type==="mdxJsxTextElement"||b.type==="mdxFlowExpression"||b.type==="mdxTextExpression"},y=>{if(y.position==null)return;let{start:b,length:v}=h4h(p,y.position),O=a.slice(b,b+v),A=O;function g(S){let w=c(S);S&&w&&(A=A.replace(S,w))}function m(S){let w=Wmu({href:S,markdownFilesToPathName:r,metadata:i});S!=null&&w!=null&&w.type==="replace"&&(A=A.replace(S,w.slug))}function j(S){L$c(S,{src:w=>g(dR(qvn(w.value))),icon:w=>{let D=dR(qvn(w.value));D$i(D)&&g(D)},href:w=>m(dR(qvn(w.value)))})}if(y.type==="image"){let S=dR(y.url);g(dR(S))}if(y.type==="link"&&m(dR(y.url)),N$c(y)){let S=y.attributes.filter(Tvn).find(q=>q.name==="src");g(dR(lsa(S?.value)));let w=y.attributes.filter(Tvn).find(q=>q.name==="icon"),D=dR(lsa(w?.value));D$i(D)&&g(D);let B=y.attributes.find(q=>q.type==="mdxJsxAttribute"&&q.name==="href");m(dR(lsa(B?.value))),y.attributes.forEach(q=>{Tvn(q)&&typeof q.value!="string"&&q.value!=null&&q.value.data?.estree?j(q.value.data.estree):Q$c(q)&&q.data?.estree&&j(q.data.estree)})}return F$c(y)&&y.data?.estree&&j(y.data.estree),A!==O&&_.push({start:b,end:b+v,replacement:A}),na}),u=Gmu(a,_)}return EJa.default.stringify(u,o)}function dR(e){if(typeof e=="string")return e.replace(/#.*$/,"")}function GPB(e){return e.replace(/\\([()])/g,"$1")}function y4h(e,t,r){for(let i of t){let n=e[i];if(n!=null){if(typeof n=="object")n.type==="fileId"&&(e[i]={type:"fileId",value:li.FileId(r(n.value)??n.value)});else if(typeof n=="string"){let a=r(n);e[i]=a?{type:"fileId",value:li.FileId(a)}:{type:"url",value:li.Url(n)}}}}}var HPB=zt.union([zt.string(),zt.object({light:zt.string().optional(),dark:zt.string().optional()})]);function V$c(e,t){let r=t(e);return r?{type:"fileId",value:li.FileId(r)}:{type:"url",value:li.Url(e)}}function b4h(e,t){let r=HPB.safeParse(e.logo);if(!r.success)return;let i=r.data;typeof i=="string"?e.logo=V$c(i,t):(i.light!=null&&(e.logo.light=V$c(i.light,t)),i.dark!=null&&(e.logo.dark=V$c(i.dark,t)))}var v4h=require("fs/promises");async function xPB(e){return(await(0,v4h.readFile)(e)).toString()}function KPB(e){return e.startsWith("http://")||e.startsWith("https://")}function JPB(e,t){let r=e.split(`
1816
1816
  `),i=new Set,n=t.trim();n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1));let a=n.split(",");for(let d of a){let s=d.trim(),u=s.match(/^(\d+)-(\d+)$/);if(u){let p=parseInt(u[1]??"1",10),_=parseInt(u[2]??"1",10);for(let h=p;h<=_;h++)i.add(h-1);continue}let f=s.match(/^(\d+)$/);if(f){let p=parseInt(f[1]??"1",10);i.add(p-1);continue}if(s!=="")return e}return i.size===0?e:Array.from(i).sort((d,s)=>d-s).filter(d=>d>=0&&d<r.length).map(d=>r[d]??"").join(`
1817
- `)}async function K$c({markdown:e,absolutePathToFernFolder:t,absolutePathToMarkdownFile:r,context:i,fileLoader:n=xPB}){if(!e.includes("<Code"))return e;let a=/([ \t]*)<Code(?:\s+[^>]*?)?\s+src={?['"]([^'"]+)['"](?! \+)}?((?:\s+[^>]*)?)\/>/g,o=e,c;for(;(c=a.exec(e))!=null;){let d=c[0],s=c[1],u=c[2];if(d==null||u==null)throw new Error(`Failed to parse regex "${c}" in ${r}`);try{let f,p,_;if(KPB(u))try{let S=await fetch(u);if(!S.ok){i.logger.warn(`Failed to fetch code from URL "${u}" (status ${S.status}) referenced in ${r}`);break}f=await S.text();let D=new URL(u).pathname;p=D.split(".").pop(),_=D.split("/").pop()}catch(S){i.logger.warn(`Failed to fetch code from URL "${u}" referenced in ${r}: ${S}`);break}else{let S=Uu(u.startsWith("/")?t:en(r),Xe.of(u.replace(/^\//,"")));f=await n(S),p=S.split(".").pop(),_=S.split("/").pop()}let h=new Map,y=/(\w+)=(?:{([^}]+)}|"([^"]+)")/g,b=d?.split("src=")[0]?.trim()??"",v;for(;(v=y.exec(b))!==null;){let S=v[1],w=v[2]||v[3],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}let O=c[3]?.trim()||"";for(y.lastIndex=0;(v=y.exec(O))!==null;){let S=v[1],w=v[2]||v[3],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}h.delete("src");let A=h.get("language");A&&(p=A.value,h.delete("language"));let g=h.get("title");g&&(_=g.value,h.delete("title"));let m=h.get("lines");m&&(f=JPB(f,m.value),h.delete("lines"));let j="";p!=null&&(j+=p),_!=null&&(g?.fromCurlyBraces?j+=` title={${_}}`:j+=` title={"${_}"}`);for(let[S,w]of h)if(w.fromCurlyBraces)j+=` ${S}={${w.value}}`;else{let D=w.value.trim();/^-?\d+(\.\d+)?$/.test(D)?j+=` ${S}={${D}}`:D==="true"||D==="false"?j+=` ${S}={${D}}`:j+=` ${S}={${JSON.stringify(w.value)}}`}f=`\`\`\`${j}
1817
+ `)}async function K$c({markdown:e,absolutePathToFernFolder:t,absolutePathToMarkdownFile:r,context:i,fileLoader:n=xPB}){if(!e.includes("<Code"))return e;let a=/([ \t]*)<Code(?:\s+[^>]*?)?\s+src={?['"]([^'"]+)['"](?! \+)}?((?:\s+[^>]*)?)\/>/g,o=e,c;for(;(c=a.exec(e))!=null;){let d=c[0],s=c[1],u=c[2];if(d==null||u==null)throw new Error(`Failed to parse regex "${c}" in ${r}`);try{let f,p,_;if(KPB(u))try{let S=await fetch(u);if(!S.ok){i.logger.warn(`Failed to fetch code from URL "${u}" (status ${S.status}) referenced in ${r}`);break}f=await S.text();let D=new URL(u).pathname;p=D.split(".").pop(),_=D.split("/").pop()}catch(S){i.logger.warn(`Failed to fetch code from URL "${u}" referenced in ${r}: ${S}`);break}else{let S=Uu(u.startsWith("/")?t:en(r),Xe.of(u.replace(/^\//,"")));f=await n(S),p=S.split(".").pop(),_=S.split("/").pop()}let h=new Map,y=/(\w+)=(?:{([^}]+)}|"([^"]+)"|(\d+)(?=\s|\/|>|$))/g,b=d?.split("src=")[0]?.trim()??"",v;for(;(v=y.exec(b))!==null;){let S=v[1],w=v[2]||v[3]||v[4],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}let O=c[3]?.trim()||"";for(y.lastIndex=0;(v=y.exec(O))!==null;){let S=v[1],w=v[2]||v[3]||v[4],D=v[2]!==void 0;S&&w&&h.set(S,{value:w,fromCurlyBraces:D})}h.delete("src");let A=h.get("language");A&&(p=A.value,h.delete("language"));let g=h.get("title");g&&(_=g.value,h.delete("title"));let m=h.get("lines");m&&(f=JPB(f,m.value),h.delete("lines"));let j="";p!=null&&(j+=p),_!=null&&(g?.fromCurlyBraces?j+=` title={${_}}`:j+=` title={"${_}"}`);for(let[S,w]of h)if(w.fromCurlyBraces)j+=` ${S}={${w.value}}`;else{let D=w.value.trim();/^-?\d+(\.\d+)?$/.test(D)?j+=` ${S}={${D}}`:D==="true"||D==="false"?j+=` ${S}={${D}}`:j+=` ${S}={${JSON.stringify(w.value)}}`}f=`\`\`\`${j}
1818
1818
  ${f}
1819
1819
  \`\`\``,f=f.split(`
1820
1820
  `).map(S=>s+S).join(`
@@ -1880,7 +1880,7 @@ Found ${d.length} preview deployment(s):
1880
1880
  ${u==="podman"?"Seed tests default to Podman. ":""}Install ${u}: ${u==="podman"?"https://podman.io/docs/installation":"https://docs.docker.com/get-docker/"}
1881
1881
  Error details: ${p||f||"No output"}`);if(_!==0)throw new Error(`Container exited with code ${_}.
1882
1882
  ${f}
1883
- ${p}`)}async function GEB(e,t){await Nb(void 0,t??"docker",["pull",e],{all:!0,doNotPipeOutput:!0})}var q$i=ce(require("path"),1),Wvn="/fern",pXc="output",_Xc="config.json",hXc="ir.json",HEB="snippet.json",xEB="snippet-templates.json",KEB="generators",JEB="sources",$EB=q$i.default.join(Wvn,pXc),YEB=q$i.default.join(Wvn,_Xc),XEB=q$i.default.join(Wvn,hXc),ZEB=q$i.default.join(Wvn,HEB),kEB=q$i.default.join(Wvn,xEB),OP7=q$i.default.join(Wvn,KEB),eSB=q$i.default.join(Wvn,JEB);var ZPu=$EB,LJa=YEB,kPu=XEB,eju=ZEB,tju=kEB;var K3h=eSB,rju="9229";var VJa=class{containerImage;keepContainer;runner;constructor({containerImage:t,keepContainer:r,runner:i,dockerImage:n,keepDocker:a}){this.containerImage=t??n??"",this.keepContainer=r??a??!1,this.runner=i}async execute({generatorName:t,irPath:r,configPath:i,outputPath:n,snippetPath:a,snippetTemplatePath:o,licenseFilePath:c,context:d,inspect:s,runner:u}){d.logger.info(`Executing generator ${t} using container image: ${this.containerImage}`);let f=[`${i}:${LJa}:ro`,`${r}:${kPu}:ro`,`${n}:${ZPu}`];a&&f.push(`${a}:${eju}`),o&&f.push(`${o}:${tju}`),c&&f.push(`${c}:/tmp/LICENSE:ro`);let p={},_={};s&&(p.NODE_OPTIONS=`--inspect-brk=0.0.0.0:${rju}`,_[rju]=rju),await dXc({logger:d.logger,imageName:this.containerImage,args:[LJa],binds:f,envVars:p,ports:_,removeAfterCompletion:!this.keepContainer,runner:this.runner??u})}};var J_E=ce(Wi(),1),axn=require("fs/promises"),zza=ce(require("path"),1),Rza=require("path"),$_E=ce(Z9(),1);var jHh=ce(_d(),1),cL=ce(AHh(),1),OY=ce(Bj(),1),wHh=ce(require("path"),1),STB="0.0.1";function FZc(e){if(e.raw?.github!=null&&typeof e.raw.github=="object"&&"license"in e.raw.github){let t=e.raw.github;if(t.license!=null){if(typeof t.license=="string")return{type:"basic",value:t.license};if(typeof t.license=="object"&&"custom"in t.license)return{type:"custom",value:t.license.custom}}}if(e.raw?.metadata?.license!=null){let t=e.raw.metadata.license;if(typeof t=="string")return{type:"basic",value:t};if(typeof t=="object"&&"custom"in t)return{type:"custom",value:t.custom}}}function MTB(e,t){let r=FZc(e);if(r!=null){if(r.type==="basic"){if(r.value==="MIT"||r.value==="Apache-2.0")return cL.FernGeneratorExec.LicenseConfig.basic({id:r.value==="MIT"?cL.FernGeneratorExec.LicenseId.Mit:cL.FernGeneratorExec.LicenseId.Apache2})}else if(r.type==="custom")return cL.FernGeneratorExec.LicenseConfig.custom({filename:wHh.basename(r.value)})}}function mHh(e){return e!=null?jHh.GithubPublishInfo._visit(e,{npm:t=>{let r=(t.token||"${NPM_TOKEN}").trim(),i=r==="<USE_OIDC>"||r==="OIDC";return cL.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,OY.EnvironmentVariable)(i?"<USE_OIDC>":r.startsWith("${")&&r.endsWith("}")?r.slice(2,-1).trim():"")})},maven:t=>cL.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:t.registryUrl,coordinate:t.coordinate,usernameEnvironmentVariable:(0,OY.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,OY.EnvironmentVariable)(t.credentials?.password??""),signature:t.signature!=null?{keyIdEnvironmentVariable:(0,OY.EnvironmentVariable)(t.signature.keyId??""),passwordEnvironmentVariable:(0,OY.EnvironmentVariable)(t.signature.password??""),secretKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.signature.secretKey??"")}:void 0}),pypi:t=>cL.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:t.registryUrl,packageName:t.packageName,usernameEnvironmentVariable:(0,OY.EnvironmentVariable)("PYPI_USERNAME"),passwordEnvironmentVariable:(0,OY.EnvironmentVariable)("PYPI_PASSWORD"),pypiMetadata:t.pypiMetadata}),rubygems:t=>cL.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.apiKey??"")}),postman:t=>cL.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.apiKey??""),workspaceIdEnvironmentVariable:(0,OY.EnvironmentVariable)(t.workspaceId??"")}),nuget:t=>cL.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.apiKey??"")}),crates:t=>cL.FernGeneratorExec.GithubPublishInfo.crates({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,OY.EnvironmentVariable)(t.token??"")}),_other:()=>{}}):void 0}function EHh({generatorInvocation:e,customConfig:t,workspaceName:r,organization:i,outputVersion:n=STB,absolutePathToSnippet:a,absolutePathToSnippetTemplates:o,absolutePathToFernConfig:c,writeUnitTests:d,generateOauthClients:s,generatePaginatedClients:u,whiteLabel:f,paths:p}){let _=MTB(e,c),{snippetPath:h,snippetTemplatePath:y,irPath:b,outputDirectory:v}=p,O=e.outputMode._visit({publish:A=>({...PHh(n,A,e,p),snippetFilepath:h,publishingMetadata:e.publishMetadata}),publishV2:A=>({...PHh(n,A,e,p),snippetFilepath:h,publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:cL.FernGeneratorExec.OutputMode.downloadFiles(),path:v,snippetFilepath:h,publishingMetadata:e.publishMetadata}),github:A=>{let g={mode:cL.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${A.owner}/${A.repo}`,version:n,publishInfo:mHh(A.publishInfo),installationToken:void 0}),path:v,publishingMetadata:e.publishMetadata};return a!==void 0&&(g.snippetFilepath=h),o!==void 0&&(g.snippetTemplateFilepath=y),g},githubV2:A=>{let g=A._visit({commitAndRelease:j=>`https://github.com/${j.owner}/${j.repo}`,push:j=>`https://github.com/${j.owner}/${j.repo}`,pullRequest:j=>`https://github.com/${j.owner}/${j.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),m={mode:cL.FernGeneratorExec.OutputMode.github({repoUrl:g,version:n,publishInfo:mHh(A.publishInfo)}),path:v,publishingMetadata:e.publishMetadata};return a!==void 0&&(m.snippetFilepath=h),o!==void 0&&(m.snippetTemplateFilepath=y),m},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{irFilepath:b,output:O,publish:void 0,customConfig:t,workspaceName:r,organization:i,environment:cL.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:f??!1,writeUnitTests:d,generateOauthClients:s,generatePaginatedClients:u,license:_}}function PHh(e,t,r,i){let{outputDirectory:n}=i,a;"registryOverrides"in t?a=t.registryOverrides.maven??t.registryOverrides.npm:a!=null&&(a=t._visit({mavenOverride:c=>c,npmOverride:c=>c,pypiOverride:c=>c,rubyGemsOverride:c=>c,postman:c=>c,nugetOverride:c=>c,cratesOverride:c=>c,_other:()=>{}}));let o="";return r.raw?.github!=null&&(w3a(r.raw.github)?o=r.raw.github.uri:o=r.raw?.github.repository),{mode:cL.FernGeneratorExec.OutputMode.github({repoUrl:o,version:e}),path:n}}var C=Symbol(),k=Symbol();var SHh={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.246",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types,services:e.services,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,errors:e.errors.map(t=>({name:t.name,docs:t.docs,discriminantValue:{originalValue:t.discriminantValueV4.name.unsafeName.originalValue,camelCase:t.discriminantValueV4.name.unsafeName.camelCase,pascalCase:t.discriminantValueV4.name.unsafeName.pascalCase,snakeCase:t.discriminantValueV4.name.unsafeName.snakeCase,screamingSnakeCase:t.discriminantValueV4.name.unsafeName.screamingSnakeCase,wireValue:t.discriminantValueV4.wireValue},discriminantValueV2:t.discriminantValueV2,discriminantValueV3:t.discriminantValueV3,discriminantValueV4:t.discriminantValueV4,type:t.type,typeV2:t.typeV2,typeV3:t.typeV3,http:t.http,statusCode:t.statusCode}))})};var I={};Zt(I,{V1:()=>JcU,V10:()=>ilU,V11:()=>nlU,V12:()=>alU,V13:()=>olU,V14:()=>ulU,V15:()=>slU,V16:()=>clU,V17:()=>llU,V18:()=>flU,V19:()=>dlU,V2:()=>$cU,V20:()=>plU,V21:()=>_lU,V22:()=>hlU,V23:()=>J8P.FernIrV23,V24:()=>$8P.FernIrV24,V25:()=>Y8P.FernIrV25,V26:()=>X8P.FernIrV26,V27:()=>Z8P.FernIrV27,V28:()=>k8P.FernIrV28,V29:()=>eWP.FernIrV29,V3:()=>YcU,V30:()=>tWP.FernIrV30,V31:()=>rWP.FernIrV31,V32:()=>iWP.FernIrV32,V33:()=>nWP.FernIrV33,V34:()=>aWP.FernIrV34,V35:()=>oWP.FernIrV35,V36:()=>uWP.FernIrV36,V37:()=>sWP.FernIrV37,V38:()=>cWP.FernIrV38,V39:()=>lWP.FernIrV39,V4:()=>XcU,V40:()=>fWP.FernIrV40,V41:()=>dWP.FernIrV41,V42:()=>pWP.FernIrV42,V43:()=>_WP.FernIrV43,V44:()=>hWP.FernIrV44,V45:()=>yWP.FernIrV45,V46:()=>bWP.FernIrV46,V47:()=>vWP.FernIrV47,V48:()=>gWP.FernIrV48,V49:()=>OWP.FernIrV49,V5:()=>ZcU,V50:()=>AWP.FernIrV50,V51:()=>mWP.FernIrV51,V52:()=>PWP.FernIrV52,V53:()=>jWP.FernIrV53,V54:()=>wWP.FernIrV54,V55:()=>EWP.FernIrV55,V56:()=>SWP.FernIrV56,V57:()=>MWP.FernIrV57,V58:()=>DWP.FernIrV58,V59:()=>BWP.FernIrV59,V6:()=>kcU,V60:()=>IWP.FernIrV60,V61:()=>CWP.FernIrV61,V62:()=>qWP.FernIrV62,V63:()=>gr,V7:()=>elU,V8:()=>tlU,V9:()=>rlU});var JcU=ce(mYh(),1),$cU=ce(bty(),1),YcU=ce(usy(),1),XcU=ce(ahy(),1),ZcU=ce(GOy(),1),kcU=ce(Zwy(),1),elU=ce(oCy(),1),tlU=ce(_Ny(),1),rlU=ce(UVy(),1),ilU=ce(uGy(),1),nlU=ce(I$y(),1),alU=ce(Mtb(),1),olU=ce(wsb(),1),ulU=ce(mhb(),1),slU=ce(gmb(),1),clU=ce(IMb(),1),llU=ce(WTb(),1),flU=ce(tLb(),1),dlU=ce(y9b(),1),plU=ce(x$b(),1),_lU=ce(wrv(),1),hlU=ce(nlv(),1),J8P=ce(P_v(),1),$8P=ce(ogv(),1),Y8P=ce(KPv(),1),X8P=ce(FSv(),1),Z8P=ce(qCv(),1),k8P=ce(Dzv(),1),eWP=ce(w4v(),1),tWP=ce(SWv(),1),rWP=ce(DHv(),1),iWP=ce(U$v(),1),nWP=ce(XPl(),1),aWP=ce(cog(),1),oWP=ce(ndg(),1),uWP=ce(kbg(),1),sWP=ce(YPg(),1),cWP=ce(YMg(),1),lWP=ce(pTg(),1),fWP=ce(BUg(),1),dWP=ce($Wg(),1),pWP=ce(vxg(),1),_WP=ce(WZg(),1),hWP=ce(hnO(),1),yWP=ce(rfO(),1),bWP=ce($bO(),1),vWP=ce(xjO(),1),gWP=ce(WBO(),1),OWP=ce(WzO(),1),AWP=ce(ZVO(),1),mWP=ce(bHO(),1),PWP=ce(LXO(),1),jWP=ce(hsA(),1),wWP=ce(XgA(),1),EWP=ce(QBA(),1),SWP=ce(M4A(),1),MWP=ce(bem(),1),DWP=ce(EAm(),1),BWP=ce($Um(),1),IWP=ce(CtP(),1),CWP=ce(UjP(),1),qWP=ce(K8P(),1);function TWP({inlinedRequest:e,allTypes:t}){let r=new Set,i=t.reduce((n,a)=>({...n,[Qmf(a.name)]:a}),{});for(let n of e.extends)RWP({typeName:n,typeNameToDeclaration:i,referencedTypes:r});for(let n of e.properties)nva({reference:n.valueType,typeNameToDeclaration:i,referencedTypes:r});return[...r].reduce((n,a)=>{let o=i[a];if(o==null)throw new Error("Cannot find declaration for ID: "+a);return[...n,o.name]},[])}function nva({reference:e,typeNameToDeclaration:t,referencedTypes:r}){I.V2.types.TypeReference._visit(e,{primitive:Bt,container:i=>{ylU({container:i,typeNameToDeclaration:t,referencedTypes:r})},named:i=>{RWP({typeName:i,typeNameToDeclaration:t,referencedTypes:r})},unknown:Bt,void:Bt,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function ylU({container:e,typeNameToDeclaration:t,referencedTypes:r}){I.V2.types.ContainerType._visit(e,{list:i=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r})},set:i=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r})},optional:i=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:i,valueType:n})=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r}),nva({reference:n,typeNameToDeclaration:t,referencedTypes:r})},literal:Bt,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function RWP({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let i=Qmf(e);r.add(i);let n=t[i];if(n==null)throw new Error("Cannot locate type: "+i);for(let a of n.referencedTypes)r.add(Qmf(a))}function Qmf(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var zWP={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.249",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:"0.0.134-3-g97d4964",[P.JAVA_SDK]:"0.0.134-3-g97d4964",[P.JAVA_SPRING]:"0.0.134-3-g97d4964",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=[...e.types];return{apiName:e.apiName,auth:e.auth,headers:e.headers,types:t,errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{websocket:e.services.websocket,http:e.services.http.map(r=>({availability:r.availability,docs:r.docs,name:r.name,basePath:r.basePath,basePathV2:r.basePathV2,headers:r.headers,pathParameters:r.pathParameters,endpoints:r.endpoints.map(i=>blU(r,i,e.types,n=>{t.push(n)}))}))}}}};function blU(e,t,r,i){return{docs:t.docs,availability:t.availability,id:t.id,name:t.name,nameV2:t.nameV2,method:t.method,headers:t.headers,path:t.path,pathParameters:t.pathParameters,queryParameters:t.queryParameters,request:vlU(t,e,r,i),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function vlU(e,t,r,i){let n=e.requestBody;return n==null?{docs:void 0,type:I.V2.types.TypeReference.void(),typeV2:void 0}:I.V3.services.http.HttpRequestBody._visit(n,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let o={fernFilepath:t.name.fernFilepath,fernFilepathV2:t.name.fernFilepathV2,name:a.name.unsafeName.originalValue,nameV2:{originalValue:a.name.unsafeName.originalValue,camelCase:a.name.unsafeName.camelCase,pascalCase:a.name.unsafeName.pascalCase,snakeCase:a.name.unsafeName.snakeCase,screamingSnakeCase:a.name.unsafeName.screamingSnakeCase},nameV3:a.name},c=I.V2.types.Type.object({extends:a.extends,properties:a.properties.map(s=>({availability:e.availability,docs:s.docs,name:{originalValue:s.name.name.unsafeName.originalValue,camelCase:s.name.name.unsafeName.camelCase,pascalCase:s.name.name.unsafeName.pascalCase,snakeCase:s.name.name.unsafeName.snakeCase,screamingSnakeCase:s.name.name.unsafeName.screamingSnakeCase,wireValue:s.name.wireValue},nameV2:s.name,valueType:s.valueType}))});i({docs:void 0,availability:e.availability,name:o,shape:c,referencedTypes:TWP({inlinedRequest:a,allTypes:r}),examples:[]});let d=I.V2.types.TypeReference.named(o);return{docs:void 0,type:d,typeV2:d}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+n.type)}})}var QWP={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:"0.0.11-4-g1c29f6c",[P.POSTMAN]:"0.0.32-rc0",[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types.map(t=>({docs:t.docs,availability:t.availability,name:t.name,shape:t.shape,examples:t.examples.map(r=>UWP(r.shape)),referencedTypes:t.referencedTypes})),errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{...e.services,http:e.services.http.map(t=>({...t,endpoints:t.endpoints.map(r=>({...r,examples:r.examples.map(i=>PlU(i))}))}))}})};function UWP(e){return I.V4.types.ExampleTypeShape._visit(e,{object:t=>I.V3.types.ExampleType.object(glU(t)),union:t=>I.V3.types.ExampleType.union(AlU(t)),alias:t=>I.V3.types.ExampleType.alias(mlU(t)),enum:I.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function glU(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:Sx(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function Sx(e){return I.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:I.V3.types.ExampleTypeReference.primitive,container:t=>I.V3.types.ExampleTypeReference.container(OlU(t)),named:t=>I.V3.types.ExampleTypeReference.named(LWP(t)),unknown:I.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function OlU(e){return I.V4.types.ExampleContainer._visit(e,{list:t=>I.V3.types.ExampleContainer.list(t.map(Sx)),set:t=>I.V3.types.ExampleContainer.set(t.map(Sx)),optional:t=>I.V3.types.ExampleContainer.optional(t!=null?Sx(t):void 0),map:t=>I.V3.types.ExampleContainer.map(t.map(r=>({key:Sx(r.key),value:Sx(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function LWP(e){return{typeName:e.typeName,shape:UWP(e.shape)}}function AlU(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:I.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>I.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(LWP(t)),singleProperty:t=>I.V3.types.ExampleSingleUnionTypeProperties.singleProperty(Sx(t)),noProperties:()=>I.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function mlU(e){return{value:Sx(e.value)}}function PlU(e){return{servicePathParameters:e.servicePathParameters.map(t=>NWP(t)),endpointPathParameters:e.servicePathParameters.map(t=>NWP(t)),serviceHeaders:e.serviceHeaders.map(t=>FWP(t)),endpointHeaders:e.endpointHeaders.map(t=>FWP(t)),queryParameters:e.queryParameters.map(t=>jlU(t)),request:e.request!=null?wlU(e.request):void 0,response:SlU(e.response)}}function NWP(e){return{key:e.key,value:Sx(e.value)}}function FWP(e){return{key:e.wireKey,value:Sx(e.value)}}function jlU(e){return{key:e.wireKey,value:Sx(e.value)}}function wlU(e){return I.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>I.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>ElU(r))}),reference:t=>I.V3.services.http.ExampleRequestBody.reference(Sx(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function ElU(e){return{wireKey:e.wireKey,value:Sx(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function SlU(e){return I.V4.services.http.ExampleResponse._visit(e,{ok:t=>I.V3.services.http.ExampleResponse.ok({body:t.body!=null?Sx(t.body):void 0}),error:t=>I.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?Sx(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function Q5t(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function jAe(e){return{...Q5t(e.name),wireValue:e.wireValue}}function FR(e){return{safeName:{originalValue:e.originalName,camelCase:e.camelCase.safeName,pascalCase:e.pascalCase.safeName,snakeCase:e.snakeCase.safeName,screamingSnakeCase:e.screamingSnakeCase.safeName},unsafeName:{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}}function QR(e){return{wireValue:e.wireValue,name:FR(e.name)}}function ava(e){return I.V5.types.ContainerType._visit(e,{list:t=>I.V4.types.ContainerType.list(ND(t)),set:t=>I.V4.types.ContainerType.set(ND(t)),map:({keyType:t,valueType:r})=>I.V4.types.ContainerType.map({keyType:ND(t),valueType:ND(r)}),optional:t=>I.V4.types.ContainerType.optional(ND(t)),literal:t=>I.V5.types.Literal._visit(t,{string:r=>I.V4.types.ContainerType.literal(I.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function nNn(e){return e.map(t=>Q5t(t))}function aNn(e){return e.map(t=>FR(t))}function DQ(e){return{fernFilepath:nNn(e.fernFilepath),fernFilepathV2:aNn(e.fernFilepath),name:e.name.originalName,nameV2:Q5t(e.name),nameV3:FR(e.name)}}function ND(e){return I.V5.types.TypeReference._visit(e,{named:t=>I.V4.types.TypeReference.named(DQ(t)),container:t=>I.V4.types.TypeReference.container(ava(t)),primitive:t=>I.V4.types.TypeReference.primitive(t),unknown:I.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function oNn(e){return{name:jAe(e.name),nameV2:QR(e.name),valueType:ND(e.valueType),availability:e.availability,docs:e.docs}}function VWP(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>MlU(t))}}function MlU(e){return I.V5.auth.AuthScheme._visit(e,{basic:I.V4.auth.AuthScheme.basic,bearer:I.V4.auth.AuthScheme.bearer,header:t=>I.V4.auth.AuthScheme.header(oNn(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function WWP(e){return{docs:e.docs,id:e.id,url:e.url,name:FR(e.name)}}function GWP({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let i=e.type!=null?I.V4.types.Type.alias({aliasOf:ND(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:Q5t(e.name.name),nameV3:FR(e.name.name),fernFilepath:nNn(e.name.fernFilepath),fernFilepathV2:aNn(e.name.fernFilepath)},discriminantValueV2:QR(e.discriminantValue),discriminantValueV3:I.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:I.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:n=>I.V4.errors.ErrorDeclarationDiscriminantValue.property(QR(n.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:QR(e.discriminantValue),type:i??I.V4.types.Type.alias({aliasOf:I.V4.types.TypeReference.void(),resolvedType:I.V4.types.ResolvedTypeReference.void()}),typeV2:i,typeV3:e.type!=null?ND(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function Mx(e){return{jsonExample:e.jsonExample,shape:HWP(e.shape)}}function HWP(e){return I.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:I.V4.types.ExampleTypeReferenceShape.primitive,container:t=>I.V4.types.ExampleTypeReferenceShape.container(BlU(t)),unknown:I.V4.types.ExampleTypeReferenceShape.unknown,named:t=>I.V4.types.ExampleTypeReferenceShape.named(DlU(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function DlU(e){return{typeName:DQ(e.typeName),shape:L8u(e.shape)}}function BlU(e){return I.V5.types.ExampleContainer._visit(e,{list:t=>I.V4.types.ExampleContainer.list(t.map(r=>Mx(r))),set:t=>I.V4.types.ExampleContainer.set(t.map(r=>Mx(r))),optional:t=>I.V4.types.ExampleContainer.optional(t!=null?Mx(t):void 0),map:t=>I.V4.types.ExampleContainer.map(t.map(r=>({key:Mx(r.key),value:Mx(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function L8u(e){return I.V5.types.ExampleTypeShape._visit(e,{alias:t=>I.V4.types.ExampleTypeShape.alias({value:Mx(t.value)}),object:t=>I.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:Mx(r.value),originalTypeDeclaration:DQ(r.originalTypeDeclaration)}))}),union:t=>I.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:I.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>I.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:DQ(r.typeName),shape:L8u(r.shape)}),singleProperty:r=>I.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:HWP(r.shape)}),noProperties:I.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>I.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function JWP({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:IlU(e.name),basePath:ClU(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>qlU({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>oNn(r)),pathParameters:e.pathParameters.map(r=>$WP(r))}}function IlU(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:nNn(e.fernFilepath),fernFilepathV2:aNn(e.fernFilepath)}}function ClU(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function qlU({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:Q5t(e.name),nameV2:FR(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>oNn(r)),path:e.path,pathParameters:e.pathParameters.map(r=>$WP(r)),queryParameters:e.queryParameters.map(r=>TlU(r)),requestBody:e.requestBody!=null?RlU(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?zlU(e.sdkRequest):void 0,response:NlU(e.response),errors:e.errors.map(r=>FlU(r)),errorsV2:QlU({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>VlU(r))}}function $WP(e){return{docs:e.docs,availability:e.availability,name:Q5t(e.name),nameV2:FR(e.name),valueType:ND(e.valueType)}}function TlU(e){return{docs:e.docs,availability:e.availability,name:jAe(e.name),nameV2:QR(e.name),valueType:ND(e.valueType),allowMultiple:e.allowMultiple}}function RlU(e){return I.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V4.services.http.HttpRequestBody.inlinedRequestBody({name:FR(t.name),extends:t.extends.map(r=>DQ(r)),properties:t.properties.map(r=>({docs:r.docs,name:QR(r.name),valueType:ND(r.valueType)}))}),reference:t=>I.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:ND(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function zlU(e){return{requestParameterName:FR(e.requestParameterName),shape:I.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>I.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:ND(t.requestBodyType)}),wrapper:t=>I.V4.services.http.SdkRequestShape.wrapper({wrapperName:FR(t.wrapperName),bodyKey:FR(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function NlU(e){let t=e.type!=null?ND(e.type):void 0;return{docs:e.docs,type:t??I.V4.types.TypeReference.void(),typeV2:t}}function FlU(e){return{docs:e.docs,error:Umf(e.error)}}function QlU({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>UlU({responseError:r,errorResolver:t}))}}function UlU({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:jAe(r.discriminantValue),shape:LlU({responseError:e,declaration:r})}}function LlU({responseError:e,declaration:t}){return t.type==null?I.V4.services.commons.ResponseErrorShape.noProperties():I.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:Umf(e.error)})}function Umf(e){return{name:e.name.originalName,nameV2:Q5t(e.name),nameV3:FR(e.name),fernFilepath:nNn(e.fernFilepath),fernFilepathV2:aNn(e.fernFilepath)}}function VlU(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>xWP(t)),endpointPathParameters:e.endpointPathParameters.map(t=>xWP(t)),serviceHeaders:e.serviceHeaders.map(t=>KWP(t)),endpointHeaders:e.endpointHeaders.map(t=>KWP(t)),queryParameters:e.queryParameters.map(t=>WlU(t)),request:e.request!=null?GlU(e.request):void 0,response:xlU(e.response)}}function xWP(e){return{key:e.key,value:Mx(e.value)}}function KWP(e){return{wireKey:e.wireKey,value:Mx(e.value)}}function WlU(e){return{wireKey:e.wireKey,value:Mx(e.value)}}function GlU(e){return I.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>I.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>HlU(r))}),reference:t=>I.V4.services.http.ExampleRequestBody.reference(Mx(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function HlU(e){return{wireKey:e.wireKey,value:Mx(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?DQ(e.originalTypeDeclaration):void 0}}function xlU(e){return I.V5.http.ExampleResponse._visit(e,{ok:t=>I.V4.services.http.ExampleResponse.ok({body:t.body!=null?Mx(t.body):void 0}),error:t=>I.V4.services.http.ExampleResponse.error({error:Umf(t.error),body:t.body!=null?Mx(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function YWP(e){return{docs:e.docs,availability:e.availability,name:DQ(e.name),shape:KlU(e.shape),examples:e.examples.map(t=>JlU(t)),referencedTypes:e.referencedTypes.map(t=>DQ(t))}}function KlU(e){return I.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>I.V4.types.Type.alias({aliasOf:ND(t),resolvedType:$lU(r)}),enum:t=>I.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:jAe(r.name),nameV2:QR(r.name),value:r.name.wireValue}))}),object:t=>I.V4.types.Type.object({extends:t.extends.map(r=>DQ(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:jAe(r.name),nameV2:QR(r.name),valueType:ND(r.valueType)}))}),union:t=>I.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:jAe(t.discriminant),discriminantV3:QR(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:jAe(r.discriminantValue),discriminantValueV2:QR(r.discriminantValue),valueType:I.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>I.V4.types.TypeReference.named(DQ(i)),singleProperty:i=>ND(i.type),noProperties:I.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:I.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>I.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(DQ(i)),singleProperty:i=>I.V4.types.SingleUnionTypeProperties.singleProperty({name:jAe(i.name),nameV2:QR(i.name),type:ND(i.type)}),noProperties:I.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function JlU(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:L8u(e.shape)}}function $lU(e){return I.V5.types.ResolvedTypeReference._visit(e,{named:t=>I.V4.types.ResolvedTypeReference.named({name:DQ(t.name),shape:YlU(t.shape)}),container:t=>I.V4.types.ResolvedTypeReference.container(ava(t)),primitive:I.V4.types.ResolvedTypeReference.primitive,unknown:I.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function YlU(e){return I.V5.types.ShapeType._visit(e,{enum:()=>I.V5.types.ShapeType.Enum,object:()=>I.V5.types.ShapeType.Object,union:()=>I.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var V8u=class{errors;constructor(t){this.errors=t.errors.reduce((r,i)=>({...r,[XWP(i.name)]:i}),{})}getDeclaration(t){let r=XWP(t),i=this.errors[r];if(i==null)throw new Error("Error does not exist: "+r);return i}};function XWP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}var W8u=class{types;constructor(t){this.types=t.types.reduce((r,i)=>({...r,[ZWP(i.name)]:i}),{})}resolveTypeReference(t){return I.V5.types.TypeReference._visit(t,{container:r=>I.V4.types.ResolvedTypeReference.container(ava(r)),named:r=>{let i=this.getTypeDeclaration(r);return i.shape._type==="alias"?this.resolveTypeReference(i.shape.aliasOf):I.V4.types.ResolvedTypeReference.named({name:DQ(r),shape:XlU(i.shape._type)})},primitive:I.V4.types.ResolvedTypeReference.primitive,unknown:I.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=ZWP(t),i=this.types[r];if(i==null)throw new Error("Type does not exist: "+i);return i}};function ZWP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function XlU(e){switch(e){case"object":return I.V4.types.ShapeType.Object;case"union":return I.V4.types.ShapeType.Union;case"enum":return I.V4.types.ShapeType.Enum;default:vt(e)}}var kWP={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[P.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new W8u(e),r=new V8u(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:VWP(e.auth),headers:e.headers.map(i=>oNn(i)),types:e.types.map(i=>YWP(i)),services:{http:e.services.map(i=>JWP({service:i,errorResolver:r})),websocket:[]},errors:e.errors.map(i=>GWP({errorDeclaration:i,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:jAe(e.constants.errorInstanceIdKey),errorDiscriminant:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR",wireValue:"error"},errorContentKey:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"}},errorsV2:{errorInstanceIdKey:QR(e.constants.errorInstanceIdKey),errorDiscriminant:{name:{unsafeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"},safeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"}},wireValue:"error"},errorContentKey:{name:{unsafeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"},safeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"}},wireValue:"content"}}},defaultEnvironment:e.defaultEnvironment,environments:e.environments.map(i=>WWP(i)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?FR(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:I.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:I.V4.ir.ErrorDiscriminationStrategy.statusCode,property:i=>I.V4.ir.ErrorDiscriminationStrategy.property({discriminant:QR(i.discriminant),contentProperty:QR(i.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var e5P={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[P.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[P.OPENAPI]:"0.0.16-1-ga2c0ada",[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?I.V6.environment.Environments._visit(e.environments.environments,{singleBaseUrl:i=>i.environments,multipleBaseUrls:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying multiple URLs for a single environment. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a multiple URls for a single environment."),_unknown:()=>{throw new Error("Unknown Environments: "+e.environments?.environments.type)}}):[]})};var t5P={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.268",[P.TYPESCRIPT_EXPRESS]:"0.0.268",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:e.services.map(t=>{let r=t.name.fernFilepath[t.name.fernFilepath.length-1],i=r!=null?`${r.pascalCase.safeName}Service`:"Service",n=r!=null?`${r.camelCase.unsafeName}Service`:"Service",a=r!=null?`${r.snakeCase.unsafeName}_service`:"service",o=a.toUpperCase(),c=M0(n);return{...t,name:{name:{originalName:i,camelCase:{safeName:n,unsafeName:n},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:o,unsafeName:o},pascalCase:{safeName:c,unsafeName:c}},fernFilepath:t.name.fernFilepath}}})})};var n5P={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[P.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[P.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[P.OPENAPI_PYTHON_CLIENT]:"0.0.0",[P.OPENAPI]:"0.0.20-1-gbbeb9bd",[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:ZlU(e.auth),headers:e.headers.map(t=>G8u(t)),types:e.types.map(t=>klU(t)),errors:e.errors.map(t=>ofU(t)),services:e.services.map(t=>ufU(t))})};function Lmf(e){return e.allParts}function ZlU(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:I.V7.auth.AuthScheme.header(G8u(t)))}}function G8u(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:s6(e.valueType)}}function s6(e){return I.V8.types.TypeReference._visit(e,{container:t=>I.V7.types.TypeReference.container(a5P(t)),named:t=>I.V7.types.TypeReference.named(U5t(t)),primitive:I.V7.types.TypeReference.primitive,unknown:I.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function a5P(e){return I.V8.types.ContainerType._visit(e,{list:t=>I.V7.types.ContainerType.list(s6(t)),optional:t=>I.V7.types.ContainerType.optional(s6(t)),set:t=>I.V7.types.ContainerType.set(s6(t)),map:({keyType:t,valueType:r})=>I.V7.types.ContainerType.map({keyType:s6(t),valueType:s6(r)}),literal:I.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function U5t(e){return{name:e.name,fernFilepath:Lmf(e.fernFilepath)}}function klU(e){return{docs:e.docs,availability:e.availability,name:U5t(e.name),shape:efU(e.shape),examples:e.examples.map(t=>nfU(t)),referencedTypes:e.referencedTypes.map(t=>U5t(t))}}function efU(e){return I.V8.types.Type._visit(e,{alias:t=>I.V7.types.Type.alias({aliasOf:s6(t.aliasOf),resolvedType:tfU(t.resolvedType)}),enum:I.V7.types.Type.enum,object:t=>I.V7.types.Type.object({extends:t.extends.map(r=>U5t(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:s6(r.valueType)}))}),union:t=>I.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>rfU(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function tfU(e){return I.V8.types.ResolvedTypeReference._visit(e,{container:t=>I.V7.types.ResolvedTypeReference.container(a5P(t)),named:t=>I.V7.types.ResolvedTypeReference.named({name:U5t(t.name),shape:t.shape}),primitive:I.V7.types.ResolvedTypeReference.primitive,unknown:I.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function rfU(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:ifU(e.shape)}}function ifU(e){return I.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(U5t(t)),singleProperty:t=>I.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:s6(t.type)}),noProperties:I.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function nfU(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:Vmf(e.shape)}}function Vmf(e){return I.V8.types.ExampleTypeShape._visit(e,{alias:t=>I.V7.types.ExampleTypeShape.alias({value:o2(t.value)}),enum:I.V7.types.ExampleTypeShape.enum,object:t=>I.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:o2(r.value),originalTypeDeclaration:U5t(r.originalTypeDeclaration)}))}),union:t=>I.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:afU(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function o2(e){return{jsonExample:e.jsonExample,shape:o5P(e.shape)}}function o5P(e){return I.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>I.V7.types.ExampleTypeReferenceShape.named({typeName:U5t(t.typeName),shape:Vmf(t.shape)}),container:t=>I.V7.types.ExampleTypeReferenceShape.container(I.V8.types.ExampleContainer._visit(t,{list:r=>I.V7.types.ExampleContainer.list(r.map(i=>o2(i))),set:r=>I.V7.types.ExampleContainer.set(r.map(i=>o2(i))),optional:r=>I.V7.types.ExampleContainer.optional(r!=null?o2(r):void 0),map:r=>I.V7.types.ExampleContainer.map(r.map(i=>({key:o2(i.key),value:o2(i.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:I.V7.types.ExampleTypeReferenceShape.primitive,unknown:I.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function afU(e){return I.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:U5t(t.typeName),shape:Vmf(t.shape)}),singleProperty:t=>I.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:o5P(t.shape)}),noProperties:I.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function ofU(e){return{docs:e.docs,name:Wmf(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?s6(e.type):void 0,statusCode:e.statusCode}}function Wmf(e){return{name:e.name,fernFilepath:Lmf(e.fernFilepath)}}function ufU(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:Lmf(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>u5P(t)),headers:e.headers.map(t=>G8u(t)),endpoints:e.endpoints.map(t=>sfU(t))}}function u5P(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:s6(e.valueType)}}function sfU(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>cfU(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>u5P(t)),sdkRequest:e.sdkRequest!=null?ffU(e.sdkRequest):void 0,requestBody:e.requestBody!=null?pfU(e.requestBody):void 0,response:_fU(e.response),headers:e.headers.map(t=>G8u(t)),queryParameters:e.queryParameters.map(t=>lfU(t)),examples:e.examples.map(t=>hfU(t))}}function cfU(e){return{docs:e.docs,error:Wmf(e.error)}}function lfU(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:s6(e.valueType),allowMultiple:e.allowMultiple}}function ffU(e){return{requestParameterName:e.requestParameterName,shape:dfU(e.shape)}}function dfU(e){return I.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:s6(t.requestBodyType)}),wrapper:I.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function pfU(e){return I.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>U5t(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:s6(r.valueType)}))}),reference:t=>I.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:s6(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function _fU(e){return{docs:e.docs,type:e.type!=null?s6(e.type):void 0}}function hfU(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>r5P(t)),endpointPathParameters:e.endpointPathParameters.map(t=>r5P(t)),queryParameters:e.queryParameters.map(t=>yfU(t)),serviceHeaders:e.serviceHeaders.map(t=>i5P(t)),endpointHeaders:e.endpointHeaders.map(t=>i5P(t)),request:e.request!=null?bfU(e.request):void 0,response:vfU(e.response)}}function r5P(e){return{key:e.key,value:o2(e.value)}}function yfU(e){return{wireKey:e.wireKey,value:o2(e.value)}}function i5P(e){return{wireKey:e.wireKey,value:o2(e.value)}}function bfU(e){return I.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>I.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:o2(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?U5t(r.originalTypeDeclaration):void 0}))}),reference:t=>I.V7.http.ExampleRequestBody.reference(o2(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function vfU(e){return I.V8.http.ExampleResponse._visit(e,{ok:t=>I.V7.http.ExampleResponse.ok({body:t.body!=null?o2(t.body):void 0}),error:t=>I.V7.http.ExampleResponse.error({error:Wmf(t.error),body:t.body!=null?o2(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var s5P={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[P.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[P.JAVA]:C,[P.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[P.JAVA_SDK]:"0.0.134-4-gef1ec4f",[P.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[P.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[P.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))n.shape._type==="union"&&n.shape.baseProperties.length>0&&t.failWithoutThrowing(r!=null?`Type ${n.name.name.originalName} uses base-properties. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a union with base-properties.");return t.getResult()===_w.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var c5P={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.STOPLIGHT]:k,[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=bn(e.services,r=>({docs:void 0,...r}));for(let r of Object.values(e.subpackages))if(r.docs!=null&&r.service!=null){let i=t[r.service];if(i==null)throw new Error("Service does not exist: "+r.service);i.docs=r.docs}return{...e,services:t}}};var l5P={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[P.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[P.JAVA]:C,[P.JAVA_MODEL]:"0.0.134-15-ge1ac358",[P.JAVA_SDK]:"0.0.134-15-ge1ac358",[P.JAVA_SPRING]:"0.0.134-15-ge1ac358",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.STOPLIGHT]:k,[P.OPENAPI]:C,[P.POSTMAN]:"0.0.40-1-g9aa2117",[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:gfU(e.auth,t)})};function gfU(e,t){return{...e,schemes:e.schemes.map(r=>OfU(r,t))}}function OfU(e,{taskContext:t,targetGenerator:r}){return I.V11.auth.AuthScheme._visit(e,{bearer:I.V10.auth.AuthScheme.bearer,basic:I.V10.auth.AuthScheme.basic,header:i=>i.prefix!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying an auth header prefix. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an auth header prefix."):I.V10.auth.AuthScheme.header({docs:i.docs,availability:{status:I.V10.commons.AvailabilityStatus.GeneralAvailability,message:void 0},name:{name:i.name,wireValue:i.header},valueType:i.valueType}),_unknown:()=>{throw new Error("Unknown auth scheme: "+e._type)}})}var d5P={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[P.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[P.JAVA]:C,[P.JAVA_MODEL]:"0.1.0-1-gdb5c636",[P.JAVA_SDK]:"0.1.0-1-gdb5c636",[P.JAVA_SPRING]:"0.1.0-1-gdb5c636",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.STOPLIGHT]:"0.0.23-8-g479c860",[P.OPENAPI]:"0.0.22-1-g1c86b58",[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let i=bn(e.types,n=>({...n,shape:I.V12.types.Type._visit(n.shape,{union:I.V11.types.Type.union,enum:I.V11.types.Type.enum,object:I.V11.types.Type.object,alias:a=>I.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:I.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:I.V11.types.ResolvedTypeReference.container,primitive:I.V11.types.ResolvedTypeReference.primitive,named:o=>o.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(f5P({taskContext:t,targetGenerator:r})):I.V11.types.ResolvedTypeReference.named({shape:o.shape,name:o.name}),unknown:I.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(f5P({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:i,services:bn(e.services,n=>AfU(n,{taskContext:t,targetGenerator:r}))}}};function f5P(e){return e.targetGenerator!=null?`Generator ${e.targetGenerator.name}@${e.targetGenerator.version} does not support undiscriminated unions If you'd like to use this feature, please upgrade ${e.targetGenerator.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an undiscriminated union."}function AfU(e,t){return{...e,endpoints:e.endpoints.map(r=>mfU(r,t))}}function mfU(e,{taskContext:t,targetGenerator:r}){return e.streamingResponse!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a streaming response."):{...e,requestBody:e.requestBody!=null?I.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:I.V11.http.HttpRequestBody.inlinedRequestBody,reference:I.V11.http.HttpRequestBody.reference,fileUpload:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support file upload requests. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a file upload request."),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.requestBody?.type)}}):void 0,response:e.response!=null?{docs:e.response.docs,type:e.response.responseBodyType}:{docs:void 0,type:void 0}}}var p5P={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:bn(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:I.V12.types.Type.undiscriminatedUnion({docs:void 0,members:t.shape.members})}),auth:{...e.auth,schemes:e.auth.schemes.map(t=>t._type!=="header"?t:{...t,name:t.name.name,header:t.name.wireValue})}})};var _5P={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V14.types.Type._visit(r.shape,{union:i=>I.V13.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:LC(n.valueType)})),types:i.types.map(n=>wfU(n))}),enum:I.V13.types.Type.enum,object:i=>I.V13.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:LC(n.valueType)}))}),alias:i=>I.V13.types.Type.alias({aliasOf:LC(i.aliasOf),resolvedType:SfU(i.resolvedType)}),undiscriminatedUnion:i=>I.V13.types.Type.undiscriminatedUnion(MfU(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:PfU(e.auth),headers:e.headers.map(r=>xmf(r)),types:t,services:bn(e.services,r=>DfU(r)),errors:bn(e.errors,r=>zfU(r))}}};function PfU(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:I.V13.auth.AuthScheme.header(jfU(t)))}}function jfU(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:LC(e.valueType)}}function xmf(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:LC(e.valueType)}}function LC(e){return I.V14.types.TypeReference._visit(e,{container:t=>I.V13.types.TypeReference.container(h5P(t)),primitive:t=>t==="DATE"?I.V13.types.TypeReference.primitive(I.V13.types.PrimitiveType.String):I.V13.types.TypeReference.primitive(t),named:I.V13.types.TypeReference.named,unknown:I.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function h5P(e){return I.V14.types.ContainerType._visit(e,{list:t=>I.V13.types.ContainerType.list(LC(t)),optional:t=>I.V13.types.ContainerType.optional(LC(t)),set:t=>I.V13.types.ContainerType.set(LC(t)),map:({keyType:t,valueType:r})=>I.V13.types.ContainerType.map({keyType:LC(t),valueType:LC(r)}),literal:I.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function wfU(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:EfU(e.shape)}}function EfU(e){return I.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:LC(t.type)}),noProperties:I.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function SfU(e){return I.V14.types.ResolvedTypeReference._visit(e,{container:t=>I.V13.types.ResolvedTypeReference.container(h5P(t)),named:I.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?I.V13.types.ResolvedTypeReference.primitive(I.V13.types.PrimitiveType.String):I.V13.types.ResolvedTypeReference.primitive(t),unknown:I.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function MfU(e){return{members:e.members.map(t=>({...t,type:LC(t.type)}))}}function DfU(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>y5P(t)),headers:e.headers.map(t=>xmf(t)),endpoints:e.endpoints.map(t=>BfU(t))}}function y5P(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:LC(e.valueType)}}function BfU(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>y5P(t)),sdkRequest:e.sdkRequest!=null?CfU(e.sdkRequest):void 0,requestBody:e.requestBody!=null?TfU(e.requestBody):void 0,response:e.response!=null?Gmf(e.response):void 0,headers:e.headers.map(t=>xmf(t)),queryParameters:e.queryParameters.map(t=>IfU(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?Hmf(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?RfU(e.sdkResponse):void 0}}function IfU(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:LC(e.valueType),allowMultiple:e.allowMultiple}}function CfU(e){return{requestParameterName:e.requestParameterName,shape:qfU(e.shape)}}function qfU(e){return I.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:LC(t.requestBodyType)}),wrapper:I.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function TfU(e){return I.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:LC(r.valueType)}))}),reference:t=>I.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:LC(t.requestBodyType)}),fileUpload:t=>I.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:LC(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Gmf(e){return{docs:e.docs,responseBodyType:LC(e.responseBodyType)}}function Hmf(e){return{dataEventType:LC(e.dataEventType),terminator:e.terminator}}function RfU(e){return I.V14.http.SdkResponse._visit(e,{streaming:t=>I.V13.http.SdkResponse.streaming(Hmf(t)),nonStreaming:t=>I.V13.http.SdkResponse.nonStreaming(Gmf(t)),maybeStreaming:t=>I.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:Gmf(t.nonStreaming),streaming:Hmf(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function zfU(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?LC(e.type):void 0,statusCode:e.statusCode}}var b5P={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[P.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.0.52-3-gd9df38df",[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V15.types.Type._visit(r.shape,{union:i=>I.V14.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:VC(n.valueType)})),types:i.types.map(n=>QfU(n))}),enum:I.V14.types.Type.enum,object:i=>I.V14.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:VC(n.valueType)}))}),alias:i=>I.V14.types.Type.alias({aliasOf:VC(i.aliasOf),resolvedType:LfU(i.resolvedType)}),undiscriminatedUnion:i=>I.V14.types.Type.undiscriminatedUnion(VfU(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:NfU(e.auth),headers:e.headers.map(r=>$mf(r)),types:t,services:bn(e.services,r=>WfU(r)),errors:bn(e.errors,r=>YfU(r))}}};function NfU(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:I.V14.auth.AuthScheme.header(FfU(t)))}}function FfU(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:VC(e.valueType)}}function $mf(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:VC(e.valueType)}}function VC(e){return I.V15.types.TypeReference._visit(e,{container:t=>I.V14.types.TypeReference.container(v5P(t)),primitive:t=>t==="BASE_64"?I.V14.types.TypeReference.primitive(I.V14.types.PrimitiveType.String):I.V14.types.TypeReference.primitive(t),named:I.V14.types.TypeReference.named,unknown:I.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function v5P(e){return I.V15.types.ContainerType._visit(e,{list:t=>I.V14.types.ContainerType.list(VC(t)),optional:t=>I.V14.types.ContainerType.optional(VC(t)),set:t=>I.V14.types.ContainerType.set(VC(t)),map:({keyType:t,valueType:r})=>I.V14.types.ContainerType.map({keyType:VC(t),valueType:VC(r)}),literal:I.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function QfU(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:UfU(e.shape)}}function UfU(e){return I.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:VC(t.type)}),noProperties:I.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function LfU(e){return I.V15.types.ResolvedTypeReference._visit(e,{container:t=>I.V14.types.ResolvedTypeReference.container(v5P(t)),named:I.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?I.V14.types.ResolvedTypeReference.primitive(I.V14.types.PrimitiveType.String):I.V14.types.ResolvedTypeReference.primitive(t),unknown:I.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function VfU(e){return{members:e.members.map(t=>({...t,type:VC(t.type)}))}}function WfU(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>g5P(t)),headers:e.headers.map(t=>$mf(t)),endpoints:e.endpoints.map(t=>GfU(t))}}function g5P(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:VC(e.valueType)}}function GfU(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>g5P(t)),sdkRequest:e.sdkRequest!=null?xfU(e.sdkRequest):void 0,requestBody:e.requestBody!=null?JfU(e.requestBody):void 0,response:e.response!=null?Kmf(e.response):void 0,headers:e.headers.map(t=>$mf(t)),queryParameters:e.queryParameters.map(t=>HfU(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?Jmf(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?$fU(e.sdkResponse):void 0}}function HfU(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:VC(e.valueType),allowMultiple:e.allowMultiple}}function xfU(e){return{requestParameterName:e.requestParameterName,shape:KfU(e.shape)}}function KfU(e){return I.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:VC(t.requestBodyType)}),wrapper:I.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function JfU(e){return I.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:VC(r.valueType)}))}),reference:t=>I.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:VC(t.requestBodyType)}),fileUpload:t=>I.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:VC(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Kmf(e){return{docs:e.docs,responseBodyType:VC(e.responseBodyType)}}function Jmf(e){return{dataEventType:VC(e.dataEventType),terminator:e.terminator}}function $fU(e){return I.V15.http.SdkResponse._visit(e,{streaming:t=>I.V14.http.SdkResponse.streaming(Jmf(t)),nonStreaming:t=>I.V14.http.SdkResponse.nonStreaming(Kmf(t)),maybeStreaming:t=>I.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:Kmf(t.nonStreaming),streaming:Jmf(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function YfU(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?VC(e.type):void 0,statusCode:e.statusCode}}var O5P={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[P.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[P.JAVA]:C,[P.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[P.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[P.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>e.basePath!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying a base-path in api.yml. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a root base-path."):{...e,services:bn(e.services,i=>({...i,pathParameters:Ymf(i.pathParameters),endpoints:i.endpoints.map(n=>({...n,allPathParameters:Ymf(n.allPathParameters),pathParameters:Ymf(n.pathParameters)}))}))}};function Ymf(e){return e.map(t=>XfU(t))}function XfU(e){return{...e,availability:{status:I.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var A5P={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))if(n.shape._type==="union"&&n.shape.extends.length>0)return t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support union types with extensions. See ${i} in file ${n.name.fernFilepath.allParts.join("/")}. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains union types with extensions.");return{...e}}};var m5P={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[P.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[P.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.3.0-3-ge125e311",[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:bn(e.services,i=>{let n=i.endpoints[0]?.baseUrl;return i.endpoints.some(a=>a.baseUrl!==n)?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support endpoint-level server URLs. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains endpoint-level server URLs."):{...i,baseUrl:n}})})};var j5P={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[P.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[P.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:"0.0.44-1-gbf4b0f3",[P.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:bn(e.services,r=>ZfU(r,t)),types:bn(e.types,r=>ndU(r,t))})};function ZfU(e,t){return{...e,endpoints:e.endpoints.map(r=>kfU(r,t))}}function kfU(e,t){return{...e,examples:e.examples.map(r=>edU(r,t))}}function edU(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>Xmf(r,t)),servicePathParameters:e.servicePathParameters.map(r=>Xmf(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>Xmf(r,t)),serviceHeaders:e.serviceHeaders.map(r=>P5P(r,t)),endpointHeaders:e.endpointHeaders.map(r=>P5P(r,t)),queryParameters:e.queryParameters.map(r=>tdU(r,t)),request:e.request!=null?rdU(e.request,t):void 0,response:idU(e.response,t)}}function Xmf(e,t){return{key:e.key,value:u2(e.value,t)}}function P5P(e,t){return{wireKey:e.wireKey,value:u2(e.value,t)}}function tdU(e,t){return{wireKey:e.wireKey,value:u2(e.value,t)}}function rdU(e,t){return I.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>I.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(i=>({wireKey:i.wireKey,value:u2(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),reference:r=>I.V18.http.ExampleRequestBody.reference(u2(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function idU(e,t){return I.V19.http.ExampleResponse._visit(e,{ok:r=>I.V18.http.ExampleResponse.ok({body:r.body!=null?u2(r.body,t):void 0}),error:r=>I.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?u2(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function ndU(e,t){return{...e,examples:e.examples.map(r=>adU(r,t))}}function adU(e,t){return{...e,shape:Zmf(e.shape,t)}}function Zmf(e,t){return I.V19.types.ExampleTypeShape._visit(e,{alias:r=>I.V18.types.ExampleTypeShape.alias({value:u2(r.value,t)}),object:r=>I.V18.types.ExampleTypeShape.object({properties:r.properties.map(i=>({wireKey:i.wireKey,value:u2(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),union:r=>I.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:I.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:i=>I.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:i.jsonExample,shape:w5P(i.shape,t)}),samePropertiesAsObject:i=>I.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:i.typeName,shape:Zmf(i.shape,t)}),noProperties:I.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:I.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function u2(e,t){return{jsonExample:e.jsonExample,shape:w5P(e.shape,t)}}function w5P(e,t){return I.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>I.V18.types.ExampleTypeReferenceShape.primitive(odU(r,t)),named:r=>I.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:Zmf(r.shape,t)}),container:r=>I.V18.types.ExampleTypeReferenceShape.container(I.V19.types.ExampleContainer._visit(r,{list:i=>I.V18.types.ExampleContainer.list(i.map(n=>u2(n,t))),set:i=>I.V18.types.ExampleContainer.set(i.map(n=>u2(n,t))),optional:i=>I.V18.types.ExampleContainer.optional(i!=null?u2(i,t):void 0),map:i=>I.V18.types.ExampleContainer.map(i.map(n=>({key:u2(n.key,t),value:u2(n.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:I.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function odU(e,{taskContext:t,targetGenerator:r}){return e.type==="date"?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support examples for dates. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains date examples."):e}var E5P={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[P.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.26-rc0-3-gdfabd674",[P.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[P.JAVA]:C,[P.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[P.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[P.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[P.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[P.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[P.GO_FIBER]:k,[P.GO_MODEL]:"0.0.0",[P.GO_SDK]:"0.0.0",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:bn(e.services,r=>udU(r,t))})};function udU(e,t){return{...e,endpoints:e.endpoints.map(r=>sdU(r,t))}}function sdU(e,t){return{...e,response:e.response!=null?S5P(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?cdU(e.sdkResponse,t):void 0}}function S5P(e,t){return I.V20.http.HttpResponse._visit(e,{fileDownload:()=>M5P(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function cdU(e,t){return I.V20.http.SdkResponse._visit(e,{fileDownload:()=>M5P(t),streaming:I.V19.http.SdkResponse.streaming,maybeStreaming:r=>I.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:S5P(r.nonStreaming,t)}),json:I.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function M5P({targetGenerator:e,taskContext:t}){return t.failAndThrow(e!=null?`Generator ${e.name}@${e.version} does not support file download. If you'd like to use this feature, please upgrade ${e.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains file download.")}var D5P={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:k,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:bn(e.services,r=>ldU(r,t))})};function ldU(e,t){return{...e,endpoints:e.endpoints.map(r=>fdU(r,t))}}function fdU(e,t){return{...e,streamingResponse:e.streamingResponse!=null?kmf(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?ddU(e.sdkResponse,t):void 0}}function kmf(e,{taskContext:t,targetGenerator:r}){return{dataEventType:I.V21.http.StreamingResponseChunkType._visit(e.dataEventType,{json:i=>i,text:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming text responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains streaming text responses."),_unknown:()=>{throw new Error("Unknown StreamingResponseChunkType: "+e.dataEventType.type)}}),terminator:e.terminator}}function ddU(e,t){return I.V21.http.SdkResponse._visit(e,{fileDownload:I.V20.http.SdkResponse.fileDownload,streaming:r=>I.V20.http.SdkResponse.streaming(kmf(r,t)),maybeStreaming:r=>I.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:kmf(r.streaming,t),nonStreaming:r.nonStreaming}),json:I.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var B5P={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.5.0-3-gac7ce7c",[P.GO_MODEL]:"0.0.14-8-g2fa39f7",[P.GO_SDK]:"0.0.14-8-g2fa39f7",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:bn(e.services,t=>pdU(t))})};function pdU(e){return{...e,endpoints:e.endpoints.map(t=>_dU(t))}}function _dU(e){return{...e,...e.response!=null?I.V22.http.HttpResponse._visit(e.response,{json:t=>({response:I.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:I.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:I.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:I.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:I.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var q5P={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[P.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.7.4-rc3-4-g6cf92f81",[P.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:"0.0.28-3-g112d3dd",[P.STOPLIGHT]:"0.0.28-3-g112d3dd",[P.POSTMAN]:"0.0.44-4-gddab2ae",[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],i={};for(let[n,a]of Object.entries(e.services)){let o=[];for(let c of a.endpoints){let d=hdU(c);d==null?r.push(c):o.push(d)}i[n]={...a,endpoints:o,headers:a.headers.map(c=>tPf(c)),pathParameters:a.pathParameters.map(c=>H8u(c))}}return r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(n=>n.name.originalName).join(", ")} will be skipped.`)),{...e,auth:{...e.auth,schemes:e.auth.schemes.map(n=>bdU(n))},headers:e.headers.map(n=>tPf(n)),types:bn(e.types,n=>vdU(n)),services:i,errors:bn(e.errors,n=>jdU(n)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(n=>H8u(n)),variables:e.variables.map(n=>wdU(n))}}};function hdU(e){let t;if(!(e.requestBody!=null&&(t=ydU(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>tPf(r)),pathParameters:e.pathParameters.map(r=>H8u(r)),allPathParameters:e.allPathParameters.map(r=>H8u(r)),queryParameters:e.queryParameters.map(r=>EdU(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:SdU(e.sdkRequest.shape)}:void 0,response:e.response!=null?MdU(e.response):void 0,examples:e.examples.map(r=>DdU(r))}}function ydU(e){switch(e.type){case"bytes":return;case"fileUpload":return I.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>IdU(t))});case"inlinedRequestBody":return I.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>CdU(t))});case"reference":return I.V22.http.HttpRequestBody.reference({...e,requestBodyType:WC(e.requestBodyType)});default:vt(e)}}function tPf(e){return{...e,valueType:WC(e.valueType)}}function bdU(e){return e._visit({bearer:I.V22.auth.AuthScheme.bearer,basic:I.V22.auth.AuthScheme.basic,header:t=>I.V22.auth.AuthScheme.header({...t,valueType:WC(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function vdU(e){return{...e,shape:gdU(e.shape),examples:e.examples.map(t=>OdU(t))}}function gdU(e){return e._visit({alias:t=>I.V22.types.Type.alias({...t,aliasOf:WC(t.aliasOf),resolvedType:mdU(t.resolvedType)}),enum:I.V22.types.Type.enum,object:t=>I.V22.types.Type.object({...t,properties:t.properties.map(r=>I5P(r))}),union:t=>I.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>I5P(r)),types:t.types.map(r=>({...r,shape:PdU(r.shape)}))}),undiscriminatedUnion:t=>I.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:WC(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function OdU(e){return{...e,shape:rPf(e.shape)}}function rPf(e){return e._visit({alias:t=>I.V22.types.ExampleTypeShape.alias({...t,value:wAe(t.value)}),enum:I.V22.types.ExampleTypeShape.enum,object:t=>I.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:wAe(r.value)}))}),union:t=>I.V22.types.ExampleTypeShape.union({...t,properties:AdU(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function wAe(e){return{...e,shape:iPf(e.shape)}}function iPf(e){return e._visit({primitive:t=>I.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:I.V22.types.ExamplePrimitive.integer,double:I.V22.types.ExamplePrimitive.double,string:I.V22.types.ExamplePrimitive.string,boolean:I.V22.types.ExamplePrimitive.boolean,long:I.V22.types.ExamplePrimitive.long,datetime:r=>I.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:I.V22.types.ExamplePrimitive.date,uuid:I.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>I.V22.types.ExampleTypeReferenceShape.named({...t,shape:rPf(t.shape)}),container:t=>I.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>I.V22.types.ExampleContainer.list(r.map(i=>wAe(i))),set:r=>I.V22.types.ExampleContainer.set(r.map(i=>wAe(i))),optional:r=>I.V22.types.ExampleContainer.optional(r!=null?wAe(r):void 0),map:r=>I.V22.types.ExampleContainer.map(r.map(i=>({key:wAe(i.key),value:wAe(i.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:I.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function AdU(e){return e._visit({singleProperty:t=>I.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:iPf(t.shape)}),noProperties:I.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>I.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:rPf(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function WC(e){return e._visit({container:t=>I.V22.types.TypeReference.container(T5P(t)),primitive:I.V22.types.TypeReference.primitive,named:I.V22.types.TypeReference.named,unknown:I.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function T5P(e){return e._visit({list:t=>I.V22.types.ContainerType.list(WC(t)),set:t=>I.V22.types.ContainerType.set(WC(t)),optional:t=>I.V22.types.ContainerType.optional(WC(t)),map:t=>I.V22.types.ContainerType.map({keyType:WC(t.keyType),valueType:WC(t.valueType)}),literal:I.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function mdU(e){return e._visit({container:t=>I.V22.types.ResolvedTypeReference.container(T5P(t)),primitive:I.V22.types.ResolvedTypeReference.primitive,named:I.V22.types.ResolvedTypeReference.named,unknown:I.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function I5P(e){return{...e,valueType:WC(e.valueType)}}function PdU(e){return e._visit({noProperties:I.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>I.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:WC(t.type)}),samePropertiesAsObject:I.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function jdU(e){return{...e,type:e.type!=null?WC(e.type):void 0}}function wdU(e){return{...e,type:WC(e.type)}}function H8u(e){return{...e,valueType:WC(e.valueType)}}function EdU(e){return{...e,valueType:WC(e.valueType)}}function SdU(e){return e._visit({justRequestBody:t=>I.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:WC(t.requestBodyType)}),wrapper:I.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function MdU(e){return e._visit({json:t=>I.V22.http.HttpResponse.json({...t,responseBodyType:WC(t.responseBodyType)}),fileDownload:I.V22.http.HttpResponse.fileDownload,streaming:t=>I.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>I.V22.http.StreamingResponseChunkType.json(WC(r)),text:I.V22.http.StreamingResponseChunkType.text,_other:()=>{throw new Error("Unknown streaming data event type: "+t.dataEventType.type)}})}),_other:()=>{throw new Error("Unknown response: "+e.type)}})}function DdU(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>ePf(t)),servicePathParameters:e.servicePathParameters.map(t=>ePf(t)),endpointPathParameters:e.endpointPathParameters.map(t=>ePf(t)),serviceHeaders:e.serviceHeaders.map(t=>C5P(t)),endpointHeaders:e.endpointHeaders.map(t=>C5P(t)),queryParameters:e.queryParameters.map(t=>BdU(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>I.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:wAe(r.value)}))}),reference:t=>I.V22.http.ExampleRequestBody.reference({...t,shape:iPf(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>I.V22.http.ExampleResponse.ok({...t,body:t.body!=null?wAe(t.body):void 0}),error:t=>I.V22.http.ExampleResponse.error({...t,body:t.body!=null?wAe(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function ePf(e){return{...e,value:wAe(e.value)}}function BdU(e){return{...e,value:wAe(e.value)}}function C5P(e){return{...e,value:wAe(e.value)}}function IdU(e){return e._visit({file:I.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>I.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:WC(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function CdU(e){return{...e,valueType:WC(e.valueType)}}var Wn={};Zt(Wn,{V23:()=>_v5,V24:()=>hv5,V25:()=>yv5,V26:()=>bv5,V27:()=>vv5,V28:()=>gv5,V29:()=>Ov5,V30:()=>Av5,V31:()=>mv5,V32:()=>Pv5,V33:()=>jv5,V34:()=>wv5,V35:()=>Ev5,V36:()=>Sv5,V37:()=>Mv5,V38:()=>Dv5,V39:()=>Bv5,V40:()=>Iv5,V41:()=>Cv5,V42:()=>qv5,V43:()=>Tv5,V44:()=>Rv5,V45:()=>zv5,V46:()=>Nv5,V47:()=>Fv5,V48:()=>Qv5,V49:()=>Uv5,V50:()=>Lv5,V51:()=>Vv5,V52:()=>Wv5,V53:()=>Gv5,V54:()=>Hv5,V55:()=>xv5,V56:()=>Kv5,V57:()=>Jv5,V58:()=>$v5,V59:()=>Yv5,V60:()=>Xv5,V61:()=>Zv5,V62:()=>kv5,V63:()=>Vn});var _v5=ce(qt(),1),hv5=ce(St(),1),yv5=ce(Et(),1),bv5=ce(wt(),1),vv5=ce(Ot(),1),gv5=ce(At(),1),Ov5=ce(mt(),1),Av5=ce(_t(),1),mv5=ce(pt(),1),Pv5=ce(ot(),1),jv5=ce(et(),1),wv5=ce(Ze(),1),Ev5=ce(Je(),1),Sv5=ce($e(),1),Mv5=ce(Ke(),1),Dv5=ce(He(),1),Bv5=ce(Le(),1),Iv5=ce(Ve(),1),Cv5=ce(Qe(),1),qv5=ce(ze(),1),Tv5=ce(Te(),1),Rv5=ce(Ie(),1),zv5=ce(Se(),1),Nv5=ce(je(),1),Fv5=ce(Pe(),1),Qv5=ce(Ae(),1),Uv5=ce(be(),1),Lv5=ce(ye(),1),Vv5=ce(he(),1),Wv5=ce(_e(),1),Gv5=ce($(),1),Hv5=ce(Es(),1),xv5=ce(ls(),1),Kv5=ce(fs(),1),Jv5=ce(Gu(),1),$v5=ce(Hu(),1),Yv5=ce(xu(),1),Xv5=ce(Du(),1),Zv5=ce(xo(),1),kv5=ce(Ko(),1);var $dE={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var YdE={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"0.4.9-1-ge0997b3",[P.JAVA_SDK]:"0.4.9-1-ge0997b3",[P.JAVA_SPRING]:"0.4.9-1-ge0997b3",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],i=[],n={};for(let[a,o]of Object.entries(e.services)){let c=[];for(let d of o.endpoints){let s;if(d.sdkRequest!=null&&(s=eg5(d.sdkRequest),s==null)){r.push(d);continue}if(d.response!=null){let u=d.response._visit({fileDownload:f=>I.V24.HttpResponse.fileDownload(f),json:f=>I.V24.HttpResponse.json(f),streaming:f=>I.V24.HttpResponse.streaming(f),text:()=>(i.push(d),I.V24.HttpResponse.json({docs:void 0,responseBodyType:I.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});c.push({...d,sdkRequest:s,response:u})}else c.push({...d,sdkRequest:s,response:void 0})}n[a]={...o,endpoints:c}}return i.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support text/plain responses. `),i.length===1&&i[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${i[0].name.originalName} response type will be casted to unknown.`):t.taskContext.logger.warn(`Therefore, endpoints ${i.map(a=>a.name.originalName).join(", ")} response types will be casted to unknown.`)),r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(a=>a.name.originalName).join(", ")} will be skipped.`)),{...e,services:n}}};function eg5(e){let t=e.shape;if(t.type==="wrapper")return{shape:I.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:I.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var ZdE={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[P.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,ag5(r)])),headers:e.headers.map(t=>rKs(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(i=>tg5(i))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,rg5(r)]))})};function tg5(e){return{...e,headers:e.headers.map(t=>rKs(t)),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function rg5(e){return{...e,endpoints:e.endpoints.map(t=>ig5(t)),headers:e.headers.map(t=>rKs(t)),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function ig5(e){return{...e,headers:e.headers.map(t=>rKs(t)),queryParameters:e.queryParameters.map(t=>ng5(t)),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function rKs(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function ng5(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function ag5(e){return{...e,shape:e.shape._visit({union:t=>I.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>XdE(r))}),object:t=>I.V25.Type.object({...t,properties:t.properties.map(r=>XdE(r))}),enum:t=>I.V25.Type.enum({...t,values:t.values.map(r=>og5(r))}),alias:t=>I.V25.Type.alias(t),undiscriminatedUnion:t=>I.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function XdE(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function og5(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var kdE={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.6.1-3-g94ee67a",[P.GO_MODEL]:"0.6.1-3-g94ee67a",[P.GO_SDK]:"0.6.1-3-g94ee67a",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,ug5(r)]))})};function ug5(e){return{...e,endpoints:e.endpoints.map(t=>sg5(t))}}function sg5(e){return{...e,response:e.response!=null?cg5(e.response):void 0}}function cg5(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?I.V26.HttpResponse.json(t):I.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var epE={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[P.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.8.1-1-g0f40bf18",[P.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.9.0-2-g6b0be0e",[P.GO_MODEL]:"0.9.0-2-g6b0be0e",[P.GO_SDK]:"0.9.0-2-g6b0be0e",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:Fg5(e.auth),headers:nKs(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Wg5(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,gg5(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,pg5(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,dg5(r)])),pathParameters:iKs(e.pathParameters),variables:lg5(e.variables)})};function lg5(e){return e.map(t=>fg5(t))}function fg5(e){return{...e,type:uI(e.type)}}function dg5(e){return{...e,type:e.type!=null?uI(e.type):void 0}}function pg5(e){return e.map(t=>_g5(t))}function _g5(e){return{...e,headers:nKs(e.headers),payload:hg5(e.payload)}}function hg5(e){switch(e.type){case"inlinedPayload":return I.V27.WebhookPayload.inlinedPayload(yg5(e));case"reference":return I.V27.WebhookPayload.reference({...e,payloadType:uI(e.payloadType)})}}function yg5(e){return{...e,properties:bg5(e.properties)}}function bg5(e){return e.map(t=>vg5(t))}function vg5(e){return{...e,valueType:uI(e.valueType)}}function gg5(e){return{...e,endpoints:Og5(e.endpoints),headers:nKs(e.headers),pathParameters:iKs(e.pathParameters)}}function Og5(e){return e.map(t=>Ag5(t))}function Ag5(e){return{...e,headers:nKs(e.headers),pathParameters:iKs(e.pathParameters),allPathParameters:iKs(e.allPathParameters),queryParameters:zg5(e.queryParameters),requestBody:e.requestBody!=null?Dg5(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?Eg5(e.sdkRequest):void 0,response:e.response!=null?mg5(e.response):void 0}}function mg5(e){switch(e.type){case"json":return I.V27.HttpResponse.json(wg5(e.value));case"fileDownload":return I.V27.HttpResponse.fileDownload(e);case"text":return I.V27.HttpResponse.text(e);case"streaming":return I.V27.HttpResponse.streaming(Pg5(e));default:vt(e)}}function Pg5(e){return{...e,dataEventType:jg5(e.dataEventType)}}function jg5(e){switch(e.type){case"json":return I.V27.StreamingResponseChunkType.json(uI(e.json));case"text":return I.V27.StreamingResponseChunkType.text();default:vt(e)}}function wg5(e){switch(e.type){case"response":return I.V27.JsonResponse.response({...e,responseBodyType:uI(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:uI(e.responseBodyType),responseProperty:e.responseProperty!=null?npE(e.responseProperty):void 0});default:vt(e)}}function Eg5(e){return{...e,shape:Sg5(e.shape)}}function Sg5(e){switch(e.type){case"justRequestBody":return I.V27.SdkRequestShape.justRequestBody(Mg5(e.value));case"wrapper":return I.V27.SdkRequestShape.wrapper(e);default:vt(e)}}function Mg5(e){switch(e.type){case"typeReference":return I.V27.SdkRequestBodyType.typeReference(tpE(e));case"bytes":return I.V27.SdkRequestBodyType.bytes(e);default:vt(e)}}function Dg5(e){switch(e.type){case"inlinedRequestBody":return I.V27.HttpRequestBody.inlinedRequestBody(qg5(e));case"reference":return I.V27.HttpRequestBody.reference(tpE(e));case"fileUpload":return I.V27.HttpRequestBody.fileUpload(Bg5(e));case"bytes":return I.V27.HttpRequestBody.bytes(e);default:vt(e)}}function Bg5(e){return{...e,properties:Ig5(e.properties)}}function Ig5(e){return e.map(t=>Cg5(t))}function Cg5(e){switch(e.type){case"file":return I.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return I.V27.FileUploadRequestProperty.bodyProperty(rpE(e));default:vt(e)}}function tpE(e){return{...e,requestBodyType:uI(e.requestBodyType)}}function qg5(e){return{...e,properties:Tg5(e.properties)}}function Tg5(e){return e.map(t=>rpE(t))}function rpE(e){return{...e,valueType:uI(e.valueType)}}function iKs(e){return e.map(t=>Rg5(t))}function Rg5(e){return{...e,valueType:uI(e.valueType)}}function zg5(e){return e.map(t=>Ng5(t))}function Ng5(e){return{...e,valueType:uI(e.valueType)}}function Fg5(e){return{...e,schemes:Qg5(e.schemes)}}function Qg5(e){return e.map(t=>Ug5(t))}function Ug5(e){switch(e.type){case"basic":return I.V27.AuthScheme.basic(e);case"bearer":return I.V27.AuthScheme.bearer(e);case"header":return Lg5(e);default:vt(e)}}function Lg5(e){return I.V27.AuthScheme.header({...e,valueType:uI(e.valueType)})}function nKs(e){return e.map(t=>Vg5(t))}function Vg5(e){return{...e,valueType:uI(e.valueType)}}function Wg5(e){return{...e,shape:Gg5(e.shape)}}function Gg5(e){switch(e.type){case"alias":return I.V27.Type.alias(Hg5(e));case"enum":return I.V27.Type.enum(e);case"object":return I.V27.Type.object(xg5(e));case"union":return I.V27.Type.union(Kg5(e));case"undiscriminatedUnion":return I.V27.Type.undiscriminatedUnion(Jg5(e));default:vt(e)}}function Hg5(e){return{aliasOf:uI(e.aliasOf),resolvedType:Zg5(e.resolvedType)}}function xg5(e){return{...e,properties:ipE(e.properties)}}function Kg5(e){return{...e,types:$g5(e.types),baseProperties:ipE(e.baseProperties)}}function Jg5(e){return{members:Xg5(e.members)}}function ipE(e){return e.map(t=>npE(t))}function npE(e){return{...e,valueType:uI(e.valueType)}}function $g5(e){return e.map(t=>({...t,shape:Yg5(t.shape)}))}function Yg5(e){switch(e.propertiesType){case"samePropertiesAsObject":return I.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return I.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:uI(e.type)});case"noProperties":return I.V27.SingleUnionTypeProperties.noProperties();default:vt(e)}}function Xg5(e){return e.map(t=>({...t,type:uI(t.type)}))}function Zg5(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?I.V27.ResolvedTypeReference.primitive(I.V27.PrimitiveType.Boolean):I.V27.ResolvedTypeReference.container(I.V27.ContainerType.literal(I.V27.Literal.string(e.container.literal.string))):I.V27.ResolvedTypeReference.container(apE(e.container));case"named":return I.V27.ResolvedTypeReference.named(e);case"primitive":return I.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return I.V27.ResolvedTypeReference.unknown();default:vt(e)}}function uI(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?I.V27.TypeReference.primitive(I.V27.PrimitiveType.Boolean):I.V27.TypeReference.container(I.V27.ContainerType.literal(I.V27.Literal.string(e.container.literal.string))):I.V27.TypeReference.container(apE(e.container));case"named":return I.V27.TypeReference.named(e);case"primitive":return I.V27.TypeReference.primitive(e.primitive);case"unknown":return I.V27.TypeReference.unknown();default:vt(e)}}function apE(e){switch(e.type){case"list":return I.V27.ContainerType.list(uI(e.list));case"map":return I.V27.ContainerType.map({keyType:uI(e.keyType),valueType:uI(e.valueType)});case"optional":return I.V27.ContainerType.optional(uI(e.optional));case"set":return I.V27.ContainerType.set(uI(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return I.V27.ContainerType.literal(I.V27.Literal.string(e.literal.string));default:vt(e)}}var upE={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[P.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.8.6-1-g3d8d8591",[P.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[P.JAVA]:C,[P.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[P.JAVA_SDK]:"0.5.14-1-ge4bcd98",[P.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,kg5({typeId:t,allTypes:e.types})]))})};function kg5({typeId:e,allTypes:t}){let r=opE({typeId:e,allTypes:t});return{availability:r.availability,docs:r.docs,name:r.name,shape:r.shape,examples:r.examples,referencedTypes:Array.from(r.referencedTypes).map(i=>{let n=opE({typeId:i,allTypes:t});return{typeId:i,fernFilepath:n.name.fernFilepath,name:n.name.name}})}}function opE({typeId:e,allTypes:t}){let r=t[e];if(r==null)throw new Error(`Type definition for type id ${e} is undefined`);return r}var spE={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[P.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new iop(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},iop=class{ir;constructor(t){this.ir=t}convertTypes(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertType(i)]))}convertServices(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertService(i)]))}convertService(t){return{...t,endpoints:this.convertEndpoints(t.endpoints)}}convertEndpoints(t){return t.map(r=>({...r,examples:this.convertExampleEndpointCalls(r.examples)}))}convertExampleEndpointCalls(t){return t.map(r=>({...r,rootPathParameters:this.convertExamplePathParameters(r.rootPathParameters),servicePathParameters:this.convertExamplePathParameters(r.servicePathParameters),endpointPathParameters:this.convertExamplePathParameters(r.endpointPathParameters),serviceHeaders:this.convertExampleHeaders(r.serviceHeaders),endpointHeaders:this.convertExampleHeaders(r.endpointHeaders),queryParameters:this.convertExampleQueryParameters(r.queryParameters),request:r.request!=null?this.convertExampleRequestBody(r.request):void 0,response:this.convertExampleResponse(r.response)}))}convertExamplePathParameters(t){return t.map(r=>({key:r.name.originalName,value:this.convertExampleTypeReference(r.value)}))}convertExampleHeaders(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleQueryParameters(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleRequestBody(t){switch(t.type){case"inlinedRequestBody":return I.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return I.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:vt(t)}}convertExampleResponse(t){switch(t.type){case"ok":return I.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return I.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:vt(t)}}convertType(t){return{...t,examples:this.convertExampleTypes(t.examples)}}convertExampleTypes(t){return t.map(r=>this.convertExampleType(r))}convertExampleType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeReferences(t){return t.map(r=>this.convertExampleTypeReference(r))}convertExampleTypeReference(t){return{...t,shape:this.convertExampleTypeReferenceShape(t.shape)}}convertExampleTypeReferenceShape(t){switch(t.type){case"primitive":return I.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return I.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return I.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return I.V29.ExampleTypeReferenceShape.unknown(t);default:vt(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return I.V29.ExamplePrimitive.integer(t.integer);case"double":return I.V29.ExamplePrimitive.double(t.double);case"string":return I.V29.ExamplePrimitive.string(t.string.original);case"boolean":return I.V29.ExamplePrimitive.boolean(t.boolean);case"long":return I.V29.ExamplePrimitive.long(t.long);case"datetime":return I.V29.ExamplePrimitive.datetime(t.datetime);case"date":return I.V29.ExamplePrimitive.date(t.date);case"uuid":return I.V29.ExamplePrimitive.uuid(t.uuid);default:vt(t)}}convertExampleContainer(t){switch(t.type){case"list":return I.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return I.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return I.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return I.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:vt(t)}}convertKeyValuePairs(t){return t.map(r=>({key:this.convertExampleTypeReference(r.key),value:this.convertExampleTypeReference(r.value)}))}convertExampleNamedType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeShape(t){switch(t.type){case"alias":return I.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return I.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return I.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return I.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:vt(t)}}convertExampleObjectType(t){return{properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}}convertExampleUnionType(t){return{wireDiscriminantValue:t.singleUnionType.wireDiscriminantValue.wireValue,properties:this.convertExampleSingleUnionTypeProperties(t.singleUnionType.shape)}}convertExampleSingleUnionTypeProperties(t){switch(t.type){case"samePropertiesAsObject":{let r=this.ir.types[t.typeId]?.name;if(r==null)throw new Error(`Internal error; type ID ${t.typeId} does not exist in the IR`);return I.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(I.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return I.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return I.V29.ExampleSingleUnionTypeProperties.noProperties();default:vt(t)}}};var cpE={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.8.8",[P.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.8.8",[P.TYPESCRIPT_EXPRESS]:"0.8.8",[P.JAVA]:C,[P.JAVA_MODEL]:"0.7.0-rc0",[P.JAVA_SDK]:"0.7.0-rc0",[P.JAVA_SPRING]:"0.7.0-rc0",[P.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[P.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.7.5-1-gb54fb677",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V30.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({apiName:e.apiName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:e.auth,headers:e.headers,types:e.types,webhookGroups:e.webhookGroups,errors:e.errors,subpackages:e.subpackages,rootPackage:e.rootPackage,constants:e.constants,environments:e.environments,basePath:e.basePath,pathParameters:e.pathParameters,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,variables:e.variables,serviceTypeReferenceInfo:e.serviceTypeReferenceInfo,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{availability:r.availability,name:r.name,displayName:r.displayName,basePath:r.basePath,endpoints:r.endpoints.map(i=>({id:i.id,docs:i.docs,availability:i.availability,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,examples:i.examples})),headers:r.headers,pathParameters:r.pathParameters}]))})};var fpE={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.9.4-2-g139cf36",[P.GO_MODEL]:"0.9.4-2-g139cf36",[P.GO_SDK]:"0.9.4-2-g139cf36",[P.RUBY_MODEL]:"0.0.0",[P.RUBY_SDK]:"0.0.0",[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:aO5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(eO5)}]))})};function exn({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function eO5(e){return{...e,examples:exn({examples:e.examples,convert:tO5})}}function tO5(e){let t;if(e.request!=null&&(t=rO5(e.request),t==null))return;let r=iO5(e.response);if(r!=null)return{...e,rootPathParameters:exn({examples:e.rootPathParameters,convert:nop}),endpointPathParameters:exn({examples:e.endpointPathParameters,convert:nop}),servicePathParameters:exn({examples:e.servicePathParameters,convert:nop}),endpointHeaders:exn({examples:e.endpointHeaders,convert:lpE}),serviceHeaders:exn({examples:e.serviceHeaders,convert:lpE}),queryParameters:exn({examples:e.queryParameters,convert:nO5}),request:t,response:r}}function rO5(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let i=ebe(r.value);i!=null&&t.push({...r,value:i})}return I.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=aop(e.shape);return t==null?void 0:I.V31.ExampleRequestBody.reference({...e,shape:t})}default:vt(e)}}function iO5(e){switch(e.type){case"ok":{if(e.body==null)return I.V31.ExampleResponse.ok({body:void 0});let t=ebe(e.body);return t==null?void 0:I.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return I.V31.ExampleResponse.error({...e,body:void 0});let t=ebe(e.body);return t==null?void 0:I.V31.ExampleResponse.error({...e,body:t})}}}function nop(e){let t=ebe(e.value);if(t!=null)return{...e,value:t}}function lpE(e){let t=ebe(e.value);if(t!=null)return{...e,value:t}}function nO5(e){let t=ebe(e.value);if(t!=null)return{...e,value:t}}function aO5(e){let t=[];for(let r of e){let i=oO5(r);i!=null&&t.push(i)}return t}function oO5(e){let t=dpE(e.shape);if(t!=null)return{...e,shape:t}}function dpE(e){switch(e.type){case"enum":return I.V31.ExampleTypeShape.enum(e);case"alias":{let t=ebe(e.value);return t==null?void 0:I.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let i=ebe(r.value);i!=null&&t.push({...r,value:i})}return I.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=uO5(e.singleUnionType);return t==null?void 0:I.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:vt(e)}}function ebe(e){let t=aop(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function uO5(e){let t=sO5(e.shape);if(t!=null)return{...e,shape:t}}function sO5(e){switch(e.type){case"noProperties":return I.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=aop(e.shape);return t==null?void 0:I.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let i=ebe(r.value);i!=null&&t.push({...r,value:i})}return I.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:vt(e)}}function aop(e){switch(e.type){case"container":{let t=cO5(e.container);return t==null?void 0:I.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=dpE(e.shape);return t==null?void 0:I.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return I.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return I.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:vt(e)}}function cO5(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let i=ebe(r);i!=null&&t.push(i)}return I.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let i=ebe(r);i!=null&&t.push(i)}return I.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let i=ebe(r.key),n=ebe(r.value);i!=null&&n!=null&&t.push({key:i,value:n})}return I.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return I.V31.ExampleContainer.optional();let t=ebe(e.optional);return t==null?I.V31.ExampleContainer.optional():I.V31.ExampleContainer.optional(t)}default:vt(e)}}var ppE={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.12.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.12.0",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.13.0-3-g8c56a41",[P.GO_MODEL]:"0.13.0-3-g8c56a41",[P.GO_SDK]:"0.13.0-3-g8c56a41",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:"0.0.0",[P.CSHARP_SDK]:"0.0.0",[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new oop(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>t.convertEndpoint(n))}]))}}},oop=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:I.V33.TypeReference.container(I.V33.ContainerType.optional(I.V33.TypeReference.primitive("STRING")))}:r),examples:lO5({examples:t.examples,convert:fO5})}}isTypeReferenceObject(t){switch(t.type){case"container":return this.isContainerObject(t.container);case"named":return this.isNamedTypeObject(t);case"primitive":return!1;case"unknown":return!0;default:vt(t)}}isContainerObject(t){switch(t.type){case"map":case"list":case"set":return!0;case"optional":return this.isTypeReferenceObject(t.optional);case"literal":return!1;default:vt(t)}}isNamedTypeObject(t){let r=this.ir.types[t.typeId];if(r==null)return!0;switch(r.shape.type){case"alias":return this.isTypeReferenceObject(r.shape.aliasOf);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:vt(r.shape)}}};function lO5({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function fO5(e){return{...e,queryParameters:e.queryParameters.filter(t=>!uop(t.value))}}function uop(e){switch(e.shape.type){case"container":return dO5(e.shape.container);case"named":return pO5(e.shape);case"primitive":return!1;case"unknown":return!0;default:vt(e.shape)}}function dO5(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&uop(e.optional);default:vt(e)}}function pO5(e){switch(e.shape.type){case"alias":return uop(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:vt(e.shape)}}var Dza=ce(XPl(),1);var _pE={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.10.4",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V33.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,requestBody:n.requestBody?._visit({inlinedRequestBody:a=>Dza.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>Dza.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>Dza.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(o=>(o.type==="file"&&o.value.type==="fileArray"&&t.taskContext.logger.warn(`${n.method} ${n.fullPath.head} accepts a list of files however the ${t.targetGenerator?.name}@${t.targetGenerator?.version} only supports accepting a single file. File an [issue](https://github.com/fern-api/fern/issues) to add request for file arrays in ${t.targetGenerator?.name}@${t.targetGenerator?.version}!`),o.type==="file"?Dza.FernIrV33.FileUploadRequestProperty.file({...o.value}):o))}),bytes:a=>Dza.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var hpE={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.18.0",[P.GO_MODEL]:"0.18.0",[P.GO_SDK]:"0.18.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V34.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({docs:i.docs,availability:i.availability,id:i.id,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,idempotent:i.idempotent,examples:i.examples}))}]))})};var ypE={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.11.6",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var bpE={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.13.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.13.0",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.12.0",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V36.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.filter(a=>a.exampleType==="userProvided")}))}]))})};var vpE={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[P.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.15.0-rc0",[P.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.9.0-rc0",[P.PYTHON_PYDANTIC]:"0.9.0-rc0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"1.2.0-rc0",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V37.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?._visit({fileDownload:a=>I.V37.HttpResponse.fileDownload(a),json:a=>I.V37.HttpResponse.json(a),streaming:a=>a._visit({json:o=>I.V37.HttpResponse.streaming({dataEventType:I.V37.StreamingResponseChunkType.json(o.payload),docs:o.docs,terminator:o.terminator}),sse:()=>{},text:o=>I.V37.HttpResponse.streaming({dataEventType:I.V37.StreamingResponseChunkType.text(),docs:o.docs,terminator:void 0}),_other:()=>{}}),text:a=>I.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var gpE={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.9.0-rc1",[P.PYTHON_PYDANTIC]:"0.9.0-rc1",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"1.4.0-rc1",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:"0.7.0-rc0",[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>_O5(r))}})};function _O5(e){switch(e.type){case"basic":return I.V38.AuthScheme.basic(e);case"bearer":return I.V38.AuthScheme.bearer(e);case"header":return I.V38.AuthScheme.header(e);case"oauth":return I.V38.AuthScheme.bearer({docs:e.docs,token:{originalName:"token",camelCase:{unsafeName:"token",safeName:"token"},pascalCase:{unsafeName:"Token",safeName:"Token"},snakeCase:{unsafeName:"token",safeName:"token"},screamingSnakeCase:{unsafeName:"TOKEN",safeName:"TOKEN"}},tokenEnvVar:void 0});default:vt(e)}}var OpE={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.20.0",[P.GO_MODEL]:"0.20.0",[P.GO_SDK]:"0.20.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var ApE={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V40.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,errors:Object.fromEntries(Object.entries(e.errors).map(([r,i])=>[r,{name:i.name,discriminantValue:i.discriminantValue,type:i.type,statusCode:i.statusCode,docs:i.docs}]))})};var mpE={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"0.8.0-rc0",[P.JAVA_SDK]:"0.9.0-rc0",[P.JAVA_SPRING]:"0.8.0-rc0",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>hO5(r))}})};function hO5(e){switch(e.type){case"basic":return I.V41.AuthScheme.basic(e);case"bearer":return I.V41.AuthScheme.bearer(e);case"header":return I.V41.AuthScheme.header(e);case"oauth":return I.V41.AuthScheme.oauth(yO5(e));default:vt(e)}}function yO5(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:I.V41.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:{...e.configuration.tokenEndpoint,endpointReference:e.configuration.tokenEndpoint.endpointReference.endpointId},refreshEndpoint:e.configuration.refreshEndpoint!=null?{...e.configuration.refreshEndpoint,endpointReference:e.configuration.refreshEndpoint?.endpointReference.endpointId}:void 0})};default:vt(e.configuration.type)}}var PpE={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.17.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.17.0",[P.TYPESCRIPT_EXPRESS]:"0.13.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V42.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?.body}))}]))})};var wpE={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V43.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.map(a=>bO5({example:a})).filter(ds)}))}]))})};function bO5({example:e}){return e._visit({userProvided:t=>I.V43.HttpEndpointExample.userProvided(jpE({example:t})),generated:t=>I.V43.HttpEndpointExample.generated(jpE({example:t})),_other:()=>{}})}function jpE({example:e}){return{...e,response:vO5({example:e.response})}}function vO5({example:e}){switch(e.type){case"ok":return gO5({example:e.value});case"error":return I.V43.ExampleResponse.error(e);default:vt(e)}}function gO5({example:e}){switch(e.type){case"body":return I.V43.ExampleResponse.ok({body:e.value});case"sse":return I.V43.ExampleResponse.ok({body:void 0});case"stream":return I.V43.ExampleResponse.ok({body:void 0});default:vt(e)}}var EpE={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V45.types.Type._visit(r.shape,{union:i=>I.V44.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Kj(n.valueType)})),types:i.types.map(n=>IO5(n))}),enum:I.V44.types.Type.enum,object:i=>I.V44.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Kj(n.valueType)}))}),alias:i=>I.V44.types.Type.alias({aliasOf:Kj(i.aliasOf),resolvedType:qO5(i.resolvedType)}),undiscriminatedUnion:i=>I.V44.types.Type.undiscriminatedUnion(TO5(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:EO5(e.auth),headers:e.headers.map(r=>Bza(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>Bza(r)),types:t,services:bn(e.services,r=>RO5(r)),errors:bn(e.errors,r=>XO5(r)),webhookGroups:bn(e.webhookGroups,r=>PO5(r)),websocketChannels:bn(e.websocketChannels,r=>OO5(r)),pathParameters:e.pathParameters.map(r=>BDo(r)),variables:e.variables.map(r=>zO5(r))}}};function OO5(e){return{...e,headers:e.headers.map(t=>Bza(t)),queryParameters:e.queryParameters.map(t=>IDo(t)),pathParameters:e.pathParameters.map(t=>BDo(t)),messages:e.messages.map(t=>AO5(t))}}function AO5(e){return{...e,body:mO5(e.body)}}function mO5(e){switch(e.type){case"inlinedBody":return I.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Kj(t.valueType)}))});case"reference":return I.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:Kj(e.bodyType)})}}function PO5(e){return e.map(t=>jO5(t))}function jO5(e){return{...e,headers:e.headers.map(t=>Bza(t)),payload:wO5(e.payload)}}function wO5(e){switch(e.type){case"reference":return I.V44.webhooks.WebhookPayload.reference({...e,payloadType:Kj(e.payloadType)});case"inlinedPayload":return I.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Kj(t.valueType)}))})}}function EO5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V44.auth.AuthScheme.basic(t);case"bearer":return I.V44.auth.AuthScheme.bearer(t);case"header":return I.V44.auth.AuthScheme.header(SO5(t));case"oauth":return I.V44.auth.AuthScheme.oauth(MO5(t))}})}}function SO5(e){return{...e,valueType:Kj(e.valueType)}}function MO5(e){return{...e,configuration:I.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:DO5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?BO5(e.configuration.refreshEndpoint):void 0})}}function DO5(e){return{...e,requestProperties:{clientId:aKs(e.requestProperties.clientId),clientSecret:aKs(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?aKs(e.requestProperties.scopes):void 0},responseProperties:{accessToken:F6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?F6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?F6i(e.responseProperties.refreshToken):void 0}}}function BO5(e){return{...e,requestProperties:{refreshToken:aKs(e.requestProperties.refreshToken)},responseProperties:{accessToken:F6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?F6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?F6i(e.responseProperties.refreshToken):void 0}}}function Bza(e){return{...e,valueType:Kj(e.valueType)}}function Kj(e){return I.V45.types.TypeReference._visit(e,{container:t=>I.V44.types.TypeReference.container(SpE(t)),primitive:t=>t.v1==="BIG_INTEGER"?I.V44.types.TypeReference.primitive(I.V44.types.PrimitiveType.String):I.V44.types.TypeReference.primitive(t.v1),named:I.V44.types.TypeReference.named,unknown:I.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function SpE(e){return I.V45.types.ContainerType._visit(e,{list:t=>I.V44.types.ContainerType.list(Kj(t)),optional:t=>I.V44.types.ContainerType.optional(Kj(t)),set:t=>I.V44.types.ContainerType.set(Kj(t)),map:({keyType:t,valueType:r})=>I.V44.types.ContainerType.map({keyType:Kj(t),valueType:Kj(r)}),literal:I.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function IO5(e){return{...e,shape:CO5(e.shape)}}function CO5(e){return I.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:Kj(t.type)}),noProperties:I.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function qO5(e){return I.V45.types.ResolvedTypeReference._visit(e,{container:t=>I.V44.types.ResolvedTypeReference.container(SpE(t)),named:I.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?I.V44.types.ResolvedTypeReference.primitive(I.V44.types.PrimitiveType.String):I.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:I.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function TO5(e){return{members:e.members.map(t=>({...t,type:Kj(t.type)}))}}function RO5(e){return{...e,pathParameters:e.pathParameters.map(t=>BDo(t)),headers:e.headers.map(t=>Bza(t)),endpoints:e.endpoints.map(t=>NO5(t))}}function BDo(e){return{...e,valueType:Kj(e.valueType)}}function zO5(e){return{...e,type:Kj(e.type)}}function NO5(e){return{...e,pagination:e.pagination!=null?VO5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>BDo(t)),pathParameters:e.pathParameters.map(t=>BDo(t)),sdkRequest:e.sdkRequest!=null?xO5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?$O5(e.requestBody):void 0,response:e.response!=null?FO5(e.response):void 0,headers:e.headers.map(t=>Bza(t)),queryParameters:e.queryParameters.map(t=>IDo(t))}}function FO5(e){return{...e,body:e.body!=null?QO5(e.body):void 0}}function QO5(e){switch(e.type){case"json":return I.V44.http.HttpResponseBody.json(UO5(e.value));case"fileDownload":return I.V44.http.HttpResponseBody.fileDownload(e);case"text":return I.V44.http.HttpResponseBody.text(e);case"streaming":return I.V44.http.HttpResponseBody.streaming(LO5(e.value))}}function UO5(e){switch(e.type){case"response":return I.V44.http.JsonResponse.response({...e,responseBodyType:Kj(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Kj(e.responseBodyType),responseProperty:e.responseProperty!=null?sop(e.responseProperty):void 0})}}function LO5(e){switch(e.type){case"json":return I.V44.http.StreamingResponse.json({...e,payload:Kj(e.payload)});case"text":return I.V44.http.StreamingResponse.text(e);case"sse":return I.V44.http.StreamingResponse.sse({...e,payload:Kj(e.payload)})}}function VO5(e){switch(e.type){case"cursor":return I.V44.http.Pagination.cursor(WO5(e));case"offset":return I.V44.http.Pagination.offset(GO5(e))}}function WO5(e){return{...e,page:IDo(e.page),next:F6i(e.next),results:F6i(e.results)}}function GO5(e){return{...e,page:IDo(e.page),results:F6i(e.results)}}function aKs(e){return{...e,property:HO5(e.property)}}function HO5(e){switch(e.type){case"query":return I.V44.RequestPropertyValue.query(IDo(e));case"body":return I.V44.RequestPropertyValue.body(sop(e))}}function F6i(e){return{...e,property:sop(e.property)}}function sop(e){return{...e,valueType:Kj(e.valueType)}}function IDo(e){return{...e,valueType:Kj(e.valueType)}}function xO5(e){return{...e,shape:KO5(e.shape)}}function KO5(e){return I.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V44.http.SdkRequestShape.justRequestBody(JO5(t)),wrapper:I.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function JO5(e){switch(e.type){case"bytes":return I.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Kj(e.requestBodyType)})}}function $O5(e){return I.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Kj(r.valueType)}))}),reference:t=>I.V44.http.HttpRequestBody.reference({...t,requestBodyType:Kj(t.requestBodyType)}),fileUpload:t=>I.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Kj(r.valueType)});case"file":return I.V44.http.FileUploadRequestProperty.file(YO5(r.value))}})}),bytes:t=>I.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function YO5(e){switch(e.type){case"file":return I.V44.http.FileProperty.file(e);case"fileArray":return I.V44.http.FileProperty.fileArray(e)}}function XO5(e){return{...e,type:e.type!=null?Kj(e.type):void 0}}var DpE={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.21.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.21.0",[P.TYPESCRIPT_EXPRESS]:"0.16.0",[P.JAVA]:C,[P.JAVA_MODEL]:"0.9.0",[P.JAVA_SDK]:"0.10.0",[P.JAVA_SPRING]:"0.9.0",[P.PYTHON_FASTAPI]:"0.10.1",[P.PYTHON_PYDANTIC]:"0.9.1",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"2.9.9",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:ZO5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({...i,examples:kO5(i.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:eA5(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(i=>({...i,shape:bq(i.shape)}))}]))})};function bq(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.list(r.map(i=>bq(i)))),set:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.set(r.map(i=>bq(i)))),map:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.map(r.map(i=>({key:bq(i.key),value:bq(i.value)})))),optional:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.optional(r!=null?bq(r):void 0)),literal:r=>I.V45.ExampleTypeReferenceShape.primitive(r._visit({string:i=>I.V45.ExamplePrimitive.string(i),integer:i=>I.V45.ExamplePrimitive.integer(i),double:i=>I.V45.ExamplePrimitive.double(i),long:i=>I.V45.ExamplePrimitive.long(i),boolean:i=>I.V45.ExamplePrimitive.boolean(i),datetime:i=>I.V45.ExamplePrimitive.datetime(i),date:i=>I.V45.ExamplePrimitive.date(i),uuid:i=>I.V45.ExamplePrimitive.uuid(i),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}})}),named:t=>({...e,shape:I.V45.ExampleTypeReferenceShape.named({...t,shape:BpE(t.shape)})}),primitive:t=>({...e,shape:I.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>I.V45.ExamplePrimitive.string(r),integer:r=>I.V45.ExamplePrimitive.integer(r),double:r=>I.V45.ExamplePrimitive.double(r),long:r=>I.V45.ExamplePrimitive.long(r),boolean:r=>I.V45.ExamplePrimitive.boolean(r),datetime:r=>I.V45.ExamplePrimitive.datetime(r),date:r=>I.V45.ExamplePrimitive.date(r),uuid:r=>I.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:I.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function MpE(e){return{...e,properties:e.properties.map(t=>({...t,value:bq(t.value)}))}}function BpE(e){return e.type==="alias"?I.V45.ExampleTypeShape.alias({value:bq(e.value)}):e.type==="object"?I.V45.ExampleTypeShape.object(MpE(e)):e.type==="union"?I.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>I.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:MpE(t.object)}),singleProperty:t=>I.V45.ExampleSingleUnionTypeProperties.singleProperty(bq(t)),noProperties:()=>I.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?I.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:bq(e.singleUnionType)}):I.V45.ExampleTypeShape.enum(e)}function ZO5(e){return e.map(t=>({...t,shape:BpE(t.shape)}))}function oKs(e){return e.map(t=>({...t,value:bq(t.value)}))}function cop(e){return e.map(t=>({...t,value:bq(t.value)}))}function IpE(e){return e.map(t=>({...t,value:bq(t.value)}))}function kO5(e){return e.map(t=>{let r={...t,rootPathParameters:oKs(t.rootPathParameters),servicePathParameters:oKs(t.servicePathParameters),endpointPathParameters:oKs(t.endpointPathParameters),serviceHeaders:cop(t.serviceHeaders),endpointHeaders:cop(t.endpointHeaders),queryParameters:IpE(t.queryParameters),request:t.request?._visit({inlinedRequestBody:i=>I.V45.ExampleRequestBody.inlinedRequestBody({...i,properties:i.properties.map(n=>({...n,value:bq(n.value)}))}),reference:i=>I.V45.ExampleRequestBody.reference(bq(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}}),response:t.response._visit({ok:i=>I.V45.ExampleResponse.ok(i._visit({body:n=>I.V45.ExampleEndpointSuccessResponse.body(n!=null?bq(n):void 0),stream:n=>I.V45.ExampleEndpointSuccessResponse.stream(n.map(bq)),sse:n=>I.V45.ExampleEndpointSuccessResponse.sse(n.map(a=>({...a,data:bq(a.data)}))),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})),error:i=>I.V45.ExampleResponse.error({...i,body:i.body!=null?bq(i.body):void 0}),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})};return t._visit({userProvided:()=>I.V45.HttpEndpointExample.userProvided(r),generated:()=>I.V45.HttpEndpointExample.generated(r),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})})}function eA5(e){return e.map(t=>({...t,pathParameters:oKs(t.pathParameters),headers:cop(t.headers),queryParameters:IpE(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:i=>I.V45.ExampleWebSocketMessageBody.inlinedBody({...i,properties:i.properties.map(n=>({...n,value:bq(n.value)}))}),reference:i=>I.V45.ExampleWebSocketMessageBody.reference(bq(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})}))}))}var CpE={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V46.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>{let i=r.endpoints.map(n=>{let{autogeneratedExamples:a,userSpecifiedExamples:o,...c}=n;return{...c,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...n.userSpecifiedExamples.map(s=>{if(s.example!=null)return I.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(ds),...n.autogeneratedExamples.map(s=>I.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:i}]}))})};var qpE={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.29.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.29.0",[P.TYPESCRIPT_EXPRESS]:"0.17.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V47.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.map(a=>({...a,pagination:a.pagination!=null?rA5(a.pagination):void 0}));return[r,{...i,endpoints:n}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:tA5(t)},services:t}}};function tA5(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function rA5(e){switch(e.type){case"cursor":{let t=iA5(e);return t!=null?I.V47.Pagination.cursor(t):void 0}case"offset":{let t=nA5(e);return t!=null?I.V47.Pagination.offset(t):void 0}default:vt(e)}}function iA5(e){let t=TpE(e.page);if(t!=null)return{...e,page:t}}function nA5(e){if(e.step!=null)return;let t=TpE(e.page);if(t!=null)return{...e,page:t}}function TpE(e){switch(e.property.type){case"query":return e.property}}var RpE={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.11.0-rc0",[P.PYTHON_PYDANTIC]:"0.10.0-rc0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"2.11.0-rc0",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V48.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.flatMap(a=>{let o;return a.response?.body!=null&&(o=a.response.body?._visit({json:d=>I.V48.HttpResponseBody.json({...d}),fileDownload:d=>I.V48.HttpResponseBody.fileDownload({...d}),text:d=>I.V48.HttpResponseBody.text({...d}),streaming:d=>I.V48.HttpResponseBody.streaming({...d}),streamParameter:()=>{},_other:()=>{}}),o==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:o}}});return[r,{...i,endpoints:n}]}));return{...e,services:t}}};var zpE={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.34.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.34.0",[P.TYPESCRIPT_EXPRESS]:"0.17.2",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:"0.0.0",[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V50.types.Type._visit(r.shape,{union:i=>I.V49.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Jj(n.valueType)})),types:i.types.map(n=>yA5(n))}),enum:I.V49.types.Type.enum,object:i=>I.V49.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Jj(n.valueType)}))}),alias:i=>I.V49.types.Type.alias({aliasOf:Jj(i.aliasOf),resolvedType:vA5(i.resolvedType)}),undiscriminatedUnion:i=>I.V49.types.Type.undiscriminatedUnion(gA5(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:fA5(e.auth),headers:e.headers.map(r=>Iza(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>Iza(r)),types:t,services:bn(e.services,r=>OA5(r)),errors:bn(e.errors,r=>zA5(r)),webhookGroups:bn(e.webhookGroups,r=>sA5(r)),websocketChannels:bn(e.websocketChannels,r=>aA5(r)),pathParameters:e.pathParameters.map(r=>CDo(r)),variables:e.variables.map(r=>AA5(r))}}};function aA5(e){return{...e,headers:e.headers.map(t=>Iza(t)),queryParameters:e.queryParameters.map(t=>fop(t)),pathParameters:e.pathParameters.map(t=>CDo(t)),messages:e.messages.map(t=>oA5(t))}}function oA5(e){return{...e,body:uA5(e.body)}}function uA5(e){switch(e.type){case"inlinedBody":return I.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Jj(t.valueType)}))});case"reference":return I.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:Jj(e.bodyType)})}}function sA5(e){return e.map(t=>cA5(t))}function cA5(e){return{...e,headers:e.headers.map(t=>Iza(t)),payload:lA5(e.payload)}}function lA5(e){switch(e.type){case"reference":return I.V49.webhooks.WebhookPayload.reference({...e,payloadType:Jj(e.payloadType)});case"inlinedPayload":return I.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Jj(t.valueType)}))})}}function fA5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V49.auth.AuthScheme.basic(t);case"bearer":return I.V49.auth.AuthScheme.bearer(t);case"header":return I.V49.auth.AuthScheme.header(dA5(t));case"oauth":return I.V49.auth.AuthScheme.oauth(pA5(t))}})}}function dA5(e){return{...e,valueType:Jj(e.valueType)}}function pA5(e){return{...e,configuration:I.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:_A5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?hA5(e.configuration.refreshEndpoint):void 0})}}function _A5(e){return{...e,requestProperties:{clientId:gcn(e.requestProperties.clientId),clientSecret:gcn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?gcn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Q6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Q6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Q6i(e.responseProperties.refreshToken):void 0}}}function hA5(e){return{...e,requestProperties:{refreshToken:gcn(e.requestProperties.refreshToken)},responseProperties:{accessToken:Q6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Q6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Q6i(e.responseProperties.refreshToken):void 0}}}function Iza(e){return{...e,valueType:Jj(e.valueType)}}function Jj(e){return I.V50.types.TypeReference._visit(e,{container:t=>I.V49.types.TypeReference.container(NpE(t)),primitive:t=>t.v2?.type==="integer"?I.V49.types.TypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?I.V49.types.TypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?I.V49.types.TypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.string(t.v2)}):I.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:I.V49.types.TypeReference.named,unknown:I.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function NpE(e){return I.V50.types.ContainerType._visit(e,{list:t=>I.V49.types.ContainerType.list(Jj(t)),optional:t=>I.V49.types.ContainerType.optional(Jj(t)),set:t=>I.V49.types.ContainerType.set(Jj(t)),map:({keyType:t,valueType:r})=>I.V49.types.ContainerType.map({keyType:Jj(t),valueType:Jj(r)}),literal:I.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function yA5(e){return{...e,shape:bA5(e.shape)}}function bA5(e){return I.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:Jj(t.type)}),noProperties:I.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function vA5(e){return I.V50.types.ResolvedTypeReference._visit(e,{container:t=>I.V49.types.ResolvedTypeReference.container(NpE(t)),named:I.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.string(t.v2)}):I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:I.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function gA5(e){return{members:e.members.map(t=>({...t,type:Jj(t.type)}))}}function OA5(e){return{...e,pathParameters:e.pathParameters.map(t=>CDo(t)),headers:e.headers.map(t=>Iza(t)),endpoints:e.endpoints.map(t=>mA5(t))}}function CDo(e){return{...e,valueType:Jj(e.valueType)}}function AA5(e){return{...e,type:Jj(e.type)}}function mA5(e){return{...e,pagination:e.pagination!=null?SA5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>CDo(t)),pathParameters:e.pathParameters.map(t=>CDo(t)),sdkRequest:e.sdkRequest!=null?IA5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?TA5(e.requestBody):void 0,response:e.response!=null?PA5(e.response):void 0,headers:e.headers.map(t=>Iza(t)),queryParameters:e.queryParameters.map(t=>fop(t))}}function PA5(e){return{...e,body:e.body!=null?jA5(e.body):void 0}}function jA5(e){switch(e.type){case"json":return I.V49.http.HttpResponseBody.json(FpE(e.value));case"fileDownload":return I.V49.http.HttpResponseBody.fileDownload(e);case"text":return I.V49.http.HttpResponseBody.text(e);case"streaming":return I.V49.http.HttpResponseBody.streaming(QpE(e.value));case"streamParameter":return I.V49.http.HttpResponseBody.streamParameter(EA5(e))}}function FpE(e){switch(e.type){case"response":return I.V49.http.JsonResponse.response({...e,responseBodyType:Jj(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Jj(e.responseBodyType),responseProperty:e.responseProperty!=null?lop(e.responseProperty):void 0})}}function QpE(e){switch(e.type){case"json":return I.V49.http.StreamingResponse.json({...e,payload:Jj(e.payload)});case"text":return I.V49.http.StreamingResponse.text(e);case"sse":return I.V49.http.StreamingResponse.sse({...e,payload:Jj(e.payload)})}}function wA5(e){switch(e.type){case"json":return I.V49.http.NonStreamHttpResponseBody.json(FpE(e.value));case"text":return I.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function EA5(e){return{nonStreamResponse:wA5(e.nonStreamResponse),streamResponse:QpE(e.streamResponse)}}function SA5(e){switch(e.type){case"cursor":return I.V49.http.Pagination.cursor(MA5(e));case"offset":return I.V49.http.Pagination.offset(DA5(e))}}function MA5(e){return{...e,page:gcn(e.page),next:Q6i(e.next),results:Q6i(e.results)}}function DA5(e){return{...e,page:gcn(e.page),results:Q6i(e.results),step:e.step!=null?gcn(e.step):void 0}}function gcn(e){return{...e,property:BA5(e.property)}}function BA5(e){switch(e.type){case"query":return I.V49.RequestPropertyValue.query(fop(e));case"body":return I.V49.RequestPropertyValue.body(lop(e))}}function Q6i(e){return{...e,property:lop(e.property)}}function lop(e){return{...e,valueType:Jj(e.valueType)}}function fop(e){return{...e,valueType:Jj(e.valueType)}}function IA5(e){return{...e,streamParameter:e.streamParameter!=null?gcn(e.streamParameter):void 0,shape:CA5(e.shape)}}function CA5(e){return I.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V49.http.SdkRequestShape.justRequestBody(qA5(t)),wrapper:I.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function qA5(e){switch(e.type){case"bytes":return I.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Jj(e.requestBodyType)})}}function TA5(e){return I.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Jj(r.valueType)}))}),reference:t=>I.V49.http.HttpRequestBody.reference({...t,requestBodyType:Jj(t.requestBodyType)}),fileUpload:t=>I.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Jj(r.valueType)});case"file":return I.V49.http.FileUploadRequestProperty.file(RA5(r.value))}})}),bytes:t=>I.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function RA5(e){switch(e.type){case"file":return I.V49.http.FileProperty.file(e);case"fileArray":return I.V49.http.FileProperty.fileArray(e)}}function zA5(e){return{...e,type:e.type!=null?Jj(e.type):void 0}}var VpE={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"0.1.2",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=bn(e.types,r=>{let i=r.autogeneratedExamples.map(a=>UpE(a)),n=r.userProvidedExamples.map(a=>UpE(a));return{...r,examples:[...i,...n]}});return{...e,types:t,services:bn(e.services,r=>KA5(r)),errors:bn(e.errors,r=>ZA5(r)),webhookGroups:bn(e.webhookGroups,r=>UA5(r)),websocketChannels:bn(e.websocketChannels,r=>NA5(r))}}};function NA5(e){return{...e,examples:e.examples.map(t=>FA5(t))}}function FA5(e){return{...e,pathParameters:e.pathParameters.map(t=>uKs(t)),headers:e.headers.map(t=>dop(t)),queryParameters:e.queryParameters.map(t=>WpE(t)),messages:e.messages.map(t=>({...t,body:QA5(t.body)}))}}function WpE(e){return{...e,value:Nz(e.value)}}function dop(e){return{...e,value:Nz(e.value)}}function uKs(e){return{...e,value:Nz(e.value)}}function QA5(e){switch(e.type){case"inlinedBody":return I.V50.ExampleWebSocketMessageBody.inlinedBody(GpE(e));case"reference":return I.V50.ExampleWebSocketMessageBody.reference(Nz(e))}}function GpE(e){return{...e,properties:e.properties.map(t=>({...t,value:Nz(t.value)}))}}function UA5(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:Nz(r.payload)}))}))}function UpE(e){return{...e,shape:HpE(e.shape)}}function pop(e){switch(e.type){case"primitive":return I.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return I.V50.ExampleTypeReferenceShape.container(LA5(e));case"unknown":return I.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:HpE(e.shape)})}}function LA5(e){switch(e.container.type){case"list":return I.V50.ExampleContainer.list(e.container.list.map(t=>Nz(t)));case"set":return I.V50.ExampleContainer.set(e.container.set.map(t=>Nz(t)));case"optional":return I.V50.ExampleContainer.optional(e.container.optional!=null?Nz(e.container.optional):void 0);case"map":return I.V50.ExampleContainer.map(e.container.map.map(t=>({key:Nz(t.key),value:Nz(t.value)})));case"literal":return I.V50.ExampleContainer.literal(e.container.literal)}}function Nz(e){return{...e,shape:pop(e.shape)}}function HpE(e){switch(e.type){case"object":return I.V50.ExampleTypeShape.object({properties:e.properties.map(t=>xpE(t))});case"alias":return I.V50.ExampleTypeShape.alias({value:{...Nz(e.value)}});case"enum":return I.V50.ExampleTypeShape.enum(e);case"union":return I.V50.ExampleTypeShape.union(WA5(e));case"undiscriminatedUnion":return I.V50.ExampleTypeShape.undiscriminatedUnion(VA5(e))}}function VA5(e){return{...e,singleUnionType:Nz(e.singleUnionType)}}function WA5(e){return{...e,singleUnionType:GA5(e.singleUnionType)}}function GA5(e){return{...e,shape:HA5(e.shape)}}function HA5(e){switch(e.type){case"samePropertiesAsObject":return I.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:xA5(e.object)});case"singleProperty":return I.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:pop(e.shape)});case"noProperties":return I.V50.ExampleSingleUnionTypeProperties.noProperties()}}function xA5(e){return{...e,properties:e.properties.map(t=>xpE(t))}}function xpE(e){return{...e,value:{...e.value,shape:pop(e.value.shape)}}}function KA5(e){return{...e,endpoints:e.endpoints.map(t=>JA5(t))}}function JA5(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:LpE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?LpE(t.example):void 0}))}}function LpE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>uKs(t)),servicePathParameters:e.servicePathParameters.map(t=>uKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>uKs(t)),serviceHeaders:e.serviceHeaders.map(t=>dop(t)),endpointHeaders:e.endpointHeaders.map(t=>dop(t)),queryParameters:e.queryParameters.map(t=>WpE(t)),request:e.request!=null?XA5(e.request):void 0,response:$A5(e.response)}}function $A5(e){switch(e.type){case"error":return I.V50.ExampleResponse.error({...e,body:e.body!=null?Nz(e.body):void 0});case"ok":return I.V50.ExampleResponse.ok(YA5(e))}}function YA5(e){switch(e.value.type){case"body":return I.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?Nz(e.value.value):void 0);case"stream":return I.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Nz(t)));case"sse":return I.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Nz(t.data)})))}}function XA5(e){switch(e.type){case"inlinedRequestBody":return I.V50.ExampleRequestBody.inlinedRequestBody(GpE(e));case"reference":return I.V50.ExampleRequestBody.reference(Nz(e))}}function ZA5(e){return{...e,examples:e.examples.map(t=>({...t,shape:Nz(t.shape)}))}}var $pE={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?em5(e.apiVersion):void 0,auth:sm5(e.auth),headers:e.headers.map(t=>txn(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>txn(t)),types:kA5(e.types),services:bn(e.services,t=>gm5(t)),webhookGroups:bn(e.webhookGroups,t=>nm5(t)),websocketChannels:bn(e.websocketChannels,t=>tm5(t)),errors:bn(e.errors,t=>Rm5(t)),pathParameters:e.pathParameters.map(t=>qDo(t)),variables:e.variables.map(t=>Om5(t))})};function kA5(e){return bn(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>KpE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>KpE(r)),shape:I.V52.types.Type._visit(t.shape,{union:r=>I.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:aA(i.valueType)})),types:r.types.map(i=>hm5(i))}),enum:I.V51.types.Type.enum,object:r=>I.V51.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:aA(i.valueType)}))}),alias:r=>I.V51.types.Type.alias({aliasOf:aA(r.aliasOf),resolvedType:bm5(r.resolvedType)}),undiscriminatedUnion:r=>I.V51.types.Type.undiscriminatedUnion(vm5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function em5(e){return I.V51.ApiVersionScheme.header({...e,header:txn(e.header)})}function tm5(e){return{...e,headers:e.headers.map(t=>txn(t)),queryParameters:e.queryParameters.map(t=>yop(t)),pathParameters:e.pathParameters.map(t=>qDo(t)),messages:e.messages.map(t=>rm5(t)),examples:e.examples.map(t=>zm5(t))}}function rm5(e){return{...e,body:im5(e.body)}}function im5(e){switch(e.type){case"inlinedBody":return I.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:aA(t.valueType)}))});case"reference":return I.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:aA(e.bodyType)})}}function nm5(e){return e.map(t=>am5(t))}function am5(e){return{...e,headers:e.headers.map(t=>txn(t)),payload:om5(e.payload),examples:e.examples!=null?e.examples.map(t=>um5(t)):void 0}}function om5(e){switch(e.type){case"reference":return I.V51.webhooks.WebhookPayload.reference({...e,payloadType:aA(e.payloadType)});case"inlinedPayload":return I.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:aA(t.valueType)}))})}}function um5(e){return{...e,payload:Fz(e.payload)}}function sm5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V51.auth.AuthScheme.basic(t);case"bearer":return I.V51.auth.AuthScheme.bearer(t);case"header":return I.V51.auth.AuthScheme.header(cm5(t));case"oauth":return I.V51.auth.AuthScheme.oauth(lm5(t))}})}}function cm5(e){return{...e,valueType:aA(e.valueType)}}function lm5(e){return{...e,configuration:I.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:fm5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?dm5(e.configuration.refreshEndpoint):void 0})}}function fm5(e){return{...e,requestProperties:{clientId:Ocn(e.requestProperties.clientId),clientSecret:Ocn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Ocn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:U6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?U6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?U6i(e.responseProperties.refreshToken):void 0}}}function dm5(e){return{...e,requestProperties:{refreshToken:Ocn(e.requestProperties.refreshToken)},responseProperties:{accessToken:U6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?U6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?U6i(e.responseProperties.refreshToken):void 0}}}function txn(e){return{...e,valueType:aA(e.valueType)}}function aA(e){return I.V52.types.TypeReference._visit(e,{container:t=>I.V51.types.TypeReference.container(XpE(t)),primitive:t=>I.V51.types.TypeReference.primitive(YpE(t)),named:I.V51.types.TypeReference.named,unknown:I.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function YpE(e){return{v1:pm5(e.v1),v2:e.v2!=null?_m5(e.v2):void 0}}function pm5(e){switch(e){case"UINT":return I.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return I.V51.types.PrimitiveTypeV1.Long}return e}function _m5(e){switch(e.type){case"integer":return I.V51.types.PrimitiveTypeV2.integer(e);case"double":return I.V51.types.PrimitiveTypeV2.double(e);case"string":return I.V51.types.PrimitiveTypeV2.string(e);case"boolean":return I.V51.types.PrimitiveTypeV2.boolean(e);case"long":return I.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return I.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:vt(e)}}function XpE(e){return I.V52.types.ContainerType._visit(e,{list:t=>I.V51.types.ContainerType.list(aA(t)),optional:t=>I.V51.types.ContainerType.optional(aA(t)),set:t=>I.V51.types.ContainerType.set(aA(t)),map:({keyType:t,valueType:r})=>I.V51.types.ContainerType.map({keyType:aA(t),valueType:aA(r)}),literal:I.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function hm5(e){return{...e,shape:ym5(e.shape)}}function ym5(e){return I.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:aA(t.type)}),noProperties:I.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function bm5(e){return I.V52.types.ResolvedTypeReference._visit(e,{container:t=>I.V51.types.ResolvedTypeReference.container(XpE(t)),named:I.V51.types.ResolvedTypeReference.named,primitive:t=>I.V51.types.ResolvedTypeReference.primitive(YpE(t)),unknown:I.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function vm5(e){return{members:e.members.map(t=>({...t,type:aA(t.type)}))}}function gm5(e){return{...e,pathParameters:e.pathParameters.map(t=>qDo(t)),headers:e.headers.map(t=>txn(t)),endpoints:e.endpoints.map(t=>Am5(t))}}function qDo(e){return{...e,valueType:aA(e.valueType)}}function Om5(e){return{...e,type:aA(e.type)}}function Am5(e){return{...e,pagination:e.pagination!=null?Em5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>qDo(t)),pathParameters:e.pathParameters.map(t=>qDo(t)),sdkRequest:e.sdkRequest!=null?Bm5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?qm5(e.requestBody):void 0,response:e.response!=null?mm5(e.response):void 0,headers:e.headers.map(t=>txn(t)),queryParameters:e.queryParameters.map(t=>yop(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:JpE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?JpE(t.example):void 0}))}}function mm5(e){return{...e,body:e.body!=null?Pm5(e.body):void 0}}function Pm5(e){switch(e.type){case"json":return I.V51.http.HttpResponseBody.json(ZpE(e.value));case"fileDownload":return I.V51.http.HttpResponseBody.fileDownload(e);case"text":return I.V51.http.HttpResponseBody.text(e);case"streaming":return I.V51.http.HttpResponseBody.streaming(kpE(e.value));case"streamParameter":return I.V51.http.HttpResponseBody.streamParameter(wm5(e))}}function ZpE(e){switch(e.type){case"response":return I.V51.http.JsonResponse.response({...e,responseBodyType:aA(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:aA(e.responseBodyType),responseProperty:e.responseProperty!=null?hop(e.responseProperty):void 0})}}function kpE(e){switch(e.type){case"json":return I.V51.http.StreamingResponse.json({...e,payload:aA(e.payload)});case"text":return I.V51.http.StreamingResponse.text(e);case"sse":return I.V51.http.StreamingResponse.sse({...e,payload:aA(e.payload)})}}function jm5(e){switch(e.type){case"json":return I.V51.http.NonStreamHttpResponseBody.json(ZpE(e.value));case"text":return I.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function wm5(e){return{nonStreamResponse:jm5(e.nonStreamResponse),streamResponse:kpE(e.streamResponse)}}function Em5(e){switch(e.type){case"cursor":return I.V51.http.Pagination.cursor(Sm5(e));case"offset":return I.V51.http.Pagination.offset(Mm5(e))}}function Sm5(e){return{...e,page:Ocn(e.page),next:U6i(e.next),results:U6i(e.results)}}function Mm5(e){return{...e,page:Ocn(e.page),results:U6i(e.results),step:e.step!=null?Ocn(e.step):void 0}}function Ocn(e){return{...e,property:Dm5(e.property)}}function Dm5(e){switch(e.type){case"query":return I.V51.RequestPropertyValue.query(yop(e));case"body":return I.V51.RequestPropertyValue.body(hop(e))}}function U6i(e){return{...e,property:hop(e.property)}}function hop(e){return{...e,valueType:aA(e.valueType)}}function yop(e){return{...e,valueType:aA(e.valueType)}}function Bm5(e){return{...e,streamParameter:e.streamParameter!=null?Ocn(e.streamParameter):void 0,shape:Im5(e.shape)}}function Im5(e){return I.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V51.http.SdkRequestShape.justRequestBody(Cm5(t)),wrapper:I.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Cm5(e){switch(e.type){case"bytes":return I.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:aA(e.requestBodyType)})}}function qm5(e){return I.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:aA(r.valueType)}))}),reference:t=>I.V51.http.HttpRequestBody.reference({...t,requestBodyType:aA(t.requestBodyType)}),fileUpload:t=>I.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:aA(r.valueType)});case"file":return I.V51.http.FileUploadRequestProperty.file(Tm5(r.value))}})}),bytes:t=>I.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Tm5(e){switch(e.type){case"file":return I.V51.http.FileProperty.file(e);case"fileArray":return I.V51.http.FileProperty.fileArray(e)}}function Rm5(e){return{...e,type:e.type!=null?aA(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Fz(t.shape)}))}}function zm5(e){return{...e,pathParameters:e.pathParameters.map(t=>sKs(t)),headers:e.headers.map(t=>_op(t)),queryParameters:e.queryParameters.map(t=>e_E(t)),messages:e.messages.map(t=>({...t,body:Nm5(t.body)}))}}function e_E(e){return{...e,value:Fz(e.value)}}function _op(e){return{...e,value:Fz(e.value)}}function sKs(e){return{...e,value:Fz(e.value)}}function Nm5(e){switch(e.type){case"inlinedBody":return I.V51.ExampleWebSocketMessageBody.inlinedBody(t_E(e));case"reference":return I.V51.ExampleWebSocketMessageBody.reference(Fz(e))}}function t_E(e){return{...e,properties:e.properties.map(t=>({...t,value:Fz(t.value)}))}}function KpE(e){return{...e,shape:i_E(e.shape)}}function bop(e){switch(e.type){case"primitive":return I.V51.ExampleTypeReferenceShape.primitive(Fm5(e));case"container":return I.V51.ExampleTypeReferenceShape.container(Qm5(e));case"unknown":return I.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:i_E(e.shape)})}}function r_E(e){switch(e.type){case"integer":return I.V51.ExamplePrimitive.integer(e.integer);case"uint":return I.V51.ExamplePrimitive.integer(e.uint);case"uint64":return I.V51.ExamplePrimitive.integer(e.uint64);case"double":return I.V51.ExamplePrimitive.double(e.double);case"long":return I.V51.ExamplePrimitive.long(e.long);case"boolean":return I.V51.ExamplePrimitive.boolean(e.boolean);case"string":return I.V51.ExamplePrimitive.string(e.string);case"date":return I.V51.ExamplePrimitive.date(e.date);case"datetime":return I.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return I.V51.ExamplePrimitive.uuid(e.uuid)}}function Fm5(e){return r_E(e.primitive)}function Qm5(e){switch(e.container.type){case"list":return I.V51.ExampleContainer.list({list:e.container.list.map(t=>Fz(t)),itemType:aA(e.container.itemType)});case"set":return I.V51.ExampleContainer.set({set:e.container.set.map(t=>Fz(t)),itemType:aA(e.container.itemType)});case"optional":return I.V51.ExampleContainer.optional({optional:e.container.optional!=null?Fz(e.container.optional):void 0,valueType:aA(e.container.valueType)});case"map":return I.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:Fz(t.key),value:Fz(t.value)})),keyType:aA(e.container.keyType),valueType:aA(e.container.valueType)});case"literal":return I.V51.ExampleContainer.literal({literal:r_E(e.container.literal)})}}function Fz(e){return{...e,shape:bop(e.shape)}}function i_E(e){switch(e.type){case"object":return I.V51.ExampleTypeShape.object({properties:e.properties.map(t=>n_E(t))});case"alias":return I.V51.ExampleTypeShape.alias({value:{...Fz(e.value)}});case"enum":return I.V51.ExampleTypeShape.enum(e);case"union":return I.V51.ExampleTypeShape.union(Lm5(e));case"undiscriminatedUnion":return I.V51.ExampleTypeShape.undiscriminatedUnion(Um5(e))}}function Um5(e){return{...e,singleUnionType:Fz(e.singleUnionType)}}function Lm5(e){return{...e,singleUnionType:Vm5(e.singleUnionType)}}function Vm5(e){return{...e,shape:Wm5(e.shape)}}function Wm5(e){switch(e.type){case"samePropertiesAsObject":return I.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Gm5(e.object)});case"singleProperty":return I.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:bop(e.shape)});case"noProperties":return I.V51.ExampleSingleUnionTypeProperties.noProperties()}}function Gm5(e){return{...e,properties:e.properties.map(t=>n_E(t))}}function n_E(e){return{...e,value:{...e.value,shape:bop(e.value.shape)}}}function JpE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>sKs(t)),servicePathParameters:e.servicePathParameters.map(t=>sKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>sKs(t)),serviceHeaders:e.serviceHeaders.map(t=>_op(t)),endpointHeaders:e.endpointHeaders.map(t=>_op(t)),queryParameters:e.queryParameters.map(t=>e_E(t)),request:e.request!=null?Km5(e.request):void 0,response:Hm5(e.response)}}function Hm5(e){switch(e.type){case"error":return I.V51.ExampleResponse.error({...e,body:e.body!=null?Fz(e.body):void 0});case"ok":return I.V51.ExampleResponse.ok(xm5(e))}}function xm5(e){switch(e.value.type){case"body":return I.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?Fz(e.value.value):void 0);case"stream":return I.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Fz(t)));case"sse":return I.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Fz(t.data)})))}}function Km5(e){switch(e.type){case"inlinedRequestBody":return I.V51.ExampleRequestBody.inlinedRequestBody(t_E(e));case"reference":return I.V51.ExampleRequestBody.reference(Fz(e))}}var u_E={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[P.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[P.TYPESCRIPT]:"0.38.0-rc0",[P.TYPESCRIPT_SDK]:"0.38.0-rc0",[P.TYPESCRIPT_EXPRESS]:"0.17.3",[P.JAVA]:C,[P.JAVA_MODEL]:"1.3.0",[P.JAVA_SDK]:"2.5.0",[P.JAVA_SPRING]:"1.3.0",[P.PYTHON_FASTAPI]:"1.1.0-rc0",[P.PYTHON_PYDANTIC]:"1.1.0-rc0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:"0.1.0",[P.STOPLIGHT]:C,[P.POSTMAN]:"0.2.0",[P.PYTHON_SDK]:"3.3.0-rc0",[P.GO_FIBER]:"0.23.5",[P.GO_MODEL]:"0.23.5",[P.GO_SDK]:"0.28.3",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"0.5.0",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:"0.1.0",[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?$m5(e.apiVersion):void 0,auth:iP5(e.auth),headers:e.headers.map(t=>rxn(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>rxn(t)),types:Jm5(e.types),services:bn(e.services,t=>_P5(t)),webhookGroups:bn(e.webhookGroups,t=>km5(t)),websocketChannels:bn(e.websocketChannels,t=>Ym5(t)),errors:bn(e.errors,t=>BP5(t)),pathParameters:e.pathParameters.map(t=>TDo(t)),variables:e.variables.map(t=>hP5(t))})};function Jm5(e){return bn(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>a_E(r)),userProvidedExamples:t.userProvidedExamples.map(r=>a_E(r)),shape:I.V53.types.Type._visit(t.shape,{union:r=>I.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:oA(i.valueType)})),types:r.types.map(i=>lP5(i))}),enum:I.V52.types.Type.enum,object:r=>I.V52.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:oA(i.valueType)}))}),alias:r=>I.V52.types.Type.alias({aliasOf:oA(r.aliasOf),resolvedType:dP5(r.resolvedType)}),undiscriminatedUnion:r=>I.V52.types.Type.undiscriminatedUnion(pP5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function $m5(e){return I.V52.ApiVersionScheme.header({...e,header:rxn(e.header)})}function Ym5(e){return{...e,headers:e.headers.map(t=>rxn(t)),queryParameters:e.queryParameters.map(t=>Oop(t)),pathParameters:e.pathParameters.map(t=>TDo(t)),messages:e.messages.map(t=>Xm5(t)),examples:e.examples.map(t=>IP5(t))}}function Xm5(e){return{...e,body:Zm5(e.body)}}function Zm5(e){switch(e.type){case"inlinedBody":return I.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:oA(t.valueType)}))});case"reference":return I.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:oA(e.bodyType)})}}function km5(e){return e.map(t=>eP5(t))}function eP5(e){return{...e,headers:e.headers.map(t=>rxn(t)),payload:tP5(e.payload),examples:e.examples!=null?e.examples.map(t=>rP5(t)):void 0}}function tP5(e){switch(e.type){case"reference":return I.V52.webhooks.WebhookPayload.reference({...e,payloadType:oA(e.payloadType)});case"inlinedPayload":return I.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:oA(t.valueType)}))})}}function rP5(e){return{...e,payload:Qz(e.payload)}}function iP5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V52.auth.AuthScheme.basic(t);case"bearer":return I.V52.auth.AuthScheme.bearer(t);case"header":return I.V52.auth.AuthScheme.header(nP5(t));case"oauth":return I.V52.auth.AuthScheme.oauth(aP5(t))}})}}function nP5(e){return{...e,valueType:oA(e.valueType)}}function aP5(e){return{...e,configuration:I.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:oP5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?uP5(e.configuration.refreshEndpoint):void 0})}}function oP5(e){return{...e,requestProperties:{clientId:Acn(e.requestProperties.clientId),clientSecret:Acn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Acn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:L6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?L6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?L6i(e.responseProperties.refreshToken):void 0}}}function uP5(e){return{...e,requestProperties:{refreshToken:Acn(e.requestProperties.refreshToken)},responseProperties:{accessToken:L6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?L6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?L6i(e.responseProperties.refreshToken):void 0}}}function rxn(e){return{...e,valueType:oA(e.valueType)}}function oA(e){return I.V53.types.TypeReference._visit(e,{container:t=>I.V52.types.TypeReference.container(c_E(t)),primitive:t=>I.V52.types.TypeReference.primitive(s_E(t)),named:I.V52.types.TypeReference.named,unknown:I.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function s_E(e){return{v1:sP5(e.v1),v2:e.v2!=null?cP5(e.v2):void 0}}function sP5(e){switch(e){case"FLOAT":return I.V52.types.PrimitiveTypeV1.Double}return e}function cP5(e){switch(e.type){case"integer":return I.V52.types.PrimitiveTypeV2.integer(e);case"double":return I.V52.types.PrimitiveTypeV2.double(e);case"string":return I.V52.types.PrimitiveTypeV2.string(e);case"boolean":return I.V52.types.PrimitiveTypeV2.boolean(e);case"long":return I.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return I.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return I.V52.types.PrimitiveTypeV2.uint();case"uint64":return I.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:vt(e)}}function c_E(e){return I.V53.types.ContainerType._visit(e,{list:t=>I.V52.types.ContainerType.list(oA(t)),optional:t=>I.V52.types.ContainerType.optional(oA(t)),set:t=>I.V52.types.ContainerType.set(oA(t)),map:({keyType:t,valueType:r})=>I.V52.types.ContainerType.map({keyType:oA(t),valueType:oA(r)}),literal:I.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function lP5(e){return{...e,shape:fP5(e.shape)}}function fP5(e){return I.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:oA(t.type)}),noProperties:I.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function dP5(e){return I.V53.types.ResolvedTypeReference._visit(e,{container:t=>I.V52.types.ResolvedTypeReference.container(c_E(t)),named:I.V52.types.ResolvedTypeReference.named,primitive:t=>I.V52.types.ResolvedTypeReference.primitive(s_E(t)),unknown:I.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function pP5(e){return{members:e.members.map(t=>({...t,type:oA(t.type)}))}}function _P5(e){return{...e,pathParameters:e.pathParameters.map(t=>TDo(t)),headers:e.headers.map(t=>rxn(t)),endpoints:e.endpoints.map(t=>yP5(t))}}function TDo(e){return{...e,valueType:oA(e.valueType)}}function hP5(e){return{...e,type:oA(e.type)}}function yP5(e){return{...e,pagination:e.pagination!=null?AP5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>TDo(t)),pathParameters:e.pathParameters.map(t=>TDo(t)),sdkRequest:e.sdkRequest!=null?wP5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?MP5(e.requestBody):void 0,response:e.response!=null?bP5(e.response):void 0,headers:e.headers.map(t=>rxn(t)),queryParameters:e.queryParameters.map(t=>Oop(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:o_E(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?o_E(t.example):void 0}))}}function bP5(e){return{...e,body:e.body!=null?vP5(e.body):void 0}}function vP5(e){switch(e.type){case"json":return I.V52.http.HttpResponseBody.json(l_E(e.value));case"fileDownload":return I.V52.http.HttpResponseBody.fileDownload(e);case"text":return I.V52.http.HttpResponseBody.text(e);case"streaming":return I.V52.http.HttpResponseBody.streaming(f_E(e.value));case"streamParameter":return I.V52.http.HttpResponseBody.streamParameter(OP5(e))}}function l_E(e){switch(e.type){case"response":return I.V52.http.JsonResponse.response({...e,responseBodyType:oA(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:oA(e.responseBodyType),responseProperty:e.responseProperty!=null?gop(e.responseProperty):void 0})}}function f_E(e){switch(e.type){case"json":return I.V52.http.StreamingResponse.json({...e,payload:oA(e.payload)});case"text":return I.V52.http.StreamingResponse.text(e);case"sse":return I.V52.http.StreamingResponse.sse({...e,payload:oA(e.payload)})}}function gP5(e){switch(e.type){case"json":return I.V52.http.NonStreamHttpResponseBody.json(l_E(e.value));case"text":return I.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function OP5(e){return{nonStreamResponse:gP5(e.nonStreamResponse),streamResponse:f_E(e.streamResponse)}}function AP5(e){switch(e.type){case"cursor":return I.V52.http.Pagination.cursor(mP5(e));case"offset":return I.V52.http.Pagination.offset(PP5(e))}}function mP5(e){return{...e,page:Acn(e.page),next:L6i(e.next),results:L6i(e.results)}}function PP5(e){return{...e,page:Acn(e.page),results:L6i(e.results),step:e.step!=null?Acn(e.step):void 0}}function Acn(e){return{...e,property:jP5(e.property)}}function jP5(e){switch(e.type){case"query":return I.V52.RequestPropertyValue.query(Oop(e));case"body":return I.V52.RequestPropertyValue.body(gop(e))}}function L6i(e){return{...e,property:gop(e.property)}}function gop(e){return{...e,valueType:oA(e.valueType)}}function Oop(e){return{...e,valueType:oA(e.valueType)}}function wP5(e){return{...e,streamParameter:e.streamParameter!=null?Acn(e.streamParameter):void 0,shape:EP5(e.shape)}}function EP5(e){return I.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V52.http.SdkRequestShape.justRequestBody(SP5(t)),wrapper:I.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function SP5(e){switch(e.type){case"bytes":return I.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:oA(e.requestBodyType)})}}function MP5(e){return I.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:oA(r.valueType)}))}),reference:t=>I.V52.http.HttpRequestBody.reference({...t,requestBodyType:oA(t.requestBodyType)}),fileUpload:t=>I.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:oA(r.valueType)});case"file":return I.V52.http.FileUploadRequestProperty.file(DP5(r.value))}})}),bytes:t=>I.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function DP5(e){switch(e.type){case"file":return I.V52.http.FileProperty.file(e);case"fileArray":return I.V52.http.FileProperty.fileArray(e)}}function BP5(e){return{...e,type:e.type!=null?oA(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Qz(t.shape)}))}}function IP5(e){return{...e,pathParameters:e.pathParameters.map(t=>cKs(t)),headers:e.headers.map(t=>vop(t)),queryParameters:e.queryParameters.map(t=>d_E(t)),messages:e.messages.map(t=>({...t,body:CP5(t.body)}))}}function d_E(e){return{...e,value:Qz(e.value)}}function vop(e){return{...e,value:Qz(e.value)}}function cKs(e){return{...e,value:Qz(e.value)}}function CP5(e){switch(e.type){case"inlinedBody":return I.V52.ExampleWebSocketMessageBody.inlinedBody(p_E(e));case"reference":return I.V52.ExampleWebSocketMessageBody.reference(Qz(e))}}function p_E(e){return{...e,properties:e.properties.map(t=>({...t,value:Qz(t.value)}))}}function a_E(e){return{...e,shape:h_E(e.shape)}}function Aop(e){switch(e.type){case"primitive":return I.V52.ExampleTypeReferenceShape.primitive(qP5(e));case"container":return I.V52.ExampleTypeReferenceShape.container(TP5(e));case"unknown":return I.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:h_E(e.shape)})}}function __E(e){switch(e.type){case"integer":return I.V52.ExamplePrimitive.integer(e.integer);case"uint":return I.V52.ExamplePrimitive.integer(e.uint);case"uint64":return I.V52.ExamplePrimitive.integer(e.uint64);case"float":return I.V52.ExamplePrimitive.double(e.float);case"double":return I.V52.ExamplePrimitive.double(e.double);case"long":return I.V52.ExamplePrimitive.long(e.long);case"boolean":return I.V52.ExamplePrimitive.boolean(e.boolean);case"string":return I.V52.ExamplePrimitive.string(e.string);case"date":return I.V52.ExamplePrimitive.date(e.date);case"datetime":return I.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return I.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return I.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return I.V52.ExamplePrimitive.string({original:e.bigInteger})}}function qP5(e){return __E(e.primitive)}function TP5(e){switch(e.container.type){case"list":return I.V52.ExampleContainer.list({list:e.container.list.map(t=>Qz(t)),itemType:oA(e.container.itemType)});case"set":return I.V52.ExampleContainer.set({set:e.container.set.map(t=>Qz(t)),itemType:oA(e.container.itemType)});case"optional":return I.V52.ExampleContainer.optional({optional:e.container.optional!=null?Qz(e.container.optional):void 0,valueType:oA(e.container.valueType)});case"map":return I.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:Qz(t.key),value:Qz(t.value)})),keyType:oA(e.container.keyType),valueType:oA(e.container.valueType)});case"literal":return I.V52.ExampleContainer.literal({literal:__E(e.container.literal)})}}function Qz(e){return{...e,shape:Aop(e.shape)}}function h_E(e){switch(e.type){case"object":return I.V52.ExampleTypeShape.object({properties:e.properties.map(t=>y_E(t))});case"alias":return I.V52.ExampleTypeShape.alias({value:{...Qz(e.value)}});case"enum":return I.V52.ExampleTypeShape.enum(e);case"union":return I.V52.ExampleTypeShape.union(zP5(e));case"undiscriminatedUnion":return I.V52.ExampleTypeShape.undiscriminatedUnion(RP5(e))}}function RP5(e){return{...e,singleUnionType:Qz(e.singleUnionType)}}function zP5(e){return{...e,singleUnionType:NP5(e.singleUnionType)}}function NP5(e){return{...e,shape:FP5(e.shape)}}function FP5(e){switch(e.type){case"samePropertiesAsObject":return I.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:QP5(e.object)});case"singleProperty":return I.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Aop(e.shape)});case"noProperties":return I.V52.ExampleSingleUnionTypeProperties.noProperties()}}function QP5(e){return{...e,properties:e.properties.map(t=>y_E(t))}}function y_E(e){return{...e,value:{...e.value,shape:Aop(e.value.shape)}}}function o_E(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>cKs(t)),servicePathParameters:e.servicePathParameters.map(t=>cKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>cKs(t)),serviceHeaders:e.serviceHeaders.map(t=>vop(t)),endpointHeaders:e.endpointHeaders.map(t=>vop(t)),queryParameters:e.queryParameters.map(t=>d_E(t)),request:e.request!=null?VP5(e.request):void 0,response:UP5(e.response)}}function UP5(e){switch(e.type){case"error":return I.V52.ExampleResponse.error({...e,body:e.body!=null?Qz(e.body):void 0});case"ok":return I.V52.ExampleResponse.ok(LP5(e))}}function LP5(e){switch(e.value.type){case"body":return I.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?Qz(e.value.value):void 0);case"stream":return I.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Qz(t)));case"sse":return I.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Qz(t.data)})))}}function VP5(e){switch(e.type){case"inlinedRequestBody":return I.V52.ExampleRequestBody.inlinedRequestBody(p_E(e));case"reference":return I.V52.ExampleRequestBody.reference(Qz(e))}}var b_E={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:C,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:bn(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:WP5(r.response)}))}))})};function WP5(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?I.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var O_E={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.47.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[P.TYPESCRIPT]:"0.47.0",[P.TYPESCRIPT_SDK]:"0.47.0",[P.TYPESCRIPT_EXPRESS]:"0.17.7",[P.JAVA]:C,[P.JAVA_MODEL]:"1.7.0",[P.JAVA_SDK]:"2.16.0",[P.JAVA_SPRING]:"1.5.0",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"1.10.1",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:"0.3.2",[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?HP5(e.apiVersion):void 0,auth:kP5(e.auth),headers:e.headers.map(t=>ixn(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>ixn(t)),types:GP5(e.types),services:bn(e.services,t=>sj5(t)),webhookGroups:bn(e.webhookGroups,t=>$P5(t)),websocketChannels:bn(e.websocketChannels,t=>xP5(t)),errors:bn(e.errors,t=>jj5(t)),pathParameters:e.pathParameters.map(t=>RDo(t)),variables:e.variables.map(t=>cj5(t)),dynamic:e.dynamic!=null?Nj5(e.dynamic):void 0})};function GP5(e){return bn(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>v_E(r)),userProvidedExamples:t.userProvidedExamples.map(r=>v_E(r)),shape:I.V55.types.Type._visit(t.shape,{union:r=>I.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:gh(i.valueType)})),types:r.types.map(i=>nj5(i))}),enum:I.V54.types.Type.enum,object:r=>I.V54.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:gh(i.valueType)})),extendedProperties:r.extendedProperties?.map(i=>({...i,valueType:gh(i.valueType)}))}),alias:r=>I.V54.types.Type.alias({aliasOf:gh(r.aliasOf),resolvedType:oj5(r.resolvedType)}),undiscriminatedUnion:r=>I.V54.types.Type.undiscriminatedUnion(uj5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function HP5(e){return I.V54.ApiVersionScheme.header({...e,header:ixn(e.header)})}function xP5(e){return{...e,headers:e.headers.map(t=>ixn(t)),queryParameters:e.queryParameters.map(t=>jop(t)),pathParameters:e.pathParameters.map(t=>RDo(t)),messages:e.messages.map(t=>KP5(t)),examples:e.examples.map(t=>wj5(t))}}function KP5(e){return{...e,body:JP5(e.body)}}function JP5(e){switch(e.type){case"inlinedBody":return I.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:gh(t.valueType)}))});case"reference":return I.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:gh(e.bodyType)})}}function $P5(e){return e.map(t=>YP5(t))}function YP5(e){return{...e,headers:e.headers.map(t=>ixn(t)),payload:XP5(e.payload),examples:e.examples!=null?e.examples.map(t=>ZP5(t)):void 0}}function XP5(e){switch(e.type){case"reference":return I.V54.webhooks.WebhookPayload.reference({...e,payloadType:gh(e.payloadType)});case"inlinedPayload":return I.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:gh(t.valueType)}))})}}function ZP5(e){return{...e,payload:PT(e.payload)}}function kP5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V54.auth.AuthScheme.basic(t);case"bearer":return I.V54.auth.AuthScheme.bearer(t);case"header":return I.V54.auth.AuthScheme.header(ej5(t));case"oauth":return I.V54.auth.AuthScheme.oauth(tj5(t))}})}}function ej5(e){return{...e,valueType:gh(e.valueType)}}function tj5(e){return{...e,configuration:I.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:rj5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?ij5(e.configuration.refreshEndpoint):void 0})}}function rj5(e){return{...e,requestProperties:{clientId:mcn(e.requestProperties.clientId),clientSecret:mcn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?mcn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:iRi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?iRi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?iRi(e.responseProperties.refreshToken):void 0}}}function ij5(e){return{...e,requestProperties:{refreshToken:mcn(e.requestProperties.refreshToken)},responseProperties:{accessToken:iRi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?iRi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?iRi(e.responseProperties.refreshToken):void 0}}}function ixn(e){return{...e,valueType:gh(e.valueType)}}function gh(e){return e.type==="container"&&e.container.type==="nullable"?Yj5(e.container.nullable):e.type==="container"&&e.container.type==="optional"?$j5(e.container.optional):I.V55.types.TypeReference._visit(e,{container:t=>I.V54.types.TypeReference.container(m_E(t)),primitive:t=>I.V54.types.TypeReference.primitive(A_E(t)),named:I.V54.types.TypeReference.named,unknown:I.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function A_E(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function m_E(e){return I.V55.types.ContainerType._visit(e,{list:t=>I.V54.types.ContainerType.list(gh(t)),optional:t=>I.V54.types.ContainerType.optional(gh(t)),nullable:t=>I.V54.types.ContainerType.optional(gh(t)),set:t=>I.V54.types.ContainerType.set(gh(t)),map:({keyType:t,valueType:r})=>I.V54.types.ContainerType.map({keyType:gh(t),valueType:gh(r)}),literal:I.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function nj5(e){return{...e,shape:aj5(e.shape)}}function aj5(e){return I.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:gh(t.type)}),noProperties:I.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function oj5(e){return I.V55.types.ResolvedTypeReference._visit(e,{container:t=>I.V54.types.ResolvedTypeReference.container(m_E(t)),named:I.V54.types.ResolvedTypeReference.named,primitive:t=>I.V54.types.ResolvedTypeReference.primitive(A_E(t)),unknown:I.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function uj5(e){return{members:e.members.map(t=>({...t,type:gh(t.type)}))}}function sj5(e){return{...e,pathParameters:e.pathParameters.map(t=>RDo(t)),headers:e.headers.map(t=>ixn(t)),endpoints:e.endpoints.map(t=>lj5(t))}}function RDo(e){return{...e,valueType:gh(e.valueType)}}function cj5(e){return{...e,type:gh(e.type)}}function lj5(e){return{...e,pagination:e.pagination!=null?hj5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>RDo(t)),pathParameters:e.pathParameters.map(t=>RDo(t)),sdkRequest:e.sdkRequest!=null?gj5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?mj5(e.requestBody):void 0,response:e.response!=null?fj5(e.response):void 0,headers:e.headers.map(t=>ixn(t)),queryParameters:e.queryParameters.map(t=>jop(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:g_E(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?g_E(t.example):void 0}))}}function fj5(e){return{...e,body:e.body!=null?dj5(e.body):void 0}}function dj5(e){switch(e.type){case"json":return I.V54.http.HttpResponseBody.json(P_E(e.value));case"fileDownload":return I.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return I.V54.http.HttpResponseBody.bytes(e);case"text":return I.V54.http.HttpResponseBody.text(e);case"streaming":return I.V54.http.HttpResponseBody.streaming(j_E(e.value));case"streamParameter":return I.V54.http.HttpResponseBody.streamParameter(_j5(e));default:vt(e)}}function P_E(e){switch(e.type){case"response":return I.V54.http.JsonResponse.response({...e,responseBodyType:gh(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:gh(e.responseBodyType),responseProperty:e.responseProperty!=null?Pop(e.responseProperty):void 0})}}function j_E(e){switch(e.type){case"json":return I.V54.http.StreamingResponse.json({...e,payload:gh(e.payload)});case"text":return I.V54.http.StreamingResponse.text(e);case"sse":return I.V54.http.StreamingResponse.sse({...e,payload:gh(e.payload)})}}function pj5(e){switch(e.type){case"json":return I.V54.http.NonStreamHttpResponseBody.json(P_E(e.value));case"bytes":return I.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return I.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:vt(e)}}function _j5(e){return{nonStreamResponse:pj5(e.nonStreamResponse),streamResponse:j_E(e.streamResponse)}}function hj5(e){switch(e.type){case"cursor":return I.V54.http.Pagination.cursor(yj5(e));case"offset":return I.V54.http.Pagination.offset(bj5(e))}}function yj5(e){return{...e,page:mcn(e.page),next:iRi(e.next),results:iRi(e.results)}}function bj5(e){return{...e,page:mcn(e.page),results:iRi(e.results),step:e.step!=null?mcn(e.step):void 0,hasNextPage:e.hasNextPage!=null?iRi(e.hasNextPage):void 0}}function mcn(e){return{...e,property:vj5(e.property)}}function vj5(e){switch(e.type){case"query":return I.V54.RequestPropertyValue.query(jop(e));case"body":return I.V54.RequestPropertyValue.body(Pop(e))}}function iRi(e){return{...e,property:Pop(e.property)}}function Pop(e){return{...e,valueType:gh(e.valueType)}}function jop(e){return{...e,valueType:gh(e.valueType)}}function gj5(e){return{...e,streamParameter:e.streamParameter!=null?mcn(e.streamParameter):void 0,shape:Oj5(e.shape)}}function Oj5(e){return I.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V54.http.SdkRequestShape.justRequestBody(Aj5(t)),wrapper:I.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Aj5(e){switch(e.type){case"bytes":return I.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:gh(e.requestBodyType)})}}function mj5(e){return I.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:gh(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:gh(r.valueType)}))}),reference:t=>I.V54.http.HttpRequestBody.reference({...t,requestBodyType:gh(t.requestBodyType)}),fileUpload:t=>I.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:gh(r.valueType)});case"file":return I.V54.http.FileUploadRequestProperty.file(Pj5(r.value))}})}),bytes:t=>I.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Pj5(e){switch(e.type){case"file":return I.V54.http.FileProperty.file(e);case"fileArray":return I.V54.http.FileProperty.fileArray(e)}}function jj5(e){return{...e,type:e.type!=null?gh(e.type):void 0,examples:e.examples.map(t=>({...t,shape:PT(t.shape)}))}}function wj5(e){return{...e,pathParameters:e.pathParameters.map(t=>lKs(t)),headers:e.headers.map(t=>mop(t)),queryParameters:e.queryParameters.map(t=>w_E(t)),messages:e.messages.map(t=>({...t,body:Ej5(t.body)}))}}function w_E(e){return{...e,value:PT(e.value)}}function mop(e){return{...e,value:PT(e.value)}}function lKs(e){return{...e,value:PT(e.value)}}function Ej5(e){switch(e.type){case"inlinedBody":return I.V54.ExampleWebSocketMessageBody.inlinedBody(E_E(e));case"reference":return I.V54.ExampleWebSocketMessageBody.reference(PT(e))}}function E_E(e){return{...e,properties:e.properties.map(t=>({...t,value:PT(t.value)}))}}function v_E(e){return{...e,shape:S_E(e.shape)}}function wop(e){switch(e.type){case"primitive":return I.V54.ExampleTypeReferenceShape.primitive(Sj5(e));case"container":return I.V54.ExampleTypeReferenceShape.container(Mj5(e));case"unknown":return I.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:S_E(e.shape)})}}function Sj5(e){return e.primitive}function Mj5(e){switch(e.container.type){case"list":return I.V54.ExampleContainer.list({list:e.container.list.map(t=>PT(t)),itemType:gh(e.container.itemType)});case"set":return I.V54.ExampleContainer.set({set:e.container.set.map(t=>PT(t)),itemType:gh(e.container.itemType)});case"optional":return I.V54.ExampleContainer.optional({optional:e.container.optional!=null?PT(e.container.optional):void 0,valueType:gh(e.container.valueType)});case"nullable":return I.V54.ExampleContainer.optional({optional:e.container.nullable!=null?PT(e.container.nullable):void 0,valueType:gh(e.container.valueType)});case"map":return I.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:PT(t.key),value:PT(t.value)})),keyType:gh(e.container.keyType),valueType:gh(e.container.valueType)});case"literal":return I.V54.ExampleContainer.literal({literal:e.container.literal})}}function PT(e){return{...e,shape:wop(e.shape)}}function S_E(e){switch(e.type){case"object":return I.V54.ExampleTypeShape.object({properties:e.properties.map(t=>M_E(t))});case"alias":return I.V54.ExampleTypeShape.alias({value:{...PT(e.value)}});case"enum":return I.V54.ExampleTypeShape.enum(e);case"union":return I.V54.ExampleTypeShape.union(Bj5(e));case"undiscriminatedUnion":return I.V54.ExampleTypeShape.undiscriminatedUnion(Dj5(e))}}function Dj5(e){return{...e,singleUnionType:PT(e.singleUnionType)}}function Bj5(e){return{...e,singleUnionType:Ij5(e.singleUnionType)}}function Ij5(e){return{...e,shape:Cj5(e.shape)}}function Cj5(e){switch(e.type){case"samePropertiesAsObject":return I.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:qj5(e.object)});case"singleProperty":return I.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:wop(e.shape)});case"noProperties":return I.V54.ExampleSingleUnionTypeProperties.noProperties()}}function qj5(e){return{...e,properties:e.properties.map(t=>M_E(t))}}function M_E(e){return{...e,value:{...e.value,shape:wop(e.value.shape)}}}function g_E(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>lKs(t)),servicePathParameters:e.servicePathParameters.map(t=>lKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>lKs(t)),serviceHeaders:e.serviceHeaders.map(t=>mop(t)),endpointHeaders:e.endpointHeaders.map(t=>mop(t)),queryParameters:e.queryParameters.map(t=>w_E(t)),request:e.request!=null?zj5(e.request):void 0,response:Tj5(e.response)}}function Tj5(e){switch(e.type){case"error":return I.V54.ExampleResponse.error({...e,body:e.body!=null?PT(e.body):void 0});case"ok":return I.V54.ExampleResponse.ok(Rj5(e))}}function Rj5(e){switch(e.value.type){case"body":return I.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?PT(e.value.value):void 0);case"stream":return I.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>PT(t)));case"sse":return I.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:PT(t.data)})))}}function zj5(e){switch(e.type){case"inlinedRequestBody":return I.V54.ExampleRequestBody.inlinedRequestBody(E_E(e));case"reference":return I.V54.ExampleRequestBody.reference(PT(e))}}function Nj5(e){return{...e,types:bn(e.types,t=>Fj5(t)),endpoints:bn(e.endpoints,t=>Qj5(t)),headers:e.headers?.map(t=>x4t(t))}}function Fj5(e){switch(e.type){case"alias":return I.V54.dynamic.NamedType.alias({...e,typeReference:WPe(e.typeReference)});case"enum":return I.V54.dynamic.NamedType.enum(e);case"object":return I.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>x4t(t))});case"discriminatedUnion":return I.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Lj5(r)]))});case"undiscriminatedUnion":return I.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>WPe(t))});default:vt(e)}}function Qj5(e){return{...e,auth:e.auth!=null?Uj5(e.auth):void 0,request:Vj5(e.request)}}function Uj5(e){switch(e.type){case"basic":return I.V54.dynamic.Auth.basic(e);case"bearer":return I.V54.dynamic.Auth.bearer(e);case"header":return I.V54.dynamic.Auth.header({header:x4t(e.header)})}}function WPe(e){switch(e.type){case"list":return I.V54.dynamic.TypeReference.list(WPe(e.value));case"optional":return Zj5(e.value);case"nullable":return Xj5(e.value);case"map":return I.V54.dynamic.TypeReference.map({...e,key:WPe(e.key),value:WPe(e.value)});case"literal":return I.V54.dynamic.TypeReference.literal(e.value);case"named":return I.V54.dynamic.TypeReference.named(e.value);case"primitive":return I.V54.dynamic.TypeReference.primitive(e.value);case"set":return I.V54.dynamic.TypeReference.set(WPe(e.value));case"unknown":return I.V54.dynamic.TypeReference.unknown();default:vt(e)}}function Lj5(e){switch(e.type){case"samePropertiesAsObject":return I.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>x4t(t))});case"singleProperty":return I.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:WPe(e.typeReference),properties:e.properties?.map(t=>x4t(t))});case"noProperties":return I.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>x4t(t))});default:vt(e)}}function x4t(e){return{...e,typeReference:WPe(e.typeReference)}}function Vj5(e){switch(e.type){case"body":return I.V54.dynamic.Request.body(Wj5(e));case"inlined":return I.V54.dynamic.Request.inlined(Gj5(e));default:vt(e)}}function Wj5(e){return{pathParameters:e.pathParameters?.map(t=>x4t(t)),body:e.body!=null?D_E(e.body):void 0}}function Gj5(e){return{...e,pathParameters:e.pathParameters?.map(t=>x4t(t)),queryParameters:e.queryParameters?.map(t=>x4t(t)),headers:e.headers?.map(t=>x4t(t)),body:e.body!=null?Hj5(e.body):void 0}}function Hj5(e){switch(e.type){case"properties":return I.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>x4t(t)));case"referenced":return I.V54.dynamic.InlinedRequestBody.referenced(xj5(e));case"fileUpload":return I.V54.dynamic.InlinedRequestBody.fileUpload(Kj5(e));default:vt(e)}}function xj5(e){return{...e,bodyType:D_E(e.bodyType)}}function D_E(e){switch(e.type){case"bytes":return I.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return I.V54.dynamic.ReferencedRequestBodyType.typeReference(WPe(e.value));default:vt(e)}}function Kj5(e){return{properties:e.properties.map(t=>Jj5(t))}}function Jj5(e){switch(e.type){case"file":return I.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return I.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return I.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(x4t(e));default:vt(e)}}function $j5(e){return e.type==="container"&&e.container.type==="nullable"?I.V54.types.TypeReference.container(I.V54.types.ContainerType.optional(gh(e.container.nullable))):I.V54.types.TypeReference.container(I.V54.types.ContainerType.optional(gh(e)))}function Yj5(e){return e.type==="container"&&e.container.type==="optional"?gh(e):I.V54.types.TypeReference.container(I.V54.types.ContainerType.optional(gh(e)))}function Xj5(e){return e.type==="optional"?WPe(e):I.V54.dynamic.TypeReference.optional(WPe(e))}function Zj5(e){return e.type==="nullable"?I.V54.dynamic.TypeReference.optional(WPe(e.value)):I.V54.dynamic.TypeReference.optional(WPe(e))}var B_E={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:"0.0.2",[P.CSHARP_SDK]:"1.12.0-rc0",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:C,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:bn(e.services,t=>kj5(t))})};function kj5(e){return{...e,endpoints:e.endpoints.map(t=>e05(t))}}function e05(e){return{...e,pagination:t05(e.pagination)}}function t05(e){if(e!=null)switch(e.type){case"cursor":return I.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return I.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:vt(e)}}var I_E={laterVersion:"v57",earlierVersion:"v56",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.49.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.49.0",[P.TYPESCRIPT]:"0.49.0",[P.TYPESCRIPT_SDK]:"0.49.0",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.0",[P.JAVA_SDK]:"2.34.0",[P.JAVA_SPRING]:"1.6.0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.6.3",[P.PYTHON_PYDANTIC]:"1.4.8",[P.PYTHON_SDK]:"4.3.19",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:"0.23.6",[P.GO_MODEL]:"0.23.6",[P.GO_SDK]:"0.37.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"1.12.0-rc11",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:"0.14.1",[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V56.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?r05(e.dynamic):void 0})};function r05(e){return{...e,endpoints:i05(e.endpoints)}}function i05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,n05(r)]).filter(([t,r])=>r!=null))}function n05(e){return{...e,auth:e.auth!=null?u05(e.auth):void 0,examples:e.examples!=null?a05(e.examples):void 0}}function a05(e){return e.map(t=>o05(t)).filter(t=>t!=null)}function o05(e){return{...e,auth:e.auth!=null?s05(e.auth):void 0}}function u05(e){switch(e.type){case"basic":return I.V56.dynamic.Auth.basic(e);case"bearer":return I.V56.dynamic.Auth.bearer(e);case"header":return I.V56.dynamic.Auth.header(e);case"oauth":return;default:vt(e)}}function s05(e){switch(e.type){case"basic":return I.V56.dynamic.AuthValues.basic(e);case"bearer":return I.V56.dynamic.AuthValues.bearer(e);case"header":return I.V56.dynamic.AuthValues.header(e);case"oauth":return;default:vt(e)}}var q_E={laterVersion:"v58",earlierVersion:"v57",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"1.2.0",[P.TYPESCRIPT_BROWSER_SDK]:"1.2.0",[P.TYPESCRIPT]:"1.2.0",[P.TYPESCRIPT_SDK]:"1.2.0",[P.TYPESCRIPT_EXPRESS]:"0.18.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:"2.36.5",[P.JAVA_SPRING]:"1.6.1",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.7.0",[P.PYTHON_PYDANTIC]:"1.5.0",[P.PYTHON_SDK]:"4.21.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:"1.1.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"1.17.5",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:"0.1.0",[P.PHP_MODEL]:C,[P.PHP_SDK]:"1.15.1",[P.RUST_MODEL]:C,[P.RUST_SDK]:"0.0.0"},jsonifyEarlierVersion:e=>Wn.V57.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,publishConfig:e.publishConfig!=null?v05(e.publishConfig):void 0,services:c05(e.services),dynamic:e.dynamic!=null?p05(e.dynamic):void 0})};function c05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,l05(r)]))}function l05(e){return{...e,endpoints:f05(e.endpoints)}}function f05(e){return e.map(d05).filter(t=>t!=null)}function d05(e){if(e.method!=="HEAD")return{...e,method:e.method}}function p05(e){return{...e,endpoints:_05(e.endpoints)}}function _05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,h05(r)]).filter(([t,r])=>r!=null))}function h05(e){let t=e.location.method;if(t!=="HEAD")return{...e,examples:e.examples!=null?y05(e.examples):void 0,location:{...e.location,method:t}}}function y05(e){return e.map(t=>b05(t)).filter(t=>t!=null)}function b05(e){let t=e.endpoint.method;if(t!=="HEAD")return{...e,endpoint:{...e.endpoint,method:t}}}function v05(e){switch(e.type){case"github":{let t=C_E(e.target);return t==null?void 0:I.V57.publish.PublishingConfig.github({...e,target:t})}case"direct":{let t=C_E(e.target);return t==null?void 0:I.V57.publish.PublishingConfig.direct({target:t})}case"filesystem":return;default:vt(e)}}function C_E(e){switch(e.type){case"postman":return I.V57.publish.PublishTarget.postman(e);case"npm":return I.V57.publish.PublishTarget.npm(e);case"maven":return I.V57.publish.PublishTarget.maven(e);case"pypi":return;default:vt(e)}}var T_E={laterVersion:"v59",earlierVersion:"v58",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"2.6.8",[P.TYPESCRIPT_BROWSER_SDK]:"2.6.8",[P.TYPESCRIPT]:"2.6.8",[P.TYPESCRIPT_SDK]:"2.6.8",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.1",[P.JAVA_SDK]:"2.43.0",[P.JAVA_SPRING]:"1.8.2",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.8.0",[P.PYTHON_PYDANTIC]:"1.6.0",[P.PYTHON_SDK]:"4.26.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:"0.23.7",[P.GO_MODEL]:"0.23.7",[P.GO_SDK]:"1.7.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:"1.0.0-rc26",[P.CSHARP_MODEL]:"0.0.3",[P.CSHARP_SDK]:"2.2.0",[P.SWIFT_MODEL]:"0.0.1",[P.SWIFT_SDK]:"0.16.0",[P.PHP_MODEL]:C,[P.PHP_SDK]:"1.17.0",[P.RUST_MODEL]:C,[P.RUST_SDK]:"0.1.1"},jsonifyEarlierVersion:e=>Wn.V58.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?O05(e.dynamic):void 0,auth:e.auth!=null?g05(e.auth):void 0})};function g05(e){return{...e,schemes:e.schemes.filter(t=>t.type!=="inferred")}}function O05(e){return{...e,endpoints:A05(e.endpoints)}}function A05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,m05(r)]).filter(([t,r])=>r!=null))}function m05(e){return{...e,examples:e.examples!=null?j05(e.examples):void 0,auth:P05(e.auth)}}function P05(e){return e==null?e:e._visit({basic:t=>I.V58.dynamic.Auth.basic(t),bearer:t=>I.V58.dynamic.Auth.bearer(t),header:t=>I.V58.dynamic.Auth.header(t),oauth:t=>I.V58.dynamic.Auth.oauth(t),inferred:()=>{},_other:()=>{}})}function j05(e){return e.map(t=>w05(t)).filter(t=>t!=null)}function w05(e){return{...e,auth:E05(e.auth)}}function E05(e){if(e==null)return e;if(e.type!=="inferred")return e}var R_E={laterVersion:"v60",earlierVersion:"v59",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"2.11.2",[P.TYPESCRIPT_BROWSER_SDK]:"2.11.2",[P.TYPESCRIPT]:"2.11.2",[P.TYPESCRIPT_SDK]:"2.11.2",[P.TYPESCRIPT_EXPRESS]:"0.18.6",[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.2",[P.JAVA_SDK]:"3.5.10",[P.JAVA_SPRING]:"1.8.3",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.9.0",[P.PYTHON_PYDANTIC]:"1.7.0",[P.PYTHON_SDK]:"4.30.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:"0.23.8",[P.GO_MODEL]:"0.23.8",[P.GO_SDK]:"1.12.4",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:C,[P.PHP_MODEL]:C,[P.PHP_SDK]:C,[P.RUST_MODEL]:C,[P.RUST_SDK]:C},jsonifyEarlierVersion:e=>Wn.V59.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:D05(e.services),auth:S05(e.auth)})};function S05(e){return{...e,schemes:M05(e.schemes)}}function M05(e){return e.map(t=>{switch(t.type){case"bearer":return I.V59.AuthScheme.bearer({...t});case"basic":return I.V59.AuthScheme.basic({...t});case"header":return I.V59.AuthScheme.header({...t});case"oauth":switch(t.configuration.type){case"clientCredentials":return I.V59.AuthScheme.oauth({...t,configuration:I.V59.OAuthConfiguration.clientCredentials({...t.configuration,refreshEndpoint:t.configuration.refreshEndpoint?{...t.configuration.refreshEndpoint,responseProperties:{accessToken:nxn(t.configuration.refreshEndpoint.responseProperties.accessToken),expiresIn:Cza(t.configuration.refreshEndpoint.responseProperties.expiresIn),refreshToken:Cza(t.configuration.refreshEndpoint.responseProperties.refreshToken)},requestProperties:{refreshToken:qza(t.configuration.refreshEndpoint.requestProperties.refreshToken)}}:void 0,tokenEndpoint:{...t.configuration.tokenEndpoint,responseProperties:{accessToken:nxn(t.configuration.tokenEndpoint.responseProperties.accessToken),expiresIn:Cza(t.configuration.tokenEndpoint.responseProperties.expiresIn),refreshToken:Cza(t.configuration.tokenEndpoint.responseProperties.refreshToken)},requestProperties:{clientId:qza(t.configuration.tokenEndpoint.requestProperties.clientId),clientSecret:qza(t.configuration.tokenEndpoint.requestProperties.clientSecret),scopes:Eop(t.configuration.tokenEndpoint.requestProperties.scopes),customProperties:t.configuration.tokenEndpoint.requestProperties.customProperties?.map(qza)}}})});default:vt(t.configuration.type)}break;case"inferred":return I.V59.AuthScheme.inferred({...t,tokenEndpoint:{...t.tokenEndpoint,expiryProperty:Cza(t.tokenEndpoint.expiryProperty),authenticatedRequestHeaders:t.tokenEndpoint.authenticatedRequestHeaders.map(r=>({...r,responseProperty:nxn(r.responseProperty)}))}});default:vt(t)}})}function D05(e){return Object.entries(e).reduce((t,[r,i])=>(t[r]={...i,endpoints:B05(i.endpoints)},t),{})}function B05(e){return e.map(t=>({...t,pagination:I05(t.pagination),sdkRequest:C05(t.sdkRequest)}))}function I05(e){if(!e)return e;switch(e.type){case"cursor":return I.V59.Pagination.cursor({next:nxn(e.next),results:nxn(e.results),page:qza(e.page)});case"offset":return I.V59.Pagination.offset({hasNextPage:Cza(e.hasNextPage),results:nxn(e.results),page:qza(e.page),step:Eop(e.step)});case"custom":return I.V59.Pagination.custom({results:nxn(e.results)});default:vt(e)}}function Eop(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function qza(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function Cza(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function nxn(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function C05(e){return e&&{...e,streamParameter:Eop(e.streamParameter)}}var z_E={laterVersion:"v61",earlierVersion:"v60",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"3.7.2",[P.TYPESCRIPT_BROWSER_SDK]:"3.7.2",[P.TYPESCRIPT]:"3.7.2",[P.TYPESCRIPT_SDK]:"3.7.2",[P.TYPESCRIPT_EXPRESS]:"3.7.2",[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.3",[P.JAVA_SDK]:"3.9.0",[P.JAVA_SPRING]:"1.8.4",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.10.3",[P.PYTHON_PYDANTIC]:"1.8.2",[P.PYTHON_SDK]:"4.33.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:"0.23.9",[P.GO_SDK]:"1.14.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:"1.0.0-rc34",[P.CSHARP_MODEL]:"0.0.4",[P.CSHARP_SDK]:"2.4.0",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:"0.22.0",[P.PHP_MODEL]:C,[P.PHP_SDK]:"1.18.0",[P.RUST_MODEL]:C,[P.RUST_SDK]:"0.7.2"},jsonifyEarlierVersion:e=>Wn.V60.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",skipValidation:!0}),migrateBackwards:e=>{let{apiPlayground:t,...r}=e;return{...r,errors:Object.fromEntries(Object.entries(e.errors).map(([i,n])=>[i,q05(n)])),dynamic:e.dynamic!=null?N05(e.dynamic):void 0,publishConfig:e.publishConfig!=null?z05(e.publishConfig):void 0,services:Object.fromEntries(Object.entries(e.services).map(([i,n])=>[i,T05(n)]))}}};function q05(e){let{isWildcardStatusCode:t,...r}=e;return r}function T05(e){return{...e,endpoints:e.endpoints.map(R05)}}function R05(e){let{apiPlayground:t,...r}=e;return r}function z05(e){return I.V61.PublishingConfig._visit(e,{github:t=>{let r=Sop(t.target);return r!=null?I.V60.PublishingConfig.github({...t,target:r}):void 0},direct:t=>{let r=Sop(t.target);return r!=null?I.V60.PublishingConfig.direct({target:r}):void 0},filesystem:t=>{let r=t.publishTarget!=null?Sop(t.publishTarget):void 0;return I.V60.PublishingConfig.filesystem({generateFullProject:t.generateFullProject,publishTarget:r})},_other:()=>{}})}function Sop(e){return I.V61.PublishTarget._visit(e,{postman:I.V60.PublishTarget.postman,npm:I.V60.PublishTarget.npm,maven:I.V60.PublishTarget.maven,pypi:I.V60.PublishTarget.pypi,crates:t=>I.V60.PublishTarget.pypi({version:t.version,packageName:t.packageName}),_other:()=>{}})}function N05(e){return{...e,endpoints:L05(e.endpoints),generatorConfig:e.generatorConfig!=null?F05(e.generatorConfig):void 0}}function F05(e){return{...e,outputConfig:Q05(e.outputConfig)}}function Q05(e){return I.V61.dynamic.GeneratorOutputConfig._visit(e,{publish:t=>{let r=U05(t);return r!=null?I.V60.dynamic.GeneratorOutputConfig.publish(r):I.V60.dynamic.GeneratorOutputConfig.local()},local:I.V60.dynamic.GeneratorOutputConfig.local,_other:I.V60.dynamic.GeneratorOutputConfig.local})}function U05(e){return I.V61.dynamic.PublishInfo._visit(e,{go:I.V60.dynamic.PublishInfo.go,swift:()=>{},maven:I.V60.dynamic.PublishInfo.maven,npm:I.V60.dynamic.PublishInfo.npm,nuget:I.V60.dynamic.PublishInfo.nuget,pypi:I.V60.dynamic.PublishInfo.pypi,rubygems:I.V60.dynamic.PublishInfo.rubygems,crates:()=>{},_other:()=>{}})}function L05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,V05(r)]).filter(([t,r])=>r!=null))}function V05(e){return{...e,response:W05(e.response)}}function W05(e){return I.V61.dynamic.Response._visit(e,{json:I.V60.dynamic.Response.json,streaming:I.V60.dynamic.Response.json,streamParameter:I.V60.dynamic.Response.json,fileDownload:I.V60.dynamic.Response.json,text:I.V60.dynamic.Response.json,bytes:I.V60.dynamic.Response.json,_other:I.V60.dynamic.Response.json})}var N_E={laterVersion:"v62",earlierVersion:"v61",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"2.0.1",[P.PYTHON_PYDANTIC]:"1.11.2",[P.PYTHON_SDK]:"4.46.5",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:C,[P.PHP_MODEL]:"0.0.2",[P.PHP_SDK]:"1.22.0",[P.RUST_MODEL]:C,[P.RUST_SDK]:C},jsonifyEarlierVersion:e=>Wn.V61.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",skipValidation:!0}),migrateBackwards:e=>({...e,errors:G05(e.errors)})};function G05(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>r.isWildcardStatusCode!==!0))}var F_E={laterVersion:"v63",earlierVersion:"v62",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"3.43.0",[P.TYPESCRIPT_BROWSER_SDK]:"3.43.0",[P.TYPESCRIPT]:"3.43.0",[P.TYPESCRIPT_SDK]:"3.43.0",[P.TYPESCRIPT_EXPRESS]:"3.43.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.PYTHON_SDK]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:C,[P.PHP_MODEL]:C,[P.PHP_SDK]:C,[P.RUST_MODEL]:C,[P.RUST_SDK]:C},jsonifyEarlierVersion:e=>Wn.V62.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",skipValidation:!0}),migrateBackwards:e=>({...e,auth:H05(e.auth)})};function H05(e){return{...e,requirement:I.V63.AuthSchemesRequirement._visit(e.requirement,{all:()=>I.V62.AuthSchemesRequirement.All,any:()=>I.V62.AuthSchemesRequirement.Any,endpointSecurity:()=>I.V62.AuthSchemesRequirement.All,_other:()=>I.V62.AuthSchemesRequirement.All})}}function zDo(){return K05}var fKs=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new Mop([...this.migrations,t])}},Mop=class extends fKs{build(){return new Dop(this.migrations)}},Dop=class{migrations;constructor(t){this.migrations=t}migrateForGenerator({intermediateRepresentation:t,context:r,targetGenerator:i}){return this.migrate({intermediateRepresentation:t,shouldMigrate:n=>this.shouldRunMigration({migration:n,targetGenerator:i}),context:r,targetGenerator:i})}migrateThroughMigration({migration:t,intermediateRepresentation:r,context:i,targetGenerator:n}){return this.migrateThroughVersion({version:t.earlierVersion,intermediateRepresentation:r,context:i,targetGenerator:n})}migrateThroughVersion({version:t,intermediateRepresentation:r,context:i,targetGenerator:n}){let a=!1;if(this.migrations[0]?.laterVersion===t)return{ir:r,jsonify:()=>Promise.resolve().then(()=>Vn.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let c=this.migrate({intermediateRepresentation:r,shouldMigrate:d=>{let s=d.earlierVersion===t;return a||=s,s||!a},context:i,targetGenerator:n});return a||i.failAndThrow(`IR ${t} does not exist`),c}migrate({intermediateRepresentation:t,shouldMigrate:r,context:i,targetGenerator:n}){let a=t,o=async()=>Vn.IntermediateRepresentation.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"});for(let c of this.migrations){if(!r(c))break;i.logger.debug(`Migrating IR from ${c.laterVersion} to ${c.earlierVersion}`),a=c.migrateBackwards(a,{taskContext:i,targetGenerator:n}),o=()=>Promise.resolve().then(()=>c.jsonifyEarlierVersion(a))}return{ir:a,jsonify:o}}shouldRunMigration({migration:t,targetGenerator:r}){let i=t.firstGeneratorVersionToConsumeNewIR[r.name];if(i==null)throw new Error(`Cannot migrate intermediate representation. Unrecognized generator: ${r.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`);switch(i){case C:return!0;case k:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return S$(i,r.version)}getIRVersionForGenerator({targetGenerator:t}){let r=this.migrations[0]?.laterVersion;for(let i of this.migrations)if(this.shouldRunMigration({migration:i,targetGenerator:t}))r=i.earlierVersion;else break;return r}},x05={Builder:new fKs([])},K05=x05.Builder.withMigration(F_E).withMigration(N_E).withMigration(z_E).withMigration(R_E).withMigration(T_E).withMigration(q_E).withMigration(I_E).withMigration(B_E).withMigration(O_E).withMigration(b_E).withMigration(u_E).withMigration($pE).withMigration(VpE).withMigration(zpE).withMigration(RpE).withMigration(qpE).withMigration(CpE).withMigration(DpE).withMigration(EpE).withMigration(wpE).withMigration(PpE).withMigration(mpE).withMigration(ApE).withMigration(OpE).withMigration(gpE).withMigration(vpE).withMigration(bpE).withMigration(ypE).withMigration(hpE).withMigration(_pE).withMigration(ppE).withMigration(fpE).withMigration(cpE).withMigration(spE).withMigration(upE).withMigration(epE).withMigration(kdE).withMigration(ZdE).withMigration(YdE).withMigration($dE).withMigration(q5P).withMigration(B5P).withMigration(D5P).withMigration(E5P).withMigration(j5P).withMigration(m5P).withMigration(A5P).withMigration(O5P).withMigration(b5P).withMigration(_5P).withMigration(p5P).withMigration(d5P).withMigration(l5P).withMigration(c5P).withMigration(s5P).withMigration(n5P).withMigration(t5P).withMigration(e5P).withMigration(kWP).withMigration(QWP).withMigration(zWP).withMigration(SHh).build();function NDo({intermediateRepresentation:e,context:t,targetGenerator:r}){return zDo().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function Bop({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:i}){return zDo().migrateThroughVersion({version:i,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function FDo({intermediateRepresentation:e,context:t,version:r}){return zDo().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function Q_E({workspace:e,audiences:t,generatorInvocation:r,context:i,irVersionOverride:n,version:a,packageName:o,sourceConfig:c,includeOptionalRequestPropertyExamples:d,ir:s}){let u=s??eS({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:d,disabled:r.disableExamples},readme:r.readme,version:a,packageName:o,context:i,sourceResolver:new kE(i,e),generationMetadata:{cliVersion:e.cliVersion,generatorName:r.name,generatorVersion:r.version,generatorConfig:r.config}});c!=null&&(u.sourceConfig=c),u.generationMetadata={cliVersion:e.cliVersion,generatorName:r.name,generatorVersion:r.version,generatorConfig:r.config},i.logger.debug("Generated IR");let f=await jpn(r).then(h=>h==null?void 0:"v"+h.toString()),p=n??f,_=p!=null?await FDo({intermediateRepresentation:u,context:i,version:p}):await NDo({intermediateRepresentation:u,context:i,targetGenerator:{name:r.name,version:r.version}});return{latest:u,migrated:_}}var V_E=require("@boundaryml/baml");var nRi=require("@boundaryml/baml");var Iop=require("@boundaryml/baml"),dKs=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}async AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return await this.runtime.buildRequest("AnalyzeSdkDiff",{diff:t},this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,!1,n)}catch(i){throw(0,Iop.toBamlError)(i)}}},pKs=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}async AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return await this.runtime.buildRequest("AnalyzeSdkDiff",{diff:t},this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,!0,n)}catch(i){throw(0,Iop.toBamlError)(i)}}};var Cop=require("@boundaryml/baml"),_Ks=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return this.runtime.parseLlmResponse("AnalyzeSdkDiff",t,!1,this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,n)}catch(i){throw(0,Cop.toBamlError)(i)}}},hKs=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return this.runtime.parseLlmResponse("AnalyzeSdkDiff",t,!0,this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,n)}catch(i){throw(0,Cop.toBamlError)(i)}}};var yKs=require("@boundaryml/baml");var J05={"diff_analyzer.baml":`// SDK Diff Analyzer
1883
+ ${p}`)}async function GEB(e,t){await Nb(void 0,t??"docker",["pull",e],{all:!0,doNotPipeOutput:!0})}var q$i=ce(require("path"),1),Wvn="/fern",pXc="output",_Xc="config.json",hXc="ir.json",HEB="snippet.json",xEB="snippet-templates.json",KEB="generators",JEB="sources",$EB=q$i.default.join(Wvn,pXc),YEB=q$i.default.join(Wvn,_Xc),XEB=q$i.default.join(Wvn,hXc),ZEB=q$i.default.join(Wvn,HEB),kEB=q$i.default.join(Wvn,xEB),OP7=q$i.default.join(Wvn,KEB),eSB=q$i.default.join(Wvn,JEB);var ZPu=$EB,LJa=YEB,kPu=XEB,eju=ZEB,tju=kEB;var K3h=eSB,rju="9229";var VJa=class{containerImage;keepContainer;runner;constructor({containerImage:t,keepContainer:r,runner:i,dockerImage:n,keepDocker:a}){this.containerImage=t??n??"",this.keepContainer=r??a??!1,this.runner=i}async execute({generatorName:t,irPath:r,configPath:i,outputPath:n,snippetPath:a,snippetTemplatePath:o,licenseFilePath:c,context:d,inspect:s,runner:u}){d.logger.info(`Executing generator ${t} using container image: ${this.containerImage}`);let f=[`${i}:${LJa}:ro`,`${r}:${kPu}:ro`,`${n}:${ZPu}`];a&&f.push(`${a}:${eju}`),o&&f.push(`${o}:${tju}`),c&&f.push(`${c}:/tmp/LICENSE:ro`);let p={},_={};s&&(p.NODE_OPTIONS=`--inspect-brk=0.0.0.0:${rju}`,_[rju]=rju),await dXc({logger:d.logger,imageName:this.containerImage,args:[LJa],binds:f,envVars:p,ports:_,removeAfterCompletion:!this.keepContainer,runner:this.runner??u})}};var J_E=ce(Wi(),1),axn=require("fs/promises"),zza=ce(require("path"),1),Rza=require("path"),$_E=ce(Z9(),1);var jHh=ce(_d(),1),cL=ce(AHh(),1),OY=ce(Bj(),1),wHh=ce(require("path"),1),STB="0.0.1";function FZc(e){if(e.raw?.github!=null&&typeof e.raw.github=="object"&&"license"in e.raw.github){let t=e.raw.github;if(t.license!=null){if(typeof t.license=="string")return{type:"basic",value:t.license};if(typeof t.license=="object"&&"custom"in t.license)return{type:"custom",value:t.license.custom}}}if(e.raw?.metadata?.license!=null){let t=e.raw.metadata.license;if(typeof t=="string")return{type:"basic",value:t};if(typeof t=="object"&&"custom"in t)return{type:"custom",value:t.custom}}}function MTB(e,t){let r=FZc(e);if(r!=null){if(r.type==="basic"){if(r.value==="MIT"||r.value==="Apache-2.0")return cL.FernGeneratorExec.LicenseConfig.basic({id:r.value==="MIT"?cL.FernGeneratorExec.LicenseId.Mit:cL.FernGeneratorExec.LicenseId.Apache2})}else if(r.type==="custom")return cL.FernGeneratorExec.LicenseConfig.custom({filename:wHh.basename(r.value)})}}function mHh(e){return e!=null?jHh.GithubPublishInfo._visit(e,{npm:t=>{let r=(t.token??"").trim(),i=r==="<USE_OIDC>"||r==="OIDC",n=r!=="";return cL.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,OY.EnvironmentVariable)(i?"<USE_OIDC>":r.startsWith("${")&&r.endsWith("}")?r.slice(2,-1).trim():""),shouldGeneratePublishWorkflow:i||n})},maven:t=>cL.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:t.registryUrl,coordinate:t.coordinate,usernameEnvironmentVariable:(0,OY.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,OY.EnvironmentVariable)(t.credentials?.password??""),signature:t.signature!=null?{keyIdEnvironmentVariable:(0,OY.EnvironmentVariable)(t.signature.keyId??""),passwordEnvironmentVariable:(0,OY.EnvironmentVariable)(t.signature.password??""),secretKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.signature.secretKey??"")}:void 0}),pypi:t=>cL.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:t.registryUrl,packageName:t.packageName,usernameEnvironmentVariable:(0,OY.EnvironmentVariable)("PYPI_USERNAME"),passwordEnvironmentVariable:(0,OY.EnvironmentVariable)("PYPI_PASSWORD"),pypiMetadata:t.pypiMetadata}),rubygems:t=>cL.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.apiKey??"")}),postman:t=>cL.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.apiKey??""),workspaceIdEnvironmentVariable:(0,OY.EnvironmentVariable)(t.workspaceId??"")}),nuget:t=>cL.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,OY.EnvironmentVariable)(t.apiKey??"")}),crates:t=>cL.FernGeneratorExec.GithubPublishInfo.crates({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,OY.EnvironmentVariable)(t.token??"")}),_other:()=>{}}):void 0}function EHh({generatorInvocation:e,customConfig:t,workspaceName:r,organization:i,outputVersion:n=STB,absolutePathToSnippet:a,absolutePathToSnippetTemplates:o,absolutePathToFernConfig:c,writeUnitTests:d,generateOauthClients:s,generatePaginatedClients:u,whiteLabel:f,paths:p}){let _=MTB(e,c),{snippetPath:h,snippetTemplatePath:y,irPath:b,outputDirectory:v}=p,O=e.outputMode._visit({publish:A=>({...PHh(n,A,e,p),snippetFilepath:h,publishingMetadata:e.publishMetadata}),publishV2:A=>({...PHh(n,A,e,p),snippetFilepath:h,publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:cL.FernGeneratorExec.OutputMode.downloadFiles(),path:v,snippetFilepath:h,publishingMetadata:e.publishMetadata}),github:A=>{let g={mode:cL.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${A.owner}/${A.repo}`,version:n,publishInfo:mHh(A.publishInfo),installationToken:void 0}),path:v,publishingMetadata:e.publishMetadata};return a!==void 0&&(g.snippetFilepath=h),o!==void 0&&(g.snippetTemplateFilepath=y),g},githubV2:A=>{let g=A._visit({commitAndRelease:j=>`https://github.com/${j.owner}/${j.repo}`,push:j=>`https://github.com/${j.owner}/${j.repo}`,pullRequest:j=>`https://github.com/${j.owner}/${j.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),m={mode:cL.FernGeneratorExec.OutputMode.github({repoUrl:g,version:n,publishInfo:mHh(A.publishInfo)}),path:v,publishingMetadata:e.publishMetadata};return a!==void 0&&(m.snippetFilepath=h),o!==void 0&&(m.snippetTemplateFilepath=y),m},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{irFilepath:b,output:O,publish:void 0,customConfig:t,workspaceName:r,organization:i,environment:cL.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:f??!1,writeUnitTests:d,generateOauthClients:s,generatePaginatedClients:u,license:_}}function PHh(e,t,r,i){let{outputDirectory:n}=i,a;"registryOverrides"in t?a=t.registryOverrides.maven??t.registryOverrides.npm:a!=null&&(a=t._visit({mavenOverride:c=>c,npmOverride:c=>c,pypiOverride:c=>c,rubyGemsOverride:c=>c,postman:c=>c,nugetOverride:c=>c,cratesOverride:c=>c,_other:()=>{}}));let o="";return r.raw?.github!=null&&(w3a(r.raw.github)?o=`https://github.com/${r.raw.github.uri}`:o=r.raw?.github.repository),{mode:cL.FernGeneratorExec.OutputMode.github({repoUrl:o,version:e}),path:n}}var C=Symbol(),k=Symbol();var SHh={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.246",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types,services:e.services,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,errors:e.errors.map(t=>({name:t.name,docs:t.docs,discriminantValue:{originalValue:t.discriminantValueV4.name.unsafeName.originalValue,camelCase:t.discriminantValueV4.name.unsafeName.camelCase,pascalCase:t.discriminantValueV4.name.unsafeName.pascalCase,snakeCase:t.discriminantValueV4.name.unsafeName.snakeCase,screamingSnakeCase:t.discriminantValueV4.name.unsafeName.screamingSnakeCase,wireValue:t.discriminantValueV4.wireValue},discriminantValueV2:t.discriminantValueV2,discriminantValueV3:t.discriminantValueV3,discriminantValueV4:t.discriminantValueV4,type:t.type,typeV2:t.typeV2,typeV3:t.typeV3,http:t.http,statusCode:t.statusCode}))})};var I={};Zt(I,{V1:()=>JcU,V10:()=>ilU,V11:()=>nlU,V12:()=>alU,V13:()=>olU,V14:()=>ulU,V15:()=>slU,V16:()=>clU,V17:()=>llU,V18:()=>flU,V19:()=>dlU,V2:()=>$cU,V20:()=>plU,V21:()=>_lU,V22:()=>hlU,V23:()=>J8P.FernIrV23,V24:()=>$8P.FernIrV24,V25:()=>Y8P.FernIrV25,V26:()=>X8P.FernIrV26,V27:()=>Z8P.FernIrV27,V28:()=>k8P.FernIrV28,V29:()=>eWP.FernIrV29,V3:()=>YcU,V30:()=>tWP.FernIrV30,V31:()=>rWP.FernIrV31,V32:()=>iWP.FernIrV32,V33:()=>nWP.FernIrV33,V34:()=>aWP.FernIrV34,V35:()=>oWP.FernIrV35,V36:()=>uWP.FernIrV36,V37:()=>sWP.FernIrV37,V38:()=>cWP.FernIrV38,V39:()=>lWP.FernIrV39,V4:()=>XcU,V40:()=>fWP.FernIrV40,V41:()=>dWP.FernIrV41,V42:()=>pWP.FernIrV42,V43:()=>_WP.FernIrV43,V44:()=>hWP.FernIrV44,V45:()=>yWP.FernIrV45,V46:()=>bWP.FernIrV46,V47:()=>vWP.FernIrV47,V48:()=>gWP.FernIrV48,V49:()=>OWP.FernIrV49,V5:()=>ZcU,V50:()=>AWP.FernIrV50,V51:()=>mWP.FernIrV51,V52:()=>PWP.FernIrV52,V53:()=>jWP.FernIrV53,V54:()=>wWP.FernIrV54,V55:()=>EWP.FernIrV55,V56:()=>SWP.FernIrV56,V57:()=>MWP.FernIrV57,V58:()=>DWP.FernIrV58,V59:()=>BWP.FernIrV59,V6:()=>kcU,V60:()=>IWP.FernIrV60,V61:()=>CWP.FernIrV61,V62:()=>qWP.FernIrV62,V63:()=>gr,V7:()=>elU,V8:()=>tlU,V9:()=>rlU});var JcU=ce(mYh(),1),$cU=ce(bty(),1),YcU=ce(usy(),1),XcU=ce(ahy(),1),ZcU=ce(GOy(),1),kcU=ce(Zwy(),1),elU=ce(oCy(),1),tlU=ce(_Ny(),1),rlU=ce(UVy(),1),ilU=ce(uGy(),1),nlU=ce(I$y(),1),alU=ce(Mtb(),1),olU=ce(wsb(),1),ulU=ce(mhb(),1),slU=ce(gmb(),1),clU=ce(IMb(),1),llU=ce(WTb(),1),flU=ce(tLb(),1),dlU=ce(y9b(),1),plU=ce(x$b(),1),_lU=ce(wrv(),1),hlU=ce(nlv(),1),J8P=ce(P_v(),1),$8P=ce(ogv(),1),Y8P=ce(KPv(),1),X8P=ce(FSv(),1),Z8P=ce(qCv(),1),k8P=ce(Dzv(),1),eWP=ce(w4v(),1),tWP=ce(SWv(),1),rWP=ce(DHv(),1),iWP=ce(U$v(),1),nWP=ce(XPl(),1),aWP=ce(cog(),1),oWP=ce(ndg(),1),uWP=ce(kbg(),1),sWP=ce(YPg(),1),cWP=ce(YMg(),1),lWP=ce(pTg(),1),fWP=ce(BUg(),1),dWP=ce($Wg(),1),pWP=ce(vxg(),1),_WP=ce(WZg(),1),hWP=ce(hnO(),1),yWP=ce(rfO(),1),bWP=ce($bO(),1),vWP=ce(xjO(),1),gWP=ce(WBO(),1),OWP=ce(WzO(),1),AWP=ce(ZVO(),1),mWP=ce(bHO(),1),PWP=ce(LXO(),1),jWP=ce(hsA(),1),wWP=ce(XgA(),1),EWP=ce(QBA(),1),SWP=ce(M4A(),1),MWP=ce(bem(),1),DWP=ce(EAm(),1),BWP=ce($Um(),1),IWP=ce(CtP(),1),CWP=ce(UjP(),1),qWP=ce(K8P(),1);function TWP({inlinedRequest:e,allTypes:t}){let r=new Set,i=t.reduce((n,a)=>({...n,[Qmf(a.name)]:a}),{});for(let n of e.extends)RWP({typeName:n,typeNameToDeclaration:i,referencedTypes:r});for(let n of e.properties)nva({reference:n.valueType,typeNameToDeclaration:i,referencedTypes:r});return[...r].reduce((n,a)=>{let o=i[a];if(o==null)throw new Error("Cannot find declaration for ID: "+a);return[...n,o.name]},[])}function nva({reference:e,typeNameToDeclaration:t,referencedTypes:r}){I.V2.types.TypeReference._visit(e,{primitive:Bt,container:i=>{ylU({container:i,typeNameToDeclaration:t,referencedTypes:r})},named:i=>{RWP({typeName:i,typeNameToDeclaration:t,referencedTypes:r})},unknown:Bt,void:Bt,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function ylU({container:e,typeNameToDeclaration:t,referencedTypes:r}){I.V2.types.ContainerType._visit(e,{list:i=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r})},set:i=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r})},optional:i=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:i,valueType:n})=>{nva({reference:i,typeNameToDeclaration:t,referencedTypes:r}),nva({reference:n,typeNameToDeclaration:t,referencedTypes:r})},literal:Bt,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function RWP({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let i=Qmf(e);r.add(i);let n=t[i];if(n==null)throw new Error("Cannot locate type: "+i);for(let a of n.referencedTypes)r.add(Qmf(a))}function Qmf(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var zWP={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.249",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:"0.0.134-3-g97d4964",[P.JAVA_SDK]:"0.0.134-3-g97d4964",[P.JAVA_SPRING]:"0.0.134-3-g97d4964",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=[...e.types];return{apiName:e.apiName,auth:e.auth,headers:e.headers,types:t,errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{websocket:e.services.websocket,http:e.services.http.map(r=>({availability:r.availability,docs:r.docs,name:r.name,basePath:r.basePath,basePathV2:r.basePathV2,headers:r.headers,pathParameters:r.pathParameters,endpoints:r.endpoints.map(i=>blU(r,i,e.types,n=>{t.push(n)}))}))}}}};function blU(e,t,r,i){return{docs:t.docs,availability:t.availability,id:t.id,name:t.name,nameV2:t.nameV2,method:t.method,headers:t.headers,path:t.path,pathParameters:t.pathParameters,queryParameters:t.queryParameters,request:vlU(t,e,r,i),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function vlU(e,t,r,i){let n=e.requestBody;return n==null?{docs:void 0,type:I.V2.types.TypeReference.void(),typeV2:void 0}:I.V3.services.http.HttpRequestBody._visit(n,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let o={fernFilepath:t.name.fernFilepath,fernFilepathV2:t.name.fernFilepathV2,name:a.name.unsafeName.originalValue,nameV2:{originalValue:a.name.unsafeName.originalValue,camelCase:a.name.unsafeName.camelCase,pascalCase:a.name.unsafeName.pascalCase,snakeCase:a.name.unsafeName.snakeCase,screamingSnakeCase:a.name.unsafeName.screamingSnakeCase},nameV3:a.name},c=I.V2.types.Type.object({extends:a.extends,properties:a.properties.map(s=>({availability:e.availability,docs:s.docs,name:{originalValue:s.name.name.unsafeName.originalValue,camelCase:s.name.name.unsafeName.camelCase,pascalCase:s.name.name.unsafeName.pascalCase,snakeCase:s.name.name.unsafeName.snakeCase,screamingSnakeCase:s.name.name.unsafeName.screamingSnakeCase,wireValue:s.name.wireValue},nameV2:s.name,valueType:s.valueType}))});i({docs:void 0,availability:e.availability,name:o,shape:c,referencedTypes:TWP({inlinedRequest:a,allTypes:r}),examples:[]});let d=I.V2.types.TypeReference.named(o);return{docs:void 0,type:d,typeV2:d}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+n.type)}})}var QWP={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:"0.0.11-4-g1c29f6c",[P.POSTMAN]:"0.0.32-rc0",[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types.map(t=>({docs:t.docs,availability:t.availability,name:t.name,shape:t.shape,examples:t.examples.map(r=>UWP(r.shape)),referencedTypes:t.referencedTypes})),errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{...e.services,http:e.services.http.map(t=>({...t,endpoints:t.endpoints.map(r=>({...r,examples:r.examples.map(i=>PlU(i))}))}))}})};function UWP(e){return I.V4.types.ExampleTypeShape._visit(e,{object:t=>I.V3.types.ExampleType.object(glU(t)),union:t=>I.V3.types.ExampleType.union(AlU(t)),alias:t=>I.V3.types.ExampleType.alias(mlU(t)),enum:I.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function glU(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:Sx(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function Sx(e){return I.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:I.V3.types.ExampleTypeReference.primitive,container:t=>I.V3.types.ExampleTypeReference.container(OlU(t)),named:t=>I.V3.types.ExampleTypeReference.named(LWP(t)),unknown:I.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function OlU(e){return I.V4.types.ExampleContainer._visit(e,{list:t=>I.V3.types.ExampleContainer.list(t.map(Sx)),set:t=>I.V3.types.ExampleContainer.set(t.map(Sx)),optional:t=>I.V3.types.ExampleContainer.optional(t!=null?Sx(t):void 0),map:t=>I.V3.types.ExampleContainer.map(t.map(r=>({key:Sx(r.key),value:Sx(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function LWP(e){return{typeName:e.typeName,shape:UWP(e.shape)}}function AlU(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:I.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>I.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(LWP(t)),singleProperty:t=>I.V3.types.ExampleSingleUnionTypeProperties.singleProperty(Sx(t)),noProperties:()=>I.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function mlU(e){return{value:Sx(e.value)}}function PlU(e){return{servicePathParameters:e.servicePathParameters.map(t=>NWP(t)),endpointPathParameters:e.servicePathParameters.map(t=>NWP(t)),serviceHeaders:e.serviceHeaders.map(t=>FWP(t)),endpointHeaders:e.endpointHeaders.map(t=>FWP(t)),queryParameters:e.queryParameters.map(t=>jlU(t)),request:e.request!=null?wlU(e.request):void 0,response:SlU(e.response)}}function NWP(e){return{key:e.key,value:Sx(e.value)}}function FWP(e){return{key:e.wireKey,value:Sx(e.value)}}function jlU(e){return{key:e.wireKey,value:Sx(e.value)}}function wlU(e){return I.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>I.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>ElU(r))}),reference:t=>I.V3.services.http.ExampleRequestBody.reference(Sx(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function ElU(e){return{wireKey:e.wireKey,value:Sx(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function SlU(e){return I.V4.services.http.ExampleResponse._visit(e,{ok:t=>I.V3.services.http.ExampleResponse.ok({body:t.body!=null?Sx(t.body):void 0}),error:t=>I.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?Sx(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function Q5t(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function jAe(e){return{...Q5t(e.name),wireValue:e.wireValue}}function FR(e){return{safeName:{originalValue:e.originalName,camelCase:e.camelCase.safeName,pascalCase:e.pascalCase.safeName,snakeCase:e.snakeCase.safeName,screamingSnakeCase:e.screamingSnakeCase.safeName},unsafeName:{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}}function QR(e){return{wireValue:e.wireValue,name:FR(e.name)}}function ava(e){return I.V5.types.ContainerType._visit(e,{list:t=>I.V4.types.ContainerType.list(ND(t)),set:t=>I.V4.types.ContainerType.set(ND(t)),map:({keyType:t,valueType:r})=>I.V4.types.ContainerType.map({keyType:ND(t),valueType:ND(r)}),optional:t=>I.V4.types.ContainerType.optional(ND(t)),literal:t=>I.V5.types.Literal._visit(t,{string:r=>I.V4.types.ContainerType.literal(I.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function nNn(e){return e.map(t=>Q5t(t))}function aNn(e){return e.map(t=>FR(t))}function DQ(e){return{fernFilepath:nNn(e.fernFilepath),fernFilepathV2:aNn(e.fernFilepath),name:e.name.originalName,nameV2:Q5t(e.name),nameV3:FR(e.name)}}function ND(e){return I.V5.types.TypeReference._visit(e,{named:t=>I.V4.types.TypeReference.named(DQ(t)),container:t=>I.V4.types.TypeReference.container(ava(t)),primitive:t=>I.V4.types.TypeReference.primitive(t),unknown:I.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function oNn(e){return{name:jAe(e.name),nameV2:QR(e.name),valueType:ND(e.valueType),availability:e.availability,docs:e.docs}}function VWP(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>MlU(t))}}function MlU(e){return I.V5.auth.AuthScheme._visit(e,{basic:I.V4.auth.AuthScheme.basic,bearer:I.V4.auth.AuthScheme.bearer,header:t=>I.V4.auth.AuthScheme.header(oNn(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function WWP(e){return{docs:e.docs,id:e.id,url:e.url,name:FR(e.name)}}function GWP({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let i=e.type!=null?I.V4.types.Type.alias({aliasOf:ND(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:Q5t(e.name.name),nameV3:FR(e.name.name),fernFilepath:nNn(e.name.fernFilepath),fernFilepathV2:aNn(e.name.fernFilepath)},discriminantValueV2:QR(e.discriminantValue),discriminantValueV3:I.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:I.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:n=>I.V4.errors.ErrorDeclarationDiscriminantValue.property(QR(n.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:QR(e.discriminantValue),type:i??I.V4.types.Type.alias({aliasOf:I.V4.types.TypeReference.void(),resolvedType:I.V4.types.ResolvedTypeReference.void()}),typeV2:i,typeV3:e.type!=null?ND(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function Mx(e){return{jsonExample:e.jsonExample,shape:HWP(e.shape)}}function HWP(e){return I.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:I.V4.types.ExampleTypeReferenceShape.primitive,container:t=>I.V4.types.ExampleTypeReferenceShape.container(BlU(t)),unknown:I.V4.types.ExampleTypeReferenceShape.unknown,named:t=>I.V4.types.ExampleTypeReferenceShape.named(DlU(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function DlU(e){return{typeName:DQ(e.typeName),shape:L8u(e.shape)}}function BlU(e){return I.V5.types.ExampleContainer._visit(e,{list:t=>I.V4.types.ExampleContainer.list(t.map(r=>Mx(r))),set:t=>I.V4.types.ExampleContainer.set(t.map(r=>Mx(r))),optional:t=>I.V4.types.ExampleContainer.optional(t!=null?Mx(t):void 0),map:t=>I.V4.types.ExampleContainer.map(t.map(r=>({key:Mx(r.key),value:Mx(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function L8u(e){return I.V5.types.ExampleTypeShape._visit(e,{alias:t=>I.V4.types.ExampleTypeShape.alias({value:Mx(t.value)}),object:t=>I.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:Mx(r.value),originalTypeDeclaration:DQ(r.originalTypeDeclaration)}))}),union:t=>I.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:I.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>I.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:DQ(r.typeName),shape:L8u(r.shape)}),singleProperty:r=>I.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:HWP(r.shape)}),noProperties:I.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>I.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function JWP({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:IlU(e.name),basePath:ClU(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>qlU({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>oNn(r)),pathParameters:e.pathParameters.map(r=>$WP(r))}}function IlU(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:nNn(e.fernFilepath),fernFilepathV2:aNn(e.fernFilepath)}}function ClU(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function qlU({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:Q5t(e.name),nameV2:FR(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>oNn(r)),path:e.path,pathParameters:e.pathParameters.map(r=>$WP(r)),queryParameters:e.queryParameters.map(r=>TlU(r)),requestBody:e.requestBody!=null?RlU(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?zlU(e.sdkRequest):void 0,response:NlU(e.response),errors:e.errors.map(r=>FlU(r)),errorsV2:QlU({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>VlU(r))}}function $WP(e){return{docs:e.docs,availability:e.availability,name:Q5t(e.name),nameV2:FR(e.name),valueType:ND(e.valueType)}}function TlU(e){return{docs:e.docs,availability:e.availability,name:jAe(e.name),nameV2:QR(e.name),valueType:ND(e.valueType),allowMultiple:e.allowMultiple}}function RlU(e){return I.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V4.services.http.HttpRequestBody.inlinedRequestBody({name:FR(t.name),extends:t.extends.map(r=>DQ(r)),properties:t.properties.map(r=>({docs:r.docs,name:QR(r.name),valueType:ND(r.valueType)}))}),reference:t=>I.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:ND(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function zlU(e){return{requestParameterName:FR(e.requestParameterName),shape:I.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>I.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:ND(t.requestBodyType)}),wrapper:t=>I.V4.services.http.SdkRequestShape.wrapper({wrapperName:FR(t.wrapperName),bodyKey:FR(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function NlU(e){let t=e.type!=null?ND(e.type):void 0;return{docs:e.docs,type:t??I.V4.types.TypeReference.void(),typeV2:t}}function FlU(e){return{docs:e.docs,error:Umf(e.error)}}function QlU({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>UlU({responseError:r,errorResolver:t}))}}function UlU({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:jAe(r.discriminantValue),shape:LlU({responseError:e,declaration:r})}}function LlU({responseError:e,declaration:t}){return t.type==null?I.V4.services.commons.ResponseErrorShape.noProperties():I.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:Umf(e.error)})}function Umf(e){return{name:e.name.originalName,nameV2:Q5t(e.name),nameV3:FR(e.name),fernFilepath:nNn(e.fernFilepath),fernFilepathV2:aNn(e.fernFilepath)}}function VlU(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>xWP(t)),endpointPathParameters:e.endpointPathParameters.map(t=>xWP(t)),serviceHeaders:e.serviceHeaders.map(t=>KWP(t)),endpointHeaders:e.endpointHeaders.map(t=>KWP(t)),queryParameters:e.queryParameters.map(t=>WlU(t)),request:e.request!=null?GlU(e.request):void 0,response:xlU(e.response)}}function xWP(e){return{key:e.key,value:Mx(e.value)}}function KWP(e){return{wireKey:e.wireKey,value:Mx(e.value)}}function WlU(e){return{wireKey:e.wireKey,value:Mx(e.value)}}function GlU(e){return I.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>I.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>HlU(r))}),reference:t=>I.V4.services.http.ExampleRequestBody.reference(Mx(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function HlU(e){return{wireKey:e.wireKey,value:Mx(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?DQ(e.originalTypeDeclaration):void 0}}function xlU(e){return I.V5.http.ExampleResponse._visit(e,{ok:t=>I.V4.services.http.ExampleResponse.ok({body:t.body!=null?Mx(t.body):void 0}),error:t=>I.V4.services.http.ExampleResponse.error({error:Umf(t.error),body:t.body!=null?Mx(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function YWP(e){return{docs:e.docs,availability:e.availability,name:DQ(e.name),shape:KlU(e.shape),examples:e.examples.map(t=>JlU(t)),referencedTypes:e.referencedTypes.map(t=>DQ(t))}}function KlU(e){return I.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>I.V4.types.Type.alias({aliasOf:ND(t),resolvedType:$lU(r)}),enum:t=>I.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:jAe(r.name),nameV2:QR(r.name),value:r.name.wireValue}))}),object:t=>I.V4.types.Type.object({extends:t.extends.map(r=>DQ(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:jAe(r.name),nameV2:QR(r.name),valueType:ND(r.valueType)}))}),union:t=>I.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:jAe(t.discriminant),discriminantV3:QR(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:jAe(r.discriminantValue),discriminantValueV2:QR(r.discriminantValue),valueType:I.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>I.V4.types.TypeReference.named(DQ(i)),singleProperty:i=>ND(i.type),noProperties:I.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:I.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>I.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(DQ(i)),singleProperty:i=>I.V4.types.SingleUnionTypeProperties.singleProperty({name:jAe(i.name),nameV2:QR(i.name),type:ND(i.type)}),noProperties:I.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function JlU(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:L8u(e.shape)}}function $lU(e){return I.V5.types.ResolvedTypeReference._visit(e,{named:t=>I.V4.types.ResolvedTypeReference.named({name:DQ(t.name),shape:YlU(t.shape)}),container:t=>I.V4.types.ResolvedTypeReference.container(ava(t)),primitive:I.V4.types.ResolvedTypeReference.primitive,unknown:I.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function YlU(e){return I.V5.types.ShapeType._visit(e,{enum:()=>I.V5.types.ShapeType.Enum,object:()=>I.V5.types.ShapeType.Object,union:()=>I.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var V8u=class{errors;constructor(t){this.errors=t.errors.reduce((r,i)=>({...r,[XWP(i.name)]:i}),{})}getDeclaration(t){let r=XWP(t),i=this.errors[r];if(i==null)throw new Error("Error does not exist: "+r);return i}};function XWP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}var W8u=class{types;constructor(t){this.types=t.types.reduce((r,i)=>({...r,[ZWP(i.name)]:i}),{})}resolveTypeReference(t){return I.V5.types.TypeReference._visit(t,{container:r=>I.V4.types.ResolvedTypeReference.container(ava(r)),named:r=>{let i=this.getTypeDeclaration(r);return i.shape._type==="alias"?this.resolveTypeReference(i.shape.aliasOf):I.V4.types.ResolvedTypeReference.named({name:DQ(r),shape:XlU(i.shape._type)})},primitive:I.V4.types.ResolvedTypeReference.primitive,unknown:I.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=ZWP(t),i=this.types[r];if(i==null)throw new Error("Type does not exist: "+i);return i}};function ZWP(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function XlU(e){switch(e){case"object":return I.V4.types.ShapeType.Object;case"union":return I.V4.types.ShapeType.Union;case"enum":return I.V4.types.ShapeType.Enum;default:vt(e)}}var kWP={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[P.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.STOPLIGHT]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new W8u(e),r=new V8u(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:VWP(e.auth),headers:e.headers.map(i=>oNn(i)),types:e.types.map(i=>YWP(i)),services:{http:e.services.map(i=>JWP({service:i,errorResolver:r})),websocket:[]},errors:e.errors.map(i=>GWP({errorDeclaration:i,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:jAe(e.constants.errorInstanceIdKey),errorDiscriminant:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR",wireValue:"error"},errorContentKey:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"}},errorsV2:{errorInstanceIdKey:QR(e.constants.errorInstanceIdKey),errorDiscriminant:{name:{unsafeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"},safeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"}},wireValue:"error"},errorContentKey:{name:{unsafeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"},safeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"}},wireValue:"content"}}},defaultEnvironment:e.defaultEnvironment,environments:e.environments.map(i=>WWP(i)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?FR(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:I.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:I.V4.ir.ErrorDiscriminationStrategy.statusCode,property:i=>I.V4.ir.ErrorDiscriminationStrategy.property({discriminant:QR(i.discriminant),contentProperty:QR(i.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var e5P={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[P.TYPESCRIPT_EXPRESS]:"0.0.264",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[P.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[P.OPENAPI]:"0.0.16-1-ga2c0ada",[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?I.V6.environment.Environments._visit(e.environments.environments,{singleBaseUrl:i=>i.environments,multipleBaseUrls:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying multiple URLs for a single environment. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a multiple URls for a single environment."),_unknown:()=>{throw new Error("Unknown Environments: "+e.environments?.environments.type)}}):[]})};var t5P={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.268",[P.TYPESCRIPT_EXPRESS]:"0.0.268",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.OPENAPI_PYTHON_CLIENT]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:e.services.map(t=>{let r=t.name.fernFilepath[t.name.fernFilepath.length-1],i=r!=null?`${r.pascalCase.safeName}Service`:"Service",n=r!=null?`${r.camelCase.unsafeName}Service`:"Service",a=r!=null?`${r.snakeCase.unsafeName}_service`:"service",o=a.toUpperCase(),c=M0(n);return{...t,name:{name:{originalName:i,camelCase:{safeName:n,unsafeName:n},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:o,unsafeName:o},pascalCase:{safeName:c,unsafeName:c}},fernFilepath:t.name.fernFilepath}}})})};var n5P={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[P.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[P.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[P.OPENAPI_PYTHON_CLIENT]:"0.0.0",[P.OPENAPI]:"0.0.20-1-gbbeb9bd",[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:ZlU(e.auth),headers:e.headers.map(t=>G8u(t)),types:e.types.map(t=>klU(t)),errors:e.errors.map(t=>ofU(t)),services:e.services.map(t=>ufU(t))})};function Lmf(e){return e.allParts}function ZlU(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:I.V7.auth.AuthScheme.header(G8u(t)))}}function G8u(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:s6(e.valueType)}}function s6(e){return I.V8.types.TypeReference._visit(e,{container:t=>I.V7.types.TypeReference.container(a5P(t)),named:t=>I.V7.types.TypeReference.named(U5t(t)),primitive:I.V7.types.TypeReference.primitive,unknown:I.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function a5P(e){return I.V8.types.ContainerType._visit(e,{list:t=>I.V7.types.ContainerType.list(s6(t)),optional:t=>I.V7.types.ContainerType.optional(s6(t)),set:t=>I.V7.types.ContainerType.set(s6(t)),map:({keyType:t,valueType:r})=>I.V7.types.ContainerType.map({keyType:s6(t),valueType:s6(r)}),literal:I.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function U5t(e){return{name:e.name,fernFilepath:Lmf(e.fernFilepath)}}function klU(e){return{docs:e.docs,availability:e.availability,name:U5t(e.name),shape:efU(e.shape),examples:e.examples.map(t=>nfU(t)),referencedTypes:e.referencedTypes.map(t=>U5t(t))}}function efU(e){return I.V8.types.Type._visit(e,{alias:t=>I.V7.types.Type.alias({aliasOf:s6(t.aliasOf),resolvedType:tfU(t.resolvedType)}),enum:I.V7.types.Type.enum,object:t=>I.V7.types.Type.object({extends:t.extends.map(r=>U5t(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:s6(r.valueType)}))}),union:t=>I.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>rfU(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function tfU(e){return I.V8.types.ResolvedTypeReference._visit(e,{container:t=>I.V7.types.ResolvedTypeReference.container(a5P(t)),named:t=>I.V7.types.ResolvedTypeReference.named({name:U5t(t.name),shape:t.shape}),primitive:I.V7.types.ResolvedTypeReference.primitive,unknown:I.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function rfU(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:ifU(e.shape)}}function ifU(e){return I.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(U5t(t)),singleProperty:t=>I.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:s6(t.type)}),noProperties:I.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function nfU(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:Vmf(e.shape)}}function Vmf(e){return I.V8.types.ExampleTypeShape._visit(e,{alias:t=>I.V7.types.ExampleTypeShape.alias({value:o2(t.value)}),enum:I.V7.types.ExampleTypeShape.enum,object:t=>I.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:o2(r.value),originalTypeDeclaration:U5t(r.originalTypeDeclaration)}))}),union:t=>I.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:afU(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function o2(e){return{jsonExample:e.jsonExample,shape:o5P(e.shape)}}function o5P(e){return I.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>I.V7.types.ExampleTypeReferenceShape.named({typeName:U5t(t.typeName),shape:Vmf(t.shape)}),container:t=>I.V7.types.ExampleTypeReferenceShape.container(I.V8.types.ExampleContainer._visit(t,{list:r=>I.V7.types.ExampleContainer.list(r.map(i=>o2(i))),set:r=>I.V7.types.ExampleContainer.set(r.map(i=>o2(i))),optional:r=>I.V7.types.ExampleContainer.optional(r!=null?o2(r):void 0),map:r=>I.V7.types.ExampleContainer.map(r.map(i=>({key:o2(i.key),value:o2(i.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:I.V7.types.ExampleTypeReferenceShape.primitive,unknown:I.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function afU(e){return I.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:U5t(t.typeName),shape:Vmf(t.shape)}),singleProperty:t=>I.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:o5P(t.shape)}),noProperties:I.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function ofU(e){return{docs:e.docs,name:Wmf(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?s6(e.type):void 0,statusCode:e.statusCode}}function Wmf(e){return{name:e.name,fernFilepath:Lmf(e.fernFilepath)}}function ufU(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:Lmf(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>u5P(t)),headers:e.headers.map(t=>G8u(t)),endpoints:e.endpoints.map(t=>sfU(t))}}function u5P(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:s6(e.valueType)}}function sfU(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>cfU(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>u5P(t)),sdkRequest:e.sdkRequest!=null?ffU(e.sdkRequest):void 0,requestBody:e.requestBody!=null?pfU(e.requestBody):void 0,response:_fU(e.response),headers:e.headers.map(t=>G8u(t)),queryParameters:e.queryParameters.map(t=>lfU(t)),examples:e.examples.map(t=>hfU(t))}}function cfU(e){return{docs:e.docs,error:Wmf(e.error)}}function lfU(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:s6(e.valueType),allowMultiple:e.allowMultiple}}function ffU(e){return{requestParameterName:e.requestParameterName,shape:dfU(e.shape)}}function dfU(e){return I.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:s6(t.requestBodyType)}),wrapper:I.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function pfU(e){return I.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>U5t(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:s6(r.valueType)}))}),reference:t=>I.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:s6(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function _fU(e){return{docs:e.docs,type:e.type!=null?s6(e.type):void 0}}function hfU(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>r5P(t)),endpointPathParameters:e.endpointPathParameters.map(t=>r5P(t)),queryParameters:e.queryParameters.map(t=>yfU(t)),serviceHeaders:e.serviceHeaders.map(t=>i5P(t)),endpointHeaders:e.endpointHeaders.map(t=>i5P(t)),request:e.request!=null?bfU(e.request):void 0,response:vfU(e.response)}}function r5P(e){return{key:e.key,value:o2(e.value)}}function yfU(e){return{wireKey:e.wireKey,value:o2(e.value)}}function i5P(e){return{wireKey:e.wireKey,value:o2(e.value)}}function bfU(e){return I.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>I.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:o2(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?U5t(r.originalTypeDeclaration):void 0}))}),reference:t=>I.V7.http.ExampleRequestBody.reference(o2(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function vfU(e){return I.V8.http.ExampleResponse._visit(e,{ok:t=>I.V7.http.ExampleResponse.ok({body:t.body!=null?o2(t.body):void 0}),error:t=>I.V7.http.ExampleResponse.error({error:Wmf(t.error),body:t.body!=null?o2(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var s5P={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[P.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[P.JAVA]:C,[P.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[P.JAVA_SDK]:"0.0.134-4-gef1ec4f",[P.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[P.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[P.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:k,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))n.shape._type==="union"&&n.shape.baseProperties.length>0&&t.failWithoutThrowing(r!=null?`Type ${n.name.name.originalName} uses base-properties. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a union with base-properties.");return t.getResult()===_w.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var c5P={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.STOPLIGHT]:k,[P.OPENAPI]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=bn(e.services,r=>({docs:void 0,...r}));for(let r of Object.values(e.subpackages))if(r.docs!=null&&r.service!=null){let i=t[r.service];if(i==null)throw new Error("Service does not exist: "+r.service);i.docs=r.docs}return{...e,services:t}}};var l5P={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[P.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[P.JAVA]:C,[P.JAVA_MODEL]:"0.0.134-15-ge1ac358",[P.JAVA_SDK]:"0.0.134-15-ge1ac358",[P.JAVA_SPRING]:"0.0.134-15-ge1ac358",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.STOPLIGHT]:k,[P.OPENAPI]:C,[P.POSTMAN]:"0.0.40-1-g9aa2117",[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:gfU(e.auth,t)})};function gfU(e,t){return{...e,schemes:e.schemes.map(r=>OfU(r,t))}}function OfU(e,{taskContext:t,targetGenerator:r}){return I.V11.auth.AuthScheme._visit(e,{bearer:I.V10.auth.AuthScheme.bearer,basic:I.V10.auth.AuthScheme.basic,header:i=>i.prefix!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying an auth header prefix. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an auth header prefix."):I.V10.auth.AuthScheme.header({docs:i.docs,availability:{status:I.V10.commons.AvailabilityStatus.GeneralAvailability,message:void 0},name:{name:i.name,wireValue:i.header},valueType:i.valueType}),_unknown:()=>{throw new Error("Unknown auth scheme: "+e._type)}})}var d5P={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[P.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[P.JAVA]:C,[P.JAVA_MODEL]:"0.1.0-1-gdb5c636",[P.JAVA_SDK]:"0.1.0-1-gdb5c636",[P.JAVA_SPRING]:"0.1.0-1-gdb5c636",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.STOPLIGHT]:"0.0.23-8-g479c860",[P.OPENAPI]:"0.0.22-1-g1c86b58",[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let i=bn(e.types,n=>({...n,shape:I.V12.types.Type._visit(n.shape,{union:I.V11.types.Type.union,enum:I.V11.types.Type.enum,object:I.V11.types.Type.object,alias:a=>I.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:I.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:I.V11.types.ResolvedTypeReference.container,primitive:I.V11.types.ResolvedTypeReference.primitive,named:o=>o.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(f5P({taskContext:t,targetGenerator:r})):I.V11.types.ResolvedTypeReference.named({shape:o.shape,name:o.name}),unknown:I.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(f5P({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:i,services:bn(e.services,n=>AfU(n,{taskContext:t,targetGenerator:r}))}}};function f5P(e){return e.targetGenerator!=null?`Generator ${e.targetGenerator.name}@${e.targetGenerator.version} does not support undiscriminated unions If you'd like to use this feature, please upgrade ${e.targetGenerator.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an undiscriminated union."}function AfU(e,t){return{...e,endpoints:e.endpoints.map(r=>mfU(r,t))}}function mfU(e,{taskContext:t,targetGenerator:r}){return e.streamingResponse!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a streaming response."):{...e,requestBody:e.requestBody!=null?I.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:I.V11.http.HttpRequestBody.inlinedRequestBody,reference:I.V11.http.HttpRequestBody.reference,fileUpload:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support file upload requests. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a file upload request."),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.requestBody?.type)}}):void 0,response:e.response!=null?{docs:e.response.docs,type:e.response.responseBodyType}:{docs:void 0,type:void 0}}}var p5P={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:bn(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:I.V12.types.Type.undiscriminatedUnion({docs:void 0,members:t.shape.members})}),auth:{...e.auth,schemes:e.auth.schemes.map(t=>t._type!=="header"?t:{...t,name:t.name.name,header:t.name.wireValue})}})};var _5P={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:k,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V14.types.Type._visit(r.shape,{union:i=>I.V13.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:LC(n.valueType)})),types:i.types.map(n=>wfU(n))}),enum:I.V13.types.Type.enum,object:i=>I.V13.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:LC(n.valueType)}))}),alias:i=>I.V13.types.Type.alias({aliasOf:LC(i.aliasOf),resolvedType:SfU(i.resolvedType)}),undiscriminatedUnion:i=>I.V13.types.Type.undiscriminatedUnion(MfU(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:PfU(e.auth),headers:e.headers.map(r=>xmf(r)),types:t,services:bn(e.services,r=>DfU(r)),errors:bn(e.errors,r=>zfU(r))}}};function PfU(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:I.V13.auth.AuthScheme.header(jfU(t)))}}function jfU(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:LC(e.valueType)}}function xmf(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:LC(e.valueType)}}function LC(e){return I.V14.types.TypeReference._visit(e,{container:t=>I.V13.types.TypeReference.container(h5P(t)),primitive:t=>t==="DATE"?I.V13.types.TypeReference.primitive(I.V13.types.PrimitiveType.String):I.V13.types.TypeReference.primitive(t),named:I.V13.types.TypeReference.named,unknown:I.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function h5P(e){return I.V14.types.ContainerType._visit(e,{list:t=>I.V13.types.ContainerType.list(LC(t)),optional:t=>I.V13.types.ContainerType.optional(LC(t)),set:t=>I.V13.types.ContainerType.set(LC(t)),map:({keyType:t,valueType:r})=>I.V13.types.ContainerType.map({keyType:LC(t),valueType:LC(r)}),literal:I.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function wfU(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:EfU(e.shape)}}function EfU(e){return I.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:LC(t.type)}),noProperties:I.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function SfU(e){return I.V14.types.ResolvedTypeReference._visit(e,{container:t=>I.V13.types.ResolvedTypeReference.container(h5P(t)),named:I.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?I.V13.types.ResolvedTypeReference.primitive(I.V13.types.PrimitiveType.String):I.V13.types.ResolvedTypeReference.primitive(t),unknown:I.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function MfU(e){return{members:e.members.map(t=>({...t,type:LC(t.type)}))}}function DfU(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>y5P(t)),headers:e.headers.map(t=>xmf(t)),endpoints:e.endpoints.map(t=>BfU(t))}}function y5P(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:LC(e.valueType)}}function BfU(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>y5P(t)),sdkRequest:e.sdkRequest!=null?CfU(e.sdkRequest):void 0,requestBody:e.requestBody!=null?TfU(e.requestBody):void 0,response:e.response!=null?Gmf(e.response):void 0,headers:e.headers.map(t=>xmf(t)),queryParameters:e.queryParameters.map(t=>IfU(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?Hmf(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?RfU(e.sdkResponse):void 0}}function IfU(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:LC(e.valueType),allowMultiple:e.allowMultiple}}function CfU(e){return{requestParameterName:e.requestParameterName,shape:qfU(e.shape)}}function qfU(e){return I.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:LC(t.requestBodyType)}),wrapper:I.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function TfU(e){return I.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:LC(r.valueType)}))}),reference:t=>I.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:LC(t.requestBodyType)}),fileUpload:t=>I.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:LC(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Gmf(e){return{docs:e.docs,responseBodyType:LC(e.responseBodyType)}}function Hmf(e){return{dataEventType:LC(e.dataEventType),terminator:e.terminator}}function RfU(e){return I.V14.http.SdkResponse._visit(e,{streaming:t=>I.V13.http.SdkResponse.streaming(Hmf(t)),nonStreaming:t=>I.V13.http.SdkResponse.nonStreaming(Gmf(t)),maybeStreaming:t=>I.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:Gmf(t.nonStreaming),streaming:Hmf(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function zfU(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?LC(e.type):void 0,statusCode:e.statusCode}}var b5P={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[P.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.0.52-3-gd9df38df",[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V15.types.Type._visit(r.shape,{union:i=>I.V14.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:VC(n.valueType)})),types:i.types.map(n=>QfU(n))}),enum:I.V14.types.Type.enum,object:i=>I.V14.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:VC(n.valueType)}))}),alias:i=>I.V14.types.Type.alias({aliasOf:VC(i.aliasOf),resolvedType:LfU(i.resolvedType)}),undiscriminatedUnion:i=>I.V14.types.Type.undiscriminatedUnion(VfU(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:NfU(e.auth),headers:e.headers.map(r=>$mf(r)),types:t,services:bn(e.services,r=>WfU(r)),errors:bn(e.errors,r=>YfU(r))}}};function NfU(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:I.V14.auth.AuthScheme.header(FfU(t)))}}function FfU(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:VC(e.valueType)}}function $mf(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:VC(e.valueType)}}function VC(e){return I.V15.types.TypeReference._visit(e,{container:t=>I.V14.types.TypeReference.container(v5P(t)),primitive:t=>t==="BASE_64"?I.V14.types.TypeReference.primitive(I.V14.types.PrimitiveType.String):I.V14.types.TypeReference.primitive(t),named:I.V14.types.TypeReference.named,unknown:I.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function v5P(e){return I.V15.types.ContainerType._visit(e,{list:t=>I.V14.types.ContainerType.list(VC(t)),optional:t=>I.V14.types.ContainerType.optional(VC(t)),set:t=>I.V14.types.ContainerType.set(VC(t)),map:({keyType:t,valueType:r})=>I.V14.types.ContainerType.map({keyType:VC(t),valueType:VC(r)}),literal:I.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function QfU(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:UfU(e.shape)}}function UfU(e){return I.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:VC(t.type)}),noProperties:I.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function LfU(e){return I.V15.types.ResolvedTypeReference._visit(e,{container:t=>I.V14.types.ResolvedTypeReference.container(v5P(t)),named:I.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?I.V14.types.ResolvedTypeReference.primitive(I.V14.types.PrimitiveType.String):I.V14.types.ResolvedTypeReference.primitive(t),unknown:I.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function VfU(e){return{members:e.members.map(t=>({...t,type:VC(t.type)}))}}function WfU(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>g5P(t)),headers:e.headers.map(t=>$mf(t)),endpoints:e.endpoints.map(t=>GfU(t))}}function g5P(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:VC(e.valueType)}}function GfU(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>g5P(t)),sdkRequest:e.sdkRequest!=null?xfU(e.sdkRequest):void 0,requestBody:e.requestBody!=null?JfU(e.requestBody):void 0,response:e.response!=null?Kmf(e.response):void 0,headers:e.headers.map(t=>$mf(t)),queryParameters:e.queryParameters.map(t=>HfU(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?Jmf(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?$fU(e.sdkResponse):void 0}}function HfU(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:VC(e.valueType),allowMultiple:e.allowMultiple}}function xfU(e){return{requestParameterName:e.requestParameterName,shape:KfU(e.shape)}}function KfU(e){return I.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:VC(t.requestBodyType)}),wrapper:I.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function JfU(e){return I.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:VC(r.valueType)}))}),reference:t=>I.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:VC(t.requestBodyType)}),fileUpload:t=>I.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:VC(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Kmf(e){return{docs:e.docs,responseBodyType:VC(e.responseBodyType)}}function Jmf(e){return{dataEventType:VC(e.dataEventType),terminator:e.terminator}}function $fU(e){return I.V15.http.SdkResponse._visit(e,{streaming:t=>I.V14.http.SdkResponse.streaming(Jmf(t)),nonStreaming:t=>I.V14.http.SdkResponse.nonStreaming(Kmf(t)),maybeStreaming:t=>I.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:Kmf(t.nonStreaming),streaming:Jmf(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function YfU(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?VC(e.type):void 0,statusCode:e.statusCode}}var O5P={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[P.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[P.JAVA]:C,[P.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[P.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[P.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>e.basePath!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying a base-path in api.yml. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a root base-path."):{...e,services:bn(e.services,i=>({...i,pathParameters:Ymf(i.pathParameters),endpoints:i.endpoints.map(n=>({...n,allPathParameters:Ymf(n.allPathParameters),pathParameters:Ymf(n.pathParameters)}))}))}};function Ymf(e){return e.map(t=>XfU(t))}function XfU(e){return{...e,availability:{status:I.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var A5P={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))if(n.shape._type==="union"&&n.shape.extends.length>0)return t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support union types with extensions. See ${i} in file ${n.name.fernFilepath.allParts.join("/")}. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains union types with extensions.");return{...e}}};var m5P={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[P.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[P.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.3.0-3-ge125e311",[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:bn(e.services,i=>{let n=i.endpoints[0]?.baseUrl;return i.endpoints.some(a=>a.baseUrl!==n)?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support endpoint-level server URLs. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains endpoint-level server URLs."):{...i,baseUrl:n}})})};var j5P={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:k,[P.TYPESCRIPT_BROWSER_SDK]:k,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[P.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[P.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:"0.0.44-1-gbf4b0f3",[P.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[P.GO_FIBER]:k,[P.GO_MODEL]:k,[P.GO_SDK]:k,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:bn(e.services,r=>ZfU(r,t)),types:bn(e.types,r=>ndU(r,t))})};function ZfU(e,t){return{...e,endpoints:e.endpoints.map(r=>kfU(r,t))}}function kfU(e,t){return{...e,examples:e.examples.map(r=>edU(r,t))}}function edU(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>Xmf(r,t)),servicePathParameters:e.servicePathParameters.map(r=>Xmf(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>Xmf(r,t)),serviceHeaders:e.serviceHeaders.map(r=>P5P(r,t)),endpointHeaders:e.endpointHeaders.map(r=>P5P(r,t)),queryParameters:e.queryParameters.map(r=>tdU(r,t)),request:e.request!=null?rdU(e.request,t):void 0,response:idU(e.response,t)}}function Xmf(e,t){return{key:e.key,value:u2(e.value,t)}}function P5P(e,t){return{wireKey:e.wireKey,value:u2(e.value,t)}}function tdU(e,t){return{wireKey:e.wireKey,value:u2(e.value,t)}}function rdU(e,t){return I.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>I.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(i=>({wireKey:i.wireKey,value:u2(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),reference:r=>I.V18.http.ExampleRequestBody.reference(u2(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function idU(e,t){return I.V19.http.ExampleResponse._visit(e,{ok:r=>I.V18.http.ExampleResponse.ok({body:r.body!=null?u2(r.body,t):void 0}),error:r=>I.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?u2(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function ndU(e,t){return{...e,examples:e.examples.map(r=>adU(r,t))}}function adU(e,t){return{...e,shape:Zmf(e.shape,t)}}function Zmf(e,t){return I.V19.types.ExampleTypeShape._visit(e,{alias:r=>I.V18.types.ExampleTypeShape.alias({value:u2(r.value,t)}),object:r=>I.V18.types.ExampleTypeShape.object({properties:r.properties.map(i=>({wireKey:i.wireKey,value:u2(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),union:r=>I.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:I.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:i=>I.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:i.jsonExample,shape:w5P(i.shape,t)}),samePropertiesAsObject:i=>I.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:i.typeName,shape:Zmf(i.shape,t)}),noProperties:I.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:I.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function u2(e,t){return{jsonExample:e.jsonExample,shape:w5P(e.shape,t)}}function w5P(e,t){return I.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>I.V18.types.ExampleTypeReferenceShape.primitive(odU(r,t)),named:r=>I.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:Zmf(r.shape,t)}),container:r=>I.V18.types.ExampleTypeReferenceShape.container(I.V19.types.ExampleContainer._visit(r,{list:i=>I.V18.types.ExampleContainer.list(i.map(n=>u2(n,t))),set:i=>I.V18.types.ExampleContainer.set(i.map(n=>u2(n,t))),optional:i=>I.V18.types.ExampleContainer.optional(i!=null?u2(i,t):void 0),map:i=>I.V18.types.ExampleContainer.map(i.map(n=>({key:u2(n.key,t),value:u2(n.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:I.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function odU(e,{taskContext:t,targetGenerator:r}){return e.type==="date"?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support examples for dates. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains date examples."):e}var E5P={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[P.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.5.26-rc0-3-gdfabd674",[P.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[P.JAVA]:C,[P.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[P.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[P.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[P.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[P.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[P.GO_FIBER]:k,[P.GO_MODEL]:"0.0.0",[P.GO_SDK]:"0.0.0",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:bn(e.services,r=>udU(r,t))})};function udU(e,t){return{...e,endpoints:e.endpoints.map(r=>sdU(r,t))}}function sdU(e,t){return{...e,response:e.response!=null?S5P(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?cdU(e.sdkResponse,t):void 0}}function S5P(e,t){return I.V20.http.HttpResponse._visit(e,{fileDownload:()=>M5P(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function cdU(e,t){return I.V20.http.SdkResponse._visit(e,{fileDownload:()=>M5P(t),streaming:I.V19.http.SdkResponse.streaming,maybeStreaming:r=>I.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:S5P(r.nonStreaming,t)}),json:I.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function M5P({targetGenerator:e,taskContext:t}){return t.failAndThrow(e!=null?`Generator ${e.name}@${e.version} does not support file download. If you'd like to use this feature, please upgrade ${e.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains file download.")}var D5P={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:k,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:bn(e.services,r=>ldU(r,t))})};function ldU(e,t){return{...e,endpoints:e.endpoints.map(r=>fdU(r,t))}}function fdU(e,t){return{...e,streamingResponse:e.streamingResponse!=null?kmf(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?ddU(e.sdkResponse,t):void 0}}function kmf(e,{taskContext:t,targetGenerator:r}){return{dataEventType:I.V21.http.StreamingResponseChunkType._visit(e.dataEventType,{json:i=>i,text:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming text responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains streaming text responses."),_unknown:()=>{throw new Error("Unknown StreamingResponseChunkType: "+e.dataEventType.type)}}),terminator:e.terminator}}function ddU(e,t){return I.V21.http.SdkResponse._visit(e,{fileDownload:I.V20.http.SdkResponse.fileDownload,streaming:r=>I.V20.http.SdkResponse.streaming(kmf(r,t)),maybeStreaming:r=>I.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:kmf(r.streaming,t),nonStreaming:r.nonStreaming}),json:I.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var B5P={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.5.0-3-gac7ce7c",[P.GO_MODEL]:"0.0.14-8-g2fa39f7",[P.GO_SDK]:"0.0.14-8-g2fa39f7",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:bn(e.services,t=>pdU(t))})};function pdU(e){return{...e,endpoints:e.endpoints.map(t=>_dU(t))}}function _dU(e){return{...e,...e.response!=null?I.V22.http.HttpResponse._visit(e.response,{json:t=>({response:I.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:I.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:I.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:I.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:I.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var q5P={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[P.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.7.4-rc3-4-g6cf92f81",[P.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:"0.0.28-3-g112d3dd",[P.STOPLIGHT]:"0.0.28-3-g112d3dd",[P.POSTMAN]:"0.0.44-4-gddab2ae",[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],i={};for(let[n,a]of Object.entries(e.services)){let o=[];for(let c of a.endpoints){let d=hdU(c);d==null?r.push(c):o.push(d)}i[n]={...a,endpoints:o,headers:a.headers.map(c=>tPf(c)),pathParameters:a.pathParameters.map(c=>H8u(c))}}return r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(n=>n.name.originalName).join(", ")} will be skipped.`)),{...e,auth:{...e.auth,schemes:e.auth.schemes.map(n=>bdU(n))},headers:e.headers.map(n=>tPf(n)),types:bn(e.types,n=>vdU(n)),services:i,errors:bn(e.errors,n=>jdU(n)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(n=>H8u(n)),variables:e.variables.map(n=>wdU(n))}}};function hdU(e){let t;if(!(e.requestBody!=null&&(t=ydU(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>tPf(r)),pathParameters:e.pathParameters.map(r=>H8u(r)),allPathParameters:e.allPathParameters.map(r=>H8u(r)),queryParameters:e.queryParameters.map(r=>EdU(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:SdU(e.sdkRequest.shape)}:void 0,response:e.response!=null?MdU(e.response):void 0,examples:e.examples.map(r=>DdU(r))}}function ydU(e){switch(e.type){case"bytes":return;case"fileUpload":return I.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>IdU(t))});case"inlinedRequestBody":return I.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>CdU(t))});case"reference":return I.V22.http.HttpRequestBody.reference({...e,requestBodyType:WC(e.requestBodyType)});default:vt(e)}}function tPf(e){return{...e,valueType:WC(e.valueType)}}function bdU(e){return e._visit({bearer:I.V22.auth.AuthScheme.bearer,basic:I.V22.auth.AuthScheme.basic,header:t=>I.V22.auth.AuthScheme.header({...t,valueType:WC(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function vdU(e){return{...e,shape:gdU(e.shape),examples:e.examples.map(t=>OdU(t))}}function gdU(e){return e._visit({alias:t=>I.V22.types.Type.alias({...t,aliasOf:WC(t.aliasOf),resolvedType:mdU(t.resolvedType)}),enum:I.V22.types.Type.enum,object:t=>I.V22.types.Type.object({...t,properties:t.properties.map(r=>I5P(r))}),union:t=>I.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>I5P(r)),types:t.types.map(r=>({...r,shape:PdU(r.shape)}))}),undiscriminatedUnion:t=>I.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:WC(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function OdU(e){return{...e,shape:rPf(e.shape)}}function rPf(e){return e._visit({alias:t=>I.V22.types.ExampleTypeShape.alias({...t,value:wAe(t.value)}),enum:I.V22.types.ExampleTypeShape.enum,object:t=>I.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:wAe(r.value)}))}),union:t=>I.V22.types.ExampleTypeShape.union({...t,properties:AdU(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function wAe(e){return{...e,shape:iPf(e.shape)}}function iPf(e){return e._visit({primitive:t=>I.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:I.V22.types.ExamplePrimitive.integer,double:I.V22.types.ExamplePrimitive.double,string:I.V22.types.ExamplePrimitive.string,boolean:I.V22.types.ExamplePrimitive.boolean,long:I.V22.types.ExamplePrimitive.long,datetime:r=>I.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:I.V22.types.ExamplePrimitive.date,uuid:I.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>I.V22.types.ExampleTypeReferenceShape.named({...t,shape:rPf(t.shape)}),container:t=>I.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>I.V22.types.ExampleContainer.list(r.map(i=>wAe(i))),set:r=>I.V22.types.ExampleContainer.set(r.map(i=>wAe(i))),optional:r=>I.V22.types.ExampleContainer.optional(r!=null?wAe(r):void 0),map:r=>I.V22.types.ExampleContainer.map(r.map(i=>({key:wAe(i.key),value:wAe(i.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:I.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function AdU(e){return e._visit({singleProperty:t=>I.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:iPf(t.shape)}),noProperties:I.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>I.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:rPf(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function WC(e){return e._visit({container:t=>I.V22.types.TypeReference.container(T5P(t)),primitive:I.V22.types.TypeReference.primitive,named:I.V22.types.TypeReference.named,unknown:I.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function T5P(e){return e._visit({list:t=>I.V22.types.ContainerType.list(WC(t)),set:t=>I.V22.types.ContainerType.set(WC(t)),optional:t=>I.V22.types.ContainerType.optional(WC(t)),map:t=>I.V22.types.ContainerType.map({keyType:WC(t.keyType),valueType:WC(t.valueType)}),literal:I.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function mdU(e){return e._visit({container:t=>I.V22.types.ResolvedTypeReference.container(T5P(t)),primitive:I.V22.types.ResolvedTypeReference.primitive,named:I.V22.types.ResolvedTypeReference.named,unknown:I.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function I5P(e){return{...e,valueType:WC(e.valueType)}}function PdU(e){return e._visit({noProperties:I.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>I.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:WC(t.type)}),samePropertiesAsObject:I.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function jdU(e){return{...e,type:e.type!=null?WC(e.type):void 0}}function wdU(e){return{...e,type:WC(e.type)}}function H8u(e){return{...e,valueType:WC(e.valueType)}}function EdU(e){return{...e,valueType:WC(e.valueType)}}function SdU(e){return e._visit({justRequestBody:t=>I.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:WC(t.requestBodyType)}),wrapper:I.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function MdU(e){return e._visit({json:t=>I.V22.http.HttpResponse.json({...t,responseBodyType:WC(t.responseBodyType)}),fileDownload:I.V22.http.HttpResponse.fileDownload,streaming:t=>I.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>I.V22.http.StreamingResponseChunkType.json(WC(r)),text:I.V22.http.StreamingResponseChunkType.text,_other:()=>{throw new Error("Unknown streaming data event type: "+t.dataEventType.type)}})}),_other:()=>{throw new Error("Unknown response: "+e.type)}})}function DdU(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>ePf(t)),servicePathParameters:e.servicePathParameters.map(t=>ePf(t)),endpointPathParameters:e.endpointPathParameters.map(t=>ePf(t)),serviceHeaders:e.serviceHeaders.map(t=>C5P(t)),endpointHeaders:e.endpointHeaders.map(t=>C5P(t)),queryParameters:e.queryParameters.map(t=>BdU(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>I.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:wAe(r.value)}))}),reference:t=>I.V22.http.ExampleRequestBody.reference({...t,shape:iPf(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>I.V22.http.ExampleResponse.ok({...t,body:t.body!=null?wAe(t.body):void 0}),error:t=>I.V22.http.ExampleResponse.error({...t,body:t.body!=null?wAe(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function ePf(e){return{...e,value:wAe(e.value)}}function BdU(e){return{...e,value:wAe(e.value)}}function C5P(e){return{...e,value:wAe(e.value)}}function IdU(e){return e._visit({file:I.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>I.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:WC(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function CdU(e){return{...e,valueType:WC(e.valueType)}}var Wn={};Zt(Wn,{V23:()=>_v5,V24:()=>hv5,V25:()=>yv5,V26:()=>bv5,V27:()=>vv5,V28:()=>gv5,V29:()=>Ov5,V30:()=>Av5,V31:()=>mv5,V32:()=>Pv5,V33:()=>jv5,V34:()=>wv5,V35:()=>Ev5,V36:()=>Sv5,V37:()=>Mv5,V38:()=>Dv5,V39:()=>Bv5,V40:()=>Iv5,V41:()=>Cv5,V42:()=>qv5,V43:()=>Tv5,V44:()=>Rv5,V45:()=>zv5,V46:()=>Nv5,V47:()=>Fv5,V48:()=>Qv5,V49:()=>Uv5,V50:()=>Lv5,V51:()=>Vv5,V52:()=>Wv5,V53:()=>Gv5,V54:()=>Hv5,V55:()=>xv5,V56:()=>Kv5,V57:()=>Jv5,V58:()=>$v5,V59:()=>Yv5,V60:()=>Xv5,V61:()=>Zv5,V62:()=>kv5,V63:()=>Vn});var _v5=ce(qt(),1),hv5=ce(St(),1),yv5=ce(Et(),1),bv5=ce(wt(),1),vv5=ce(Ot(),1),gv5=ce(At(),1),Ov5=ce(mt(),1),Av5=ce(_t(),1),mv5=ce(pt(),1),Pv5=ce(ot(),1),jv5=ce(et(),1),wv5=ce(Ze(),1),Ev5=ce(Je(),1),Sv5=ce($e(),1),Mv5=ce(Ke(),1),Dv5=ce(He(),1),Bv5=ce(Le(),1),Iv5=ce(Ve(),1),Cv5=ce(Qe(),1),qv5=ce(ze(),1),Tv5=ce(Te(),1),Rv5=ce(Ie(),1),zv5=ce(Se(),1),Nv5=ce(je(),1),Fv5=ce(Pe(),1),Qv5=ce(Ae(),1),Uv5=ce(be(),1),Lv5=ce(ye(),1),Vv5=ce(he(),1),Wv5=ce(_e(),1),Gv5=ce($(),1),Hv5=ce(Es(),1),xv5=ce(ls(),1),Kv5=ce(fs(),1),Jv5=ce(Gu(),1),$v5=ce(Hu(),1),Yv5=ce(xu(),1),Xv5=ce(Du(),1),Zv5=ce(xo(),1),kv5=ce(Ko(),1);var $dE={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var YdE={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"0.4.9-1-ge0997b3",[P.JAVA_SDK]:"0.4.9-1-ge0997b3",[P.JAVA_SPRING]:"0.4.9-1-ge0997b3",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],i=[],n={};for(let[a,o]of Object.entries(e.services)){let c=[];for(let d of o.endpoints){let s;if(d.sdkRequest!=null&&(s=eg5(d.sdkRequest),s==null)){r.push(d);continue}if(d.response!=null){let u=d.response._visit({fileDownload:f=>I.V24.HttpResponse.fileDownload(f),json:f=>I.V24.HttpResponse.json(f),streaming:f=>I.V24.HttpResponse.streaming(f),text:()=>(i.push(d),I.V24.HttpResponse.json({docs:void 0,responseBodyType:I.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});c.push({...d,sdkRequest:s,response:u})}else c.push({...d,sdkRequest:s,response:void 0})}n[a]={...o,endpoints:c}}return i.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support text/plain responses. `),i.length===1&&i[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${i[0].name.originalName} response type will be casted to unknown.`):t.taskContext.logger.warn(`Therefore, endpoints ${i.map(a=>a.name.originalName).join(", ")} response types will be casted to unknown.`)),r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(a=>a.name.originalName).join(", ")} will be skipped.`)),{...e,services:n}}};function eg5(e){let t=e.shape;if(t.type==="wrapper")return{shape:I.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:I.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var ZdE={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[P.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,ag5(r)])),headers:e.headers.map(t=>rKs(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(i=>tg5(i))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,rg5(r)]))})};function tg5(e){return{...e,headers:e.headers.map(t=>rKs(t)),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function rg5(e){return{...e,endpoints:e.endpoints.map(t=>ig5(t)),headers:e.headers.map(t=>rKs(t)),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function ig5(e){return{...e,headers:e.headers.map(t=>rKs(t)),queryParameters:e.queryParameters.map(t=>ng5(t)),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function rKs(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function ng5(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function ag5(e){return{...e,shape:e.shape._visit({union:t=>I.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>XdE(r))}),object:t=>I.V25.Type.object({...t,properties:t.properties.map(r=>XdE(r))}),enum:t=>I.V25.Type.enum({...t,values:t.values.map(r=>og5(r))}),alias:t=>I.V25.Type.alias(t),undiscriminatedUnion:t=>I.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function XdE(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function og5(e){return{...e,availability:e.availability==null?{status:I.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var kdE={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.6.1-3-g94ee67a",[P.GO_MODEL]:"0.6.1-3-g94ee67a",[P.GO_SDK]:"0.6.1-3-g94ee67a",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,ug5(r)]))})};function ug5(e){return{...e,endpoints:e.endpoints.map(t=>sg5(t))}}function sg5(e){return{...e,response:e.response!=null?cg5(e.response):void 0}}function cg5(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?I.V26.HttpResponse.json(t):I.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var epE={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[P.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.8.1-1-g0f40bf18",[P.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.9.0-2-g6b0be0e",[P.GO_MODEL]:"0.9.0-2-g6b0be0e",[P.GO_SDK]:"0.9.0-2-g6b0be0e",[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:Fg5(e.auth),headers:nKs(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Wg5(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,gg5(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,pg5(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,dg5(r)])),pathParameters:iKs(e.pathParameters),variables:lg5(e.variables)})};function lg5(e){return e.map(t=>fg5(t))}function fg5(e){return{...e,type:uI(e.type)}}function dg5(e){return{...e,type:e.type!=null?uI(e.type):void 0}}function pg5(e){return e.map(t=>_g5(t))}function _g5(e){return{...e,headers:nKs(e.headers),payload:hg5(e.payload)}}function hg5(e){switch(e.type){case"inlinedPayload":return I.V27.WebhookPayload.inlinedPayload(yg5(e));case"reference":return I.V27.WebhookPayload.reference({...e,payloadType:uI(e.payloadType)})}}function yg5(e){return{...e,properties:bg5(e.properties)}}function bg5(e){return e.map(t=>vg5(t))}function vg5(e){return{...e,valueType:uI(e.valueType)}}function gg5(e){return{...e,endpoints:Og5(e.endpoints),headers:nKs(e.headers),pathParameters:iKs(e.pathParameters)}}function Og5(e){return e.map(t=>Ag5(t))}function Ag5(e){return{...e,headers:nKs(e.headers),pathParameters:iKs(e.pathParameters),allPathParameters:iKs(e.allPathParameters),queryParameters:zg5(e.queryParameters),requestBody:e.requestBody!=null?Dg5(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?Eg5(e.sdkRequest):void 0,response:e.response!=null?mg5(e.response):void 0}}function mg5(e){switch(e.type){case"json":return I.V27.HttpResponse.json(wg5(e.value));case"fileDownload":return I.V27.HttpResponse.fileDownload(e);case"text":return I.V27.HttpResponse.text(e);case"streaming":return I.V27.HttpResponse.streaming(Pg5(e));default:vt(e)}}function Pg5(e){return{...e,dataEventType:jg5(e.dataEventType)}}function jg5(e){switch(e.type){case"json":return I.V27.StreamingResponseChunkType.json(uI(e.json));case"text":return I.V27.StreamingResponseChunkType.text();default:vt(e)}}function wg5(e){switch(e.type){case"response":return I.V27.JsonResponse.response({...e,responseBodyType:uI(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:uI(e.responseBodyType),responseProperty:e.responseProperty!=null?npE(e.responseProperty):void 0});default:vt(e)}}function Eg5(e){return{...e,shape:Sg5(e.shape)}}function Sg5(e){switch(e.type){case"justRequestBody":return I.V27.SdkRequestShape.justRequestBody(Mg5(e.value));case"wrapper":return I.V27.SdkRequestShape.wrapper(e);default:vt(e)}}function Mg5(e){switch(e.type){case"typeReference":return I.V27.SdkRequestBodyType.typeReference(tpE(e));case"bytes":return I.V27.SdkRequestBodyType.bytes(e);default:vt(e)}}function Dg5(e){switch(e.type){case"inlinedRequestBody":return I.V27.HttpRequestBody.inlinedRequestBody(qg5(e));case"reference":return I.V27.HttpRequestBody.reference(tpE(e));case"fileUpload":return I.V27.HttpRequestBody.fileUpload(Bg5(e));case"bytes":return I.V27.HttpRequestBody.bytes(e);default:vt(e)}}function Bg5(e){return{...e,properties:Ig5(e.properties)}}function Ig5(e){return e.map(t=>Cg5(t))}function Cg5(e){switch(e.type){case"file":return I.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return I.V27.FileUploadRequestProperty.bodyProperty(rpE(e));default:vt(e)}}function tpE(e){return{...e,requestBodyType:uI(e.requestBodyType)}}function qg5(e){return{...e,properties:Tg5(e.properties)}}function Tg5(e){return e.map(t=>rpE(t))}function rpE(e){return{...e,valueType:uI(e.valueType)}}function iKs(e){return e.map(t=>Rg5(t))}function Rg5(e){return{...e,valueType:uI(e.valueType)}}function zg5(e){return e.map(t=>Ng5(t))}function Ng5(e){return{...e,valueType:uI(e.valueType)}}function Fg5(e){return{...e,schemes:Qg5(e.schemes)}}function Qg5(e){return e.map(t=>Ug5(t))}function Ug5(e){switch(e.type){case"basic":return I.V27.AuthScheme.basic(e);case"bearer":return I.V27.AuthScheme.bearer(e);case"header":return Lg5(e);default:vt(e)}}function Lg5(e){return I.V27.AuthScheme.header({...e,valueType:uI(e.valueType)})}function nKs(e){return e.map(t=>Vg5(t))}function Vg5(e){return{...e,valueType:uI(e.valueType)}}function Wg5(e){return{...e,shape:Gg5(e.shape)}}function Gg5(e){switch(e.type){case"alias":return I.V27.Type.alias(Hg5(e));case"enum":return I.V27.Type.enum(e);case"object":return I.V27.Type.object(xg5(e));case"union":return I.V27.Type.union(Kg5(e));case"undiscriminatedUnion":return I.V27.Type.undiscriminatedUnion(Jg5(e));default:vt(e)}}function Hg5(e){return{aliasOf:uI(e.aliasOf),resolvedType:Zg5(e.resolvedType)}}function xg5(e){return{...e,properties:ipE(e.properties)}}function Kg5(e){return{...e,types:$g5(e.types),baseProperties:ipE(e.baseProperties)}}function Jg5(e){return{members:Xg5(e.members)}}function ipE(e){return e.map(t=>npE(t))}function npE(e){return{...e,valueType:uI(e.valueType)}}function $g5(e){return e.map(t=>({...t,shape:Yg5(t.shape)}))}function Yg5(e){switch(e.propertiesType){case"samePropertiesAsObject":return I.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return I.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:uI(e.type)});case"noProperties":return I.V27.SingleUnionTypeProperties.noProperties();default:vt(e)}}function Xg5(e){return e.map(t=>({...t,type:uI(t.type)}))}function Zg5(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?I.V27.ResolvedTypeReference.primitive(I.V27.PrimitiveType.Boolean):I.V27.ResolvedTypeReference.container(I.V27.ContainerType.literal(I.V27.Literal.string(e.container.literal.string))):I.V27.ResolvedTypeReference.container(apE(e.container));case"named":return I.V27.ResolvedTypeReference.named(e);case"primitive":return I.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return I.V27.ResolvedTypeReference.unknown();default:vt(e)}}function uI(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?I.V27.TypeReference.primitive(I.V27.PrimitiveType.Boolean):I.V27.TypeReference.container(I.V27.ContainerType.literal(I.V27.Literal.string(e.container.literal.string))):I.V27.TypeReference.container(apE(e.container));case"named":return I.V27.TypeReference.named(e);case"primitive":return I.V27.TypeReference.primitive(e.primitive);case"unknown":return I.V27.TypeReference.unknown();default:vt(e)}}function apE(e){switch(e.type){case"list":return I.V27.ContainerType.list(uI(e.list));case"map":return I.V27.ContainerType.map({keyType:uI(e.keyType),valueType:uI(e.valueType)});case"optional":return I.V27.ContainerType.optional(uI(e.optional));case"set":return I.V27.ContainerType.set(uI(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return I.V27.ContainerType.literal(I.V27.Literal.string(e.literal.string));default:vt(e)}}var upE={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[P.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.8.6-1-g3d8d8591",[P.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[P.JAVA]:C,[P.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[P.JAVA_SDK]:"0.5.14-1-ge4bcd98",[P.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,kg5({typeId:t,allTypes:e.types})]))})};function kg5({typeId:e,allTypes:t}){let r=opE({typeId:e,allTypes:t});return{availability:r.availability,docs:r.docs,name:r.name,shape:r.shape,examples:r.examples,referencedTypes:Array.from(r.referencedTypes).map(i=>{let n=opE({typeId:i,allTypes:t});return{typeId:i,fernFilepath:n.name.fernFilepath,name:n.name.name}})}}function opE({typeId:e,allTypes:t}){let r=t[e];if(r==null)throw new Error(`Type definition for type id ${e} is undefined`);return r}var spE={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[P.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new iop(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},iop=class{ir;constructor(t){this.ir=t}convertTypes(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertType(i)]))}convertServices(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertService(i)]))}convertService(t){return{...t,endpoints:this.convertEndpoints(t.endpoints)}}convertEndpoints(t){return t.map(r=>({...r,examples:this.convertExampleEndpointCalls(r.examples)}))}convertExampleEndpointCalls(t){return t.map(r=>({...r,rootPathParameters:this.convertExamplePathParameters(r.rootPathParameters),servicePathParameters:this.convertExamplePathParameters(r.servicePathParameters),endpointPathParameters:this.convertExamplePathParameters(r.endpointPathParameters),serviceHeaders:this.convertExampleHeaders(r.serviceHeaders),endpointHeaders:this.convertExampleHeaders(r.endpointHeaders),queryParameters:this.convertExampleQueryParameters(r.queryParameters),request:r.request!=null?this.convertExampleRequestBody(r.request):void 0,response:this.convertExampleResponse(r.response)}))}convertExamplePathParameters(t){return t.map(r=>({key:r.name.originalName,value:this.convertExampleTypeReference(r.value)}))}convertExampleHeaders(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleQueryParameters(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleRequestBody(t){switch(t.type){case"inlinedRequestBody":return I.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return I.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:vt(t)}}convertExampleResponse(t){switch(t.type){case"ok":return I.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return I.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:vt(t)}}convertType(t){return{...t,examples:this.convertExampleTypes(t.examples)}}convertExampleTypes(t){return t.map(r=>this.convertExampleType(r))}convertExampleType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeReferences(t){return t.map(r=>this.convertExampleTypeReference(r))}convertExampleTypeReference(t){return{...t,shape:this.convertExampleTypeReferenceShape(t.shape)}}convertExampleTypeReferenceShape(t){switch(t.type){case"primitive":return I.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return I.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return I.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return I.V29.ExampleTypeReferenceShape.unknown(t);default:vt(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return I.V29.ExamplePrimitive.integer(t.integer);case"double":return I.V29.ExamplePrimitive.double(t.double);case"string":return I.V29.ExamplePrimitive.string(t.string.original);case"boolean":return I.V29.ExamplePrimitive.boolean(t.boolean);case"long":return I.V29.ExamplePrimitive.long(t.long);case"datetime":return I.V29.ExamplePrimitive.datetime(t.datetime);case"date":return I.V29.ExamplePrimitive.date(t.date);case"uuid":return I.V29.ExamplePrimitive.uuid(t.uuid);default:vt(t)}}convertExampleContainer(t){switch(t.type){case"list":return I.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return I.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return I.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return I.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:vt(t)}}convertKeyValuePairs(t){return t.map(r=>({key:this.convertExampleTypeReference(r.key),value:this.convertExampleTypeReference(r.value)}))}convertExampleNamedType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeShape(t){switch(t.type){case"alias":return I.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return I.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return I.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return I.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:vt(t)}}convertExampleObjectType(t){return{properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}}convertExampleUnionType(t){return{wireDiscriminantValue:t.singleUnionType.wireDiscriminantValue.wireValue,properties:this.convertExampleSingleUnionTypeProperties(t.singleUnionType.shape)}}convertExampleSingleUnionTypeProperties(t){switch(t.type){case"samePropertiesAsObject":{let r=this.ir.types[t.typeId]?.name;if(r==null)throw new Error(`Internal error; type ID ${t.typeId} does not exist in the IR`);return I.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(I.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return I.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return I.V29.ExampleSingleUnionTypeProperties.noProperties();default:vt(t)}}};var cpE={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.8.8",[P.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.8.8",[P.TYPESCRIPT_EXPRESS]:"0.8.8",[P.JAVA]:C,[P.JAVA_MODEL]:"0.7.0-rc0",[P.JAVA_SDK]:"0.7.0-rc0",[P.JAVA_SPRING]:"0.7.0-rc0",[P.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[P.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.7.5-1-gb54fb677",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:k,[P.RUBY_SDK]:k,[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V30.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({apiName:e.apiName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:e.auth,headers:e.headers,types:e.types,webhookGroups:e.webhookGroups,errors:e.errors,subpackages:e.subpackages,rootPackage:e.rootPackage,constants:e.constants,environments:e.environments,basePath:e.basePath,pathParameters:e.pathParameters,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,variables:e.variables,serviceTypeReferenceInfo:e.serviceTypeReferenceInfo,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{availability:r.availability,name:r.name,displayName:r.displayName,basePath:r.basePath,endpoints:r.endpoints.map(i=>({id:i.id,docs:i.docs,availability:i.availability,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,examples:i.examples})),headers:r.headers,pathParameters:r.pathParameters}]))})};var fpE={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.9.4-2-g139cf36",[P.GO_MODEL]:"0.9.4-2-g139cf36",[P.GO_SDK]:"0.9.4-2-g139cf36",[P.RUBY_MODEL]:"0.0.0",[P.RUBY_SDK]:"0.0.0",[P.CSHARP_MODEL]:k,[P.CSHARP_SDK]:k,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:aO5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(eO5)}]))})};function exn({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function eO5(e){return{...e,examples:exn({examples:e.examples,convert:tO5})}}function tO5(e){let t;if(e.request!=null&&(t=rO5(e.request),t==null))return;let r=iO5(e.response);if(r!=null)return{...e,rootPathParameters:exn({examples:e.rootPathParameters,convert:nop}),endpointPathParameters:exn({examples:e.endpointPathParameters,convert:nop}),servicePathParameters:exn({examples:e.servicePathParameters,convert:nop}),endpointHeaders:exn({examples:e.endpointHeaders,convert:lpE}),serviceHeaders:exn({examples:e.serviceHeaders,convert:lpE}),queryParameters:exn({examples:e.queryParameters,convert:nO5}),request:t,response:r}}function rO5(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let i=ebe(r.value);i!=null&&t.push({...r,value:i})}return I.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=aop(e.shape);return t==null?void 0:I.V31.ExampleRequestBody.reference({...e,shape:t})}default:vt(e)}}function iO5(e){switch(e.type){case"ok":{if(e.body==null)return I.V31.ExampleResponse.ok({body:void 0});let t=ebe(e.body);return t==null?void 0:I.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return I.V31.ExampleResponse.error({...e,body:void 0});let t=ebe(e.body);return t==null?void 0:I.V31.ExampleResponse.error({...e,body:t})}}}function nop(e){let t=ebe(e.value);if(t!=null)return{...e,value:t}}function lpE(e){let t=ebe(e.value);if(t!=null)return{...e,value:t}}function nO5(e){let t=ebe(e.value);if(t!=null)return{...e,value:t}}function aO5(e){let t=[];for(let r of e){let i=oO5(r);i!=null&&t.push(i)}return t}function oO5(e){let t=dpE(e.shape);if(t!=null)return{...e,shape:t}}function dpE(e){switch(e.type){case"enum":return I.V31.ExampleTypeShape.enum(e);case"alias":{let t=ebe(e.value);return t==null?void 0:I.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let i=ebe(r.value);i!=null&&t.push({...r,value:i})}return I.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=uO5(e.singleUnionType);return t==null?void 0:I.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:vt(e)}}function ebe(e){let t=aop(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function uO5(e){let t=sO5(e.shape);if(t!=null)return{...e,shape:t}}function sO5(e){switch(e.type){case"noProperties":return I.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=aop(e.shape);return t==null?void 0:I.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let i=ebe(r.value);i!=null&&t.push({...r,value:i})}return I.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:vt(e)}}function aop(e){switch(e.type){case"container":{let t=cO5(e.container);return t==null?void 0:I.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=dpE(e.shape);return t==null?void 0:I.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return I.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return I.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:vt(e)}}function cO5(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let i=ebe(r);i!=null&&t.push(i)}return I.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let i=ebe(r);i!=null&&t.push(i)}return I.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let i=ebe(r.key),n=ebe(r.value);i!=null&&n!=null&&t.push({key:i,value:n})}return I.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return I.V31.ExampleContainer.optional();let t=ebe(e.optional);return t==null?I.V31.ExampleContainer.optional():I.V31.ExampleContainer.optional(t)}default:vt(e)}}var ppE={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.12.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.12.0",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.13.0-3-g8c56a41",[P.GO_MODEL]:"0.13.0-3-g8c56a41",[P.GO_SDK]:"0.13.0-3-g8c56a41",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:"0.0.0",[P.CSHARP_SDK]:"0.0.0",[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new oop(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>t.convertEndpoint(n))}]))}}},oop=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:I.V33.TypeReference.container(I.V33.ContainerType.optional(I.V33.TypeReference.primitive("STRING")))}:r),examples:lO5({examples:t.examples,convert:fO5})}}isTypeReferenceObject(t){switch(t.type){case"container":return this.isContainerObject(t.container);case"named":return this.isNamedTypeObject(t);case"primitive":return!1;case"unknown":return!0;default:vt(t)}}isContainerObject(t){switch(t.type){case"map":case"list":case"set":return!0;case"optional":return this.isTypeReferenceObject(t.optional);case"literal":return!1;default:vt(t)}}isNamedTypeObject(t){let r=this.ir.types[t.typeId];if(r==null)return!0;switch(r.shape.type){case"alias":return this.isTypeReferenceObject(r.shape.aliasOf);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:vt(r.shape)}}};function lO5({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function fO5(e){return{...e,queryParameters:e.queryParameters.filter(t=>!uop(t.value))}}function uop(e){switch(e.shape.type){case"container":return dO5(e.shape.container);case"named":return pO5(e.shape);case"primitive":return!1;case"unknown":return!0;default:vt(e.shape)}}function dO5(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&uop(e.optional);default:vt(e)}}function pO5(e){switch(e.shape.type){case"alias":return uop(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:vt(e.shape)}}var Dza=ce(XPl(),1);var _pE={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.10.4",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V33.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,requestBody:n.requestBody?._visit({inlinedRequestBody:a=>Dza.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>Dza.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>Dza.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(o=>(o.type==="file"&&o.value.type==="fileArray"&&t.taskContext.logger.warn(`${n.method} ${n.fullPath.head} accepts a list of files however the ${t.targetGenerator?.name}@${t.targetGenerator?.version} only supports accepting a single file. File an [issue](https://github.com/fern-api/fern/issues) to add request for file arrays in ${t.targetGenerator?.name}@${t.targetGenerator?.version}!`),o.type==="file"?Dza.FernIrV33.FileUploadRequestProperty.file({...o.value}):o))}),bytes:a=>Dza.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var hpE={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.18.0",[P.GO_MODEL]:"0.18.0",[P.GO_SDK]:"0.18.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V34.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({docs:i.docs,availability:i.availability,id:i.id,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,idempotent:i.idempotent,examples:i.examples}))}]))})};var ypE={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.11.6",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var bpE={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.13.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.13.0",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"0.12.0",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V36.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.filter(a=>a.exampleType==="userProvided")}))}]))})};var vpE={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[P.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.15.0-rc0",[P.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.9.0-rc0",[P.PYTHON_PYDANTIC]:"0.9.0-rc0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"1.2.0-rc0",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V37.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?._visit({fileDownload:a=>I.V37.HttpResponse.fileDownload(a),json:a=>I.V37.HttpResponse.json(a),streaming:a=>a._visit({json:o=>I.V37.HttpResponse.streaming({dataEventType:I.V37.StreamingResponseChunkType.json(o.payload),docs:o.docs,terminator:o.terminator}),sse:()=>{},text:o=>I.V37.HttpResponse.streaming({dataEventType:I.V37.StreamingResponseChunkType.text(),docs:o.docs,terminator:void 0}),_other:()=>{}}),text:a=>I.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var gpE={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.9.0-rc1",[P.PYTHON_PYDANTIC]:"0.9.0-rc1",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"1.4.0-rc1",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:"0.7.0-rc0",[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>_O5(r))}})};function _O5(e){switch(e.type){case"basic":return I.V38.AuthScheme.basic(e);case"bearer":return I.V38.AuthScheme.bearer(e);case"header":return I.V38.AuthScheme.header(e);case"oauth":return I.V38.AuthScheme.bearer({docs:e.docs,token:{originalName:"token",camelCase:{unsafeName:"token",safeName:"token"},pascalCase:{unsafeName:"Token",safeName:"Token"},snakeCase:{unsafeName:"token",safeName:"token"},screamingSnakeCase:{unsafeName:"TOKEN",safeName:"TOKEN"}},tokenEnvVar:void 0});default:vt(e)}}var OpE={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:"0.20.0",[P.GO_MODEL]:"0.20.0",[P.GO_SDK]:"0.20.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var ApE={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V40.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,errors:Object.fromEntries(Object.entries(e.errors).map(([r,i])=>[r,{name:i.name,discriminantValue:i.discriminantValue,type:i.type,statusCode:i.statusCode,docs:i.docs}]))})};var mpE={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"0.8.0-rc0",[P.JAVA_SDK]:"0.9.0-rc0",[P.JAVA_SPRING]:"0.8.0-rc0",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>hO5(r))}})};function hO5(e){switch(e.type){case"basic":return I.V41.AuthScheme.basic(e);case"bearer":return I.V41.AuthScheme.bearer(e);case"header":return I.V41.AuthScheme.header(e);case"oauth":return I.V41.AuthScheme.oauth(yO5(e));default:vt(e)}}function yO5(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:I.V41.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:{...e.configuration.tokenEndpoint,endpointReference:e.configuration.tokenEndpoint.endpointReference.endpointId},refreshEndpoint:e.configuration.refreshEndpoint!=null?{...e.configuration.refreshEndpoint,endpointReference:e.configuration.refreshEndpoint?.endpointReference.endpointId}:void 0})};default:vt(e.configuration.type)}}var PpE={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.17.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.17.0",[P.TYPESCRIPT_EXPRESS]:"0.13.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V42.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?.body}))}]))})};var wpE={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V43.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.map(a=>bO5({example:a})).filter(ds)}))}]))})};function bO5({example:e}){return e._visit({userProvided:t=>I.V43.HttpEndpointExample.userProvided(jpE({example:t})),generated:t=>I.V43.HttpEndpointExample.generated(jpE({example:t})),_other:()=>{}})}function jpE({example:e}){return{...e,response:vO5({example:e.response})}}function vO5({example:e}){switch(e.type){case"ok":return gO5({example:e.value});case"error":return I.V43.ExampleResponse.error(e);default:vt(e)}}function gO5({example:e}){switch(e.type){case"body":return I.V43.ExampleResponse.ok({body:e.value});case"sse":return I.V43.ExampleResponse.ok({body:void 0});case"stream":return I.V43.ExampleResponse.ok({body:void 0});default:vt(e)}}var EpE={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V45.types.Type._visit(r.shape,{union:i=>I.V44.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Kj(n.valueType)})),types:i.types.map(n=>IO5(n))}),enum:I.V44.types.Type.enum,object:i=>I.V44.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Kj(n.valueType)}))}),alias:i=>I.V44.types.Type.alias({aliasOf:Kj(i.aliasOf),resolvedType:qO5(i.resolvedType)}),undiscriminatedUnion:i=>I.V44.types.Type.undiscriminatedUnion(TO5(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:EO5(e.auth),headers:e.headers.map(r=>Bza(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>Bza(r)),types:t,services:bn(e.services,r=>RO5(r)),errors:bn(e.errors,r=>XO5(r)),webhookGroups:bn(e.webhookGroups,r=>PO5(r)),websocketChannels:bn(e.websocketChannels,r=>OO5(r)),pathParameters:e.pathParameters.map(r=>BDo(r)),variables:e.variables.map(r=>zO5(r))}}};function OO5(e){return{...e,headers:e.headers.map(t=>Bza(t)),queryParameters:e.queryParameters.map(t=>IDo(t)),pathParameters:e.pathParameters.map(t=>BDo(t)),messages:e.messages.map(t=>AO5(t))}}function AO5(e){return{...e,body:mO5(e.body)}}function mO5(e){switch(e.type){case"inlinedBody":return I.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Kj(t.valueType)}))});case"reference":return I.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:Kj(e.bodyType)})}}function PO5(e){return e.map(t=>jO5(t))}function jO5(e){return{...e,headers:e.headers.map(t=>Bza(t)),payload:wO5(e.payload)}}function wO5(e){switch(e.type){case"reference":return I.V44.webhooks.WebhookPayload.reference({...e,payloadType:Kj(e.payloadType)});case"inlinedPayload":return I.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Kj(t.valueType)}))})}}function EO5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V44.auth.AuthScheme.basic(t);case"bearer":return I.V44.auth.AuthScheme.bearer(t);case"header":return I.V44.auth.AuthScheme.header(SO5(t));case"oauth":return I.V44.auth.AuthScheme.oauth(MO5(t))}})}}function SO5(e){return{...e,valueType:Kj(e.valueType)}}function MO5(e){return{...e,configuration:I.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:DO5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?BO5(e.configuration.refreshEndpoint):void 0})}}function DO5(e){return{...e,requestProperties:{clientId:aKs(e.requestProperties.clientId),clientSecret:aKs(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?aKs(e.requestProperties.scopes):void 0},responseProperties:{accessToken:F6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?F6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?F6i(e.responseProperties.refreshToken):void 0}}}function BO5(e){return{...e,requestProperties:{refreshToken:aKs(e.requestProperties.refreshToken)},responseProperties:{accessToken:F6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?F6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?F6i(e.responseProperties.refreshToken):void 0}}}function Bza(e){return{...e,valueType:Kj(e.valueType)}}function Kj(e){return I.V45.types.TypeReference._visit(e,{container:t=>I.V44.types.TypeReference.container(SpE(t)),primitive:t=>t.v1==="BIG_INTEGER"?I.V44.types.TypeReference.primitive(I.V44.types.PrimitiveType.String):I.V44.types.TypeReference.primitive(t.v1),named:I.V44.types.TypeReference.named,unknown:I.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function SpE(e){return I.V45.types.ContainerType._visit(e,{list:t=>I.V44.types.ContainerType.list(Kj(t)),optional:t=>I.V44.types.ContainerType.optional(Kj(t)),set:t=>I.V44.types.ContainerType.set(Kj(t)),map:({keyType:t,valueType:r})=>I.V44.types.ContainerType.map({keyType:Kj(t),valueType:Kj(r)}),literal:I.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function IO5(e){return{...e,shape:CO5(e.shape)}}function CO5(e){return I.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:Kj(t.type)}),noProperties:I.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function qO5(e){return I.V45.types.ResolvedTypeReference._visit(e,{container:t=>I.V44.types.ResolvedTypeReference.container(SpE(t)),named:I.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?I.V44.types.ResolvedTypeReference.primitive(I.V44.types.PrimitiveType.String):I.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:I.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function TO5(e){return{members:e.members.map(t=>({...t,type:Kj(t.type)}))}}function RO5(e){return{...e,pathParameters:e.pathParameters.map(t=>BDo(t)),headers:e.headers.map(t=>Bza(t)),endpoints:e.endpoints.map(t=>NO5(t))}}function BDo(e){return{...e,valueType:Kj(e.valueType)}}function zO5(e){return{...e,type:Kj(e.type)}}function NO5(e){return{...e,pagination:e.pagination!=null?VO5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>BDo(t)),pathParameters:e.pathParameters.map(t=>BDo(t)),sdkRequest:e.sdkRequest!=null?xO5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?$O5(e.requestBody):void 0,response:e.response!=null?FO5(e.response):void 0,headers:e.headers.map(t=>Bza(t)),queryParameters:e.queryParameters.map(t=>IDo(t))}}function FO5(e){return{...e,body:e.body!=null?QO5(e.body):void 0}}function QO5(e){switch(e.type){case"json":return I.V44.http.HttpResponseBody.json(UO5(e.value));case"fileDownload":return I.V44.http.HttpResponseBody.fileDownload(e);case"text":return I.V44.http.HttpResponseBody.text(e);case"streaming":return I.V44.http.HttpResponseBody.streaming(LO5(e.value))}}function UO5(e){switch(e.type){case"response":return I.V44.http.JsonResponse.response({...e,responseBodyType:Kj(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Kj(e.responseBodyType),responseProperty:e.responseProperty!=null?sop(e.responseProperty):void 0})}}function LO5(e){switch(e.type){case"json":return I.V44.http.StreamingResponse.json({...e,payload:Kj(e.payload)});case"text":return I.V44.http.StreamingResponse.text(e);case"sse":return I.V44.http.StreamingResponse.sse({...e,payload:Kj(e.payload)})}}function VO5(e){switch(e.type){case"cursor":return I.V44.http.Pagination.cursor(WO5(e));case"offset":return I.V44.http.Pagination.offset(GO5(e))}}function WO5(e){return{...e,page:IDo(e.page),next:F6i(e.next),results:F6i(e.results)}}function GO5(e){return{...e,page:IDo(e.page),results:F6i(e.results)}}function aKs(e){return{...e,property:HO5(e.property)}}function HO5(e){switch(e.type){case"query":return I.V44.RequestPropertyValue.query(IDo(e));case"body":return I.V44.RequestPropertyValue.body(sop(e))}}function F6i(e){return{...e,property:sop(e.property)}}function sop(e){return{...e,valueType:Kj(e.valueType)}}function IDo(e){return{...e,valueType:Kj(e.valueType)}}function xO5(e){return{...e,shape:KO5(e.shape)}}function KO5(e){return I.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V44.http.SdkRequestShape.justRequestBody(JO5(t)),wrapper:I.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function JO5(e){switch(e.type){case"bytes":return I.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Kj(e.requestBodyType)})}}function $O5(e){return I.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Kj(r.valueType)}))}),reference:t=>I.V44.http.HttpRequestBody.reference({...t,requestBodyType:Kj(t.requestBodyType)}),fileUpload:t=>I.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Kj(r.valueType)});case"file":return I.V44.http.FileUploadRequestProperty.file(YO5(r.value))}})}),bytes:t=>I.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function YO5(e){switch(e.type){case"file":return I.V44.http.FileProperty.file(e);case"fileArray":return I.V44.http.FileProperty.fileArray(e)}}function XO5(e){return{...e,type:e.type!=null?Kj(e.type):void 0}}var DpE={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.21.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.21.0",[P.TYPESCRIPT_EXPRESS]:"0.16.0",[P.JAVA]:C,[P.JAVA_MODEL]:"0.9.0",[P.JAVA_SDK]:"0.10.0",[P.JAVA_SPRING]:"0.9.0",[P.PYTHON_FASTAPI]:"0.10.1",[P.PYTHON_PYDANTIC]:"0.9.1",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"2.9.9",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:ZO5(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({...i,examples:kO5(i.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:eA5(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(i=>({...i,shape:bq(i.shape)}))}]))})};function bq(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.list(r.map(i=>bq(i)))),set:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.set(r.map(i=>bq(i)))),map:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.map(r.map(i=>({key:bq(i.key),value:bq(i.value)})))),optional:r=>I.V45.ExampleTypeReferenceShape.container(I.V45.ExampleContainer.optional(r!=null?bq(r):void 0)),literal:r=>I.V45.ExampleTypeReferenceShape.primitive(r._visit({string:i=>I.V45.ExamplePrimitive.string(i),integer:i=>I.V45.ExamplePrimitive.integer(i),double:i=>I.V45.ExamplePrimitive.double(i),long:i=>I.V45.ExamplePrimitive.long(i),boolean:i=>I.V45.ExamplePrimitive.boolean(i),datetime:i=>I.V45.ExamplePrimitive.datetime(i),date:i=>I.V45.ExamplePrimitive.date(i),uuid:i=>I.V45.ExamplePrimitive.uuid(i),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}})}),named:t=>({...e,shape:I.V45.ExampleTypeReferenceShape.named({...t,shape:BpE(t.shape)})}),primitive:t=>({...e,shape:I.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>I.V45.ExamplePrimitive.string(r),integer:r=>I.V45.ExamplePrimitive.integer(r),double:r=>I.V45.ExamplePrimitive.double(r),long:r=>I.V45.ExamplePrimitive.long(r),boolean:r=>I.V45.ExamplePrimitive.boolean(r),datetime:r=>I.V45.ExamplePrimitive.datetime(r),date:r=>I.V45.ExamplePrimitive.date(r),uuid:r=>I.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:I.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function MpE(e){return{...e,properties:e.properties.map(t=>({...t,value:bq(t.value)}))}}function BpE(e){return e.type==="alias"?I.V45.ExampleTypeShape.alias({value:bq(e.value)}):e.type==="object"?I.V45.ExampleTypeShape.object(MpE(e)):e.type==="union"?I.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>I.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:MpE(t.object)}),singleProperty:t=>I.V45.ExampleSingleUnionTypeProperties.singleProperty(bq(t)),noProperties:()=>I.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?I.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:bq(e.singleUnionType)}):I.V45.ExampleTypeShape.enum(e)}function ZO5(e){return e.map(t=>({...t,shape:BpE(t.shape)}))}function oKs(e){return e.map(t=>({...t,value:bq(t.value)}))}function cop(e){return e.map(t=>({...t,value:bq(t.value)}))}function IpE(e){return e.map(t=>({...t,value:bq(t.value)}))}function kO5(e){return e.map(t=>{let r={...t,rootPathParameters:oKs(t.rootPathParameters),servicePathParameters:oKs(t.servicePathParameters),endpointPathParameters:oKs(t.endpointPathParameters),serviceHeaders:cop(t.serviceHeaders),endpointHeaders:cop(t.endpointHeaders),queryParameters:IpE(t.queryParameters),request:t.request?._visit({inlinedRequestBody:i=>I.V45.ExampleRequestBody.inlinedRequestBody({...i,properties:i.properties.map(n=>({...n,value:bq(n.value)}))}),reference:i=>I.V45.ExampleRequestBody.reference(bq(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}}),response:t.response._visit({ok:i=>I.V45.ExampleResponse.ok(i._visit({body:n=>I.V45.ExampleEndpointSuccessResponse.body(n!=null?bq(n):void 0),stream:n=>I.V45.ExampleEndpointSuccessResponse.stream(n.map(bq)),sse:n=>I.V45.ExampleEndpointSuccessResponse.sse(n.map(a=>({...a,data:bq(a.data)}))),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})),error:i=>I.V45.ExampleResponse.error({...i,body:i.body!=null?bq(i.body):void 0}),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})};return t._visit({userProvided:()=>I.V45.HttpEndpointExample.userProvided(r),generated:()=>I.V45.HttpEndpointExample.generated(r),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})})}function eA5(e){return e.map(t=>({...t,pathParameters:oKs(t.pathParameters),headers:cop(t.headers),queryParameters:IpE(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:i=>I.V45.ExampleWebSocketMessageBody.inlinedBody({...i,properties:i.properties.map(n=>({...n,value:bq(n.value)}))}),reference:i=>I.V45.ExampleWebSocketMessageBody.reference(bq(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})}))}))}var CpE={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V46.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>{let i=r.endpoints.map(n=>{let{autogeneratedExamples:a,userSpecifiedExamples:o,...c}=n;return{...c,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...n.userSpecifiedExamples.map(s=>{if(s.example!=null)return I.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(ds),...n.autogeneratedExamples.map(s=>I.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:i}]}))})};var qpE={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.29.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.29.0",[P.TYPESCRIPT_EXPRESS]:"0.17.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V47.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.map(a=>({...a,pagination:a.pagination!=null?rA5(a.pagination):void 0}));return[r,{...i,endpoints:n}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:tA5(t)},services:t}}};function tA5(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function rA5(e){switch(e.type){case"cursor":{let t=iA5(e);return t!=null?I.V47.Pagination.cursor(t):void 0}case"offset":{let t=nA5(e);return t!=null?I.V47.Pagination.offset(t):void 0}default:vt(e)}}function iA5(e){let t=TpE(e.page);if(t!=null)return{...e,page:t}}function nA5(e){if(e.step!=null)return;let t=TpE(e.page);if(t!=null)return{...e,page:t}}function TpE(e){switch(e.property.type){case"query":return e.property}}var RpE={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:"0.11.0-rc0",[P.PYTHON_PYDANTIC]:"0.10.0-rc0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:"2.11.0-rc0",[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:k,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V48.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.flatMap(a=>{let o;return a.response?.body!=null&&(o=a.response.body?._visit({json:d=>I.V48.HttpResponseBody.json({...d}),fileDownload:d=>I.V48.HttpResponseBody.fileDownload({...d}),text:d=>I.V48.HttpResponseBody.text({...d}),streaming:d=>I.V48.HttpResponseBody.streaming({...d}),streamParameter:()=>{},_other:()=>{}}),o==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:o}}});return[r,{...i,endpoints:n}]}));return{...e,services:t}}};var zpE={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.34.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:"0.34.0",[P.TYPESCRIPT_EXPRESS]:"0.17.2",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:"0.0.0",[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=bn(e.types,r=>({...r,shape:I.V50.types.Type._visit(r.shape,{union:i=>I.V49.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Jj(n.valueType)})),types:i.types.map(n=>yA5(n))}),enum:I.V49.types.Type.enum,object:i=>I.V49.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Jj(n.valueType)}))}),alias:i=>I.V49.types.Type.alias({aliasOf:Jj(i.aliasOf),resolvedType:vA5(i.resolvedType)}),undiscriminatedUnion:i=>I.V49.types.Type.undiscriminatedUnion(gA5(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:fA5(e.auth),headers:e.headers.map(r=>Iza(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>Iza(r)),types:t,services:bn(e.services,r=>OA5(r)),errors:bn(e.errors,r=>zA5(r)),webhookGroups:bn(e.webhookGroups,r=>sA5(r)),websocketChannels:bn(e.websocketChannels,r=>aA5(r)),pathParameters:e.pathParameters.map(r=>CDo(r)),variables:e.variables.map(r=>AA5(r))}}};function aA5(e){return{...e,headers:e.headers.map(t=>Iza(t)),queryParameters:e.queryParameters.map(t=>fop(t)),pathParameters:e.pathParameters.map(t=>CDo(t)),messages:e.messages.map(t=>oA5(t))}}function oA5(e){return{...e,body:uA5(e.body)}}function uA5(e){switch(e.type){case"inlinedBody":return I.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Jj(t.valueType)}))});case"reference":return I.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:Jj(e.bodyType)})}}function sA5(e){return e.map(t=>cA5(t))}function cA5(e){return{...e,headers:e.headers.map(t=>Iza(t)),payload:lA5(e.payload)}}function lA5(e){switch(e.type){case"reference":return I.V49.webhooks.WebhookPayload.reference({...e,payloadType:Jj(e.payloadType)});case"inlinedPayload":return I.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Jj(t.valueType)}))})}}function fA5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V49.auth.AuthScheme.basic(t);case"bearer":return I.V49.auth.AuthScheme.bearer(t);case"header":return I.V49.auth.AuthScheme.header(dA5(t));case"oauth":return I.V49.auth.AuthScheme.oauth(pA5(t))}})}}function dA5(e){return{...e,valueType:Jj(e.valueType)}}function pA5(e){return{...e,configuration:I.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:_A5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?hA5(e.configuration.refreshEndpoint):void 0})}}function _A5(e){return{...e,requestProperties:{clientId:gcn(e.requestProperties.clientId),clientSecret:gcn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?gcn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Q6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Q6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Q6i(e.responseProperties.refreshToken):void 0}}}function hA5(e){return{...e,requestProperties:{refreshToken:gcn(e.requestProperties.refreshToken)},responseProperties:{accessToken:Q6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Q6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Q6i(e.responseProperties.refreshToken):void 0}}}function Iza(e){return{...e,valueType:Jj(e.valueType)}}function Jj(e){return I.V50.types.TypeReference._visit(e,{container:t=>I.V49.types.TypeReference.container(NpE(t)),primitive:t=>t.v2?.type==="integer"?I.V49.types.TypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?I.V49.types.TypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?I.V49.types.TypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.string(t.v2)}):I.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:I.V49.types.TypeReference.named,unknown:I.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function NpE(e){return I.V50.types.ContainerType._visit(e,{list:t=>I.V49.types.ContainerType.list(Jj(t)),optional:t=>I.V49.types.ContainerType.optional(Jj(t)),set:t=>I.V49.types.ContainerType.set(Jj(t)),map:({keyType:t,valueType:r})=>I.V49.types.ContainerType.map({keyType:Jj(t),valueType:Jj(r)}),literal:I.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function yA5(e){return{...e,shape:bA5(e.shape)}}function bA5(e){return I.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:Jj(t.type)}),noProperties:I.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function vA5(e){return I.V50.types.ResolvedTypeReference._visit(e,{container:t=>I.V49.types.ResolvedTypeReference.container(NpE(t)),named:I.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:I.V49.types.PrimitiveTypeV2.string(t.v2)}):I.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:I.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function gA5(e){return{members:e.members.map(t=>({...t,type:Jj(t.type)}))}}function OA5(e){return{...e,pathParameters:e.pathParameters.map(t=>CDo(t)),headers:e.headers.map(t=>Iza(t)),endpoints:e.endpoints.map(t=>mA5(t))}}function CDo(e){return{...e,valueType:Jj(e.valueType)}}function AA5(e){return{...e,type:Jj(e.type)}}function mA5(e){return{...e,pagination:e.pagination!=null?SA5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>CDo(t)),pathParameters:e.pathParameters.map(t=>CDo(t)),sdkRequest:e.sdkRequest!=null?IA5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?TA5(e.requestBody):void 0,response:e.response!=null?PA5(e.response):void 0,headers:e.headers.map(t=>Iza(t)),queryParameters:e.queryParameters.map(t=>fop(t))}}function PA5(e){return{...e,body:e.body!=null?jA5(e.body):void 0}}function jA5(e){switch(e.type){case"json":return I.V49.http.HttpResponseBody.json(FpE(e.value));case"fileDownload":return I.V49.http.HttpResponseBody.fileDownload(e);case"text":return I.V49.http.HttpResponseBody.text(e);case"streaming":return I.V49.http.HttpResponseBody.streaming(QpE(e.value));case"streamParameter":return I.V49.http.HttpResponseBody.streamParameter(EA5(e))}}function FpE(e){switch(e.type){case"response":return I.V49.http.JsonResponse.response({...e,responseBodyType:Jj(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Jj(e.responseBodyType),responseProperty:e.responseProperty!=null?lop(e.responseProperty):void 0})}}function QpE(e){switch(e.type){case"json":return I.V49.http.StreamingResponse.json({...e,payload:Jj(e.payload)});case"text":return I.V49.http.StreamingResponse.text(e);case"sse":return I.V49.http.StreamingResponse.sse({...e,payload:Jj(e.payload)})}}function wA5(e){switch(e.type){case"json":return I.V49.http.NonStreamHttpResponseBody.json(FpE(e.value));case"text":return I.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function EA5(e){return{nonStreamResponse:wA5(e.nonStreamResponse),streamResponse:QpE(e.streamResponse)}}function SA5(e){switch(e.type){case"cursor":return I.V49.http.Pagination.cursor(MA5(e));case"offset":return I.V49.http.Pagination.offset(DA5(e))}}function MA5(e){return{...e,page:gcn(e.page),next:Q6i(e.next),results:Q6i(e.results)}}function DA5(e){return{...e,page:gcn(e.page),results:Q6i(e.results),step:e.step!=null?gcn(e.step):void 0}}function gcn(e){return{...e,property:BA5(e.property)}}function BA5(e){switch(e.type){case"query":return I.V49.RequestPropertyValue.query(fop(e));case"body":return I.V49.RequestPropertyValue.body(lop(e))}}function Q6i(e){return{...e,property:lop(e.property)}}function lop(e){return{...e,valueType:Jj(e.valueType)}}function fop(e){return{...e,valueType:Jj(e.valueType)}}function IA5(e){return{...e,streamParameter:e.streamParameter!=null?gcn(e.streamParameter):void 0,shape:CA5(e.shape)}}function CA5(e){return I.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V49.http.SdkRequestShape.justRequestBody(qA5(t)),wrapper:I.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function qA5(e){switch(e.type){case"bytes":return I.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Jj(e.requestBodyType)})}}function TA5(e){return I.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Jj(r.valueType)}))}),reference:t=>I.V49.http.HttpRequestBody.reference({...t,requestBodyType:Jj(t.requestBodyType)}),fileUpload:t=>I.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Jj(r.valueType)});case"file":return I.V49.http.FileUploadRequestProperty.file(RA5(r.value))}})}),bytes:t=>I.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function RA5(e){switch(e.type){case"file":return I.V49.http.FileProperty.file(e);case"fileArray":return I.V49.http.FileProperty.fileArray(e)}}function zA5(e){return{...e,type:e.type!=null?Jj(e.type):void 0}}var VpE={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"0.1.2",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=bn(e.types,r=>{let i=r.autogeneratedExamples.map(a=>UpE(a)),n=r.userProvidedExamples.map(a=>UpE(a));return{...r,examples:[...i,...n]}});return{...e,types:t,services:bn(e.services,r=>KA5(r)),errors:bn(e.errors,r=>ZA5(r)),webhookGroups:bn(e.webhookGroups,r=>UA5(r)),websocketChannels:bn(e.websocketChannels,r=>NA5(r))}}};function NA5(e){return{...e,examples:e.examples.map(t=>FA5(t))}}function FA5(e){return{...e,pathParameters:e.pathParameters.map(t=>uKs(t)),headers:e.headers.map(t=>dop(t)),queryParameters:e.queryParameters.map(t=>WpE(t)),messages:e.messages.map(t=>({...t,body:QA5(t.body)}))}}function WpE(e){return{...e,value:Nz(e.value)}}function dop(e){return{...e,value:Nz(e.value)}}function uKs(e){return{...e,value:Nz(e.value)}}function QA5(e){switch(e.type){case"inlinedBody":return I.V50.ExampleWebSocketMessageBody.inlinedBody(GpE(e));case"reference":return I.V50.ExampleWebSocketMessageBody.reference(Nz(e))}}function GpE(e){return{...e,properties:e.properties.map(t=>({...t,value:Nz(t.value)}))}}function UA5(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:Nz(r.payload)}))}))}function UpE(e){return{...e,shape:HpE(e.shape)}}function pop(e){switch(e.type){case"primitive":return I.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return I.V50.ExampleTypeReferenceShape.container(LA5(e));case"unknown":return I.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:HpE(e.shape)})}}function LA5(e){switch(e.container.type){case"list":return I.V50.ExampleContainer.list(e.container.list.map(t=>Nz(t)));case"set":return I.V50.ExampleContainer.set(e.container.set.map(t=>Nz(t)));case"optional":return I.V50.ExampleContainer.optional(e.container.optional!=null?Nz(e.container.optional):void 0);case"map":return I.V50.ExampleContainer.map(e.container.map.map(t=>({key:Nz(t.key),value:Nz(t.value)})));case"literal":return I.V50.ExampleContainer.literal(e.container.literal)}}function Nz(e){return{...e,shape:pop(e.shape)}}function HpE(e){switch(e.type){case"object":return I.V50.ExampleTypeShape.object({properties:e.properties.map(t=>xpE(t))});case"alias":return I.V50.ExampleTypeShape.alias({value:{...Nz(e.value)}});case"enum":return I.V50.ExampleTypeShape.enum(e);case"union":return I.V50.ExampleTypeShape.union(WA5(e));case"undiscriminatedUnion":return I.V50.ExampleTypeShape.undiscriminatedUnion(VA5(e))}}function VA5(e){return{...e,singleUnionType:Nz(e.singleUnionType)}}function WA5(e){return{...e,singleUnionType:GA5(e.singleUnionType)}}function GA5(e){return{...e,shape:HA5(e.shape)}}function HA5(e){switch(e.type){case"samePropertiesAsObject":return I.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:xA5(e.object)});case"singleProperty":return I.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:pop(e.shape)});case"noProperties":return I.V50.ExampleSingleUnionTypeProperties.noProperties()}}function xA5(e){return{...e,properties:e.properties.map(t=>xpE(t))}}function xpE(e){return{...e,value:{...e.value,shape:pop(e.value.shape)}}}function KA5(e){return{...e,endpoints:e.endpoints.map(t=>JA5(t))}}function JA5(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:LpE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?LpE(t.example):void 0}))}}function LpE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>uKs(t)),servicePathParameters:e.servicePathParameters.map(t=>uKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>uKs(t)),serviceHeaders:e.serviceHeaders.map(t=>dop(t)),endpointHeaders:e.endpointHeaders.map(t=>dop(t)),queryParameters:e.queryParameters.map(t=>WpE(t)),request:e.request!=null?XA5(e.request):void 0,response:$A5(e.response)}}function $A5(e){switch(e.type){case"error":return I.V50.ExampleResponse.error({...e,body:e.body!=null?Nz(e.body):void 0});case"ok":return I.V50.ExampleResponse.ok(YA5(e))}}function YA5(e){switch(e.value.type){case"body":return I.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?Nz(e.value.value):void 0);case"stream":return I.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Nz(t)));case"sse":return I.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Nz(t.data)})))}}function XA5(e){switch(e.type){case"inlinedRequestBody":return I.V50.ExampleRequestBody.inlinedRequestBody(GpE(e));case"reference":return I.V50.ExampleRequestBody.reference(Nz(e))}}function ZA5(e){return{...e,examples:e.examples.map(t=>({...t,shape:Nz(t.shape)}))}}var $pE={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:k,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?em5(e.apiVersion):void 0,auth:sm5(e.auth),headers:e.headers.map(t=>txn(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>txn(t)),types:kA5(e.types),services:bn(e.services,t=>gm5(t)),webhookGroups:bn(e.webhookGroups,t=>nm5(t)),websocketChannels:bn(e.websocketChannels,t=>tm5(t)),errors:bn(e.errors,t=>Rm5(t)),pathParameters:e.pathParameters.map(t=>qDo(t)),variables:e.variables.map(t=>Om5(t))})};function kA5(e){return bn(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>KpE(r)),userProvidedExamples:t.userProvidedExamples.map(r=>KpE(r)),shape:I.V52.types.Type._visit(t.shape,{union:r=>I.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:aA(i.valueType)})),types:r.types.map(i=>hm5(i))}),enum:I.V51.types.Type.enum,object:r=>I.V51.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:aA(i.valueType)}))}),alias:r=>I.V51.types.Type.alias({aliasOf:aA(r.aliasOf),resolvedType:bm5(r.resolvedType)}),undiscriminatedUnion:r=>I.V51.types.Type.undiscriminatedUnion(vm5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function em5(e){return I.V51.ApiVersionScheme.header({...e,header:txn(e.header)})}function tm5(e){return{...e,headers:e.headers.map(t=>txn(t)),queryParameters:e.queryParameters.map(t=>yop(t)),pathParameters:e.pathParameters.map(t=>qDo(t)),messages:e.messages.map(t=>rm5(t)),examples:e.examples.map(t=>zm5(t))}}function rm5(e){return{...e,body:im5(e.body)}}function im5(e){switch(e.type){case"inlinedBody":return I.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:aA(t.valueType)}))});case"reference":return I.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:aA(e.bodyType)})}}function nm5(e){return e.map(t=>am5(t))}function am5(e){return{...e,headers:e.headers.map(t=>txn(t)),payload:om5(e.payload),examples:e.examples!=null?e.examples.map(t=>um5(t)):void 0}}function om5(e){switch(e.type){case"reference":return I.V51.webhooks.WebhookPayload.reference({...e,payloadType:aA(e.payloadType)});case"inlinedPayload":return I.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:aA(t.valueType)}))})}}function um5(e){return{...e,payload:Fz(e.payload)}}function sm5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V51.auth.AuthScheme.basic(t);case"bearer":return I.V51.auth.AuthScheme.bearer(t);case"header":return I.V51.auth.AuthScheme.header(cm5(t));case"oauth":return I.V51.auth.AuthScheme.oauth(lm5(t))}})}}function cm5(e){return{...e,valueType:aA(e.valueType)}}function lm5(e){return{...e,configuration:I.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:fm5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?dm5(e.configuration.refreshEndpoint):void 0})}}function fm5(e){return{...e,requestProperties:{clientId:Ocn(e.requestProperties.clientId),clientSecret:Ocn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Ocn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:U6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?U6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?U6i(e.responseProperties.refreshToken):void 0}}}function dm5(e){return{...e,requestProperties:{refreshToken:Ocn(e.requestProperties.refreshToken)},responseProperties:{accessToken:U6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?U6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?U6i(e.responseProperties.refreshToken):void 0}}}function txn(e){return{...e,valueType:aA(e.valueType)}}function aA(e){return I.V52.types.TypeReference._visit(e,{container:t=>I.V51.types.TypeReference.container(XpE(t)),primitive:t=>I.V51.types.TypeReference.primitive(YpE(t)),named:I.V51.types.TypeReference.named,unknown:I.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function YpE(e){return{v1:pm5(e.v1),v2:e.v2!=null?_m5(e.v2):void 0}}function pm5(e){switch(e){case"UINT":return I.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return I.V51.types.PrimitiveTypeV1.Long}return e}function _m5(e){switch(e.type){case"integer":return I.V51.types.PrimitiveTypeV2.integer(e);case"double":return I.V51.types.PrimitiveTypeV2.double(e);case"string":return I.V51.types.PrimitiveTypeV2.string(e);case"boolean":return I.V51.types.PrimitiveTypeV2.boolean(e);case"long":return I.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return I.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:vt(e)}}function XpE(e){return I.V52.types.ContainerType._visit(e,{list:t=>I.V51.types.ContainerType.list(aA(t)),optional:t=>I.V51.types.ContainerType.optional(aA(t)),set:t=>I.V51.types.ContainerType.set(aA(t)),map:({keyType:t,valueType:r})=>I.V51.types.ContainerType.map({keyType:aA(t),valueType:aA(r)}),literal:I.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function hm5(e){return{...e,shape:ym5(e.shape)}}function ym5(e){return I.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:aA(t.type)}),noProperties:I.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function bm5(e){return I.V52.types.ResolvedTypeReference._visit(e,{container:t=>I.V51.types.ResolvedTypeReference.container(XpE(t)),named:I.V51.types.ResolvedTypeReference.named,primitive:t=>I.V51.types.ResolvedTypeReference.primitive(YpE(t)),unknown:I.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function vm5(e){return{members:e.members.map(t=>({...t,type:aA(t.type)}))}}function gm5(e){return{...e,pathParameters:e.pathParameters.map(t=>qDo(t)),headers:e.headers.map(t=>txn(t)),endpoints:e.endpoints.map(t=>Am5(t))}}function qDo(e){return{...e,valueType:aA(e.valueType)}}function Om5(e){return{...e,type:aA(e.type)}}function Am5(e){return{...e,pagination:e.pagination!=null?Em5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>qDo(t)),pathParameters:e.pathParameters.map(t=>qDo(t)),sdkRequest:e.sdkRequest!=null?Bm5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?qm5(e.requestBody):void 0,response:e.response!=null?mm5(e.response):void 0,headers:e.headers.map(t=>txn(t)),queryParameters:e.queryParameters.map(t=>yop(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:JpE(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?JpE(t.example):void 0}))}}function mm5(e){return{...e,body:e.body!=null?Pm5(e.body):void 0}}function Pm5(e){switch(e.type){case"json":return I.V51.http.HttpResponseBody.json(ZpE(e.value));case"fileDownload":return I.V51.http.HttpResponseBody.fileDownload(e);case"text":return I.V51.http.HttpResponseBody.text(e);case"streaming":return I.V51.http.HttpResponseBody.streaming(kpE(e.value));case"streamParameter":return I.V51.http.HttpResponseBody.streamParameter(wm5(e))}}function ZpE(e){switch(e.type){case"response":return I.V51.http.JsonResponse.response({...e,responseBodyType:aA(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:aA(e.responseBodyType),responseProperty:e.responseProperty!=null?hop(e.responseProperty):void 0})}}function kpE(e){switch(e.type){case"json":return I.V51.http.StreamingResponse.json({...e,payload:aA(e.payload)});case"text":return I.V51.http.StreamingResponse.text(e);case"sse":return I.V51.http.StreamingResponse.sse({...e,payload:aA(e.payload)})}}function jm5(e){switch(e.type){case"json":return I.V51.http.NonStreamHttpResponseBody.json(ZpE(e.value));case"text":return I.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function wm5(e){return{nonStreamResponse:jm5(e.nonStreamResponse),streamResponse:kpE(e.streamResponse)}}function Em5(e){switch(e.type){case"cursor":return I.V51.http.Pagination.cursor(Sm5(e));case"offset":return I.V51.http.Pagination.offset(Mm5(e))}}function Sm5(e){return{...e,page:Ocn(e.page),next:U6i(e.next),results:U6i(e.results)}}function Mm5(e){return{...e,page:Ocn(e.page),results:U6i(e.results),step:e.step!=null?Ocn(e.step):void 0}}function Ocn(e){return{...e,property:Dm5(e.property)}}function Dm5(e){switch(e.type){case"query":return I.V51.RequestPropertyValue.query(yop(e));case"body":return I.V51.RequestPropertyValue.body(hop(e))}}function U6i(e){return{...e,property:hop(e.property)}}function hop(e){return{...e,valueType:aA(e.valueType)}}function yop(e){return{...e,valueType:aA(e.valueType)}}function Bm5(e){return{...e,streamParameter:e.streamParameter!=null?Ocn(e.streamParameter):void 0,shape:Im5(e.shape)}}function Im5(e){return I.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V51.http.SdkRequestShape.justRequestBody(Cm5(t)),wrapper:I.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Cm5(e){switch(e.type){case"bytes":return I.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:aA(e.requestBodyType)})}}function qm5(e){return I.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:aA(r.valueType)}))}),reference:t=>I.V51.http.HttpRequestBody.reference({...t,requestBodyType:aA(t.requestBodyType)}),fileUpload:t=>I.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:aA(r.valueType)});case"file":return I.V51.http.FileUploadRequestProperty.file(Tm5(r.value))}})}),bytes:t=>I.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Tm5(e){switch(e.type){case"file":return I.V51.http.FileProperty.file(e);case"fileArray":return I.V51.http.FileProperty.fileArray(e)}}function Rm5(e){return{...e,type:e.type!=null?aA(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Fz(t.shape)}))}}function zm5(e){return{...e,pathParameters:e.pathParameters.map(t=>sKs(t)),headers:e.headers.map(t=>_op(t)),queryParameters:e.queryParameters.map(t=>e_E(t)),messages:e.messages.map(t=>({...t,body:Nm5(t.body)}))}}function e_E(e){return{...e,value:Fz(e.value)}}function _op(e){return{...e,value:Fz(e.value)}}function sKs(e){return{...e,value:Fz(e.value)}}function Nm5(e){switch(e.type){case"inlinedBody":return I.V51.ExampleWebSocketMessageBody.inlinedBody(t_E(e));case"reference":return I.V51.ExampleWebSocketMessageBody.reference(Fz(e))}}function t_E(e){return{...e,properties:e.properties.map(t=>({...t,value:Fz(t.value)}))}}function KpE(e){return{...e,shape:i_E(e.shape)}}function bop(e){switch(e.type){case"primitive":return I.V51.ExampleTypeReferenceShape.primitive(Fm5(e));case"container":return I.V51.ExampleTypeReferenceShape.container(Qm5(e));case"unknown":return I.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:i_E(e.shape)})}}function r_E(e){switch(e.type){case"integer":return I.V51.ExamplePrimitive.integer(e.integer);case"uint":return I.V51.ExamplePrimitive.integer(e.uint);case"uint64":return I.V51.ExamplePrimitive.integer(e.uint64);case"double":return I.V51.ExamplePrimitive.double(e.double);case"long":return I.V51.ExamplePrimitive.long(e.long);case"boolean":return I.V51.ExamplePrimitive.boolean(e.boolean);case"string":return I.V51.ExamplePrimitive.string(e.string);case"date":return I.V51.ExamplePrimitive.date(e.date);case"datetime":return I.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return I.V51.ExamplePrimitive.uuid(e.uuid)}}function Fm5(e){return r_E(e.primitive)}function Qm5(e){switch(e.container.type){case"list":return I.V51.ExampleContainer.list({list:e.container.list.map(t=>Fz(t)),itemType:aA(e.container.itemType)});case"set":return I.V51.ExampleContainer.set({set:e.container.set.map(t=>Fz(t)),itemType:aA(e.container.itemType)});case"optional":return I.V51.ExampleContainer.optional({optional:e.container.optional!=null?Fz(e.container.optional):void 0,valueType:aA(e.container.valueType)});case"map":return I.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:Fz(t.key),value:Fz(t.value)})),keyType:aA(e.container.keyType),valueType:aA(e.container.valueType)});case"literal":return I.V51.ExampleContainer.literal({literal:r_E(e.container.literal)})}}function Fz(e){return{...e,shape:bop(e.shape)}}function i_E(e){switch(e.type){case"object":return I.V51.ExampleTypeShape.object({properties:e.properties.map(t=>n_E(t))});case"alias":return I.V51.ExampleTypeShape.alias({value:{...Fz(e.value)}});case"enum":return I.V51.ExampleTypeShape.enum(e);case"union":return I.V51.ExampleTypeShape.union(Lm5(e));case"undiscriminatedUnion":return I.V51.ExampleTypeShape.undiscriminatedUnion(Um5(e))}}function Um5(e){return{...e,singleUnionType:Fz(e.singleUnionType)}}function Lm5(e){return{...e,singleUnionType:Vm5(e.singleUnionType)}}function Vm5(e){return{...e,shape:Wm5(e.shape)}}function Wm5(e){switch(e.type){case"samePropertiesAsObject":return I.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:Gm5(e.object)});case"singleProperty":return I.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:bop(e.shape)});case"noProperties":return I.V51.ExampleSingleUnionTypeProperties.noProperties()}}function Gm5(e){return{...e,properties:e.properties.map(t=>n_E(t))}}function n_E(e){return{...e,value:{...e.value,shape:bop(e.value.shape)}}}function JpE(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>sKs(t)),servicePathParameters:e.servicePathParameters.map(t=>sKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>sKs(t)),serviceHeaders:e.serviceHeaders.map(t=>_op(t)),endpointHeaders:e.endpointHeaders.map(t=>_op(t)),queryParameters:e.queryParameters.map(t=>e_E(t)),request:e.request!=null?Km5(e.request):void 0,response:Hm5(e.response)}}function Hm5(e){switch(e.type){case"error":return I.V51.ExampleResponse.error({...e,body:e.body!=null?Fz(e.body):void 0});case"ok":return I.V51.ExampleResponse.ok(xm5(e))}}function xm5(e){switch(e.value.type){case"body":return I.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?Fz(e.value.value):void 0);case"stream":return I.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Fz(t)));case"sse":return I.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Fz(t.data)})))}}function Km5(e){switch(e.type){case"inlinedRequestBody":return I.V51.ExampleRequestBody.inlinedRequestBody(t_E(e));case"reference":return I.V51.ExampleRequestBody.reference(Fz(e))}}var u_E={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[P.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[P.TYPESCRIPT]:"0.38.0-rc0",[P.TYPESCRIPT_SDK]:"0.38.0-rc0",[P.TYPESCRIPT_EXPRESS]:"0.17.3",[P.JAVA]:C,[P.JAVA_MODEL]:"1.3.0",[P.JAVA_SDK]:"2.5.0",[P.JAVA_SPRING]:"1.3.0",[P.PYTHON_FASTAPI]:"1.1.0-rc0",[P.PYTHON_PYDANTIC]:"1.1.0-rc0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:"0.1.0",[P.STOPLIGHT]:C,[P.POSTMAN]:"0.2.0",[P.PYTHON_SDK]:"3.3.0-rc0",[P.GO_FIBER]:"0.23.5",[P.GO_MODEL]:"0.23.5",[P.GO_SDK]:"0.28.3",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"0.5.0",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:"0.1.0",[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?$m5(e.apiVersion):void 0,auth:iP5(e.auth),headers:e.headers.map(t=>rxn(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>rxn(t)),types:Jm5(e.types),services:bn(e.services,t=>_P5(t)),webhookGroups:bn(e.webhookGroups,t=>km5(t)),websocketChannels:bn(e.websocketChannels,t=>Ym5(t)),errors:bn(e.errors,t=>BP5(t)),pathParameters:e.pathParameters.map(t=>TDo(t)),variables:e.variables.map(t=>hP5(t))})};function Jm5(e){return bn(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>a_E(r)),userProvidedExamples:t.userProvidedExamples.map(r=>a_E(r)),shape:I.V53.types.Type._visit(t.shape,{union:r=>I.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:oA(i.valueType)})),types:r.types.map(i=>lP5(i))}),enum:I.V52.types.Type.enum,object:r=>I.V52.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:oA(i.valueType)}))}),alias:r=>I.V52.types.Type.alias({aliasOf:oA(r.aliasOf),resolvedType:dP5(r.resolvedType)}),undiscriminatedUnion:r=>I.V52.types.Type.undiscriminatedUnion(pP5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function $m5(e){return I.V52.ApiVersionScheme.header({...e,header:rxn(e.header)})}function Ym5(e){return{...e,headers:e.headers.map(t=>rxn(t)),queryParameters:e.queryParameters.map(t=>Oop(t)),pathParameters:e.pathParameters.map(t=>TDo(t)),messages:e.messages.map(t=>Xm5(t)),examples:e.examples.map(t=>IP5(t))}}function Xm5(e){return{...e,body:Zm5(e.body)}}function Zm5(e){switch(e.type){case"inlinedBody":return I.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:oA(t.valueType)}))});case"reference":return I.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:oA(e.bodyType)})}}function km5(e){return e.map(t=>eP5(t))}function eP5(e){return{...e,headers:e.headers.map(t=>rxn(t)),payload:tP5(e.payload),examples:e.examples!=null?e.examples.map(t=>rP5(t)):void 0}}function tP5(e){switch(e.type){case"reference":return I.V52.webhooks.WebhookPayload.reference({...e,payloadType:oA(e.payloadType)});case"inlinedPayload":return I.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:oA(t.valueType)}))})}}function rP5(e){return{...e,payload:Qz(e.payload)}}function iP5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V52.auth.AuthScheme.basic(t);case"bearer":return I.V52.auth.AuthScheme.bearer(t);case"header":return I.V52.auth.AuthScheme.header(nP5(t));case"oauth":return I.V52.auth.AuthScheme.oauth(aP5(t))}})}}function nP5(e){return{...e,valueType:oA(e.valueType)}}function aP5(e){return{...e,configuration:I.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:oP5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?uP5(e.configuration.refreshEndpoint):void 0})}}function oP5(e){return{...e,requestProperties:{clientId:Acn(e.requestProperties.clientId),clientSecret:Acn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Acn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:L6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?L6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?L6i(e.responseProperties.refreshToken):void 0}}}function uP5(e){return{...e,requestProperties:{refreshToken:Acn(e.requestProperties.refreshToken)},responseProperties:{accessToken:L6i(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?L6i(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?L6i(e.responseProperties.refreshToken):void 0}}}function rxn(e){return{...e,valueType:oA(e.valueType)}}function oA(e){return I.V53.types.TypeReference._visit(e,{container:t=>I.V52.types.TypeReference.container(c_E(t)),primitive:t=>I.V52.types.TypeReference.primitive(s_E(t)),named:I.V52.types.TypeReference.named,unknown:I.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function s_E(e){return{v1:sP5(e.v1),v2:e.v2!=null?cP5(e.v2):void 0}}function sP5(e){switch(e){case"FLOAT":return I.V52.types.PrimitiveTypeV1.Double}return e}function cP5(e){switch(e.type){case"integer":return I.V52.types.PrimitiveTypeV2.integer(e);case"double":return I.V52.types.PrimitiveTypeV2.double(e);case"string":return I.V52.types.PrimitiveTypeV2.string(e);case"boolean":return I.V52.types.PrimitiveTypeV2.boolean(e);case"long":return I.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return I.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return I.V52.types.PrimitiveTypeV2.uint();case"uint64":return I.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:vt(e)}}function c_E(e){return I.V53.types.ContainerType._visit(e,{list:t=>I.V52.types.ContainerType.list(oA(t)),optional:t=>I.V52.types.ContainerType.optional(oA(t)),set:t=>I.V52.types.ContainerType.set(oA(t)),map:({keyType:t,valueType:r})=>I.V52.types.ContainerType.map({keyType:oA(t),valueType:oA(r)}),literal:I.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function lP5(e){return{...e,shape:fP5(e.shape)}}function fP5(e){return I.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:oA(t.type)}),noProperties:I.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function dP5(e){return I.V53.types.ResolvedTypeReference._visit(e,{container:t=>I.V52.types.ResolvedTypeReference.container(c_E(t)),named:I.V52.types.ResolvedTypeReference.named,primitive:t=>I.V52.types.ResolvedTypeReference.primitive(s_E(t)),unknown:I.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function pP5(e){return{members:e.members.map(t=>({...t,type:oA(t.type)}))}}function _P5(e){return{...e,pathParameters:e.pathParameters.map(t=>TDo(t)),headers:e.headers.map(t=>rxn(t)),endpoints:e.endpoints.map(t=>yP5(t))}}function TDo(e){return{...e,valueType:oA(e.valueType)}}function hP5(e){return{...e,type:oA(e.type)}}function yP5(e){return{...e,pagination:e.pagination!=null?AP5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>TDo(t)),pathParameters:e.pathParameters.map(t=>TDo(t)),sdkRequest:e.sdkRequest!=null?wP5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?MP5(e.requestBody):void 0,response:e.response!=null?bP5(e.response):void 0,headers:e.headers.map(t=>rxn(t)),queryParameters:e.queryParameters.map(t=>Oop(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:o_E(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?o_E(t.example):void 0}))}}function bP5(e){return{...e,body:e.body!=null?vP5(e.body):void 0}}function vP5(e){switch(e.type){case"json":return I.V52.http.HttpResponseBody.json(l_E(e.value));case"fileDownload":return I.V52.http.HttpResponseBody.fileDownload(e);case"text":return I.V52.http.HttpResponseBody.text(e);case"streaming":return I.V52.http.HttpResponseBody.streaming(f_E(e.value));case"streamParameter":return I.V52.http.HttpResponseBody.streamParameter(OP5(e))}}function l_E(e){switch(e.type){case"response":return I.V52.http.JsonResponse.response({...e,responseBodyType:oA(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:oA(e.responseBodyType),responseProperty:e.responseProperty!=null?gop(e.responseProperty):void 0})}}function f_E(e){switch(e.type){case"json":return I.V52.http.StreamingResponse.json({...e,payload:oA(e.payload)});case"text":return I.V52.http.StreamingResponse.text(e);case"sse":return I.V52.http.StreamingResponse.sse({...e,payload:oA(e.payload)})}}function gP5(e){switch(e.type){case"json":return I.V52.http.NonStreamHttpResponseBody.json(l_E(e.value));case"text":return I.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function OP5(e){return{nonStreamResponse:gP5(e.nonStreamResponse),streamResponse:f_E(e.streamResponse)}}function AP5(e){switch(e.type){case"cursor":return I.V52.http.Pagination.cursor(mP5(e));case"offset":return I.V52.http.Pagination.offset(PP5(e))}}function mP5(e){return{...e,page:Acn(e.page),next:L6i(e.next),results:L6i(e.results)}}function PP5(e){return{...e,page:Acn(e.page),results:L6i(e.results),step:e.step!=null?Acn(e.step):void 0}}function Acn(e){return{...e,property:jP5(e.property)}}function jP5(e){switch(e.type){case"query":return I.V52.RequestPropertyValue.query(Oop(e));case"body":return I.V52.RequestPropertyValue.body(gop(e))}}function L6i(e){return{...e,property:gop(e.property)}}function gop(e){return{...e,valueType:oA(e.valueType)}}function Oop(e){return{...e,valueType:oA(e.valueType)}}function wP5(e){return{...e,streamParameter:e.streamParameter!=null?Acn(e.streamParameter):void 0,shape:EP5(e.shape)}}function EP5(e){return I.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V52.http.SdkRequestShape.justRequestBody(SP5(t)),wrapper:I.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function SP5(e){switch(e.type){case"bytes":return I.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:oA(e.requestBodyType)})}}function MP5(e){return I.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:oA(r.valueType)}))}),reference:t=>I.V52.http.HttpRequestBody.reference({...t,requestBodyType:oA(t.requestBodyType)}),fileUpload:t=>I.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:oA(r.valueType)});case"file":return I.V52.http.FileUploadRequestProperty.file(DP5(r.value))}})}),bytes:t=>I.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function DP5(e){switch(e.type){case"file":return I.V52.http.FileProperty.file(e);case"fileArray":return I.V52.http.FileProperty.fileArray(e)}}function BP5(e){return{...e,type:e.type!=null?oA(e.type):void 0,examples:e.examples.map(t=>({...t,shape:Qz(t.shape)}))}}function IP5(e){return{...e,pathParameters:e.pathParameters.map(t=>cKs(t)),headers:e.headers.map(t=>vop(t)),queryParameters:e.queryParameters.map(t=>d_E(t)),messages:e.messages.map(t=>({...t,body:CP5(t.body)}))}}function d_E(e){return{...e,value:Qz(e.value)}}function vop(e){return{...e,value:Qz(e.value)}}function cKs(e){return{...e,value:Qz(e.value)}}function CP5(e){switch(e.type){case"inlinedBody":return I.V52.ExampleWebSocketMessageBody.inlinedBody(p_E(e));case"reference":return I.V52.ExampleWebSocketMessageBody.reference(Qz(e))}}function p_E(e){return{...e,properties:e.properties.map(t=>({...t,value:Qz(t.value)}))}}function a_E(e){return{...e,shape:h_E(e.shape)}}function Aop(e){switch(e.type){case"primitive":return I.V52.ExampleTypeReferenceShape.primitive(qP5(e));case"container":return I.V52.ExampleTypeReferenceShape.container(TP5(e));case"unknown":return I.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:h_E(e.shape)})}}function __E(e){switch(e.type){case"integer":return I.V52.ExamplePrimitive.integer(e.integer);case"uint":return I.V52.ExamplePrimitive.integer(e.uint);case"uint64":return I.V52.ExamplePrimitive.integer(e.uint64);case"float":return I.V52.ExamplePrimitive.double(e.float);case"double":return I.V52.ExamplePrimitive.double(e.double);case"long":return I.V52.ExamplePrimitive.long(e.long);case"boolean":return I.V52.ExamplePrimitive.boolean(e.boolean);case"string":return I.V52.ExamplePrimitive.string(e.string);case"date":return I.V52.ExamplePrimitive.date(e.date);case"datetime":return I.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return I.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return I.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return I.V52.ExamplePrimitive.string({original:e.bigInteger})}}function qP5(e){return __E(e.primitive)}function TP5(e){switch(e.container.type){case"list":return I.V52.ExampleContainer.list({list:e.container.list.map(t=>Qz(t)),itemType:oA(e.container.itemType)});case"set":return I.V52.ExampleContainer.set({set:e.container.set.map(t=>Qz(t)),itemType:oA(e.container.itemType)});case"optional":return I.V52.ExampleContainer.optional({optional:e.container.optional!=null?Qz(e.container.optional):void 0,valueType:oA(e.container.valueType)});case"map":return I.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:Qz(t.key),value:Qz(t.value)})),keyType:oA(e.container.keyType),valueType:oA(e.container.valueType)});case"literal":return I.V52.ExampleContainer.literal({literal:__E(e.container.literal)})}}function Qz(e){return{...e,shape:Aop(e.shape)}}function h_E(e){switch(e.type){case"object":return I.V52.ExampleTypeShape.object({properties:e.properties.map(t=>y_E(t))});case"alias":return I.V52.ExampleTypeShape.alias({value:{...Qz(e.value)}});case"enum":return I.V52.ExampleTypeShape.enum(e);case"union":return I.V52.ExampleTypeShape.union(zP5(e));case"undiscriminatedUnion":return I.V52.ExampleTypeShape.undiscriminatedUnion(RP5(e))}}function RP5(e){return{...e,singleUnionType:Qz(e.singleUnionType)}}function zP5(e){return{...e,singleUnionType:NP5(e.singleUnionType)}}function NP5(e){return{...e,shape:FP5(e.shape)}}function FP5(e){switch(e.type){case"samePropertiesAsObject":return I.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:QP5(e.object)});case"singleProperty":return I.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Aop(e.shape)});case"noProperties":return I.V52.ExampleSingleUnionTypeProperties.noProperties()}}function QP5(e){return{...e,properties:e.properties.map(t=>y_E(t))}}function y_E(e){return{...e,value:{...e.value,shape:Aop(e.value.shape)}}}function o_E(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>cKs(t)),servicePathParameters:e.servicePathParameters.map(t=>cKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>cKs(t)),serviceHeaders:e.serviceHeaders.map(t=>vop(t)),endpointHeaders:e.endpointHeaders.map(t=>vop(t)),queryParameters:e.queryParameters.map(t=>d_E(t)),request:e.request!=null?VP5(e.request):void 0,response:UP5(e.response)}}function UP5(e){switch(e.type){case"error":return I.V52.ExampleResponse.error({...e,body:e.body!=null?Qz(e.body):void 0});case"ok":return I.V52.ExampleResponse.ok(LP5(e))}}function LP5(e){switch(e.value.type){case"body":return I.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?Qz(e.value.value):void 0);case"stream":return I.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>Qz(t)));case"sse":return I.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:Qz(t.data)})))}}function VP5(e){switch(e.type){case"inlinedRequestBody":return I.V52.ExampleRequestBody.inlinedRequestBody(p_E(e));case"reference":return I.V52.ExampleRequestBody.reference(Qz(e))}}var b_E={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:C,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:bn(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:WP5(r.response)}))}))})};function WP5(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?I.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var O_E={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.47.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[P.TYPESCRIPT]:"0.47.0",[P.TYPESCRIPT_SDK]:"0.47.0",[P.TYPESCRIPT_EXPRESS]:"0.17.7",[P.JAVA]:C,[P.JAVA_MODEL]:"1.7.0",[P.JAVA_SDK]:"2.16.0",[P.JAVA_SPRING]:"1.5.0",[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"1.10.1",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:"0.3.2",[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?HP5(e.apiVersion):void 0,auth:kP5(e.auth),headers:e.headers.map(t=>ixn(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>ixn(t)),types:GP5(e.types),services:bn(e.services,t=>sj5(t)),webhookGroups:bn(e.webhookGroups,t=>$P5(t)),websocketChannels:bn(e.websocketChannels,t=>xP5(t)),errors:bn(e.errors,t=>jj5(t)),pathParameters:e.pathParameters.map(t=>RDo(t)),variables:e.variables.map(t=>cj5(t)),dynamic:e.dynamic!=null?Nj5(e.dynamic):void 0})};function GP5(e){return bn(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>v_E(r)),userProvidedExamples:t.userProvidedExamples.map(r=>v_E(r)),shape:I.V55.types.Type._visit(t.shape,{union:r=>I.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:gh(i.valueType)})),types:r.types.map(i=>nj5(i))}),enum:I.V54.types.Type.enum,object:r=>I.V54.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:gh(i.valueType)})),extendedProperties:r.extendedProperties?.map(i=>({...i,valueType:gh(i.valueType)}))}),alias:r=>I.V54.types.Type.alias({aliasOf:gh(r.aliasOf),resolvedType:oj5(r.resolvedType)}),undiscriminatedUnion:r=>I.V54.types.Type.undiscriminatedUnion(uj5(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function HP5(e){return I.V54.ApiVersionScheme.header({...e,header:ixn(e.header)})}function xP5(e){return{...e,headers:e.headers.map(t=>ixn(t)),queryParameters:e.queryParameters.map(t=>jop(t)),pathParameters:e.pathParameters.map(t=>RDo(t)),messages:e.messages.map(t=>KP5(t)),examples:e.examples.map(t=>wj5(t))}}function KP5(e){return{...e,body:JP5(e.body)}}function JP5(e){switch(e.type){case"inlinedBody":return I.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:gh(t.valueType)}))});case"reference":return I.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:gh(e.bodyType)})}}function $P5(e){return e.map(t=>YP5(t))}function YP5(e){return{...e,headers:e.headers.map(t=>ixn(t)),payload:XP5(e.payload),examples:e.examples!=null?e.examples.map(t=>ZP5(t)):void 0}}function XP5(e){switch(e.type){case"reference":return I.V54.webhooks.WebhookPayload.reference({...e,payloadType:gh(e.payloadType)});case"inlinedPayload":return I.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:gh(t.valueType)}))})}}function ZP5(e){return{...e,payload:PT(e.payload)}}function kP5(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return I.V54.auth.AuthScheme.basic(t);case"bearer":return I.V54.auth.AuthScheme.bearer(t);case"header":return I.V54.auth.AuthScheme.header(ej5(t));case"oauth":return I.V54.auth.AuthScheme.oauth(tj5(t))}})}}function ej5(e){return{...e,valueType:gh(e.valueType)}}function tj5(e){return{...e,configuration:I.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:rj5(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?ij5(e.configuration.refreshEndpoint):void 0})}}function rj5(e){return{...e,requestProperties:{clientId:mcn(e.requestProperties.clientId),clientSecret:mcn(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?mcn(e.requestProperties.scopes):void 0},responseProperties:{accessToken:iRi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?iRi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?iRi(e.responseProperties.refreshToken):void 0}}}function ij5(e){return{...e,requestProperties:{refreshToken:mcn(e.requestProperties.refreshToken)},responseProperties:{accessToken:iRi(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?iRi(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?iRi(e.responseProperties.refreshToken):void 0}}}function ixn(e){return{...e,valueType:gh(e.valueType)}}function gh(e){return e.type==="container"&&e.container.type==="nullable"?Yj5(e.container.nullable):e.type==="container"&&e.container.type==="optional"?$j5(e.container.optional):I.V55.types.TypeReference._visit(e,{container:t=>I.V54.types.TypeReference.container(m_E(t)),primitive:t=>I.V54.types.TypeReference.primitive(A_E(t)),named:I.V54.types.TypeReference.named,unknown:I.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function A_E(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function m_E(e){return I.V55.types.ContainerType._visit(e,{list:t=>I.V54.types.ContainerType.list(gh(t)),optional:t=>I.V54.types.ContainerType.optional(gh(t)),nullable:t=>I.V54.types.ContainerType.optional(gh(t)),set:t=>I.V54.types.ContainerType.set(gh(t)),map:({keyType:t,valueType:r})=>I.V54.types.ContainerType.map({keyType:gh(t),valueType:gh(r)}),literal:I.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function nj5(e){return{...e,shape:aj5(e.shape)}}function aj5(e){return I.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>I.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>I.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:gh(t.type)}),noProperties:I.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function oj5(e){return I.V55.types.ResolvedTypeReference._visit(e,{container:t=>I.V54.types.ResolvedTypeReference.container(m_E(t)),named:I.V54.types.ResolvedTypeReference.named,primitive:t=>I.V54.types.ResolvedTypeReference.primitive(A_E(t)),unknown:I.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function uj5(e){return{members:e.members.map(t=>({...t,type:gh(t.type)}))}}function sj5(e){return{...e,pathParameters:e.pathParameters.map(t=>RDo(t)),headers:e.headers.map(t=>ixn(t)),endpoints:e.endpoints.map(t=>lj5(t))}}function RDo(e){return{...e,valueType:gh(e.valueType)}}function cj5(e){return{...e,type:gh(e.type)}}function lj5(e){return{...e,pagination:e.pagination!=null?hj5(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>RDo(t)),pathParameters:e.pathParameters.map(t=>RDo(t)),sdkRequest:e.sdkRequest!=null?gj5(e.sdkRequest):void 0,requestBody:e.requestBody!=null?mj5(e.requestBody):void 0,response:e.response!=null?fj5(e.response):void 0,headers:e.headers.map(t=>ixn(t)),queryParameters:e.queryParameters.map(t=>jop(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:g_E(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?g_E(t.example):void 0}))}}function fj5(e){return{...e,body:e.body!=null?dj5(e.body):void 0}}function dj5(e){switch(e.type){case"json":return I.V54.http.HttpResponseBody.json(P_E(e.value));case"fileDownload":return I.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return I.V54.http.HttpResponseBody.bytes(e);case"text":return I.V54.http.HttpResponseBody.text(e);case"streaming":return I.V54.http.HttpResponseBody.streaming(j_E(e.value));case"streamParameter":return I.V54.http.HttpResponseBody.streamParameter(_j5(e));default:vt(e)}}function P_E(e){switch(e.type){case"response":return I.V54.http.JsonResponse.response({...e,responseBodyType:gh(e.responseBodyType)});case"nestedPropertyAsResponse":return I.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:gh(e.responseBodyType),responseProperty:e.responseProperty!=null?Pop(e.responseProperty):void 0})}}function j_E(e){switch(e.type){case"json":return I.V54.http.StreamingResponse.json({...e,payload:gh(e.payload)});case"text":return I.V54.http.StreamingResponse.text(e);case"sse":return I.V54.http.StreamingResponse.sse({...e,payload:gh(e.payload)})}}function pj5(e){switch(e.type){case"json":return I.V54.http.NonStreamHttpResponseBody.json(P_E(e.value));case"bytes":return I.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return I.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return I.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:vt(e)}}function _j5(e){return{nonStreamResponse:pj5(e.nonStreamResponse),streamResponse:j_E(e.streamResponse)}}function hj5(e){switch(e.type){case"cursor":return I.V54.http.Pagination.cursor(yj5(e));case"offset":return I.V54.http.Pagination.offset(bj5(e))}}function yj5(e){return{...e,page:mcn(e.page),next:iRi(e.next),results:iRi(e.results)}}function bj5(e){return{...e,page:mcn(e.page),results:iRi(e.results),step:e.step!=null?mcn(e.step):void 0,hasNextPage:e.hasNextPage!=null?iRi(e.hasNextPage):void 0}}function mcn(e){return{...e,property:vj5(e.property)}}function vj5(e){switch(e.type){case"query":return I.V54.RequestPropertyValue.query(jop(e));case"body":return I.V54.RequestPropertyValue.body(Pop(e))}}function iRi(e){return{...e,property:Pop(e.property)}}function Pop(e){return{...e,valueType:gh(e.valueType)}}function jop(e){return{...e,valueType:gh(e.valueType)}}function gj5(e){return{...e,streamParameter:e.streamParameter!=null?mcn(e.streamParameter):void 0,shape:Oj5(e.shape)}}function Oj5(e){return I.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>I.V54.http.SdkRequestShape.justRequestBody(Aj5(t)),wrapper:I.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function Aj5(e){switch(e.type){case"bytes":return I.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return I.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:gh(e.requestBodyType)})}}function mj5(e){return I.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>I.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:gh(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:gh(r.valueType)}))}),reference:t=>I.V54.http.HttpRequestBody.reference({...t,requestBodyType:gh(t.requestBodyType)}),fileUpload:t=>I.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return I.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:gh(r.valueType)});case"file":return I.V54.http.FileUploadRequestProperty.file(Pj5(r.value))}})}),bytes:t=>I.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function Pj5(e){switch(e.type){case"file":return I.V54.http.FileProperty.file(e);case"fileArray":return I.V54.http.FileProperty.fileArray(e)}}function jj5(e){return{...e,type:e.type!=null?gh(e.type):void 0,examples:e.examples.map(t=>({...t,shape:PT(t.shape)}))}}function wj5(e){return{...e,pathParameters:e.pathParameters.map(t=>lKs(t)),headers:e.headers.map(t=>mop(t)),queryParameters:e.queryParameters.map(t=>w_E(t)),messages:e.messages.map(t=>({...t,body:Ej5(t.body)}))}}function w_E(e){return{...e,value:PT(e.value)}}function mop(e){return{...e,value:PT(e.value)}}function lKs(e){return{...e,value:PT(e.value)}}function Ej5(e){switch(e.type){case"inlinedBody":return I.V54.ExampleWebSocketMessageBody.inlinedBody(E_E(e));case"reference":return I.V54.ExampleWebSocketMessageBody.reference(PT(e))}}function E_E(e){return{...e,properties:e.properties.map(t=>({...t,value:PT(t.value)}))}}function v_E(e){return{...e,shape:S_E(e.shape)}}function wop(e){switch(e.type){case"primitive":return I.V54.ExampleTypeReferenceShape.primitive(Sj5(e));case"container":return I.V54.ExampleTypeReferenceShape.container(Mj5(e));case"unknown":return I.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return I.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:S_E(e.shape)})}}function Sj5(e){return e.primitive}function Mj5(e){switch(e.container.type){case"list":return I.V54.ExampleContainer.list({list:e.container.list.map(t=>PT(t)),itemType:gh(e.container.itemType)});case"set":return I.V54.ExampleContainer.set({set:e.container.set.map(t=>PT(t)),itemType:gh(e.container.itemType)});case"optional":return I.V54.ExampleContainer.optional({optional:e.container.optional!=null?PT(e.container.optional):void 0,valueType:gh(e.container.valueType)});case"nullable":return I.V54.ExampleContainer.optional({optional:e.container.nullable!=null?PT(e.container.nullable):void 0,valueType:gh(e.container.valueType)});case"map":return I.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:PT(t.key),value:PT(t.value)})),keyType:gh(e.container.keyType),valueType:gh(e.container.valueType)});case"literal":return I.V54.ExampleContainer.literal({literal:e.container.literal})}}function PT(e){return{...e,shape:wop(e.shape)}}function S_E(e){switch(e.type){case"object":return I.V54.ExampleTypeShape.object({properties:e.properties.map(t=>M_E(t))});case"alias":return I.V54.ExampleTypeShape.alias({value:{...PT(e.value)}});case"enum":return I.V54.ExampleTypeShape.enum(e);case"union":return I.V54.ExampleTypeShape.union(Bj5(e));case"undiscriminatedUnion":return I.V54.ExampleTypeShape.undiscriminatedUnion(Dj5(e))}}function Dj5(e){return{...e,singleUnionType:PT(e.singleUnionType)}}function Bj5(e){return{...e,singleUnionType:Ij5(e.singleUnionType)}}function Ij5(e){return{...e,shape:Cj5(e.shape)}}function Cj5(e){switch(e.type){case"samePropertiesAsObject":return I.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:qj5(e.object)});case"singleProperty":return I.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:wop(e.shape)});case"noProperties":return I.V54.ExampleSingleUnionTypeProperties.noProperties()}}function qj5(e){return{...e,properties:e.properties.map(t=>M_E(t))}}function M_E(e){return{...e,value:{...e.value,shape:wop(e.value.shape)}}}function g_E(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>lKs(t)),servicePathParameters:e.servicePathParameters.map(t=>lKs(t)),endpointPathParameters:e.endpointPathParameters.map(t=>lKs(t)),serviceHeaders:e.serviceHeaders.map(t=>mop(t)),endpointHeaders:e.endpointHeaders.map(t=>mop(t)),queryParameters:e.queryParameters.map(t=>w_E(t)),request:e.request!=null?zj5(e.request):void 0,response:Tj5(e.response)}}function Tj5(e){switch(e.type){case"error":return I.V54.ExampleResponse.error({...e,body:e.body!=null?PT(e.body):void 0});case"ok":return I.V54.ExampleResponse.ok(Rj5(e))}}function Rj5(e){switch(e.value.type){case"body":return I.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?PT(e.value.value):void 0);case"stream":return I.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>PT(t)));case"sse":return I.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:PT(t.data)})))}}function zj5(e){switch(e.type){case"inlinedRequestBody":return I.V54.ExampleRequestBody.inlinedRequestBody(E_E(e));case"reference":return I.V54.ExampleRequestBody.reference(PT(e))}}function Nj5(e){return{...e,types:bn(e.types,t=>Fj5(t)),endpoints:bn(e.endpoints,t=>Qj5(t)),headers:e.headers?.map(t=>x4t(t))}}function Fj5(e){switch(e.type){case"alias":return I.V54.dynamic.NamedType.alias({...e,typeReference:WPe(e.typeReference)});case"enum":return I.V54.dynamic.NamedType.enum(e);case"object":return I.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>x4t(t))});case"discriminatedUnion":return I.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,Lj5(r)]))});case"undiscriminatedUnion":return I.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>WPe(t))});default:vt(e)}}function Qj5(e){return{...e,auth:e.auth!=null?Uj5(e.auth):void 0,request:Vj5(e.request)}}function Uj5(e){switch(e.type){case"basic":return I.V54.dynamic.Auth.basic(e);case"bearer":return I.V54.dynamic.Auth.bearer(e);case"header":return I.V54.dynamic.Auth.header({header:x4t(e.header)})}}function WPe(e){switch(e.type){case"list":return I.V54.dynamic.TypeReference.list(WPe(e.value));case"optional":return Zj5(e.value);case"nullable":return Xj5(e.value);case"map":return I.V54.dynamic.TypeReference.map({...e,key:WPe(e.key),value:WPe(e.value)});case"literal":return I.V54.dynamic.TypeReference.literal(e.value);case"named":return I.V54.dynamic.TypeReference.named(e.value);case"primitive":return I.V54.dynamic.TypeReference.primitive(e.value);case"set":return I.V54.dynamic.TypeReference.set(WPe(e.value));case"unknown":return I.V54.dynamic.TypeReference.unknown();default:vt(e)}}function Lj5(e){switch(e.type){case"samePropertiesAsObject":return I.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>x4t(t))});case"singleProperty":return I.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:WPe(e.typeReference),properties:e.properties?.map(t=>x4t(t))});case"noProperties":return I.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>x4t(t))});default:vt(e)}}function x4t(e){return{...e,typeReference:WPe(e.typeReference)}}function Vj5(e){switch(e.type){case"body":return I.V54.dynamic.Request.body(Wj5(e));case"inlined":return I.V54.dynamic.Request.inlined(Gj5(e));default:vt(e)}}function Wj5(e){return{pathParameters:e.pathParameters?.map(t=>x4t(t)),body:e.body!=null?D_E(e.body):void 0}}function Gj5(e){return{...e,pathParameters:e.pathParameters?.map(t=>x4t(t)),queryParameters:e.queryParameters?.map(t=>x4t(t)),headers:e.headers?.map(t=>x4t(t)),body:e.body!=null?Hj5(e.body):void 0}}function Hj5(e){switch(e.type){case"properties":return I.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>x4t(t)));case"referenced":return I.V54.dynamic.InlinedRequestBody.referenced(xj5(e));case"fileUpload":return I.V54.dynamic.InlinedRequestBody.fileUpload(Kj5(e));default:vt(e)}}function xj5(e){return{...e,bodyType:D_E(e.bodyType)}}function D_E(e){switch(e.type){case"bytes":return I.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return I.V54.dynamic.ReferencedRequestBodyType.typeReference(WPe(e.value));default:vt(e)}}function Kj5(e){return{properties:e.properties.map(t=>Jj5(t))}}function Jj5(e){switch(e.type){case"file":return I.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return I.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return I.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(x4t(e));default:vt(e)}}function $j5(e){return e.type==="container"&&e.container.type==="nullable"?I.V54.types.TypeReference.container(I.V54.types.ContainerType.optional(gh(e.container.nullable))):I.V54.types.TypeReference.container(I.V54.types.ContainerType.optional(gh(e)))}function Yj5(e){return e.type==="container"&&e.container.type==="optional"?gh(e):I.V54.types.TypeReference.container(I.V54.types.ContainerType.optional(gh(e)))}function Xj5(e){return e.type==="optional"?WPe(e):I.V54.dynamic.TypeReference.optional(WPe(e))}function Zj5(e){return e.type==="nullable"?I.V54.dynamic.TypeReference.optional(WPe(e.value)):I.V54.dynamic.TypeReference.optional(WPe(e))}var B_E={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.PYTHON_SDK]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:"0.0.2",[P.CSHARP_SDK]:"1.12.0-rc0",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:C,[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:bn(e.services,t=>kj5(t))})};function kj5(e){return{...e,endpoints:e.endpoints.map(t=>e05(t))}}function e05(e){return{...e,pagination:t05(e.pagination)}}function t05(e){if(e!=null)switch(e.type){case"cursor":return I.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return I.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:vt(e)}}var I_E={laterVersion:"v57",earlierVersion:"v56",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"0.49.0",[P.TYPESCRIPT_BROWSER_SDK]:"0.49.0",[P.TYPESCRIPT]:"0.49.0",[P.TYPESCRIPT_SDK]:"0.49.0",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.0",[P.JAVA_SDK]:"2.34.0",[P.JAVA_SPRING]:"1.6.0",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.6.3",[P.PYTHON_PYDANTIC]:"1.4.8",[P.PYTHON_SDK]:"4.3.19",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:"0.23.6",[P.GO_MODEL]:"0.23.6",[P.GO_SDK]:"0.37.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"1.12.0-rc11",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:k,[P.PHP_MODEL]:k,[P.PHP_SDK]:"0.14.1",[P.RUST_MODEL]:k,[P.RUST_SDK]:k},jsonifyEarlierVersion:e=>Wn.V56.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?r05(e.dynamic):void 0})};function r05(e){return{...e,endpoints:i05(e.endpoints)}}function i05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,n05(r)]).filter(([t,r])=>r!=null))}function n05(e){return{...e,auth:e.auth!=null?u05(e.auth):void 0,examples:e.examples!=null?a05(e.examples):void 0}}function a05(e){return e.map(t=>o05(t)).filter(t=>t!=null)}function o05(e){return{...e,auth:e.auth!=null?s05(e.auth):void 0}}function u05(e){switch(e.type){case"basic":return I.V56.dynamic.Auth.basic(e);case"bearer":return I.V56.dynamic.Auth.bearer(e);case"header":return I.V56.dynamic.Auth.header(e);case"oauth":return;default:vt(e)}}function s05(e){switch(e.type){case"basic":return I.V56.dynamic.AuthValues.basic(e);case"bearer":return I.V56.dynamic.AuthValues.bearer(e);case"header":return I.V56.dynamic.AuthValues.header(e);case"oauth":return;default:vt(e)}}var q_E={laterVersion:"v58",earlierVersion:"v57",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"1.2.0",[P.TYPESCRIPT_BROWSER_SDK]:"1.2.0",[P.TYPESCRIPT]:"1.2.0",[P.TYPESCRIPT_SDK]:"1.2.0",[P.TYPESCRIPT_EXPRESS]:"0.18.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:"2.36.5",[P.JAVA_SPRING]:"1.6.1",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.7.0",[P.PYTHON_PYDANTIC]:"1.5.0",[P.PYTHON_SDK]:"4.21.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:"1.1.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:"1.17.5",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:"0.1.0",[P.PHP_MODEL]:C,[P.PHP_SDK]:"1.15.1",[P.RUST_MODEL]:C,[P.RUST_SDK]:"0.0.0"},jsonifyEarlierVersion:e=>Wn.V57.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,publishConfig:e.publishConfig!=null?v05(e.publishConfig):void 0,services:c05(e.services),dynamic:e.dynamic!=null?p05(e.dynamic):void 0})};function c05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,l05(r)]))}function l05(e){return{...e,endpoints:f05(e.endpoints)}}function f05(e){return e.map(d05).filter(t=>t!=null)}function d05(e){if(e.method!=="HEAD")return{...e,method:e.method}}function p05(e){return{...e,endpoints:_05(e.endpoints)}}function _05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,h05(r)]).filter(([t,r])=>r!=null))}function h05(e){let t=e.location.method;if(t!=="HEAD")return{...e,examples:e.examples!=null?y05(e.examples):void 0,location:{...e.location,method:t}}}function y05(e){return e.map(t=>b05(t)).filter(t=>t!=null)}function b05(e){let t=e.endpoint.method;if(t!=="HEAD")return{...e,endpoint:{...e.endpoint,method:t}}}function v05(e){switch(e.type){case"github":{let t=C_E(e.target);return t==null?void 0:I.V57.publish.PublishingConfig.github({...e,target:t})}case"direct":{let t=C_E(e.target);return t==null?void 0:I.V57.publish.PublishingConfig.direct({target:t})}case"filesystem":return;default:vt(e)}}function C_E(e){switch(e.type){case"postman":return I.V57.publish.PublishTarget.postman(e);case"npm":return I.V57.publish.PublishTarget.npm(e);case"maven":return I.V57.publish.PublishTarget.maven(e);case"pypi":return;default:vt(e)}}var T_E={laterVersion:"v59",earlierVersion:"v58",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"2.6.8",[P.TYPESCRIPT_BROWSER_SDK]:"2.6.8",[P.TYPESCRIPT]:"2.6.8",[P.TYPESCRIPT_SDK]:"2.6.8",[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.1",[P.JAVA_SDK]:"2.43.0",[P.JAVA_SPRING]:"1.8.2",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.8.0",[P.PYTHON_PYDANTIC]:"1.6.0",[P.PYTHON_SDK]:"4.26.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:"0.23.7",[P.GO_MODEL]:"0.23.7",[P.GO_SDK]:"1.7.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:"1.0.0-rc26",[P.CSHARP_MODEL]:"0.0.3",[P.CSHARP_SDK]:"2.2.0",[P.SWIFT_MODEL]:"0.0.1",[P.SWIFT_SDK]:"0.16.0",[P.PHP_MODEL]:C,[P.PHP_SDK]:"1.17.0",[P.RUST_MODEL]:C,[P.RUST_SDK]:"0.1.1"},jsonifyEarlierVersion:e=>Wn.V58.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,dynamic:e.dynamic!=null?O05(e.dynamic):void 0,auth:e.auth!=null?g05(e.auth):void 0})};function g05(e){return{...e,schemes:e.schemes.filter(t=>t.type!=="inferred")}}function O05(e){return{...e,endpoints:A05(e.endpoints)}}function A05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,m05(r)]).filter(([t,r])=>r!=null))}function m05(e){return{...e,examples:e.examples!=null?j05(e.examples):void 0,auth:P05(e.auth)}}function P05(e){return e==null?e:e._visit({basic:t=>I.V58.dynamic.Auth.basic(t),bearer:t=>I.V58.dynamic.Auth.bearer(t),header:t=>I.V58.dynamic.Auth.header(t),oauth:t=>I.V58.dynamic.Auth.oauth(t),inferred:()=>{},_other:()=>{}})}function j05(e){return e.map(t=>w05(t)).filter(t=>t!=null)}function w05(e){return{...e,auth:E05(e.auth)}}function E05(e){if(e==null)return e;if(e.type!=="inferred")return e}var R_E={laterVersion:"v60",earlierVersion:"v59",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"2.11.2",[P.TYPESCRIPT_BROWSER_SDK]:"2.11.2",[P.TYPESCRIPT]:"2.11.2",[P.TYPESCRIPT_SDK]:"2.11.2",[P.TYPESCRIPT_EXPRESS]:"0.18.6",[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.2",[P.JAVA_SDK]:"3.5.10",[P.JAVA_SPRING]:"1.8.3",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.9.0",[P.PYTHON_PYDANTIC]:"1.7.0",[P.PYTHON_SDK]:"4.30.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:"0.23.8",[P.GO_MODEL]:"0.23.8",[P.GO_SDK]:"1.12.4",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:C,[P.PHP_MODEL]:C,[P.PHP_SDK]:C,[P.RUST_MODEL]:C,[P.RUST_SDK]:C},jsonifyEarlierVersion:e=>Wn.V59.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:D05(e.services),auth:S05(e.auth)})};function S05(e){return{...e,schemes:M05(e.schemes)}}function M05(e){return e.map(t=>{switch(t.type){case"bearer":return I.V59.AuthScheme.bearer({...t});case"basic":return I.V59.AuthScheme.basic({...t});case"header":return I.V59.AuthScheme.header({...t});case"oauth":switch(t.configuration.type){case"clientCredentials":return I.V59.AuthScheme.oauth({...t,configuration:I.V59.OAuthConfiguration.clientCredentials({...t.configuration,refreshEndpoint:t.configuration.refreshEndpoint?{...t.configuration.refreshEndpoint,responseProperties:{accessToken:nxn(t.configuration.refreshEndpoint.responseProperties.accessToken),expiresIn:Cza(t.configuration.refreshEndpoint.responseProperties.expiresIn),refreshToken:Cza(t.configuration.refreshEndpoint.responseProperties.refreshToken)},requestProperties:{refreshToken:qza(t.configuration.refreshEndpoint.requestProperties.refreshToken)}}:void 0,tokenEndpoint:{...t.configuration.tokenEndpoint,responseProperties:{accessToken:nxn(t.configuration.tokenEndpoint.responseProperties.accessToken),expiresIn:Cza(t.configuration.tokenEndpoint.responseProperties.expiresIn),refreshToken:Cza(t.configuration.tokenEndpoint.responseProperties.refreshToken)},requestProperties:{clientId:qza(t.configuration.tokenEndpoint.requestProperties.clientId),clientSecret:qza(t.configuration.tokenEndpoint.requestProperties.clientSecret),scopes:Eop(t.configuration.tokenEndpoint.requestProperties.scopes),customProperties:t.configuration.tokenEndpoint.requestProperties.customProperties?.map(qza)}}})});default:vt(t.configuration.type)}break;case"inferred":return I.V59.AuthScheme.inferred({...t,tokenEndpoint:{...t.tokenEndpoint,expiryProperty:Cza(t.tokenEndpoint.expiryProperty),authenticatedRequestHeaders:t.tokenEndpoint.authenticatedRequestHeaders.map(r=>({...r,responseProperty:nxn(r.responseProperty)}))}});default:vt(t)}})}function D05(e){return Object.entries(e).reduce((t,[r,i])=>(t[r]={...i,endpoints:B05(i.endpoints)},t),{})}function B05(e){return e.map(t=>({...t,pagination:I05(t.pagination),sdkRequest:C05(t.sdkRequest)}))}function I05(e){if(!e)return e;switch(e.type){case"cursor":return I.V59.Pagination.cursor({next:nxn(e.next),results:nxn(e.results),page:qza(e.page)});case"offset":return I.V59.Pagination.offset({hasNextPage:Cza(e.hasNextPage),results:nxn(e.results),page:qza(e.page),step:Eop(e.step)});case"custom":return I.V59.Pagination.custom({results:nxn(e.results)});default:vt(e)}}function Eop(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function qza(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function Cza(e){if(e)return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function nxn(e){return{propertyPath:e.propertyPath?.map(t=>t.name),property:e.property}}function C05(e){return e&&{...e,streamParameter:Eop(e.streamParameter)}}var z_E={laterVersion:"v61",earlierVersion:"v60",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"3.7.2",[P.TYPESCRIPT_BROWSER_SDK]:"3.7.2",[P.TYPESCRIPT]:"3.7.2",[P.TYPESCRIPT_SDK]:"3.7.2",[P.TYPESCRIPT_EXPRESS]:"3.7.2",[P.JAVA]:C,[P.JAVA_MODEL]:"1.8.3",[P.JAVA_SDK]:"3.9.0",[P.JAVA_SPRING]:"1.8.4",[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"1.10.3",[P.PYTHON_PYDANTIC]:"1.8.2",[P.PYTHON_SDK]:"4.33.0",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:"0.23.9",[P.GO_SDK]:"1.14.0",[P.RUBY_MODEL]:C,[P.RUBY_SDK]:"1.0.0-rc34",[P.CSHARP_MODEL]:"0.0.4",[P.CSHARP_SDK]:"2.4.0",[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:"0.22.0",[P.PHP_MODEL]:C,[P.PHP_SDK]:"1.18.0",[P.RUST_MODEL]:C,[P.RUST_SDK]:"0.7.2"},jsonifyEarlierVersion:e=>Wn.V60.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",skipValidation:!0}),migrateBackwards:e=>{let{apiPlayground:t,...r}=e;return{...r,errors:Object.fromEntries(Object.entries(e.errors).map(([i,n])=>[i,q05(n)])),dynamic:e.dynamic!=null?N05(e.dynamic):void 0,publishConfig:e.publishConfig!=null?z05(e.publishConfig):void 0,services:Object.fromEntries(Object.entries(e.services).map(([i,n])=>[i,T05(n)]))}}};function q05(e){let{isWildcardStatusCode:t,...r}=e;return r}function T05(e){return{...e,endpoints:e.endpoints.map(R05)}}function R05(e){let{apiPlayground:t,...r}=e;return r}function z05(e){return I.V61.PublishingConfig._visit(e,{github:t=>{let r=Sop(t.target);return r!=null?I.V60.PublishingConfig.github({...t,target:r}):void 0},direct:t=>{let r=Sop(t.target);return r!=null?I.V60.PublishingConfig.direct({target:r}):void 0},filesystem:t=>{let r=t.publishTarget!=null?Sop(t.publishTarget):void 0;return I.V60.PublishingConfig.filesystem({generateFullProject:t.generateFullProject,publishTarget:r})},_other:()=>{}})}function Sop(e){return I.V61.PublishTarget._visit(e,{postman:I.V60.PublishTarget.postman,npm:I.V60.PublishTarget.npm,maven:I.V60.PublishTarget.maven,pypi:I.V60.PublishTarget.pypi,crates:t=>I.V60.PublishTarget.pypi({version:t.version,packageName:t.packageName}),_other:()=>{}})}function N05(e){return{...e,endpoints:L05(e.endpoints),generatorConfig:e.generatorConfig!=null?F05(e.generatorConfig):void 0}}function F05(e){return{...e,outputConfig:Q05(e.outputConfig)}}function Q05(e){return I.V61.dynamic.GeneratorOutputConfig._visit(e,{publish:t=>{let r=U05(t);return r!=null?I.V60.dynamic.GeneratorOutputConfig.publish(r):I.V60.dynamic.GeneratorOutputConfig.local()},local:I.V60.dynamic.GeneratorOutputConfig.local,_other:I.V60.dynamic.GeneratorOutputConfig.local})}function U05(e){return I.V61.dynamic.PublishInfo._visit(e,{go:I.V60.dynamic.PublishInfo.go,swift:()=>{},maven:I.V60.dynamic.PublishInfo.maven,npm:I.V60.dynamic.PublishInfo.npm,nuget:I.V60.dynamic.PublishInfo.nuget,pypi:I.V60.dynamic.PublishInfo.pypi,rubygems:I.V60.dynamic.PublishInfo.rubygems,crates:()=>{},_other:()=>{}})}function L05(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t,V05(r)]).filter(([t,r])=>r!=null))}function V05(e){return{...e,response:W05(e.response)}}function W05(e){return I.V61.dynamic.Response._visit(e,{json:I.V60.dynamic.Response.json,streaming:I.V60.dynamic.Response.json,streamParameter:I.V60.dynamic.Response.json,fileDownload:I.V60.dynamic.Response.json,text:I.V60.dynamic.Response.json,bytes:I.V60.dynamic.Response.json,_other:I.V60.dynamic.Response.json})}var N_E={laterVersion:"v62",earlierVersion:"v61",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:C,[P.TYPESCRIPT_BROWSER_SDK]:C,[P.TYPESCRIPT]:C,[P.TYPESCRIPT_SDK]:C,[P.TYPESCRIPT_EXPRESS]:C,[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:"2.0.1",[P.PYTHON_PYDANTIC]:"1.11.2",[P.PYTHON_SDK]:"4.46.5",[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:C,[P.PHP_MODEL]:"0.0.2",[P.PHP_SDK]:"1.22.0",[P.RUST_MODEL]:C,[P.RUST_SDK]:C},jsonifyEarlierVersion:e=>Wn.V61.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",skipValidation:!0}),migrateBackwards:e=>({...e,errors:G05(e.errors)})};function G05(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>r.isWildcardStatusCode!==!0))}var F_E={laterVersion:"v63",earlierVersion:"v62",firstGeneratorVersionToConsumeNewIR:{[P.TYPESCRIPT_NODE_SDK]:"3.43.0",[P.TYPESCRIPT_BROWSER_SDK]:"3.43.0",[P.TYPESCRIPT]:"3.43.0",[P.TYPESCRIPT_SDK]:"3.43.0",[P.TYPESCRIPT_EXPRESS]:"3.43.0",[P.JAVA]:C,[P.JAVA_MODEL]:C,[P.JAVA_SDK]:C,[P.JAVA_SPRING]:C,[P.OPENAPI_PYTHON_CLIENT]:C,[P.OPENAPI]:C,[P.PYTHON_FASTAPI]:C,[P.PYTHON_PYDANTIC]:C,[P.PYTHON_SDK]:C,[P.STOPLIGHT]:C,[P.POSTMAN]:C,[P.GO_FIBER]:C,[P.GO_MODEL]:C,[P.GO_SDK]:C,[P.RUBY_MODEL]:C,[P.RUBY_SDK]:C,[P.CSHARP_MODEL]:C,[P.CSHARP_SDK]:C,[P.SWIFT_MODEL]:C,[P.SWIFT_SDK]:C,[P.PHP_MODEL]:C,[P.PHP_SDK]:C,[P.RUST_MODEL]:C,[P.RUST_SDK]:C},jsonifyEarlierVersion:e=>Wn.V62.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",skipValidation:!0}),migrateBackwards:e=>({...e,auth:H05(e.auth)})};function H05(e){return{...e,requirement:I.V63.AuthSchemesRequirement._visit(e.requirement,{all:()=>I.V62.AuthSchemesRequirement.All,any:()=>I.V62.AuthSchemesRequirement.Any,endpointSecurity:()=>I.V62.AuthSchemesRequirement.All,_other:()=>I.V62.AuthSchemesRequirement.All})}}function zDo(){return K05}var fKs=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new Mop([...this.migrations,t])}},Mop=class extends fKs{build(){return new Dop(this.migrations)}},Dop=class{migrations;constructor(t){this.migrations=t}migrateForGenerator({intermediateRepresentation:t,context:r,targetGenerator:i}){return this.migrate({intermediateRepresentation:t,shouldMigrate:n=>this.shouldRunMigration({migration:n,targetGenerator:i}),context:r,targetGenerator:i})}migrateThroughMigration({migration:t,intermediateRepresentation:r,context:i,targetGenerator:n}){return this.migrateThroughVersion({version:t.earlierVersion,intermediateRepresentation:r,context:i,targetGenerator:n})}migrateThroughVersion({version:t,intermediateRepresentation:r,context:i,targetGenerator:n}){let a=!1;if(this.migrations[0]?.laterVersion===t)return{ir:r,jsonify:()=>Promise.resolve().then(()=>Vn.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let c=this.migrate({intermediateRepresentation:r,shouldMigrate:d=>{let s=d.earlierVersion===t;return a||=s,s||!a},context:i,targetGenerator:n});return a||i.failAndThrow(`IR ${t} does not exist`),c}migrate({intermediateRepresentation:t,shouldMigrate:r,context:i,targetGenerator:n}){let a=t,o=async()=>Vn.IntermediateRepresentation.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"});for(let c of this.migrations){if(!r(c))break;i.logger.debug(`Migrating IR from ${c.laterVersion} to ${c.earlierVersion}`),a=c.migrateBackwards(a,{taskContext:i,targetGenerator:n}),o=()=>Promise.resolve().then(()=>c.jsonifyEarlierVersion(a))}return{ir:a,jsonify:o}}shouldRunMigration({migration:t,targetGenerator:r}){let i=t.firstGeneratorVersionToConsumeNewIR[r.name];if(i==null)throw new Error(`Cannot migrate intermediate representation. Unrecognized generator: ${r.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`);switch(i){case C:return!0;case k:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return S$(i,r.version)}getIRVersionForGenerator({targetGenerator:t}){let r=this.migrations[0]?.laterVersion;for(let i of this.migrations)if(this.shouldRunMigration({migration:i,targetGenerator:t}))r=i.earlierVersion;else break;return r}},x05={Builder:new fKs([])},K05=x05.Builder.withMigration(F_E).withMigration(N_E).withMigration(z_E).withMigration(R_E).withMigration(T_E).withMigration(q_E).withMigration(I_E).withMigration(B_E).withMigration(O_E).withMigration(b_E).withMigration(u_E).withMigration($pE).withMigration(VpE).withMigration(zpE).withMigration(RpE).withMigration(qpE).withMigration(CpE).withMigration(DpE).withMigration(EpE).withMigration(wpE).withMigration(PpE).withMigration(mpE).withMigration(ApE).withMigration(OpE).withMigration(gpE).withMigration(vpE).withMigration(bpE).withMigration(ypE).withMigration(hpE).withMigration(_pE).withMigration(ppE).withMigration(fpE).withMigration(cpE).withMigration(spE).withMigration(upE).withMigration(epE).withMigration(kdE).withMigration(ZdE).withMigration(YdE).withMigration($dE).withMigration(q5P).withMigration(B5P).withMigration(D5P).withMigration(E5P).withMigration(j5P).withMigration(m5P).withMigration(A5P).withMigration(O5P).withMigration(b5P).withMigration(_5P).withMigration(p5P).withMigration(d5P).withMigration(l5P).withMigration(c5P).withMigration(s5P).withMigration(n5P).withMigration(t5P).withMigration(e5P).withMigration(kWP).withMigration(QWP).withMigration(zWP).withMigration(SHh).build();function NDo({intermediateRepresentation:e,context:t,targetGenerator:r}){return zDo().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function Bop({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:i}){return zDo().migrateThroughVersion({version:i,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function FDo({intermediateRepresentation:e,context:t,version:r}){return zDo().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function Q_E({workspace:e,audiences:t,generatorInvocation:r,context:i,irVersionOverride:n,version:a,packageName:o,sourceConfig:c,includeOptionalRequestPropertyExamples:d,ir:s}){let u=s??eS({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:d,disabled:r.disableExamples},readme:r.readme,version:a,packageName:o,context:i,sourceResolver:new kE(i,e),generationMetadata:{cliVersion:e.cliVersion,generatorName:r.name,generatorVersion:r.version,generatorConfig:r.config}});c!=null&&(u.sourceConfig=c),u.generationMetadata={cliVersion:e.cliVersion,generatorName:r.name,generatorVersion:r.version,generatorConfig:r.config},i.logger.debug("Generated IR");let f=await jpn(r).then(h=>h==null?void 0:"v"+h.toString()),p=n??f,_=p!=null?await FDo({intermediateRepresentation:u,context:i,version:p}):await NDo({intermediateRepresentation:u,context:i,targetGenerator:{name:r.name,version:r.version}});return{latest:u,migrated:_}}var V_E=require("@boundaryml/baml");var nRi=require("@boundaryml/baml");var Iop=require("@boundaryml/baml"),dKs=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}async AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return await this.runtime.buildRequest("AnalyzeSdkDiff",{diff:t},this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,!1,n)}catch(i){throw(0,Iop.toBamlError)(i)}}},pKs=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}async AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return await this.runtime.buildRequest("AnalyzeSdkDiff",{diff:t},this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,!0,n)}catch(i){throw(0,Iop.toBamlError)(i)}}};var Cop=require("@boundaryml/baml"),_Ks=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return this.runtime.parseLlmResponse("AnalyzeSdkDiff",t,!1,this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,n)}catch(i){throw(0,Cop.toBamlError)(i)}}},hKs=class{runtime;ctxManager;constructor(t,r){this.runtime=t,this.ctxManager=r}AnalyzeSdkDiff(t,r){try{let i=r?.env?{...process.env,...r.env}:{...process.env},n=Object.fromEntries(Object.entries(i).filter(([a,o])=>o!==void 0));return this.runtime.parseLlmResponse("AnalyzeSdkDiff",t,!0,this.ctxManager.cloneContext(),r?.tb?.__tb(),r?.clientRegistry,n)}catch(i){throw(0,Cop.toBamlError)(i)}}};var yKs=require("@boundaryml/baml");var J05={"diff_analyzer.baml":`// SDK Diff Analyzer
1884
1884
  // Analyzes git diffs of SDK code and produces semantic commit messages and version bumps
1885
1885
 
1886
1886
  enum VersionBump {
@@ -2012,7 +2012,7 @@ Unable to analyze changes with AI, incrementing PATCH version.
2012
2012
  \u{1F33F} Generated with Fern`}async isFernIgnorePresent(){let t=Ir.of(Ct(this.absolutePathToLocalOutput,Xe.of(aHt)));return await mi(t)}async isGitRepository(){let t=Ir.of(Ct(this.absolutePathToLocalOutput,Xe.of(".git")));return await mi(t)}async copyGeneratedFilesWithFernIgnoreInExistingRepo(){let t=Ir.of(Ct(this.absolutePathToLocalOutput,Xe.of(aHt))),r=await Lln({absolutePathToFernignore:t});(await this.runGitCommand(["config","--list"],this.absolutePathToLocalOutput)).includes("user.name")||(await this.runGitCommand(["config","user.name","fern-api"],this.absolutePathToLocalOutput),await this.runGitCommand(["config","user.email","info@buildwithfern.com"],this.absolutePathToLocalOutput)),await this.runGitCommand(["rm","-rf","."],this.absolutePathToLocalOutput),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput),await this.runGitCommand(["add","."],this.absolutePathToLocalOutput),await this.runGitCommand(["reset","--",...r],this.absolutePathToLocalOutput),await this.runGitCommand(["restore","."],this.absolutePathToLocalOutput)}async copyGeneratedFilesWithFernIgnoreInTempRepo(){let t=Ir.of((await K_E.default.dir({})).path),r=Ir.of(Ct(this.absolutePathToLocalOutput,Xe.of(aHt))),i=await Lln({absolutePathToFernignore:r});await(0,q3.cp)(this.absolutePathToLocalOutput,t,{recursive:!0}),await this.runGitCommand(["init"],t),await this.runGitCommand(["add","."],t),(await this.runGitCommand(["config","--list"],t)).includes("user.name")||(await this.runGitCommand(["config","user.name","fern-api"],t),await this.runGitCommand(["config","user.email","info@buildwithfern.com"],t)),await this.runGitCommand(["commit","--allow-empty","-m",'"init"'],t),await this.runGitCommand(["rm","-rf","."],t),await this.copyGeneratedFilesToDirectory(t),await this.runGitCommand(["add","."],t),await this.runGitCommand(["reset","--",...i],t),await this.runGitCommand(["restore","."],t),await(0,q3.rm)(Ct(t,Xe.of(".git")),{recursive:!0}),await(0,q3.rm)(this.absolutePathToLocalOutput,{recursive:!0}),await(0,q3.cp)(t,this.absolutePathToLocalOutput,{recursive:!0})}async copyGeneratedFilesNoFernIgnorePreservingGit(){let t=await(0,q3.readdir)(this.absolutePathToLocalOutput);await Promise.all(t.filter(r=>r!==".git").map(r=>(0,q3.rm)(Ct(this.absolutePathToLocalOutput,Xe.of(r)),{force:!0,recursive:!0}))),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput)}async copyGeneratedFilesNoFernIgnoreDeleteAll(){this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`),await(0,q3.rm)(this.absolutePathToLocalOutput,{force:!0,recursive:!0}),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput)}async copyGeneratedFilesToDirectory(t){let[r,...i]=await(0,q3.readdir)(this.absolutePathToTmpOutputDirectory);if(r!=null)if(this.context.logger.debug(`Copying generated files to ${t}`),r.endsWith(".zip")){await(0,G_E.default)(Ct(this.absolutePathToTmpOutputDirectory,Xe.of(r)),t);for(let n of i)await(0,q3.cp)(Ct(this.absolutePathToTmpOutputDirectory,Xe.of(n)),Ct(t,Xe.of(n)),{recursive:!0})}else await(0,q3.cp)(this.absolutePathToTmpOutputDirectory,t,{recursive:!0})}async copySnippetJSON({absolutePathToTmpSnippetJSON:t,absolutePathToLocalSnippetJSON:r}){this.context.logger.debug(`Copying generated snippets to ${r}`),await(0,q3.cp)(t,r)}async runGitCommand(t,r){return(await Nb(this.context.logger,"git",t,{cwd:r,doNotPipeOutput:!0})).stdout}async generateDiffFile(){let t=(0,x_E.join)((0,H_E.tmpdir)(),`git-diff-${Date.now()}.patch`);return await this.runGitCommand(["diff","HEAD","--output",t],this.absolutePathToLocalOutput),this.context.logger.info(`Generated git diff to file: ${t}`),t}};function Z05(e,t){let r=FZc(e);if(r?.type==="custom"){let i=r.value,n=t?zza.dirname(t):process.cwd(),a=zza.isAbsolute(i)?i:zza.resolve(n,i);return Ir.of(a)}}async function Y_E({organization:e,absolutePathToFernConfig:t,workspace:r,generatorInvocation:i,absolutePathToLocalOutput:n,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:o,audiences:c,version:d,workspaceTempDir:s,keepDocker:u,context:f,irVersionOverride:p,outputVersionOverride:_,writeUnitTests:h,generateOauthClients:y,generatePaginatedClients:b,includeOptionalRequestPropertyExamples:v,inspect:O,executionEnvironment:A,runner:g,whiteLabel:m,ir:j,ai:S}){let{latest:w,migrated:D}=await Q_E({workspace:r,audiences:c,generatorInvocation:i,context:f,irVersionOverride:p,packageName:ki.getPackageName({generatorInvocation:i}),version:d??_,sourceConfig:ew5(r),includeOptionalRequestPropertyExamples:v,ir:j}),B=await k05({workspaceTempDir:s,filename:hXc,context:f,ir:D});f.logger.debug("Wrote IR to: "+B);let q=(0,Rza.join)(s.path,_Xc),U=Ir.of(q);await(0,axn.writeFile)(q,""),f.logger.debug("Will write config.json to: "+U);let R=(0,Rza.join)(s.path,pXc),N=Ir.of(R);await(0,axn.mkdir)(R,{recursive:!0}),f.logger.debug("Will write output to: "+N);let F;if(a!=null){let ge=(0,Rza.join)(s.path,"snippet.json");F=Ir.of(ge),await(0,axn.writeFile)(ge,""),f.logger.debug("Will write snippet.json to: "+F)}let x;if(o!=null){let ge=(0,Rza.join)(s.path,Zmp);x=Ir.of(ge),await(0,axn.writeFile)(ge,""),f.logger.debug("Will write snippet-templates.json to: "+x)}let ee=A??new VJa({containerImage:`${i.name}:${i.version}`,keepContainer:u}),ve=ee instanceof VJa?{outputDirectory:Ir.of(ZPu),irPath:Ir.of(kPu),configPath:Ir.of(LJa),snippetPath:Ir.of(eju),snippetTemplatePath:Ir.of(tju)}:{outputDirectory:N,configPath:U,irPath:B,snippetPath:F,snippetTemplatePath:x},H=EHh({generatorInvocation:i,customConfig:i.config,workspaceName:r.definition.rootApiFile.contents.name,outputVersion:_,organization:e,absolutePathToSnippet:F,absolutePathToSnippetTemplates:x,absolutePathToFernConfig:t,writeUnitTests:h,generateOauthClients:y,generatePaginatedClients:b,whiteLabel:m,paths:ve});await(0,axn.writeFile)(U,JSON.stringify(await J_E.GeneratorConfig.jsonOrThrow(H),void 0,4));let G=Z05(i,t);await ee.execute({generatorName:i.name,irPath:B,configPath:U,outputPath:N,snippetPath:F,snippetTemplatePath:x,licenseFilePath:G,context:f,inspect:O,runner:g});let ue=await new gKs({context:f,absolutePathToLocalOutput:n,absolutePathToTmpOutputDirectory:N,absolutePathToLocalSnippetJSON:a,absolutePathToLocalSnippetTemplateJSON:o,absolutePathToTmpSnippetJSON:F,absolutePathToTmpSnippetTemplatesJSON:x,version:d,ai:S,isWhitelabel:j.readmeConfig?.whiteLabel??!1}).copyGeneratedFiles();return{ir:w,generatorConfig:H,...ue}}async function k05({ir:e,workspaceTempDir:t,filename:r,context:i}){i.logger.debug("Migrated IR");let n;if(r)n=Ir.of((0,Rza.join)(t.path,r));else{let a=await $_E.default.file({tmpdir:t.path});n=Ir.of(a.path)}return await X9(n,e,{pretty:!1}),i.logger.debug(`Wrote IR to ${n}`),n}function ew5(e){return{sources:e.getSources().map(t=>t.type==="protobuf"?j$.proto({id:t.id,protoRootUrl:`file:///${tw5(t)}`}):j$.openapi())}}function tw5(e){return`${K3h}/${e.id}`}function oxn({apiName:e,organization:t,generatorInvocation:r}){let i=rw5(r);return{apiName:e,organization:t,customConfig:r.config,outputConfig:i??$t.GeneratorOutputConfig.local()}}function rw5(e){let t=e.outputMode;switch(t.type){case"downloadFiles":return $t.GeneratorOutputConfig.local();case"publishV2":return iw5({publish:t.publishV2,version:e.version});case"githubV2":return nw5({github:t.githubV2,language:e.language,version:e.version});case"publish":case"github":return;default:vt(t)}}function iw5({publish:e,version:t}){switch(e.type){case"npmOverride":{let r=e.npmOverride;return r==null?void 0:$t.GeneratorOutputConfig.publish($t.PublishInfo.npm({version:t,packageName:r.packageName,repoUrl:void 0}))}case"mavenOverride":{let r=e.mavenOverride;return r==null?void 0:$t.GeneratorOutputConfig.publish($t.PublishInfo.maven({version:t,coordinate:r.coordinate,repoUrl:void 0}))}case"pypiOverride":{let r=e.pypiOverride;return r==null?void 0:$t.GeneratorOutputConfig.publish($t.PublishInfo.pypi({version:t,packageName:r.coordinate,repoUrl:void 0}))}case"rubyGemsOverride":{let r=e.rubyGemsOverride;return r==null?void 0:$t.GeneratorOutputConfig.publish($t.PublishInfo.rubygems({version:t,packageName:r.packageName,repoUrl:void 0}))}case"nugetOverride":{let r=e.nugetOverride;return r==null?void 0:$t.GeneratorOutputConfig.publish($t.PublishInfo.nuget({version:t,packageName:r.packageName,repoUrl:void 0}))}case"cratesOverride":{let r=e.cratesOverride;return r==null?void 0:$t.GeneratorOutputConfig.publish($t.PublishInfo.crates({version:t,packageName:r.packageName,repoUrl:void 0}))}case"postman":return;default:vt(e)}}function nw5({github:e,version:t,language:r}){let i=aw5({owner:e.owner,repo:e.repo});if(r===ki.GenerationLanguage.GO)return $t.GeneratorOutputConfig.publish($t.PublishInfo.go({version:t,repoUrl:i}));if(r===ki.GenerationLanguage.SWIFT)return $t.GeneratorOutputConfig.publish($t.PublishInfo.swift({version:t,repoUrl:i}));let n=e.publishInfo;if(n!=null)switch(n.type){case"maven":return $t.GeneratorOutputConfig.publish($t.PublishInfo.maven({version:t,coordinate:n.coordinate,repoUrl:i}));case"npm":return $t.GeneratorOutputConfig.publish($t.PublishInfo.npm({version:t,packageName:n.packageName,repoUrl:i}));case"pypi":return $t.GeneratorOutputConfig.publish($t.PublishInfo.pypi({version:t,packageName:n.packageName,repoUrl:i}));case"rubygems":return $t.GeneratorOutputConfig.publish($t.PublishInfo.rubygems({version:t,packageName:n.packageName,repoUrl:i}));case"nuget":return $t.GeneratorOutputConfig.publish($t.PublishInfo.nuget({version:t,packageName:n.packageName,repoUrl:i}));case"crates":return $t.GeneratorOutputConfig.publish($t.PublishInfo.crates({version:t,packageName:n.packageName,repoUrl:i}));case"postman":return;default:vt(n)}}function aw5({owner:e,repo:t}){return`https://github.com/${e}/${t}`}var MKs=ce(DHi(),1);var X_E=require("fs"),OKs=require("fs/promises"),Z_E=require("stream/promises");async function k_E({snippetsS3PreSignedReadUrl:e,absolutePathToLocalSnippetJSON:t,context:r}){try{await ow5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(It.green(`Downloaded to ${t}`))}catch{r.logger.debug(It.yellow("Failed to download snippet.json from output."))}}async function ow5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await wB.get(e,{responseType:"stream"});await mi(t)&&await(0,OKs.rm)(t,{recursive:!0}),await(0,OKs.mkdir)(en(t),{recursive:!0}),await(0,Z_E.pipeline)(r.data,(0,X_E.createWriteStream)(t))}var V6i=ce(DHi(),1);var ehE=ce(EXn(),1),AKs=require("fs/promises");var thE=ce(ng(),1);async function rhE({projectConfig:e,workspace:t,organization:r,intermediateRepresentation:i,generatorInvocation:n,version:a,context:o,shouldLogS3Url:c,token:d,whitelabel:s,irVersionOverride:u,absolutePathToPreview:f,fernignorePath:p}){let _;if(p!=null)try{_=await(0,AKs.readFile)(p,"utf-8")}catch(y){o.failAndThrow(`Failed to read fernignore file at ${p}: ${y}`)}let h=await uw5({projectConfig:e,workspace:t,organization:r,generatorInvocation:n,version:a,context:o,shouldLogS3Url:c,token:d,whitelabel:s,absolutePathToPreview:f,fernignoreContents:_});return await sw5({intermediateRepresentation:i,job:h,context:o,generatorInvocation:n,irVersionOverride:u}),h}async function uw5({projectConfig:e,workspace:t,organization:r,generatorInvocation:i,version:n,context:a,shouldLogS3Url:o,token:c,whitelabel:d,absolutePathToPreview:s,fernignoreContents:u}){let f=XNi({token:c.value}),p={id:i.name,version:i.version,outputMode:i.outputMode,customConfig:i.config,publishMetadata:i.publishMetadata},_=await f.remoteGen.createJobV3({apiName:t.definition.rootApiFile.contents.name,version:n,organizationName:r,generators:[p],uploadToS3:lw5({outputMode:i.outputMode,generatorInvocation:i,absolutePathToPreview:s,shouldLogS3Url:o}),whitelabel:d,preview:s!=null,fernignoreContents:u});return _.ok?_.body:cw5(_.error)._visit({illegalApiNameError:()=>a.failAndThrow("API name is invalid: "+t.definition.rootApiFile.contents.name),illegalApiVersionError:()=>a.failAndThrow("API version is invalid: "+n),cannotPublishToNpmScope:({validScope:h,invalidScope:y})=>a.failAndThrow(`You do not have permission to publish to ${y} (expected ${h})`),cannotPublishToMavenGroup:({validGroup:h,invalidGroup:y})=>a.failAndThrow(`You do not have permission to publish to ${y} (expected ${h})`),cannotPublishPypiPackage:({validPrefix:h,invalidPackageName:y})=>a.failAndThrow(`You do not have permission to publish to ${y} (expected ${h})`),generatorsDoNotExistError:h=>a.failAndThrow("Generators do not exist: "+h.nonExistentGenerators.map(y=>`${y.id}@${y.version}`).join(", ")),insufficientPermissions:()=>a.failAndThrow(`You do not have permission to run this generator. Please run 'fern login' to ensure you are logged in with the correct account.
2013
2013
 
2014
2014
  If you believe this is an error, please contact support@buildwithfern.com`),orgNotConfiguredForWhitelabel:()=>a.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com."),_other:h=>(a.logger.debug(`Failed to create job: ${JSON.stringify(h)}`),a.failAndThrow("Failed to create job. Please try again or contact support@buildwithfern.com for assistance."))})}async function sw5({intermediateRepresentation:e,generatorInvocation:t,job:r,context:i,irVersionOverride:n}){let a=await jpn(t).then(f=>f==null?void 0:"v"+f.toString()),o=n??a,c=o==null?await NDo({intermediateRepresentation:e,context:i,targetGenerator:{name:t.name,version:t.version}}):await Bop({intermediateRepresentation:e,context:i,irVersion:o,targetGenerator:{name:t.name,version:t.version}}),d=new ehE.default,s=await Brc(c,{onWrite:f=>{i.logger.debug("Wrote IR to disk: "+f)}});d.append("file",s);let u=(0,thE.default)(mbc(),`/api/remote-gen/jobs/${r.jobId}/start`);try{await wB.post(u,d,{headers:d.getHeaders(),maxBodyLength:1/0})}catch(f){let p=f instanceof CT_?f.response?.data:f;i.logger.debug(`POST ${u} failed with ${JSON.stringify(f)}`),i.failAndThrow("Failed to start job",p)}}function cw5(e){if(e?.content?.reason==="status-code"){let t=e.content.body;switch(t?._error){case"IllegalApiNameError":return V6i.FernFiddle.remoteGen.createJobV3.Error.illegalApiNameError();case"IllegalApiVersionError":return V6i.FernFiddle.remoteGen.createJobV3.Error.illegalApiVersionError(t.body);case"GeneratorsDoNotExistError":return V6i.FernFiddle.remoteGen.createJobV3.Error.generatorsDoNotExistError(t.body);case"CannotPublishToNpmScope":return V6i.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToNpmScope(t.body);case"CannotPublishToMavenScope":return V6i.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToMavenGroup(t.body);case"CannotPublishPypiPackage":return V6i.FernFiddle.remoteGen.createJobV3.Error.cannotPublishPypiPackage(t.body);case"InsufficientPermissions":return V6i.FernFiddle.remoteGen.createJobV3.Error.insufficientPermissions(t.body);case"OrgNotConfiguredForWhitelabel":return V6i.FernFiddle.remoteGen.createJobV3.Error.orgNotConfiguredForWhitelabel(t.body)}}return e}function lw5({outputMode:e,generatorInvocation:t,absolutePathToPreview:r,shouldLogS3Url:i}){return e.type==="downloadFiles"||t.absolutePathToLocalSnippets!=null||r!=null||i}var ihE=XNi();var fw5=3;function nhE({job:e,taskId:t,taskHandler:r,context:i}){let n=0,a=async()=>{let o=await ihE.remoteGen.getJobStatus(e.jobId);if(o.ok)return o.body[t];i.logger.debug("Failed to get job status.",JSON.stringify(o.error.content))};return new Promise((o,c)=>{d();async function d(){try{let s=await a();if(s==null)n++,n===fw5&&i.failAndThrow(`Failed to get job status after ${n} attempts.`),setTimeout(d,2e3+1e3*n);else{n=0;let u=await r.processUpdate(s);r.isFinished?o(u):setTimeout(d,2e3)}}catch(s){c(s)}}})}var Qop=ce(wmu(),1),Uop=require("fs"),G6i=require("fs/promises"),jKs=ce(require("path"),1),Lop=require("stream/promises");var mKs=ce(uhE(),1);function W6i(e,t,{target:r="stdout",...i}={}){return mKs.default[r]?nna.link(e,t):i.fallback===!1?e:typeof i.fallback=="function"?i.fallback(e,t):`${e} (\u200B${t}\u200B)`}W6i.isSupported=mKs.default.stdout;W6i.stderr=(e,t,r={})=>W6i(e,t,{target:"stderr",...r});W6i.stderr.isSupported=mKs.default.stderr;var wKs=ce(Z9(),1),PKs=class{context;generatorInvocation;absolutePathToPreview;lengthOfLastLogs=0;constructor({interactiveTaskContext:t,generatorInvocation:r,absolutePathToPreview:i}){this.context=t,this.generatorInvocation=r,this.absolutePathToPreview=i}async processUpdate(t){t==null&&this.context.failAndThrow("Task is missing on job status");let r=t.packages.map(n=>n.coordinate._visit({npm:a=>`${a.name}@${a.version}`,maven:a=>`${a.group}:${a.artifact}:${a.version}`,pypi:a=>`${a.name} ${a.version}`,ruby:a=>`${a.name}:${a.version}`,nuget:a=>`${a.name} ${a.version}`,crates:a=>`${a.name} ${a.version}`,_other:()=>"<unknown package>"}));t.packages.length>0&&this.#i==null&&(this.#i=t.packages[0]?.coordinate._visit({npm:n=>n.version,maven:n=>n.version,pypi:n=>n.version,ruby:n=>n.version,nuget:n=>n.version,crates:n=>n.version,_other:()=>{}})),this.absolutePathToPreview==null&&this.context.setSubtitle(r.length>0?r.map(n=>`\u25E6 ${n}`).join(`
2015
- `):void 0);for(let n of t.logs.slice(this.lengthOfLastLogs))if(this.context.logger.log(hw5(n.level),n.message),this.#i==null){let a=n.message.match(/Tagging release (\d+\.\d+\.\d+)/);a&&(this.#i=a[1])}this.lengthOfLastLogs=t.logs.length;let i=n=>{this.context.logger.debug(`Generated files. ${W6i("View here",n,{fallback:(a,o)=>`${a}: ${o}`})}`)};return await t.status._visit({notStarted:Bt,running:Bt,failed:({message:n,s3PreSignedReadUrl:a})=>{a!=null&&i(a),this.context.failAndThrow(n)},finished:async n=>{if(n.s3PreSignedReadUrlV2!=null){i(n.s3PreSignedReadUrlV2);let a=this.getAbsolutePathToLocalOutput();a!=null&&await pw5({s3PreSignedReadUrl:n.s3PreSignedReadUrlV2,absolutePathToLocalOutput:a,context:this.context})}if(this.absolutePathToPreview==null)for(let a of r)this.context.logger.info(`Published ${a}`);this.#e=!0,this.#t=n.createdSnippets!=null?n.createdSnippets:!1,this.#r=n.snippetsS3PreSignedReadUrl},_other:()=>{this.context.logger.warn("Received unknown update type: "+t.status.type)}}),this.#e?{createdSnippets:this.#t,snippetsS3PreSignedReadUrl:this.#r,actualVersion:this.#i}:void 0}getAbsolutePathToLocalOutput(){return this.absolutePathToPreview!=null?Ct(this.absolutePathToPreview,Xe.of(jKs.default.basename(this.generatorInvocation.name))):this.generatorInvocation.absolutePathToLocalOutput}#e=!1;get isFinished(){return this.#e}#t=!1;get createdSnippets(){return this.#t}#r=void 0;get snippetsS3PreSignedReadUrl(){return this.#r}#i=void 0;get actualVersion(){return this.#i}};async function pw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){try{let i=await yw5(t),n=await bw5(t);i&&n?await vw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):i&&!n?await gw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):await _w5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(It.green(`Downloaded to ${t}`))}catch(i){r.failAndThrow("Failed to download files",i)}}async function _w5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await wB.get(e,{responseType:"stream"}),i=await wKs.default.dir({prefix:"fern",unsafeCleanup:!0}),n=jKs.default.join(i.path,"output.zip");await(0,Lop.pipeline)(r.data,(0,Uop.createWriteStream)(n)),await mi(t)&&await(0,G6i.rm)(t,{recursive:!0}),await(0,G6i.mkdir)(t,{recursive:!0}),await(0,Qop.default)(n,t)}function hw5(e){switch(e){case"DEBUG":return oc.Debug;case"INFO":return oc.Info;case"WARN":return oc.Warn;case"ERROR":return oc.Error;default:return oc.Info}}async function yw5(e){let t=Ct(e,Xe.of(aHt));return await mi(t)}async function bw5(e){let t=Ct(e,Xe.of(".git"));return await mi(t)}async function T3(e,t,r){return(await Nb(r.logger,"git",e,{cwd:t,doNotPipeOutput:!0})).stdout}async function vw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let i=Ct(t,Xe.of(aHt)),n=await Lln({absolutePathToFernignore:i});(await T3(["config","--list"],t,r)).includes("user.name")||(await T3(["config","user.name","fern-api"],t,r),await T3(["config","user.email","info@buildwithfern.com"],t,r)),await T3(["rm","-rf","."],t,r),await shE({s3PreSignedReadUrl:e,outputPath:t}),await T3(["add","."],t,r),await T3(["reset","--",...n],t,r),await T3(["restore","."],t,r)}async function gw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let i=Ir.of((await wKs.default.dir({})).path),n=Ct(t,Xe.of(aHt)),a=await Lln({absolutePathToFernignore:n});await(0,G6i.cp)(t,i,{recursive:!0}),await T3(["init"],i,r),await T3(["add","."],i,r),(await T3(["config","--list"],i,r)).includes("user.name")||(await T3(["config","user.name","fern-api"],i,r),await T3(["config","user.email","info@buildwithfern.com"],i,r)),await T3(["commit","--allow-empty","-m",'"init"'],i,r),await T3(["rm","-rf","."],i,r),await shE({s3PreSignedReadUrl:e,outputPath:i}),await T3(["add","."],i,r),await T3(["reset","--",...a],i,r),await T3(["restore","."],i,r),await(0,G6i.rm)(Ct(i,Xe.of(".git")),{recursive:!0}),await(0,G6i.rm)(t,{recursive:!0}),await(0,G6i.cp)(i,t,{recursive:!0})}async function shE({s3PreSignedReadUrl:e,outputPath:t}){let r=await wB.get(e,{responseType:"stream"}),i=await wKs.default.dir({prefix:"fern",unsafeCleanup:!0}),n=jKs.default.join(i.path,"output.zip");await(0,Lop.pipeline)(r.data,(0,Uop.createWriteStream)(n)),await(0,Qop.default)(n,t)}var SKs=require("fs/promises"),chE=ce(Z9(),1),Ow5="proto.zip",EKs=class{sourceTypes;context;sources;constructor(t,r){this.context=t,this.sources=Object.fromEntries(r.map(i=>[i.id,i])),this.sourceTypes=new Set(Object.values(this.sources).map(i=>i.type))}async uploadSources(t){for(let[r,i]of Object.entries(t)){let n=this.getSourceOrThrow(r);await this.uploadSource(n,i.uploadUrl)}return this.convertFdrSourceUploadsToSourceConfig(t)}async uploadSource(t,r){let i=await this.getUploadCommand(t),n=await(0,SKs.readFile)(i.absoluteFilePath),a=await fetch(r,{method:"PUT",body:n,headers:{"Content-Type":"application/octet-stream"}});await i.cleanup(),a.ok||this.context.failAndThrow(`Failed to upload source file: ${t.absoluteFilePath}. Status: ${a.status}, ${a.statusText}`)}async getUploadCommand(t){if(t.type==="protobuf"){let r=await this.zipSource(t.absoluteFilePath);return{absoluteFilePath:r,cleanup:async()=>{this.context.logger.debug(`Removing ${r}`),await(0,SKs.unlink)(r)}}}return{absoluteFilePath:t.absoluteFilePath,cleanup:async()=>{}}}async zipSource(t){let r=await chE.default.dir(),i=Ct(Ir.of(r.path),Xe.of(Ow5));return this.context.logger.debug(`Zipping source ${t} into ${i}`),await Nb(this.context.logger,"zip",["-r",i,"."],{cwd:t,doNotPipeOutput:!0}),i}convertFdrSourceUploadsToSourceConfig(t){let r=[];for(let[i,n]of Object.entries(t))switch(this.getSourceOrThrow(i).type){case"protobuf":r.push(j$.proto({id:i,protoRootUrl:n.downloadUrl}));continue;case"openapi":r.push(j$.openapi());continue;case"asyncapi":continue}return{sources:r}}getSourceOrThrow(t){let r=this.sources[t];return r==null&&this.context.failAndThrow(`Internal error; server responded with source id "${t}" which does not exist in the workspace.`),r}};async function fhE({projectConfig:e,organization:t,workspace:r,interactiveTaskContext:i,generatorInvocation:n,version:a,audiences:o,shouldLogS3Url:c,token:d,whitelabel:s,irVersionOverride:u,absolutePathToPreview:f,readme:p,fernignorePath:_,dynamicIrOnly:h}){let y=qVt({token:d.value}),b=ki.getPackageName({generatorInvocation:n}),v=f!=null,O=H=>MT(H,{onError:G=>i.failAndThrow(G)},{substituteAsEmpty:v}),A=O(n),g=oxn({apiName:r.definition.rootApiFile.contents.name,organization:t,generatorInvocation:A}),m=a??await mw5({fdr:y,packageName:b,generatorInvocation:n}),j=eS({workspace:r,generationLanguage:n.language,keywords:n.keywords,smartCasing:n.smartCasing,exampleGeneration:{disabled:n.disableExamples,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!1},audiences:o,readme:p,packageName:b,version:m,context:i,sourceResolver:new kE(i,r),dynamicGeneratorConfig:g,generationMetadata:{cliVersion:r.cliVersion,generatorName:n.name,generatorVersion:n.version,generatorConfig:n.config}}),w=await O4({token:d.value}).organization.get(Jh.OrganizationId(e.organization));w.ok&&(w.body.isWhitelabled&&(j.readmeConfig==null&&(j.readmeConfig=jw5),j.readmeConfig.whiteLabel=!0),j.selfHosted=w.body.selfHostedSdKs);let D=r.getSources(),B=eH({ir:j,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},context:i}),q=await y.api.v1.register.registerApiDefinition({orgId:li.OrgId(t),apiId:li.ApiId(j.apiName.originalName),definition:B,sources:D.length>0?Pw5(D):void 0}),U,R;q.ok&&(U=q.body.apiDefinitionId,R=q.body.sources);let N=new EKs(i,D);if(R==null&&N.sourceTypes.has("protobuf")&&(q.ok||i.failAndThrow(`Failed to register API definition: ${JSON.stringify(q.error.content)}`),i.failAndThrow("Did not successfully upload Protobuf source files.")),R!=null){i.logger.debug("Uploading source files ...");let H=await N.uploadSources(R);i.logger.debug("Setting IR source configuration ..."),j.sourceConfig=H}if(h){if(i.logger.info("Dynamic IR only mode: skipping SDK generation and uploading dynamic IR only"),a==null){i.failAndThrow("Version is required for dynamic IR only mode");return}if(n.language==null){i.failAndThrow("Language is required for dynamic IR only mode");return}if(b==null){i.failAndThrow("Package name is required for dynamic IR only mode");return}try{await lhE({fdr:y,organization:t,version:a,language:n.language,packageName:b,ir:j,smartCasing:n.smartCasing,dynamicGeneratorConfig:g,context:i})}catch(H){i.failAndThrow(`Failed to upload dynamic IR: ${H instanceof Error?H.message:String(H)}`)}return{createdSnippets:!1,snippetsS3PreSignedReadUrl:void 0,actualVersion:a}}let F=await rhE({projectConfig:e,workspace:r,organization:t,generatorInvocation:A,context:i,version:a,intermediateRepresentation:{...j,fdrApiDefinitionId:U,publishConfig:Aw5({generatorInvocation:A})},shouldLogS3Url:c,token:d,whitelabel:s!=null?O(s):void 0,irVersionOverride:u,absolutePathToPreview:f,fernignorePath:_});i.logger.debug(`Job ID: ${F.jobId}`);let x=F.taskIds[0];if(x==null){i.failAndThrow("Did not receive a task ID.");return}i.logger.debug(`Task ID: ${x}`);let ee=new PKs({job:F,taskId:x,generatorInvocation:n,interactiveTaskContext:i,absolutePathToPreview:f}),me=await nhE({job:F,taskHandler:ee,taskId:x,context:i}),ve=me?.actualVersion??m;if(me!=null&&ve!=null&&n.language!=null&&b!=null&&!v)try{await lhE({fdr:y,organization:t,version:ve,language:n.language,packageName:b,ir:j,smartCasing:n.smartCasing,dynamicGeneratorConfig:g,context:i})}catch(H){i.logger.warn(`Failed to upload dynamic IR for SDK generation: ${H instanceof Error?H.message:String(H)}`)}return me}function Aw5({generatorInvocation:e}){return e.outputMode._visit({downloadFiles:()=>{},github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:t=>t._visit({mavenOverride:()=>{},pypiOverride:()=>{},nugetOverride:()=>{},npmOverride:()=>{},rubyGemsOverride:()=>{},cratesOverride:()=>{},postman:r=>{let i;return e.raw?.output?.location==="postman"&&(i=e.raw.output?.["collection-id"]),gr.PublishingConfig.direct({target:gr.PublishTarget.postman({apiKey:r.apiKey,workspaceId:r.workspaceId,collectionId:i})})},_other:()=>{}}),_other:()=>{}})}async function mw5({fdr:e,packageName:t,generatorInvocation:r}){if(r.language==null)return;let i;switch(r.language){case"csharp":i="Csharp";break;case"go":i="Go";break;case"java":i="Java";break;case"python":i="Python";break;case"ruby":i="Ruby";break;case"typescript":i="TypeScript";break;case"php":i="Php";break;case"swift":i="Swift";break;default:return}if(t==null)return;let n=await e.sdks.versions.computeSemanticVersion({githubRepository:r.outputMode.type==="githubV2"?`${r.outputMode.githubV2.owner}/${r.outputMode.githubV2.repo}`:void 0,language:i,package:t});if(n.ok)return n.body.version}function Pw5(e){return Object.fromEntries(Object.values(e).map(t=>[t.id,{type:t.type==="protobuf"?"proto":t.type}]))}var jw5={defaultEndpoint:void 0,bannerLink:void 0,introduction:void 0,apiReferenceLink:void 0,apiName:void 0,disabledFeatures:void 0,whiteLabel:void 0,customSections:void 0,features:void 0,exampleStyle:void 0};async function lhE({fdr:e,organization:t,version:r,language:i,packageName:n,ir:a,smartCasing:o,dynamicGeneratorConfig:c,context:d}){d.logger.debug(`Uploading dynamic IR for ${i} SDK...`);let s=await e.api.v1.register.getSdkDynamicIrUploadUrls({orgId:li.OrgId(t),version:r,snippetConfiguration:{[i]:n}});if(!s.ok){d.logger.warn(`Failed to get dynamic IR upload URLs: ${s.error.error}`);return}let u=s.body.uploadUrls[i]?.uploadUrl;if(u==null){d.logger.warn(`No upload URL returned for ${i}`);return}let f=uvn({ir:a,disableExamples:!0,smartCasing:o,generationLanguage:i,generatorConfig:c}),p=JSON.stringify(f),_=await fetch(u,{method:"PUT",body:p,headers:{"Content-Type":"application/octet-stream","Content-Length":p.length.toString()}});_.ok?d.logger.debug(`Uploaded dynamic IR for ${i}:${n} (${r})`):d.logger.warn(`Failed to upload dynamic IR for ${i}: ${_.status}`)}async function Vop({projectConfig:e,organization:t,workspace:r,context:i,generatorGroup:n,version:a,shouldLogS3Url:o,token:c,whitelabel:d,absolutePathToPreview:s,mode:u,fernignorePath:f,dynamicIrOnly:p}){if(n.generators.length===0)return i.logger.warn("No generators specified."),null;let _=[],h=[];return _.push(...n.generators.map(b=>i.runInteractiveTask({name:b.name},async v=>{let O=ioa(b),A=await r.toFernWorkspace({context:i},O,b.apiOverride?.specs),g=await fhE({projectConfig:e,organization:t,workspace:A,interactiveTaskContext:v,generatorInvocation:{...b,outputMode:b.outputMode._visit({downloadFiles:()=>b.outputMode,github:m=>MKs.FernFiddle.OutputMode.github({...m,makePr:u==="pull-request"}),githubV2:m=>u==="pull-request"?MKs.FernFiddle.OutputMode.githubV2(MKs.FernFiddle.GithubOutputModeV2.pullRequest(m)):b.outputMode,publish:()=>b.outputMode,publishV2:()=>b.outputMode,_other:()=>b.outputMode})},version:a,audiences:n.audiences,shouldLogS3Url:o,token:c,whitelabel:d,readme:b.readme,irVersionOverride:b.irVersionOverride,absolutePathToPreview:s,fernignorePath:f,dynamicIrOnly:p});g!=null&&g.createdSnippets&&(h.push(b),b.absolutePathToLocalSnippets!=null&&g.snippetsS3PreSignedReadUrl!=null&&await k_E({snippetsS3PreSignedReadUrl:g.snippetsS3PreSignedReadUrl,absolutePathToLocalSnippetJSON:b.absolutePathToLocalSnippets,context:v}))}))),(await Promise.all(_)).some(b=>!b)&&i.failAndThrow(),{snippetsProducedBy:h}}var ayE=require("crypto"),lup=require("fs/promises");var fup=ce(o3a(),1);var XhE=ce(YhE(),1);var ZhE=require("util"),fS5=(0,ZhE.promisify)(XhE.default);async function khE(e,t,r){let i=AFa(e,t),n=[];for(let a of i){let o=await Promise.all(a.map(async c=>{try{let d=await fS5(c);return d==null||d.height==null||d.width==null?void 0:{filePath:c,width:d.width,height:d.height,blurDataUrl:void 0}}catch(d){r.logger.error(`Failed to measure image size for ${c}. ${d?.message}`);return}}));n.push(...o.filter(ds))}return new Map(n.map(a=>[a.filePath,a]))}async function cup(e,t,r){let i=new Array(t.length),n=new Set;for(let a=0;a<t.length;a++){let o=t[a];if(o===void 0)continue;let c=(async()=>{let d=await r(o,a);i[a]=d})().then(()=>{n.delete(c)});n.add(c),n.size>=e&&await Promise.race(n)}return await Promise.all(n),i}var dS5=10,eyE=10,aJs=parseInt(process.env.FERN_DOCS_ASSET_HASH_CONCURRENCY??"32",10);async function tyE(e){let t=await(0,lup.readFile)(e);return(0,ayE.createHash)("sha256").update(new Uint8Array(t)).digest("hex")}async function oyE({token:e,organization:t,docsWorkspace:r,domain:i,customDomains:n,apiWorkspaces:a,ossWorkspaces:o,context:c,preview:d,editThisPage:s,isPrivate:u=!1,disableTemplates:f=!1,skipUpload:p=!1,withAiExamples:_=!0,targetAudiences:h}){let y=qVt({token:e.value}),b=u?{type:"private",authType:"sso"}:{type:"public"},v,O=n[0]??i,A=pS5(i),g=r.config.experimental&&!r.config.experimental.dynamicSnippets,m=new i8t({domain:i,docsWorkspace:r,ossWorkspaces:o,apiWorkspaces:a,taskContext:c,editThisPage:s,uploadFiles:async N=>{let F=new Map(N.map(Fe=>[Fe.absoluteFilePath,Fe])),ee=N.map(Fe=>({...Fe,mediaType:fup.lookup(Fe.absoluteFilePath)})).filter(Fe=>Fe.mediaType!==!1).filter(Fe=>zO.parse(Fe.mediaType)?.isImage()??!1).map(Fe=>Fe.absoluteFilePath),me=await khE(ee,dS5,c);c.logger.debug(`Hashing ${me.size} image files with concurrency ${aJs}...`);let ve=performance.now(),H=Array.from(me.values()),Ee=(await cup(aJs,H,async Fe=>{let it=F.get(Fe.filePath);return it==null?null:{filePath:li.docs.v1.write.FilePath(bzo(it.relativeFilePath)),width:Fe.width,height:Fe.height,blurDataUrl:Fe.blurDataUrl,alt:void 0,fileHash:await tyE(it.absoluteFilePath)}})).filter(Fe=>Fe!=null),ue=performance.now()-ve;c.logger.debug(`Hashed ${Ee.length} images in ${ue.toFixed(0)}ms`);let ge=N.filter(({absoluteFilePath:Fe})=>!me.has(Fe));c.logger.debug(`Hashing ${ge.length} non-image files with concurrency ${aJs}...`);let We=performance.now(),se=await cup(aJs,ge,async Fe=>({path:li.docs.v1.write.FilePath(bzo(Fe.relativeFilePath)),fileHash:await tyE(Fe.absoluteFilePath)})),ne=performance.now()-We;if(c.logger.debug(`Hashed ${se.length} non-image files in ${ne.toFixed(0)}ms`),d){let Fe=await y.docs.v2.write.startDocsPreviewRegister({orgId:li.OrgId(t),authConfig:u?{type:"private",authType:"sso"}:{type:"public"},filepaths:se,images:Ee,basePath:A});if(Fe.ok){if(O=Fe.body.previewUrl,v=Fe.body.docsRegistrationId,c.logger.debug(`Received preview registration ID: ${v}`),p)c.logger.debug("Skip-upload mode: skipping file uploads for docs preview");else{let it=new Set(Fe.body.skippedFiles||[]),Br=Object.fromEntries(Object.entries(Fe.body.uploadUrls).filter(([Vt])=>!it.has(Vt))),Wt=Object.keys(Br).length,Qt=it.size;Wt>0?(c.logger.debug(`Uploading ${Wt} files (${Qt} skipped)...`),await ryE(Br,r.absoluteFilePath,c,eyE)):c.logger.debug(`No files to upload (all ${Qt} up to date)`)}return iyE(Fe.body.uploadUrls,r.absoluteFilePath)}else return await nyE(Fe.error,c)}else{let Fe=await y.docs.v2.write.startDocsRegister({domain:i,customDomains:n,authConfig:b,apiId:li.ApiId(""),orgId:li.OrgId(t),filepaths:se,images:Ee});if(Fe.ok){v=Fe.body.docsRegistrationId,c.logger.debug(`Received production registration ID: ${v}`);let it=Fe.body.skippedFiles?.length||0;if(it>0&&c.logger.info(`Skipped ${it} unchanged file${it===1?"":"s"} (already uploaded)`),p)c.logger.debug("Skip-upload mode: skipping file uploads for docs");else{let Br=new Set(Fe.body.skippedFiles||[]),Wt=Object.fromEntries(Object.entries(Fe.body.uploadUrls).filter(([Vt])=>!Br.has(Vt))),Qt=Object.keys(Wt).length;Qt>0?(c.logger.info(`\u2191 Uploading ${Qt} files...`),await ryE(Wt,r.absoluteFilePath,c,eyE)):c.logger.info("No files to upload (all up to date)")}return iyE(Fe.body.uploadUrls,r.absoluteFilePath)}else return nyE(Fe.error,c)}},registerApi:async({ir:N,snippetsConfig:F,playgroundConfig:x,apiName:ee,workspace:me})=>{let ve=eH({ir:N,snippetsConfig:F,playgroundConfig:x,context:c}),H=OS5(_,r.config.experimental?.aiExampleStyleInstructions);if(H&&me){let se=me.getSources().find(ne=>ne.type==="openapi")?.absoluteFilePath;ve=await gua(ve,H,c,e,t,se)}let G,Ee=new Set;if(!g){let ge=await _S5({fdr:y,workspace:me,organization:t,context:c,snippetsConfig:F});ge&&Object.keys(ge).length>0&&(G=ge,Ee=new Set(Object.keys(ge)),c.logger.debug(`Using existing SDK dynamic IRs for: ${Object.keys(ge).join(", ")}`));let We=await bS5({workspace:me,organization:t,context:c,snippetsConfig:F,skipLanguages:Ee});We&&(G={...G,...We})}let ue=await y.api.v1.register.registerApiDefinition({orgId:li.OrgId(t),apiId:li.ApiId(N.apiName.originalName),definition:ve,definitionV2:void 0,dynamicIRs:G});if(ue.ok)return c.logger.debug(`Registered API Definition ${ee}: ${ue.body.apiDefinitionId}`),ue.body.dynamicIRs&&G&&(p?c.logger.debug("Skip-upload mode: skipping dynamic IR uploads"):await vS5({dynamicIRs:G,dynamicIRUploadUrls:ue.body.dynamicIRs,context:c,apiId:ue.body.apiDefinitionId})),ue.body.apiDefinitionId;switch(ue.error.error){case"UnauthorizedError":case"UserNotInOrgError":return c.failAndThrow("You do not have permissions to register the docs. Reach out to support@buildwithfern.com");default:{let ge=AS5(ue.error);return c.logger.error(`FDR registerApiDefinition failed. Error details:
2015
+ `):void 0);for(let n of t.logs.slice(this.lengthOfLastLogs))if(this.context.logger.log(hw5(n.level),n.message),this.#i==null){let a=n.message.match(/Tagging release (\d+\.\d+\.\d+)/);a&&(this.#i=a[1])}this.lengthOfLastLogs=t.logs.length;let i=n=>{this.context.logger.debug(`Generated files. ${W6i("View here",n,{fallback:(a,o)=>`${a}: ${o}`})}`)};return await t.status._visit({notStarted:Bt,running:Bt,failed:({message:n,s3PreSignedReadUrl:a})=>{a!=null&&i(a),this.context.failAndThrow(n)},finished:async n=>{if(n.s3PreSignedReadUrlV2!=null){i(n.s3PreSignedReadUrlV2);let a=this.getAbsolutePathToLocalOutput();a!=null&&await pw5({s3PreSignedReadUrl:n.s3PreSignedReadUrlV2,absolutePathToLocalOutput:a,context:this.context})}if(this.absolutePathToPreview==null)for(let a of r)this.context.logger.info(`Published ${a}`);this.#e=!0,this.#t=n.createdSnippets!=null?n.createdSnippets:!1,this.#r=n.snippetsS3PreSignedReadUrl},_other:()=>{this.context.logger.warn("Received unknown update type: "+t.status.type)}}),this.#e?{createdSnippets:this.#t,snippetsS3PreSignedReadUrl:this.#r,actualVersion:this.#i}:void 0}getAbsolutePathToLocalOutput(){return this.absolutePathToPreview!=null?Ct(this.absolutePathToPreview,Xe.of(jKs.default.basename(this.generatorInvocation.name))):this.generatorInvocation.absolutePathToLocalOutput}#e=!1;get isFinished(){return this.#e}#t=!1;get createdSnippets(){return this.#t}#r=void 0;get snippetsS3PreSignedReadUrl(){return this.#r}#i=void 0;get actualVersion(){return this.#i}};async function pw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){try{let i=await yw5(t),n=await bw5(t);i&&n?await vw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):i&&!n?await gw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):await _w5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(It.green(`Downloaded to ${t}`))}catch(i){r.failAndThrow("Failed to download files",i)}}async function _w5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await wB.get(e,{responseType:"stream"}),i=await wKs.default.dir({prefix:"fern",unsafeCleanup:!0}),n=jKs.default.join(i.path,"output.zip");await(0,Lop.pipeline)(r.data,(0,Uop.createWriteStream)(n)),await mi(t)&&await(0,G6i.rm)(t,{recursive:!0}),await(0,G6i.mkdir)(t,{recursive:!0}),await(0,Qop.default)(n,t)}function hw5(e){switch(e){case"DEBUG":return oc.Debug;case"INFO":return oc.Info;case"WARN":return oc.Warn;case"ERROR":return oc.Error;default:return oc.Info}}async function yw5(e){let t=Ct(e,Xe.of(aHt));return await mi(t)}async function bw5(e){let t=Ct(e,Xe.of(".git"));return await mi(t)}async function T3(e,t,r){return(await Nb(r.logger,"git",e,{cwd:t,doNotPipeOutput:!0})).stdout}async function vw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let i=Ct(t,Xe.of(aHt)),n=await Lln({absolutePathToFernignore:i});(await T3(["config","--list"],t,r)).includes("user.name")||(await T3(["config","user.name","fern-api"],t,r),await T3(["config","user.email","info@buildwithfern.com"],t,r)),await T3(["rm","-rf","."],t,r),await shE({s3PreSignedReadUrl:e,outputPath:t}),await T3(["add","."],t,r),await T3(["reset","--",...n],t,r),await T3(["restore","."],t,r)}async function gw5({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let i=Ir.of((await wKs.default.dir({})).path),n=Ct(t,Xe.of(aHt)),a=await Lln({absolutePathToFernignore:n});await(0,G6i.cp)(t,i,{recursive:!0}),await T3(["init"],i,r),await T3(["add","."],i,r),(await T3(["config","--list"],i,r)).includes("user.name")||(await T3(["config","user.name","fern-api"],i,r),await T3(["config","user.email","info@buildwithfern.com"],i,r)),await T3(["commit","--allow-empty","-m",'"init"'],i,r),await T3(["rm","-rf","."],i,r),await shE({s3PreSignedReadUrl:e,outputPath:i}),await T3(["add","."],i,r),await T3(["reset","--",...a],i,r),await T3(["restore","."],i,r),await(0,G6i.rm)(Ct(i,Xe.of(".git")),{recursive:!0}),await(0,G6i.rm)(t,{recursive:!0}),await(0,G6i.cp)(i,t,{recursive:!0})}async function shE({s3PreSignedReadUrl:e,outputPath:t}){let r=await wB.get(e,{responseType:"stream"}),i=await wKs.default.dir({prefix:"fern",unsafeCleanup:!0}),n=jKs.default.join(i.path,"output.zip");await(0,Lop.pipeline)(r.data,(0,Uop.createWriteStream)(n)),await(0,Qop.default)(n,t)}var SKs=require("fs/promises"),chE=ce(Z9(),1),Ow5="proto.zip",EKs=class{sourceTypes;context;sources;constructor(t,r){this.context=t,this.sources=Object.fromEntries(r.map(i=>[i.id,i])),this.sourceTypes=new Set(Object.values(this.sources).map(i=>i.type))}async uploadSources(t){for(let[r,i]of Object.entries(t)){let n=this.getSourceOrThrow(r);await this.uploadSource(n,i.uploadUrl)}return this.convertFdrSourceUploadsToSourceConfig(t)}async uploadSource(t,r){let i=await this.getUploadCommand(t),n=await(0,SKs.readFile)(i.absoluteFilePath),a=await fetch(r,{method:"PUT",body:n,headers:{"Content-Type":"application/octet-stream"}});await i.cleanup(),a.ok||this.context.failAndThrow(`Failed to upload source file: ${t.absoluteFilePath}. Status: ${a.status}, ${a.statusText}`)}async getUploadCommand(t){if(t.type==="protobuf"){let r=await this.zipSource(t.absoluteFilePath);return{absoluteFilePath:r,cleanup:async()=>{this.context.logger.debug(`Removing ${r}`),await(0,SKs.unlink)(r)}}}return{absoluteFilePath:t.absoluteFilePath,cleanup:async()=>{}}}async zipSource(t){let r=await chE.default.dir(),i=Ct(Ir.of(r.path),Xe.of(Ow5));return this.context.logger.debug(`Zipping source ${t} into ${i}`),await Nb(this.context.logger,"zip",["-r",i,"."],{cwd:t,doNotPipeOutput:!0}),i}convertFdrSourceUploadsToSourceConfig(t){let r=[];for(let[i,n]of Object.entries(t))switch(this.getSourceOrThrow(i).type){case"protobuf":r.push(j$.proto({id:i,protoRootUrl:n.downloadUrl}));continue;case"openapi":r.push(j$.openapi());continue;case"asyncapi":continue}return{sources:r}}getSourceOrThrow(t){let r=this.sources[t];return r==null&&this.context.failAndThrow(`Internal error; server responded with source id "${t}" which does not exist in the workspace.`),r}};async function fhE({projectConfig:e,organization:t,workspace:r,interactiveTaskContext:i,generatorInvocation:n,version:a,audiences:o,shouldLogS3Url:c,token:d,whitelabel:s,irVersionOverride:u,absolutePathToPreview:f,readme:p,fernignorePath:_,dynamicIrOnly:h}){let y=qVt({token:d.value}),b=ki.getPackageName({generatorInvocation:n}),v=f!=null,O=H=>MT(H,{onError:G=>i.failAndThrow(G)},{substituteAsEmpty:v}),A=O(n),g=oxn({apiName:r.definition.rootApiFile.contents.name,organization:t,generatorInvocation:A}),m=a??await mw5({fdr:y,packageName:b,generatorInvocation:n}),j=eS({workspace:r,generationLanguage:n.language,keywords:n.keywords,smartCasing:n.smartCasing,exampleGeneration:{disabled:n.disableExamples,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!1},audiences:o,readme:p,packageName:b,version:m,context:i,sourceResolver:new kE(i,r),dynamicGeneratorConfig:g,generationMetadata:{cliVersion:r.cliVersion,generatorName:n.name,generatorVersion:n.version,generatorConfig:n.config}}),w=await O4({token:d.value}).organization.get(Jh.OrganizationId(e.organization));w.ok&&(w.body.isWhitelabled&&(j.readmeConfig==null&&(j.readmeConfig=jw5),j.readmeConfig.whiteLabel=!0),j.selfHosted=w.body.selfHostedSdKs);let D=r.getSources(),B=eH({ir:j,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},context:i}),q=await y.api.v1.register.registerApiDefinition({orgId:li.OrgId(t),apiId:li.ApiId(j.apiName.originalName),definition:B,sources:D.length>0?Pw5(D):void 0}),U,R;q.ok&&(U=q.body.apiDefinitionId,R=q.body.sources);let N=new EKs(i,D);if(R==null&&N.sourceTypes.has("protobuf")&&(q.ok||i.failAndThrow(`Failed to register API definition: ${JSON.stringify(q.error.content)}`),i.failAndThrow("Did not successfully upload Protobuf source files.")),R!=null){i.logger.debug("Uploading source files ...");let H=await N.uploadSources(R);i.logger.debug("Setting IR source configuration ..."),j.sourceConfig=H}if(h){if(i.logger.info("Dynamic IR only mode: skipping SDK generation and uploading dynamic IR only"),a==null){i.failAndThrow("Version is required for dynamic IR only mode");return}if(n.language==null){i.failAndThrow("Language is required for dynamic IR only mode");return}if(b==null){i.failAndThrow("Package name is required for dynamic IR only mode");return}try{await lhE({fdr:y,organization:t,version:a,language:n.language,packageName:b,ir:j,smartCasing:n.smartCasing,dynamicGeneratorConfig:g,context:i})}catch(H){i.failAndThrow(`Failed to upload dynamic IR: ${H instanceof Error?H.message:String(H)}`)}return{createdSnippets:!1,snippetsS3PreSignedReadUrl:void 0,actualVersion:a}}let F=await rhE({projectConfig:e,workspace:r,organization:t,generatorInvocation:A,context:i,version:a,intermediateRepresentation:{...j,fdrApiDefinitionId:U,publishConfig:Aw5({generatorInvocation:A})},shouldLogS3Url:c,token:d,whitelabel:s!=null?O(s):void 0,irVersionOverride:u,absolutePathToPreview:f,fernignorePath:_});i.logger.debug(`Job ID: ${F.jobId}`);let x=F.taskIds[0];if(x==null){i.failAndThrow("Did not receive a task ID.");return}i.logger.debug(`Task ID: ${x}`);let ee=new PKs({job:F,taskId:x,generatorInvocation:n,interactiveTaskContext:i,absolutePathToPreview:f}),me=await nhE({job:F,taskHandler:ee,taskId:x,context:i}),ve=me?.actualVersion??m;if(me!=null&&ve!=null&&n.language!=null&&b!=null&&!v)try{await lhE({fdr:y,organization:t,version:ve,language:n.language,packageName:b,ir:j,smartCasing:n.smartCasing,dynamicGeneratorConfig:g,context:i})}catch(H){i.logger.warn(`Failed to upload dynamic IR for SDK generation: ${H instanceof Error?H.message:String(H)}`)}return me}function Aw5({generatorInvocation:e}){return e.outputMode._visit({downloadFiles:()=>{},github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:t=>t._visit({mavenOverride:()=>{},pypiOverride:()=>{},nugetOverride:()=>{},npmOverride:()=>{},rubyGemsOverride:()=>{},cratesOverride:()=>{},postman:r=>{let i;return e.raw?.output?.location==="postman"&&(i=e.raw.output?.["collection-id"]),gr.PublishingConfig.direct({target:gr.PublishTarget.postman({apiKey:r.apiKey,workspaceId:r.workspaceId,collectionId:i})})},_other:()=>{}}),_other:()=>{}})}async function mw5({fdr:e,packageName:t,generatorInvocation:r}){if(r.language==null)return;let i;switch(r.language){case"csharp":i="Csharp";break;case"go":i="Go";break;case"java":i="Java";break;case"python":i="Python";break;case"ruby":i="Ruby";break;case"typescript":i="TypeScript";break;case"php":i="Php";break;case"swift":i="Swift";break;default:return}if(t==null)return;let n=await e.sdks.versions.computeSemanticVersion({githubRepository:r.outputMode.type==="githubV2"?`${r.outputMode.githubV2.owner}/${r.outputMode.githubV2.repo}`:void 0,language:i,package:t});if(n.ok)return n.body.version}function Pw5(e){return Object.fromEntries(Object.values(e).map(t=>[t.id,{type:t.type==="protobuf"?"proto":t.type}]))}var jw5={defaultEndpoint:void 0,bannerLink:void 0,introduction:void 0,apiReferenceLink:void 0,apiName:void 0,disabledFeatures:void 0,whiteLabel:void 0,customSections:void 0,features:void 0,exampleStyle:void 0};async function lhE({fdr:e,organization:t,version:r,language:i,packageName:n,ir:a,smartCasing:o,dynamicGeneratorConfig:c,context:d}){d.logger.debug(`Uploading dynamic IR for ${i} SDK...`);let s=await e.api.v1.register.getSdkDynamicIrUploadUrls({orgId:li.OrgId(t),version:r,snippetConfiguration:{[i]:n}});if(!s.ok){d.logger.warn(`Failed to get dynamic IR upload URLs: ${s.error.error}`);return}let u=s.body.uploadUrls[i]?.uploadUrl;if(u==null){d.logger.warn(`No upload URL returned for ${i}`);return}let f=uvn({ir:a,disableExamples:!0,smartCasing:o,generationLanguage:i,generatorConfig:c}),p=JSON.stringify(f),_=await fetch(u,{method:"PUT",body:p,headers:{"Content-Type":"application/octet-stream","Content-Length":p.length.toString()}});_.ok?d.logger.debug(`Uploaded dynamic IR for ${i}:${n} (${r})`):d.logger.warn(`Failed to upload dynamic IR for ${i}: ${_.status}`)}async function Vop({projectConfig:e,organization:t,workspace:r,context:i,generatorGroup:n,version:a,shouldLogS3Url:o,token:c,whitelabel:d,absolutePathToPreview:s,mode:u,fernignorePath:f,dynamicIrOnly:p}){if(n.generators.length===0)return i.logger.warn("No generators specified."),null;let _=[],h=[];return _.push(...n.generators.map(b=>i.runInteractiveTask({name:b.name},async v=>{let O=ioa(b),A=await r.toFernWorkspace({context:i},O,b.apiOverride?.specs),g=await fhE({projectConfig:e,organization:t,workspace:A,interactiveTaskContext:v,generatorInvocation:{...b,outputMode:b.outputMode._visit({downloadFiles:()=>b.outputMode,github:m=>MKs.FernFiddle.OutputMode.github({...m,makePr:u==="pull-request"}),githubV2:m=>u==="pull-request"?MKs.FernFiddle.OutputMode.githubV2(MKs.FernFiddle.GithubOutputModeV2.pullRequest(m)):b.outputMode,publish:()=>b.outputMode,publishV2:()=>b.outputMode,_other:()=>b.outputMode})},version:a,audiences:n.audiences,shouldLogS3Url:o,token:c,whitelabel:d,readme:b.readme,irVersionOverride:b.irVersionOverride,absolutePathToPreview:s,fernignorePath:f,dynamicIrOnly:p});g!=null&&g.createdSnippets&&(h.push(b),b.absolutePathToLocalSnippets!=null&&g.snippetsS3PreSignedReadUrl!=null&&await k_E({snippetsS3PreSignedReadUrl:g.snippetsS3PreSignedReadUrl,absolutePathToLocalSnippetJSON:b.absolutePathToLocalSnippets,context:v}))}))),(await Promise.all(_)).some(b=>!b)&&i.failAndThrow(),{snippetsProducedBy:h}}var ayE=require("crypto"),lup=require("fs/promises");var fup=ce(o3a(),1);var XhE=ce(YhE(),1);var ZhE=require("util"),fS5=(0,ZhE.promisify)(XhE.default);async function khE(e,t,r){let i=AFa(e,t),n=[];for(let a of i){let o=await Promise.all(a.map(async c=>{try{let d=await fS5(c);return d==null||d.height==null||d.width==null?void 0:{filePath:c,width:d.width,height:d.height,blurDataUrl:void 0}}catch(d){r.logger.error(`Failed to measure image size for ${c}. ${d?.message}`);return}}));n.push(...o.filter(ds))}return new Map(n.map(a=>[a.filePath,a]))}async function cup(e,t,r){let i=new Array(t.length),n=new Set;for(let a=0;a<t.length;a++){let o=t[a];if(o===void 0)continue;let c=(async()=>{let d=await r(o,a);i[a]=d})().then(()=>{n.delete(c)});n.add(c),n.size>=e&&await Promise.race(n)}return await Promise.all(n),i}var dS5=10,eyE=10,aJs=parseInt(process.env.FERN_DOCS_ASSET_HASH_CONCURRENCY??"32",10);async function tyE(e){let t=await(0,lup.readFile)(e);return(0,ayE.createHash)("sha256").update(new Uint8Array(t)).digest("hex")}async function oyE({token:e,organization:t,docsWorkspace:r,domain:i,customDomains:n,apiWorkspaces:a,ossWorkspaces:o,context:c,preview:d,editThisPage:s,isPrivate:u=!1,disableTemplates:f=!1,skipUpload:p=!1,withAiExamples:_=!0,targetAudiences:h}){let y=qVt({token:e.value}),b=u?{type:"private",authType:"sso"}:{type:"public"},v,O=n[0]??i,A=pS5(i),g=r.config.experimental&&r.config.experimental.dynamicSnippets===!1,m=new i8t({domain:i,docsWorkspace:r,ossWorkspaces:o,apiWorkspaces:a,taskContext:c,editThisPage:s,uploadFiles:async N=>{let F=new Map(N.map(Fe=>[Fe.absoluteFilePath,Fe])),ee=N.map(Fe=>({...Fe,mediaType:fup.lookup(Fe.absoluteFilePath)})).filter(Fe=>Fe.mediaType!==!1).filter(Fe=>zO.parse(Fe.mediaType)?.isImage()??!1).map(Fe=>Fe.absoluteFilePath),me=await khE(ee,dS5,c);c.logger.debug(`Hashing ${me.size} image files with concurrency ${aJs}...`);let ve=performance.now(),H=Array.from(me.values()),Ee=(await cup(aJs,H,async Fe=>{let it=F.get(Fe.filePath);return it==null?null:{filePath:li.docs.v1.write.FilePath(bzo(it.relativeFilePath)),width:Fe.width,height:Fe.height,blurDataUrl:Fe.blurDataUrl,alt:void 0,fileHash:await tyE(it.absoluteFilePath)}})).filter(Fe=>Fe!=null),ue=performance.now()-ve;c.logger.debug(`Hashed ${Ee.length} images in ${ue.toFixed(0)}ms`);let ge=N.filter(({absoluteFilePath:Fe})=>!me.has(Fe));c.logger.debug(`Hashing ${ge.length} non-image files with concurrency ${aJs}...`);let We=performance.now(),se=await cup(aJs,ge,async Fe=>({path:li.docs.v1.write.FilePath(bzo(Fe.relativeFilePath)),fileHash:await tyE(Fe.absoluteFilePath)})),ne=performance.now()-We;if(c.logger.debug(`Hashed ${se.length} non-image files in ${ne.toFixed(0)}ms`),d){let Fe=await y.docs.v2.write.startDocsPreviewRegister({orgId:li.OrgId(t),authConfig:u?{type:"private",authType:"sso"}:{type:"public"},filepaths:se,images:Ee,basePath:A});if(Fe.ok){if(O=Fe.body.previewUrl,v=Fe.body.docsRegistrationId,c.logger.debug(`Received preview registration ID: ${v}`),p)c.logger.debug("Skip-upload mode: skipping file uploads for docs preview");else{let it=new Set(Fe.body.skippedFiles||[]),Br=Object.fromEntries(Object.entries(Fe.body.uploadUrls).filter(([Vt])=>!it.has(Vt))),Wt=Object.keys(Br).length,Qt=it.size;Wt>0?(c.logger.debug(`Uploading ${Wt} files (${Qt} skipped)...`),await ryE(Br,r.absoluteFilePath,c,eyE)):c.logger.debug(`No files to upload (all ${Qt} up to date)`)}return iyE(Fe.body.uploadUrls,r.absoluteFilePath)}else return await nyE(Fe.error,c)}else{let Fe=await y.docs.v2.write.startDocsRegister({domain:i,customDomains:n,authConfig:b,apiId:li.ApiId(""),orgId:li.OrgId(t),filepaths:se,images:Ee});if(Fe.ok){v=Fe.body.docsRegistrationId,c.logger.debug(`Received production registration ID: ${v}`);let it=Fe.body.skippedFiles?.length||0;if(it>0&&c.logger.info(`Skipped ${it} unchanged file${it===1?"":"s"} (already uploaded)`),p)c.logger.debug("Skip-upload mode: skipping file uploads for docs");else{let Br=new Set(Fe.body.skippedFiles||[]),Wt=Object.fromEntries(Object.entries(Fe.body.uploadUrls).filter(([Vt])=>!Br.has(Vt))),Qt=Object.keys(Wt).length;Qt>0?(c.logger.info(`\u2191 Uploading ${Qt} files...`),await ryE(Wt,r.absoluteFilePath,c,eyE)):c.logger.info("No files to upload (all up to date)")}return iyE(Fe.body.uploadUrls,r.absoluteFilePath)}else return nyE(Fe.error,c)}},registerApi:async({ir:N,snippetsConfig:F,playgroundConfig:x,apiName:ee,workspace:me})=>{let ve=eH({ir:N,snippetsConfig:F,playgroundConfig:x,context:c}),H=OS5(_,r.config.experimental?.aiExampleStyleInstructions);if(H&&me){let se=me.getSources().find(ne=>ne.type==="openapi")?.absoluteFilePath;ve=await gua(ve,H,c,e,t,se)}let G,Ee=new Set;if(!g){let ge=await _S5({fdr:y,workspace:me,organization:t,context:c,snippetsConfig:F});ge&&Object.keys(ge).length>0&&(G=ge,Ee=new Set(Object.keys(ge)),c.logger.debug(`Using existing SDK dynamic IRs for: ${Object.keys(ge).join(", ")}`));let We=await bS5({workspace:me,organization:t,context:c,snippetsConfig:F,skipLanguages:Ee});We&&(G={...G,...We})}let ue=await y.api.v1.register.registerApiDefinition({orgId:li.OrgId(t),apiId:li.ApiId(N.apiName.originalName),definition:ve,definitionV2:void 0,dynamicIRs:G});if(ue.ok)return c.logger.debug(`Registered API Definition ${ee}: ${ue.body.apiDefinitionId}`),ue.body.dynamicIRs&&G&&(p?c.logger.debug("Skip-upload mode: skipping dynamic IR uploads"):await vS5({dynamicIRs:G,dynamicIRUploadUrls:ue.body.dynamicIRs,context:c,apiId:ue.body.apiDefinitionId})),ue.body.apiDefinitionId;switch(ue.error.error){case"UnauthorizedError":case"UserNotInOrgError":return c.failAndThrow("You do not have permissions to register the docs. Reach out to support@buildwithfern.com");default:{let ge=AS5(ue.error);return c.logger.error(`FDR registerApiDefinition failed. Error details:
2016
2016
  ${JSON.stringify(ge,void 0,2)}`),ee!=null?c.failAndThrow(`Failed to publish docs because API definition (${ee}) could not be uploaded. Please contact support@buildwithfern.com`,ge):c.failAndThrow("Failed to publish docs because API definition could not be uploaded. Please contact support@buildwithfern.com",ge)}}},targetAudiences:h});c.logger.info("Resolving docs definition...");let j=performance.now(),S=await m.resolve(),w=performance.now()-j;if(r.config.settings?.substituteEnvVars){c.logger.debug("Applying environment variable substitution to docs definition...");let{jsFiles:N,...F}=S;S={...MT(F,{onError:ee=>c.failAndThrow(ee)},{substituteAsEmpty:!1}),jsFiles:N}}let D=Object.keys(S.pages).length,B=a.length,q=process.memoryUsage();if(c.logger.info(`Resolved docs definition in ${w.toFixed(0)}ms: ${D} pages${B?`, ${B} API workspaces`:""}`),c.logger.debug(`Memory after resolve: RSS=${(q.rss/1024/1024).toFixed(2)}MB, Heap=${(q.heapUsed/1024/1024).toFixed(2)}MB`),v==null)return c.failAndThrow("Failed to publish docs.","Docs registration ID is missing.");c.logger.info("Publishing docs to FDR...");let U=performance.now(),R=await y.docs.v2.write.finishDocsRegister(iG.DocsRegistrationId(v),{docsDefinition:S,excludeApis:!1});if(R.ok){let N=performance.now()-U;c.logger.debug(`Docs published to FDR in ${N.toFixed(0)}ms`);let F=tH(O);await gS5({docsDefinition:S,isPreview:d,context:c});let x=W6i(F,F);c.logger.info(It.green(`Published docs to ${x}`))}else switch(R.error.error){case"UnauthorizedError":case"UserNotInOrgError":return c.failAndThrow("Insufficient permissions. Failed to publish docs to "+i);case"DocsRegistrationIdNotFound":return c.failAndThrow("Failed to publish docs to "+i,`Docs registration ID ${v} does not exist.`);default:return c.failAndThrow("Failed to publish docs to "+i,R.error)}}async function ryE(e,t,r,i){let n=Date.now(),a=Object.keys(e).length;r.logger.debug(`Start uploading ${a} files...`);let o=AFa(Object.entries(e),i),c=0;for(let s of o){await Promise.all(s.map(async([f,{uploadUrl:p}])=>{let _=Xe.of(f),h=Uu(t,_);try{let y=fup.lookup(h);await wB.put(p,await(0,lup.readFile)(h),{headers:{"Content-Type":y===!1?"application/octet-stream":y,"Cache-Control":"public, max-age=31536000, immutable"}})}catch(y){r.failAndThrow(`Failed to upload ${h}`,y)}}));let u=Date.now();c+=s.length,r.logger.debug(`Uploaded ${c}/${a} files in ${u-n}ms`)}let d=Date.now();r.logger.debug(`Finished uploading ${a} files in ${d-n}ms`)}function iyE(e,t){let r=[];for(let[i,n]of Object.entries(e)){let a=Xe.of(i),o=Uu(t,a);r.push({relativeFilePath:a,absoluteFilePath:o,fileId:n.fileId})}return r}async function nyE(e,t){switch(await t.instrumentPostHogEvent({command:"docs-generation",properties:{error:JSON.stringify(e)}}),e.error){case"InvalidCustomDomainError":return t.failAndThrow("Your docs domain should end with docs.buildwithfern.com");case"InvalidDomainError":return t.failAndThrow("Please make sure that none of your custom domains are not overlapping (i.e. one is a substring of another)");case"UnauthorizedError":return t.failAndThrow("Please make sure that your FERN_TOKEN is set.");case"UserNotInOrgError":return t.failAndThrow("Please verify if you have access to the organization you are trying to publish the docs to. If you are not a member of the organization, please reach out to the organization owner.");case"UnavailableError":return t.failAndThrow("Failed to publish docs. Please try again later or reach out to Fern support at support@buildwithfern.com.");default:return t.failAndThrow("Failed to publish docs.",e)}}function pS5(e){try{return new URL(tH(e)).pathname}catch{return}}async function _S5({fdr:e,workspace:t,organization:r,context:i,snippetsConfig:n}){if(!t)return;let a=await hS5({fdr:e,workspace:t,snippetsConfig:n,context:i});if(Object.keys(a).length===0){i.logger.debug("[SDK Dynamic IR] No snippet configs found, skipping S3 check");return}try{let o=await e.api.v1.register.checkSdkDynamicIrExists({orgId:li.OrgId(r),snippetConfiguration:a});if(!o.ok||!o.body){i.logger.debug("[SDK Dynamic IR] API call failed or returned empty body");return}let c=o.body.existingDynamicIrs;if(Object.keys(c).length===0){i.logger.debug("[SDK Dynamic IR] No existing SDK dynamic IRs found in S3");return}let d={};for(let[s,u]of Object.entries(c))try{i.logger.debug(`Downloading existing SDK dynamic IR for ${s}...`);let f=await fetch(u.downloadUrl);if(f.ok){let p=await f.json();d[s]={dynamicIR:p},i.logger.debug(`Successfully downloaded SDK dynamic IR for ${s}`)}else i.logger.warn(`Failed to download SDK dynamic IR for ${s}: ${f.status}`)}catch(f){i.logger.warn(`Error downloading SDK dynamic IR for ${s}: ${f}`)}return Object.keys(d).length>0?d:void 0}catch(o){i.logger.debug(`Error checking for existing SDK dynamic IRs: ${o}`);return}}async function hS5({fdr:e,workspace:t,snippetsConfig:r,context:i}){let n={},a=[{language:"typescript",snippetName:r.typescriptSdk?.package,explicitVersion:r.typescriptSdk?.version},{language:"python",snippetName:r.pythonSdk?.package,explicitVersion:r.pythonSdk?.version},{language:"java",snippetName:r.javaSdk?.coordinate,explicitVersion:r.javaSdk?.version},{language:"go",snippetName:r.goSdk?.githubRepo,explicitVersion:r.goSdk?.version},{language:"csharp",snippetName:r.csharpSdk?.package,explicitVersion:r.csharpSdk?.version},{language:"ruby",snippetName:r.rubySdk?.gem,explicitVersion:r.rubySdk?.version},{language:"php",snippetName:r.phpSdk?.package,explicitVersion:r.phpSdk?.version},{language:"swift",snippetName:r.swiftSdk?.package,explicitVersion:r.swiftSdk?.version},{language:"rust",snippetName:r.rustSdk?.package,explicitVersion:r.rustSdk?.version}];for(let o of a){if(!o.snippetName)continue;let c=o.explicitVersion;c||(c=(await yS5({fdr:e,workspace:t,language:o.language,snippetName:o.snippetName,context:i}))?.version),n[o.language]={packageName:o.snippetName,version:c},c||i.logger.debug(`[SDK Dynamic IR] ${o.language}: no version specified, will use latest`)}return n}async function yS5({fdr:e,workspace:t,language:r,snippetName:i,context:n}){let a;switch(r){case"csharp":a="Csharp";break;case"go":a="Go";break;case"java":a="Java";break;case"python":a="Python";break;case"ruby":a="Ruby";break;case"typescript":a="TypeScript";break;case"php":a="Php";break;case"swift":a="Swift";break;default:return}let o,c,d;if(t.generatorsConfiguration?.groups){let s=[];for(let u of t.generatorsConfiguration.groups)for(let f of u.generators)if(f.language===r){let p=ki.getPackageName({generatorInvocation:f});p&&s.push(p),!c&&p&&(c=p,d=f.name,f.outputMode.type==="githubV2"&&(o=`${f.outputMode.githubV2.owner}/${f.outputMode.githubV2.repo}`))}}if(!c){n.logger.debug(`[SDK Dynamic IR] ${r}: no generator found with a package name`);return}try{let s=await e.sdks.versions.computeSemanticVersion({githubRepository:o,language:a,package:c});if(!s.ok){n.logger.debug(`[SDK Dynamic IR] ${r}: version computation failed for package "${c}"`);return}return n.logger.debug(`[SDK Dynamic IR] ${r}: computed version ${s.body.version} for package "${c}"`),{version:s.body.version,generatorPackage:c}}catch(s){n.logger.debug(`[SDK Dynamic IR] ${r}: error computing version: ${s}`);return}}async function bS5({workspace:e,organization:t,context:r,snippetsConfig:i,skipLanguages:n=new Set}){let a={};if(!e)return;Object.keys(i).length===0&&(r.logger.warn(`WARNING: No snippets defined for ${e.workspaceName}.`),r.logger.warn("Did you add snippets to your docs configuration?"),r.logger.warn("For more info: https://buildwithfern.com/learn/docs/api-references/sdk-snippets"));let o={typescript:i.typescriptSdk?.package,python:i.pythonSdk?.package,java:i.javaSdk?.coordinate,go:i.goSdk?.githubRepo,csharp:i.csharpSdk?.package,ruby:i.rubySdk?.gem,php:i.phpSdk?.package,swift:i.swiftSdk?.package,rust:i.rustSdk?.package};if(e.generatorsConfiguration?.groups)for(let c of e.generatorsConfiguration.groups)for(let d of c.generators){let s=oxn({apiName:e.workspaceName??"",organization:t,generatorInvocation:d}),u="";if(s?.outputConfig.type==="publish")switch(s.outputConfig.value.type){case"npm":case"nuget":case"pypi":case"rubygems":u=s.outputConfig.value.packageName;break;case"maven":u=s.outputConfig.value.coordinate;break;case"go":u=s.outputConfig.value.repoUrl;break;case"swift":u=s.outputConfig.value.repoUrl;break;case"crates":u=s.outputConfig.value.packageName;break}if(d.language==="php"&&d.config&&typeof d.config=="object"&&"packageName"in d.config&&(u=d.config.packageName??""),!!d.language){if(n.has(d.language)){r.logger.debug(`Skipping dynamic IR generation for ${d.language} (using existing SDK dynamic IR)`);continue}if(d.language&&o[d.language]===u){let f=eS({workspace:e,generationLanguage:d.language,keywords:void 0,smartCasing:d.smartCasing,exampleGeneration:{disabled:!0,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!0},audiences:{type:"all"},readme:void 0,packageName:u,version:void 0,context:r,sourceResolver:new kE(r,e),dynamicGeneratorConfig:s}),p=uvn({ir:f,disableExamples:!0,smartCasing:d.smartCasing,generationLanguage:d.language,generatorConfig:s});p?a[d.language]={dynamicIR:p}:r.logger.debug(`Failed to create dynamic IR for ${d.language}`)}}}for(let[c,d]of Object.entries(o))c&&d&&!Object.keys(a).includes(c)&&!n.has(c)&&(r.logger.warn(),r.logger.warn(`Failed to upload ${c} SDK snippets because of unknown package \`${d}\`.`),r.logger.warn(`Please make sure your ${e.workspaceName?`${e.workspaceName}/`:""}generators.yml has a generator that publishes a ${d} package.`),r.logger.warn());if(Object.keys(a).length>0)return a}async function vS5({dynamicIRs:e,dynamicIRUploadUrls:t,context:r,apiId:i}){if(Object.keys(t).length>0)for(let[n,a]of Object.entries(t)){let o=e[n]?.dynamicIR;if(o){let c=JSON.stringify(o);(await fetch(a.uploadUrl,{method:"PUT",body:c,headers:{"Content-Type":"application/octet-stream","Content-Length":Buffer.byteLength(c,"utf8").toString()}})).ok?r.logger.debug(`Uploaded dynamic IR for ${i}:${n}`):r.logger.warn(`Failed to upload dynamic IR for ${i}:${n}`)}else r.logger.warn(`Could not find matching dynamic IR to upload for ${i}:${n}`)}}async function gS5({docsDefinition:e,isPreview:t,context:r}){e.config.aiChatConfig==null||t||r.logger.warn(It.yellow("Enabling Ask Fern from docs.yml is deprecated. Please enable it from the Fern dashboard instead."))}function OS5(e,t){if(e)return{enabled:!0,model:process.env.FERN_AI_MODEL||"gpt-4o-mini",maxRetries:parseInt(process.env.FERN_AI_MAX_RETRIES||"3"),requestTimeoutMs:parseInt(process.env.FERN_AI_TIMEOUT_MS||"25000"),styleInstructions:t}}function AS5(e){let t=e,r=t?.content;return{errorType:t?.error,statusCode:t?.statusCode??r?.statusCode,reason:r?.reason,errorMessage:r?.errorMessage??r?.message,body:r?.body,cause:r?.cause,rawError:e}}async function dup({organization:e,apiWorkspaces:t,ossWorkspaces:r,docsWorkspace:i,context:n,token:a,instanceUrl:o,preview:c,disableTemplates:d,skipUpload:s}){let u=c&&!i.config.settings?.substituteEnvVars;i.config=MT(i.config,{onError:h=>n.failAndThrow(h)},{substituteAsEmpty:u});let f=i.config.instances;if(f.length===0){n.failAndThrow("No instances specified in docs.yml! Cannot register docs.");return}if(f.length>1&&o==null){n.failAndThrow(`More than one docs instances. Please specify one (e.g. --instance ${f[0]?.url})`);return}let p=f.find(h=>h.url===o)??f[0];if(p==null){n.failAndThrow(`No docs instance with url ${o}. Failed to register.`);return}let _=[];p.customDomain!=null&&(typeof p.customDomain=="string"?_.push(p.customDomain):Array.isArray(p.customDomain)&&_.push(...p.customDomain)),n.logger.info(`Starting docs publishing for ${c?"preview":"production"}: ${p.url}`),n.logger.debug(`Organization: ${e}, Preview: ${c}, APIs: ${t.length}, OSS: ${r.length}`),await n.runInteractiveTask({name:p.url},async()=>{let h=performance.now();await oyE({docsWorkspace:i,customDomains:_,domain:p.url,token:a,organization:e,context:n,apiWorkspaces:t,ossWorkspaces:r,preview:c,editThisPage:p.editThisPage,isPrivate:p.private,disableTemplates:d,skipUpload:s,withAiExamples:i.config.experimental?.aiExamples??!0,targetAudiences:p.audiences?Array.isArray(p.audiences)?p.audiences:[p.audiences]:void 0});let y=performance.now()-h;n.logger.debug(`Docs publishing completed in ${y.toFixed(0)}ms`)})}function wcn(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}var VyE=ce(OyE());var AyE="9.0.6";var SS5=`octokit-endpoint.js/${AyE} ${wcn()}`,myE={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":SS5},mediaType:{format:""}};function PyE(e){return e?Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}):{}}function jyE(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}function pup(e,t){let r=Object.assign({},e);return Object.keys(t).forEach(i=>{jyE(t[i])?i in e?r[i]=pup(e[i],t[i]):Object.assign(r,{[i]:t[i]}):Object.assign(r,{[i]:t[i]})}),r}function _up(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function WDo(e,t,r){if(typeof t=="string"){let[n,a]=t.split(" ");r=Object.assign(a?{method:n,url:a}:{url:n},r)}else r=Object.assign({},t);r.headers=PyE(r.headers),_up(r),_up(r.headers);let i=pup(e||{},r);return r.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(i.mediaType.previews=e.mediaType.previews.filter(n=>!i.mediaType.previews.includes(n)).concat(i.mediaType.previews)),i.mediaType.previews=(i.mediaType.previews||[]).map(n=>n.replace(/-preview/,""))),i}function wyE(e,t){let r=/\?/.test(e)?"&":"?",i=Object.keys(t);return i.length===0?e:e+r+i.map(n=>n==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${n}=${encodeURIComponent(t[n])}`).join("&")}var MS5=/\{[^{}}]+\}/g;function DS5(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function EyE(e){let t=e.match(MS5);return t?t.map(DS5).reduce((r,i)=>r.concat(i),[]):[]}function hup(e,t){let r={__proto__:null};for(let i of Object.keys(e))t.indexOf(i)===-1&&(r[i]=e[i]);return r}function SyE(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function Uza(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function GDo(e,t,r){return t=e==="+"||e==="#"?SyE(t):Uza(t),r?Uza(r)+"="+t:t}function Qza(e){return e!=null}function yup(e){return e===";"||e==="&"||e==="?"}function BS5(e,t,r,i){var n=e[r],a=[];if(Qza(n)&&n!=="")if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")n=n.toString(),i&&i!=="*"&&(n=n.substring(0,parseInt(i,10))),a.push(GDo(t,n,yup(t)?r:""));else if(i==="*")Array.isArray(n)?n.filter(Qza).forEach(function(o){a.push(GDo(t,o,yup(t)?r:""))}):Object.keys(n).forEach(function(o){Qza(n[o])&&a.push(GDo(t,n[o],o))});else{let o=[];Array.isArray(n)?n.filter(Qza).forEach(function(c){o.push(GDo(t,c))}):Object.keys(n).forEach(function(c){Qza(n[c])&&(o.push(Uza(c)),o.push(GDo(t,n[c].toString())))}),yup(t)?a.push(Uza(r)+"="+o.join(",")):o.length!==0&&a.push(o.join(","))}else t===";"?Qza(n)&&a.push(Uza(r)):n===""&&(t==="&"||t==="?")?a.push(Uza(r)+"="):n===""&&a.push("");return a}function MyE(e){return{expand:IS5.bind(null,e)}}function IS5(e,t){var r=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,n,a){if(n){let c="",d=[];if(r.indexOf(n.charAt(0))!==-1&&(c=n.charAt(0),n=n.substr(1)),n.split(/,/g).forEach(function(s){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);d.push(BS5(t,c,u[1],u[2]||u[3]))}),c&&c!=="+"){var o=",";return c==="?"?o="&":c!=="#"&&(o=c),(d.length!==0?c:"")+d.join(o)}else return d.join(",")}else return SyE(a)}),e==="/"?e:e.replace(/\/$/,"")}function oJs(e){let t=e.method.toUpperCase(),r=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},e.headers),n,a=hup(e,["method","baseUrl","url","headers","request","mediaType"]),o=EyE(r);r=MyE(r).expand(a),/^http/.test(r)||(r=e.baseUrl+r);let c=Object.keys(e).filter(u=>o.includes(u)).concat("baseUrl"),d=hup(a,c);if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=i.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];i.accept=u.concat(e.mediaType.previews).map(f=>{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${f}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?r=wyE(r,d):"data"in d?n=d.data:Object.keys(d).length&&(n=d),!i["content-type"]&&typeof n<"u"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof n>"u"&&(n=""),Object.assign({method:t,url:r,headers:i},typeof n<"u"?{body:n}:null,e.request?{request:e.request}:null)}function DyE(e,t,r){return oJs(WDo(e,t,r))}function bup(e,t){let r=WDo(e,t),i=DyE.bind(null,r);return Object.assign(i,{DEFAULTS:r,defaults:bup.bind(null,r),merge:WDo.bind(null,r),parse:oJs})}var ByE=bup(null,myE);var IyE="8.4.1";function CyE(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}var HDo=class extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}};var vup=ce(t$c()),CS5=(0,vup.default)(e=>console.warn(e)),qS5=(0,vup.default)(e=>console.warn(e)),Ecn=class extends Error{constructor(t,r,i){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=r;let n;"headers"in i&&typeof i.headers<"u"&&(n=i.headers),"response"in i&&(this.response=i.response,n=i.response.headers);let a=Object.assign({},i.request);i.request.headers.authorization&&(a.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),a.url=a.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=a,Object.defineProperty(this,"code",{get(){return CS5(new HDo("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),r}}),Object.defineProperty(this,"headers",{get(){return qS5(new HDo("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")),n||{}}})}};function qyE(e){return e.arrayBuffer()}function Oup(e){let t=e.request&&e.request.log?e.request.log:console,r=e.request?.parseSuccessResponseBody!==!1;(CyE(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let i={},n,a,{fetch:o}=globalThis;if(e.request?.fetch&&(o=e.request.fetch),!o)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");return o(e.url,{method:e.method,body:e.body,redirect:e.request?.redirect,headers:e.headers,signal:e.request?.signal,...e.body&&{duplex:"half"}}).then(async c=>{a=c.url,n=c.status;for(let d of c.headers)i[d[0]]=d[1];if("deprecation"in i){let d=i.link&&i.link.match(/<([^<>]+)>; rel="deprecation"/),s=d&&d.pop();t.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${i.sunset}${s?`. See ${s}`:""}`)}if(!(n===204||n===205)){if(e.method==="HEAD"){if(n<400)return;throw new Ecn(c.statusText,n,{response:{url:a,status:n,headers:i,data:void 0},request:e})}if(n===304)throw new Ecn("Not modified",n,{response:{url:a,status:n,headers:i,data:await gup(c)},request:e});if(n>=400){let d=await gup(c);throw new Ecn(TS5(d),n,{response:{url:a,status:n,headers:i,data:d},request:e})}return r?await gup(c):c.body}}).then(c=>({status:n,url:a,headers:i,data:c})).catch(c=>{if(c instanceof Ecn)throw c;if(c.name==="AbortError")throw c;let d=c.message;throw c.name==="TypeError"&&"cause"in c&&(c.cause instanceof Error?d=c.cause.message:typeof c.cause=="string"&&(d=c.cause)),new Ecn(d,500,{request:e})})}async function gup(e){let t=e.headers.get("content-type");return/application\/json/.test(t)?e.json().catch(()=>e.text()).catch(()=>""):!t||/^text\/|charset=utf-8$/.test(t)?e.text():qyE(e)}function TS5(e){if(typeof e=="string")return e;let t;return"documentation_url"in e?t=` - ${e.documentation_url}`:t="","message"in e?Array.isArray(e.errors)?`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}${t}`:`${e.message}${t}`:`Unknown error: ${JSON.stringify(e)}`}function uJs(e,t){let r=e.defaults(t);return Object.assign(function(n,a){let o=r.merge(n,a);if(!o.request||!o.request.hook)return Oup(r.parse(o));let c=(d,s)=>Oup(r.parse(r.merge(d,s)));return Object.assign(c,{endpoint:r,defaults:uJs.bind(null,r)}),o.request.hook(c,o)},{endpoint:r,defaults:uJs.bind(null,r)})}var xDo=uJs(ByE,{headers:{"user-agent":`octokit-request.js/${IyE} ${wcn()}`}});var RS5="7.1.1";function zS5(e){return`Request failed due to following response errors:
2017
2017
  `+e.errors.map(t=>` - ${t.message}`).join(`
2018
2018
  `)}var NS5=class extends Error{constructor(e,t,r){super(zS5(r)),this.request=e,this.headers=t,this.response=r,this.name="GraphqlResponseError",this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},FS5=["method","baseUrl","url","headers","request","query","mediaType"],QS5=["query","method","url"],TyE=/\/api\/v3\/?$/;function US5(e,t,r){if(r){if(typeof t=="string"&&"query"in r)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let o in r)if(QS5.includes(o))return Promise.reject(new Error(`[@octokit/graphql] "${o}" cannot be used as variable name`))}let i=typeof t=="string"?Object.assign({query:t},r):t,n=Object.keys(i).reduce((o,c)=>FS5.includes(c)?(o[c]=i[c],o):(o.variables||(o.variables={}),o.variables[c]=i[c],o),{}),a=i.baseUrl||e.endpoint.DEFAULTS.baseUrl;return TyE.test(a)&&(n.url=a.replace(TyE,"/api/graphql")),e(n).then(o=>{if(o.data.errors){let c={};for(let d of Object.keys(o.headers))c[d]=o.headers[d];throw new NS5(n,c,o.data)}return o.data.data})}function Aup(e,t){let r=e.defaults(t);return Object.assign((n,a)=>US5(r,n,a),{defaults:Aup.bind(null,r),endpoint:r.endpoint})}var y3Z=Aup(xDo,{headers:{"user-agent":`octokit-graphql.js/${RS5} ${wcn()}`},method:"POST",url:"/graphql"});function RyE(e){return Aup(e,{method:"POST",url:"/graphql"})}var LS5=/^v1\./,VS5=/^ghs_/,WS5=/^ghu_/;async function zyE(e){let t=e.split(/\./).length===3,r=LS5.test(e)||VS5.test(e),i=WS5.test(e);return{type:"token",token:e,tokenType:t?"app":r?"installation":i?"user-to-server":"oauth"}}function NyE(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function FyE(e,t,r,i){let n=t.endpoint.merge(r,i);return n.headers.authorization=NyE(e),t(n)}var QyE=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(zyE.bind(null,t),{hook:FyE.bind(null,t)})};var WyE="5.2.2",UyE=()=>{},GS5=console.warn.bind(console),HS5=console.error.bind(console);function xS5(e={}){return typeof e.debug!="function"&&(e.debug=UyE),typeof e.info!="function"&&(e.info=UyE),typeof e.warn!="function"&&(e.warn=GS5),typeof e.error!="function"&&(e.error=HS5),e}var LyE=`octokit-core.js/${WyE} ${wcn()}`,GyE=class{static{this.VERSION=WyE}static defaults(e){return class extends this{constructor(...r){let i=r[0]||{};if(typeof e=="function"){super(e(i));return}super(Object.assign({},e,i,i.userAgent&&e.userAgent?{userAgent:`${i.userAgent} ${e.userAgent}`}:null))}}}static{this.plugins=[]}static plugin(...e){let t=this.plugins;return class extends this{static{this.plugins=t.concat(e.filter(i=>!t.includes(i)))}}}constructor(e={}){let t=new VyE.Collection,r={baseUrl:xDo.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=e.userAgent?`${e.userAgent} ${LyE}`:LyE,e.baseUrl&&(r.baseUrl=e.baseUrl),e.previews&&(r.mediaType.previews=e.previews),e.timeZone&&(r.headers["time-zone"]=e.timeZone),this.request=xDo.defaults(r),this.graphql=RyE(this.request).defaults(r),this.log=xS5(e.log),this.hook=t,e.authStrategy){let{authStrategy:n,...a}=e,o=n(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:a},e.auth));t.wrap("request",o.hook),this.auth=o}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let n=QyE(e.auth);t.wrap("request",n.hook),this.auth=n}let i=this.constructor;for(let n=0;n<i.plugins.length;++n)Object.assign(this,i.plugins[n](this,e))}};var HyE="4.0.1";function mup(e){e.hook.wrap("request",(t,r)=>{e.log.debug("request",r);let i=Date.now(),n=e.request.endpoint.parse(r),a=n.url.replace(r.baseUrl,"");return t(r).then(o=>(e.log.info(`${n.method} ${a} - ${o.status} in ${Date.now()-i}ms`),o)).catch(o=>{throw e.log.info(`${n.method} ${a} - ${o.status} in ${Date.now()-i}ms`),o})})}mup.VERSION=HyE;var KS5="11.4.4-cjs.2";function JS5(e){if(!e.data)return{...e,data:[]};if(!("total_count"in e.data&&!("url"in e.data)))return e;let r=e.data.incomplete_results,i=e.data.repository_selection,n=e.data.total_count;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count;let a=Object.keys(e.data)[0],o=e.data[a];return e.data=o,typeof r<"u"&&(e.data.incomplete_results=r),typeof i<"u"&&(e.data.repository_selection=i),e.data.total_count=n,e}function Pup(e,t,r){let i=typeof t=="function"?t.endpoint(r):e.request.endpoint(t,r),n=typeof t=="function"?t:e.request,a=i.method,o=i.headers,c=i.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!c)return{done:!0};try{let d=await n({method:a,url:c,headers:o}),s=JS5(d);return c=((s.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],{value:s}}catch(d){if(d.status!==409)throw d;return c="",{value:{status:200,headers:{},data:[]}}}}})}}function xyE(e,t,r,i){return typeof r=="function"&&(i=r,r=void 0),KyE(e,[],Pup(e,t,r)[Symbol.asyncIterator](),i)}function KyE(e,t,r,i){return r.next().then(n=>{if(n.done)return t;let a=!1;function o(){a=!0}return t=t.concat(i?i(n.value,o):n.value.data),a?t:KyE(e,t,r,i)})}var F3Z=Object.assign(xyE,{iterator:Pup});function jup(e){return{paginate:Object.assign(xyE.bind(null,e),{iterator:Pup.bind(null,e)})}}jup.VERSION=KS5;var wup="13.3.2-cjs.1";var $S5={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"],usageMetricsForOrg:["GET /orgs/{org}/copilot/usage"],usageMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/usage"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createInvitation:["POST /orgs/{org}/invitations"],createOrUpdateCustomProperties:["PATCH /orgs/{org}/properties/schema"],createOrUpdateCustomPropertiesValuesForRepos:["PATCH /orgs/{org}/properties/values"],createOrUpdateCustomProperty:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],createWebhook:["POST /orgs/{org}/hooks"],delete:["DELETE /orgs/{org}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],enableOrDisableSecurityProductOnAllOrgRepos:["POST /orgs/{org}/{security_product}/{enablement}",{},{deprecated:"octokit.rest.orgs.enableOrDisableSecurityProductOnAllOrgRepos() is deprecated, see https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization"}],get:["GET /orgs/{org}"],getAllCustomProperties:["GET /orgs/{org}/properties/schema"],getCustomProperty:["GET /orgs/{org}/properties/schema/{custom_property_name}"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listCustomPropertiesValuesForRepos:["GET /orgs/{org}/properties/values"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeCustomProperty:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addCollaborator:["PUT /projects/{project_id}/collaborators/{username}"],createCard:["POST /projects/columns/{column_id}/cards"],createColumn:["POST /projects/{project_id}/columns"],createForAuthenticatedUser:["POST /user/projects"],createForOrg:["POST /orgs/{org}/projects"],createForRepo:["POST /repos/{owner}/{repo}/projects"],delete:["DELETE /projects/{project_id}"],deleteCard:["DELETE /projects/columns/cards/{card_id}"],deleteColumn:["DELETE /projects/columns/{column_id}"],get:["GET /projects/{project_id}"],getCard:["GET /projects/columns/cards/{card_id}"],getColumn:["GET /projects/columns/{column_id}"],getPermissionForUser:["GET /projects/{project_id}/collaborators/{username}/permission"],listCards:["GET /projects/columns/{column_id}/cards"],listCollaborators:["GET /projects/{project_id}/collaborators"],listColumns:["GET /projects/{project_id}/columns"],listForOrg:["GET /orgs/{org}/projects"],listForRepo:["GET /repos/{owner}/{repo}/projects"],listForUser:["GET /users/{username}/projects"],moveCard:["POST /projects/columns/cards/{card_id}/moves"],moveColumn:["POST /projects/columns/{column_id}/moves"],removeCollaborator:["DELETE /projects/{project_id}/collaborators/{username}"],update:["PATCH /projects/{project_id}"],updateCard:["PATCH /projects/columns/cards/{card_id}"],updateColumn:["PATCH /projects/columns/{column_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateCustomPropertiesValues:["PATCH /repos/{owner}/{repo}/properties/values"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getCustomPropertiesValues:["GET /repos/{owner}/{repo}/properties/values"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/secret-scanning/alerts"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateProjectPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForProjectInOrg:["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listProjectsInOrg:["GET /orgs/{org}/teams/{team_slug}/projects"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeProjectInOrg:["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},JyE=$S5;var sxn=new Map;for(let[e,t]of Object.entries(JyE))for(let[r,i]of Object.entries(t)){let[n,a,o]=i,[c,d]=n.split(/ /),s=Object.assign({method:c,url:d},a);sxn.has(e)||sxn.set(e,new Map),sxn.get(e).set(r,{scope:e,methodName:r,endpointDefaults:s,decorations:o})}var YS5={has({scope:e},t){return sxn.get(e).has(t)},getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty(e,t,r){return Object.defineProperty(e.cache,t,r),!0},deleteProperty(e,t){return delete e.cache[t],!0},ownKeys({scope:e}){return[...sxn.get(e).keys()]},set(e,t,r){return e.cache[t]=r},get({octokit:e,scope:t,cache:r},i){if(r[i])return r[i];let n=sxn.get(t).get(i);if(!n)return;let{endpointDefaults:a,decorations:o}=n;return o?r[i]=XS5(e,t,i,a,o):r[i]=e.request.defaults(a),r[i]}};function Eup(e){let t={};for(let r of sxn.keys())t[r]=new Proxy({octokit:e,scope:r,cache:{}},YS5);return t}function XS5(e,t,r,i,n){let a=e.request.defaults(i);function o(...c){let d=a.endpoint.merge(...c);if(n.mapToData)return d=Object.assign({},d,{data:d[n.mapToData],[n.mapToData]:void 0}),a(d);if(n.renamed){let[s,u]=n.renamed;e.log.warn(`octokit.${t}.${r}() has been renamed to octokit.${s}.${u}()`)}if(n.deprecated&&e.log.warn(n.deprecated),n.renamedParameters){let s=a.endpoint.merge(...c);for(let[u,f]of Object.entries(n.renamedParameters))u in s&&(e.log.warn(`"${u}" parameter is deprecated for "octokit.${t}.${r}()". Use "${f}" instead`),f in s||(s[f]=s[u]),delete s[u]);return a(s)}return a(...c)}return Object.assign(o,a)}function ZS5(e){return{rest:Eup(e)}}ZS5.VERSION=wup;function Sup(e){let t=Eup(e);return{...t,rest:t}}Sup.VERSION=wup;var kS5="20.1.2",$yE=GyE.plugin(mup,Sup,jup).defaults({userAgent:`octokit-rest.js/${kS5}`});var uRi=ce(require("fs/promises"),1),Mup=ce(require("os"),1),XyE=ce(require("path"),1),Dup=ce(Z9(),1);async function ZyE({token:e,projectConfig:t,workspace:r,generatorGroup:i,version:n,keepDocker:a,inspect:o,context:c,absolutePathToPreview:d,runner:s,ai:u}){(await Promise.all(i.generators.map(async p=>c.runInteractiveTask({name:p.name},async _=>{p=(R=>MT(R,{onError:N=>_.failAndThrow(N)}))(p);let y=await r.toFernWorkspace({context:c},ioa(p),p.apiOverride?.specs),b=oxn({apiName:y.definition.rootApiFile.contents.name,organization:t.organization,generatorInvocation:p}),v=eM5(p);n=n??await oLc({packageName:v,generatorInvocation:p});let O=eS({workspace:y,audiences:i.audiences,generationLanguage:p.language,keywords:p.keywords,smartCasing:p.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:!1,disabled:p.disableExamples},readme:p.readme,version:n??await oLc({packageName:v,generatorInvocation:p}),packageName:v,context:c,sourceResolver:new kE(c,y),dynamicGeneratorConfig:b,generationMetadata:{cliVersion:r.cliVersion,generatorName:p.name,generatorVersion:p.version,generatorConfig:p.config}}),A=O4({token:e?.value});if(p.absolutePathToLocalOutput==null&&(e=await fZn(),e==null)){_.failWithoutThrowing("Please provide a FERN_TOKEN in your environment.");return}let g=await A.organization.get(Jh.OrganizationId(t.organization));if(p.absolutePathToLocalOutput==null&&!g.ok){_.failWithoutThrowing(`Failed to load details for organization ${t.organization}.`);return}g.ok&&(g.body.isWhitelabled&&(O.readmeConfig==null&&(O.readmeConfig=oM5),O.readmeConfig.whiteLabel=!0),O.selfHosted=g.body.selfHostedSdKs);let m=nM5({generatorInvocation:p,org:g.ok?g.body:void 0,version:n,packageName:v,context:_});m!=null&&(O.publishConfig=m);let j=tM5(d,p),S=j??p.absolutePathToLocalOutput??Ir.of(await Dup.default.dir().then(R=>R.path)),w=uM5(p,j!=null);if(n!=null&&vKs(n)&&w==null&&c.failAndThrow(`Automatic versioning (--version AUTO) requires a self-hosted GitHub repository configuration. Regular GitHub repositories are not supported because auto versioning needs to push changes back to the repository. Please configure your generator with self-hosted GitHub output in generators.yml. Example:
@@ -2023,7 +2023,7 @@ generators:
2023
2023
  uri: your-org/your-sdk-repo
2024
2024
  token: \${GITHUB_TOKEN}
2025
2025
  mode: pull-request
2026
- `),w!=null){await uRi.rm(S,{recursive:!0,force:!0}),await uRi.mkdir(S,{recursive:!0});try{let R=await W_c({githubRepository:w.uri,installationToken:w.token,targetDirectory:S,timeoutMs:1e3});(w.mode??"push")==="push"&&w.branch!=null&&(_.logger.debug(`Checking out branch ${w.branch} before generation`),await R.checkoutRemoteBranch(w.branch))}catch(R){_.failAndThrow(`Failed to clone GitHub repository ${w.uri}: ${R instanceof Error?R.message:String(R)}`)}}let D;p.raw?.snippets?.path!=null&&(D=Ir.of(Ct(r.absoluteFilePath,Xe.of(p.raw.snippets.path)))),D==null&&w!=null&&(D=Ir.of((await YyE()).path+"/snippet.json"));let B=await YyE(),{shouldCommit:q,autoVersioningCommitMessage:U}=await Y_E({organization:t.organization,absolutePathToFernConfig:t._absolutePath,workspace:y,generatorInvocation:p,absolutePathToLocalOutput:S,absolutePathToLocalSnippetJSON:D,absolutePathToLocalSnippetTemplateJSON:void 0,version:n,audiences:i.audiences,workspaceTempDir:B,keepDocker:a,context:_,irVersionOverride:p.irVersionOverride,outputVersionOverride:n,writeUnitTests:!0,generateOauthClients:g.ok?g?.body.oauthClientEnabled??!1:!1,generatePaginatedClients:g.ok?g?.body.paginationEnabled??!1:!1,includeOptionalRequestPropertyExamples:!1,inspect:o,executionEnvironment:void 0,ir:O,whiteLabel:g.ok?g.body.isWhitelabled:!1,runner:s,ai:u});_.logger.info(It.green("Wrote files to "+S)),w!=null&&q&&await iM5(_,w,S,U)})))).some(p=>!p)&&c.failAndThrow()}function eM5(e){if(typeof e.raw?.output=="object"&&e.raw?.output!==null){let t=e.raw.output["package-name"];if(t!=null)return t}if(typeof e.raw?.config=="object"&&e.raw?.config!==null){let t=e.raw.config.package_name;if(t!=null)return t;let r=e.raw.config.module?.path;if(r!=null)return r}}function tM5(e,t){if(e==null)return;let i=(t.name.split("/").pop()??"sdk").replace(/[^a-zA-Z0-9-_]/g,"_");return e?Ct(e,Xe.of(i)):void 0}function rM5(e){let t=e.split(`
2026
+ `),w!=null){await uRi.rm(S,{recursive:!0,force:!0}),await uRi.mkdir(S,{recursive:!0});try{let R=await W_c({githubRepository:w.uri,installationToken:w.token,targetDirectory:S,timeoutMs:3e4});(w.mode??"push")==="push"&&w.branch!=null&&(_.logger.debug(`Checking out branch ${w.branch} before generation`),await R.checkoutRemoteBranch(w.branch))}catch(R){_.failAndThrow(`Failed to clone GitHub repository ${w.uri}: ${R instanceof Error?R.message:String(R)}`)}}let D;p.raw?.snippets?.path!=null&&(D=Ir.of(Ct(r.absoluteFilePath,Xe.of(p.raw.snippets.path)))),D==null&&w!=null&&(D=Ir.of((await YyE()).path+"/snippet.json"));let B=await YyE(),{shouldCommit:q,autoVersioningCommitMessage:U}=await Y_E({organization:t.organization,absolutePathToFernConfig:t._absolutePath,workspace:y,generatorInvocation:p,absolutePathToLocalOutput:S,absolutePathToLocalSnippetJSON:D,absolutePathToLocalSnippetTemplateJSON:void 0,version:n,audiences:i.audiences,workspaceTempDir:B,keepDocker:a,context:_,irVersionOverride:p.irVersionOverride,outputVersionOverride:n,writeUnitTests:!0,generateOauthClients:g.ok?g?.body.oauthClientEnabled??!1:!1,generatePaginatedClients:g.ok?g?.body.paginationEnabled??!1:!1,includeOptionalRequestPropertyExamples:!1,inspect:o,executionEnvironment:void 0,ir:O,whiteLabel:g.ok?g.body.isWhitelabled:!1,runner:s,ai:u});_.logger.info(It.green("Wrote files to "+S)),w!=null&&q&&await iM5(_,w,S,U)})))).some(p=>!p)&&c.failAndThrow()}function eM5(e){if(typeof e.raw?.output=="object"&&e.raw?.output!==null){let t=e.raw.output["package-name"];if(t!=null)return t;let r=e.raw.output.coordinate;if(r!=null)return r}if(typeof e.raw?.config=="object"&&e.raw?.config!==null){let t=e.raw.config.package_name;if(t!=null)return t;let r=e.raw.config.module?.path;if(r!=null)return r}}function tM5(e,t){if(e==null)return;let i=(t.name.split("/").pop()??"sdk").replace(/[^a-zA-Z0-9-_]/g,"_");return e?Ct(e,Xe.of(i)):void 0}function rM5(e){let t=e.split(`
2027
2027
  `),r=t[0]?.trim()||"SDK Generation",i=t.slice(1).join(`
2028
2028
  `).trim()||"Automated SDK generation by Fern";return{prTitle:r,prBody:i}}async function iM5(e,t,r,i){try{e.logger.debug("Starting GitHub self-hosted flow in directory: "+r);let n=$dn.createAtPath(r),c=`fern-bot/${new Date().toISOString().replace("T","_").replace(/:/g,"-").replace("Z","").replace(".","_")}`;try{await n.setUserAndEmail({name:"fern-api",email:"115122769+fern-api[bot]@users.noreply.github.com"})}catch{}let d=t.mode??"push";switch(d){case"pull-request":{e.logger.debug(`Checking out new branch ${c}`),await n.checkout(c),e.logger.debug("Checking for .fernignore file...");let s=Ct(r,Xe.of(".fernignore"));try{await uRi.access(s),e.logger.debug(".fernignore already exists")}catch{e.logger.debug("Creating .fernignore file..."),await uRi.writeFile(s,`# Specify files that shouldn't be modified by Fern
2029
2029
  `,"utf-8")}e.logger.debug("Committing changes...");let u=i??"SDK Generation";if(await n.commitAllChanges(u),e.logger.debug(`Committed changes to local copy of GitHub repository at ${r}`),!t.previewMode){await n.push();let A=await n.getCurrentBranch();e.logger.info(`Pushed branch: https://github.com/${t.uri}/tree/${A}`)}let f=t.branch??await n.getDefaultBranch(),p=new $yE({auth:t.token}),_=Ydn(t.uri),{owner:h,repo:y}=_,b=`${h}:${c}`,{prTitle:v,prBody:O}=rM5(u);try{let{data:A}=await p.pulls.create({owner:h,repo:y,title:v,body:O,head:b,base:f,draft:!1});e.logger.info(`Created pull request: ${A.html_url}`)}catch(A){(A instanceof Error?A.message:String(A)).includes("A pull request already exists for")&&e.failWithoutThrowing(`A pull request already exists for ${b}`)}break}case"push":{t.branch!=null&&(e.logger.debug(`Checking out branch ${t.branch}`),await n.checkout(t.branch)),e.logger.debug("Checking for .fernignore file...");let s=Ct(r,Xe.of(".fernignore"));try{await uRi.access(s),e.logger.debug(".fernignore already exists")}catch{e.logger.debug("Creating .fernignore file..."),await uRi.writeFile(s,`# Specify files that shouldn't be modified by Fern