@fern-api/php-dynamic-snippets 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- "use strict";var be=Object.defineProperty,Mr=Object.defineProperties,_r=Object.getOwnPropertyDescriptor,Or=Object.getOwnPropertyDescriptors,Dr=Object.getOwnPropertyNames,Ee=Object.getOwnPropertySymbols;var je=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;var qe=(n,t,e)=>t in n?be(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ue=(n,t)=>{for(var e in t||(t={}))je.call(t,e)&&qe(n,e,t[e]);if(Ee)for(var e of Ee(t))et.call(t,e)&&qe(n,e,t[e]);return n},fe=(n,t)=>Mr(n,Or(t));var tt=n=>typeof n=="symbol"?n:n+"",rt=(n,t)=>{var e={};for(var r in n)je.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&Ee)for(var r of Ee(n))t.indexOf(r)<0&&et.call(n,r)&&(e[r]=n[r]);return e};var ze=(n,t)=>()=>(n&&(t=n(n=0)),t);var nt=(n,t)=>{for(var e in t)be(n,e,{get:t[e],enumerable:!0})},$r=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dr(t))!je.call(n,i)&&i!==e&&be(n,i,{get:()=>t[i],enumerable:!(r=_r(t,i))||r.enumerable});return n};var Vr=n=>$r(be({},"__esModule",{value:!0}),n);var p=(n,t,e)=>qe(n,typeof t!="symbol"?t+"":t,e);function ot(){throw new Error("setTimeout has not been defined")}function at(){throw new Error("clearTimeout has not been defined")}function st(n){if(q===setTimeout)return setTimeout(n,0);if((q===ot||!q)&&setTimeout)return q=setTimeout,setTimeout(n,0);try{return q(n,0)}catch(t){try{return q.call(null,n,0)}catch(e){return q.call(this,n,0)}}}function Wr(n){if(j===clearTimeout)return clearTimeout(n);if((j===at||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(n);try{return j(n)}catch(t){try{return j.call(null,n)}catch(e){return j.call(this,n)}}}function qr(){!le||!K||(le=!1,K.length?U=K.concat(U):Ne=-1,U.length&&ut())}function ut(){if(!le){var n=st(qr);le=!0;for(var t=U.length;t;){for(K=U,U=[];++Ne<t;)K&&K[Ne].run();Ne=-1,t=U.length}K=null,le=!1,Wr(n)}}function jr(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];U.push(new ft(n,t)),U.length===1&&!le&&st(ut)}function ft(n,t){this.fun=n,this.array=t}function Q(){}function un(n){throw new Error("process.binding is not supported")}function fn(){return"/"}function pn(n){throw new Error("process.chdir is not supported")}function ln(){return 0}function dn(n){var t=cn.call(pe)*.001,e=Math.floor(t),r=Math.floor(t%1*1e9);return n&&(e=e-n[0],r=r-n[1],r<0&&(e--,r+=1e9)),[e,r]}function hn(){var n=new Date,t=n-mn;return t/1e3}var q,j,U,le,K,Ne,zr,Yr,Gr,Hr,Zr,Jr,Kr,Qr,Xr,en,tn,rn,nn,on,an,sn,pe,cn,mn,c,it,u=ze(()=>{"use strict";q=ot,j=at;typeof globalThis.setTimeout=="function"&&(q=setTimeout);typeof globalThis.clearTimeout=="function"&&(j=clearTimeout);U=[],le=!1,Ne=-1;ft.prototype.run=function(){this.fun.apply(null,this.array)};zr="browser",Yr="browser",Gr=!0,Hr={},Zr=[],Jr="",Kr={},Qr={},Xr={};en=Q,tn=Q,rn=Q,nn=Q,on=Q,an=Q,sn=Q;pe=globalThis.performance||{},cn=pe.now||pe.mozNow||pe.msNow||pe.oNow||pe.webkitNow||function(){return new Date().getTime()};mn=new Date;c={nextTick:jr,title:zr,browser:Gr,env:Hr,argv:Zr,version:Jr,versions:Kr,on:en,addListener:tn,once:rn,off:nn,removeListener:on,removeAllListeners:an,emit:sn,binding:un,cwd:fn,chdir:pn,umask:ln,hrtime:dn,platform:Yr,release:Qr,config:Xr,uptime:hn},it={};Object.keys(it).forEach(n=>{let t=n.split("."),e=c;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=it[n]:e=e[i]||(e[i]={})}})});function dt(){Ge=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)S[t]=n[t],L[n.charCodeAt(t)]=t;L[45]=62,L[95]=63}function yn(n){Ge||dt();var t,e,r,i,o,a,l=n.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[l-2]==="="?2:n[l-1]==="="?1:0,a=new xn(l*3/4-o),r=o>0?l-4:l;var m=0;for(t=0,e=0;t<r;t+=4,e+=3)i=L[n.charCodeAt(t)]<<18|L[n.charCodeAt(t+1)]<<12|L[n.charCodeAt(t+2)]<<6|L[n.charCodeAt(t+3)],a[m++]=i>>16&255,a[m++]=i>>8&255,a[m++]=i&255;return o===2?(i=L[n.charCodeAt(t)]<<2|L[n.charCodeAt(t+1)]>>4,a[m++]=i&255):o===1&&(i=L[n.charCodeAt(t)]<<10|L[n.charCodeAt(t+1)]<<4|L[n.charCodeAt(t+2)]>>2,a[m++]=i>>8&255,a[m++]=i&255),a}function gn(n){return S[n>>18&63]+S[n>>12&63]+S[n>>6&63]+S[n&63]}function wn(n,t,e){for(var r,i=[],o=t;o<e;o+=3)r=(n[o]<<16)+(n[o+1]<<8)+n[o+2],i.push(gn(r));return i.join("")}function pt(n){Ge||dt();for(var t,e=n.length,r=e%3,i="",o=[],a=16383,l=0,m=e-r;l<m;l+=a)o.push(wn(n,l,l+a>m?m:l+a));return r===1?(t=n[e-1],i+=S[t>>2],i+=S[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=S[t>>10],i+=S[t>>4&63],i+=S[t<<2&63],i+="="),o.push(i),o.join("")}function Ce(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function M(n,t){if(Ce()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return He(this,n)}return mt(this,n,t,e)}function mt(n,t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?An(n,t,e,r):typeof t=="string"?Tn(n,t,e):Rn(n,t)}function ht(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function vn(n,t,e,r){return ht(t),t<=0?M(n,t):e!==void 0?typeof r=="string"?M(n,t).fill(e,r):M(n,t).fill(e):M(n,t)}function He(n,t){if(ht(t),n=M(n,t<0?0:Ze(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function Tn(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=xt(t,e)|0;n=M(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function Ye(n,t){var e=t.length<0?0:Ze(t.length)|0;n=M(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function An(n,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),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=Ye(n,t),n}function Rn(n,t){if(F(t)){var e=Ze(t.length)|0;return n=M(n,e),n.length===0||t.copy(n,0,0,e),n}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Wn(t.length)?M(n,0):Ye(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ye(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ze(n){if(n>=Ce())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ce().toString(16)+" bytes");return n|0}function F(n){return!!(n!=null&&n._isBuffer)}function xt(n,t){if(F(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var e=n.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 Ie(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Rt(n).length;default:if(r)return Ie(n).length;t=(""+t).toLowerCase(),r=!0}}function En(n,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(n||(n="utf8");;)switch(n){case"hex":return kn(this,t,e);case"utf8":case"utf-8":return wt(this,t,e);case"ascii":return Fn(this,t,e);case"latin1":case"binary":return Bn(this,t,e);case"base64":return Pn(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Un(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function X(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function yt(n,t,e,r,i){if(n.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=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),F(t))return t.length===0?-1:lt(n,t,e,r,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):lt(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function lt(n,t,e,r,i){var o=1,a=n.length,l=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;o=2,a/=2,l/=2,e/=2}function m(A,I){return o===1?A[I]:A.readUInt16BE(I*o)}var h;if(i){var y=-1;for(h=e;h<a;h++)if(m(n,h)===m(t,y===-1?0:h-y)){if(y===-1&&(y=h),h-y+1===l)return y*o}else y!==-1&&(h-=h-y),y=-1}else for(e+l>a&&(e=a-l),h=e;h>=0;h--){for(var g=!0,b=0;b<l;b++)if(m(n,h+b)!==m(t,b)){g=!1;break}if(g)return h}return-1}function bn(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var l=parseInt(t.substr(a*2,2),16);if(isNaN(l))return a;n[e+a]=l}return a}function Nn(n,t,e,r){return Se(Ie(t,n.length-e),n,e,r)}function gt(n,t,e,r){return Se($n(t),n,e,r)}function Cn(n,t,e,r){return gt(n,t,e,r)}function In(n,t,e,r){return Se(Rt(t),n,e,r)}function Ln(n,t,e,r){return Se(Vn(t,n.length-e),n,e,r)}function Pn(n,t,e){return t===0&&e===n.length?pt(n):pt(n.slice(t,e))}function wt(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=e){var m,h,y,g;switch(l){case 1:o<128&&(a=o);break;case 2:m=n[i+1],(m&192)===128&&(g=(o&31)<<6|m&63,g>127&&(a=g));break;case 3:m=n[i+1],h=n[i+2],(m&192)===128&&(h&192)===128&&(g=(o&15)<<12|(m&63)<<6|h&63,g>2047&&(g<55296||g>57343)&&(a=g));break;case 4:m=n[i+1],h=n[i+2],y=n[i+3],(m&192)===128&&(h&192)===128&&(y&192)===128&&(g=(o&15)<<18|(m&63)<<12|(h&63)<<6|y&63,g>65535&&g<1114112&&(a=g))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=l}return Sn(r)}function Sn(n){var t=n.length;if(t<=ct)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=ct));return e}function Fn(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]&127);return r}function Bn(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]);return r}function kn(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var i="",o=t;o<e;++o)i+=Dn(n[o]);return i}function Un(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}function T(n,t,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function N(n,t,e,r,i,o){if(!F(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+r>n.length)throw new RangeError("Index out of range")}function Le(n,t,e,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(n.length-e,2);i<o;++i)n[e+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}function Pe(n,t,e,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(n.length-e,4);i<o;++i)n[e+i]=t>>>(r?i:3-i)*8&255}function vt(n,t,e,r,i,o){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Tt(n,t,e,r,i){return i||vt(n,t,e,4,34028234663852886e22,-34028234663852886e22),bt(n,t,e,r,23,4),e+4}function At(n,t,e,r,i){return i||vt(n,t,e,8,17976931348623157e292,-17976931348623157e292),bt(n,t,e,r,52,8),e+8}function _n(n){if(n=On(n).replace(Mn,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function On(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Dn(n){return n<16?"0"+n.toString(16):n.toString(16)}function Ie(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],a=0;a<r;++a){if(e=n.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=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 $n(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Vn(n,t){for(var e,r,i,o=[],a=0;a<n.length&&!((t-=2)<0);++a)e=n.charCodeAt(a),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function Rt(n){return yn(_n(n))}function Se(n,t,e,r){for(var i=0;i<r&&!(i+e>=t.length||i>=n.length);++i)t[i+e]=n[i];return i}function Wn(n){return n!==n}function qn(n){return n!=null&&(!!n._isBuffer||Et(n)||jn(n))}function Et(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function jn(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&Et(n.slice(0,0))}function Fe(n,t,e,r,i){var o,a,l=i*8-r-1,m=(1<<l)-1,h=m>>1,y=-7,g=e?i-1:0,b=e?-1:1,A=n[t+g];for(g+=b,o=A&(1<<-y)-1,A>>=-y,y+=l;y>0;o=o*256+n[t+g],g+=b,y-=8);for(a=o&(1<<-y)-1,o>>=-y,y+=r;y>0;a=a*256+n[t+g],g+=b,y-=8);if(o===0)o=1-h;else{if(o===m)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-h}return(A?-1:1)*a*Math.pow(2,o-r)}function bt(n,t,e,r,i,o){var a,l,m,h=o*8-i-1,y=(1<<h)-1,g=y>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:o-1,I=r?1:-1,Ur=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=y):(a=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-a))<1&&(a--,m*=2),a+g>=1?t+=b/m:t+=b*Math.pow(2,1-g),t*m>=2&&(a++,m/=2),a+g>=y?(l=0,a=y):a+g>=1?(l=(t*m-1)*Math.pow(2,i),a=a+g):(l=t*Math.pow(2,g-1)*Math.pow(2,i),a=0));i>=8;n[e+A]=l&255,A+=I,l/=256,i-=8);for(a=a<<i|l,h+=i;h>0;n[e+A]=a&255,A+=I,a/=256,h-=8);n[e+A-I]|=Ur*128}var S,L,xn,Ge,ct,Mn,Nt=ze(()=>{"use strict";u();f();S=[],L=[],xn=typeof Uint8Array!="undefined"?Uint8Array:Array,Ge=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return mt(null,n,t,e)};s.kMaxLength=Ce();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return vn(null,n,t,e)};s.allocUnsafe=function(n){return He(null,n)};s.allocUnsafeSlow=function(n){return He(null,n)};s.isBuffer=qn;s.compare=function(t,e){if(!F(t)||!F(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,a=Math.min(r,i);o<a;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?1:0};s.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}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!F(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};s.byteLength=xt;s.prototype._isBuffer=!0;s.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)X(this,e,e+1);return this};s.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)X(this,e,e+3),X(this,e+1,e+2);return this};s.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)X(this,e,e+7),X(this,e+1,e+6),X(this,e+2,e+5),X(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?wt(this,0,t):En.apply(this,arguments)};s.prototype.equals=function(t){if(!F(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,i,o){if(!F(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=r)return 0;if(i>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,l=r-e,m=Math.min(a,l),h=this.slice(i,o),y=t.slice(e,r),g=0;g<m;++g)if(h[g]!==y[g]){a=h[g],l=y[g];break}return a<l?-1:l<a?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return yt(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return yt(this,t,e,r,!1)};s.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=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");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return bn(this,t,e,r);case"utf8":case"utf-8":return Nn(this,t,e,r);case"ascii":return gt(this,t,e,r);case"latin1":case"binary":return Cn(this,t,e,r);case"base64":return In(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ln(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};ct=4096;s.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 i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=s.prototype;else{var o=e-t;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};s.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return i};s.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};s.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};s.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};s.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])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=e,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.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};s.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]};s.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),Fe(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),Fe(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),Fe(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),Fe(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;N(this,t,e,r,o,0)}var a=1,l=0;for(this[e]=t&255;++l<r&&(a*=256);)this[e+l]=t/a&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;N(this,t,e,r,o,0)}var a=r-1,l=1;for(this[e+a]=t&255;--a>=0&&(l*=256);)this[e+a]=t/l&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Le(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Le(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,4294967295,0),s.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};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,4294967295,0),s.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};s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);N(this,t,e,r,o-1,-o)}var a=0,l=1,m=0;for(this[e]=t&255;++a<r&&(l*=256);)t<0&&m===0&&this[e+a-1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+r};s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);N(this,t,e,r,o-1,-o)}var a=r-1,l=1,m=0;for(this[e+a]=t&255;--a>=0&&(l*=256);)t<0&&m===0&&this[e+a+1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Le(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Le(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,2147483647,-2147483648),s.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};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.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};s.prototype.writeFloatLE=function(t,e,r){return Tt(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return Tt(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return At(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return At(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var o=i-r,a;if(this===t&&r<e&&e<i)for(a=o-1;a>=0;--a)t[a+e]=this[a+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};s.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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 a;if(typeof t=="number")for(a=e;a<r;++a)this[a]=t;else{var l=F(t)?t:Ie(new s(t,i).toString()),m=l.length;for(a=0;a<r-e;++a)this[a+e]=l[a%m]}return this};Mn=/[^+\/0-9A-Za-z-_]/g});var f=ze(()=>{"use strict";Nt()});var ua={};nt(ua,{DynamicSnippetsGenerator:()=>Xe});module.exports=Vr(ua);u();f();u();f();u();f();function v(n){throw new Error("Unexpected value: "+JSON.stringify(n))}u();f();function he(n){return Object.keys(n)}u();f();u();f();u();f();u();f();u();f();u();f();var zn=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Ct=zn;var Yn=typeof self=="object"&&self&&self.Object===Object&&self,Gn=Ct||Yn||Function("return this")(),It=Gn;var Hn=It.Symbol,_=Hn;u();f();var Lt=Object.prototype,Zn=Lt.hasOwnProperty,Jn=Lt.toString,xe=_?_.toStringTag:void 0;function Kn(n){var t=Zn.call(n,xe),e=n[xe];try{n[xe]=void 0;var r=!0}catch(o){}var i=Jn.call(n);return r&&(t?n[xe]=e:delete n[xe]),i}var Pt=Kn;u();f();var Qn=Object.prototype,Xn=Qn.toString;function ei(n){return Xn.call(n)}var St=ei;var ti="[object Null]",ri="[object Undefined]",Ft=_?_.toStringTag:void 0;function ni(n){return n==null?n===void 0?ri:ti:Ft&&Ft in Object(n)?Pt(n):St(n)}var Bt=ni;u();f();function ii(n){return n!=null&&typeof n=="object"}var kt=ii;var oi="[object Symbol]";function ai(n){return typeof n=="symbol"||kt(n)&&Bt(n)==oi}var Ut=ai;u();f();u();f();function si(n,t){for(var e=-1,r=n==null?0:n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}var Mt=si;u();f();var ui=Array.isArray,_t=ui;var fi=1/0,Ot=_?_.prototype:void 0,Dt=Ot?Ot.toString:void 0;function $t(n){if(typeof n=="string")return n;if(_t(n))return Mt(n,$t)+"";if(Ut(n))return Dt?Dt.call(n):"";var t=n+"";return t=="0"&&1/n==-fi?"-0":t}var Vt=$t;u();f();function pi(n){return n==null?"":Vt(n)}var z=pi;u();f();u();f();u();f();u();f();u();f();u();f();function li(n,t,e){var r=-1,i=n.length;t<0&&(t=-t>i?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=n[r+t];return o}var Wt=li;function ci(n,t,e){var r=n.length;return e=e===void 0?r:e,!t&&e>=r?n:Wt(n,t,e)}var qt=ci;u();f();var di="\\ud800-\\udfff",mi="\\u0300-\\u036f",hi="\\ufe20-\\ufe2f",xi="\\u20d0-\\u20ff",yi=mi+hi+xi,gi="\\ufe0e\\ufe0f",wi="\\u200d",vi=RegExp("["+wi+di+yi+gi+"]");function Ti(n){return vi.test(n)}var Be=Ti;u();f();u();f();function Ai(n){return n.split("")}var jt=Ai;u();f();var zt="\\ud800-\\udfff",Ri="\\u0300-\\u036f",Ei="\\ufe20-\\ufe2f",bi="\\u20d0-\\u20ff",Ni=Ri+Ei+bi,Ci="\\ufe0e\\ufe0f",Ii="["+zt+"]",Je="["+Ni+"]",Ke="\\ud83c[\\udffb-\\udfff]",Li="(?:"+Je+"|"+Ke+")",Yt="[^"+zt+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Pi="\\u200d",Zt=Li+"?",Jt="["+Ci+"]?",Si="(?:"+Pi+"(?:"+[Yt,Gt,Ht].join("|")+")"+Jt+Zt+")*",Fi=Jt+Zt+Si,Bi="(?:"+[Yt+Je+"?",Je,Gt,Ht,Ii].join("|")+")",ki=RegExp(Ke+"(?="+Ke+")|"+Bi+Fi,"g");function Ui(n){return n.match(ki)||[]}var Kt=Ui;function Mi(n){return Be(n)?Kt(n):jt(n)}var Qt=Mi;function _i(n){return function(t){t=z(t);var e=Be(t)?Qt(t):void 0,r=e?e[0]:t.charAt(0),i=e?qt(e,1).join(""):t.slice(1);return r[n]()+i}}var Xt=_i;var Oi=Xt("toUpperCase"),ce=Oi;function Di(n){return ce(z(n).toLowerCase())}var er=Di;u();f();u();f();function $i(n,t,e,r){var i=-1,o=n==null?0:n.length;for(r&&o&&(e=n[++i]);++i<o;)e=t(e,n[i],i,n);return e}var tr=$i;u();f();u();f();u();f();function Vi(n){return function(t){return n==null?void 0:n[t]}}var rr=Vi;var Wi={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},qi=rr(Wi),nr=qi;var ji=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zi="\\u0300-\\u036f",Yi="\\ufe20-\\ufe2f",Gi="\\u20d0-\\u20ff",Hi=zi+Yi+Gi,Zi="["+Hi+"]",Ji=RegExp(Zi,"g");function Ki(n){return n=z(n),n&&n.replace(ji,nr).replace(Ji,"")}var ir=Ki;u();f();u();f();var Qi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Xi(n){return n.match(Qi)||[]}var or=Xi;u();f();var eo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function to(n){return eo.test(n)}var ar=to;u();f();var lr="\\ud800-\\udfff",ro="\\u0300-\\u036f",no="\\ufe20-\\ufe2f",io="\\u20d0-\\u20ff",oo=ro+no+io,cr="\\u2700-\\u27bf",dr="a-z\\xdf-\\xf6\\xf8-\\xff",ao="\\xac\\xb1\\xd7\\xf7",so="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uo="\\u2000-\\u206f",fo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mr="A-Z\\xc0-\\xd6\\xd8-\\xde",po="\\ufe0e\\ufe0f",hr=ao+so+uo+fo,xr="['\u2019]",sr="["+hr+"]",lo="["+oo+"]",yr="\\d+",co="["+cr+"]",gr="["+dr+"]",wr="[^"+lr+hr+yr+cr+dr+mr+"]",mo="\\ud83c[\\udffb-\\udfff]",ho="(?:"+lo+"|"+mo+")",xo="[^"+lr+"]",vr="(?:\\ud83c[\\udde6-\\uddff]){2}",Tr="[\\ud800-\\udbff][\\udc00-\\udfff]",de="["+mr+"]",yo="\\u200d",ur="(?:"+gr+"|"+wr+")",go="(?:"+de+"|"+wr+")",fr="(?:"+xr+"(?:d|ll|m|re|s|t|ve))?",pr="(?:"+xr+"(?:D|LL|M|RE|S|T|VE))?",Ar=ho+"?",Rr="["+po+"]?",wo="(?:"+yo+"(?:"+[xo,vr,Tr].join("|")+")"+Rr+Ar+")*",vo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",To="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ao=Rr+Ar+wo,Ro="(?:"+[co,vr,Tr].join("|")+")"+Ao,Eo=RegExp([de+"?"+gr+"+"+fr+"(?="+[sr,de,"$"].join("|")+")",go+"+"+pr+"(?="+[sr,de+ur,"$"].join("|")+")",de+"?"+ur+"+"+fr,de+"+"+pr,To,vo,yr,Ro].join("|"),"g");function bo(n){return n.match(Eo)||[]}var Er=bo;function No(n,t,e){return n=z(n),t=e?void 0:t,t===void 0?ar(n)?Er(n):or(n):n.match(t)||[]}var br=No;var Co="['\u2019]",Io=RegExp(Co,"g");function Lo(n){return function(t){return tr(br(ir(t).replace(Io,"")),n,"")}}var Nr=Lo;var Po=Nr(function(n,t,e){return t=t.toLowerCase(),n+(e?er(t):t)}),ke=Po;u();f();u();f();var O=class{};u();f();u();f();var Y=class extends O{constructor(e){super();p(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var So=4,ye=class{constructor(){p(this,"buffer","");p(this,"indentLevel",0);p(this,"hasWrittenAnything",!1);p(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
1
+ "use strict";var be=Object.defineProperty,Mr=Object.defineProperties,_r=Object.getOwnPropertyDescriptor,Or=Object.getOwnPropertyDescriptors,Dr=Object.getOwnPropertyNames,Ee=Object.getOwnPropertySymbols;var je=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;var We=(n,t,e)=>t in n?be(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ue=(n,t)=>{for(var e in t||(t={}))je.call(t,e)&&We(n,e,t[e]);if(Ee)for(var e of Ee(t))et.call(t,e)&&We(n,e,t[e]);return n},fe=(n,t)=>Mr(n,Or(t));var tt=n=>typeof n=="symbol"?n:n+"",rt=(n,t)=>{var e={};for(var r in n)je.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&Ee)for(var r of Ee(n))t.indexOf(r)<0&&et.call(n,r)&&(e[r]=n[r]);return e};var ze=(n,t)=>()=>(n&&(t=n(n=0)),t);var nt=(n,t)=>{for(var e in t)be(n,e,{get:t[e],enumerable:!0})},$r=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dr(t))!je.call(n,i)&&i!==e&&be(n,i,{get:()=>t[i],enumerable:!(r=_r(t,i))||r.enumerable});return n};var Vr=n=>$r(be({},"__esModule",{value:!0}),n);var p=(n,t,e)=>We(n,typeof t!="symbol"?t+"":t,e);function ot(){throw new Error("setTimeout has not been defined")}function at(){throw new Error("clearTimeout has not been defined")}function st(n){if(W===setTimeout)return setTimeout(n,0);if((W===ot||!W)&&setTimeout)return W=setTimeout,setTimeout(n,0);try{return W(n,0)}catch(t){try{return W.call(null,n,0)}catch(e){return W.call(this,n,0)}}}function qr(n){if(j===clearTimeout)return clearTimeout(n);if((j===at||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(n);try{return j(n)}catch(t){try{return j.call(null,n)}catch(e){return j.call(this,n)}}}function Wr(){!le||!K||(le=!1,K.length?U=K.concat(U):Ne=-1,U.length&&ut())}function ut(){if(!le){var n=st(Wr);le=!0;for(var t=U.length;t;){for(K=U,U=[];++Ne<t;)K&&K[Ne].run();Ne=-1,t=U.length}K=null,le=!1,qr(n)}}function jr(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];U.push(new ft(n,t)),U.length===1&&!le&&st(ut)}function ft(n,t){this.fun=n,this.array=t}function Q(){}function un(n){throw new Error("process.binding is not supported")}function fn(){return"/"}function pn(n){throw new Error("process.chdir is not supported")}function ln(){return 0}function dn(n){var t=cn.call(pe)*.001,e=Math.floor(t),r=Math.floor(t%1*1e9);return n&&(e=e-n[0],r=r-n[1],r<0&&(e--,r+=1e9)),[e,r]}function hn(){var n=new Date,t=n-mn;return t/1e3}var W,j,U,le,K,Ne,zr,Yr,Gr,Hr,Zr,Jr,Kr,Qr,Xr,en,tn,rn,nn,on,an,sn,pe,cn,mn,c,it,u=ze(()=>{"use strict";W=ot,j=at;typeof globalThis.setTimeout=="function"&&(W=setTimeout);typeof globalThis.clearTimeout=="function"&&(j=clearTimeout);U=[],le=!1,Ne=-1;ft.prototype.run=function(){this.fun.apply(null,this.array)};zr="browser",Yr="browser",Gr=!0,Hr={},Zr=[],Jr="",Kr={},Qr={},Xr={};en=Q,tn=Q,rn=Q,nn=Q,on=Q,an=Q,sn=Q;pe=globalThis.performance||{},cn=pe.now||pe.mozNow||pe.msNow||pe.oNow||pe.webkitNow||function(){return new Date().getTime()};mn=new Date;c={nextTick:jr,title:zr,browser:Gr,env:Hr,argv:Zr,version:Jr,versions:Kr,on:en,addListener:tn,once:rn,off:nn,removeListener:on,removeAllListeners:an,emit:sn,binding:un,cwd:fn,chdir:pn,umask:ln,hrtime:dn,platform:Yr,release:Qr,config:Xr,uptime:hn},it={};Object.keys(it).forEach(n=>{let t=n.split("."),e=c;for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1?e[i]=it[n]:e=e[i]||(e[i]={})}})});function dt(){Ge=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)P[t]=n[t],L[n.charCodeAt(t)]=t;L[45]=62,L[95]=63}function yn(n){Ge||dt();var t,e,r,i,o,a,l=n.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=n[l-2]==="="?2:n[l-1]==="="?1:0,a=new xn(l*3/4-o),r=o>0?l-4:l;var m=0;for(t=0,e=0;t<r;t+=4,e+=3)i=L[n.charCodeAt(t)]<<18|L[n.charCodeAt(t+1)]<<12|L[n.charCodeAt(t+2)]<<6|L[n.charCodeAt(t+3)],a[m++]=i>>16&255,a[m++]=i>>8&255,a[m++]=i&255;return o===2?(i=L[n.charCodeAt(t)]<<2|L[n.charCodeAt(t+1)]>>4,a[m++]=i&255):o===1&&(i=L[n.charCodeAt(t)]<<10|L[n.charCodeAt(t+1)]<<4|L[n.charCodeAt(t+2)]>>2,a[m++]=i>>8&255,a[m++]=i&255),a}function gn(n){return P[n>>18&63]+P[n>>12&63]+P[n>>6&63]+P[n&63]}function wn(n,t,e){for(var r,i=[],o=t;o<e;o+=3)r=(n[o]<<16)+(n[o+1]<<8)+n[o+2],i.push(gn(r));return i.join("")}function pt(n){Ge||dt();for(var t,e=n.length,r=e%3,i="",o=[],a=16383,l=0,m=e-r;l<m;l+=a)o.push(wn(n,l,l+a>m?m:l+a));return r===1?(t=n[e-1],i+=P[t>>2],i+=P[t<<4&63],i+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],i+=P[t>>10],i+=P[t>>4&63],i+=P[t<<2&63],i+="="),o.push(i),o.join("")}function Ce(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function M(n,t){if(Ce()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return He(this,n)}return mt(this,n,t,e)}function mt(n,t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?An(n,t,e,r):typeof t=="string"?Tn(n,t,e):Rn(n,t)}function ht(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function vn(n,t,e,r){return ht(t),t<=0?M(n,t):e!==void 0?typeof r=="string"?M(n,t).fill(e,r):M(n,t).fill(e):M(n,t)}function He(n,t){if(ht(t),n=M(n,t<0?0:Ze(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function Tn(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=xt(t,e)|0;n=M(n,r);var i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function Ye(n,t){var e=t.length<0?0:Ze(t.length)|0;n=M(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function An(n,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),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=Ye(n,t),n}function Rn(n,t){if(F(t)){var e=Ze(t.length)|0;return n=M(n,e),n.length===0||t.copy(n,0,0,e),n}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||qn(t.length)?M(n,0):Ye(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ye(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ze(n){if(n>=Ce())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ce().toString(16)+" bytes");return n|0}function F(n){return!!(n!=null&&n._isBuffer)}function xt(n,t){if(F(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var e=n.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 Ie(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Rt(n).length;default:if(r)return Ie(n).length;t=(""+t).toLowerCase(),r=!0}}function En(n,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(n||(n="utf8");;)switch(n){case"hex":return kn(this,t,e);case"utf8":case"utf-8":return wt(this,t,e);case"ascii":return Fn(this,t,e);case"latin1":case"binary":return Bn(this,t,e);case"base64":return Sn(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Un(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function X(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function yt(n,t,e,r,i){if(n.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=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),F(t))return t.length===0?-1:lt(n,t,e,r,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):lt(n,[t],e,r,i);throw new TypeError("val must be string, number or Buffer")}function lt(n,t,e,r,i){var o=1,a=n.length,l=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;o=2,a/=2,l/=2,e/=2}function m(A,I){return o===1?A[I]:A.readUInt16BE(I*o)}var h;if(i){var y=-1;for(h=e;h<a;h++)if(m(n,h)===m(t,y===-1?0:h-y)){if(y===-1&&(y=h),h-y+1===l)return y*o}else y!==-1&&(h-=h-y),y=-1}else for(e+l>a&&(e=a-l),h=e;h>=0;h--){for(var g=!0,b=0;b<l;b++)if(m(n,h+b)!==m(t,b)){g=!1;break}if(g)return h}return-1}function bn(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var l=parseInt(t.substr(a*2,2),16);if(isNaN(l))return a;n[e+a]=l}return a}function Nn(n,t,e,r){return Pe(Ie(t,n.length-e),n,e,r)}function gt(n,t,e,r){return Pe($n(t),n,e,r)}function Cn(n,t,e,r){return gt(n,t,e,r)}function In(n,t,e,r){return Pe(Rt(t),n,e,r)}function Ln(n,t,e,r){return Pe(Vn(t,n.length-e),n,e,r)}function Sn(n,t,e){return t===0&&e===n.length?pt(n):pt(n.slice(t,e))}function wt(n,t,e){e=Math.min(n.length,e);for(var r=[],i=t;i<e;){var o=n[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=e){var m,h,y,g;switch(l){case 1:o<128&&(a=o);break;case 2:m=n[i+1],(m&192)===128&&(g=(o&31)<<6|m&63,g>127&&(a=g));break;case 3:m=n[i+1],h=n[i+2],(m&192)===128&&(h&192)===128&&(g=(o&15)<<12|(m&63)<<6|h&63,g>2047&&(g<55296||g>57343)&&(a=g));break;case 4:m=n[i+1],h=n[i+2],y=n[i+3],(m&192)===128&&(h&192)===128&&(y&192)===128&&(g=(o&15)<<18|(m&63)<<12|(h&63)<<6|y&63,g>65535&&g<1114112&&(a=g))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=l}return Pn(r)}function Pn(n){var t=n.length;if(t<=ct)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=ct));return e}function Fn(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]&127);return r}function Bn(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;i<e;++i)r+=String.fromCharCode(n[i]);return r}function kn(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var i="",o=t;o<e;++o)i+=Dn(n[o]);return i}function Un(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+r[o+1]*256);return i}function T(n,t,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function N(n,t,e,r,i,o){if(!F(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+r>n.length)throw new RangeError("Index out of range")}function Le(n,t,e,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(n.length-e,2);i<o;++i)n[e+i]=(t&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}function Se(n,t,e,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(n.length-e,4);i<o;++i)n[e+i]=t>>>(r?i:3-i)*8&255}function vt(n,t,e,r,i,o){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Tt(n,t,e,r,i){return i||vt(n,t,e,4,34028234663852886e22,-34028234663852886e22),bt(n,t,e,r,23,4),e+4}function At(n,t,e,r,i){return i||vt(n,t,e,8,17976931348623157e292,-17976931348623157e292),bt(n,t,e,r,52,8),e+8}function _n(n){if(n=On(n).replace(Mn,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function On(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Dn(n){return n<16?"0"+n.toString(16):n.toString(16)}function Ie(n,t){t=t||1/0;for(var e,r=n.length,i=null,o=[],a=0;a<r;++a){if(e=n.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=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 $n(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Vn(n,t){for(var e,r,i,o=[],a=0;a<n.length&&!((t-=2)<0);++a)e=n.charCodeAt(a),r=e>>8,i=e%256,o.push(i),o.push(r);return o}function Rt(n){return yn(_n(n))}function Pe(n,t,e,r){for(var i=0;i<r&&!(i+e>=t.length||i>=n.length);++i)t[i+e]=n[i];return i}function qn(n){return n!==n}function Wn(n){return n!=null&&(!!n._isBuffer||Et(n)||jn(n))}function Et(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function jn(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&Et(n.slice(0,0))}function Fe(n,t,e,r,i){var o,a,l=i*8-r-1,m=(1<<l)-1,h=m>>1,y=-7,g=e?i-1:0,b=e?-1:1,A=n[t+g];for(g+=b,o=A&(1<<-y)-1,A>>=-y,y+=l;y>0;o=o*256+n[t+g],g+=b,y-=8);for(a=o&(1<<-y)-1,o>>=-y,y+=r;y>0;a=a*256+n[t+g],g+=b,y-=8);if(o===0)o=1-h;else{if(o===m)return a?NaN:(A?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-h}return(A?-1:1)*a*Math.pow(2,o-r)}function bt(n,t,e,r,i,o){var a,l,m,h=o*8-i-1,y=(1<<h)-1,g=y>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:o-1,I=r?1:-1,Ur=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=y):(a=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-a))<1&&(a--,m*=2),a+g>=1?t+=b/m:t+=b*Math.pow(2,1-g),t*m>=2&&(a++,m/=2),a+g>=y?(l=0,a=y):a+g>=1?(l=(t*m-1)*Math.pow(2,i),a=a+g):(l=t*Math.pow(2,g-1)*Math.pow(2,i),a=0));i>=8;n[e+A]=l&255,A+=I,l/=256,i-=8);for(a=a<<i|l,h+=i;h>0;n[e+A]=a&255,A+=I,a/=256,h-=8);n[e+A-I]|=Ur*128}var P,L,xn,Ge,ct,Mn,Nt=ze(()=>{"use strict";u();f();P=[],L=[],xn=typeof Uint8Array!="undefined"?Uint8Array:Array,Ge=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return mt(null,n,t,e)};s.kMaxLength=Ce();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return vn(null,n,t,e)};s.allocUnsafe=function(n){return He(null,n)};s.allocUnsafeSlow=function(n){return He(null,n)};s.isBuffer=Wn;s.compare=function(t,e){if(!F(t)||!F(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,o=0,a=Math.min(r,i);o<a;++o)if(t[o]!==e[o]){r=t[o],i=e[o];break}return r<i?-1:i<r?1:0};s.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}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=s.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!F(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};s.byteLength=xt;s.prototype._isBuffer=!0;s.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)X(this,e,e+1);return this};s.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)X(this,e,e+3),X(this,e+1,e+2);return this};s.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)X(this,e,e+7),X(this,e+1,e+6),X(this,e+2,e+5),X(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?wt(this,0,t):En.apply(this,arguments)};s.prototype.equals=function(t){if(!F(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,i,o){if(!F(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=r)return 0;if(i>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,l=r-e,m=Math.min(a,l),h=this.slice(i,o),y=t.slice(e,r),g=0;g<m;++g)if(h[g]!==y[g]){a=h[g],l=y[g];break}return a<l?-1:l<a?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return yt(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return yt(this,t,e,r,!1)};s.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=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");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return bn(this,t,e,r);case"utf8":case"utf-8":return Nn(this,t,e,r);case"ascii":return gt(this,t,e,r);case"latin1":case"binary":return Cn(this,t,e,r);case"base64":return In(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ln(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};ct=4096;s.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 i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=s.prototype;else{var o=e-t;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};s.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return i};s.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};s.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]};s.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};s.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])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=this[t],o=1,a=0;++a<e&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||T(t,e,this.length);for(var i=e,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(t,e){return e||T(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.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};s.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]};s.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),Fe(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),Fe(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),Fe(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),Fe(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;N(this,t,e,r,o,0)}var a=1,l=0;for(this[e]=t&255;++l<r&&(a*=256);)this[e+l]=t/a&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e|0,r=r|0,!i){var o=Math.pow(2,8*r)-1;N(this,t,e,r,o,0)}var a=r-1,l=1;for(this[e+a]=t&255;--a>=0&&(l*=256);)this[e+a]=t/l&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Le(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Le(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):Se(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Se(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);N(this,t,e,r,o-1,-o)}var a=0,l=1,m=0;for(this[e]=t&255;++a<r&&(l*=256);)t<0&&m===0&&this[e+a-1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+r};s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*r-1);N(this,t,e,r,o-1,-o)}var a=r-1,l=1,m=0;for(this[e+a]=t&255;--a>=0&&(l*=256);)t<0&&m===0&&this[e+a+1]!==0&&(m=1),this[e+a]=(t/l>>0)-m&255;return e+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Le(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Le(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Se(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Se(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return Tt(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return Tt(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return At(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return At(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var o=i-r,a;if(this===t&&r<e&&e<i)for(a=o-1;a>=0;--a)t[a+e]=this[a+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o};s.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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 a;if(typeof t=="number")for(a=e;a<r;++a)this[a]=t;else{var l=F(t)?t:Ie(new s(t,i).toString()),m=l.length;for(a=0;a<r-e;++a)this[a+e]=l[a%m]}return this};Mn=/[^+\/0-9A-Za-z-_]/g});var f=ze(()=>{"use strict";Nt()});var ua={};nt(ua,{DynamicSnippetsGenerator:()=>Xe});module.exports=Vr(ua);u();f();u();f();u();f();function v(n){throw new Error("Unexpected value: "+JSON.stringify(n))}u();f();function he(n){return Object.keys(n)}u();f();u();f();u();f();u();f();u();f();u();f();var zn=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Ct=zn;var Yn=typeof self=="object"&&self&&self.Object===Object&&self,Gn=Ct||Yn||Function("return this")(),It=Gn;var Hn=It.Symbol,_=Hn;u();f();var Lt=Object.prototype,Zn=Lt.hasOwnProperty,Jn=Lt.toString,xe=_?_.toStringTag:void 0;function Kn(n){var t=Zn.call(n,xe),e=n[xe];try{n[xe]=void 0;var r=!0}catch(o){}var i=Jn.call(n);return r&&(t?n[xe]=e:delete n[xe]),i}var St=Kn;u();f();var Qn=Object.prototype,Xn=Qn.toString;function ei(n){return Xn.call(n)}var Pt=ei;var ti="[object Null]",ri="[object Undefined]",Ft=_?_.toStringTag:void 0;function ni(n){return n==null?n===void 0?ri:ti:Ft&&Ft in Object(n)?St(n):Pt(n)}var Bt=ni;u();f();function ii(n){return n!=null&&typeof n=="object"}var kt=ii;var oi="[object Symbol]";function ai(n){return typeof n=="symbol"||kt(n)&&Bt(n)==oi}var Ut=ai;u();f();u();f();function si(n,t){for(var e=-1,r=n==null?0:n.length,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}var Mt=si;u();f();var ui=Array.isArray,_t=ui;var fi=1/0,Ot=_?_.prototype:void 0,Dt=Ot?Ot.toString:void 0;function $t(n){if(typeof n=="string")return n;if(_t(n))return Mt(n,$t)+"";if(Ut(n))return Dt?Dt.call(n):"";var t=n+"";return t=="0"&&1/n==-fi?"-0":t}var Vt=$t;u();f();function pi(n){return n==null?"":Vt(n)}var z=pi;u();f();u();f();u();f();u();f();u();f();u();f();function li(n,t,e){var r=-1,i=n.length;t<0&&(t=-t>i?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=n[r+t];return o}var qt=li;function ci(n,t,e){var r=n.length;return e=e===void 0?r:e,!t&&e>=r?n:qt(n,t,e)}var Wt=ci;u();f();var di="\\ud800-\\udfff",mi="\\u0300-\\u036f",hi="\\ufe20-\\ufe2f",xi="\\u20d0-\\u20ff",yi=mi+hi+xi,gi="\\ufe0e\\ufe0f",wi="\\u200d",vi=RegExp("["+wi+di+yi+gi+"]");function Ti(n){return vi.test(n)}var Be=Ti;u();f();u();f();function Ai(n){return n.split("")}var jt=Ai;u();f();var zt="\\ud800-\\udfff",Ri="\\u0300-\\u036f",Ei="\\ufe20-\\ufe2f",bi="\\u20d0-\\u20ff",Ni=Ri+Ei+bi,Ci="\\ufe0e\\ufe0f",Ii="["+zt+"]",Je="["+Ni+"]",Ke="\\ud83c[\\udffb-\\udfff]",Li="(?:"+Je+"|"+Ke+")",Yt="[^"+zt+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Si="\\u200d",Zt=Li+"?",Jt="["+Ci+"]?",Pi="(?:"+Si+"(?:"+[Yt,Gt,Ht].join("|")+")"+Jt+Zt+")*",Fi=Jt+Zt+Pi,Bi="(?:"+[Yt+Je+"?",Je,Gt,Ht,Ii].join("|")+")",ki=RegExp(Ke+"(?="+Ke+")|"+Bi+Fi,"g");function Ui(n){return n.match(ki)||[]}var Kt=Ui;function Mi(n){return Be(n)?Kt(n):jt(n)}var Qt=Mi;function _i(n){return function(t){t=z(t);var e=Be(t)?Qt(t):void 0,r=e?e[0]:t.charAt(0),i=e?Wt(e,1).join(""):t.slice(1);return r[n]()+i}}var Xt=_i;var Oi=Xt("toUpperCase"),ce=Oi;function Di(n){return ce(z(n).toLowerCase())}var er=Di;u();f();u();f();function $i(n,t,e,r){var i=-1,o=n==null?0:n.length;for(r&&o&&(e=n[++i]);++i<o;)e=t(e,n[i],i,n);return e}var tr=$i;u();f();u();f();u();f();function Vi(n){return function(t){return n==null?void 0:n[t]}}var rr=Vi;var qi={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Wi=rr(qi),nr=Wi;var ji=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zi="\\u0300-\\u036f",Yi="\\ufe20-\\ufe2f",Gi="\\u20d0-\\u20ff",Hi=zi+Yi+Gi,Zi="["+Hi+"]",Ji=RegExp(Zi,"g");function Ki(n){return n=z(n),n&&n.replace(ji,nr).replace(Ji,"")}var ir=Ki;u();f();u();f();var Qi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Xi(n){return n.match(Qi)||[]}var or=Xi;u();f();var eo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function to(n){return eo.test(n)}var ar=to;u();f();var lr="\\ud800-\\udfff",ro="\\u0300-\\u036f",no="\\ufe20-\\ufe2f",io="\\u20d0-\\u20ff",oo=ro+no+io,cr="\\u2700-\\u27bf",dr="a-z\\xdf-\\xf6\\xf8-\\xff",ao="\\xac\\xb1\\xd7\\xf7",so="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uo="\\u2000-\\u206f",fo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mr="A-Z\\xc0-\\xd6\\xd8-\\xde",po="\\ufe0e\\ufe0f",hr=ao+so+uo+fo,xr="['\u2019]",sr="["+hr+"]",lo="["+oo+"]",yr="\\d+",co="["+cr+"]",gr="["+dr+"]",wr="[^"+lr+hr+yr+cr+dr+mr+"]",mo="\\ud83c[\\udffb-\\udfff]",ho="(?:"+lo+"|"+mo+")",xo="[^"+lr+"]",vr="(?:\\ud83c[\\udde6-\\uddff]){2}",Tr="[\\ud800-\\udbff][\\udc00-\\udfff]",de="["+mr+"]",yo="\\u200d",ur="(?:"+gr+"|"+wr+")",go="(?:"+de+"|"+wr+")",fr="(?:"+xr+"(?:d|ll|m|re|s|t|ve))?",pr="(?:"+xr+"(?:D|LL|M|RE|S|T|VE))?",Ar=ho+"?",Rr="["+po+"]?",wo="(?:"+yo+"(?:"+[xo,vr,Tr].join("|")+")"+Rr+Ar+")*",vo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",To="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ao=Rr+Ar+wo,Ro="(?:"+[co,vr,Tr].join("|")+")"+Ao,Eo=RegExp([de+"?"+gr+"+"+fr+"(?="+[sr,de,"$"].join("|")+")",go+"+"+pr+"(?="+[sr,de+ur,"$"].join("|")+")",de+"?"+ur+"+"+fr,de+"+"+pr,To,vo,yr,Ro].join("|"),"g");function bo(n){return n.match(Eo)||[]}var Er=bo;function No(n,t,e){return n=z(n),t=e?void 0:t,t===void 0?ar(n)?Er(n):or(n):n.match(t)||[]}var br=No;var Co="['\u2019]",Io=RegExp(Co,"g");function Lo(n){return function(t){return tr(br(ir(t).replace(Io,"")),n,"")}}var Nr=Lo;var So=Nr(function(n,t,e){return t=t.toLowerCase(),n+(e?er(t):t)}),ke=So;u();f();u();f();var O=class{};u();f();u();f();var Y=class extends O{constructor(e){super();p(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var Po=4,ye=class{constructor(){p(this,"buffer","");p(this,"indentLevel",0);p(this,"hasWrittenAnything",!1);p(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
2
2
  `),r=e?t.substring(0,t.length-1):t,i=this.getIndentString(),o=r.replaceAll(`
3
3
  `,`
4
4
  ${i}`);this.isAtStartOfLine()&&(o=i+o),e&&(o+=`
5
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 Y(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new Y(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}openBlock(t,e="{",r,i="}"){let o=t.filter(a=>a!==void 0).join(" ");o?this.write(`${o} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),r(),this.dedent()}finally{this.write(i!=null?i:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
6
  `)}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
7
  `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:r}){if(t.length>0){let i=t[0];i!=null&&r(i);for(let o=1;o<t.length;o++){this.write(e);let a=t[o];a!=null&&r(a)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
8
- `)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*So)}};u();f();function Qe(n){return(n==null?void 0:n.name)!=null}u();f();var ge=class extends O{constructor({condition:e,true_:r,false_:i}){super();p(this,"condition");p(this,"true_");p(this,"false_");this.condition=e,this.true_=r,this.false_=i}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};u();f();u();f();u();f();var we=class{constructor(){p(this,"reporter");p(this,"snippet");p(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:t,snippet:e}){(this.reporter==null||this.reporter.size()>t.errors.size())&&(this.reporter=t.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:t}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${t.method} ${t.path}"`)}};var ve=class{constructor(t){p(this,"context");this.context=t}async generate(t){let e=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(e.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let r=new we;for(let i of e){let o=this.context.clone(),a=this.createSnippetGenerator(o);try{let l=await a.generateSnippet({endpoint:i,request:t});if(o.errors.empty())return{snippet:l,errors:void 0};r.update({context:o,snippet:l})}catch(l){r.err==null&&(r.err=l)}}return r.getResponseOrThrow({endpoint:t.endpoint})}generateSync(t){let e=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(e.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let r=new we;for(let i of e){let o=this.context.clone(),a=this.createSnippetGenerator(o);try{let l=a.generateSnippetSync({endpoint:i,request:t});if(o.errors.empty())return{snippet:l,errors:void 0};r.update({context:o,snippet:l})}catch(l){r.err==null&&(r.err=l)}}return r.getResponseOrThrow({endpoint:t.endpoint})}};u();f();u();f();u();f();var Te=class{constructor(){p(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}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]}}};u();f();var w={Critical:"CRITICAL",Warning:"WARNING"},Ae=class n{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(fe(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 n;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 Re=class{constructor({ir:t,config:e}){p(this,"config");p(this,"errors");p(this,"_ir");p(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.errors=new Ae,this.httpEndpointReferenceParser=new Te}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let a=t.find(m=>m.name.wireValue===i);if(a==null)throw this.newParameterNotRecognizedError(i);let l=this.isListTypeReference(a.typeReference)&&!Array.isArray(o)?[o]:o;r.push({name:a.name,typeReference:a.typeReference,value:l})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){let i=[];for(let[o,a]of Object.entries(e)){this.errors.scope(o);try{let l=t.find(m=>m.name.wireValue===o);if(l==null){if(r)continue;this.errors.add({severity:w.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:l.name,typeReference:l.typeReference,value:a})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:t,record:e}){let r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:w.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:w.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let i=[];for(let o of r){if(typeof o!="string"){this.errors.add({severity:w.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:w.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:w.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 i=t.discriminant.wireValue,o=r[i];if(o==null){this.errors.add({severity:w.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:w.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let a=t.types[o];if(a==null){this.errors.add({severity:w.Critical,message:`No type found for discriminant value "${o}"`});return}let h=r,{[i]:l}=h,m=rt(h,[tt(i)]);return{singleDiscriminatedUnionType:a,discriminantValue:a.discriminantValue,value:m}}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 i;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}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,i;return e&&((i=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:v(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(i=>i.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}default:v(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:w.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:w.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:w.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(he(r.urls));for(let o of he(t))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:w.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${he(r.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:w.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:w.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:w.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:v(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:v(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:v(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}};u();f();var B={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};u();f();u();f();u();f();var Ue="";var d={};nt(d,{Array:()=>ee,AstNode:()=>x,Attribute:()=>te,Class:()=>D,ClassInstantiation:()=>k,ClassReference:()=>R,CodeBlock:()=>E,DataClass:()=>ne,Enum:()=>ie,Field:()=>oe,Map:()=>ae,Method:()=>V,MethodInvocation:()=>W,Parameter:()=>$,Trait:()=>re,Type:()=>P,TypeLiteral:()=>J,Writer:()=>G,array:()=>Do,assignVariable:()=>Xo,attribute:()=>$o,classReference:()=>qo,class_:()=>Vo,codeblock:()=>se,dataClass:()=>jo,enum_:()=>zo,field:()=>Yo,instantiateClass:()=>Fr,invokeMethod:()=>Go,map:()=>Zo,mergeArrays:()=>ra,method:()=>Jo,parameter:()=>Ko,string:()=>ta,ternary:()=>Qo,this_:()=>na,throwException:()=>Ho,trait:()=>Wo,variable:()=>ea});u();f();u();f();u();f();u();f();u();f();function Cr(n){return{namespace:n.substring(0,n.lastIndexOf("\\")),name:n.substring(n.lastIndexOf("\\")+1)}}var G=class extends ye{constructor({namespace:e,rootNamespace:r,customConfig:i}){super();p(this,"namespace");p(this,"rootNamespace");p(this,"customConfig");p(this,"references",{});this.namespace=e,this.rootNamespace=r,this.customConfig=i}addReference(e){var a,l;if(e.namespace==null)return;if(Object.keys(this.references).filter(m=>{let h=Cr(m);return h.namespace!==e.namespace&&h.name===e.name}).length>0){e.requireFullyQualified();return}let i=e.namespace===Ue?e.name:`${e.namespace}\\${e.name}`;((l=(a=this.references)[i])!=null?l:a[i]=[]).push(e)}toString(){let e=`namespace ${this.namespace};`,r=this.stringifyImports();return r.length>0?`${e}
8
+ `)),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*Po)}};u();f();function Qe(n){return(n==null?void 0:n.name)!=null}u();f();var ge=class extends O{constructor({condition:e,true_:r,false_:i}){super();p(this,"condition");p(this,"true_");p(this,"false_");this.condition=e,this.true_=r,this.false_=i}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};u();f();u();f();u();f();var we=class{constructor(){p(this,"reporter");p(this,"snippet");p(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:t,snippet:e}){(this.reporter==null||this.reporter.size()>t.errors.size())&&(this.reporter=t.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:t}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${t.method} ${t.path}"`)}};var ve=class{constructor(t){p(this,"context");this.context=t}async generate(t){let e=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(e.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let r=new we;for(let i of e){let o=this.context.clone(),a=this.createSnippetGenerator(o);try{let l=await a.generateSnippet({endpoint:i,request:t});if(o.errors.empty())return{snippet:l,errors:void 0};r.update({context:o,snippet:l})}catch(l){r.err==null&&(r.err=l)}}return r.getResponseOrThrow({endpoint:t.endpoint})}generateSync(t){let e=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(e.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let r=new we;for(let i of e){let o=this.context.clone(),a=this.createSnippetGenerator(o);try{let l=a.generateSnippetSync({endpoint:i,request:t});if(o.errors.empty())return{snippet:l,errors:void 0};r.update({context:o,snippet:l})}catch(l){r.err==null&&(r.err=l)}}return r.getResponseOrThrow({endpoint:t.endpoint})}};u();f();u();f();u();f();var Te=class{constructor(){p(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}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]}}};u();f();var w={Critical:"CRITICAL",Warning:"WARNING"},Ae=class n{constructor(){p(this,"errors");p(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(fe(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 n;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 Re=class{constructor({ir:t,config:e}){p(this,"config");p(this,"errors");p(this,"_ir");p(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.errors=new Ae,this.httpEndpointReferenceParser=new Te}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let a=t.find(m=>m.name.wireValue===i);if(a==null)throw this.newParameterNotRecognizedError(i);let l=this.isListTypeReference(a.typeReference)&&!Array.isArray(o)?[o]:o;r.push({name:a.name,typeReference:a.typeReference,value:l})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){let i=[];for(let[o,a]of Object.entries(e)){this.errors.scope(o);try{let l=t.find(m=>m.name.wireValue===o);if(l==null){if(r)continue;this.errors.add({severity:w.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:l.name,typeReference:l.typeReference,value:a})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:t,record:e}){let r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:w.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:w.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let i=[];for(let o of r){if(typeof o!="string"){this.errors.add({severity:w.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:w.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:w.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 i=t.discriminant.wireValue,o=r[i];if(o==null){this.errors.add({severity:w.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:w.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let a=t.types[o];if(a==null){this.errors.add({severity:w.Critical,message:`No type found for discriminant value "${o}"`});return}let h=r,{[i]:l}=h,m=rt(h,[tt(i)]);return{singleDiscriminatedUnionType:a,discriminantValue:a.discriminantValue,value:m}}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 i;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}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,i;return e&&((i=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:v(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(i=>i.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(i=>i.id===t);return r==null?void 0:r.name}default:v(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:w.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:w.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:w.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(he(r.urls));for(let o of he(t))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:w.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${he(r.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:w.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:w.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:w.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:v(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:v(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:v(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}};u();f();var B={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};u();f();u();f();u();f();var Ue="";var d={};nt(d,{Array:()=>ee,AstNode:()=>x,Attribute:()=>te,Class:()=>D,ClassInstantiation:()=>k,ClassReference:()=>R,CodeBlock:()=>E,DataClass:()=>ne,Enum:()=>ie,Field:()=>oe,Map:()=>ae,Method:()=>V,MethodInvocation:()=>q,Parameter:()=>$,Trait:()=>re,Type:()=>S,TypeLiteral:()=>J,Writer:()=>G,array:()=>Do,assignVariable:()=>Xo,attribute:()=>$o,classReference:()=>Wo,class_:()=>Vo,codeblock:()=>se,dataClass:()=>jo,enum_:()=>zo,field:()=>Yo,instantiateClass:()=>Fr,invokeMethod:()=>Go,map:()=>Zo,mergeArrays:()=>ra,method:()=>Jo,parameter:()=>Ko,string:()=>ta,ternary:()=>Qo,this_:()=>na,throwException:()=>Ho,trait:()=>qo,variable:()=>ea});u();f();u();f();u();f();u();f();u();f();function Cr(n){return{namespace:n.substring(0,n.lastIndexOf("\\")),name:n.substring(n.lastIndexOf("\\")+1)}}var G=class extends ye{constructor({namespace:e,rootNamespace:r,customConfig:i}){super();p(this,"namespace");p(this,"rootNamespace");p(this,"customConfig");p(this,"references",{});this.namespace=e,this.rootNamespace=r,this.customConfig=i}addReference(e){var a,l;if(e.namespace==null)return;if(Object.keys(this.references).filter(m=>{let h=Cr(m);return h.namespace!==e.namespace&&h.name===e.name}).length>0){e.requireFullyQualified();return}let i=e.namespace===Ue?e.name:`${e.namespace}\\${e.name}`;((l=(a=this.references)[i])!=null?l:a[i]=[]).push(e)}toString(){let e=`namespace ${this.namespace};`,r=this.stringifyImports();return r.length>0?`${e}
9
9
 
10
10
  ${r}
11
11
 
@@ -14,10 +14,10 @@ ${this.buffer}`:e+`
14
14
  `+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(r=>Cr(r).namespace!==this.namespace).map(r=>`use ${r};`).join(`
15
15
  `)}};var x=class extends O{toString(t){if(t==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:r,customConfig:i}=t,o=new G({namespace:e,rootNamespace:r,customConfig:i});return this.write(o),o.toString()}async toStringAsync({namespace:t,rootNamespace:e,customConfig:r}){let i=new G({namespace:t,rootNamespace:e,customConfig:r});return this.write(i),i.toString()}};var ee=class extends x{constructor({entries:e}){super();p(this,"entries");this.entries=e!=null?e:[]}write(e){e.write("["),this.entries.forEach((r,i)=>{i>0&&e.write(", "),r.write(e)}),e.write("]")}};u();f();var te=class extends x{constructor(e){var r;super();p(this,"reference");p(this,"arguments");this.reference=e.reference,this.arguments=(r=e.arguments)!=null?r:[]}write(e){e.addReference(this.reference),e.write(`${this.reference.name}`),this.arguments.length>0&&(e.write("("),this.arguments.forEach((r,i)=>{i>0&&e.write(","),typeof r=="string"?e.write(r):r.write(e)}),e.write(")"))}};u();f();u();f();var R=class extends x{constructor({name:e,namespace:r}){super();p(this,"name");p(this,"namespace");p(this,"fullyQualified");this.name=e,this.namespace=r,this.fullyQualified=!1}requireFullyQualified(){this.fullyQualified=!0}write(e){e.addReference(this);let r=this.fullyQualified?`\\${this.namespace}\\${this.name}`:this.name;e.write(`${r}`)}};u();f();u();f();function H(n){return n.startsWith("$")?n:`$${n}`}var C=class extends x{constructor({docs:e}={}){super();p(this,"docs");p(this,"tags",[]);this.docs=e}addTag(e){this.tags.push(fe(ue({},e),{name:e.name!=null?H(e.name):void 0}))}write(e){e.writeLine("/**"),this.docs!=null&&(this.docs.split(`
16
16
  `).forEach(r=>{e.writeLine(` * ${r}`)}),this.tags.length>0&&e.writeLine(" *"));for(let r of this.tags)this.writeTag({writer:e,tag:r});e.writeLine(" */")}writeTag({writer:e,tag:r}){let i=r.docs!=null?r.docs.split(`
17
- `):void 0;i!=null&&i.length>1&&(i.forEach(o=>{e.writeLine(` * ${o}`)}),e.writeLine(" *")),e.write(` * @${r.tagType} `),r.type.write(e,{comment:!0}),r.name!=null&&e.write(` ${r.name}`),i!=null&&i.length===1&&e.write(` ${i[0]}`),e.newLine()}};u();f();u();f();var Me={Public:"public",Private:"private",Protected:"protected"};function Z(n){return Fo(n,[Me.Public,Me.Protected,Me.Private])}function Fo(n,t){return t.reduce((e,r)=>[...e,...n.filter(i=>i.access===r)],[])}var D=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"abstract");p(this,"docs");p(this,"parentClassReference");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);p(this,"constructor_");this.name=e,this.namespace=r,this.abstract=i!=null?i:!1,this.docs=o,this.parentClassReference=a,this.traits=l!=null?l:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new R({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:Z(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:Z(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new C({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:r}){var i;this.writeConstructorComment({writer:e,constructor:r}),r.access!=null&&e.write(`${r.access} `),e.write("function __construct("),e.indent(),r.parameters.forEach((o,a)=>{a===0&&e.newLine(),o.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(i=r.body)==null||i.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:r}){if(r.parameters.length===0)return;let i=new C;for(let o of r.parameters)i.addTag(o.getCommentTag());i.write(e)}writeFields({writer:e,fields:r}){r.filter(i=>!i.inherited).forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};u();f();var re=class extends x{constructor({name:e,namespace:r,docs:i,traits:o}){super();p(this,"name");p(this,"namespace");p(this,"docs");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);this.name=e,this.namespace=r,this.docs=i,this.traits=o!=null?o:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:Z(this.fields)}),this.writeMethods({writer:e,methods:Z(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new C({docs:this.docs}).write(e)}writeFields({writer:e,fields:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};u();f();u();f();function me({writer:n,arguments_:t,multiline:e}){if(t.length===0){n.write("()");return}if(e){Bo({writer:n,arguments_:t});return}ko({writer:n,arguments_:t})}function Bo({writer:n,arguments_:t}){n.writeLine("("),n.indent();for(let e of t)Ir({writer:n,argument:e}),n.writeLine(",");n.dedent(),n.write(")")}function ko({writer:n,arguments_:t}){n.write("("),t.forEach((e,r)=>{r>0&&n.write(", "),Ir({writer:n,argument:e})}),n.write(")")}function Ir({writer:n,argument:t}){Qe(t)?(n.write(`${t.name}: `),n.writeNodeOrString(t.assignment)):t.write(n)}var k=class extends x{constructor({classReference:e,arguments_:r,multiline:i}){super();p(this,"classReference");p(this,"arguments_");p(this,"multiline");this.classReference=e,this.arguments_=r,this.multiline=i!=null?i:!1}write(e){e.write("new "),e.writeNode(this.classReference),me({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};u();f();var E=class extends x{constructor(e){super();p(this,"arg");this.arg=e}write(e){return new Y(this.arg).write(e)}};u();f();u();f();var $=class extends x{constructor({name:e,type:r,docs:i,initializer:o,access:a,readonly_:l}){super();p(this,"name");p(this,"type");p(this,"docs");p(this,"initializer");p(this,"access");p(this,"readonly_");this.name=H(e),this.type=r,this.docs=i,this.initializer=o,this.access=a,this.readonly_=l!=null?l:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};u();f();var P=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e,{comment:r}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(Lr),e.write("DateTime");break;case"dateTime":e.addReference(Lr),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!r){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:r}),e.write(">");break;case"map":{if(!r){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:r}),e.write(", "),this.internalType.valueType.write(e,{comment:r}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!r){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");for(let i of this.internalType.entries)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:i,comment:r}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((i,o)=>{o>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:i,comment:r})}),e.write("}");break}case"union":{this.getUniqueTypes({types:this.internalType.types,comment:r,writer:e}).forEach((o,a)=>{a>0&&e.write("|"),o.write(e,{comment:r}),a++});break}case"optional":{let i=this.internalType.value.internalType.type==="mixed",o=this.internalType.value.internalType.type==="union";!o&&!i&&e.write("?"),this.internalType.value.write(e,{comment:r}),o&&(e.write("|"),e.writeNode(n.null()));break}case"reference":e.writeNode(this.internalType.value);break;case"enumString":r?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;default:v(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:n.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static typeDict(e,{multiline:r}={}){return new this({type:"typeDict",entries:e,multiline:r})}static union(e){return new this({type:"union",types:e})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeTypeDictEntry({writer:e,entry:r,comment:i}){e.write(r.key),r.optional&&e.write("?"),e.write(": "),r.valueType.write(e,{comment:i})}getUniqueTypes({writer:e,types:r,comment:i}){let o=new Set;return r.filter(a=>{if(i)return!0;let l=a.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig});return o.has(l)?!1:(o.add(l),!0)})}},Lr=new R({namespace:Ue,name:"DateTime"});u();f();function Pr(n){return n.startsWith("$")?n.slice(1):n}var Sr="values",ne=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"class_");this.name=e,this.namespace=r,this.class_=new D({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let r=Z(this.class_.fields).map(i=>fe(ue({},i),{name:Pr(i.name)}));r.length>0&&this.class_.addConstructor({access:"public",parameters:this.getConstructorParameters({orderedFields:r}),body:d.codeblock(i=>{for(let o of r)i.write(`$this->${o.name} = $${Sr}['${o.name}']`),o.type.isOptional()&&i.write(" ?? null"),i.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new $({name:Sr,type:P.typeDict(e.map(r=>({key:r.name,valueType:r.type,optional:r.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new E("[]"):void 0})]}};u();f();u();f();var V=class extends x{constructor({name:e,access:r,parameters:i,throws:o,return_:a,body:l,docs:m,classReference:h}){super();p(this,"name");p(this,"access");p(this,"parameters");p(this,"throws");p(this,"return_");p(this,"body");p(this,"docs");p(this,"classReference");this.name=e,this.access=r,this.parameters=i,this.throws=o!=null?o:[],this.return_=a,this.body=l,this.docs=m,this.classReference=h}write(e){var r;this.writeComment(e),e.write(`${this.access} function ${this.name}(`),this.parameters.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write("): "),this.return_!=null?this.return_.write(e):e.write("void"),e.writeLine(" {"),e.indent(),(r=this.body)==null||r.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let r=new C({docs:this.docs});for(let i of this.parameters)r.addTag({tagType:"param",type:i.type,name:i.name,docs:i.docs});this.return_!=null&&r.addTag({tagType:"return",type:this.return_});for(let i of this.throws)r.addTag({tagType:"throws",type:P.reference(i)});e.writeNode(r)}};var ie=class extends x{constructor({name:e,namespace:r,backing:i,docs:o,serializable:a}){super();p(this,"name");p(this,"namespace");p(this,"backing");p(this,"docs");p(this,"members",[]);p(this,"serializable");this.name=e,this.namespace=r,this.backing=i,this.docs=o,this.serializable=a!=null?a:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new R({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let r of this.members)e.write(`case ${r.name}`),r.value!=null&&(typeof r.value=="string"?e.write(` = "${r.value}"`):e.write(` = ${r.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new V({name:"jsonSerialize",return_:P.string(),access:"public",parameters:[],body:new E("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new C({docs:this.docs}).write(e)}};u();f();var oe=class extends x{constructor({name:e,type:r,access:i,readonly_:o,initializer:a,docs:l,inlineDocs:m,attributes:h,inherited:y}){super();p(this,"name");p(this,"type");p(this,"access");p(this,"readonly_");p(this,"initializer");p(this,"docs");p(this,"inlineDocs");p(this,"attributes");p(this,"inherited");this.name=H(e),this.type=r,this.access=i,this.readonly_=o!=null?o:!1,this.initializer=a,this.docs=l,this.inlineDocs=m,this.attributes=h!=null?h:[],this.inherited=y!=null?y:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let r=new C;r.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),r.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((r,i)=>{i>0&&e.write(", "),r.write(e)}),e.writeLine("]"))}};u();f();var ae=class extends x{constructor({entries:e,multiline:r}){super();p(this,"entries");p(this,"multiline");this.entries=e!=null?e:[],this.multiline=r!=null?r:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:r,value:i}of this.entries)r.write(e),e.write(" => "),i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[r,{key:i,value:o}]of this.entries.entries())r>0&&e.write(", "),i.write(e),e.write(" => "),o.write(e);e.write("]")}};u();f();var W=class extends x{constructor({method:e,arguments_:r,static_:i,multiline:o,on:a}){super();p(this,"method");p(this,"arguments_");p(this,"multiline");p(this,"static_");p(this,"on");this.method=e,this.arguments_=r,this.static_=i!=null?i:!1,this.multiline=o!=null?o:!1,this.on=a}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),me({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};u();f();u();f();var J=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(Mo({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(Uo({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
18
- `)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}e.write(`'${this.internalType.value.replaceAll("'","\\'")}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:v(this.internalType)}}writeStringWithHeredoc({writer:e,value:r}){e.writeLine("<<<EOT"),e.writeNoIndent(r),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:r}){e.writeNode(new k({classReference:r.reference,arguments_:[n.map({entries:r.fields.map(i=>({key:n.string(i.name),value:i.value}))})]}))}writeList({writer:e,list:r}){let i=Oo({values:r.values});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:r}){let i=_o({entries:r.entries});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.key.write(e),e.write(" => "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:r}){return new this({type:"class",reference:e,fields:r})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(r.includes('"')?`\`${r}\``:`"${r}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownMap({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of r)e.writeNode(n.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[o,a]of i)e.write(`'${o}' => `),e.writeNode(n.unknown(a)),e.writeLine(",");e.dedent(),e.write("]")}};function Uo({writer:n,value:t}){return new k({classReference:new R({name:"DateTime",namespace:""}),arguments_:[new E(`'${t}'`)]})}function Mo({writer:n,value:t}){return new W({on:new R({name:"File",namespace:`${n.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new E(`"${t}"`)]})}function _o({entries:n}){return n.filter(t=>!J.isNop(t.key)&&!J.isNop(t.value))}function Oo({values:n}){return n.filter(t=>!J.isNop(t))}u();f();var _e=class extends x{constructor(e){super();p(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),me({writer:e,arguments_:this.arrays.map(r=>se(i=>{if(typeof r=="string"||r instanceof x){i.writeNodeOrString(r);return}i.writeNodeOrString(r.ref),r.fallback&&(i.write(" ?? "),i.writeNodeOrString(r.fallback))}))})}};function Do(n){return new ee(n)}function $o(n){return new te(n)}function Vo(n){return new D(n)}function Wo(n){return new re(n)}function qo(n){return new R(n)}function se(n){return new E(n)}function jo(n){return new ne(n)}function zo(n){return new ie(n)}function Yo(n){return new oe(n)}function Fr(n){return new k(n)}function Go(n){return new W(n)}function Ho(n){return se(t=>{t.write("throw "),t.writeNode(Fr(n))})}function Zo(n){return new ae(n)}function Jo(n){return new V(n)}function Ko(n){return new $(n)}function Qo(n){return new ge(n)}function Xo(n,t){return se(e=>{e.writeNodeOrString(n),e.write(" = "),e.writeNodeOrString(t)})}function ea(n){return se(H(n))}function ta(n){return se(`"${n}"`)}function ra(...n){return new _e(n)}function na(){return new E(n=>{n.write("$this")})}var Br="$client",Oe="Example",kr=`<?php
17
+ `):void 0;i!=null&&i.length>1&&(i.forEach(o=>{e.writeLine(` * ${o}`)}),e.writeLine(" *")),e.write(` * @${r.tagType} `),r.type.write(e,{comment:!0}),r.name!=null&&e.write(` ${r.name}`),i!=null&&i.length===1&&e.write(` ${i[0]}`),e.newLine()}};u();f();u();f();var Me={Public:"public",Private:"private",Protected:"protected"};function Z(n){return Fo(n,[Me.Public,Me.Protected,Me.Private])}function Fo(n,t){return t.reduce((e,r)=>[...e,...n.filter(i=>i.access===r)],[])}var D=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"abstract");p(this,"docs");p(this,"parentClassReference");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);p(this,"constructor_");this.name=e,this.namespace=r,this.abstract=i!=null?i:!1,this.docs=o,this.parentClassReference=a,this.traits=l!=null?l:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new R({name:this.name,namespace:this.namespace})),this.abstract&&e.write("abstract "),this.writeComment(e),e.write(`class ${this.name} `),this.parentClassReference!=null&&(e.write("extends "),this.parentClassReference.write(e)),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:Z(this.fields)}),(this.constructor!=null||this.methods.length>0)&&e.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:e,constructor:this.constructor_}),this.methods.length>0&&e.newLine()),this.writeMethods({writer:e,methods:Z(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new C({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:r}){var i;this.writeConstructorComment({writer:e,constructor:r}),r.access!=null&&e.write(`${r.access} `),e.write("function __construct("),e.indent(),r.parameters.forEach((o,a)=>{a===0&&e.newLine(),o.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(i=r.body)==null||i.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:r}){if(r.parameters.length===0)return;let i=new C;for(let o of r.parameters)i.addTag(o.getCommentTag());i.write(e)}writeFields({writer:e,fields:r}){r.filter(i=>!i.inherited).forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};u();f();var re=class extends x{constructor({name:e,namespace:r,docs:i,traits:o}){super();p(this,"name");p(this,"namespace");p(this,"docs");p(this,"traits");p(this,"fields",[]);p(this,"methods",[]);this.name=e,this.namespace=r,this.docs=i,this.traits=o!=null?o:[]}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}write(e){this.writeComment(e),e.write(`trait ${this.name} `),e.newLine(),e.writeLine("{"),e.indent(),this.traits.length>0&&(e.write("use "),this.traits.forEach((r,i)=>{i>0&&e.write(","),e.writeNode(r)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:Z(this.fields)}),this.writeMethods({writer:e,methods:Z(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new C({docs:this.docs}).write(e)}writeFields({writer:e,fields:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:r}){r.forEach((i,o)=>{o>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};u();f();u();f();function me({writer:n,arguments_:t,multiline:e}){if(t.length===0){n.write("()");return}if(e){Bo({writer:n,arguments_:t});return}ko({writer:n,arguments_:t})}function Bo({writer:n,arguments_:t}){n.writeLine("("),n.indent();for(let e of t)Ir({writer:n,argument:e}),n.writeLine(",");n.dedent(),n.write(")")}function ko({writer:n,arguments_:t}){n.write("("),t.forEach((e,r)=>{r>0&&n.write(", "),Ir({writer:n,argument:e})}),n.write(")")}function Ir({writer:n,argument:t}){Qe(t)?(n.write(`${t.name}: `),n.writeNodeOrString(t.assignment)):t.write(n)}var k=class extends x{constructor({classReference:e,arguments_:r,multiline:i}){super();p(this,"classReference");p(this,"arguments_");p(this,"multiline");this.classReference=e,this.arguments_=r,this.multiline=i!=null?i:!1}write(e){e.write("new "),e.writeNode(this.classReference),me({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};u();f();var E=class extends x{constructor(e){super();p(this,"arg");this.arg=e}write(e){return new Y(this.arg).write(e)}};u();f();u();f();var $=class extends x{constructor({name:e,type:r,docs:i,initializer:o,access:a,readonly_:l}){super();p(this,"name");p(this,"type");p(this,"docs");p(this,"initializer");p(this,"access");p(this,"readonly_");this.name=H(e),this.type=r,this.docs=i,this.initializer=o,this.access=a,this.readonly_=l!=null?l:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(e){this.access!=null&&e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null?(e.write(" = "),this.initializer.write(e)):this.type.isOptional()&&e.write(" = null")}};u();f();var S=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e,{comment:r}={}){switch(this.internalType.type){case"int":e.write("int");break;case"string":e.write("string");break;case"bool":e.write("bool");break;case"float":e.write("float");break;case"date":e.addReference(Lr),e.write("DateTime");break;case"dateTime":e.addReference(Lr),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!r){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:r}),e.write(">");break;case"map":{if(!r){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:r}),e.write(", "),this.internalType.valueType.write(e,{comment:r}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!r){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");for(let i of this.internalType.entries)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:i,comment:r}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((i,o)=>{o>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:i,comment:r})}),e.write("}");break}case"union":{this.getUniqueTypes({types:this.internalType.types,comment:r,writer:e}).forEach((o,a)=>{a>0&&e.write("|"),o.write(e,{comment:r}),a++});break}case"optional":{let i=this.internalType.value.internalType.type==="mixed",o=this.internalType.value.internalType.type==="union";!o&&!i&&e.write("?"),this.internalType.value.write(e,{comment:r}),o&&(e.write("|"),e.writeNode(n.null()));break}case"reference":e.writeNode(this.internalType.value);break;case"enumString":r?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;default:v(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:n.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var e;return(e=this.underlyingTypeIfOptional())!=null?e:this}isOptional(){return this.internalType.type==="optional"}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(e){return new this({type:"array",value:e})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static typeDict(e,{multiline:r}={}){return new this({type:"typeDict",entries:e,multiline:r})}static union(e){return new this({type:"union",types:e})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static null(){return new this({type:"null"})}static reference(e){return new this({type:"reference",value:e})}static enumString(e){return new this({type:"enumString",value:e})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeTypeDictEntry({writer:e,entry:r,comment:i}){e.write(r.key),r.optional&&e.write("?"),e.write(": "),r.valueType.write(e,{comment:i})}getUniqueTypes({writer:e,types:r,comment:i}){let o=new Set;return r.filter(a=>{if(i)return!0;let l=a.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig});return o.has(l)?!1:(o.add(l),!0)})}},Lr=new R({namespace:Ue,name:"DateTime"});u();f();function Sr(n){return n.startsWith("$")?n.slice(1):n}var Pr="values",ne=class extends x{constructor({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l}){super();p(this,"name");p(this,"namespace");p(this,"class_");this.name=e,this.namespace=r,this.class_=new D({name:e,namespace:r,abstract:i,docs:o,parentClassReference:a,traits:l})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let r=Z(this.class_.fields).map(i=>fe(ue({},i),{name:Sr(i.name)}));r.length>0&&this.class_.addConstructor({access:"public",parameters:this.getConstructorParameters({orderedFields:r}),body:d.codeblock(i=>{for(let o of r)i.write(`$this->${o.name} = $${Pr}['${o.name}']`),o.type.isOptional()&&i.write(" ?? null"),i.write(";")})}),this.class_.write(e)}allFieldsAreOptional(){return this.class_.fields.every(e=>e.type.isOptional())}getConstructorParameters({orderedFields:e}){return[new $({name:Pr,type:S.typeDict(e.map(r=>({key:r.name,valueType:r.type,optional:r.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new E("[]"):void 0})]}};u();f();u();f();var V=class extends x{constructor({name:e,access:r,parameters:i,throws:o,return_:a,body:l,docs:m,classReference:h}){super();p(this,"name");p(this,"access");p(this,"parameters");p(this,"throws");p(this,"return_");p(this,"body");p(this,"docs");p(this,"classReference");this.name=e,this.access=r,this.parameters=i,this.throws=o!=null?o:[],this.return_=a,this.body=l,this.docs=m,this.classReference=h}write(e){var r;this.writeComment(e),e.write(`${this.access} function ${this.name}(`),this.parameters.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write("): "),this.return_!=null?this.return_.write(e):e.write("void"),e.writeLine(" {"),e.indent(),(r=this.body)==null||r.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let r=new C({docs:this.docs});for(let i of this.parameters)r.addTag({tagType:"param",type:i.type,name:i.name,docs:i.docs});this.return_!=null&&r.addTag({tagType:"return",type:this.return_});for(let i of this.throws)r.addTag({tagType:"throws",type:S.reference(i)});e.writeNode(r)}};var ie=class extends x{constructor({name:e,namespace:r,backing:i,docs:o,serializable:a}){super();p(this,"name");p(this,"namespace");p(this,"backing");p(this,"docs");p(this,"members",[]);p(this,"serializable");this.name=e,this.namespace=r,this.backing=i,this.docs=o,this.serializable=a!=null?a:!1}addMember(e){this.members.push(e)}write(e){this.writeComment(e),e.write("enum "),e.writeLine(`${this.name}`),this.backing!=null&&e.write(` : ${this.backing}`),this.serializable&&(e.addReference(new R({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let r of this.members)e.write(`case ${r.name}`),r.value!=null&&(typeof r.value=="string"?e.write(` = "${r.value}"`):e.write(` = ${r.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new V({name:"jsonSerialize",return_:S.string(),access:"public",parameters:[],body:new E("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new C({docs:this.docs}).write(e)}};u();f();var oe=class extends x{constructor({name:e,type:r,access:i,readonly_:o,initializer:a,docs:l,inlineDocs:m,attributes:h,inherited:y}){super();p(this,"name");p(this,"type");p(this,"access");p(this,"readonly_");p(this,"initializer");p(this,"docs");p(this,"inlineDocs");p(this,"attributes");p(this,"inherited");this.name=H(e),this.type=r,this.access=i,this.readonly_=o!=null?o:!1,this.initializer=a,this.docs=l,this.inlineDocs=m,this.attributes=h!=null?h:[],this.inherited=y!=null?y:!1}write(e){this.writeComment(e),this.writeAttributesIfPresent(e),e.write(`${this.access} `),this.readonly_&&e.write("readonly "),this.type.write(e),e.write(` ${this.name}`),this.initializer!=null&&(e.write(" = "),this.initializer.write(e)),e.write(";"),this.inlineDocs!=null&&e.write(` // ${this.inlineDocs}`),e.newLine()}writeComment(e){let r=new C;r.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),r.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((r,i)=>{i>0&&e.write(", "),r.write(e)}),e.writeLine("]"))}};u();f();var ae=class extends x{constructor({entries:e,multiline:r}){super();p(this,"entries");p(this,"multiline");this.entries=e!=null?e:[],this.multiline=r!=null?r:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:r,value:i}of this.entries)r.write(e),e.write(" => "),i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[r,{key:i,value:o}]of this.entries.entries())r>0&&e.write(", "),i.write(e),e.write(" => "),o.write(e);e.write("]")}};u();f();var q=class extends x{constructor({method:e,arguments_:r,static_:i,multiline:o,on:a}){super();p(this,"method");p(this,"arguments_");p(this,"multiline");p(this,"static_");p(this,"on");this.method=e,this.arguments_=r,this.static_=i!=null?i:!1,this.multiline=o!=null?o:!1,this.on=a}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),me({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};u();f();u();f();var J=class n extends x{constructor(e){super();p(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"list":{this.writeList({writer:e,list:this.internalType});break}case"boolean":{e.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"file":{e.writeNode(Mo({writer:e,value:this.internalType.value}));break}case"float":{e.write(this.internalType.value.toString());break}case"number":{e.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"reference":{e.writeNode(this.internalType.value);break}case"datetime":{e.writeNode(Uo({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
18
+ `)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}e.write(`'${this.internalType.value.replaceAll("'","\\'")}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:v(this.internalType)}}writeStringWithHeredoc({writer:e,value:r}){e.writeLine("<<<EOT"),e.writeNoIndent(r),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:r}){e.writeNode(new k({classReference:r.reference,arguments_:[n.map({entries:r.fields.map(i=>({key:n.string(i.name),value:i.value}))})]}))}writeList({writer:e,list:r}){let i=Oo({values:r.values});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:r}){let i=_o({entries:r.entries});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let o of i)o.key.write(e),e.write(" => "),o.value.write(e),e.writeLine(",");e.dedent(),e.write("]")}static list({values:e}){return new this({type:"list",values:e})}static boolean(e){return new this({type:"boolean",value:e})}static class_({reference:e,fields:r}){return new this({type:"class",reference:e,fields:r})}static file(e){return new this({type:"file",value:e})}static float(e){return new this({type:"float",value:e})}static datetime(e){return new this({type:"datetime",value:e})}static number(e){return new this({type:"number",value:e})}static map({entries:e}){return new this({type:"map",entries:e})}static reference(e){return new this({type:"reference",value:e})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}writeUnknown({writer:e,value:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(r.includes('"')?`\`${r}\``:`"${r}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownMap({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of r)e.writeNode(n.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:r}){let i=Object.entries(r);if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[o,a]of i)e.write(`'${o}' => `),e.writeNode(n.unknown(a)),e.writeLine(",");e.dedent(),e.write("]")}};function Uo({writer:n,value:t}){return new k({classReference:new R({name:"DateTime",namespace:""}),arguments_:[new E(`'${t}'`)]})}function Mo({writer:n,value:t}){return new q({on:new R({name:"File",namespace:`${n.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new E(`"${t}"`)]})}function _o({entries:n}){return n.filter(t=>!J.isNop(t.key)&&!J.isNop(t.value))}function Oo({values:n}){return n.filter(t=>!J.isNop(t))}u();f();var _e=class extends x{constructor(e){super();p(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),me({writer:e,arguments_:this.arrays.map(r=>se(i=>{if(typeof r=="string"||r instanceof x){i.writeNodeOrString(r);return}i.writeNodeOrString(r.ref),r.fallback&&(i.write(" ?? "),i.writeNodeOrString(r.fallback))}))})}};function Do(n){return new ee(n)}function $o(n){return new te(n)}function Vo(n){return new D(n)}function qo(n){return new re(n)}function Wo(n){return new R(n)}function se(n){return new E(n)}function jo(n){return new ne(n)}function zo(n){return new ie(n)}function Yo(n){return new oe(n)}function Fr(n){return new k(n)}function Go(n){return new q(n)}function Ho(n){return se(t=>{t.write("throw "),t.writeNode(Fr(n))})}function Zo(n){return new ae(n)}function Jo(n){return new V(n)}function Ko(n){return new $(n)}function Qo(n){return new ge(n)}function Xo(n,t){return se(e=>{e.writeNodeOrString(n),e.write(" = "),e.writeNodeOrString(t)})}function ea(n){return se(H(n))}function ta(n){return se(`"${n}"`)}function ra(...n){return new _e(n)}function na(){return new E(n=>{n.write("$this")})}var Br="$client",Oe="Example",kr=`<?php
19
19
 
20
- `,De=class{constructor({context:t}){p(this,"context");this.context=t}async generateSnippet({endpoint:t,request:e}){var i;let r=this.buildCodeBlock({endpoint:t,snippet:e});return kr+await r.toStringAsync({namespace:Oe,rootNamespace:Oe,customConfig:(i=this.context.customConfig)!=null?i:{}})}generateSnippetSync({endpoint:t,request:e}){var i;let r=this.buildCodeBlock({endpoint:t,snippet:e});return kr+r.toString({namespace:Oe,rootNamespace:Oe,customConfig:(i=this.context.customConfig)!=null?i:{}})}buildCodeBlock({endpoint:t,snippet:e}){return d.codeblock(r=>{r.writeNodeStatement(this.constructClient({endpoint:t,snippet:e})),r.writeNodeStatement(this.callMethod({endpoint:t,snippet:e}))})}constructClient({endpoint:t,snippet:e}){return d.codeblock(r=>{r.write(`${Br} = `),r.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:t,snippet:e})))})}callMethod({endpoint:t,snippet:e}){return d.invokeMethod({on:d.codeblock(Br),method:this.getMethod({endpoint:t}),arguments_:this.getMethodArgs({endpoint:t,snippet:e}),multiline:!0})}getConstructorArgs({endpoint:t,snippet:e}){let r=[];t.auth!=null&&(e.auth!=null?r.push(...this.getConstructorAuthArgs({auth:t.auth,values:e.auth})):this.context.errors.add({severity:w.Warning,message:`Auth with ${t.auth.type} configuration is required for this endpoint`}));let i=[],o=this.getConstructorBaseUrlArgs({baseUrl:e.baseURL,environment:e.environment});return o.length>0&&i.push(...o),this.context.errors.scope(B.Headers),this.context.ir.headers!=null&&e.headers!=null&&i.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:e.headers})),this.context.errors.unscope(),i.length===0?r:[...r,{name:"options",assignment:d.TypeLiteral.map({entries:i.map(a=>({key:d.TypeLiteral.string(a.name),value:a.value}))})}]}getConstructorAuthArgs({auth:t,values:e}){switch(t.type){case"basic":return e.type!=="basic"?(this.context.errors.add({severity:w.Critical,message:this.context.newAuthMismatchError({auth:t,values:e}).message}),[]):this.getConstructorBasicAuthArgs({auth:t,values:e});case"bearer":return e.type!=="bearer"?(this.context.errors.add({severity:w.Critical,message:this.context.newAuthMismatchError({auth:t,values:e}).message}),[]):this.getConstructorBearerAuthArgs({auth:t,values:e});case"header":return e.type!=="header"?(this.context.errors.add({severity:w.Critical,message:this.context.newAuthMismatchError({auth:t,values:e}).message}),[]):this.getConstructorHeaderAuthArgs({auth:t,values:e});default:v(t)}}getConstructorBasicAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.username),assignment:d.TypeLiteral.string(e.username)},{name:this.context.getPropertyName(t.password),assignment:d.TypeLiteral.string(e.password)}]}getConstructorBaseUrlArgs({baseUrl:t,environment:e}){let r=this.getBaseUrlArg({baseUrl:t,environment:e});return d.TypeLiteral.isNop(r)?[]:[{name:"baseUrl",value:r}]}getBaseUrlArg({baseUrl:t,environment:e}){if(t!=null&&e!=null)return this.context.errors.add({severity:w.Critical,message:"Cannot specify both baseUrl and environment options"}),d.TypeLiteral.nop();if(t!=null)return d.TypeLiteral.string(t);if(e!=null){if(this.context.isSingleEnvironmentID(e)){let r=this.context.getEnvironmentClassAccessFromID(e);return r==null?(this.context.errors.add({severity:w.Warning,message:`Environment ${JSON.stringify(e)} was not found`}),d.TypeLiteral.nop()):d.TypeLiteral.reference(d.codeblock(i=>{i.writeNode(r),i.write("->value")}))}this.context.isMultiEnvironmentValues(e)&&this.context.errors.add({severity:w.Warning,message:"The PHP SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}return d.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.token),assignment:d.TypeLiteral.string(e.token)}]}getConstructorHeaderAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.header.typeReference,value:e.value})}]}getConstructorHeaderArgs({headers:t,values:e}){let r=[];for(let i of t){let o=this.getConstructorHeaderArg({header:i,value:e.value});o!=null&&r.push({name:this.context.getPropertyName(i.name.name),value:o})}return r}getConstructorHeaderArg({header:t,value:e}){let r=this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:e});if(!d.TypeLiteral.isNop(r))return r}getMethodArgs({endpoint:t,snippet:e}){switch(t.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:t.request,snippet:e});default:v(t.request)}}getMethodArgsForBodyRequest({request:t,snippet:e}){let r=[];if(this.context.errors.scope(B.PathParameters),t.pathParameters!=null){let i=this.getPathParameters({namedParameters:t.pathParameters,snippet:e});r.push(...i.map(o=>o.value))}return this.context.errors.unscope(),this.context.errors.scope(B.RequestBody),t.body!=null&&r.push(this.getBodyRequestArg({body:t.body,value:e.requestBody})),this.context.errors.unscope(),r}getBodyRequestArg({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:v(t)}}getBytesBodyRequestArg({value:t}){return this.context.errors.add({severity:w.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),d.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:t,snippet:e}){let r=[];this.context.errors.scope(B.PathParameters);let o=[];t.pathParameters!=null&&o.push(...this.getPathParameters({namedParameters:t.pathParameters,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(B.RequestBody);let a=this.getFilePropertyInfo({request:t,snippet:e});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:t,inlinePathParameters:!1})||r.push(...o.map(l=>l.value)),this.context.needsRequestParameter({request:t,inlinePathParameters:!1,inlineFileProperties:!0})&&r.push(this.getInlinedRequestArg({request:t,snippet:e,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:t,inlinePathParameters:!1})?o:[],filePropertyInfo:a})),r}getFilePropertyInfo({request:t,snippet:e}){return t.body==null||!this.context.isFileUploadRequestBody(t.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:t.body,value:e.requestBody})}getInlinedRequestArg({request:t,snippet:e,pathParameterFields:r,filePropertyInfo:i}){var y,g,b,A;this.context.errors.scope(B.QueryParameters);let a=this.context.associateQueryParametersByWireValue({parameters:(y=t.queryParameters)!=null?y:[],values:(g=e.queryParameters)!=null?g:{}}).map(I=>({name:this.context.getPropertyName(I.name.name),value:this.context.dynamicTypeLiteralMapper.convert(I)}));this.context.errors.unscope(),this.context.errors.scope(B.Headers);let m=this.context.associateByWireValue({parameters:(b=t.headers)!=null?b:[],values:(A=e.headers)!=null?A:{}}).map(I=>({name:this.context.getPropertyName(I.name.name),value:this.context.dynamicTypeLiteralMapper.convert(I)}));this.context.errors.unscope(),this.context.errors.scope(B.RequestBody);let h=t.body!=null?this.getInlinedRequestBodyConstructorFields({body:t.body,value:e.requestBody,filePropertyInfo:i}):[];return this.context.errors.unscope(),d.TypeLiteral.class_({reference:d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getRequestNamespace(t.declaration.fernFilepath)}),fields:[...r,...a,...m,...h]})}getInlinedRequestBodyConstructorFields({body:t,value:e,filePropertyInfo:r}){switch(t.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:t.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:t,value:e})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:r});default:v(t)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:t}){return[...t.fileFields,...t.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:t,value:e}){return{name:this.context.getPropertyName(t.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:t.bodyType,value:e})}}getReferencedRequestBodyPropertyTypeLiteral({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:v(t)}}getInlinedRequestBodyPropertyConstructorFields({parameters:t,value:e}){var o;let r=[],i=this.context.associateByWireValue({parameters:t,values:(o=this.context.getRecord(e))!=null?o:{}});for(let a of i)r.push({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)});return r}getPathParameters({namedParameters:t,snippet:e}){var o;let r=[],i=this.context.associateByWireValue({parameters:t,values:(o=e.pathParameters)!=null?o:{}});for(let a of i)r.push({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)});return r}getMethod({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${t.declaration.fernFilepath.allParts.map(e=>this.context.getPropertyName(e)).join("->")}->${this.context.getMethodName(t.declaration.name)}`:this.context.getMethodName(t.declaration.name)}getRootClientClassInstantiation(t){return d.instantiateClass({classReference:d.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:t,multiline:!0})}};u();f();u();f();var $e=class{constructor({context:t}){p(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?d.TypeLiteral.null():(this.context.errors.add({severity:w.Critical,message:"Expected non-null value, but got null"}),d.TypeLiteral.nop());if(t.value===void 0)return d.TypeLiteral.nop();switch(t.typeReference.type){case"list":case"set":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?d.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"unknown":return this.convertUnknown({value:t.value});default:v(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.string(r)}default:v(t)}}convertList({list:t,value:e}){return Array.isArray(e)?d.TypeLiteral.list({values:e.map((r,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:w.Critical,message:`Expected array but got: ${typeof e}`}),d.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:w.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),d.TypeLiteral.nop()):d.TypeLiteral.map({entries:Object.entries(e).map(([r,i])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}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 this.convertDiscriminatedUnion({discriminatedUnion:t,value:e});case"enum":return this.convertEnum({enum_:t,value:e});case"object":return this.convertObject({object_:t,value:e});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:v(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){return d.TypeLiteral.string("todo")}convertObject({object_:t,value:e}){var i;let r=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return d.TypeLiteral.class_({reference:d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),fields:r.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getPropertyName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let r=this.getEnumValueName({enum_:t,value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.reference(d.codeblock(i=>{i.writeNode(d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)})),i.write("::"),i.write(r),i.write("->value")}))}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:w.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(i=>i.wireValue===e);if(r==null){this.context.errors.add({severity:w.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return r==null?d.TypeLiteral.nop():r}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let r of t.types)try{return this.convert({typeReference:r,value:e})}catch(i){continue}this.context.errors.add({severity:w.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return d.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.number(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(i)}case"DATE":case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.datetime(i)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.string(i)}default:v(t)}}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==="false"?!1:t:t;return this.context.getValueAsBoolean({value:r})}};u();f();var Ve=class{constructor({context:t}){p(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let r={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let a of t.properties)switch(a.type){case"file":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getSingleFileProperty({property:a,record:i})});break;case"fileArray":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getArrayFileProperty({property:a,record:i})});break;case"bodyProperty":r.bodyPropertyFields.push({name:this.context.getPropertyName(a.name.name),value:this.getBodyProperty({property:a,record:i})});break;default:v(a)}return r}getSingleFileProperty({property:t,record:e}){let r=this.context.getSingleFileValue({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.file(r)}getArrayFileProperty({property:t,record:e}){let r=this.context.getFileArrayValues({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.list({values:r.map(i=>d.TypeLiteral.file(i))})}getBodyProperty({property:t,record:e}){let r=e[t.name.wireValue];return r==null?d.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:r})}};var ia=["use","clone","list"],oa="Requests",aa="Types",We=class n extends Re{constructor({ir:e,config:r}){var i;super({ir:e,config:r});p(this,"ir");p(this,"customConfig");p(this,"dynamicTypeLiteralMapper");p(this,"filePropertyMapper");p(this,"rootNamespace");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeLiteralMapper=new $e({context:this}),this.filePropertyMapper=new Ve({context:this}),this.rootNamespace=sa({organization:r.organization,namespaceOverride:(i=this.customConfig)==null?void 0:i.namespace})}clone(){return new n({ir:this.ir,config:this.config})}getParameterName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getPropertyName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getMethodName(e){let r=e.camelCase.unsafeName;return ia.includes(r)?r:e.camelCase.safeName}getClassName(e){return e.pascalCase.safeName}getRootClientClassName(){var e,r,i;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((r=this.customConfig)==null?void 0:r["client-class-name"])!=null?(i=this.customConfig)==null?void 0:i["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return d.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,oa)}getTypesNamespace(e){return this.getNamespace(e,aa)}getNamespace(e,r){let i=e.allParts.map(o=>o.pascalCase.safeName);return i=r!=null?[...i,r]:i,[this.rootNamespace,...i].join("\\")}getEnvironmentClassAccessFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return d.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference(r)),i.write("::"),i.write(this.getClassName(r))})}getEnvironmentClassReference(e){return d.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${ce(ke(this.config.organization))}`}};function sa({organization:n,namespaceOverride:t}){return t!=null?t:`${ce(ke(n))}`}var Xe=class extends ve{constructor({ir:t,config:e}){super(new We({ir:t,config:e}))}createSnippetGenerator(t){return new De({context:t})}};0&&(module.exports={DynamicSnippetsGenerator});
20
+ `,De=class{constructor({context:t}){p(this,"context");this.context=t}async generateSnippet({endpoint:t,request:e}){var i;let r=this.buildCodeBlock({endpoint:t,snippet:e});return kr+await r.toStringAsync({namespace:Oe,rootNamespace:Oe,customConfig:(i=this.context.customConfig)!=null?i:{}})}generateSnippetSync({endpoint:t,request:e}){var i;let r=this.buildCodeBlock({endpoint:t,snippet:e});return kr+r.toString({namespace:Oe,rootNamespace:Oe,customConfig:(i=this.context.customConfig)!=null?i:{}})}buildCodeBlock({endpoint:t,snippet:e}){return d.codeblock(r=>{r.writeNodeStatement(this.constructClient({endpoint:t,snippet:e})),r.writeNodeStatement(this.callMethod({endpoint:t,snippet:e}))})}constructClient({endpoint:t,snippet:e}){return d.codeblock(r=>{r.write(`${Br} = `),r.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:t,snippet:e})))})}callMethod({endpoint:t,snippet:e}){return d.invokeMethod({on:d.codeblock(Br),method:this.getMethod({endpoint:t}),arguments_:this.getMethodArgs({endpoint:t,snippet:e}),multiline:!0})}getConstructorArgs({endpoint:t,snippet:e}){let r=[];t.auth!=null&&(e.auth!=null?r.push(...this.getConstructorAuthArgs({auth:t.auth,values:e.auth})):this.context.errors.add({severity:w.Warning,message:`Auth with ${t.auth.type} configuration is required for this endpoint`}));let i=[],o=this.getConstructorBaseUrlArgs({baseUrl:e.baseURL,environment:e.environment});return o.length>0&&i.push(...o),this.context.errors.scope(B.Headers),this.context.ir.headers!=null&&e.headers!=null&&i.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:e.headers})),this.context.errors.unscope(),i.length===0?r:[...r,{name:"options",assignment:d.TypeLiteral.map({entries:i.map(a=>({key:d.TypeLiteral.string(a.name),value:a.value}))})}]}getConstructorAuthArgs({auth:t,values:e}){switch(t.type){case"basic":return e.type!=="basic"?(this.context.errors.add({severity:w.Critical,message:this.context.newAuthMismatchError({auth:t,values:e}).message}),[]):this.getConstructorBasicAuthArgs({auth:t,values:e});case"bearer":return e.type!=="bearer"?(this.context.errors.add({severity:w.Critical,message:this.context.newAuthMismatchError({auth:t,values:e}).message}),[]):this.getConstructorBearerAuthArgs({auth:t,values:e});case"header":return e.type!=="header"?(this.context.errors.add({severity:w.Critical,message:this.context.newAuthMismatchError({auth:t,values:e}).message}),[]):this.getConstructorHeaderAuthArgs({auth:t,values:e});default:v(t)}}getConstructorBasicAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.username),assignment:d.TypeLiteral.string(e.username)},{name:this.context.getPropertyName(t.password),assignment:d.TypeLiteral.string(e.password)}]}getConstructorBaseUrlArgs({baseUrl:t,environment:e}){let r=this.getBaseUrlArg({baseUrl:t,environment:e});return d.TypeLiteral.isNop(r)?[]:[{name:"baseUrl",value:r}]}getBaseUrlArg({baseUrl:t,environment:e}){if(t!=null&&e!=null)return this.context.errors.add({severity:w.Critical,message:"Cannot specify both baseUrl and environment options"}),d.TypeLiteral.nop();if(t!=null)return d.TypeLiteral.string(t);if(e!=null){if(this.context.isSingleEnvironmentID(e)){let r=this.context.getEnvironmentClassAccessFromID(e);return r==null?(this.context.errors.add({severity:w.Warning,message:`Environment ${JSON.stringify(e)} was not found`}),d.TypeLiteral.nop()):d.TypeLiteral.reference(d.codeblock(i=>{i.writeNode(r),i.write("->value")}))}this.context.isMultiEnvironmentValues(e)&&this.context.errors.add({severity:w.Warning,message:"The PHP SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}return d.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.token),assignment:d.TypeLiteral.string(e.token)}]}getConstructorHeaderAuthArgs({auth:t,values:e}){return[{name:this.context.getPropertyName(t.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.header.typeReference,value:e.value})}]}getConstructorHeaderArgs({headers:t,values:e}){let r=[];for(let i of t){let o=this.getConstructorHeaderArg({header:i,value:e.value});o!=null&&r.push({name:this.context.getPropertyName(i.name.name),value:o})}return r}getConstructorHeaderArg({header:t,value:e}){let r=this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:e});if(!d.TypeLiteral.isNop(r))return r}getMethodArgs({endpoint:t,snippet:e}){switch(t.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:t.request,snippet:e});default:v(t.request)}}getMethodArgsForBodyRequest({request:t,snippet:e}){let r=[];if(this.context.errors.scope(B.PathParameters),t.pathParameters!=null){let i=this.getPathParameters({namedParameters:t.pathParameters,snippet:e});r.push(...i.map(o=>o.value))}return this.context.errors.unscope(),this.context.errors.scope(B.RequestBody),t.body!=null&&r.push(this.getBodyRequestArg({body:t.body,value:e.requestBody})),this.context.errors.unscope(),r}getBodyRequestArg({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:v(t)}}getBytesBodyRequestArg({value:t}){return this.context.errors.add({severity:w.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),d.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:t,snippet:e}){let r=[];this.context.errors.scope(B.PathParameters);let o=[];t.pathParameters!=null&&o.push(...this.getPathParameters({namedParameters:t.pathParameters,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(B.RequestBody);let a=this.getFilePropertyInfo({request:t,snippet:e});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:t,inlinePathParameters:!1})||r.push(...o.map(l=>l.value)),this.context.needsRequestParameter({request:t,inlinePathParameters:!1,inlineFileProperties:!0})&&r.push(this.getInlinedRequestArg({request:t,snippet:e,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:t,inlinePathParameters:!1})?o:[],filePropertyInfo:a})),r}getFilePropertyInfo({request:t,snippet:e}){return t.body==null||!this.context.isFileUploadRequestBody(t.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:t.body,value:e.requestBody})}getInlinedRequestArg({request:t,snippet:e,pathParameterFields:r,filePropertyInfo:i}){var y,g,b,A;this.context.errors.scope(B.QueryParameters);let a=this.context.associateQueryParametersByWireValue({parameters:(y=t.queryParameters)!=null?y:[],values:(g=e.queryParameters)!=null?g:{}}).map(I=>({name:this.context.getPropertyName(I.name.name),value:this.context.dynamicTypeLiteralMapper.convert(I)}));this.context.errors.unscope(),this.context.errors.scope(B.Headers);let m=this.context.associateByWireValue({parameters:(b=t.headers)!=null?b:[],values:(A=e.headers)!=null?A:{}}).map(I=>({name:this.context.getPropertyName(I.name.name),value:this.context.dynamicTypeLiteralMapper.convert(I)}));this.context.errors.unscope(),this.context.errors.scope(B.RequestBody);let h=t.body!=null?this.getInlinedRequestBodyConstructorFields({body:t.body,value:e.requestBody,filePropertyInfo:i}):[];return this.context.errors.unscope(),d.TypeLiteral.class_({reference:d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getRequestNamespace(t.declaration.fernFilepath)}),fields:[...r,...a,...m,...h]})}getInlinedRequestBodyConstructorFields({body:t,value:e,filePropertyInfo:r}){switch(t.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:t.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:t,value:e})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:r});default:v(t)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:t}){return[...t.fileFields,...t.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:t,value:e}){return{name:this.context.getPropertyName(t.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:t.bodyType,value:e})}}getReferencedRequestBodyPropertyTypeLiteral({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:v(t)}}getInlinedRequestBodyPropertyConstructorFields({parameters:t,value:e}){var o;let r=[],i=this.context.associateByWireValue({parameters:t,values:(o=this.context.getRecord(e))!=null?o:{}});for(let a of i)r.push({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)});return r}getPathParameters({namedParameters:t,snippet:e}){var o;let r=[],i=this.context.associateByWireValue({parameters:t,values:(o=e.pathParameters)!=null?o:{}});for(let a of i)r.push({name:this.context.getPropertyName(a.name.name),value:this.context.dynamicTypeLiteralMapper.convert(a)});return r}getMethod({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${t.declaration.fernFilepath.allParts.map(e=>this.context.getPropertyName(e)).join("->")}->${this.context.getMethodName(t.declaration.name)}`:this.context.getMethodName(t.declaration.name)}getRootClientClassInstantiation(t){return d.instantiateClass({classReference:d.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:t,multiline:!0})}};u();f();u();f();var $e=class{constructor({context:t}){p(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?d.TypeLiteral.null():(this.context.errors.add({severity:w.Critical,message:"Expected non-null value, but got null"}),d.TypeLiteral.nop());if(t.value===void 0)return d.TypeLiteral.nop();switch(t.typeReference.type){case"list":case"set":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?d.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"unknown":return this.convertUnknown({value:t.value});default:v(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.string(r)}default:v(t)}}convertList({list:t,value:e}){return Array.isArray(e)?d.TypeLiteral.list({values:e.map((r,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:w.Critical,message:`Expected array but got: ${typeof e}`}),d.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:w.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),d.TypeLiteral.nop()):d.TypeLiteral.map({entries:Object.entries(e).map(([r,i])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}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 this.convertDiscriminatedUnion({discriminatedUnion:t,value:e});case"enum":return this.convertEnum({enum_:t,value:e});case"object":return this.convertObject({object_:t,value:e});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:v(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){return d.TypeLiteral.string("todo")}convertObject({object_:t,value:e}){var i;let r=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return d.TypeLiteral.class_({reference:d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),fields:r.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getPropertyName(o.name.name),value:this.convert(o)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let r=this.getEnumValueName({enum_:t,value:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.reference(d.codeblock(i=>{i.writeNode(d.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)})),i.write("::"),i.write(r),i.write("->value")}))}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:w.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(i=>i.wireValue===e);if(r==null){this.context.errors.add({severity:w.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return r==null?d.TypeLiteral.nop():r}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let r of t.types)try{return this.convert({typeReference:r,value:e})}catch(i){continue}this.context.errors.add({severity:w.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return d.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.number(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:r});return i==null?d.TypeLiteral.nop():d.TypeLiteral.boolean(i)}case"DATE":case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.datetime(i)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?d.TypeLiteral.nop():d.TypeLiteral.string(i)}default:v(t)}}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==="false"?!1:t:t;return this.context.getValueAsBoolean({value:r})}};u();f();var Ve=class{constructor({context:t}){p(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let r={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let a of t.properties)switch(a.type){case"file":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getSingleFileProperty({property:a,record:i})});break;case"fileArray":r.fileFields.push({name:this.context.getPropertyName(a.name),value:this.getArrayFileProperty({property:a,record:i})});break;case"bodyProperty":r.bodyPropertyFields.push({name:this.context.getPropertyName(a.name.name),value:this.getBodyProperty({property:a,record:i})});break;default:v(a)}return r}getSingleFileProperty({property:t,record:e}){let r=this.context.getSingleFileValue({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.file(r)}getArrayFileProperty({property:t,record:e}){let r=this.context.getFileArrayValues({property:t,record:e});return r==null?d.TypeLiteral.nop():d.TypeLiteral.list({values:r.map(i=>d.TypeLiteral.file(i))})}getBodyProperty({property:t,record:e}){let r=e[t.name.wireValue];return r==null?d.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:r})}};var ia=["use","clone","list"],oa="Requests",aa="Types",qe=class n extends Re{constructor({ir:e,config:r}){var i;super({ir:e,config:r});p(this,"ir");p(this,"customConfig");p(this,"dynamicTypeLiteralMapper");p(this,"filePropertyMapper");p(this,"rootNamespace");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeLiteralMapper=new $e({context:this}),this.filePropertyMapper=new Ve({context:this}),this.rootNamespace=sa({organization:r.organization,namespaceOverride:(i=this.customConfig)==null?void 0:i.namespace})}clone(){return new n({ir:this.ir,config:this.config})}getParameterName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getPropertyName(e){return this.prependUnderscoreIfNeeded(e.camelCase.unsafeName)}getMethodName(e){let r=e.camelCase.unsafeName;return ia.includes(r)?r:e.camelCase.safeName}getClassName(e){return e.pascalCase.safeName}getRootClientClassName(){var e,r,i;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((r=this.customConfig)==null?void 0:r["client-class-name"])!=null?(i=this.customConfig)==null?void 0:i["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return d.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,oa)}getTypesNamespace(e){return this.getNamespace(e,aa)}getNamespace(e,r){let i=e.allParts.map(o=>o.pascalCase.safeName);return i=r!=null?[...i,r]:i,[this.rootNamespace,...i].join("\\")}getEnvironmentClassAccessFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return d.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference(r)),i.write("::"),i.write(this.getClassName(r))})}getEnvironmentClassReference(e){return d.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${ce(ke(this.config.organization))}`}};function sa({organization:n,namespaceOverride:t}){return t!=null?t:`${ce(ke(n))}`}var Xe=class extends ve{constructor({ir:t,config:e}){super(new qe({ir:t,config:e}))}async generate(t){return super.generate(t)}generateSync(t){return super.generateSync(t)}createSnippetGenerator(t){return new De({context:t})}};0&&(module.exports={DynamicSnippetsGenerator});
21
21
  /*! Bundled license information:
22
22
 
23
23
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -9,6 +9,8 @@ declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<
9
9
  ir: FernIr.dynamic.DynamicIntermediateRepresentation;
10
10
  config: FernGeneratorExec.GeneratorConfig;
11
11
  });
12
+ generate(request: FernIr.dynamic.EndpointSnippetRequest): Promise<FernIr.dynamic.EndpointSnippetResponse>;
13
+ generateSync(request: FernIr.dynamic.EndpointSnippetRequest): FernIr.dynamic.EndpointSnippetResponse;
12
14
  protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator;
13
15
  }
14
16
 
package/cjs/index.cjs CHANGED
@@ -29,7 +29,7 @@ ${this.buffer}`:r+`
29
29
  `):void 0;o!=null&&o.length>1&&(o.forEach(i=>{r.writeLine(` * ${i}`)}),r.writeLine(" *")),r.write(` * @${n.tagType} `),n.type.write(r,{comment:!0}),n.name!=null&&r.write(` ${n.name}`),o!=null&&o.length===1&&r.write(` ${o[0]}`),r.newLine()}};a();s();a();s();var Bt={Public:"public",Private:"private",Protected:"protected"};function ve(t){return ix(t,[Bt.Public,Bt.Protected,Bt.Private])}function ix(t,e){return e.reduce((r,n)=>[...r,...t.filter(o=>o.access===n)],[])}var ie=class extends w{constructor({name:r,namespace:n,abstract:o,docs:i,parentClassReference:u,traits:p}){super();d(this,"name");d(this,"namespace");d(this,"abstract");d(this,"docs");d(this,"parentClassReference");d(this,"traits");d(this,"fields",[]);d(this,"methods",[]);d(this,"constructor_");this.name=r,this.namespace=n,this.abstract=o!=null?o:!1,this.docs=i,this.parentClassReference=u,this.traits=p!=null?p:[]}addConstructor(r){this.constructor_=r}addField(r){this.fields.push(r)}addMethod(r){this.methods.push(r)}addTrait(r){this.traits.push(r)}write(r){r.addReference(new L({name:this.name,namespace:this.namespace})),this.abstract&&r.write("abstract "),this.writeComment(r),r.write(`class ${this.name} `),this.parentClassReference!=null&&(r.write("extends "),this.parentClassReference.write(r)),r.newLine(),r.writeLine("{"),r.indent(),this.traits.length>0&&(r.write("use "),this.traits.forEach((n,o)=>{o>0&&r.write(","),r.writeNode(n)}),r.writeTextStatement(""),r.newLine()),this.writeFields({writer:r,fields:ve(this.fields)}),(this.constructor!=null||this.methods.length>0)&&r.newLine(),this.constructor_!=null&&(this.writeConstructor({writer:r,constructor:this.constructor_}),this.methods.length>0&&r.newLine()),this.writeMethods({writer:r,methods:ve(this.methods)}),r.dedent(),r.writeLine("}")}writeComment(r){if(this.docs==null)return;new k({docs:this.docs}).write(r)}writeConstructor({writer:r,constructor:n}){var o;this.writeConstructorComment({writer:r,constructor:n}),n.access!=null&&r.write(`${n.access} `),r.write("function __construct("),r.indent(),n.parameters.forEach((i,u)=>{u===0&&r.newLine(),i.write(r),r.writeLine(",")}),r.dedent(),r.writeLine(")"),r.writeLine("{"),r.indent(),(o=n.body)==null||o.write(r),r.writeNewLineIfLastLineNot(),r.dedent(),r.writeLine("}")}writeConstructorComment({writer:r,constructor:n}){if(n.parameters.length===0)return;let o=new k;for(let i of n.parameters)o.addTag(i.getCommentTag());o.write(r)}writeFields({writer:r,fields:n}){n.filter(o=>!o.inherited).forEach((o,i)=>{i>0&&r.newLine(),o.write(r),r.writeNewLineIfLastLineNot()})}writeMethods({writer:r,methods:n}){n.forEach((o,i)=>{i>0&&r.newLine(),o.write(r),r.writeNewLineIfLastLineNot()})}};a();s();var Ue=class extends w{constructor({name:r,namespace:n,docs:o,traits:i}){super();d(this,"name");d(this,"namespace");d(this,"docs");d(this,"traits");d(this,"fields",[]);d(this,"methods",[]);this.name=r,this.namespace=n,this.docs=o,this.traits=i!=null?i:[]}addField(r){this.fields.push(r)}addMethod(r){this.methods.push(r)}write(r){this.writeComment(r),r.write(`trait ${this.name} `),r.newLine(),r.writeLine("{"),r.indent(),this.traits.length>0&&(r.write("use "),this.traits.forEach((n,o)=>{o>0&&r.write(","),r.writeNode(n)}),r.writeTextStatement(""),r.newLine()),this.writeFields({writer:r,fields:ve(this.fields)}),this.writeMethods({writer:r,methods:ve(this.methods)}),r.dedent(),r.writeLine("}")}writeComment(r){if(this.docs==null)return;new k({docs:this.docs}).write(r)}writeFields({writer:r,fields:n}){n.forEach((o,i)=>{i>0&&r.newLine(),o.write(r),r.writeNewLineIfLastLineNot()})}writeMethods({writer:r,methods:n}){n.forEach((o,i)=>{i>0&&r.newLine(),o.write(r),r.writeNewLineIfLastLineNot()})}};a();s();a();s();function fr({writer:t,arguments_:e,multiline:r}){if(e.length===0){t.write("()");return}if(r){ax({writer:t,arguments_:e});return}sx({writer:t,arguments_:e})}function ax({writer:t,arguments_:e}){t.writeLine("("),t.indent();for(let r of e)vp({writer:t,argument:r}),t.writeLine(",");t.dedent(),t.write(")")}function sx({writer:t,arguments_:e}){t.write("("),e.forEach((r,n)=>{n>0&&t.write(", "),vp({writer:t,argument:r})}),t.write(")")}function vp({writer:t,argument:e}){wo(e)?(t.write(`${e.name}: `),t.writeNodeOrString(e.assignment)):e.write(t)}var J=class extends w{constructor({classReference:r,arguments_:n,multiline:o}){super();d(this,"classReference");d(this,"arguments_");d(this,"multiline");this.classReference=r,this.arguments_=n,this.multiline=o!=null?o:!1}write(r){r.write("new "),r.writeNode(this.classReference),fr({writer:r,arguments_:this.arguments_,multiline:this.multiline})}};a();s();var B=class extends w{constructor(r){super();d(this,"arg");this.arg=r}write(r){return new he(this.arg).write(r)}};a();s();a();s();var ae=class extends w{constructor({name:r,type:n,docs:o,initializer:i,access:u,readonly_:p}){super();d(this,"name");d(this,"type");d(this,"docs");d(this,"initializer");d(this,"access");d(this,"readonly_");this.name=xe(r),this.type=n,this.docs=o,this.initializer=i,this.access=u,this.readonly_=p!=null?p:!1}getCommentTag(){return{tagType:"param",type:this.type,name:this.name,docs:this.docs}}write(r){this.access!=null&&r.write(`${this.access} `),this.readonly_&&r.write("readonly "),this.type.write(r),r.write(` ${this.name}`),this.initializer!=null?(r.write(" = "),this.initializer.write(r)):this.type.isOptional()&&r.write(" = null")}};a();s();var D=class t extends w{constructor(r){super();d(this,"internalType");this.internalType=r}write(r,{comment:n}={}){switch(this.internalType.type){case"int":r.write("int");break;case"string":r.write("string");break;case"bool":r.write("bool");break;case"float":r.write("float");break;case"date":r.addReference(wp),r.write("DateTime");break;case"dateTime":r.addReference(wp),r.write("DateTime");break;case"mixed":r.write("mixed");break;case"object":r.write("object");break;case"array":if(!n){r.write("array");break}r.write("array<"),this.internalType.value.write(r,{comment:n}),r.write(">");break;case"map":{if(!n){r.write("array");break}r.write("array<"),this.internalType.keyType.write(r,{comment:n}),r.write(", "),this.internalType.valueType.write(r,{comment:n}),r.write(">");break}case"null":{r.write("null");break}case"typeDict":{if(!n){r.write("array");break}if(this.internalType.multiline){r.writeLine("array{");for(let o of this.internalType.entries)r.write(" * "),this.writeTypeDictEntry({writer:r,entry:o,comment:n}),r.writeLine(",");r.write(" * }");break}r.write("array{"),this.internalType.entries.forEach((o,i)=>{i>0&&r.write(", "),this.writeTypeDictEntry({writer:r,entry:o,comment:n})}),r.write("}");break}case"union":{this.getUniqueTypes({types:this.internalType.types,comment:n,writer:r}).forEach((i,u)=>{u>0&&r.write("|"),i.write(r,{comment:n}),u++});break}case"optional":{let o=this.internalType.value.internalType.type==="mixed",i=this.internalType.value.internalType.type==="union";!i&&!o&&r.write("?"),this.internalType.value.write(r,{comment:n}),i&&(r.write("|"),r.writeNode(t.null()));break}case"reference":r.writeNode(this.internalType.value);break;case"enumString":n?(r.write("value-of<"),r.writeNode(this.internalType.value),r.write(">")):r.write("string");break;default:P(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:t.optional(this)}underlyingTypeIfOptional(){if(this.internalType.type==="optional")return this.internalType.value}underlyingType(){var r;return(r=this.underlyingTypeIfOptional())!=null?r:this}isOptional(){return this.internalType.type==="optional"}static int(){return new this({type:"int"})}static string(){return new this({type:"string"})}static bool(){return new this({type:"bool"})}static float(){return new this({type:"float"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static mixed(){return new this({type:"mixed"})}static object(){return new this({type:"object"})}static array(r){return new this({type:"array",value:r})}static map(r,n){return new this({type:"map",keyType:r,valueType:n})}static typeDict(r,{multiline:n}={}){return new this({type:"typeDict",entries:r,multiline:n})}static union(r){return new this({type:"union",types:r})}static optional(r){return this.isAlreadyOptional(r)?r:new this({type:"optional",value:r})}static null(){return new this({type:"null"})}static reference(r){return new this({type:"reference",value:r})}static enumString(r){return new this({type:"enumString",value:r})}static isAlreadyOptional(r){return r.internalType.type==="optional"}writeTypeDictEntry({writer:r,entry:n,comment:o}){r.write(n.key),n.optional&&r.write("?"),r.write(": "),n.valueType.write(r,{comment:o})}getUniqueTypes({writer:r,types:n,comment:o}){let i=new Set;return n.filter(u=>{if(o)return!0;let p=u.toString({namespace:r.namespace,rootNamespace:r.rootNamespace,customConfig:r.customConfig});return i.has(p)?!1:(i.add(p),!0)})}},wp=new L({namespace:Lt,name:"DateTime"});a();s();function bp(t){return t.startsWith("$")?t.slice(1):t}var Ap="values",qe=class extends w{constructor({name:r,namespace:n,abstract:o,docs:i,parentClassReference:u,traits:p}){super();d(this,"name");d(this,"namespace");d(this,"class_");this.name=r,this.namespace=n,this.class_=new ie({name:r,namespace:n,abstract:o,docs:i,parentClassReference:u,traits:p})}addField(r){this.class_.addField(r)}addMethod(r){this.class_.addMethod(r)}addTrait(r){this.class_.addTrait(r)}write(r){let n=ve(this.class_.fields).map(o=>je(We({},o),{name:bp(o.name)}));n.length>0&&this.class_.addConstructor({access:"public",parameters:this.getConstructorParameters({orderedFields:n}),body:x.codeblock(o=>{for(let i of n)o.write(`$this->${i.name} = $${Ap}['${i.name}']`),i.type.isOptional()&&o.write(" ?? null"),o.write(";")})}),this.class_.write(r)}allFieldsAreOptional(){return this.class_.fields.every(r=>r.type.isOptional())}getConstructorParameters({orderedFields:r}){return[new ae({name:Ap,type:D.typeDict(r.map(n=>({key:n.name,valueType:n.type,optional:n.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new B("[]"):void 0})]}};a();s();a();s();var se=class extends w{constructor({name:r,access:n,parameters:o,throws:i,return_:u,body:p,docs:c,classReference:y}){super();d(this,"name");d(this,"access");d(this,"parameters");d(this,"throws");d(this,"return_");d(this,"body");d(this,"docs");d(this,"classReference");this.name=r,this.access=n,this.parameters=o,this.throws=i!=null?i:[],this.return_=u,this.body=p,this.docs=c,this.classReference=y}write(r){var n;this.writeComment(r),r.write(`${this.access} function ${this.name}(`),this.parameters.forEach((o,i)=>{i>0&&r.write(", "),o.write(r)}),r.write("): "),this.return_!=null?this.return_.write(r):r.write("void"),r.writeLine(" {"),r.indent(),(n=this.body)==null||n.write(r),r.dedent(),r.writeLine("}")}writeComment(r){let n=new k({docs:this.docs});for(let o of this.parameters)n.addTag({tagType:"param",type:o.type,name:o.name,docs:o.docs});this.return_!=null&&n.addTag({tagType:"return",type:this.return_});for(let o of this.throws)n.addTag({tagType:"throws",type:D.reference(o)});r.writeNode(n)}};var $e=class extends w{constructor({name:r,namespace:n,backing:o,docs:i,serializable:u}){super();d(this,"name");d(this,"namespace");d(this,"backing");d(this,"docs");d(this,"members",[]);d(this,"serializable");this.name=r,this.namespace=n,this.backing=o,this.docs=i,this.serializable=u!=null?u:!1}addMember(r){this.members.push(r)}write(r){this.writeComment(r),r.write("enum "),r.writeLine(`${this.name}`),this.backing!=null&&r.write(` : ${this.backing}`),this.serializable&&(r.addReference(new L({name:"JsonSerializable",namespace:""})),r.writeLine(" implements JsonSerializable")),r.writeLine(" {"),r.indent();for(let n of this.members)r.write(`case ${n.name}`),n.value!=null&&(typeof n.value=="string"?r.write(` = "${n.value}"`):r.write(` = ${n.value}`)),r.writeTextStatement("");this.serializable&&(r.newLine(),r.writeNode(new se({name:"jsonSerialize",return_:D.string(),access:"public",parameters:[],body:new B("return $this->value;")}))),r.writeNewLineIfLastLineNot(),r.dedent(),r.writeLine("}")}writeComment(r){if(this.docs==null)return;new k({docs:this.docs}).write(r)}};a();s();var ke=class extends w{constructor({name:r,type:n,access:o,readonly_:i,initializer:u,docs:p,inlineDocs:c,attributes:y,inherited:h}){super();d(this,"name");d(this,"type");d(this,"access");d(this,"readonly_");d(this,"initializer");d(this,"docs");d(this,"inlineDocs");d(this,"attributes");d(this,"inherited");this.name=xe(r),this.type=n,this.access=o,this.readonly_=i!=null?i:!1,this.initializer=u,this.docs=p,this.inlineDocs=c,this.attributes=y!=null?y:[],this.inherited=h!=null?h:!1}write(r){this.writeComment(r),this.writeAttributesIfPresent(r),r.write(`${this.access} `),this.readonly_&&r.write("readonly "),this.type.write(r),r.write(` ${this.name}`),this.initializer!=null&&(r.write(" = "),this.initializer.write(r)),r.write(";"),this.inlineDocs!=null&&r.write(` // ${this.inlineDocs}`),r.newLine()}writeComment(r){let n=new k;n.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),n.write(r)}writeAttributesIfPresent(r){this.attributes.length>0&&(r.write("#["),this.attributes.forEach((n,o)=>{o>0&&r.write(", "),n.write(r)}),r.writeLine("]"))}};a();s();var _e=class extends w{constructor({entries:r,multiline:n}){super();d(this,"entries");d(this,"multiline");this.entries=r!=null?r:[],this.multiline=n!=null?n:!1}write(r){if(this.multiline){this.writeMultiline(r);return}this.writeCompact(r)}writeMultiline(r){r.writeLine("["),r.indent();for(let{key:n,value:o}of this.entries)n.write(r),r.write(" => "),o.write(r),r.writeLine(",");r.dedent(),r.write("]")}writeCompact(r){r.write("[");for(let[n,{key:o,value:i}]of this.entries.entries())n>0&&r.write(", "),o.write(r),r.write(" => "),i.write(r);r.write("]")}};a();s();var ue=class extends w{constructor({method:r,arguments_:n,static_:o,multiline:i,on:u}){super();d(this,"method");d(this,"arguments_");d(this,"multiline");d(this,"static_");d(this,"on");this.method=r,this.arguments_=n,this.static_=o!=null?o:!1,this.multiline=i!=null?i:!1,this.on=u}write(r){this.on!=null&&(this.on.write(r),r.write(this.getMethodAccessor())),r.write(this.method),fr({writer:r,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};a();s();a();s();var we=class t extends w{constructor(r){super();d(this,"internalType");this.internalType=r}write(r){switch(this.internalType.type){case"list":{this.writeList({writer:r,list:this.internalType});break}case"boolean":{r.write(this.internalType.value.toString());break}case"class":{this.writeClass({writer:r,class_:this.internalType});break}case"file":{r.writeNode(fx({writer:r,value:this.internalType.value}));break}case"float":{r.write(this.internalType.value.toString());break}case"number":{r.write(this.internalType.value.toString());break}case"map":{this.writeMap({writer:r,map:this.internalType});break}case"reference":{r.writeNode(this.internalType.value);break}case"datetime":{r.writeNode(ux({writer:r,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
30
30
  `)){this.writeStringWithHeredoc({writer:r,value:this.internalType.value});break}r.write(`'${this.internalType.value.replaceAll("'","\\'")}'`);break}case"unknown":{this.writeUnknown({writer:r,value:this.internalType.value});break}case"null":{r.write("null");break}case"nop":break;default:P(this.internalType)}}writeStringWithHeredoc({writer:r,value:n}){r.writeLine("<<<EOT"),r.writeNoIndent(n),r.newLine(),r.writeNoIndent("EOT")}writeClass({writer:r,class_:n}){r.writeNode(new J({classReference:n.reference,arguments_:[t.map({entries:n.fields.map(o=>({key:t.string(o.name),value:o.value}))})]}))}writeList({writer:r,list:n}){let o=lx({values:n.values});if(o.length===0){r.write("[]");return}r.writeLine("["),r.indent();for(let i of o)i.write(r),r.writeLine(",");r.dedent(),r.write("]")}writeMap({writer:r,map:n}){let o=px({entries:n.entries});if(o.length===0){r.write("[]");return}r.writeLine("["),r.indent();for(let i of o)i.key.write(r),r.write(" => "),i.value.write(r),r.writeLine(",");r.dedent(),r.write("]")}static list({values:r}){return new this({type:"list",values:r})}static boolean(r){return new this({type:"boolean",value:r})}static class_({reference:r,fields:n}){return new this({type:"class",reference:r,fields:n})}static file(r){return new this({type:"file",value:r})}static float(r){return new this({type:"float",value:r})}static datetime(r){return new this({type:"datetime",value:r})}static number(r){return new this({type:"number",value:r})}static map({entries:r}){return new this({type:"map",entries:r})}static reference(r){return new this({type:"reference",value:r})}static string(r){return new this({type:"string",value:r})}static unknown(r){return new this({type:"unknown",value:r})}static null(){return new this({type:"null"})}static nop(){return new this({type:"nop"})}static isNop(r){return r.internalType.type==="nop"}writeUnknown({writer:r,value:n}){switch(typeof n){case"boolean":r.write(n.toString());return;case"string":r.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":r.write(n.toString());return;case"object":if(n==null){r.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:r,value:n});return}this.writeUnknownMap({writer:r,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:r,value:n}){if(n.length===0){r.write("[]");return}r.writeLine("["),r.indent();for(let o of n)r.writeNode(t.unknown(o)),r.writeLine(",");r.dedent(),r.write("]")}writeUnknownMap({writer:r,value:n}){let o=Object.entries(n);if(o.length===0){r.write("[]");return}r.writeLine("["),r.indent();for(let[i,u]of o)r.write(`'${i}' => `),r.writeNode(t.unknown(u)),r.writeLine(",");r.dedent(),r.write("]")}};function ux({writer:t,value:e}){return new J({classReference:new L({name:"DateTime",namespace:""}),arguments_:[new B(`'${e}'`)]})}function fx({writer:t,value:e}){return new ue({on:new L({name:"File",namespace:`${t.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new B(`"${e}"`)]})}function px({entries:t}){return t.filter(e=>!we.isNop(e.key)&&!we.isNop(e.value))}function lx({values:t}){return t.filter(e=>!we.isNop(e))}a();s();var Ut=class extends w{constructor(r){super();d(this,"arrays");this.arrays=r}write(r){r.write("array_merge"),fr({writer:r,arguments_:this.arrays.map(n=>Me(o=>{if(typeof n=="string"||n instanceof w){o.writeNodeOrString(n);return}o.writeNodeOrString(n.ref),n.fallback&&(o.write(" ?? "),o.writeNodeOrString(n.fallback))}))})}};function cx(t){return new Le(t)}function dx(t){return new Be(t)}function yx(t){return new ie(t)}function mx(t){return new Ue(t)}function hx(t){return new L(t)}function Me(t){return new B(t)}function gx(t){return new qe(t)}function xx(t){return new $e(t)}function vx(t){return new ke(t)}function Sp(t){return new J(t)}function wx(t){return new ue(t)}function bx(t){return Me(e=>{e.write("throw "),e.writeNode(Sp(t))})}function Ax(t){return new _e(t)}function Sx(t){return new se(t)}function Ex(t){return new ae(t)}function Tx(t){return new Br(t)}function Rx(t,e){return Me(r=>{r.writeNodeOrString(t),r.write(" = "),r.writeNodeOrString(e)})}function Px(t){return Me(xe(t))}function Ix(t){return Me(`"${t}"`)}function Nx(...t){return new Ut(t)}function Fx(){return new B(t=>{t.write("$this")})}var Ep="$client",qt="Example",Tp=`<?php
31
31
 
32
- `,$t=class{constructor({context:e}){d(this,"context");this.context=e}async generateSnippet({endpoint:e,request:r}){var o;let n=this.buildCodeBlock({endpoint:e,snippet:r});return Tp+await n.toStringAsync({namespace:qt,rootNamespace:qt,customConfig:(o=this.context.customConfig)!=null?o:{}})}generateSnippetSync({endpoint:e,request:r}){var o;let n=this.buildCodeBlock({endpoint:e,snippet:r});return Tp+n.toString({namespace:qt,rootNamespace:qt,customConfig:(o=this.context.customConfig)!=null?o:{}})}buildCodeBlock({endpoint:e,snippet:r}){return x.codeblock(n=>{n.writeNodeStatement(this.constructClient({endpoint:e,snippet:r})),n.writeNodeStatement(this.callMethod({endpoint:e,snippet:r}))})}constructClient({endpoint:e,snippet:r}){return x.codeblock(n=>{n.write(`${Ep} = `),n.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:e,snippet:r})))})}callMethod({endpoint:e,snippet:r}){return x.invokeMethod({on:x.codeblock(Ep),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:r}),multiline:!0})}getConstructorArgs({endpoint:e,snippet:r}){let n=[];e.auth!=null&&(r.auth!=null?n.push(...this.getConstructorAuthArgs({auth:e.auth,values:r.auth})):this.context.errors.add({severity:E.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let o=[],i=this.getConstructorBaseUrlArgs({baseUrl:r.baseURL,environment:r.environment});return i.length>0&&o.push(...i),this.context.errors.scope(H.Headers),this.context.ir.headers!=null&&r.headers!=null&&o.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:r.headers})),this.context.errors.unscope(),o.length===0?n:[...n,{name:"options",assignment:x.TypeLiteral.map({entries:o.map(u=>({key:x.TypeLiteral.string(u.name),value:u.value}))})}]}getConstructorAuthArgs({auth:e,values:r}){switch(e.type){case"basic":return r.type!=="basic"?(this.context.errors.add({severity:E.Critical,message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getConstructorBasicAuthArgs({auth:e,values:r});case"bearer":return r.type!=="bearer"?(this.context.errors.add({severity:E.Critical,message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getConstructorBearerAuthArgs({auth:e,values:r});case"header":return r.type!=="header"?(this.context.errors.add({severity:E.Critical,message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getConstructorHeaderAuthArgs({auth:e,values:r});default:P(e)}}getConstructorBasicAuthArgs({auth:e,values:r}){return[{name:this.context.getPropertyName(e.username),assignment:x.TypeLiteral.string(r.username)},{name:this.context.getPropertyName(e.password),assignment:x.TypeLiteral.string(r.password)}]}getConstructorBaseUrlArgs({baseUrl:e,environment:r}){let n=this.getBaseUrlArg({baseUrl:e,environment:r});return x.TypeLiteral.isNop(n)?[]:[{name:"baseUrl",value:n}]}getBaseUrlArg({baseUrl:e,environment:r}){if(e!=null&&r!=null)return this.context.errors.add({severity:E.Critical,message:"Cannot specify both baseUrl and environment options"}),x.TypeLiteral.nop();if(e!=null)return x.TypeLiteral.string(e);if(r!=null){if(this.context.isSingleEnvironmentID(r)){let n=this.context.getEnvironmentClassAccessFromID(r);return n==null?(this.context.errors.add({severity:E.Warning,message:`Environment ${JSON.stringify(r)} was not found`}),x.TypeLiteral.nop()):x.TypeLiteral.reference(x.codeblock(o=>{o.writeNode(n),o.write("->value")}))}this.context.isMultiEnvironmentValues(r)&&this.context.errors.add({severity:E.Warning,message:"The PHP SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}return x.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:e,values:r}){return[{name:this.context.getPropertyName(e.token),assignment:x.TypeLiteral.string(r.token)}]}getConstructorHeaderAuthArgs({auth:e,values:r}){return[{name:this.context.getPropertyName(e.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:r.value})}]}getConstructorHeaderArgs({headers:e,values:r}){let n=[];for(let o of e){let i=this.getConstructorHeaderArg({header:o,value:r.value});i!=null&&n.push({name:this.context.getPropertyName(o.name.name),value:i})}return n}getConstructorHeaderArg({header:e,value:r}){let n=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:r});if(!x.TypeLiteral.isNop(n))return n}getMethodArgs({endpoint:e,snippet:r}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:r});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:r});default:P(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:r}){let n=[];if(this.context.errors.scope(H.PathParameters),e.pathParameters!=null){let o=this.getPathParameters({namedParameters:e.pathParameters,snippet:r});n.push(...o.map(i=>i.value))}return this.context.errors.unscope(),this.context.errors.scope(H.RequestBody),e.body!=null&&n.push(this.getBodyRequestArg({body:e.body,value:r.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:e,value:r}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:r});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:r});default:P(e)}}getBytesBodyRequestArg({value:e}){return this.context.errors.add({severity:E.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),x.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:e,snippet:r}){let n=[];this.context.errors.scope(H.PathParameters);let i=[];e.pathParameters!=null&&i.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:r})),this.context.errors.unscope(),this.context.errors.scope(H.RequestBody);let u=this.getFilePropertyInfo({request:e,snippet:r});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:!1})||n.push(...i.map(p=>p.value)),this.context.needsRequestParameter({request:e,inlinePathParameters:!1,inlineFileProperties:!0})&&n.push(this.getInlinedRequestArg({request:e,snippet:r,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:!1})?i:[],filePropertyInfo:u})),n}getFilePropertyInfo({request:e,snippet:r}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:r.requestBody})}getInlinedRequestArg({request:e,snippet:r,pathParameterFields:n,filePropertyInfo:o}){var h,g,v,b;this.context.errors.scope(H.QueryParameters);let u=this.context.associateQueryParametersByWireValue({parameters:(h=e.queryParameters)!=null?h:[],values:(g=r.queryParameters)!=null?g:{}}).map(T=>({name:this.context.getPropertyName(T.name.name),value:this.context.dynamicTypeLiteralMapper.convert(T)}));this.context.errors.unscope(),this.context.errors.scope(H.Headers);let c=this.context.associateByWireValue({parameters:(v=e.headers)!=null?v:[],values:(b=r.headers)!=null?b:{}}).map(T=>({name:this.context.getPropertyName(T.name.name),value:this.context.dynamicTypeLiteralMapper.convert(T)}));this.context.errors.unscope(),this.context.errors.scope(H.RequestBody);let y=e.body!=null?this.getInlinedRequestBodyConstructorFields({body:e.body,value:r.requestBody,filePropertyInfo:o}):[];return this.context.errors.unscope(),x.TypeLiteral.class_({reference:x.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getRequestNamespace(e.declaration.fernFilepath)}),fields:[...n,...u,...c,...y]})}getInlinedRequestBodyConstructorFields({body:e,value:r,filePropertyInfo:n}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:e.value,value:r});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:e,value:r})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:n});default:P(e)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:e}){return[...e.fileFields,...e.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:e,value:r}){return{name:this.context.getPropertyName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:e.bodyType,value:r})}}getReferencedRequestBodyPropertyTypeLiteral({body:e,value:r}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:r});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:r});default:P(e)}}getInlinedRequestBodyPropertyConstructorFields({parameters:e,value:r}){var i;let n=[],o=this.context.associateByWireValue({parameters:e,values:(i=this.context.getRecord(r))!=null?i:{}});for(let u of o)n.push({name:this.context.getPropertyName(u.name.name),value:this.context.dynamicTypeLiteralMapper.convert(u)});return n}getPathParameters({namedParameters:e,snippet:r}){var i;let n=[],o=this.context.associateByWireValue({parameters:e,values:(i=r.pathParameters)!=null?i:{}});for(let u of o)n.push({name:this.context.getPropertyName(u.name.name),value:this.context.dynamicTypeLiteralMapper.convert(u)});return n}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(r=>this.context.getPropertyName(r)).join("->")}->${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getRootClientClassInstantiation(e){return x.instantiateClass({classReference:x.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:e,multiline:!0})}};a();s();a();s();var kt=class{constructor({context:e}){d(this,"context");this.context=e}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?x.TypeLiteral.null():(this.context.errors.add({severity:E.Critical,message:"Expected non-null value, but got null"}),x.TypeLiteral.nop());if(e.value===void 0)return x.TypeLiteral.nop();switch(e.typeReference.type){case"list":case"set":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return this.convertLiteral({literalType:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let r=this.context.resolveNamedType({typeId:e.typeReference.value});return r==null?x.TypeLiteral.nop():this.convertNamed({named:r,value:e.value,as:e.as})}case"optional":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"nullable":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"unknown":return this.convertUnknown({value:e.value});default:P(e.typeReference)}}convertLiteral({literalType:e,value:r}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.string(n)}default:P(e)}}convertList({list:e,value:r}){return Array.isArray(r)?x.TypeLiteral.list({values:r.map((n,o)=>{this.context.errors.scope({index:o});try{return this.convert({typeReference:e,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:E.Critical,message:`Expected array but got: ${typeof r}`}),x.TypeLiteral.nop())}convertMap({map:e,value:r}){return typeof r!="object"||r==null?(this.context.errors.add({severity:E.Critical,message:`Expected object but got: ${r==null?"null":typeof r}`}),x.TypeLiteral.nop()):x.TypeLiteral.map({entries:Object.entries(r).map(([n,o])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:e.key,value:n,as:"key"}),value:this.convert({typeReference:e.value,value:o})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:r,as:n}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:r,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:r});case"enum":return this.convertEnum({enum_:e,value:r});case"object":return this.convertObject({object_:e,value:r});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r});default:P(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:r}){return x.TypeLiteral.string("todo")}convertObject({object_:e,value:r}){var o;let n=this.context.associateByWireValue({parameters:e.properties,values:(o=this.context.getRecord(r))!=null?o:{}});return x.TypeLiteral.class_({reference:x.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getTypesNamespace(e.declaration.fernFilepath)}),fields:n.map(i=>{this.context.errors.scope(i.name.wireValue);try{return{name:this.context.getPropertyName(i.name.name),value:this.convert(i)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:r}){let n=this.getEnumValueName({enum_:e,value:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.reference(x.codeblock(o=>{o.writeNode(x.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getTypesNamespace(e.declaration.fernFilepath)})),o.write("::"),o.write(n),o.write("->value")}))}getEnumValueName({enum_:e,value:r}){if(typeof r!="string"){this.context.errors.add({severity:E.Critical,message:`Expected enum value string, got: ${typeof r}`});return}let n=e.values.find(o=>o.wireValue===r);if(n==null){this.context.errors.add({severity:E.Critical,message:`An enum value named "${r}" does not exist in this context`});return}return this.context.getClassName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r});return n==null?x.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r}){for(let n of e.types)try{return this.convert({typeReference:n,value:r})}catch(o){continue}this.context.errors.add({severity:E.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof r}" value`})}convertUnknown({value:e}){return x.TypeLiteral.unknown(e)}convertPrimitive({primitive:e,value:r,as:n}){switch(e){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let o=this.getValueAsNumber({value:r,as:n});return o==null?x.TypeLiteral.nop():x.TypeLiteral.number(o)}case"FLOAT":case"DOUBLE":{let o=this.getValueAsNumber({value:r});return o==null?x.TypeLiteral.nop():x.TypeLiteral.float(o)}case"BOOLEAN":{let o=this.getValueAsBoolean({value:r,as:n});return o==null?x.TypeLiteral.nop():x.TypeLiteral.boolean(o)}case"DATE":case"DATE_TIME":{let o=this.context.getValueAsString({value:r});return o==null?x.TypeLiteral.nop():x.TypeLiteral.datetime(o)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let o=this.context.getValueAsString({value:r});return o==null?x.TypeLiteral.nop():x.TypeLiteral.string(o)}default:P(e)}}getValueAsNumber({value:e,as:r}){let n=r==="key"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:e,as:r}){let n=r==="key"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:n})}};a();s();var _t=class{constructor({context:e}){d(this,"context");this.context=e}getFilePropertyInfo({body:e,value:r}){var i;let n={fileFields:[],bodyPropertyFields:[]},o=(i=this.context.getRecord(r))!=null?i:{};for(let u of e.properties)switch(u.type){case"file":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getSingleFileProperty({property:u,record:o})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getArrayFileProperty({property:u,record:o})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(u.name.name),value:this.getBodyProperty({property:u,record:o})});break;default:P(u)}return n}getSingleFileProperty({property:e,record:r}){let n=this.context.getSingleFileValue({property:e,record:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.file(n)}getArrayFileProperty({property:e,record:r}){let n=this.context.getFileArrayValues({property:e,record:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.list({values:n.map(o=>x.TypeLiteral.file(o))})}getBodyProperty({property:e,record:r}){let n=r[e.name.wireValue];return n==null?x.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:n})}};var Cx=["use","clone","list"],Ox="Requests",Lx="Types",Mt=class t extends _r{constructor({ir:r,config:n}){var o;super({ir:r,config:n});d(this,"ir");d(this,"customConfig");d(this,"dynamicTypeLiteralMapper");d(this,"filePropertyMapper");d(this,"rootNamespace");this.ir=r,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new kt({context:this}),this.filePropertyMapper=new _t({context:this}),this.rootNamespace=Bx({organization:n.organization,namespaceOverride:(o=this.customConfig)==null?void 0:o.namespace})}clone(){return new t({ir:this.ir,config:this.config})}getParameterName(r){return this.prependUnderscoreIfNeeded(r.camelCase.unsafeName)}getPropertyName(r){return this.prependUnderscoreIfNeeded(r.camelCase.unsafeName)}getMethodName(r){let n=r.camelCase.unsafeName;return Cx.includes(n)?n:r.camelCase.safeName}getClassName(r){return r.pascalCase.safeName}getRootClientClassName(){var r,n,o;return((r=this.customConfig)==null?void 0:r.clientName)!=null?this.customConfig.clientName:((n=this.customConfig)==null?void 0:n["client-class-name"])!=null?(o=this.customConfig)==null?void 0:o["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return x.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(r){return this.getNamespace(r,Ox)}getTypesNamespace(r){return this.getNamespace(r,Lx)}getNamespace(r,n){let o=r.allParts.map(i=>i.pascalCase.safeName);return o=n!=null?[...o,n]:o,[this.rootNamespace,...o].join("\\")}getEnvironmentClassAccessFromID(r){let n=this.resolveEnvironmentName(r);if(n!=null)return x.codeblock(o=>{o.writeNode(this.getEnvironmentClassReference(n)),o.write("::"),o.write(this.getClassName(n))})}getEnvironmentClassReference(r){return x.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(r){return/^[a-zA-Z_]/.test(r)?r:`_${r}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${sr(Ot(this.config.organization))}`}};function Bx({organization:t,namespaceOverride:e}){return e!=null?e:`${sr(Ot(t))}`}var Dt=class extends qr{constructor({ir:e,config:r}){super(new Mt({ir:e,config:r}))}createSnippetGenerator(e){return new $t({context:e})}};0&&(module.exports={DynamicSnippetsGenerator});
32
+ `,$t=class{constructor({context:e}){d(this,"context");this.context=e}async generateSnippet({endpoint:e,request:r}){var o;let n=this.buildCodeBlock({endpoint:e,snippet:r});return Tp+await n.toStringAsync({namespace:qt,rootNamespace:qt,customConfig:(o=this.context.customConfig)!=null?o:{}})}generateSnippetSync({endpoint:e,request:r}){var o;let n=this.buildCodeBlock({endpoint:e,snippet:r});return Tp+n.toString({namespace:qt,rootNamespace:qt,customConfig:(o=this.context.customConfig)!=null?o:{}})}buildCodeBlock({endpoint:e,snippet:r}){return x.codeblock(n=>{n.writeNodeStatement(this.constructClient({endpoint:e,snippet:r})),n.writeNodeStatement(this.callMethod({endpoint:e,snippet:r}))})}constructClient({endpoint:e,snippet:r}){return x.codeblock(n=>{n.write(`${Ep} = `),n.writeNode(this.getRootClientClassInstantiation(this.getConstructorArgs({endpoint:e,snippet:r})))})}callMethod({endpoint:e,snippet:r}){return x.invokeMethod({on:x.codeblock(Ep),method:this.getMethod({endpoint:e}),arguments_:this.getMethodArgs({endpoint:e,snippet:r}),multiline:!0})}getConstructorArgs({endpoint:e,snippet:r}){let n=[];e.auth!=null&&(r.auth!=null?n.push(...this.getConstructorAuthArgs({auth:e.auth,values:r.auth})):this.context.errors.add({severity:E.Warning,message:`Auth with ${e.auth.type} configuration is required for this endpoint`}));let o=[],i=this.getConstructorBaseUrlArgs({baseUrl:r.baseURL,environment:r.environment});return i.length>0&&o.push(...i),this.context.errors.scope(H.Headers),this.context.ir.headers!=null&&r.headers!=null&&o.push(...this.getConstructorHeaderArgs({headers:this.context.ir.headers,values:r.headers})),this.context.errors.unscope(),o.length===0?n:[...n,{name:"options",assignment:x.TypeLiteral.map({entries:o.map(u=>({key:x.TypeLiteral.string(u.name),value:u.value}))})}]}getConstructorAuthArgs({auth:e,values:r}){switch(e.type){case"basic":return r.type!=="basic"?(this.context.errors.add({severity:E.Critical,message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getConstructorBasicAuthArgs({auth:e,values:r});case"bearer":return r.type!=="bearer"?(this.context.errors.add({severity:E.Critical,message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getConstructorBearerAuthArgs({auth:e,values:r});case"header":return r.type!=="header"?(this.context.errors.add({severity:E.Critical,message:this.context.newAuthMismatchError({auth:e,values:r}).message}),[]):this.getConstructorHeaderAuthArgs({auth:e,values:r});default:P(e)}}getConstructorBasicAuthArgs({auth:e,values:r}){return[{name:this.context.getPropertyName(e.username),assignment:x.TypeLiteral.string(r.username)},{name:this.context.getPropertyName(e.password),assignment:x.TypeLiteral.string(r.password)}]}getConstructorBaseUrlArgs({baseUrl:e,environment:r}){let n=this.getBaseUrlArg({baseUrl:e,environment:r});return x.TypeLiteral.isNop(n)?[]:[{name:"baseUrl",value:n}]}getBaseUrlArg({baseUrl:e,environment:r}){if(e!=null&&r!=null)return this.context.errors.add({severity:E.Critical,message:"Cannot specify both baseUrl and environment options"}),x.TypeLiteral.nop();if(e!=null)return x.TypeLiteral.string(e);if(r!=null){if(this.context.isSingleEnvironmentID(r)){let n=this.context.getEnvironmentClassAccessFromID(r);return n==null?(this.context.errors.add({severity:E.Warning,message:`Environment ${JSON.stringify(r)} was not found`}),x.TypeLiteral.nop()):x.TypeLiteral.reference(x.codeblock(o=>{o.writeNode(n),o.write("->value")}))}this.context.isMultiEnvironmentValues(r)&&this.context.errors.add({severity:E.Warning,message:"The PHP SDK doesn't support a multi-environment client option yet; use the baseUrl option instead"})}return x.TypeLiteral.nop()}getConstructorBearerAuthArgs({auth:e,values:r}){return[{name:this.context.getPropertyName(e.token),assignment:x.TypeLiteral.string(r.token)}]}getConstructorHeaderAuthArgs({auth:e,values:r}){return[{name:this.context.getPropertyName(e.header.name.name),assignment:this.context.dynamicTypeLiteralMapper.convert({typeReference:e.header.typeReference,value:r.value})}]}getConstructorHeaderArgs({headers:e,values:r}){let n=[];for(let o of e){let i=this.getConstructorHeaderArg({header:o,value:r.value});i!=null&&n.push({name:this.context.getPropertyName(o.name.name),value:i})}return n}getConstructorHeaderArg({header:e,value:r}){let n=this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:r});if(!x.TypeLiteral.isNop(n))return n}getMethodArgs({endpoint:e,snippet:r}){switch(e.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:e.request,snippet:r});case"body":return this.getMethodArgsForBodyRequest({request:e.request,snippet:r});default:P(e.request)}}getMethodArgsForBodyRequest({request:e,snippet:r}){let n=[];if(this.context.errors.scope(H.PathParameters),e.pathParameters!=null){let o=this.getPathParameters({namedParameters:e.pathParameters,snippet:r});n.push(...o.map(i=>i.value))}return this.context.errors.unscope(),this.context.errors.scope(H.RequestBody),e.body!=null&&n.push(this.getBodyRequestArg({body:e.body,value:r.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:e,value:r}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:r});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:r});default:P(e)}}getBytesBodyRequestArg({value:e}){return this.context.errors.add({severity:E.Critical,message:"The PHP SDK doesn't support bytes requests yet"}),x.TypeLiteral.nop()}getMethodArgsForInlinedRequest({request:e,snippet:r}){let n=[];this.context.errors.scope(H.PathParameters);let i=[];e.pathParameters!=null&&i.push(...this.getPathParameters({namedParameters:e.pathParameters,snippet:r})),this.context.errors.unscope(),this.context.errors.scope(H.RequestBody);let u=this.getFilePropertyInfo({request:e,snippet:r});return this.context.errors.unscope(),this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:!1})||n.push(...i.map(p=>p.value)),this.context.needsRequestParameter({request:e,inlinePathParameters:!1,inlineFileProperties:!0})&&n.push(this.getInlinedRequestArg({request:e,snippet:r,pathParameterFields:this.context.includePathParametersInWrappedRequest({request:e,inlinePathParameters:!1})?i:[],filePropertyInfo:u})),n}getFilePropertyInfo({request:e,snippet:r}){return e.body==null||!this.context.isFileUploadRequestBody(e.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:e.body,value:r.requestBody})}getInlinedRequestArg({request:e,snippet:r,pathParameterFields:n,filePropertyInfo:o}){var h,g,v,b;this.context.errors.scope(H.QueryParameters);let u=this.context.associateQueryParametersByWireValue({parameters:(h=e.queryParameters)!=null?h:[],values:(g=r.queryParameters)!=null?g:{}}).map(T=>({name:this.context.getPropertyName(T.name.name),value:this.context.dynamicTypeLiteralMapper.convert(T)}));this.context.errors.unscope(),this.context.errors.scope(H.Headers);let c=this.context.associateByWireValue({parameters:(v=e.headers)!=null?v:[],values:(b=r.headers)!=null?b:{}}).map(T=>({name:this.context.getPropertyName(T.name.name),value:this.context.dynamicTypeLiteralMapper.convert(T)}));this.context.errors.unscope(),this.context.errors.scope(H.RequestBody);let y=e.body!=null?this.getInlinedRequestBodyConstructorFields({body:e.body,value:r.requestBody,filePropertyInfo:o}):[];return this.context.errors.unscope(),x.TypeLiteral.class_({reference:x.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getRequestNamespace(e.declaration.fernFilepath)}),fields:[...n,...u,...c,...y]})}getInlinedRequestBodyConstructorFields({body:e,value:r,filePropertyInfo:n}){switch(e.type){case"properties":return this.getInlinedRequestBodyPropertyConstructorFields({parameters:e.value,value:r});case"referenced":return[this.getReferencedRequestBodyPropertyConstructorField({body:e,value:r})];case"fileUpload":return this.getFileUploadRequestBodyConstructorFields({filePropertyInfo:n});default:P(e)}}getFileUploadRequestBodyConstructorFields({filePropertyInfo:e}){return[...e.fileFields,...e.bodyPropertyFields]}getReferencedRequestBodyPropertyConstructorField({body:e,value:r}){return{name:this.context.getPropertyName(e.bodyKey),value:this.getReferencedRequestBodyPropertyTypeLiteral({body:e.bodyType,value:r})}}getReferencedRequestBodyPropertyTypeLiteral({body:e,value:r}){switch(e.type){case"bytes":return this.getBytesBodyRequestArg({value:r});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:e.value,value:r});default:P(e)}}getInlinedRequestBodyPropertyConstructorFields({parameters:e,value:r}){var i;let n=[],o=this.context.associateByWireValue({parameters:e,values:(i=this.context.getRecord(r))!=null?i:{}});for(let u of o)n.push({name:this.context.getPropertyName(u.name.name),value:this.context.dynamicTypeLiteralMapper.convert(u)});return n}getPathParameters({namedParameters:e,snippet:r}){var i;let n=[],o=this.context.associateByWireValue({parameters:e,values:(i=r.pathParameters)!=null?i:{}});for(let u of o)n.push({name:this.context.getPropertyName(u.name.name),value:this.context.dynamicTypeLiteralMapper.convert(u)});return n}getMethod({endpoint:e}){return e.declaration.fernFilepath.allParts.length>0?`${e.declaration.fernFilepath.allParts.map(r=>this.context.getPropertyName(r)).join("->")}->${this.context.getMethodName(e.declaration.name)}`:this.context.getMethodName(e.declaration.name)}getRootClientClassInstantiation(e){return x.instantiateClass({classReference:x.classReference({name:this.context.getRootClientClassName(),namespace:this.context.rootNamespace}),arguments_:e,multiline:!0})}};a();s();a();s();var kt=class{constructor({context:e}){d(this,"context");this.context=e}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?x.TypeLiteral.null():(this.context.errors.add({severity:E.Critical,message:"Expected non-null value, but got null"}),x.TypeLiteral.nop());if(e.value===void 0)return x.TypeLiteral.nop();switch(e.typeReference.type){case"list":case"set":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return this.convertLiteral({literalType:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let r=this.context.resolveNamedType({typeId:e.typeReference.value});return r==null?x.TypeLiteral.nop():this.convertNamed({named:r,value:e.value,as:e.as})}case"optional":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"nullable":return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as});case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"unknown":return this.convertUnknown({value:e.value});default:P(e.typeReference)}}convertLiteral({literalType:e,value:r}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.string(n)}default:P(e)}}convertList({list:e,value:r}){return Array.isArray(r)?x.TypeLiteral.list({values:r.map((n,o)=>{this.context.errors.scope({index:o});try{return this.convert({typeReference:e,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:E.Critical,message:`Expected array but got: ${typeof r}`}),x.TypeLiteral.nop())}convertMap({map:e,value:r}){return typeof r!="object"||r==null?(this.context.errors.add({severity:E.Critical,message:`Expected object but got: ${r==null?"null":typeof r}`}),x.TypeLiteral.nop()):x.TypeLiteral.map({entries:Object.entries(r).map(([n,o])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:e.key,value:n,as:"key"}),value:this.convert({typeReference:e.value,value:o})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:r,as:n}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:r,as:n});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:r});case"enum":return this.convertEnum({enum_:e,value:r});case"object":return this.convertObject({object_:e,value:r});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r});default:P(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:r}){return x.TypeLiteral.string("todo")}convertObject({object_:e,value:r}){var o;let n=this.context.associateByWireValue({parameters:e.properties,values:(o=this.context.getRecord(r))!=null?o:{}});return x.TypeLiteral.class_({reference:x.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getTypesNamespace(e.declaration.fernFilepath)}),fields:n.map(i=>{this.context.errors.scope(i.name.wireValue);try{return{name:this.context.getPropertyName(i.name.name),value:this.convert(i)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:r}){let n=this.getEnumValueName({enum_:e,value:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.reference(x.codeblock(o=>{o.writeNode(x.classReference({name:this.context.getClassName(e.declaration.name),namespace:this.context.getTypesNamespace(e.declaration.fernFilepath)})),o.write("::"),o.write(n),o.write("->value")}))}getEnumValueName({enum_:e,value:r}){if(typeof r!="string"){this.context.errors.add({severity:E.Critical,message:`Expected enum value string, got: ${typeof r}`});return}let n=e.values.find(o=>o.wireValue===r);if(n==null){this.context.errors.add({severity:E.Critical,message:`An enum value named "${r}" does not exist in this context`});return}return this.context.getClassName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:r}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r});return n==null?x.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:r}){for(let n of e.types)try{return this.convert({typeReference:n,value:r})}catch(o){continue}this.context.errors.add({severity:E.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof r}" value`})}convertUnknown({value:e}){return x.TypeLiteral.unknown(e)}convertPrimitive({primitive:e,value:r,as:n}){switch(e){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let o=this.getValueAsNumber({value:r,as:n});return o==null?x.TypeLiteral.nop():x.TypeLiteral.number(o)}case"FLOAT":case"DOUBLE":{let o=this.getValueAsNumber({value:r});return o==null?x.TypeLiteral.nop():x.TypeLiteral.float(o)}case"BOOLEAN":{let o=this.getValueAsBoolean({value:r,as:n});return o==null?x.TypeLiteral.nop():x.TypeLiteral.boolean(o)}case"DATE":case"DATE_TIME":{let o=this.context.getValueAsString({value:r});return o==null?x.TypeLiteral.nop():x.TypeLiteral.datetime(o)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let o=this.context.getValueAsString({value:r});return o==null?x.TypeLiteral.nop():x.TypeLiteral.string(o)}default:P(e)}}getValueAsNumber({value:e,as:r}){let n=r==="key"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:e,as:r}){let n=r==="key"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:n})}};a();s();var _t=class{constructor({context:e}){d(this,"context");this.context=e}getFilePropertyInfo({body:e,value:r}){var i;let n={fileFields:[],bodyPropertyFields:[]},o=(i=this.context.getRecord(r))!=null?i:{};for(let u of e.properties)switch(u.type){case"file":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getSingleFileProperty({property:u,record:o})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getArrayFileProperty({property:u,record:o})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(u.name.name),value:this.getBodyProperty({property:u,record:o})});break;default:P(u)}return n}getSingleFileProperty({property:e,record:r}){let n=this.context.getSingleFileValue({property:e,record:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.file(n)}getArrayFileProperty({property:e,record:r}){let n=this.context.getFileArrayValues({property:e,record:r});return n==null?x.TypeLiteral.nop():x.TypeLiteral.list({values:n.map(o=>x.TypeLiteral.file(o))})}getBodyProperty({property:e,record:r}){let n=r[e.name.wireValue];return n==null?x.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:n})}};var Cx=["use","clone","list"],Ox="Requests",Lx="Types",Mt=class t extends _r{constructor({ir:r,config:n}){var o;super({ir:r,config:n});d(this,"ir");d(this,"customConfig");d(this,"dynamicTypeLiteralMapper");d(this,"filePropertyMapper");d(this,"rootNamespace");this.ir=r,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new kt({context:this}),this.filePropertyMapper=new _t({context:this}),this.rootNamespace=Bx({organization:n.organization,namespaceOverride:(o=this.customConfig)==null?void 0:o.namespace})}clone(){return new t({ir:this.ir,config:this.config})}getParameterName(r){return this.prependUnderscoreIfNeeded(r.camelCase.unsafeName)}getPropertyName(r){return this.prependUnderscoreIfNeeded(r.camelCase.unsafeName)}getMethodName(r){let n=r.camelCase.unsafeName;return Cx.includes(n)?n:r.camelCase.safeName}getClassName(r){return r.pascalCase.safeName}getRootClientClassName(){var r,n,o;return((r=this.customConfig)==null?void 0:r.clientName)!=null?this.customConfig.clientName:((n=this.customConfig)==null?void 0:n["client-class-name"])!=null?(o=this.customConfig)==null?void 0:o["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return x.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(r){return this.getNamespace(r,Ox)}getTypesNamespace(r){return this.getNamespace(r,Lx)}getNamespace(r,n){let o=r.allParts.map(i=>i.pascalCase.safeName);return o=n!=null?[...o,n]:o,[this.rootNamespace,...o].join("\\")}getEnvironmentClassAccessFromID(r){let n=this.resolveEnvironmentName(r);if(n!=null)return x.codeblock(o=>{o.writeNode(this.getEnvironmentClassReference(n)),o.write("::"),o.write(this.getClassName(n))})}getEnvironmentClassReference(r){return x.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(r){return/^[a-zA-Z_]/.test(r)?r:`_${r}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${sr(Ot(this.config.organization))}`}};function Bx({organization:t,namespaceOverride:e}){return e!=null?e:`${sr(Ot(t))}`}var Dt=class extends qr{constructor({ir:e,config:r}){super(new Mt({ir:e,config:r}))}async generate(e){return super.generate(e)}generateSync(e){return super.generateSync(e)}createSnippetGenerator(e){return new $t({context:e})}};0&&(module.exports={DynamicSnippetsGenerator});
33
33
  /*! Bundled license information:
34
34
 
35
35
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -9,6 +9,8 @@ declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<
9
9
  ir: FernIr.dynamic.DynamicIntermediateRepresentation;
10
10
  config: FernGeneratorExec.GeneratorConfig;
11
11
  });
12
+ generate(request: FernIr.dynamic.EndpointSnippetRequest): Promise<FernIr.dynamic.EndpointSnippetResponse>;
13
+ generateSync(request: FernIr.dynamic.EndpointSnippetRequest): FernIr.dynamic.EndpointSnippetResponse;
12
14
  protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator;
13
15
  }
14
16
 
@@ -1 +1 @@
1
- import{a}from"./chunk-RYQOC3FW.js";import"./chunk-MMCQWL5J.js";import"./chunk-BGMLQMW7.js";import"./chunk-G6X3OBKW.js";import"./chunk-7HKG5U5F.js";import"./chunk-YELOIV6Y.js";import"./chunk-ZFTBBCKC.js";export{a as DynamicSnippetsGenerator};
1
+ import{a}from"./chunk-5YGLJUYD.js";import"./chunk-MMCQWL5J.js";import"./chunk-BGMLQMW7.js";import"./chunk-G6X3OBKW.js";import"./chunk-7HKG5U5F.js";import"./chunk-YELOIV6Y.js";import"./chunk-ZFTBBCKC.js";export{a as DynamicSnippetsGenerator};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-MMCQWL5J.js";import{a as i}from"./chunk-BGMLQMW7.js";import{a as t}from"./chunk-7HKG5U5F.js";import{k as n,m as r}from"./chunk-ZFTBBCKC.js";n();r();var o=class extends t{constructor({ir:e,config:a}){super(new i({ir:e,config:a}))}async generate(e){return super.generate(e)}generateSync(e){return super.generateSync(e)}createSnippetGenerator(e){return new p({context:e})}};export{o as a};
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as yu}from"./chunk-RYQOC3FW.js";import"./chunk-MMCQWL5J.js";import"./chunk-BGMLQMW7.js";import"./chunk-G6X3OBKW.js";import"./chunk-7HKG5U5F.js";import"./chunk-YELOIV6Y.js";import{e as be,f as l,g as su,h as lu,i as cu,k as o,l as p,m as i}from"./chunk-ZFTBBCKC.js";var Lt=l((Ql,kt)=>{"use strict";o();i();var vu="Function.prototype.bind called on incompatible ",gu=Object.prototype.toString,du=Math.max,hu="[object Function]",Wt=function(r,t){for(var n=[],a=0;a<r.length;a+=1)n[a]=r[a];for(var u=0;u<t.length;u+=1)n[u+r.length]=t[u];return n},mu=function(r,t){for(var n=[],a=t||0,u=0;a<r.length;a+=1,u+=1)n[u]=r[a];return n},bu=function(e,r){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=r);return t};kt.exports=function(r){var t=this;if(typeof t!="function"||gu.apply(t)!==hu)throw new TypeError(vu+t);for(var n=mu(arguments,1),a,u=function(){if(this instanceof a){var g=t.apply(this,Wt(n,arguments));return Object(g)===g?g:this}return t.apply(r,Wt(n,arguments))},f=du(0,t.length-n.length),c=[],y=0;y<f;y++)c[y]="$"+y;if(a=Function("binder","return function ("+bu(c,",")+"){ return binder.apply(this,arguments); }")(u),t.prototype){var h=function(){};h.prototype=t.prototype,a.prototype=new h,h.prototype=null}return a}});var L=l((rc,zt)=>{"use strict";o();i();var Su=Lt();zt.exports=Function.prototype.bind||Su});var Se=l((nc,Jt)=>{"use strict";o();i();Jt.exports=Error});var Ae=l((ac,Ht)=>{"use strict";o();i();Ht.exports=EvalError});var we=l((pc,Kt)=>{"use strict";o();i();Kt.exports=RangeError});var Pe=l((cc,Vt)=>{"use strict";o();i();Vt.exports=ReferenceError});var Ur=l((gc,Yt)=>{"use strict";o();i();Yt.exports=SyntaxError});var w=l((mc,Qt)=>{"use strict";o();i();Qt.exports=TypeError});var Oe=l((Ac,Xt)=>{"use strict";o();i();Xt.exports=URIError});var rn=l((Oc,Zt)=>{"use strict";o();i();Zt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var u=Object.getOwnPropertySymbols(r);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(r,t);if(f.value!==a||f.enumerable!==!0)return!1}return!0}});var Ee=l((xc,tn)=>{"use strict";o();i();var en=typeof Symbol!="undefined"&&Symbol,Au=rn();tn.exports=function(){return typeof en!="function"||typeof Symbol!="function"||typeof en("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Au()}});var on=l((Fc,nn)=>{"use strict";o();i();var qe={__proto__:null,foo:{}},wu=Object;nn.exports=function(){return{__proto__:qe}.foo===qe.foo&&!(qe instanceof wu)}});var xe=l((Nc,an)=>{"use strict";o();i();var Pu=Function.prototype.call,Ou=Object.prototype.hasOwnProperty,Eu=L();an.exports=Eu.call(Pu,Ou)});var F=l((Dc,ln)=>{"use strict";o();i();var m,qu=Se(),xu=Ae(),$u=we(),Iu=Pe(),tr=Ur(),er=w(),Fu=Oe(),sn=Function,$e=function(e){try{return sn('"use strict"; return ('+e+").constructor;")()}catch(r){}},z=Object.getOwnPropertyDescriptor;if(z)try{z({},"")}catch(e){z=null}var Ie=function(){throw new er},Tu=z?function(){try{return arguments.callee,Ie}catch(e){try{return z(arguments,"callee").get}catch(r){return Ie}}}():Ie,Z=Ee()(),Ru=on()(),O=Object.getPrototypeOf||(Ru?function(e){return e.__proto__}:null),rr={},Nu=typeof Uint8Array=="undefined"||!O?m:O(Uint8Array),J={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?m:ArrayBuffer,"%ArrayIteratorPrototype%":Z&&O?O([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%Atomics%":typeof Atomics=="undefined"?m:Atomics,"%BigInt%":typeof BigInt=="undefined"?m:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?m:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?m:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?m:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":qu,"%eval%":eval,"%EvalError%":xu,"%Float32Array%":typeof Float32Array=="undefined"?m:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?m:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?m:FinalizationRegistry,"%Function%":sn,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array=="undefined"?m:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?m:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Z&&O?O(O([][Symbol.iterator]())):m,"%JSON%":typeof JSON=="object"?JSON:m,"%Map%":typeof Map=="undefined"?m:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Z||!O?m:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?m:Promise,"%Proxy%":typeof Proxy=="undefined"?m:Proxy,"%RangeError%":$u,"%ReferenceError%":Iu,"%Reflect%":typeof Reflect=="undefined"?m:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?m:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Z||!O?m:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Z&&O?O(""[Symbol.iterator]()):m,"%Symbol%":Z?Symbol:m,"%SyntaxError%":tr,"%ThrowTypeError%":Tu,"%TypedArray%":Nu,"%TypeError%":er,"%Uint8Array%":typeof Uint8Array=="undefined"?m:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?m:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?m:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?m:Uint32Array,"%URIError%":Fu,"%WeakMap%":typeof WeakMap=="undefined"?m:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?m:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?m:WeakSet};if(O)try{null.error}catch(e){un=O(O(e)),J["%Error.prototype%"]=un}var un,_u=function e(r){var t;if(r==="%AsyncFunction%")t=$e("async function () {}");else if(r==="%GeneratorFunction%")t=$e("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=$e("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&O&&(t=O(a.prototype))}return J[r]=t,t},fn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},vr=L(),Dr=xe(),Uu=vr.call(Function.call,Array.prototype.concat),Du=vr.call(Function.apply,Array.prototype.splice),pn=vr.call(Function.call,String.prototype.replace),Br=vr.call(Function.call,String.prototype.slice),Bu=vr.call(Function.call,RegExp.prototype.exec),Mu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Cu=/\\(\\)?/g,ju=function(r){var t=Br(r,0,1),n=Br(r,-1);if(t==="%"&&n!=="%")throw new tr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new tr("invalid intrinsic syntax, expected opening `%`");var a=[];return pn(r,Mu,function(u,f,c,y){a[a.length]=c?pn(y,Cu,"$1"):f||u}),a},Gu=function(r,t){var n=r,a;if(Dr(fn,n)&&(a=fn[n],n="%"+a[0]+"%"),Dr(J,n)){var u=J[n];if(u===rr&&(u=_u(n)),typeof u=="undefined"&&!t)throw new er("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:u}}throw new tr("intrinsic "+r+" does not exist!")};ln.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new er("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new er('"allowMissing" argument must be a boolean');if(Bu(/^%?[^%]*%?$/,r)===null)throw new tr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ju(r),a=n.length>0?n[0]:"",u=Gu("%"+a+"%",t),f=u.name,c=u.value,y=!1,h=u.alias;h&&(a=h[0],Du(n,Uu([0,1],h)));for(var g=1,d=!0;g<n.length;g+=1){var v=n[g],A=Br(v,0,1),P=Br(v,-1);if((A==='"'||A==="'"||A==="`"||P==='"'||P==="'"||P==="`")&&A!==P)throw new tr("property names with quotes must have matching quotes");if((v==="constructor"||!d)&&(y=!0),a+="."+v,f="%"+a+"%",Dr(J,f))c=J[f];else if(c!=null){if(!(v in c)){if(!t)throw new er("base intrinsic for "+r+" exists, but the property is not available.");return}if(z&&g+1>=n.length){var S=z(c,v);d=!!S,d&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[v]}else d=Dr(c,v),c=c[v];d&&!y&&(J[f]=c)}}return c}});var Fe=l((Cc,cn)=>{"use strict";o();i();cn.exports=Object});var vn=l((Wc,yn)=>{"use strict";o();i();yn.exports=Math.abs});var dn=l((zc,gn)=>{"use strict";o();i();gn.exports=Math.floor});var mn=l((Kc,hn)=>{"use strict";o();i();hn.exports=Math.max});var Sn=l((Qc,bn)=>{"use strict";o();i();bn.exports=Math.min});var wn=l((ry,An)=>{"use strict";o();i();An.exports=Math.pow});var On=l((ny,Pn)=>{"use strict";o();i();Pn.exports=Math.round});var qn=l((ay,En)=>{"use strict";o();i();En.exports=Number.isNaN||function(r){return r!==r}});var $n=l((py,xn)=>{"use strict";o();i();var Wu=qn();xn.exports=function(r){return Wu(r)||r===0?r:r<0?-1:1}});var Fn=l((cy,In)=>{"use strict";o();i();In.exports=Object.getOwnPropertyDescriptor});var gr=l((gy,Tn)=>{"use strict";o();i();var Mr=Fn();if(Mr)try{Mr([],"length")}catch(e){Mr=null}Tn.exports=Mr});var jr=l((my,Rn)=>{"use strict";o();i();var Cr=Object.defineProperty||!1;if(Cr)try{Cr({},"a",{value:1})}catch(e){Cr=!1}Rn.exports=Cr});var Te=l((Ay,Nn)=>{"use strict";o();i();Nn.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(var u in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var f=Object.getOwnPropertySymbols(r);if(f.length!==1||f[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(r,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0}});var Dn=l((Oy,Un)=>{"use strict";o();i();var _n=typeof Symbol!="undefined"&&Symbol,ku=Te();Un.exports=function(){return typeof _n!="function"||typeof Symbol!="function"||typeof _n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ku()}});var Re=l((xy,Bn)=>{"use strict";o();i();Bn.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var Ne=l((Fy,Mn)=>{"use strict";o();i();var Lu=Fe();Mn.exports=Lu.getPrototypeOf||null});var Gr=l((Ny,Cn)=>{"use strict";o();i();Cn.exports=Function.prototype.call});var _e=l((Dy,jn)=>{"use strict";o();i();jn.exports=Function.prototype.apply});var Wn=l((Cy,Gn)=>{"use strict";o();i();Gn.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var Ln=l((Wy,kn)=>{"use strict";o();i();var zu=L(),Ju=_e(),Hu=Gr(),Ku=Wn();kn.exports=Ku||zu.call(Hu,Ju)});var Jn=l((zy,zn)=>{"use strict";o();i();var Vu=L(),Yu=w(),Qu=Gr(),Xu=Ln();zn.exports=function(r){if(r.length<1||typeof r[0]!="function")throw new Yu("a function is required");return Xu(Vu,Qu,r)}});var Xn=l((Ky,Qn)=>{"use strict";o();i();var Zu=Jn(),Hn=gr(),Vn;try{Vn=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ue=!!Vn&&Hn&&Hn(Object.prototype,"__proto__"),Yn=Object,Kn=Yn.getPrototypeOf;Qn.exports=Ue&&typeof Ue.get=="function"?Zu([Ue.get]):typeof Kn=="function"?function(r){return Kn(r==null?r:Yn(r))}:!1});var no=l((Qy,to)=>{"use strict";o();i();var Zn=Re(),ro=Ne(),eo=Xn();to.exports=Zn?function(r){return Zn(r)}:ro?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return ro(r)}:eo?function(r){return eo(r)}:null});var Me=l((rv,po)=>{"use strict";o();i();var b,rf=Fe(),ef=Se(),tf=Ae(),nf=we(),of=Pe(),ar=Ur(),ir=w(),af=Oe(),uf=vn(),ff=dn(),pf=mn(),sf=Sn(),lf=wn(),cf=On(),yf=$n(),uo=Function,De=function(e){try{return uo('"use strict"; return ('+e+").constructor;")()}catch(r){}},dr=gr(),vf=jr(),Be=function(){throw new ir},gf=dr?function(){try{return arguments.callee,Be}catch(e){try{return dr(arguments,"callee").get}catch(r){return Be}}}():Be,nr=Dn()(),E=no(),df=Ne(),hf=Re(),fo=_e(),hr=Gr(),or={},mf=typeof Uint8Array=="undefined"||!E?b:E(Uint8Array),H={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?b:ArrayBuffer,"%ArrayIteratorPrototype%":nr&&E?E([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":or,"%AsyncGenerator%":or,"%AsyncGeneratorFunction%":or,"%AsyncIteratorPrototype%":or,"%Atomics%":typeof Atomics=="undefined"?b:Atomics,"%BigInt%":typeof BigInt=="undefined"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ef,"%eval%":eval,"%EvalError%":tf,"%Float32Array%":typeof Float32Array=="undefined"?b:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?b:FinalizationRegistry,"%Function%":uo,"%GeneratorFunction%":or,"%Int8Array%":typeof Int8Array=="undefined"?b:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?b:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nr&&E?E(E([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map=="undefined"?b:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!nr||!E?b:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":rf,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?b:Promise,"%Proxy%":typeof Proxy=="undefined"?b:Proxy,"%RangeError%":nf,"%ReferenceError%":of,"%Reflect%":typeof Reflect=="undefined"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?b:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!nr||!E?b:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nr&&E?E(""[Symbol.iterator]()):b,"%Symbol%":nr?Symbol:b,"%SyntaxError%":ar,"%ThrowTypeError%":gf,"%TypedArray%":mf,"%TypeError%":ir,"%Uint8Array%":typeof Uint8Array=="undefined"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?b:Uint32Array,"%URIError%":af,"%WeakMap%":typeof WeakMap=="undefined"?b:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?b:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?b:WeakSet,"%Function.prototype.call%":hr,"%Function.prototype.apply%":fo,"%Object.defineProperty%":vf,"%Object.getPrototypeOf%":df,"%Math.abs%":uf,"%Math.floor%":ff,"%Math.max%":pf,"%Math.min%":sf,"%Math.pow%":lf,"%Math.round%":cf,"%Math.sign%":yf,"%Reflect.getPrototypeOf%":hf};if(E)try{null.error}catch(e){oo=E(E(e)),H["%Error.prototype%"]=oo}var oo,bf=function e(r){var t;if(r==="%AsyncFunction%")t=De("async function () {}");else if(r==="%GeneratorFunction%")t=De("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=De("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&E&&(t=E(a.prototype))}return H[r]=t,t},io={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},mr=L(),Wr=xe(),Sf=mr.call(hr,Array.prototype.concat),Af=mr.call(fo,Array.prototype.splice),ao=mr.call(hr,String.prototype.replace),kr=mr.call(hr,String.prototype.slice),wf=mr.call(hr,RegExp.prototype.exec),Pf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Of=/\\(\\)?/g,Ef=function(r){var t=kr(r,0,1),n=kr(r,-1);if(t==="%"&&n!=="%")throw new ar("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new ar("invalid intrinsic syntax, expected opening `%`");var a=[];return ao(r,Pf,function(u,f,c,y){a[a.length]=c?ao(y,Of,"$1"):f||u}),a},qf=function(r,t){var n=r,a;if(Wr(io,n)&&(a=io[n],n="%"+a[0]+"%"),Wr(H,n)){var u=H[n];if(u===or&&(u=bf(n)),typeof u=="undefined"&&!t)throw new ir("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:u}}throw new ar("intrinsic "+r+" does not exist!")};po.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new ir("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new ir('"allowMissing" argument must be a boolean');if(wf(/^%?[^%]*%?$/,r)===null)throw new ar("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ef(r),a=n.length>0?n[0]:"",u=qf("%"+a+"%",t),f=u.name,c=u.value,y=!1,h=u.alias;h&&(a=h[0],Af(n,Sf([0,1],h)));for(var g=1,d=!0;g<n.length;g+=1){var v=n[g],A=kr(v,0,1),P=kr(v,-1);if((A==='"'||A==="'"||A==="`"||P==='"'||P==="'"||P==="`")&&A!==P)throw new ar("property names with quotes must have matching quotes");if((v==="constructor"||!d)&&(y=!0),a+="."+v,f="%"+a+"%",Wr(H,f))c=H[f];else if(c!=null){if(!(v in c)){if(!t)throw new ir("base intrinsic for "+r+" exists, but the property is not available.");return}if(dr&&g+1>=n.length){var S=dr(c,v);d=!!S,d&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[v]}else d=Wr(c,v),c=c[v];d&&!y&&(H[f]=c)}}return c}});var Ce=l((nv,co)=>{"use strict";o();i();var so=jr(),xf=Ur(),ur=w(),lo=gr();co.exports=function(r,t,n){if(!r||typeof r!="object"&&typeof r!="function")throw new ur("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ur("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ur("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ur("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ur("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ur("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,y=!!lo&&lo(r,t);if(so)so(r,t,{configurable:f===null&&y?y.configurable:!f,enumerable:a===null&&y?y.enumerable:!a,value:n,writable:u===null&&y?y.writable:!u});else if(c||!a&&!u&&!f)r[t]=n;else throw new xf("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ge=l((av,vo)=>{"use strict";o();i();var je=jr(),yo=function(){return!!je};yo.hasArrayLengthDefineBug=function(){if(!je)return null;try{return je([],"length",{value:1}).length!==1}catch(r){return!0}};vo.exports=yo});var So=l((pv,bo)=>{"use strict";o();i();var $f=Me(),go=Ce(),If=Ge()(),ho=gr(),mo=w(),Ff=$f("%Math.floor%");bo.exports=function(r,t){if(typeof r!="function")throw new mo("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Ff(t)!==t)throw new mo("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,u=!0;if("length"in r&&ho){var f=ho(r,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(u=!1)}return(a||u||!n)&&(If?go(r,"length",t,!0,!0):go(r,"length",t)),r}});var wo=l((cv,Ao)=>{"use strict";o();i();var Tf=Me(),Lr=Tf("%Object.defineProperty%",!0)||!1;if(Lr)try{Lr({},"a",{value:1})}catch(e){Lr=!1}Ao.exports=Lr});var Hr=l((gv,zr)=>{"use strict";o();i();var We=L(),Jr=F(),Rf=So(),Nf=w(),Eo=Jr("%Function.prototype.apply%"),qo=Jr("%Function.prototype.call%"),xo=Jr("%Reflect.apply%",!0)||We.call(qo,Eo),Po=wo(),_f=Jr("%Math.max%");zr.exports=function(r){if(typeof r!="function")throw new Nf("a function is required");var t=xo(We,qo,arguments);return Rf(t,1+_f(0,r.length-(arguments.length-1)),!0)};var Oo=function(){return xo(We,Eo,arguments)};Po?Po(zr.exports,"apply",{value:Oo}):zr.exports.apply=Oo});var ke=l((mv,Io)=>{"use strict";o();i();var $o=Object.prototype.toString;Io.exports=function(r){var t=$o.call(r),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&$o.call(r.callee)==="[object Function]"),n}});var Mo=l((Av,Bo)=>{"use strict";o();i();var Do;Object.keys||(br=Object.prototype.hasOwnProperty,Le=Object.prototype.toString,Fo=ke(),ze=Object.prototype.propertyIsEnumerable,To=!ze.call({toString:null},"toString"),Ro=ze.call(function(){},"prototype"),Sr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Kr=function(e){var r=e.constructor;return r&&r.prototype===e},No={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},_o=function(){if(typeof window=="undefined")return!1;for(var e in window)try{if(!No["$"+e]&&br.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Kr(window[e])}catch(r){return!0}}catch(r){return!0}return!1}(),Uo=function(e){if(typeof window=="undefined"||!_o)return Kr(e);try{return Kr(e)}catch(r){return!1}},Do=function(r){var t=r!==null&&typeof r=="object",n=Le.call(r)==="[object Function]",a=Fo(r),u=t&&Le.call(r)==="[object String]",f=[];if(!t&&!n&&!a)throw new TypeError("Object.keys called on a non-object");var c=Ro&&n;if(u&&r.length>0&&!br.call(r,0))for(var y=0;y<r.length;++y)f.push(String(y));if(a&&r.length>0)for(var h=0;h<r.length;++h)f.push(String(h));else for(var g in r)!(c&&g==="prototype")&&br.call(r,g)&&f.push(String(g));if(To)for(var d=Uo(r),v=0;v<Sr.length;++v)!(d&&Sr[v]==="constructor")&&br.call(r,Sr[v])&&f.push(Sr[v]);return f});var br,Le,Fo,ze,To,Ro,Sr,Kr,No,_o,Uo;Bo.exports=Do});var Wo=l((Ov,Go)=>{"use strict";o();i();var Uf=Array.prototype.slice,Df=ke(),Co=Object.keys,Vr=Co?function(r){return Co(r)}:Mo(),jo=Object.keys;Vr.shim=function(){if(Object.keys){var r=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);r||(Object.keys=function(n){return Df(n)?jo(Uf.call(n)):jo(n)})}else Object.keys=Vr;return Object.keys||Vr};Go.exports=Vr});var Ar=l((xv,Jo)=>{"use strict";o();i();var Bf=Wo(),Mf=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Cf=Object.prototype.toString,jf=Array.prototype.concat,ko=Ce(),Gf=function(e){return typeof e=="function"&&Cf.call(e)==="[object Function]"},Lo=Ge()(),Wf=function(e,r,t,n){if(r in e){if(n===!0){if(e[r]===t)return}else if(!Gf(n)||!n())return}Lo?ko(e,r,t,!0):ko(e,r,t)},zo=function(e,r){var t=arguments.length>2?arguments[2]:{},n=Bf(r);Mf&&(n=jf.call(n,Object.getOwnPropertySymbols(r)));for(var a=0;a<n.length;a+=1)Wf(e,n[a],r[n[a]],t[n[a]])};zo.supportsDescriptors=!!Lo;Jo.exports=zo});var I=l((Fv,Vo)=>{"use strict";o();i();var Ho=F(),Ko=Hr(),kf=Ko(Ho("String.prototype.indexOf"));Vo.exports=function(r,t){var n=Ho(r,!!t);return typeof n=="function"&&kf(r,".prototype.")>-1?Ko(n):n}});var Xo=l((Nv,Qo)=>{"use strict";o();i();var Lf=F(),Yo=Lf("%Array%"),zf=!Yo.isArray&&I()("Object.prototype.toString");Qo.exports=Yo.isArray||function(r){return zf(r)==="[object Array]"}});var Je=l((Dv,Zo)=>{"use strict";o();i();Zo.exports=Xo()});var ei=l((Cv,ri)=>{"use strict";o();i();var Jf=F(),Hf=I(),Kf=w(),Vf=Je(),Yf=Jf("%Reflect.apply%",!0)||Hf("Function.prototype.apply");ri.exports=function(r,t){var n=arguments.length>2?arguments[2]:[];if(!Vf(n))throw new Kf("Assertion failed: optional `argumentsList`, if provided, must be a List");return Yf(r,t,n)}});function ti(){throw new Error("setTimeout has not been defined")}function ni(){throw new Error("clearTimeout has not been defined")}function oi(e){if(C===setTimeout)return setTimeout(e,0);if((C===ti||!C)&&setTimeout)return C=setTimeout,setTimeout(e,0);try{return C(e,0)}catch(r){try{return C.call(null,e,0)}catch(t){return C.call(this,e,0)}}}function Qf(e){if(j===clearTimeout)return clearTimeout(e);if((j===ni||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(e);try{return j(e)}catch(r){try{return j.call(null,e)}catch(t){return j.call(this,e)}}}function Xf(){!pr||!K||(pr=!1,K.length?U=K.concat(U):Yr=-1,U.length&&ii())}function ii(){if(!pr){var e=oi(Xf);pr=!0;for(var r=U.length;r;){for(K=U,U=[];++Yr<r;)K&&K[Yr].run();Yr=-1,r=U.length}K=null,pr=!1,Qf(e)}}function Zf(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];U.push(new ai(e,r)),U.length===1&&!pr&&oi(ii)}function ai(e,r){this.fun=e,this.array=r}function V(){}function dp(e){throw new Error("process.binding is not supported")}function hp(){return"/"}function mp(e){throw new Error("process.chdir is not supported")}function bp(){return 0}function Ap(e){var r=Sp.call(fr)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}function Pp(){var e=new Date,r=e-wp;return r/1e3}var C,j,U,pr,K,Yr,rp,ep,tp,np,op,ip,ap,up,fp,pp,sp,lp,cp,yp,vp,gp,fr,Sp,wp,Op,wr,ui=be(()=>{"use strict";o();i();C=ti,j=ni;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(j=clearTimeout);U=[],pr=!1,Yr=-1;ai.prototype.run=function(){this.fun.apply(null,this.array)};rp="browser",ep="browser",tp=!0,np={},op=[],ip="",ap={},up={},fp={};pp=V,sp=V,lp=V,cp=V,yp=V,vp=V,gp=V;fr=globalThis.performance||{},Sp=fr.now||fr.mozNow||fr.msNow||fr.oNow||fr.webkitNow||function(){return new Date().getTime()};wp=new Date;Op={nextTick:Zf,title:rp,browser:tp,env:np,argv:op,version:ip,versions:ap,on:pp,addListener:sp,once:lp,off:cp,removeListener:yp,removeAllListeners:vp,emit:gp,binding:dp,cwd:hp,chdir:mp,umask:bp,hrtime:Ap,platform:ep,release:up,config:fp,uptime:Pp},wr=Op});var He,Ke,fi=be(()=>{"use strict";o();i();typeof Object.create=="function"?He=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:He=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};Ke=He});var di={};su(di,{_extend:()=>nt,debuglog:()=>pi,default:()=>_p,deprecate:()=>Ze,format:()=>re,inherits:()=>Ke,inspect:()=>R,isArray:()=>rt,isBoolean:()=>ee,isBuffer:()=>yi,isDate:()=>Zr,isError:()=>Or,isFunction:()=>Er,isNull:()=>qr,isNullOrUndefined:()=>si,isNumber:()=>et,isObject:()=>Y,isPrimitive:()=>ci,isRegExp:()=>Pr,isString:()=>xr,isSymbol:()=>li,isUndefined:()=>T,log:()=>vi});function re(e){if(!xr(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(R(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,a=n.length,u=String(e).replace(Ep,function(c){if(c==="%%")return"%";if(t>=a)return c;switch(c){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(y){return"[Circular]"}default:return c}}),f=n[t];t<a;f=n[++t])qr(f)||!Y(f)?u+=" "+f:u+=" "+R(f);return u}function Ze(e,r){if(T(globalThis.process))return function(){return Ze(e,r).apply(this,arguments)};if(wr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(wr.throwDeprecation)throw new Error(r);wr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}function pi(e){if(T(Ve)&&(Ve=wr.env.NODE_DEBUG||""),e=e.toUpperCase(),!Qr[e])if(new RegExp("\\b"+e+"\\b","i").test(Ve)){var r=0;Qr[e]=function(){var t=re.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else Qr[e]=function(){};return Qr[e]}function R(e,r){var t={seen:[],stylize:xp};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),ee(r)?t.showHidden=r:r&&nt(t,r),T(t.showHidden)&&(t.showHidden=!1),T(t.depth)&&(t.depth=2),T(t.colors)&&(t.colors=!1),T(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=qp),Xr(t,e,t.depth)}function qp(e,r){var t=R.styles[r];return t?"\x1B["+R.colors[t][0]+"m"+e+"\x1B["+R.colors[t][1]+"m":e}function xp(e,r){return e}function $p(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Xr(e,r,t){if(e.customInspect&&r&&Er(r.inspect)&&r.inspect!==R&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return xr(n)||(n=Xr(e,n,t)),n}var a=Ip(e,r);if(a)return a;var u=Object.keys(r),f=$p(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(r)),Or(r)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return Ye(r);if(u.length===0){if(Er(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(Pr(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(Zr(r))return e.stylize(Date.prototype.toString.call(r),"date");if(Or(r))return Ye(r)}var y="",h=!1,g=["{","}"];if(rt(r)&&(h=!0,g=["[","]"]),Er(r)){var d=r.name?": "+r.name:"";y=" [Function"+d+"]"}if(Pr(r)&&(y=" "+RegExp.prototype.toString.call(r)),Zr(r)&&(y=" "+Date.prototype.toUTCString.call(r)),Or(r)&&(y=" "+Ye(r)),u.length===0&&(!h||r.length==0))return g[0]+y+g[1];if(t<0)return Pr(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var v;return h?v=Fp(e,r,t,f,u):v=u.map(function(A){return Xe(e,r,t,f,A,h)}),e.seen.pop(),Tp(v,y,g)}function Ip(e,r){if(T(r))return e.stylize("undefined","undefined");if(xr(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(et(r))return e.stylize(""+r,"number");if(ee(r))return e.stylize(""+r,"boolean");if(qr(r))return e.stylize("null","null")}function Ye(e){return"["+Error.prototype.toString.call(e)+"]"}function Fp(e,r,t,n,a){for(var u=[],f=0,c=r.length;f<c;++f)gi(r,String(f))?u.push(Xe(e,r,t,n,String(f),!0)):u.push("");return a.forEach(function(y){y.match(/^\d+$/)||u.push(Xe(e,r,t,n,y,!0))}),u}function Xe(e,r,t,n,a,u){var f,c,y;if(y=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]},y.get?y.set?c=e.stylize("[Getter/Setter]","special"):c=e.stylize("[Getter]","special"):y.set&&(c=e.stylize("[Setter]","special")),gi(n,a)||(f="["+a+"]"),c||(e.seen.indexOf(y.value)<0?(qr(t)?c=Xr(e,y.value,null):c=Xr(e,y.value,t-1),c.indexOf(`
1
+ import{a as yu}from"./chunk-5YGLJUYD.js";import"./chunk-MMCQWL5J.js";import"./chunk-BGMLQMW7.js";import"./chunk-G6X3OBKW.js";import"./chunk-7HKG5U5F.js";import"./chunk-YELOIV6Y.js";import{e as be,f as l,g as su,h as lu,i as cu,k as o,l as p,m as i}from"./chunk-ZFTBBCKC.js";var Lt=l((Ql,kt)=>{"use strict";o();i();var vu="Function.prototype.bind called on incompatible ",gu=Object.prototype.toString,du=Math.max,hu="[object Function]",Wt=function(r,t){for(var n=[],a=0;a<r.length;a+=1)n[a]=r[a];for(var u=0;u<t.length;u+=1)n[u+r.length]=t[u];return n},mu=function(r,t){for(var n=[],a=t||0,u=0;a<r.length;a+=1,u+=1)n[u]=r[a];return n},bu=function(e,r){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=r);return t};kt.exports=function(r){var t=this;if(typeof t!="function"||gu.apply(t)!==hu)throw new TypeError(vu+t);for(var n=mu(arguments,1),a,u=function(){if(this instanceof a){var g=t.apply(this,Wt(n,arguments));return Object(g)===g?g:this}return t.apply(r,Wt(n,arguments))},f=du(0,t.length-n.length),c=[],y=0;y<f;y++)c[y]="$"+y;if(a=Function("binder","return function ("+bu(c,",")+"){ return binder.apply(this,arguments); }")(u),t.prototype){var h=function(){};h.prototype=t.prototype,a.prototype=new h,h.prototype=null}return a}});var L=l((rc,zt)=>{"use strict";o();i();var Su=Lt();zt.exports=Function.prototype.bind||Su});var Se=l((nc,Jt)=>{"use strict";o();i();Jt.exports=Error});var Ae=l((ac,Ht)=>{"use strict";o();i();Ht.exports=EvalError});var we=l((pc,Kt)=>{"use strict";o();i();Kt.exports=RangeError});var Pe=l((cc,Vt)=>{"use strict";o();i();Vt.exports=ReferenceError});var Ur=l((gc,Yt)=>{"use strict";o();i();Yt.exports=SyntaxError});var w=l((mc,Qt)=>{"use strict";o();i();Qt.exports=TypeError});var Oe=l((Ac,Xt)=>{"use strict";o();i();Xt.exports=URIError});var rn=l((Oc,Zt)=>{"use strict";o();i();Zt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var u=Object.getOwnPropertySymbols(r);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(r,t);if(f.value!==a||f.enumerable!==!0)return!1}return!0}});var Ee=l((xc,tn)=>{"use strict";o();i();var en=typeof Symbol!="undefined"&&Symbol,Au=rn();tn.exports=function(){return typeof en!="function"||typeof Symbol!="function"||typeof en("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Au()}});var on=l((Fc,nn)=>{"use strict";o();i();var qe={__proto__:null,foo:{}},wu=Object;nn.exports=function(){return{__proto__:qe}.foo===qe.foo&&!(qe instanceof wu)}});var xe=l((Nc,an)=>{"use strict";o();i();var Pu=Function.prototype.call,Ou=Object.prototype.hasOwnProperty,Eu=L();an.exports=Eu.call(Pu,Ou)});var F=l((Dc,ln)=>{"use strict";o();i();var m,qu=Se(),xu=Ae(),$u=we(),Iu=Pe(),tr=Ur(),er=w(),Fu=Oe(),sn=Function,$e=function(e){try{return sn('"use strict"; return ('+e+").constructor;")()}catch(r){}},z=Object.getOwnPropertyDescriptor;if(z)try{z({},"")}catch(e){z=null}var Ie=function(){throw new er},Tu=z?function(){try{return arguments.callee,Ie}catch(e){try{return z(arguments,"callee").get}catch(r){return Ie}}}():Ie,Z=Ee()(),Ru=on()(),O=Object.getPrototypeOf||(Ru?function(e){return e.__proto__}:null),rr={},Nu=typeof Uint8Array=="undefined"||!O?m:O(Uint8Array),J={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?m:ArrayBuffer,"%ArrayIteratorPrototype%":Z&&O?O([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%Atomics%":typeof Atomics=="undefined"?m:Atomics,"%BigInt%":typeof BigInt=="undefined"?m:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?m:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?m:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?m:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":qu,"%eval%":eval,"%EvalError%":xu,"%Float32Array%":typeof Float32Array=="undefined"?m:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?m:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?m:FinalizationRegistry,"%Function%":sn,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array=="undefined"?m:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?m:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Z&&O?O(O([][Symbol.iterator]())):m,"%JSON%":typeof JSON=="object"?JSON:m,"%Map%":typeof Map=="undefined"?m:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Z||!O?m:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?m:Promise,"%Proxy%":typeof Proxy=="undefined"?m:Proxy,"%RangeError%":$u,"%ReferenceError%":Iu,"%Reflect%":typeof Reflect=="undefined"?m:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?m:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Z||!O?m:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Z&&O?O(""[Symbol.iterator]()):m,"%Symbol%":Z?Symbol:m,"%SyntaxError%":tr,"%ThrowTypeError%":Tu,"%TypedArray%":Nu,"%TypeError%":er,"%Uint8Array%":typeof Uint8Array=="undefined"?m:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?m:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?m:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?m:Uint32Array,"%URIError%":Fu,"%WeakMap%":typeof WeakMap=="undefined"?m:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?m:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?m:WeakSet};if(O)try{null.error}catch(e){un=O(O(e)),J["%Error.prototype%"]=un}var un,_u=function e(r){var t;if(r==="%AsyncFunction%")t=$e("async function () {}");else if(r==="%GeneratorFunction%")t=$e("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=$e("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&O&&(t=O(a.prototype))}return J[r]=t,t},fn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},vr=L(),Dr=xe(),Uu=vr.call(Function.call,Array.prototype.concat),Du=vr.call(Function.apply,Array.prototype.splice),pn=vr.call(Function.call,String.prototype.replace),Br=vr.call(Function.call,String.prototype.slice),Bu=vr.call(Function.call,RegExp.prototype.exec),Mu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Cu=/\\(\\)?/g,ju=function(r){var t=Br(r,0,1),n=Br(r,-1);if(t==="%"&&n!=="%")throw new tr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new tr("invalid intrinsic syntax, expected opening `%`");var a=[];return pn(r,Mu,function(u,f,c,y){a[a.length]=c?pn(y,Cu,"$1"):f||u}),a},Gu=function(r,t){var n=r,a;if(Dr(fn,n)&&(a=fn[n],n="%"+a[0]+"%"),Dr(J,n)){var u=J[n];if(u===rr&&(u=_u(n)),typeof u=="undefined"&&!t)throw new er("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:u}}throw new tr("intrinsic "+r+" does not exist!")};ln.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new er("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new er('"allowMissing" argument must be a boolean');if(Bu(/^%?[^%]*%?$/,r)===null)throw new tr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ju(r),a=n.length>0?n[0]:"",u=Gu("%"+a+"%",t),f=u.name,c=u.value,y=!1,h=u.alias;h&&(a=h[0],Du(n,Uu([0,1],h)));for(var g=1,d=!0;g<n.length;g+=1){var v=n[g],A=Br(v,0,1),P=Br(v,-1);if((A==='"'||A==="'"||A==="`"||P==='"'||P==="'"||P==="`")&&A!==P)throw new tr("property names with quotes must have matching quotes");if((v==="constructor"||!d)&&(y=!0),a+="."+v,f="%"+a+"%",Dr(J,f))c=J[f];else if(c!=null){if(!(v in c)){if(!t)throw new er("base intrinsic for "+r+" exists, but the property is not available.");return}if(z&&g+1>=n.length){var S=z(c,v);d=!!S,d&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[v]}else d=Dr(c,v),c=c[v];d&&!y&&(J[f]=c)}}return c}});var Fe=l((Cc,cn)=>{"use strict";o();i();cn.exports=Object});var vn=l((Wc,yn)=>{"use strict";o();i();yn.exports=Math.abs});var dn=l((zc,gn)=>{"use strict";o();i();gn.exports=Math.floor});var mn=l((Kc,hn)=>{"use strict";o();i();hn.exports=Math.max});var Sn=l((Qc,bn)=>{"use strict";o();i();bn.exports=Math.min});var wn=l((ry,An)=>{"use strict";o();i();An.exports=Math.pow});var On=l((ny,Pn)=>{"use strict";o();i();Pn.exports=Math.round});var qn=l((ay,En)=>{"use strict";o();i();En.exports=Number.isNaN||function(r){return r!==r}});var $n=l((py,xn)=>{"use strict";o();i();var Wu=qn();xn.exports=function(r){return Wu(r)||r===0?r:r<0?-1:1}});var Fn=l((cy,In)=>{"use strict";o();i();In.exports=Object.getOwnPropertyDescriptor});var gr=l((gy,Tn)=>{"use strict";o();i();var Mr=Fn();if(Mr)try{Mr([],"length")}catch(e){Mr=null}Tn.exports=Mr});var jr=l((my,Rn)=>{"use strict";o();i();var Cr=Object.defineProperty||!1;if(Cr)try{Cr({},"a",{value:1})}catch(e){Cr=!1}Rn.exports=Cr});var Te=l((Ay,Nn)=>{"use strict";o();i();Nn.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(var u in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var f=Object.getOwnPropertySymbols(r);if(f.length!==1||f[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(r,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0}});var Dn=l((Oy,Un)=>{"use strict";o();i();var _n=typeof Symbol!="undefined"&&Symbol,ku=Te();Un.exports=function(){return typeof _n!="function"||typeof Symbol!="function"||typeof _n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ku()}});var Re=l((xy,Bn)=>{"use strict";o();i();Bn.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var Ne=l((Fy,Mn)=>{"use strict";o();i();var Lu=Fe();Mn.exports=Lu.getPrototypeOf||null});var Gr=l((Ny,Cn)=>{"use strict";o();i();Cn.exports=Function.prototype.call});var _e=l((Dy,jn)=>{"use strict";o();i();jn.exports=Function.prototype.apply});var Wn=l((Cy,Gn)=>{"use strict";o();i();Gn.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var Ln=l((Wy,kn)=>{"use strict";o();i();var zu=L(),Ju=_e(),Hu=Gr(),Ku=Wn();kn.exports=Ku||zu.call(Hu,Ju)});var Jn=l((zy,zn)=>{"use strict";o();i();var Vu=L(),Yu=w(),Qu=Gr(),Xu=Ln();zn.exports=function(r){if(r.length<1||typeof r[0]!="function")throw new Yu("a function is required");return Xu(Vu,Qu,r)}});var Xn=l((Ky,Qn)=>{"use strict";o();i();var Zu=Jn(),Hn=gr(),Vn;try{Vn=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ue=!!Vn&&Hn&&Hn(Object.prototype,"__proto__"),Yn=Object,Kn=Yn.getPrototypeOf;Qn.exports=Ue&&typeof Ue.get=="function"?Zu([Ue.get]):typeof Kn=="function"?function(r){return Kn(r==null?r:Yn(r))}:!1});var no=l((Qy,to)=>{"use strict";o();i();var Zn=Re(),ro=Ne(),eo=Xn();to.exports=Zn?function(r){return Zn(r)}:ro?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return ro(r)}:eo?function(r){return eo(r)}:null});var Me=l((rv,po)=>{"use strict";o();i();var b,rf=Fe(),ef=Se(),tf=Ae(),nf=we(),of=Pe(),ar=Ur(),ir=w(),af=Oe(),uf=vn(),ff=dn(),pf=mn(),sf=Sn(),lf=wn(),cf=On(),yf=$n(),uo=Function,De=function(e){try{return uo('"use strict"; return ('+e+").constructor;")()}catch(r){}},dr=gr(),vf=jr(),Be=function(){throw new ir},gf=dr?function(){try{return arguments.callee,Be}catch(e){try{return dr(arguments,"callee").get}catch(r){return Be}}}():Be,nr=Dn()(),E=no(),df=Ne(),hf=Re(),fo=_e(),hr=Gr(),or={},mf=typeof Uint8Array=="undefined"||!E?b:E(Uint8Array),H={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?b:ArrayBuffer,"%ArrayIteratorPrototype%":nr&&E?E([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":or,"%AsyncGenerator%":or,"%AsyncGeneratorFunction%":or,"%AsyncIteratorPrototype%":or,"%Atomics%":typeof Atomics=="undefined"?b:Atomics,"%BigInt%":typeof BigInt=="undefined"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ef,"%eval%":eval,"%EvalError%":tf,"%Float32Array%":typeof Float32Array=="undefined"?b:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?b:FinalizationRegistry,"%Function%":uo,"%GeneratorFunction%":or,"%Int8Array%":typeof Int8Array=="undefined"?b:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?b:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nr&&E?E(E([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map=="undefined"?b:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!nr||!E?b:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":rf,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?b:Promise,"%Proxy%":typeof Proxy=="undefined"?b:Proxy,"%RangeError%":nf,"%ReferenceError%":of,"%Reflect%":typeof Reflect=="undefined"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?b:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!nr||!E?b:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nr&&E?E(""[Symbol.iterator]()):b,"%Symbol%":nr?Symbol:b,"%SyntaxError%":ar,"%ThrowTypeError%":gf,"%TypedArray%":mf,"%TypeError%":ir,"%Uint8Array%":typeof Uint8Array=="undefined"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?b:Uint32Array,"%URIError%":af,"%WeakMap%":typeof WeakMap=="undefined"?b:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?b:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?b:WeakSet,"%Function.prototype.call%":hr,"%Function.prototype.apply%":fo,"%Object.defineProperty%":vf,"%Object.getPrototypeOf%":df,"%Math.abs%":uf,"%Math.floor%":ff,"%Math.max%":pf,"%Math.min%":sf,"%Math.pow%":lf,"%Math.round%":cf,"%Math.sign%":yf,"%Reflect.getPrototypeOf%":hf};if(E)try{null.error}catch(e){oo=E(E(e)),H["%Error.prototype%"]=oo}var oo,bf=function e(r){var t;if(r==="%AsyncFunction%")t=De("async function () {}");else if(r==="%GeneratorFunction%")t=De("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=De("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&E&&(t=E(a.prototype))}return H[r]=t,t},io={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},mr=L(),Wr=xe(),Sf=mr.call(hr,Array.prototype.concat),Af=mr.call(fo,Array.prototype.splice),ao=mr.call(hr,String.prototype.replace),kr=mr.call(hr,String.prototype.slice),wf=mr.call(hr,RegExp.prototype.exec),Pf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Of=/\\(\\)?/g,Ef=function(r){var t=kr(r,0,1),n=kr(r,-1);if(t==="%"&&n!=="%")throw new ar("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new ar("invalid intrinsic syntax, expected opening `%`");var a=[];return ao(r,Pf,function(u,f,c,y){a[a.length]=c?ao(y,Of,"$1"):f||u}),a},qf=function(r,t){var n=r,a;if(Wr(io,n)&&(a=io[n],n="%"+a[0]+"%"),Wr(H,n)){var u=H[n];if(u===or&&(u=bf(n)),typeof u=="undefined"&&!t)throw new ir("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:u}}throw new ar("intrinsic "+r+" does not exist!")};po.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new ir("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new ir('"allowMissing" argument must be a boolean');if(wf(/^%?[^%]*%?$/,r)===null)throw new ar("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ef(r),a=n.length>0?n[0]:"",u=qf("%"+a+"%",t),f=u.name,c=u.value,y=!1,h=u.alias;h&&(a=h[0],Af(n,Sf([0,1],h)));for(var g=1,d=!0;g<n.length;g+=1){var v=n[g],A=kr(v,0,1),P=kr(v,-1);if((A==='"'||A==="'"||A==="`"||P==='"'||P==="'"||P==="`")&&A!==P)throw new ar("property names with quotes must have matching quotes");if((v==="constructor"||!d)&&(y=!0),a+="."+v,f="%"+a+"%",Wr(H,f))c=H[f];else if(c!=null){if(!(v in c)){if(!t)throw new ir("base intrinsic for "+r+" exists, but the property is not available.");return}if(dr&&g+1>=n.length){var S=dr(c,v);d=!!S,d&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[v]}else d=Wr(c,v),c=c[v];d&&!y&&(H[f]=c)}}return c}});var Ce=l((nv,co)=>{"use strict";o();i();var so=jr(),xf=Ur(),ur=w(),lo=gr();co.exports=function(r,t,n){if(!r||typeof r!="object"&&typeof r!="function")throw new ur("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ur("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ur("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ur("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ur("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ur("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,y=!!lo&&lo(r,t);if(so)so(r,t,{configurable:f===null&&y?y.configurable:!f,enumerable:a===null&&y?y.enumerable:!a,value:n,writable:u===null&&y?y.writable:!u});else if(c||!a&&!u&&!f)r[t]=n;else throw new xf("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ge=l((av,vo)=>{"use strict";o();i();var je=jr(),yo=function(){return!!je};yo.hasArrayLengthDefineBug=function(){if(!je)return null;try{return je([],"length",{value:1}).length!==1}catch(r){return!0}};vo.exports=yo});var So=l((pv,bo)=>{"use strict";o();i();var $f=Me(),go=Ce(),If=Ge()(),ho=gr(),mo=w(),Ff=$f("%Math.floor%");bo.exports=function(r,t){if(typeof r!="function")throw new mo("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||Ff(t)!==t)throw new mo("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],a=!0,u=!0;if("length"in r&&ho){var f=ho(r,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(u=!1)}return(a||u||!n)&&(If?go(r,"length",t,!0,!0):go(r,"length",t)),r}});var wo=l((cv,Ao)=>{"use strict";o();i();var Tf=Me(),Lr=Tf("%Object.defineProperty%",!0)||!1;if(Lr)try{Lr({},"a",{value:1})}catch(e){Lr=!1}Ao.exports=Lr});var Hr=l((gv,zr)=>{"use strict";o();i();var We=L(),Jr=F(),Rf=So(),Nf=w(),Eo=Jr("%Function.prototype.apply%"),qo=Jr("%Function.prototype.call%"),xo=Jr("%Reflect.apply%",!0)||We.call(qo,Eo),Po=wo(),_f=Jr("%Math.max%");zr.exports=function(r){if(typeof r!="function")throw new Nf("a function is required");var t=xo(We,qo,arguments);return Rf(t,1+_f(0,r.length-(arguments.length-1)),!0)};var Oo=function(){return xo(We,Eo,arguments)};Po?Po(zr.exports,"apply",{value:Oo}):zr.exports.apply=Oo});var ke=l((mv,Io)=>{"use strict";o();i();var $o=Object.prototype.toString;Io.exports=function(r){var t=$o.call(r),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&$o.call(r.callee)==="[object Function]"),n}});var Mo=l((Av,Bo)=>{"use strict";o();i();var Do;Object.keys||(br=Object.prototype.hasOwnProperty,Le=Object.prototype.toString,Fo=ke(),ze=Object.prototype.propertyIsEnumerable,To=!ze.call({toString:null},"toString"),Ro=ze.call(function(){},"prototype"),Sr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Kr=function(e){var r=e.constructor;return r&&r.prototype===e},No={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},_o=function(){if(typeof window=="undefined")return!1;for(var e in window)try{if(!No["$"+e]&&br.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Kr(window[e])}catch(r){return!0}}catch(r){return!0}return!1}(),Uo=function(e){if(typeof window=="undefined"||!_o)return Kr(e);try{return Kr(e)}catch(r){return!1}},Do=function(r){var t=r!==null&&typeof r=="object",n=Le.call(r)==="[object Function]",a=Fo(r),u=t&&Le.call(r)==="[object String]",f=[];if(!t&&!n&&!a)throw new TypeError("Object.keys called on a non-object");var c=Ro&&n;if(u&&r.length>0&&!br.call(r,0))for(var y=0;y<r.length;++y)f.push(String(y));if(a&&r.length>0)for(var h=0;h<r.length;++h)f.push(String(h));else for(var g in r)!(c&&g==="prototype")&&br.call(r,g)&&f.push(String(g));if(To)for(var d=Uo(r),v=0;v<Sr.length;++v)!(d&&Sr[v]==="constructor")&&br.call(r,Sr[v])&&f.push(Sr[v]);return f});var br,Le,Fo,ze,To,Ro,Sr,Kr,No,_o,Uo;Bo.exports=Do});var Wo=l((Ov,Go)=>{"use strict";o();i();var Uf=Array.prototype.slice,Df=ke(),Co=Object.keys,Vr=Co?function(r){return Co(r)}:Mo(),jo=Object.keys;Vr.shim=function(){if(Object.keys){var r=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);r||(Object.keys=function(n){return Df(n)?jo(Uf.call(n)):jo(n)})}else Object.keys=Vr;return Object.keys||Vr};Go.exports=Vr});var Ar=l((xv,Jo)=>{"use strict";o();i();var Bf=Wo(),Mf=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Cf=Object.prototype.toString,jf=Array.prototype.concat,ko=Ce(),Gf=function(e){return typeof e=="function"&&Cf.call(e)==="[object Function]"},Lo=Ge()(),Wf=function(e,r,t,n){if(r in e){if(n===!0){if(e[r]===t)return}else if(!Gf(n)||!n())return}Lo?ko(e,r,t,!0):ko(e,r,t)},zo=function(e,r){var t=arguments.length>2?arguments[2]:{},n=Bf(r);Mf&&(n=jf.call(n,Object.getOwnPropertySymbols(r)));for(var a=0;a<n.length;a+=1)Wf(e,n[a],r[n[a]],t[n[a]])};zo.supportsDescriptors=!!Lo;Jo.exports=zo});var I=l((Fv,Vo)=>{"use strict";o();i();var Ho=F(),Ko=Hr(),kf=Ko(Ho("String.prototype.indexOf"));Vo.exports=function(r,t){var n=Ho(r,!!t);return typeof n=="function"&&kf(r,".prototype.")>-1?Ko(n):n}});var Xo=l((Nv,Qo)=>{"use strict";o();i();var Lf=F(),Yo=Lf("%Array%"),zf=!Yo.isArray&&I()("Object.prototype.toString");Qo.exports=Yo.isArray||function(r){return zf(r)==="[object Array]"}});var Je=l((Dv,Zo)=>{"use strict";o();i();Zo.exports=Xo()});var ei=l((Cv,ri)=>{"use strict";o();i();var Jf=F(),Hf=I(),Kf=w(),Vf=Je(),Yf=Jf("%Reflect.apply%",!0)||Hf("Function.prototype.apply");ri.exports=function(r,t){var n=arguments.length>2?arguments[2]:[];if(!Vf(n))throw new Kf("Assertion failed: optional `argumentsList`, if provided, must be a List");return Yf(r,t,n)}});function ti(){throw new Error("setTimeout has not been defined")}function ni(){throw new Error("clearTimeout has not been defined")}function oi(e){if(C===setTimeout)return setTimeout(e,0);if((C===ti||!C)&&setTimeout)return C=setTimeout,setTimeout(e,0);try{return C(e,0)}catch(r){try{return C.call(null,e,0)}catch(t){return C.call(this,e,0)}}}function Qf(e){if(j===clearTimeout)return clearTimeout(e);if((j===ni||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(e);try{return j(e)}catch(r){try{return j.call(null,e)}catch(t){return j.call(this,e)}}}function Xf(){!pr||!K||(pr=!1,K.length?U=K.concat(U):Yr=-1,U.length&&ii())}function ii(){if(!pr){var e=oi(Xf);pr=!0;for(var r=U.length;r;){for(K=U,U=[];++Yr<r;)K&&K[Yr].run();Yr=-1,r=U.length}K=null,pr=!1,Qf(e)}}function Zf(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];U.push(new ai(e,r)),U.length===1&&!pr&&oi(ii)}function ai(e,r){this.fun=e,this.array=r}function V(){}function dp(e){throw new Error("process.binding is not supported")}function hp(){return"/"}function mp(e){throw new Error("process.chdir is not supported")}function bp(){return 0}function Ap(e){var r=Sp.call(fr)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}function Pp(){var e=new Date,r=e-wp;return r/1e3}var C,j,U,pr,K,Yr,rp,ep,tp,np,op,ip,ap,up,fp,pp,sp,lp,cp,yp,vp,gp,fr,Sp,wp,Op,wr,ui=be(()=>{"use strict";o();i();C=ti,j=ni;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(j=clearTimeout);U=[],pr=!1,Yr=-1;ai.prototype.run=function(){this.fun.apply(null,this.array)};rp="browser",ep="browser",tp=!0,np={},op=[],ip="",ap={},up={},fp={};pp=V,sp=V,lp=V,cp=V,yp=V,vp=V,gp=V;fr=globalThis.performance||{},Sp=fr.now||fr.mozNow||fr.msNow||fr.oNow||fr.webkitNow||function(){return new Date().getTime()};wp=new Date;Op={nextTick:Zf,title:rp,browser:tp,env:np,argv:op,version:ip,versions:ap,on:pp,addListener:sp,once:lp,off:cp,removeListener:yp,removeAllListeners:vp,emit:gp,binding:dp,cwd:hp,chdir:mp,umask:bp,hrtime:Ap,platform:ep,release:up,config:fp,uptime:Pp},wr=Op});var He,Ke,fi=be(()=>{"use strict";o();i();typeof Object.create=="function"?He=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:He=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};Ke=He});var di={};su(di,{_extend:()=>nt,debuglog:()=>pi,default:()=>_p,deprecate:()=>Ze,format:()=>re,inherits:()=>Ke,inspect:()=>R,isArray:()=>rt,isBoolean:()=>ee,isBuffer:()=>yi,isDate:()=>Zr,isError:()=>Or,isFunction:()=>Er,isNull:()=>qr,isNullOrUndefined:()=>si,isNumber:()=>et,isObject:()=>Y,isPrimitive:()=>ci,isRegExp:()=>Pr,isString:()=>xr,isSymbol:()=>li,isUndefined:()=>T,log:()=>vi});function re(e){if(!xr(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(R(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,a=n.length,u=String(e).replace(Ep,function(c){if(c==="%%")return"%";if(t>=a)return c;switch(c){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(y){return"[Circular]"}default:return c}}),f=n[t];t<a;f=n[++t])qr(f)||!Y(f)?u+=" "+f:u+=" "+R(f);return u}function Ze(e,r){if(T(globalThis.process))return function(){return Ze(e,r).apply(this,arguments)};if(wr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(wr.throwDeprecation)throw new Error(r);wr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}function pi(e){if(T(Ve)&&(Ve=wr.env.NODE_DEBUG||""),e=e.toUpperCase(),!Qr[e])if(new RegExp("\\b"+e+"\\b","i").test(Ve)){var r=0;Qr[e]=function(){var t=re.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else Qr[e]=function(){};return Qr[e]}function R(e,r){var t={seen:[],stylize:xp};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),ee(r)?t.showHidden=r:r&&nt(t,r),T(t.showHidden)&&(t.showHidden=!1),T(t.depth)&&(t.depth=2),T(t.colors)&&(t.colors=!1),T(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=qp),Xr(t,e,t.depth)}function qp(e,r){var t=R.styles[r];return t?"\x1B["+R.colors[t][0]+"m"+e+"\x1B["+R.colors[t][1]+"m":e}function xp(e,r){return e}function $p(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Xr(e,r,t){if(e.customInspect&&r&&Er(r.inspect)&&r.inspect!==R&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return xr(n)||(n=Xr(e,n,t)),n}var a=Ip(e,r);if(a)return a;var u=Object.keys(r),f=$p(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(r)),Or(r)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return Ye(r);if(u.length===0){if(Er(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(Pr(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(Zr(r))return e.stylize(Date.prototype.toString.call(r),"date");if(Or(r))return Ye(r)}var y="",h=!1,g=["{","}"];if(rt(r)&&(h=!0,g=["[","]"]),Er(r)){var d=r.name?": "+r.name:"";y=" [Function"+d+"]"}if(Pr(r)&&(y=" "+RegExp.prototype.toString.call(r)),Zr(r)&&(y=" "+Date.prototype.toUTCString.call(r)),Or(r)&&(y=" "+Ye(r)),u.length===0&&(!h||r.length==0))return g[0]+y+g[1];if(t<0)return Pr(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var v;return h?v=Fp(e,r,t,f,u):v=u.map(function(A){return Xe(e,r,t,f,A,h)}),e.seen.pop(),Tp(v,y,g)}function Ip(e,r){if(T(r))return e.stylize("undefined","undefined");if(xr(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(et(r))return e.stylize(""+r,"number");if(ee(r))return e.stylize(""+r,"boolean");if(qr(r))return e.stylize("null","null")}function Ye(e){return"["+Error.prototype.toString.call(e)+"]"}function Fp(e,r,t,n,a){for(var u=[],f=0,c=r.length;f<c;++f)gi(r,String(f))?u.push(Xe(e,r,t,n,String(f),!0)):u.push("");return a.forEach(function(y){y.match(/^\d+$/)||u.push(Xe(e,r,t,n,y,!0))}),u}function Xe(e,r,t,n,a,u){var f,c,y;if(y=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]},y.get?y.set?c=e.stylize("[Getter/Setter]","special"):c=e.stylize("[Getter]","special"):y.set&&(c=e.stylize("[Setter]","special")),gi(n,a)||(f="["+a+"]"),c||(e.seen.indexOf(y.value)<0?(qr(t)?c=Xr(e,y.value,null):c=Xr(e,y.value,t-1),c.indexOf(`
2
2
  `)>-1&&(u?c=c.split(`
3
3
  `).map(function(h){return" "+h}).join(`
4
4
  `).substr(2):c=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/php-dynamic-snippets",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",
@@ -1 +0,0 @@
1
- import{a as o}from"./chunk-MMCQWL5J.js";import{a as p}from"./chunk-BGMLQMW7.js";import{a as t}from"./chunk-7HKG5U5F.js";import{k as r,m as n}from"./chunk-ZFTBBCKC.js";r();n();var i=class extends t{constructor({ir:e,config:a}){super(new p({ir:e,config:a}))}createSnippetGenerator(e){return new o({context:e})}};export{i as a};