@fern-api/ruby-dynamic-snippets 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DynamicSnippetsGenerator.cjs +26 -0
- package/cjs/DynamicSnippetsGenerator.d.cts +19 -0
- package/cjs/DynamicSnippetsGeneratorContext-BGmCyT7y.d.cts +52 -0
- package/cjs/EndpointSnippetGenerator.cjs +26 -0
- package/cjs/EndpointSnippetGenerator.d.cts +40 -0
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +26 -0
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +4 -0
- package/cjs/context/DynamicToLiteralMapper.cjs +26 -0
- package/cjs/context/DynamicToLiteralMapper.d.cts +4 -0
- package/cjs/index.cjs +38 -0
- package/cjs/index.d.cts +6 -0
- package/esm/DynamicSnippetsGenerator.d.ts +19 -0
- package/esm/DynamicSnippetsGenerator.js +1 -0
- package/esm/DynamicSnippetsGeneratorContext-BGmCyT7y.d.ts +52 -0
- package/esm/EndpointSnippetGenerator.d.ts +40 -0
- package/esm/EndpointSnippetGenerator.js +1 -0
- package/esm/chunk-2EUGHB6H.js +26 -0
- package/esm/chunk-5MYTC5XX.js +1 -0
- package/esm/chunk-JE27KH5P.js +1 -0
- package/esm/chunk-P72WBQKD.js +1 -0
- package/esm/chunk-T3CDT3YD.js +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +4 -0
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -0
- package/esm/context/DynamicToLiteralMapper.d.ts +4 -0
- package/esm/context/DynamicToLiteralMapper.js +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +13 -0
- package/package.json +27 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";var he=Object.defineProperty,ft=Object.defineProperties,pt=Object.getOwnPropertyDescriptor,ht=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertyNames,pe=Object.getOwnPropertySymbols;var Ie=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var Ne=(i,t,e)=>t in i?he(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Ue=(i,t)=>{for(var e in t||(t={}))Ie.call(t,e)&&Ne(i,e,t[e]);if(pe)for(var e of pe(t))_e.call(t,e)&&Ne(i,e,t[e]);return i},De=(i,t)=>ft(i,ht(t));var Me=i=>typeof i=="symbol"?i:i+"",Fe=(i,t)=>{var e={};for(var r in i)Ie.call(i,r)&&t.indexOf(r)<0&&(e[r]=i[r]);if(i!=null&&pe)for(var r of pe(i))t.indexOf(r)<0&&_e.call(i,r)&&(e[r]=i[r]);return e};var Se=(i,t)=>()=>(i&&(t=i(i=0)),t);var $e=(i,t)=>{for(var e in t)he(i,e,{get:t[e],enumerable:!0})},dt=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of mt(t))!Ie.call(i,n)&&n!==e&&he(i,n,{get:()=>t[n],enumerable:!(r=pt(t,n))||r.enumerable});return i};var yt=i=>dt(he({},"__esModule",{value:!0}),i);var u=(i,t,e)=>Ne(i,typeof t!="symbol"?t+"":t,e);function Ve(){throw new Error("setTimeout has not been defined")}function Oe(){throw new Error("clearTimeout has not been defined")}function We(i){if(B===setTimeout)return setTimeout(i,0);if((B===Ve||!B)&&setTimeout)return B=setTimeout,setTimeout(i,0);try{return B(i,0)}catch(t){try{return B.call(null,i,0)}catch(e){return B.call(this,i,0)}}}function wt(i){if(_===clearTimeout)return clearTimeout(i);if((_===Oe||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch(t){try{return _.call(null,i)}catch(e){return _.call(this,i)}}}function xt(){!X||!U||(X=!1,U.length?k=U.concat(k):me=-1,k.length&&ze())}function ze(){if(!X){var i=We(xt);X=!0;for(var t=k.length;t;){for(U=k,k=[];++me<t;)U&&U[me].run();me=-1,t=k.length}U=null,X=!1,wt(i)}}function gt(i){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];k.push(new Ge(i,t)),k.length===1&&!X&&We(ze)}function Ge(i,t){this.fun=i,this.array=t}function D(){}function Dt(i){throw new Error("process.binding is not supported")}function Mt(){return"/"}function Ft(i){throw new Error("process.chdir is not supported")}function $t(){return 0}function Vt(i){var t=Yt.call(K)*.001,e=Math.floor(t),r=Math.floor(t%1*1e9);return i&&(e=e-i[0],r=r-i[1],r<0&&(e--,r+=1e9)),[e,r]}function Wt(){var i=new Date,t=i-Ot;return t/1e3}var B,_,k,X,U,me,vt,Tt,Et,At,Rt,bt,Nt,It,St,Ct,Lt,kt,Pt,Bt,_t,Ut,K,Yt,Ot,m,Ye,l=Se(()=>{"use strict";B=Ve,_=Oe;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);k=[],X=!1,me=-1;Ge.prototype.run=function(){this.fun.apply(null,this.array)};vt="browser",Tt="browser",Et=!0,At={},Rt=[],bt="",Nt={},It={},St={};Ct=D,Lt=D,kt=D,Pt=D,Bt=D,_t=D,Ut=D;K=globalThis.performance||{},Yt=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};Ot=new Date;m={nextTick:gt,title:vt,browser:Et,env:At,argv:Rt,version:bt,versions:Nt,on:Ct,addListener:Lt,once:kt,off:Pt,removeListener:Bt,removeAllListeners:_t,emit:Ut,binding:Dt,cwd:Mt,chdir:Ft,umask:$t,hrtime:Vt,platform:Tt,release:It,config:St,uptime:Wt},Ye={};Object.keys(Ye).forEach(i=>{let t=i.split("."),e=m;for(let r=0;r<t.length;r++){let n=t[r];r===t.length-1?e[n]=Ye[i]:e=e[n]||(e[n]={})}})});function Ke(){Le=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=i.length;t<e;++t)C[t]=i[t],b[i.charCodeAt(t)]=t;b[45]=62,b[95]=63}function Gt(i){Le||Ke();var t,e,r,n,o,s,f=i.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=i[f-2]==="="?2:i[f-1]==="="?1:0,s=new zt(f*3/4-o),r=o>0?f-4:f;var p=0;for(t=0,e=0;t<r;t+=4,e+=3)n=b[i.charCodeAt(t)]<<18|b[i.charCodeAt(t+1)]<<12|b[i.charCodeAt(t+2)]<<6|b[i.charCodeAt(t+3)],s[p++]=n>>16&255,s[p++]=n>>8&255,s[p++]=n&255;return o===2?(n=b[i.charCodeAt(t)]<<2|b[i.charCodeAt(t+1)]>>4,s[p++]=n&255):o===1&&(n=b[i.charCodeAt(t)]<<10|b[i.charCodeAt(t+1)]<<4|b[i.charCodeAt(t+2)]>>2,s[p++]=n>>8&255,s[p++]=n&255),s}function jt(i){return C[i>>18&63]+C[i>>12&63]+C[i>>6&63]+C[i&63]}function qt(i,t,e){for(var r,n=[],o=t;o<e;o+=3)r=(i[o]<<16)+(i[o+1]<<8)+i[o+2],n.push(jt(r));return n.join("")}function je(i){Le||Ke();for(var t,e=i.length,r=e%3,n="",o=[],s=16383,f=0,p=e-r;f<p;f+=s)o.push(qt(i,f,f+s>p?p:f+s));return r===1?(t=i[e-1],n+=C[t>>2],n+=C[t<<4&63],n+="=="):r===2&&(t=(i[e-2]<<8)+i[e-1],n+=C[t>>10],n+=C[t>>4&63],n+=C[t<<2&63],n+="="),o.push(n),o.join("")}function de(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function P(i,t){if(de()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(t),i.__proto__=a.prototype):(i===null&&(i=new a(t)),i.length=t),i}function a(i,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(i,t,e);if(typeof i=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return ke(this,i)}return Xe(this,i,t,e)}function Xe(i,t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Xt(i,t,e,r):typeof t=="string"?Kt(i,t,e):Jt(i,t)}function Je(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Ht(i,t,e,r){return Je(t),t<=0?P(i,t):e!==void 0?typeof r=="string"?P(i,t).fill(e,r):P(i,t).fill(e):P(i,t)}function ke(i,t){if(Je(t),i=P(i,t<0?0:Pe(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)i[e]=0;return i}function Kt(i,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=Ze(t,e)|0;i=P(i,r);var n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Ce(i,t){var e=t.length<0?0:Pe(t.length)|0;i=P(i,e);for(var r=0;r<e;r+=1)i[r]=t[r]&255;return i}function Xt(i,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),a.TYPED_ARRAY_SUPPORT?(i=t,i.__proto__=a.prototype):i=Ce(i,t),i}function Jt(i,t){if(L(t)){var e=Pe(t.length)|0;return i=P(i,e),i.length===0||t.copy(i,0,0,e),i}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||yr(t.length)?P(i,0):Ce(i,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ce(i,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Pe(i){if(i>=de())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+de().toString(16)+" bytes");return i|0}function L(i){return!!(i!=null&&i._isBuffer)}function Ze(i,t){if(L(i))return i.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var e=i.length;if(e===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return ye(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ot(i).length;default:if(r)return ye(i).length;t=(""+t).toLowerCase(),r=!0}}function Zt(i,t,e){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(i||(i="utf8");;)switch(i){case"hex":return ur(this,t,e);case"utf8":case"utf-8":return tt(this,t,e);case"ascii":return sr(this,t,e);case"latin1":case"binary":return ar(this,t,e);case"base64":return nr(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lr(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),r=!0}}function M(i,t,e){var r=i[t];i[t]=i[e],i[e]=r}function Qe(i,t,e,r,n){if(i.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:i.length-1),e<0&&(e=i.length+e),e>=i.length){if(n)return-1;e=i.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,r)),L(t))return t.length===0?-1:qe(i,t,e,r,n);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(i,t,e):Uint8Array.prototype.lastIndexOf.call(i,t,e):qe(i,[t],e,r,n);throw new TypeError("val must be string, number or Buffer")}function qe(i,t,e,r,n){var o=1,s=i.length,f=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(i.length<2||t.length<2)return-1;o=2,s/=2,f/=2,e/=2}function p(R,H){return o===1?R[H]:R.readUInt16BE(H*o)}var d;if(n){var w=-1;for(d=e;d<s;d++)if(p(i,d)===p(t,w===-1?0:d-w)){if(w===-1&&(w=d),d-w+1===f)return w*o}else w!==-1&&(d-=d-w),w=-1}else for(e+f>s&&(e=s-f),d=e;d>=0;d--){for(var y=!0,N=0;N<f;N++)if(p(i,d+N)!==p(t,N)){y=!1;break}if(y)return d}return-1}function Qt(i,t,e,r){e=Number(e)||0;var n=i.length-e;r?(r=Number(r),r>n&&(r=n)):r=n;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var f=parseInt(t.substr(s*2,2),16);if(isNaN(f))return s;i[e+s]=f}return s}function er(i,t,e,r){return ge(ye(t,i.length-e),i,e,r)}function et(i,t,e,r){return ge(mr(t),i,e,r)}function tr(i,t,e,r){return et(i,t,e,r)}function rr(i,t,e,r){return ge(ot(t),i,e,r)}function ir(i,t,e,r){return ge(dr(t,i.length-e),i,e,r)}function nr(i,t,e){return t===0&&e===i.length?je(i):je(i.slice(t,e))}function tt(i,t,e){e=Math.min(i.length,e);for(var r=[],n=t;n<e;){var o=i[n],s=null,f=o>239?4:o>223?3:o>191?2:1;if(n+f<=e){var p,d,w,y;switch(f){case 1:o<128&&(s=o);break;case 2:p=i[n+1],(p&192)===128&&(y=(o&31)<<6|p&63,y>127&&(s=y));break;case 3:p=i[n+1],d=i[n+2],(p&192)===128&&(d&192)===128&&(y=(o&15)<<12|(p&63)<<6|d&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:p=i[n+1],d=i[n+2],w=i[n+3],(p&192)===128&&(d&192)===128&&(w&192)===128&&(y=(o&15)<<18|(p&63)<<12|(d&63)<<6|w&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),n+=f}return or(r)}function or(i){var t=i.length;if(t<=He)return String.fromCharCode.apply(String,i);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,i.slice(r,r+=He));return e}function sr(i,t,e){var r="";e=Math.min(i.length,e);for(var n=t;n<e;++n)r+=String.fromCharCode(i[n]&127);return r}function ar(i,t,e){var r="";e=Math.min(i.length,e);for(var n=t;n<e;++n)r+=String.fromCharCode(i[n]);return r}function ur(i,t,e){var r=i.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var n="",o=t;o<e;++o)n+=hr(i[o]);return n}function lr(i,t,e){for(var r=i.slice(t,e),n="",o=0;o<r.length;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}function v(i,t,e){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+t>e)throw new RangeError("Trying to access beyond buffer length")}function A(i,t,e,r,n,o){if(!L(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(e+r>i.length)throw new RangeError("Index out of range")}function we(i,t,e,r){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(i.length-e,2);n<o;++n)i[e+n]=(t&255<<8*(r?n:1-n))>>>(r?n:1-n)*8}function xe(i,t,e,r){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(i.length-e,4);n<o;++n)i[e+n]=t>>>(r?n:3-n)*8&255}function rt(i,t,e,r,n,o){if(e+r>i.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function it(i,t,e,r,n){return n||rt(i,t,e,4,34028234663852886e22,-34028234663852886e22),at(i,t,e,r,23,4),e+4}function nt(i,t,e,r,n){return n||rt(i,t,e,8,17976931348623157e292,-17976931348623157e292),at(i,t,e,r,52,8),e+8}function fr(i){if(i=pr(i).replace(cr,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function pr(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function hr(i){return i<16?"0"+i.toString(16):i.toString(16)}function ye(i,t){t=t||1/0;for(var e,r=i.length,n=null,o=[],s=0;s<r;++s){if(e=i.charCodeAt(s),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function mr(i){for(var t=[],e=0;e<i.length;++e)t.push(i.charCodeAt(e)&255);return t}function dr(i,t){for(var e,r,n,o=[],s=0;s<i.length&&!((t-=2)<0);++s)e=i.charCodeAt(s),r=e>>8,n=e%256,o.push(n),o.push(r);return o}function ot(i){return Gt(fr(i))}function ge(i,t,e,r){for(var n=0;n<r&&!(n+e>=t.length||n>=i.length);++n)t[n+e]=i[n];return n}function yr(i){return i!==i}function wr(i){return i!=null&&(!!i._isBuffer||st(i)||xr(i))}function st(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function xr(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&st(i.slice(0,0))}function ve(i,t,e,r,n){var o,s,f=n*8-r-1,p=(1<<f)-1,d=p>>1,w=-7,y=e?n-1:0,N=e?-1:1,R=i[t+y];for(y+=N,o=R&(1<<-w)-1,R>>=-w,w+=f;w>0;o=o*256+i[t+y],y+=N,w-=8);for(s=o&(1<<-w)-1,o>>=-w,w+=r;w>0;s=s*256+i[t+y],y+=N,w-=8);if(o===0)o=1-d;else{if(o===p)return s?NaN:(R?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-d}return(R?-1:1)*s*Math.pow(2,o-r)}function at(i,t,e,r,n,o){var s,f,p,d=o*8-n-1,w=(1<<d)-1,y=w>>1,N=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=r?0:o-1,H=r?1:-1,ct=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,s=w):(s=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-s))<1&&(s--,p*=2),s+y>=1?t+=N/p:t+=N*Math.pow(2,1-y),t*p>=2&&(s++,p/=2),s+y>=w?(f=0,s=w):s+y>=1?(f=(t*p-1)*Math.pow(2,n),s=s+y):(f=t*Math.pow(2,y-1)*Math.pow(2,n),s=0));n>=8;i[e+R]=f&255,R+=H,f/=256,n-=8);for(s=s<<n|f,d+=n;d>0;i[e+R]=s&255,R+=H,s/=256,d-=8);i[e+R-H]|=ct*128}var C,b,zt,Le,He,cr,ut=Se(()=>{"use strict";l();c();C=[],b=[],zt=typeof Uint8Array!="undefined"?Uint8Array:Array,Le=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(i){return i.__proto__=a.prototype,i};a.from=function(i,t,e){return Xe(null,i,t,e)};a.kMaxLength=de();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(i,t,e){return Ht(null,i,t,e)};a.allocUnsafe=function(i){return ke(null,i)};a.allocUnsafeSlow=function(i){return ke(null,i)};a.isBuffer=wr;a.compare=function(t,e){if(!L(t)||!L(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,s=Math.min(r,n);o<s;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!L(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n};a.byteLength=Ze;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)M(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?tt(this,0,t):Zt.apply(this,arguments)};a.prototype.equals=function(t){if(!L(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,r,n,o){if(!L(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var s=o-n,f=r-e,p=Math.min(s,f),d=this.slice(n,o),w=t.slice(e,r),y=0;y<p;++y)if(d[y]!==w[y]){s=d[y],f=w[y];break}return s<f?-1:f<s?1:0};a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};a.prototype.indexOf=function(t,e,r){return Qe(this,t,e,r,!0)};a.prototype.lastIndexOf=function(t,e,r){return Qe(this,t,e,r,!1)};a.prototype.write=function(t,e,r,n){if(e===void 0)n="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")n=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((r===void 0||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return Qt(this,t,e,r);case"utf8":case"utf-8":return er(this,t,e,r);case"ascii":return et(this,t,e,r);case"latin1":case"binary":return tr(this,t,e,r);case"base64":return rr(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ir(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};He=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=a.prototype;else{var o=e-t;n=new a(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+t]}return n};a.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||v(t,e,this.length);for(var n=this[t],o=1,s=0;++s<e&&(o*=256);)n+=this[t+s]*o;return n};a.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||v(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n};a.prototype.readUInt8=function(t,e){return e||v(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||v(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||v(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||v(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||v(t,e,this.length);for(var n=this[t],o=1,s=0;++s<e&&(o*=256);)n+=this[t+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||v(t,e,this.length);for(var n=e,o=1,s=this[t+--n];n>0&&(o*=256);)s+=this[t+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||v(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||v(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};a.prototype.readInt16BE=function(t,e){e||v(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};a.prototype.readInt32LE=function(t,e){return e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||v(t,4,this.length),ve(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||v(t,4,this.length),ve(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||v(t,8,this.length),ve(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||v(t,8,this.length),ve(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=e|0,r=r|0,!n){var o=Math.pow(2,8*r)-1;A(this,t,e,r,o,0)}var s=1,f=0;for(this[e]=t&255;++f<r&&(s*=256);)this[e+f]=t/s&255;return e+r};a.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e=e|0,r=r|0,!n){var o=Math.pow(2,8*r)-1;A(this,t,e,r,o,0)}var s=r-1,f=1;for(this[e+s]=t&255;--s>=0&&(f*=256);)this[e+s]=t/f&255;return e+r};a.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):we(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):we(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):xe(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):xe(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=e|0,!n){var o=Math.pow(2,8*r-1);A(this,t,e,r,o-1,-o)}var s=0,f=1,p=0;for(this[e]=t&255;++s<r&&(f*=256);)t<0&&p===0&&this[e+s-1]!==0&&(p=1),this[e+s]=(t/f>>0)-p&255;return e+r};a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=e|0,!n){var o=Math.pow(2,8*r-1);A(this,t,e,r,o-1,-o)}var s=r-1,f=1,p=0;for(this[e+s]=t&255;--s>=0&&(f*=256);)t<0&&p===0&&this[e+s+1]!==0&&(p=1),this[e+s]=(t/f>>0)-p&255;return e+r};a.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):we(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):we(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):xe(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):xe(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,r){return it(this,t,e,!0,r)};a.prototype.writeFloatBE=function(t,e,r){return it(this,t,e,!1,r)};a.prototype.writeDoubleLE=function(t,e,r){return nt(this,t,e,!0,r)};a.prototype.writeDoubleBE=function(t,e,r){return nt(this,t,e,!1,r)};a.prototype.copy=function(t,e,r,n){if(r||(r=0),!n&&n!==0&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r,s;if(this===t&&r<e&&e<n)for(s=o-1;s>=0;--s)t[s+e]=this[s+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};a.prototype.fill=function(t,e,r,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<r;++s)this[s]=t;else{var f=L(t)?t:ye(new a(t,n).toString()),p=f.length;for(s=0;s<r-e;++s)this[s+e]=f[s%p]}return this};cr=/[^+\/0-9A-Za-z-_]/g});var c=Se(()=>{"use strict";ut()});var Pr={};$e(Pr,{DynamicSnippetsGeneratorContext:()=>Be});module.exports=yt(Pr);l();c();l();c();l();c();function T(i){throw new Error("Unexpected value: "+JSON.stringify(i))}l();c();function Q(i){return Object.keys(i)}l();c();l();c();var F=class{};l();c();l();c();var I=class extends F{constructor(e){super();u(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var gr=4,ee=class{constructor(){u(this,"buffer","");u(this,"indentLevel",0);u(this,"hasWrittenAnything",!1);u(this,"lastCharacterIsSemicolon",!1);u(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
2
|
+
`),r=e?t.substring(0,t.length-1):t,n=this.getIndentString(),o=r.replaceAll(`
|
|
3
|
+
`,`
|
|
4
|
+
${n}`);this.isAtStartOfLine()&&(o=n+o),e&&(o+=`
|
|
5
|
+
`),this.writeInternal(o)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new I(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new I(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}controlFlowWithoutStatement(t){new I(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new I(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new I(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
6
|
+
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
7
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:r}){if(t.length>0){let n=t[0];n!=null&&r(n);for(let o=1;o<t.length;o++){this.write(e);let s=t[o];s!=null&&r(s)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
8
|
+
`),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*gr)}};l();c();var Te=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},te=class extends Te{async format(t){return t}formatSync(t){return t}};l();c();l();c();l();c();l();c();var re=class{constructor(){u(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let r=t.match(this.REFERENCE_REGEX);if(!(r==null||r[1]==null||r[2]==null))return{method:r[1],path:r[2]}}};l();c();var g={Critical:"CRITICAL",Warning:"WARNING"},ie=class i{constructor(){u(this,"errors");u(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(De(Ue({},t),{path:[...this.path]}))}scope(t){this.path.push(t)}unscope(){this.path.pop()}getBySeverity(t){return this.errors.filter(e=>e.severity===t)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let t=new i;return t.errors=[...this.errors],t.path=[...this.path],t}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(t=>({severity:t.severity,path:t.path!=null?this.pathToStringArray(t.path):void 0,message:t.message}))}pathToStringArray(t){let e=[];for(let r of t){if(typeof r=="string"){e.push(r);continue}e[e.length-1]+=`[${r.index}]`}return e}};var ne=class{constructor({ir:t,config:e,options:r={}}){u(this,"config");u(this,"options");u(this,"errors");u(this,"_ir");u(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=r,this.errors=new ie,this.httpEndpointReferenceParser=new re}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];for(let[n,o]of Object.entries(e)){this.errors.scope(n);try{let s=t.find(p=>p.name.wireValue===n);if(s==null)throw this.newParameterNotRecognizedError(n);let f=this.isListTypeReference(s.typeReference)&&!Array.isArray(o)?[o]:o;r.push({name:s.name,typeReference:s.typeReference,value:f})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){let n=[];for(let[o,s]of Object.entries(e)){this.errors.scope(o);try{let f=t.find(p=>p.name.wireValue===o);if(f==null){if(r)continue;this.errors.add({severity:g.Critical,message:this.newParameterNotRecognizedError(o).message});continue}n.push({name:f.name,typeReference:f.typeReference,value:s})}finally{this.errors.unscope()}}return n}getSingleFileValue({property:t,record:e}){let r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:g.Critical,message:`Expected file value to be a string, got ${typeof r}`});return}return r}}getFileArrayValues({property:t,record:e}){let r=e[t.wireValue];if(r==null)return;if(!Array.isArray(r)){this.errors.add({severity:g.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let n=[];for(let o of r){if(typeof o!="string"){this.errors.add({severity:g.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}n.push(o)}return n}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:g.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(t)?"array":typeof t}`});return}return t==null?{}:t}resolveNamedType({typeId:t}){let e=this._ir.types[t];if(e==null){this.errors.add({severity:g.Critical,message:`Type identified by "${t}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e}){let r=this.getRecord(e);if(r==null)return;let n=t.discriminant.wireValue,o=r[n];if(o==null){this.errors.add({severity:g.Critical,message:this.newParameterNotRecognizedError(n).message});return}if(typeof o!="string"){this.errors.add({severity:g.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let s=t.types[o];if(s==null){this.errors.add({severity:g.Critical,message:`No type found for discriminant value "${o}"`});return}let d=r,{[n]:f}=d,p=Fe(d,[Me(n)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:p}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocationOrThrow(t){let e=[];for(let r of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t})&&e.push(r);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`);return e}needsRequestParameter({request:t,inlinePathParameters:e,inlineFileProperties:r}){var n;return this.includePathParametersInWrappedRequest({request:t,inlinePathParameters:e})||t.queryParameters!=null&&t.queryParameters.length>0||t.headers!=null&&t.headers.length>0?!0:t.body!=null?this.includeRequestBodyInWrappedRequest({body:t.body,inlineFileProperties:r}):!((n=t.metadata)!=null&&n.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,n;return e&&((n=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?n:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:T(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let r=e.environments.find(n=>n.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(n=>n.id===t);return r==null?void 0:r.name}default:T(e)}}isSingleEnvironmentID(t){return typeof t=="string"}isMultiEnvironmentValues(t){return typeof t=="object"}validateMultiEnvironmentUrlValues(t){if(this._ir.environments==null)return this.errors.add({severity:g.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":return this.errors.add({severity:g.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let r=e.environments[0];if(r==null)return this.errors.add({severity:g.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let n=new Set(Q(r.urls));for(let o of Q(t))n.has(o)&&n.delete(o);return n.size>0?(this.errors.add({severity:g.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${Q(r.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:g.Critical,message:this.newTypeMismatchError({expected:"string",value:t}).message});return}return t}isOptional(t){switch(t.type){case"nullable":return this.isOptional(t.value);case"optional":return!0;case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}isNullable(t){switch(t.type){case"nullable":return!0;case"optional":return this.isNullable(t.value);case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}newAuthMismatchError({auth:t,values:e}){return new Error(`Expected auth type ${t.type}, got ${e.type}`)}newParameterNotRecognizedError(t){return new Error(`"${t}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:t,value:e}){return new Error(`Expected ${t}, got ${typeof e}`)}includeRequestBodyInWrappedRequest({body:t,inlineFileProperties:e}){switch(t.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e});default:T(t)}}includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e}){return this.fileUploadHasBodyProperties({fileUpload:t})||e&&this.fileUploadHasFileProperties({fileUpload:t})}fileUploadHasBodyProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:T(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:T(e)}})}isListTypeReference(t){return t.type==="optional"?this.isListTypeReference(t.value):t.type==="list"||t.type==="set"}parsedEndpointMatches({endpoint:t,parsedEndpoint:e}){return t.location.method===e.method&&t.location.path===e.path}};l();c();var h={};$e(h,{AstNode:()=>x,ClassInstantiation:()=>V,ClassReference:()=>O,CodeBlock:()=>W,KeywordArgument:()=>z,Method:()=>G,MethodInvocation:()=>j,Parameter:()=>E,TypeLiteral:()=>ce,TypeParameter:()=>q,classReference:()=>Ir,class_:()=>Er,codeblock:()=>vr,comment:()=>br,instantiateClass:()=>Sr,invokeMethod:()=>Lr,keywordArgument:()=>Cr,method:()=>Rr,module:()=>Ar,parameters:()=>Tr,positionalArgument:()=>kr,typeParameter:()=>Nr});l();c();l();c();l();c();l();c();l();c();l();c();l();c();var Ee=class extends ee{constructor({customConfig:e,formatter:r}){super();u(this,"customConfig");u(this,"formatter");u(this,"requires",new Set);this.customConfig=e,this.formatter=r!=null?r:new te}addRequire(e){this.requires.add(e)}};var J=class extends Ee{constructor({customConfig:t,formatter:e}){super({customConfig:t,formatter:e})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Ruby file: ${e}
|
|
9
|
+
${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Ruby file: ${e}
|
|
10
|
+
${t}`)}return t}getContent(){let t=this.stringifyRequires();return t.length>0?`${t}
|
|
11
|
+
|
|
12
|
+
${this.buffer}`:this.buffer}stringifyRequires(){return Array.from(this.requires).map(t=>`require "${t}"`).join(`
|
|
13
|
+
`)}};var x=class extends F{async toStringAsync({customConfig:t,formatter:e}){let r=new J({customConfig:t,formatter:e});return this.write(r),r.toStringAsync()}toString({customConfig:t,formatter:e}){let r=new J({customConfig:t,formatter:e});return this.write(r),r.toString()}typeDefinitionToString({customConfig:t,formatter:e}){let r=new J({customConfig:t,formatter:e});return this.writeTypeDefinition(r),r.toString()}writeTypeDefinition(t){}};var S=class extends x{constructor({docs:e}){super();u(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
14
|
+
`).forEach(r=>{e.writeLine(`# ${r}`)})}};l();c();var $=class i extends x{constructor({name:e,namespace:r,typeParameters:n,docstring:o,statements:s}){super();u(this,"name");u(this,"namespace");u(this,"typeParameters");u(this,"docstring");u(this,"statements");this.name=e,this.namespace=r!=null?r:new Set,this.typeParameters=n!=null?n:[],this.docstring=o,this.statements=s!=null?s:[],this.populateChildNamespaces()}write(e){this.docstring&&new S({docs:this.docstring}).write(e),e.write(`module ${this.name}`),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((r,n)=>{r.write(e),n<this.statements.length-1&&e.newLine()}),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`module ${this.name}`),this.typeParameters.length&&(e.write("["),e.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:r=>r.writeTypeDefinition(e)}),e.write("]")),e.newLine(),this.statements.length&&(e.indent(),this.statements.forEach(r=>{r.writeTypeDefinition(e),e.newLine()}),e.dedent()),e.write("end")}populateChildNamespaces(){this.statements.filter(e=>e instanceof i||e instanceof Y).forEach(e=>{e.namespace=new Set([...this.namespace,this]),e.populateChildNamespaces()})}get fullyQualifiedNamespace(){return[...this.namespace,this].map(e=>e.name).join("::")}};var Y=class extends ${constructor({name:e,superclass:r,typeParameters:n,docstring:o,statements:s}){super({name:e,docstring:o,typeParameters:n});u(this,"superclass");u(this,"statements");this.superclass=r,this.statements=s!=null?s:[]}write(e){this.docstring&&new S({docs:this.docstring}).write(e),e.write(`class ${this.name}`),this.superclass&&e.write(` < ${this.superclass.name}`),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((r,n)=>{r.write(e),n<this.statements.length-1&&e.newLine()}),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`class ${this.name}`),this.typeParameters.length&&(e.write("["),e.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:r=>r.writeTypeDefinition(e)}),e.write("]")),this.superclass&&e.write(` < ${this.superclass.name}`),e.newLine(),this.statements.length&&(e.indent(),this.statements.forEach(r=>{r.writeTypeDefinition(e),e.newLine()}),e.dedent()),e.write("end")}};l();c();var V=class extends x{constructor({classReference:e,arguments_:r}){super();u(this,"classReference");u(this,"arguments_");this.classReference=e,this.arguments_=r}write(e){e.writeNode(this.classReference),e.write("."),e.write("new"),e.write("("),this.arguments_.length>1?(e.indent(),e.newLine(),this.arguments_.forEach((r,n)=>{n>0&&(e.write(","),e.newLine()),r.write(e)}),e.newLine(),e.dedent()):this.arguments_.forEach((r,n)=>{n>0&&e.write(", "),r.write(e)}),e.write(")")}};l();c();var O=class extends x{constructor({name:e,modules:r,fullyQualified:n}){super();u(this,"name");u(this,"modules");u(this,"fullyQualified");this.name=e,this.modules=r!=null?r:[],this.fullyQualified=n!=null?n:!1}write(e){if(this.fullyQualified||this.modules.length>0){let r=[...this.modules,this.name].join("::");e.write(r);return}e.write(this.name)}};l();c();var W=class extends x{constructor(e){super();u(this,"arg");this.arg=e}write(e){return new I(this.arg).write(e)}};l();c();var z=class extends x{constructor({name:e,value:r}){super();u(this,"name");u(this,"value");this.name=e,this.value=r}write(e){e.write(`${this.name}: `),this.value.write(e)}};l();c();l();c();l();c();var Z=class i extends x{constructor(e){super();u(this,"internalType");this.internalType=e}write(e){}writeTypeDefinition(e){if(this.internalType)switch(this.internalType.type){case"self":e.write("self");break;case"class":e.write("class");break;case"instance":e.write("instance");break;case"boolean":e.write("bool");break;case"nil":e.write("nil");break;case"top":e.write("top");break;case"bot":e.write("bot");break;case"void":e.write("void");break;case"boolish":e.write("boolish");break;case"string":e.write("String");break;case"integer":e.write("Integer");break;case"union":e.delimit({nodes:this.internalType.elems,delimiter:" | ",writeFunction:r=>r.writeTypeDefinition(e)});break;case"intersection":e.delimit({nodes:this.internalType.elems,delimiter:" & ",writeFunction:r=>r.writeTypeDefinition(e)});break;case"array":e.write("Array["),this.internalType.elem.writeTypeDefinition(e),e.write("]");break;case"hash":e.write("Hash["),this.internalType.keyType.writeTypeDefinition(e),e.write(", "),this.internalType.valueType.writeTypeDefinition(e),e.write("]");break;case"object":e.write(this.internalType.klass);break;case"singleton":e.write("singleton("),e.write(this.internalType.klass),e.write(")");break;case"tuple":e.write("["),e.delimit({nodes:this.internalType.elems,delimiter:", ",writeFunction:r=>r.write(e)}),e.write("]");break;case"generic":e.write(`${this.internalType.baseKlass}[`),e.delimit({nodes:this.internalType.parameters,delimiter:", ",writeFunction:r=>r.writeTypeDefinition(e)}),e.write("]");break;default:T(this.internalType)}else e.write("untyped")}static untyped(){return new this(void 0)}static self(){return new this({type:"self"})}static class_(){return new this({type:"class"})}static instance(){return new this({type:"instance"})}static boolean(){return new this({type:"boolean"})}static nil(){return new this({type:"nil"})}static top(){return new this({type:"top"})}static bot(){return new this({type:"bot"})}static void(){return new this({type:"void"})}static boolish(){return new this({type:"boolish"})}static string(){return new this({type:"string"})}static integer(){return new this({type:"integer"})}static union(e){return new this({type:"union",elems:e})}static intersection(e){return new this({type:"intersection",elems:e})}static array(e){return new this({type:"array",elem:e})}static hash(e,r){return new this({type:"hash",keyType:e,valueType:r})}static object(e){return new this({type:"object",klass:e})}static singleton(e){return new this({type:"singleton",klass:e})}static tuple(e){return new this({type:"tuple",elems:e})}static generic(e,r){return new this({type:"generic",baseKlass:e,parameters:r})}static nilable(e){return i.union([e,i.nil()])}nilable(){return i.nilable(this)}};var E=class extends x{constructor({name:e,type:r,optional:n}){super();u(this,"name");u(this,"type");u(this,"optional");this.name=e,this.type=r!=null?r:Z.untyped(),this.optional=n!=null?n:!1}};var oe=class extends E{constructor({name:e,type:r,initializer:n,optional:o}){super({name:e,type:r,optional:o});u(this,"initializer");this.initializer=n}write(e){e.write(`${this.name}:`),this.initializer&&e.write(` ${this.initializer.write(e)}`)}writeTypeDefinition(e){this.optional&&e.write("?"),e.write(`${this.name}: `),this.type.writeTypeDefinition(e)}};l();c();var se=class extends E{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`**${this.name}`)}writeTypeDefinition(e){e.write("**"),this.type.writeTypeDefinition(e)}};l();c();var Ae={Instance:"instance",Class_:"class"},lt={Public:"public",Private:"private",Protected:"protected"},G=class extends x{constructor({name:e,docstring:r,kind:n,visibility:o,parameters:s,returnType:f}){var p,d;super();u(this,"name");u(this,"docstring");u(this,"kind");u(this,"positionalParameters");u(this,"keywordParameters");u(this,"positionalSplatParameter");u(this,"keywordSplatParameter");u(this,"yieldParameter");u(this,"visibility");u(this,"statements",[]);u(this,"returnType");this.name=e,this.docstring=r,this.kind=n!=null?n:Ae.Instance,this.visibility=o!=null?o:lt.Public,this.positionalParameters=(p=s==null?void 0:s.positional)!=null?p:[],this.keywordParameters=(d=s==null?void 0:s.keyword)!=null?d:[],this.positionalSplatParameter=s==null?void 0:s.positionalSplat,this.keywordSplatParameter=s==null?void 0:s.keywordSplat,this.yieldParameter=s==null?void 0:s.yield,this.returnType=f!=null?f:Z.untyped()}write(e){switch(this.docstring&&new S({docs:this.docstring}).write(e),this.visibility!==lt.Public&&(e.write(this.visibility),this.kind===Ae.Class_&&e.write("_class_method"),e.write(" ")),this.kind){case Ae.Instance:e.write(`def ${this.name}`);break;case Ae.Class_:e.write(`def self.${this.name}`);break}this.parameters.length&&(e.write("("),e.delimit({nodes:this.parameters,delimiter:", ",writeFunction:r=>r.write(e)}),e.write(")")),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((r,n)=>{r.write(e),n<this.statements.length-1&&e.newLine()}),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`def ${this.name}: (`),this.parameters.forEach((r,n)=>{r.writeTypeDefinition(e),n<this.parameters.length-1&&e.write(", ")}),e.write(") -> "),this.returnType.writeTypeDefinition(e)}get parameters(){return[...this.positionalParameters,...this.keywordParameters,this.positionalSplatParameter,this.keywordSplatParameter,this.yieldParameter].flatMap(e=>e!==void 0?e:[])}};l();c();var j=class extends x{constructor({on:e,method:r,arguments_:n}){super();u(this,"on");u(this,"method");u(this,"arguments_");this.on=e,this.method=r,this.arguments_=n}write(e){this.on.write(e),e.write("."),e.write(this.method),e.write("("),this.arguments_.length>1?(e.indent(),e.newLine(),this.arguments_.forEach((r,n)=>{n>0&&(e.write(","),e.newLine()),r.write(e)}),e.newLine(),e.dedent()):this.arguments_.forEach((r,n)=>{n>0&&e.write(", "),r.write(e)}),e.write(")")}};l();c();var ae=class extends x{constructor({value:e}){super();u(this,"value");this.value=e}write(e){this.value.write(e)}};l();c();var ue=class extends E{constructor({name:e,type:r,optional:n,initializer:o}){super({name:e,type:r,optional:n});u(this,"initializer");this.initializer=o}write(e){e.write(this.name),this.initializer&&e.write(` = ${this.initializer.write(e)}`)}writeTypeDefinition(e){this.optional&&e.write("?"),this.type.writeTypeDefinition(e)}};l();c();var le=class extends E{write(t){t.write(`*${this.name}`)}writeTypeDefinition(t){t.write("*"),this.type.writeTypeDefinition(t)}};l();c();var ce=class i extends x{constructor(e){super();u(this,"internalType");this.internalType=e}static string(e){return new this({type:"str",value:e})}static integer(e){return new this({type:"int",value:e})}static float(e){return new this({type:"float",value:e})}static boolean(e){return new this({type:"bool",value:e})}static hash(e){return new this({type:"hash",entries:e})}static set(e){return new this({type:"set",values:e})}static list(e){return new this({type:"list",values:e})}static nop(){return new this({type:"nop"})}static nil(){return new this({type:"nil"})}static isNop(e){return e instanceof i&&e.internalType.type==="nop"}static isNil(e){return e instanceof i&&e.internalType.type==="nil"}write(e){switch(this.internalType.type){case"str":{this.internalType.value.includes("'")?e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`):e.write(`'${this.internalType.value}'`);break}case"int":{e.write(this.internalType.value.toString());break}case"float":{e.write(this.internalType.value.toString());break}case"bool":{e.write(this.internalType.value?"true":"false");break}case"hash":{let r=this.internalType.entries.filter(n=>!i.isNop(n.key)&&!i.isNop(n.value));if(r.length===0){e.write("{}");break}e.write(`{
|
|
15
|
+
`),r.forEach((n,o)=>{o>0&&e.writeLine(","),e.indent();let s=!1;if(n.key instanceof i&&n.key.internalType.type==="str"){let f=n.key.internalType.value;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(f)&&(e.write(`${f}:`),s=!0)}s||(n.key.write(e),e.write(":")),n.value.write(e),e.dedent()}),e.write(`
|
|
16
|
+
}`);break}case"set":{let r=this.internalType.values.filter(n=>!i.isNop(n));if(r.length===0){e.write("Set.new([])");break}e.write("Set.new(["),r.forEach((n,o)=>{o>0&&e.write(", "),n.write(e)}),e.write("])");break}case"list":{let r=this.internalType.values.filter(n=>!i.isNop(n));if(r.length===0){e.write("[]");break}e.write("["),r.forEach((n,o)=>{o>0&&e.write(", "),n.write(e)}),e.write("]");break}case"nop":break;case"nil":e.write("nil");break;default:T(this.internalType)}}};l();c();var Re;(function(i){i[i.Invariant=0]="Invariant",i.Covariant="out",i.Contravariant="in"})(Re||(Re={}));var q=class extends x{constructor({name:e,unchecked:r,bound:n,variance:o,defaultType:s}){super();u(this,"name");u(this,"unchecked");u(this,"bound");u(this,"variance");u(this,"defaultType");this.name=e,this.unchecked=r!=null?r:!1,this.bound=n,this.variance=o!=null?o:Re.Invariant,this.defaultType=s}write(e){}writeTypeDefinition(e){this.unchecked&&e.write("unchecked "),this.variance!=Re.Invariant&&e.write(`${this.variance} `),e.write(this.name),this.bound&&(e.write(" < "),this.bound.writeTypeDefinition(e)),this.defaultType&&(e.write(" = "),this.defaultType.writeTypeDefinition(e))}};l();c();var fe=class extends E{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`&${this.name}`)}};function vr(i){return new W(i)}var Tr={positional(i){return new ue(i)},keyword(i){return new oe(i)},positionalSplat(i){return new le(i)},keywordSplat(i){return new se(i)},yield(i){return new fe(i)}};function Er(i){return new Y(i)}function Ar(i){return new $(i)}function Rr(i){return new G(i)}function br(i){return new S(i)}function Nr(i){return new q(i)}function Ir(i){return new O(i)}function Sr(i){return new V(i)}function Cr(i){return new z(i)}function Lr(i){return new j(i)}function kr(i){return new ae(i)}l();c();var be=class{constructor({context:t}){u(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?h.TypeLiteral.nil():(this.context.errors.add({severity:g.Critical,message:"Expected non-null value, but got null"}),h.TypeLiteral.nop());if(t.value===void 0)return h.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literalType:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?h.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"nullable":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return h.TypeLiteral.nop();default:T(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?h.TypeLiteral.nop():h.TypeLiteral.string(r)}default:T(t)}}convertList({list:t,value:e}){return Array.isArray(e)?h.TypeLiteral.list(e.map((r,n)=>{this.context.errors.scope({index:n});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})):(this.context.errors.add({severity:g.Critical,message:`Expected array but got: ${typeof e}`}),h.TypeLiteral.nop())}convertSet({set:t,value:e}){return Array.isArray(e)?h.TypeLiteral.set(e.map((r,n)=>{this.context.errors.scope({index:n});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})):(this.context.errors.add({severity:g.Critical,message:`Expected array but got: ${typeof e}`}),h.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:g.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),h.TypeLiteral.nop()):h.TypeLiteral.hash(Object.entries(e).map(([r,n])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"key"}),value:this.convert({typeReference:t.value,value:n})}}finally{this.context.errors.unscope()}}))}convertNamed({named:t,value:e,as:r}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r});case"discriminatedUnion":return h.TypeLiteral.nop();case"object":return this.convertObject({object:t,value:e});case"enum":return h.TypeLiteral.nop();case"undiscriminatedUnion":return h.TypeLiteral.nop();default:T(t)}}convertPrimitive({primitive:t,value:e,as:r}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let n=this.getValueAsNumber({value:e,as:r});return n==null?h.TypeLiteral.nop():h.TypeLiteral.integer(n)}case"FLOAT":case"DOUBLE":{let n=this.getValueAsNumber({value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.float(n)}case"BOOLEAN":{let n=this.getValueAsBoolean({value:e,as:r});return n==null?h.TypeLiteral.nop():h.TypeLiteral.boolean(n)}case"BASE_64":case"BIG_INTEGER":case"STRING":{let n=this.context.getValueAsString({value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.string(n)}case"UUID":{let n=this.context.getValueAsString({value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.string(n)}case"DATE":{let n=this.context.getValueAsString({value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.string(n)}case"DATE_TIME":{let n=this.context.getValueAsString({value:e});return n==null?h.TypeLiteral.nop():h.TypeLiteral.string(n)}default:T(t)}}convertObject({object:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:g.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),h.TypeLiteral.nop()):h.TypeLiteral.hash(Object.entries(e).map(([r,n])=>{var p;this.context.errors.scope(r);let o=t.properties.find(d=>d.name.wireValue===r),s=(p=o==null?void 0:o.typeReference)!=null?p:{type:"unknown"},f={key:h.TypeLiteral.string(r),value:this.convert({typeReference:s,value:n})};return this.context.errors.unscope(),f}))}getValueAsNumber({value:t,as:e}){let r=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:t,as:e}){let r=e==="key"?typeof t=="string"?t==="true":!!t:t;return this.context.getValueAsBoolean({value:r})}};var Be=class i extends ne{constructor({ir:e,config:r}){super({ir:e,config:r});u(this,"ir");u(this,"customConfig");u(this,"dynamicTypeLiteralMapper");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeLiteralMapper=new be({context:this})}clone(){return new i({ir:this.ir,config:this.config})}getRootClientClassReference(){return h.classReference({name:this.getRootClientClassName(),modules:[this.getRootModuleName()]})}getRootClientClassName(){return"Client"}getRootModuleName(){var e,r;return(r=(e=this.customConfig)==null?void 0:e.clientModuleName)!=null?r:this.config.organization}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}getEnvironmentTypeReferenceFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return h.codeblock(n=>{n.writeNode(this.getEnvironmentClassReference()),n.write("::"),n.write(this.getEnumName(r))})}getEnvironmentClassReference(){return h.classReference({name:"Environment",modules:[this.getRootModuleName()]})}getEnumName(e){return this.getName(e.screamingSnakeCase.safeName)}getMethodName(e){return this.getName(e.snakeCase.safeName)}getPropertyName(e){return this.getName(e.camelCase.safeName)}getName(e){return e}};0&&(module.exports={DynamicSnippetsGeneratorContext});
|
|
17
|
+
/*! Bundled license information:
|
|
18
|
+
|
|
19
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
20
|
+
(*!
|
|
21
|
+
* The buffer module from node.js, for the browser.
|
|
22
|
+
*
|
|
23
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
24
|
+
* @license MIT
|
|
25
|
+
*)
|
|
26
|
+
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";var ue=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var et=Object.prototype.hasOwnProperty;var tt=(r,t,e)=>t in r?ue(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var ge=(r,t)=>()=>(r&&(t=r(r=0)),t);var Le=(r,t)=>{for(var e in t)ue(r,e,{get:t[e],enumerable:!0})},rt=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Xe(t))!et.call(r,n)&&n!==e&&ue(r,n,{get:()=>t[n],enumerable:!(i=Qe(t,n))||i.enumerable});return r};var it=r=>rt(ue({},"__esModule",{value:!0}),r);var u=(r,t,e)=>tt(r,typeof t!="symbol"?t+"":t,e);function be(){throw new Error("setTimeout has not been defined")}function Se(){throw new Error("clearTimeout has not been defined")}function ke(r){if(C===setTimeout)return setTimeout(r,0);if((C===be||!C)&&setTimeout)return C=setTimeout,setTimeout(r,0);try{return C(r,0)}catch(t){try{return C.call(null,r,0)}catch(e){return C.call(this,r,0)}}}function nt(r){if(B===clearTimeout)return clearTimeout(r);if((B===Se||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(r);try{return B(r)}catch(t){try{return B.call(null,r)}catch(e){return B.call(this,r)}}}function ot(){!H||!P||(H=!1,P.length?k=P.concat(k):fe=-1,k.length&&_e())}function _e(){if(!H){var r=ke(ot);H=!0;for(var t=k.length;t;){for(P=k,k=[];++fe<t;)P&&P[fe].run();fe=-1,t=k.length}P=null,H=!1,nt(r)}}function st(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];k.push(new Ce(r,t)),k.length===1&&!H&&ke(_e)}function Ce(r,t){this.fun=r,this.array=t}function D(){}function Et(r){throw new Error("process.binding is not supported")}function Rt(){return"/"}function It(r){throw new Error("process.chdir is not supported")}function Lt(){return 0}function bt(r){var t=Nt.call(J)*.001,e=Math.floor(t),i=Math.floor(t%1*1e9);return r&&(e=e-r[0],i=i-r[1],i<0&&(e--,i+=1e9)),[e,i]}function kt(){var r=new Date,t=r-St;return t/1e3}var C,B,k,H,P,fe,at,ut,ft,ct,lt,ht,pt,mt,wt,yt,xt,dt,Tt,gt,vt,At,J,Nt,St,w,Ne,f=ge(()=>{"use strict";C=be,B=Se;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(B=clearTimeout);k=[],H=!1,fe=-1;Ce.prototype.run=function(){this.fun.apply(null,this.array)};at="browser",ut="browser",ft=!0,ct={},lt=[],ht="",pt={},mt={},wt={};yt=D,xt=D,dt=D,Tt=D,gt=D,vt=D,At=D;J=globalThis.performance||{},Nt=J.now||J.mozNow||J.msNow||J.oNow||J.webkitNow||function(){return new Date().getTime()};St=new Date;w={nextTick:st,title:at,browser:ft,env:ct,argv:lt,version:ht,versions:pt,on:yt,addListener:xt,once:dt,off:Tt,removeListener:gt,removeAllListeners:vt,emit:At,binding:Et,cwd:Rt,chdir:It,umask:Lt,hrtime:bt,platform:ut,release:mt,config:wt,uptime:kt},Ne={};Object.keys(Ne).forEach(r=>{let t=r.split("."),e=w;for(let i=0;i<t.length;i++){let n=t[i];i===t.length-1?e[n]=Ne[r]:e=e[n]||(e[n]={})}})});function Ue(){Ae=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)N[t]=r[t],E[r.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Ct(r){Ae||Ue();var t,e,i,n,o,s,l=r.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[l-2]==="="?2:r[l-1]==="="?1:0,s=new _t(l*3/4-o),i=o>0?l-4:l;var h=0;for(t=0,e=0;t<i;t+=4,e+=3)n=E[r.charCodeAt(t)]<<18|E[r.charCodeAt(t+1)]<<12|E[r.charCodeAt(t+2)]<<6|E[r.charCodeAt(t+3)],s[h++]=n>>16&255,s[h++]=n>>8&255,s[h++]=n&255;return o===2?(n=E[r.charCodeAt(t)]<<2|E[r.charCodeAt(t+1)]>>4,s[h++]=n&255):o===1&&(n=E[r.charCodeAt(t)]<<10|E[r.charCodeAt(t+1)]<<4|E[r.charCodeAt(t+2)]>>2,s[h++]=n>>8&255,s[h++]=n&255),s}function Bt(r){return N[r>>18&63]+N[r>>12&63]+N[r>>6&63]+N[r&63]}function Pt(r,t,e){for(var i,n=[],o=t;o<e;o+=3)i=(r[o]<<16)+(r[o+1]<<8)+r[o+2],n.push(Bt(i));return n.join("")}function Be(r){Ae||Ue();for(var t,e=r.length,i=e%3,n="",o=[],s=16383,l=0,h=e-i;l<h;l+=s)o.push(Pt(r,l,l+s>h?h:l+s));return i===1?(t=r[e-1],n+=N[t>>2],n+=N[t<<4&63],n+="=="):i===2&&(t=(r[e-2]<<8)+r[e-1],n+=N[t>>10],n+=N[t>>4&63],n+=N[t<<2&63],n+="="),o.push(n),o.join("")}function ce(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function _(r,t){if(ce()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=a.prototype):(r===null&&(r=new a(t)),r.length=t),r}function a(r,t,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Ee(this,r)}return Me(this,r,t,e)}function Me(r,t,e,i){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Mt(r,t,e,i):typeof t=="string"?Ut(r,t,e):Yt(r,t)}function Ye(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Dt(r,t,e,i){return Ye(t),t<=0?_(r,t):e!==void 0?typeof i=="string"?_(r,t).fill(e,i):_(r,t).fill(e):_(r,t)}function Ee(r,t){if(Ye(t),r=_(r,t<0?0:Re(t)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Ut(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=Fe(t,e)|0;r=_(r,i);var n=r.write(t,e);return n!==i&&(r=r.slice(0,n)),r}function ve(r,t){var e=t.length<0?0:Re(t.length)|0;r=_(r,e);for(var i=0;i<e;i+=1)r[i]=t[i]&255;return r}function Mt(r,t,e,i){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?t=new Uint8Array(t):i===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,i),a.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=a.prototype):r=ve(r,t),r}function Yt(r,t){if(b(t)){var e=Re(t.length)|0;return r=_(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||ir(t.length)?_(r,0):ve(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return ve(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Re(r){if(r>=ce())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ce().toString(16)+" bytes");return r|0}function b(r){return!!(r!=null&&r._isBuffer)}function Fe(r,t){if(b(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return le(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return qe(r).length;default:if(i)return le(r).length;t=(""+t).toLowerCase(),i=!0}}function Ft(r,t,e){var i=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Jt(this,t,e);case"utf8":case"utf-8":return We(this,t,e);case"ascii":return jt(this,t,e);case"latin1":case"binary":return Kt(this,t,e);case"base64":return Gt(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ht(this,t,e);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}function U(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}function $e(r,t,e,i,n){if(r.length===0)return-1;if(typeof e=="string"?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(n)return-1;e=r.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof t=="string"&&(t=a.from(t,i)),b(t))return t.length===0?-1:Pe(r,t,e,i,n);if(typeof t=="number")return t=t&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Pe(r,[t],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Pe(r,t,e,i,n){var o=1,s=r.length,l=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,l/=2,e/=2}function h(A,K){return o===1?A[K]:A.readUInt16BE(K*o)}var m;if(n){var x=-1;for(m=e;m<s;m++)if(h(r,m)===h(t,x===-1?0:m-x)){if(x===-1&&(x=m),m-x+1===l)return x*o}else x!==-1&&(m-=m-x),x=-1}else for(e+l>s&&(e=s-l),m=e;m>=0;m--){for(var y=!0,R=0;R<l;R++)if(h(r,m+R)!==h(t,R)){y=!1;break}if(y)return m}return-1}function $t(r,t,e,i){e=Number(e)||0;var n=r.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var l=parseInt(t.substr(s*2,2),16);if(isNaN(l))return s;r[e+s]=l}return s}function Ot(r,t,e,i){return me(le(t,r.length-e),r,e,i)}function Oe(r,t,e,i){return me(tr(t),r,e,i)}function Wt(r,t,e,i){return Oe(r,t,e,i)}function Vt(r,t,e,i){return me(qe(t),r,e,i)}function zt(r,t,e,i){return me(rr(t,r.length-e),r,e,i)}function Gt(r,t,e){return t===0&&e===r.length?Be(r):Be(r.slice(t,e))}function We(r,t,e){e=Math.min(r.length,e);for(var i=[],n=t;n<e;){var o=r[n],s=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=e){var h,m,x,y;switch(l){case 1:o<128&&(s=o);break;case 2:h=r[n+1],(h&192)===128&&(y=(o&31)<<6|h&63,y>127&&(s=y));break;case 3:h=r[n+1],m=r[n+2],(h&192)===128&&(m&192)===128&&(y=(o&15)<<12|(h&63)<<6|m&63,y>2047&&(y<55296||y>57343)&&(s=y));break;case 4:h=r[n+1],m=r[n+2],x=r[n+3],(h&192)===128&&(m&192)===128&&(x&192)===128&&(y=(o&15)<<18|(h&63)<<12|(m&63)<<6|x&63,y>65535&&y<1114112&&(s=y))}}s===null?(s=65533,l=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=l}return qt(i)}function qt(r){var t=r.length;if(t<=De)return String.fromCharCode.apply(String,r);for(var e="",i=0;i<t;)e+=String.fromCharCode.apply(String,r.slice(i,i+=De));return e}function jt(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]&127);return i}function Kt(r,t,e){var i="";e=Math.min(r.length,e);for(var n=t;n<e;++n)i+=String.fromCharCode(r[n]);return i}function Jt(r,t,e){var i=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=t;o<e;++o)n+=er(r[o]);return n}function Ht(r,t,e){for(var i=r.slice(t,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}function T(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function v(r,t,e,i,n,o){if(!b(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(e+i>r.length)throw new RangeError("Index out of range")}function he(r,t,e,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(r.length-e,2);n<o;++n)r[e+n]=(t&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}function pe(r,t,e,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(r.length-e,4);n<o;++n)r[e+n]=t>>>(i?n:3-n)*8&255}function Ve(r,t,e,i,n,o){if(e+i>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ze(r,t,e,i,n){return n||Ve(r,t,e,4,34028234663852886e22,-34028234663852886e22),Ke(r,t,e,i,23,4),e+4}function Ge(r,t,e,i,n){return n||Ve(r,t,e,8,17976931348623157e292,-17976931348623157e292),Ke(r,t,e,i,52,8),e+8}function Qt(r){if(r=Xt(r).replace(Zt,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Xt(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function er(r){return r<16?"0"+r.toString(16):r.toString(16)}function le(r,t){t=t||1/0;for(var e,i=r.length,n=null,o=[],s=0;s<i;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function tr(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function rr(r,t){for(var e,i,n,o=[],s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function qe(r){return Ct(Qt(r))}function me(r,t,e,i){for(var n=0;n<i&&!(n+e>=t.length||n>=r.length);++n)t[n+e]=r[n];return n}function ir(r){return r!==r}function nr(r){return r!=null&&(!!r._isBuffer||je(r)||or(r))}function je(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function or(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&je(r.slice(0,0))}function we(r,t,e,i,n){var o,s,l=n*8-i-1,h=(1<<l)-1,m=h>>1,x=-7,y=e?n-1:0,R=e?-1:1,A=r[t+y];for(y+=R,o=A&(1<<-x)-1,A>>=-x,x+=l;x>0;o=o*256+r[t+y],y+=R,x-=8);for(s=o&(1<<-x)-1,o>>=-x,x+=i;x>0;s=s*256+r[t+y],y+=R,x-=8);if(o===0)o=1-m;else{if(o===h)return s?NaN:(A?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-m}return(A?-1:1)*s*Math.pow(2,o-i)}function Ke(r,t,e,i,n,o){var s,l,h,m=o*8-n-1,x=(1<<m)-1,y=x>>1,R=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:o-1,K=i?1:-1,Ze=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=x):(s=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-s))<1&&(s--,h*=2),s+y>=1?t+=R/h:t+=R*Math.pow(2,1-y),t*h>=2&&(s++,h/=2),s+y>=x?(l=0,s=x):s+y>=1?(l=(t*h-1)*Math.pow(2,n),s=s+y):(l=t*Math.pow(2,y-1)*Math.pow(2,n),s=0));n>=8;r[e+A]=l&255,A+=K,l/=256,n-=8);for(s=s<<n|l,m+=n;m>0;r[e+A]=s&255,A+=K,s/=256,m-=8);r[e+A-K]|=Ze*128}var N,E,_t,Ae,De,Zt,Je=ge(()=>{"use strict";f();c();N=[],E=[],_t=typeof Uint8Array!="undefined"?Uint8Array:Array,Ae=!1;a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;a.poolSize=8192;a._augment=function(r){return r.__proto__=a.prototype,r};a.from=function(r,t,e){return Me(null,r,t,e)};a.kMaxLength=ce();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&a[Symbol.species]);a.alloc=function(r,t,e){return Dt(null,r,t,e)};a.allocUnsafe=function(r){return Ee(null,r)};a.allocUnsafeSlow=function(r){return Ee(null,r)};a.isBuffer=nr;a.compare=function(t,e){if(!b(t)||!b(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,o=0,s=Math.min(i,n);o<s;++o)if(t[o]!==e[o]){i=t[o],n=e[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var i;if(e===void 0)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<t.length;++i){var s=t[i];if(!b(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n};a.byteLength=Fe;a.prototype._isBuffer=!0;a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)U(this,e,e+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)U(this,e,e+3),U(this,e+1,e+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)U(this,e,e+7),U(this,e+1,e+6),U(this,e+2,e+5),U(this,e+3,e+4);return this};a.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?We(this,0,t):Ft.apply(this,arguments)};a.prototype.equals=function(t){if(!b(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.compare=function(t,e,i,n,o){if(!b(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=t?t.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var s=o-n,l=i-e,h=Math.min(s,l),m=this.slice(n,o),x=t.slice(e,i),y=0;y<h;++y)if(m[y]!==x[y]){s=m[y],l=x[y];break}return s<l?-1:l<s?1:0};a.prototype.includes=function(t,e,i){return this.indexOf(t,e,i)!==-1};a.prototype.indexOf=function(t,e,i){return $e(this,t,e,i,!0)};a.prototype.lastIndexOf=function(t,e,i){return $e(this,t,e,i,!1)};a.prototype.write=function(t,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return $t(this,t,e,i);case"utf8":case"utf-8":return Ot(this,t,e,i);case"ascii":return Oe(this,t,e,i);case"latin1":case"binary":return Wt(this,t,e,i);case"base64":return Vt(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zt(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};De=4096;a.prototype.slice=function(t,e){var i=this.length;t=~~t,e=e===void 0?i:~~e,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<t&&(e=t);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=a.prototype;else{var o=e-t;n=new a(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+t]}return n};a.prototype.readUIntLE=function(t,e,i){t=t|0,e=e|0,i||T(t,e,this.length);for(var n=this[t],o=1,s=0;++s<e&&(o*=256);)n+=this[t+s]*o;return n};a.prototype.readUIntBE=function(t,e,i){t=t|0,e=e|0,i||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n};a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,e,i){t=t|0,e=e|0,i||T(t,e,this.length);for(var n=this[t],o=1,s=0;++s<e&&(o*=256);)n+=this[t+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(t,e,i){t=t|0,e=e|0,i||T(t,e,this.length);for(var n=e,o=1,s=this[t+--n];n>0&&(o*=256);)s+=this[t+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s};a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),we(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),we(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),we(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),we(this,t,!1,52,8)};a.prototype.writeUIntLE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;v(this,t,e,i,o,0)}var s=1,l=0;for(this[e]=t&255;++l<i&&(s*=256);)this[e+l]=t/s&255;return e+i};a.prototype.writeUIntBE=function(t,e,i,n){if(t=+t,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;v(this,t,e,i,o,0)}var s=i-1,l=1;for(this[e+s]=t&255;--s>=0&&(l*=256);)this[e+s]=t/l&255;return e+i};a.prototype.writeUInt8=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};a.prototype.writeUInt16LE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):he(this,t,e,!0),e+2};a.prototype.writeUInt16BE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):he(this,t,e,!1),e+2};a.prototype.writeUInt32LE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):pe(this,t,e,!0),e+4};a.prototype.writeUInt32BE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):pe(this,t,e,!1),e+4};a.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e=e|0,!n){var o=Math.pow(2,8*i-1);v(this,t,e,i,o-1,-o)}var s=0,l=1,h=0;for(this[e]=t&255;++s<i&&(l*=256);)t<0&&h===0&&this[e+s-1]!==0&&(h=1),this[e+s]=(t/l>>0)-h&255;return e+i};a.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e=e|0,!n){var o=Math.pow(2,8*i-1);v(this,t,e,i,o-1,-o)}var s=i-1,l=1,h=0;for(this[e+s]=t&255;--s>=0&&(l*=256);)t<0&&h===0&&this[e+s+1]!==0&&(h=1),this[e+s]=(t/l>>0)-h&255;return e+i};a.prototype.writeInt8=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};a.prototype.writeInt16LE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):he(this,t,e,!0),e+2};a.prototype.writeInt16BE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):he(this,t,e,!1),e+2};a.prototype.writeInt32LE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):pe(this,t,e,!0),e+4};a.prototype.writeInt32BE=function(t,e,i){return t=+t,e=e|0,i||v(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):pe(this,t,e,!1),e+4};a.prototype.writeFloatLE=function(t,e,i){return ze(this,t,e,!0,i)};a.prototype.writeFloatBE=function(t,e,i){return ze(this,t,e,!1,i)};a.prototype.writeDoubleLE=function(t,e,i){return Ge(this,t,e,!0,i)};a.prototype.writeDoubleBE=function(t,e,i){return Ge(this,t,e,!1,i)};a.prototype.copy=function(t,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var o=n-i,s;if(this===t&&i<e&&e<n)for(s=o-1;s>=0;--s)t[s+e]=this[s+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o};a.prototype.fill=function(t,e,i,n){if(typeof t=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var s;if(typeof t=="number")for(s=e;s<i;++s)this[s]=t;else{var l=b(t)?t:le(new a(t,n).toString()),h=l.length;for(s=0;s<i-e;++s)this[s+e]=l[s%h]}return this};Zt=/[^+\/0-9A-Za-z-_]/g});var c=ge(()=>{"use strict";Je()});var Tr={};Le(Tr,{DynamicTypeLiteralMapper:()=>Ie});module.exports=it(Tr);f();c();f();c();f();c();function S(r){throw new Error("Unexpected value: "+JSON.stringify(r))}f();c();f();c();var M=class{};f();c();f();c();var I=class extends M{constructor(e){super();u(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var sr=4,X=class{constructor(){u(this,"buffer","");u(this,"indentLevel",0);u(this,"hasWrittenAnything",!1);u(this,"lastCharacterIsSemicolon",!1);u(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
2
|
+
`),i=e?t.substring(0,t.length-1):t,n=this.getIndentString(),o=i.replaceAll(`
|
|
3
|
+
`,`
|
|
4
|
+
${n}`);this.isAtStartOfLine()&&(o=n+o),e&&(o+=`
|
|
5
|
+
`),this.writeInternal(o)}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new I(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new I(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}controlFlowWithoutStatement(t){new I(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new I(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new I(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
6
|
+
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
7
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:i}){if(t.length>0){let n=t[0];n!=null&&i(n);for(let o=1;o<t.length;o++){this.write(e);let s=t[o];s!=null&&i(s)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
8
|
+
`),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*sr)}};f();c();var ye=class{formatMultiple(t){return Promise.all(t.map(e=>this.format(e)))}formatMultipleSync(t){return t.map(e=>this.formatSync(e))}},ee=class extends ye{async format(t){return t}formatSync(t){return t}};f();c();f();c();var Y={Critical:"CRITICAL",Warning:"WARNING"};f();c();var p={};Le(p,{AstNode:()=>d,ClassInstantiation:()=>O,ClassReference:()=>W,CodeBlock:()=>V,KeywordArgument:()=>z,Method:()=>G,MethodInvocation:()=>q,Parameter:()=>g,TypeLiteral:()=>se,TypeParameter:()=>j,classReference:()=>mr,class_:()=>fr,codeblock:()=>ar,comment:()=>hr,instantiateClass:()=>wr,invokeMethod:()=>xr,keywordArgument:()=>yr,method:()=>lr,module:()=>cr,parameters:()=>ur,positionalArgument:()=>dr,typeParameter:()=>pr});f();c();f();c();f();c();f();c();f();c();f();c();f();c();var xe=class extends X{constructor({customConfig:e,formatter:i}){super();u(this,"customConfig");u(this,"formatter");u(this,"requires",new Set);this.customConfig=e,this.formatter=i!=null?i:new ee}addRequire(e){this.requires.add(e)}};var Z=class extends xe{constructor({customConfig:t,formatter:e}){super({customConfig:t,formatter:e})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Ruby file: ${e}
|
|
9
|
+
${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Ruby file: ${e}
|
|
10
|
+
${t}`)}return t}getContent(){let t=this.stringifyRequires();return t.length>0?`${t}
|
|
11
|
+
|
|
12
|
+
${this.buffer}`:this.buffer}stringifyRequires(){return Array.from(this.requires).map(t=>`require "${t}"`).join(`
|
|
13
|
+
`)}};var d=class extends M{async toStringAsync({customConfig:t,formatter:e}){let i=new Z({customConfig:t,formatter:e});return this.write(i),i.toStringAsync()}toString({customConfig:t,formatter:e}){let i=new Z({customConfig:t,formatter:e});return this.write(i),i.toString()}typeDefinitionToString({customConfig:t,formatter:e}){let i=new Z({customConfig:t,formatter:e});return this.writeTypeDefinition(i),i.toString()}writeTypeDefinition(t){}};var L=class extends d{constructor({docs:e}){super();u(this,"docs");this.docs=e}write(e){this.docs!=null&&this.docs.split(`
|
|
14
|
+
`).forEach(i=>{e.writeLine(`# ${i}`)})}};f();c();var F=class r extends d{constructor({name:e,namespace:i,typeParameters:n,docstring:o,statements:s}){super();u(this,"name");u(this,"namespace");u(this,"typeParameters");u(this,"docstring");u(this,"statements");this.name=e,this.namespace=i!=null?i:new Set,this.typeParameters=n!=null?n:[],this.docstring=o,this.statements=s!=null?s:[],this.populateChildNamespaces()}write(e){this.docstring&&new L({docs:this.docstring}).write(e),e.write(`module ${this.name}`),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((i,n)=>{i.write(e),n<this.statements.length-1&&e.newLine()}),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`module ${this.name}`),this.typeParameters.length&&(e.write("["),e.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:i=>i.writeTypeDefinition(e)}),e.write("]")),e.newLine(),this.statements.length&&(e.indent(),this.statements.forEach(i=>{i.writeTypeDefinition(e),e.newLine()}),e.dedent()),e.write("end")}populateChildNamespaces(){this.statements.filter(e=>e instanceof r||e instanceof $).forEach(e=>{e.namespace=new Set([...this.namespace,this]),e.populateChildNamespaces()})}get fullyQualifiedNamespace(){return[...this.namespace,this].map(e=>e.name).join("::")}};var $=class extends F{constructor({name:e,superclass:i,typeParameters:n,docstring:o,statements:s}){super({name:e,docstring:o,typeParameters:n});u(this,"superclass");u(this,"statements");this.superclass=i,this.statements=s!=null?s:[]}write(e){this.docstring&&new L({docs:this.docstring}).write(e),e.write(`class ${this.name}`),this.superclass&&e.write(` < ${this.superclass.name}`),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((i,n)=>{i.write(e),n<this.statements.length-1&&e.newLine()}),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`class ${this.name}`),this.typeParameters.length&&(e.write("["),e.delimit({nodes:this.typeParameters,delimiter:", ",writeFunction:i=>i.writeTypeDefinition(e)}),e.write("]")),this.superclass&&e.write(` < ${this.superclass.name}`),e.newLine(),this.statements.length&&(e.indent(),this.statements.forEach(i=>{i.writeTypeDefinition(e),e.newLine()}),e.dedent()),e.write("end")}};f();c();var O=class extends d{constructor({classReference:e,arguments_:i}){super();u(this,"classReference");u(this,"arguments_");this.classReference=e,this.arguments_=i}write(e){e.writeNode(this.classReference),e.write("."),e.write("new"),e.write("("),this.arguments_.length>1?(e.indent(),e.newLine(),this.arguments_.forEach((i,n)=>{n>0&&(e.write(","),e.newLine()),i.write(e)}),e.newLine(),e.dedent()):this.arguments_.forEach((i,n)=>{n>0&&e.write(", "),i.write(e)}),e.write(")")}};f();c();var W=class extends d{constructor({name:e,modules:i,fullyQualified:n}){super();u(this,"name");u(this,"modules");u(this,"fullyQualified");this.name=e,this.modules=i!=null?i:[],this.fullyQualified=n!=null?n:!1}write(e){if(this.fullyQualified||this.modules.length>0){let i=[...this.modules,this.name].join("::");e.write(i);return}e.write(this.name)}};f();c();var V=class extends d{constructor(e){super();u(this,"arg");this.arg=e}write(e){return new I(this.arg).write(e)}};f();c();var z=class extends d{constructor({name:e,value:i}){super();u(this,"name");u(this,"value");this.name=e,this.value=i}write(e){e.write(`${this.name}: `),this.value.write(e)}};f();c();f();c();f();c();var Q=class r extends d{constructor(e){super();u(this,"internalType");this.internalType=e}write(e){}writeTypeDefinition(e){if(this.internalType)switch(this.internalType.type){case"self":e.write("self");break;case"class":e.write("class");break;case"instance":e.write("instance");break;case"boolean":e.write("bool");break;case"nil":e.write("nil");break;case"top":e.write("top");break;case"bot":e.write("bot");break;case"void":e.write("void");break;case"boolish":e.write("boolish");break;case"string":e.write("String");break;case"integer":e.write("Integer");break;case"union":e.delimit({nodes:this.internalType.elems,delimiter:" | ",writeFunction:i=>i.writeTypeDefinition(e)});break;case"intersection":e.delimit({nodes:this.internalType.elems,delimiter:" & ",writeFunction:i=>i.writeTypeDefinition(e)});break;case"array":e.write("Array["),this.internalType.elem.writeTypeDefinition(e),e.write("]");break;case"hash":e.write("Hash["),this.internalType.keyType.writeTypeDefinition(e),e.write(", "),this.internalType.valueType.writeTypeDefinition(e),e.write("]");break;case"object":e.write(this.internalType.klass);break;case"singleton":e.write("singleton("),e.write(this.internalType.klass),e.write(")");break;case"tuple":e.write("["),e.delimit({nodes:this.internalType.elems,delimiter:", ",writeFunction:i=>i.write(e)}),e.write("]");break;case"generic":e.write(`${this.internalType.baseKlass}[`),e.delimit({nodes:this.internalType.parameters,delimiter:", ",writeFunction:i=>i.writeTypeDefinition(e)}),e.write("]");break;default:S(this.internalType)}else e.write("untyped")}static untyped(){return new this(void 0)}static self(){return new this({type:"self"})}static class_(){return new this({type:"class"})}static instance(){return new this({type:"instance"})}static boolean(){return new this({type:"boolean"})}static nil(){return new this({type:"nil"})}static top(){return new this({type:"top"})}static bot(){return new this({type:"bot"})}static void(){return new this({type:"void"})}static boolish(){return new this({type:"boolish"})}static string(){return new this({type:"string"})}static integer(){return new this({type:"integer"})}static union(e){return new this({type:"union",elems:e})}static intersection(e){return new this({type:"intersection",elems:e})}static array(e){return new this({type:"array",elem:e})}static hash(e,i){return new this({type:"hash",keyType:e,valueType:i})}static object(e){return new this({type:"object",klass:e})}static singleton(e){return new this({type:"singleton",klass:e})}static tuple(e){return new this({type:"tuple",elems:e})}static generic(e,i){return new this({type:"generic",baseKlass:e,parameters:i})}static nilable(e){return r.union([e,r.nil()])}nilable(){return r.nilable(this)}};var g=class extends d{constructor({name:e,type:i,optional:n}){super();u(this,"name");u(this,"type");u(this,"optional");this.name=e,this.type=i!=null?i:Q.untyped(),this.optional=n!=null?n:!1}};var te=class extends g{constructor({name:e,type:i,initializer:n,optional:o}){super({name:e,type:i,optional:o});u(this,"initializer");this.initializer=n}write(e){e.write(`${this.name}:`),this.initializer&&e.write(` ${this.initializer.write(e)}`)}writeTypeDefinition(e){this.optional&&e.write("?"),e.write(`${this.name}: `),this.type.writeTypeDefinition(e)}};f();c();var re=class extends g{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`**${this.name}`)}writeTypeDefinition(e){e.write("**"),this.type.writeTypeDefinition(e)}};f();c();var de={Instance:"instance",Class_:"class"},He={Public:"public",Private:"private",Protected:"protected"},G=class extends d{constructor({name:e,docstring:i,kind:n,visibility:o,parameters:s,returnType:l}){var h,m;super();u(this,"name");u(this,"docstring");u(this,"kind");u(this,"positionalParameters");u(this,"keywordParameters");u(this,"positionalSplatParameter");u(this,"keywordSplatParameter");u(this,"yieldParameter");u(this,"visibility");u(this,"statements",[]);u(this,"returnType");this.name=e,this.docstring=i,this.kind=n!=null?n:de.Instance,this.visibility=o!=null?o:He.Public,this.positionalParameters=(h=s==null?void 0:s.positional)!=null?h:[],this.keywordParameters=(m=s==null?void 0:s.keyword)!=null?m:[],this.positionalSplatParameter=s==null?void 0:s.positionalSplat,this.keywordSplatParameter=s==null?void 0:s.keywordSplat,this.yieldParameter=s==null?void 0:s.yield,this.returnType=l!=null?l:Q.untyped()}write(e){switch(this.docstring&&new L({docs:this.docstring}).write(e),this.visibility!==He.Public&&(e.write(this.visibility),this.kind===de.Class_&&e.write("_class_method"),e.write(" ")),this.kind){case de.Instance:e.write(`def ${this.name}`);break;case de.Class_:e.write(`def self.${this.name}`);break}this.parameters.length&&(e.write("("),e.delimit({nodes:this.parameters,delimiter:", ",writeFunction:i=>i.write(e)}),e.write(")")),this.statements.length?(e.newLine(),e.indent(),this.statements.forEach((i,n)=>{i.write(e),n<this.statements.length-1&&e.newLine()}),e.dedent(),e.write("end")):e.write("; end"),e.newLine()}writeTypeDefinition(e){e.write(`def ${this.name}: (`),this.parameters.forEach((i,n)=>{i.writeTypeDefinition(e),n<this.parameters.length-1&&e.write(", ")}),e.write(") -> "),this.returnType.writeTypeDefinition(e)}get parameters(){return[...this.positionalParameters,...this.keywordParameters,this.positionalSplatParameter,this.keywordSplatParameter,this.yieldParameter].flatMap(e=>e!==void 0?e:[])}};f();c();var q=class extends d{constructor({on:e,method:i,arguments_:n}){super();u(this,"on");u(this,"method");u(this,"arguments_");this.on=e,this.method=i,this.arguments_=n}write(e){this.on.write(e),e.write("."),e.write(this.method),e.write("("),this.arguments_.length>1?(e.indent(),e.newLine(),this.arguments_.forEach((i,n)=>{n>0&&(e.write(","),e.newLine()),i.write(e)}),e.newLine(),e.dedent()):this.arguments_.forEach((i,n)=>{n>0&&e.write(", "),i.write(e)}),e.write(")")}};f();c();var ie=class extends d{constructor({value:e}){super();u(this,"value");this.value=e}write(e){this.value.write(e)}};f();c();var ne=class extends g{constructor({name:e,type:i,optional:n,initializer:o}){super({name:e,type:i,optional:n});u(this,"initializer");this.initializer=o}write(e){e.write(this.name),this.initializer&&e.write(` = ${this.initializer.write(e)}`)}writeTypeDefinition(e){this.optional&&e.write("?"),this.type.writeTypeDefinition(e)}};f();c();var oe=class extends g{write(t){t.write(`*${this.name}`)}writeTypeDefinition(t){t.write("*"),this.type.writeTypeDefinition(t)}};f();c();var se=class r extends d{constructor(e){super();u(this,"internalType");this.internalType=e}static string(e){return new this({type:"str",value:e})}static integer(e){return new this({type:"int",value:e})}static float(e){return new this({type:"float",value:e})}static boolean(e){return new this({type:"bool",value:e})}static hash(e){return new this({type:"hash",entries:e})}static set(e){return new this({type:"set",values:e})}static list(e){return new this({type:"list",values:e})}static nop(){return new this({type:"nop"})}static nil(){return new this({type:"nil"})}static isNop(e){return e instanceof r&&e.internalType.type==="nop"}static isNil(e){return e instanceof r&&e.internalType.type==="nil"}write(e){switch(this.internalType.type){case"str":{this.internalType.value.includes("'")?e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`):e.write(`'${this.internalType.value}'`);break}case"int":{e.write(this.internalType.value.toString());break}case"float":{e.write(this.internalType.value.toString());break}case"bool":{e.write(this.internalType.value?"true":"false");break}case"hash":{let i=this.internalType.entries.filter(n=>!r.isNop(n.key)&&!r.isNop(n.value));if(i.length===0){e.write("{}");break}e.write(`{
|
|
15
|
+
`),i.forEach((n,o)=>{o>0&&e.writeLine(","),e.indent();let s=!1;if(n.key instanceof r&&n.key.internalType.type==="str"){let l=n.key.internalType.value;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(l)&&(e.write(`${l}:`),s=!0)}s||(n.key.write(e),e.write(":")),n.value.write(e),e.dedent()}),e.write(`
|
|
16
|
+
}`);break}case"set":{let i=this.internalType.values.filter(n=>!r.isNop(n));if(i.length===0){e.write("Set.new([])");break}e.write("Set.new(["),i.forEach((n,o)=>{o>0&&e.write(", "),n.write(e)}),e.write("])");break}case"list":{let i=this.internalType.values.filter(n=>!r.isNop(n));if(i.length===0){e.write("[]");break}e.write("["),i.forEach((n,o)=>{o>0&&e.write(", "),n.write(e)}),e.write("]");break}case"nop":break;case"nil":e.write("nil");break;default:S(this.internalType)}}};f();c();var Te;(function(r){r[r.Invariant=0]="Invariant",r.Covariant="out",r.Contravariant="in"})(Te||(Te={}));var j=class extends d{constructor({name:e,unchecked:i,bound:n,variance:o,defaultType:s}){super();u(this,"name");u(this,"unchecked");u(this,"bound");u(this,"variance");u(this,"defaultType");this.name=e,this.unchecked=i!=null?i:!1,this.bound=n,this.variance=o!=null?o:Te.Invariant,this.defaultType=s}write(e){}writeTypeDefinition(e){this.unchecked&&e.write("unchecked "),this.variance!=Te.Invariant&&e.write(`${this.variance} `),e.write(this.name),this.bound&&(e.write(" < "),this.bound.writeTypeDefinition(e)),this.defaultType&&(e.write(" = "),this.defaultType.writeTypeDefinition(e))}};f();c();var ae=class extends g{constructor(){super(...arguments);u(this,"initializer")}write(e){e.write(`&${this.name}`)}};function ar(r){return new V(r)}var ur={positional(r){return new ne(r)},keyword(r){return new te(r)},positionalSplat(r){return new oe(r)},keywordSplat(r){return new re(r)},yield(r){return new ae(r)}};function fr(r){return new $(r)}function cr(r){return new F(r)}function lr(r){return new G(r)}function hr(r){return new L(r)}function pr(r){return new j(r)}function mr(r){return new W(r)}function wr(r){return new O(r)}function yr(r){return new z(r)}function xr(r){return new q(r)}function dr(r){return new ie(r)}var Ie=class{constructor({context:t}){u(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?p.TypeLiteral.nil():(this.context.errors.add({severity:Y.Critical,message:"Expected non-null value, but got null"}),p.TypeLiteral.nop());if(t.value===void 0)return p.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literalType:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?p.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"nullable":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return p.TypeLiteral.nop();default:S(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let i=this.context.getValueAsBoolean({value:e});return i==null?p.TypeLiteral.nop():p.TypeLiteral.boolean(i)}case"string":{let i=this.context.getValueAsString({value:e});return i==null?p.TypeLiteral.nop():p.TypeLiteral.string(i)}default:S(t)}}convertList({list:t,value:e}){return Array.isArray(e)?p.TypeLiteral.list(e.map((i,n)=>{this.context.errors.scope({index:n});try{return this.convert({typeReference:t,value:i})}finally{this.context.errors.unscope()}})):(this.context.errors.add({severity:Y.Critical,message:`Expected array but got: ${typeof e}`}),p.TypeLiteral.nop())}convertSet({set:t,value:e}){return Array.isArray(e)?p.TypeLiteral.set(e.map((i,n)=>{this.context.errors.scope({index:n});try{return this.convert({typeReference:t,value:i})}finally{this.context.errors.unscope()}})):(this.context.errors.add({severity:Y.Critical,message:`Expected array but got: ${typeof e}`}),p.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:Y.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),p.TypeLiteral.nop()):p.TypeLiteral.hash(Object.entries(e).map(([i,n])=>{this.context.errors.scope(i);try{return{key:this.convert({typeReference:t.key,value:i,as:"key"}),value:this.convert({typeReference:t.value,value:n})}}finally{this.context.errors.unscope()}}))}convertNamed({named:t,value:e,as:i}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:i});case"discriminatedUnion":return p.TypeLiteral.nop();case"object":return this.convertObject({object:t,value:e});case"enum":return p.TypeLiteral.nop();case"undiscriminatedUnion":return p.TypeLiteral.nop();default:S(t)}}convertPrimitive({primitive:t,value:e,as:i}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let n=this.getValueAsNumber({value:e,as:i});return n==null?p.TypeLiteral.nop():p.TypeLiteral.integer(n)}case"FLOAT":case"DOUBLE":{let n=this.getValueAsNumber({value:e});return n==null?p.TypeLiteral.nop():p.TypeLiteral.float(n)}case"BOOLEAN":{let n=this.getValueAsBoolean({value:e,as:i});return n==null?p.TypeLiteral.nop():p.TypeLiteral.boolean(n)}case"BASE_64":case"BIG_INTEGER":case"STRING":{let n=this.context.getValueAsString({value:e});return n==null?p.TypeLiteral.nop():p.TypeLiteral.string(n)}case"UUID":{let n=this.context.getValueAsString({value:e});return n==null?p.TypeLiteral.nop():p.TypeLiteral.string(n)}case"DATE":{let n=this.context.getValueAsString({value:e});return n==null?p.TypeLiteral.nop():p.TypeLiteral.string(n)}case"DATE_TIME":{let n=this.context.getValueAsString({value:e});return n==null?p.TypeLiteral.nop():p.TypeLiteral.string(n)}default:S(t)}}convertObject({object:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:Y.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),p.TypeLiteral.nop()):p.TypeLiteral.hash(Object.entries(e).map(([i,n])=>{var h;this.context.errors.scope(i);let o=t.properties.find(m=>m.name.wireValue===i),s=(h=o==null?void 0:o.typeReference)!=null?h:{type:"unknown"},l={key:p.TypeLiteral.string(i),value:this.convert({typeReference:s,value:n})};return this.context.errors.unscope(),l}))}getValueAsNumber({value:t,as:e}){let i=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:i})}getValueAsBoolean({value:t,as:e}){let i=e==="key"?typeof t=="string"?t==="true":!!t:t;return this.context.getValueAsBoolean({value:i})}};0&&(module.exports={DynamicTypeLiteralMapper});
|
|
17
|
+
/*! Bundled license information:
|
|
18
|
+
|
|
19
|
+
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
20
|
+
(*!
|
|
21
|
+
* The buffer module from node.js, for the browser.
|
|
22
|
+
*
|
|
23
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
24
|
+
* @license MIT
|
|
25
|
+
*)
|
|
26
|
+
*/
|