@fern-api/php-dynamic-snippets 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DynamicSnippetsGenerator.cjs +18 -11
- package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
- package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
- package/cjs/{DynamicSnippetsGeneratorContext-7JXlOyjB.d.cts → DynamicSnippetsGeneratorContext-CwkDTYOI.d.cts} +3 -3
- package/cjs/EndpointSnippetGenerator.cjs +20 -13
- package/cjs/EndpointSnippetGenerator.cjs.map +1 -1
- package/cjs/EndpointSnippetGenerator.d.cts +5 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +17 -10
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
- package/cjs/context/DynamicTypeLiteralMapper.cjs +17 -10
- package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -1
- package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
- package/cjs/context/FilePropertyMapper.cjs +17 -10
- package/cjs/context/FilePropertyMapper.cjs.map +1 -1
- package/cjs/context/FilePropertyMapper.d.cts +1 -1
- package/cjs/index.cjs +20 -25
- package/cjs/index.cjs.map +1 -1
- package/cjs/index.d.cts +1 -1
- package/esm/DynamicSnippetsGenerator.d.ts +1 -1
- package/esm/DynamicSnippetsGenerator.js +1 -1
- package/esm/{DynamicSnippetsGeneratorContext-7JXlOyjB.d.ts → DynamicSnippetsGeneratorContext-CwkDTYOI.d.ts} +3 -3
- package/esm/EndpointSnippetGenerator.d.ts +5 -1
- package/esm/EndpointSnippetGenerator.js +1 -1
- package/esm/chunk-3LG5WCZI.js +2 -0
- package/esm/chunk-3LG5WCZI.js.map +1 -0
- package/esm/{chunk-KU3OGJUU.js → chunk-3QAUV5WT.js} +2 -2
- package/esm/chunk-CPIHNCS3.js +4 -0
- package/esm/chunk-CPIHNCS3.js.map +1 -0
- package/esm/chunk-DFQIKN25.js +2 -0
- package/esm/{chunk-625QSFAH.js → chunk-EECVWAVT.js} +2 -2
- package/esm/{chunk-625QSFAH.js.map → chunk-EECVWAVT.js.map} +1 -1
- package/esm/chunk-PYHFKEW4.js +47 -0
- package/esm/chunk-PYHFKEW4.js.map +1 -0
- package/esm/chunk-XX3MRTVI.js +2 -0
- package/esm/chunk-XX3MRTVI.js.map +1 -0
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
- package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
- package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
- package/esm/context/DynamicTypeLiteralMapper.js +1 -1
- package/esm/context/FilePropertyMapper.d.ts +1 -1
- package/esm/context/FilePropertyMapper.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -13
- package/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/esm/chunk-7MI6WLZG.js +0 -2
- package/esm/chunk-7MI6WLZG.js.map +0 -1
- package/esm/chunk-BYNT7UJT.js +0 -2
- package/esm/chunk-BYNT7UJT.js.map +0 -1
- package/esm/chunk-J4Y3S6QS.js +0 -40
- package/esm/chunk-J4Y3S6QS.js.map +0 -1
- package/esm/chunk-YKXTGZL6.js +0 -4
- package/esm/chunk-YKXTGZL6.js.map +0 -1
- package/esm/chunk-ZYT6M32A.js +0 -2
- /package/esm/{chunk-KU3OGJUU.js.map → chunk-3QAUV5WT.js.map} +0 -0
- /package/esm/{chunk-ZYT6M32A.js.map → chunk-DFQIKN25.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FernIr } from '@fern-api/dynamic-ir-sdk';
|
|
2
|
-
import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-
|
|
2
|
+
import { D as DynamicSnippetsGeneratorContext } from './DynamicSnippetsGeneratorContext-CwkDTYOI.cjs';
|
|
3
3
|
import '@fern-api/browser-compatible-base-generator';
|
|
4
4
|
import '@fern-api/php-codegen';
|
|
5
5
|
|
|
@@ -24,6 +24,10 @@ declare class EndpointSnippetGenerator {
|
|
|
24
24
|
private addError;
|
|
25
25
|
private addWarning;
|
|
26
26
|
private getConstructorBasicAuthArgs;
|
|
27
|
+
private getConstructorEnvironmentArg;
|
|
28
|
+
private getDefaultEnvironmentName;
|
|
29
|
+
private resolveMultiEnvironmentName;
|
|
30
|
+
private getBaseUrlPropertyName;
|
|
27
31
|
private getConstructorBaseUrlArgs;
|
|
28
32
|
private getBaseUrlArg;
|
|
29
33
|
private getConstructorBearerAuthArgs;
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
"use strict";var Ze=Object.defineProperty,Ki=Object.defineProperties,Zi=Object.getOwnPropertyDescriptor,Ji=Object.getOwnPropertyDescriptors,Xi=Object.getOwnPropertyNames,Ke=Object.getOwnPropertySymbols;var St=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable;var It=(r,t,e)=>t in r?Ze(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ce=(r,t)=>{for(var e in t||(t={}))St.call(t,e)&&It(r,e,t[e]);if(Ke)for(var e of Ke(t))Ht.call(t,e)&&It(r,e,t[e]);return r},Ne=(r,t)=>Ki(r,Ji(t));var Kt=r=>typeof r=="symbol"?r:r+"",Zt=(r,t)=>{var e={};for(var n in r)St.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&Ke)for(var n of Ke(r))t.indexOf(n)<0&&Ht.call(r,n)&&(e[n]=r[n]);return e};var _t=(r,t)=>()=>(r&&(t=r(r=0)),t);var Jt=(r,t)=>{for(var e in t)Ze(r,e,{get:t[e],enumerable:!0})},Qi=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xi(t))!St.call(r,i)&&i!==e&&Ze(r,i,{get:()=>t[i],enumerable:!(n=Zi(t,i))||n.enumerable});return r};var eo=r=>Qi(Ze({},"__esModule",{value:!0}),r);var l=(r,t,e)=>It(r,typeof t!="symbol"?t+"":t,e);function Qt(){throw new Error("setTimeout has not been defined")}function er(){throw new Error("clearTimeout has not been defined")}function tr(r){if(te===setTimeout)return setTimeout(r,0);if((te===Qt||!te)&&setTimeout)return te=setTimeout,setTimeout(r,0);try{return te(r,0)}catch(t){try{return te.call(null,r,0)}catch(e){return te.call(this,r,0)}}}function to(r){if(re===clearTimeout)return clearTimeout(r);if((re===er||!re)&&clearTimeout)return re=clearTimeout,clearTimeout(r);try{return re(r)}catch(t){try{return re.call(null,r)}catch(e){return re.call(this,r)}}}function ro(){!Se||!de||(Se=!1,de.length?z=de.concat(z):Je=-1,z.length&&rr())}function rr(){if(!Se){var r=tr(ro);Se=!0;for(var t=z.length;t;){for(de=z,z=[];++Je<t;)de&&de[Je].run();Je=-1,t=z.length}de=null,Se=!1,to(r)}}function no(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];z.push(new nr(r,t)),z.length===1&&!Se&&tr(rr)}function nr(r,t){this.fun=r,this.array=t}function he(){}function To(r){throw new Error("process.binding is not supported")}function bo(){return"/"}function Ao(r){throw new Error("process.chdir is not supported")}function Eo(){return 0}function Co(r){var t=Ro.call(Ie)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function Io(){var r=new Date,t=r-No;return t/1e3}var te,re,z,Se,de,Je,io,oo,ao,so,fo,uo,po,lo,co,mo,ho,xo,yo,go,wo,vo,Ie,Ro,No,p,Xt,o=_t(()=>{"use strict";te=Qt,re=er;typeof globalThis.setTimeout=="function"&&(te=setTimeout);typeof globalThis.clearTimeout=="function"&&(re=clearTimeout);z=[],Se=!1,Je=-1;nr.prototype.run=function(){this.fun.apply(null,this.array)};io="browser",oo="browser",ao=!0,so={},fo=[],uo="",po={},lo={},co={};mo=he,ho=he,xo=he,yo=he,go=he,wo=he,vo=he;Ie=globalThis.performance||{},Ro=Ie.now||Ie.mozNow||Ie.msNow||Ie.oNow||Ie.webkitNow||function(){return new Date().getTime()};No=new Date;p={nextTick:no,title:io,browser:ao,env:so,argv:fo,version:uo,versions:po,on:mo,addListener:ho,once:xo,off:yo,removeListener:go,removeAllListeners:wo,emit:vo,binding:To,cwd:bo,chdir:Ao,umask:Eo,hrtime:Co,platform:oo,release:lo,config:co,uptime:Io},Xt={};Object.keys(Xt).forEach(r=>{let t=r.split("."),e=p;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=Xt[r]:e=e[i]||(e[i]={})}})});function sr(){Pt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)j[t]=r[t],P[r.charCodeAt(t)]=t;P[45]=62,P[95]=63}function _o(r){Pt||sr();var t,e,n,i,s,u,c=r.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=r[c-2]==="="?2:r[c-1]==="="?1:0,u=new So(c*3/4-s),n=s>0?c-4:c;var m=0;for(t=0,e=0;t<n;t+=4,e+=3)i=P[r.charCodeAt(t)]<<18|P[r.charCodeAt(t+1)]<<12|P[r.charCodeAt(t+2)]<<6|P[r.charCodeAt(t+3)],u[m++]=i>>16&255,u[m++]=i>>8&255,u[m++]=i&255;return s===2?(i=P[r.charCodeAt(t)]<<2|P[r.charCodeAt(t+1)]>>4,u[m++]=i&255):s===1&&(i=P[r.charCodeAt(t)]<<10|P[r.charCodeAt(t+1)]<<4|P[r.charCodeAt(t+2)]>>2,u[m++]=i>>8&255,u[m++]=i&255),u}function Lo(r){return j[r>>18&63]+j[r>>12&63]+j[r>>6&63]+j[r&63]}function Po(r,t,e){for(var n,i=[],s=t;s<e;s+=3)n=(r[s]<<16)+(r[s+1]<<8)+r[s+2],i.push(Lo(n));return i.join("")}function ir(r){Pt||sr();for(var t,e=r.length,n=e%3,i="",s=[],u=16383,c=0,m=e-n;c<m;c+=u)s.push(Po(r,c,c+u>m?m:c+u));return n===1?(t=r[e-1],i+=j[t>>2],i+=j[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=j[t>>10],i+=j[t>>4&63],i+=j[t<<2&63],i+="="),s.push(i),s.join("")}function Xe(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function G(r,t){if(Xe()<t)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=f.prototype):(r===null&&(r=new f(t)),r.length=t),r}function f(r,t,e){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Ut(this,r)}return fr(this,r,t,e)}function fr(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Mo(r,t,e,n):typeof t=="string"?Oo(r,t,e):Bo(r,t)}function ur(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Uo(r,t,e,n){return ur(t),t<=0?G(r,t):e!==void 0?typeof n=="string"?G(r,t).fill(e,n):G(r,t).fill(e):G(r,t)}function Ut(r,t){if(ur(t),r=G(r,t<0?0:Ot(t)|0),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Oo(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=pr(t,e)|0;r=G(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function Lt(r,t){var e=t.length<0?0:Ot(t.length)|0;r=G(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Mo(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),f.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=f.prototype):r=Lt(r,t),r}function Bo(r,t){if($(t)){var e=Ot(t.length)|0;return r=G(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||ta(t.length)?G(r,0):Lt(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Lt(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ot(r){if(r>=Xe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Xe().toString(16)+" bytes");return r|0}function $(r){return!!(r!=null&&r._isBuffer)}function pr(r,t){if($(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Qe(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return yr(r).length;default:if(n)return Qe(r).length;t=(""+t).toLowerCase(),n=!0}}function Fo(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return qo(this,t,e);case"utf8":case"utf-8":return mr(this,t,e);case"ascii":return Go(this,t,e);case"latin1":case"binary":return Yo(this,t,e);case"base64":return Vo(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ho(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function xe(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function lr(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=f.from(t,n)),$(t))return t.length===0?-1:or(r,t,e,n,i);if(typeof t=="number")return t=t&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):or(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function or(r,t,e,n,i){var s=1,u=r.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;s=2,u/=2,c/=2,e/=2}function m(b,E){return s===1?b[E]:b.readUInt16BE(E*s)}var d;if(i){var h=-1;for(d=e;d<u;d++)if(m(r,d)===m(t,h===-1?0:d-h)){if(h===-1&&(h=d),d-h+1===c)return h*s}else h!==-1&&(d-=d-h),h=-1}else for(e+c>u&&(e=u-c),d=e;d>=0;d--){for(var x=!0,w=0;w<c;w++)if(m(r,d+w)!==m(t,w)){x=!1;break}if(x)return d}return-1}function ko(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var u=0;u<n;++u){var c=parseInt(t.substr(u*2,2),16);if(isNaN(c))return u;r[e+u]=c}return u}function Do(r,t,e,n){return rt(Qe(t,r.length-e),r,e,n)}function cr(r,t,e,n){return rt(Qo(t),r,e,n)}function jo(r,t,e,n){return cr(r,t,e,n)}function $o(r,t,e,n){return rt(yr(t),r,e,n)}function Wo(r,t,e,n){return rt(ea(t,r.length-e),r,e,n)}function Vo(r,t,e){return t===0&&e===r.length?ir(r):ir(r.slice(t,e))}function mr(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var s=r[i],u=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c<=e){var m,d,h,x;switch(c){case 1:s<128&&(u=s);break;case 2:m=r[i+1],(m&192)===128&&(x=(s&31)<<6|m&63,x>127&&(u=x));break;case 3:m=r[i+1],d=r[i+2],(m&192)===128&&(d&192)===128&&(x=(s&15)<<12|(m&63)<<6|d&63,x>2047&&(x<55296||x>57343)&&(u=x));break;case 4:m=r[i+1],d=r[i+2],h=r[i+3],(m&192)===128&&(d&192)===128&&(h&192)===128&&(x=(s&15)<<18|(m&63)<<12|(d&63)<<6|h&63,x>65535&&x<1114112&&(u=x))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=c}return zo(n)}function zo(r){var t=r.length;if(t<=ar)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=ar));return e}function Go(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function Yo(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function qo(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",s=t;s<e;++s)i+=Xo(r[s]);return i}function Ho(r,t,e){for(var n=r.slice(t,e),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}function R(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function S(r,t,e,n,i,s){if(!$(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function et(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(r.length-e,2);i<s;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function tt(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(r.length-e,4);i<s;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function dr(r,t,e,n,i,s){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function hr(r,t,e,n,i){return i||dr(r,t,e,4,34028234663852886e22,-34028234663852886e22),wr(r,t,e,n,23,4),e+4}function xr(r,t,e,n,i){return i||dr(r,t,e,8,17976931348623157e292,-17976931348623157e292),wr(r,t,e,n,52,8),e+8}function Zo(r){if(r=Jo(r).replace(Ko,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Jo(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Xo(r){return r<16?"0"+r.toString(16):r.toString(16)}function Qe(r,t){t=t||1/0;for(var e,n=r.length,i=null,s=[],u=0;u<n;++u){if(e=r.charCodeAt(u),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(u+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&s.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;s.push(e)}else if(e<2048){if((t-=2)<0)break;s.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;s.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;s.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return s}function Qo(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function ea(r,t){for(var e,n,i,s=[],u=0;u<r.length&&!((t-=2)<0);++u)e=r.charCodeAt(u),n=e>>8,i=e%256,s.push(i),s.push(n);return s}function yr(r){return _o(Zo(r))}function rt(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function ta(r){return r!==r}function ra(r){return r!=null&&(!!r._isBuffer||gr(r)||na(r))}function gr(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function na(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&gr(r.slice(0,0))}function nt(r,t,e,n,i){var s,u,c=i*8-n-1,m=(1<<c)-1,d=m>>1,h=-7,x=e?i-1:0,w=e?-1:1,b=r[t+x];for(x+=w,s=b&(1<<-h)-1,b>>=-h,h+=c;h>0;s=s*256+r[t+x],x+=w,h-=8);for(u=s&(1<<-h)-1,s>>=-h,h+=n;h>0;u=u*256+r[t+x],x+=w,h-=8);if(s===0)s=1-d;else{if(s===m)return u?NaN:(b?-1:1)*(1/0);u=u+Math.pow(2,n),s=s-d}return(b?-1:1)*u*Math.pow(2,s-n)}function wr(r,t,e,n,i,s){var u,c,m,d=s*8-i-1,h=(1<<d)-1,x=h>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:s-1,E=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,u=h):(u=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-u))<1&&(u--,m*=2),u+x>=1?t+=w/m:t+=w*Math.pow(2,1-x),t*m>=2&&(u++,m/=2),u+x>=h?(c=0,u=h):u+x>=1?(c=(t*m-1)*Math.pow(2,i),u=u+x):(c=t*Math.pow(2,x-1)*Math.pow(2,i),u=0));i>=8;r[e+b]=c&255,b+=E,c/=256,i-=8);for(u=u<<i|c,d+=i;d>0;r[e+b]=u&255,b+=E,u/=256,d-=8);r[e+b-E]|=_*128}var j,P,So,Pt,ar,Ko,vr=_t(()=>{"use strict";o();a();j=[],P=[],So=typeof Uint8Array!="undefined"?Uint8Array:Array,Pt=!1;f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;f.poolSize=8192;f._augment=function(r){return r.__proto__=f.prototype,r};f.from=function(r,t,e){return fr(null,r,t,e)};f.kMaxLength=Xe();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]);f.alloc=function(r,t,e){return Uo(null,r,t,e)};f.allocUnsafe=function(r){return Ut(null,r)};f.allocUnsafeSlow=function(r){return Ut(null,r)};f.isBuffer=ra;f.compare=function(t,e){if(!$(t)||!$(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,s=0,u=Math.min(n,i);s<u;++s)if(t[s]!==e[s]){n=t[s],i=e[s];break}return n<i?-1:i<n?1:0};f.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}};f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return f.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=f.allocUnsafe(e),s=0;for(n=0;n<t.length;++n){var u=t[n];if(!$(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,s),s+=u.length}return i};f.byteLength=pr;f.prototype._isBuffer=!0;f.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)xe(this,e,e+1);return this};f.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)xe(this,e,e+3),xe(this,e+1,e+2);return this};f.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)xe(this,e,e+7),xe(this,e+1,e+6),xe(this,e+2,e+5),xe(this,e+3,e+4);return this};f.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?mr(this,0,t):Fo.apply(this,arguments)};f.prototype.equals=function(t){if(!$(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:f.compare(this,t)===0};f.prototype.compare=function(t,e,n,i,s){if(!$(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var u=s-i,c=n-e,m=Math.min(u,c),d=this.slice(i,s),h=t.slice(e,n),x=0;x<m;++x)if(d[x]!==h[x]){u=d[x],c=h[x];break}return u<c?-1:c<u?1:0};f.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};f.prototype.indexOf=function(t,e,n){return lr(this,t,e,n,!0)};f.prototype.lastIndexOf=function(t,e,n){return lr(this,t,e,n,!1)};f.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-e;if((n===void 0||n>s)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return ko(this,t,e,n);case"utf8":case"utf-8":return Do(this,t,e,n);case"ascii":return cr(this,t,e,n);case"latin1":case"binary":return jo(this,t,e,n);case"base64":return $o(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wo(this,t,e,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};ar=4096;f.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(f.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=f.prototype;else{var s=e-t;i=new f(s,void 0);for(var u=0;u<s;++u)i[u]=this[u+t]}return i};f.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t],s=1,u=0;++u<e&&(s*=256);)i+=this[t+u]*s;return i};f.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t+--e],s=1;e>0&&(s*=256);)i+=this[t+--e]*s;return i};f.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]};f.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8};f.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]};f.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};f.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};f.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t],s=1,u=0;++u<e&&(s*=256);)i+=this[t+u]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*e)),i};f.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=e,s=1,u=this[t+--i];i>0&&(s*=256);)u+=this[t+--i]*s;return s*=128,u>=s&&(u-=Math.pow(2,8*e)),u};f.prototype.readInt8=function(t,e){return e||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};f.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};f.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};f.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};f.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};f.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),nt(this,t,!0,23,4)};f.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),nt(this,t,!1,23,4)};f.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),nt(this,t,!0,52,8)};f.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),nt(this,t,!1,52,8)};f.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var s=Math.pow(2,8*n)-1;S(this,t,e,n,s,0)}var u=1,c=0;for(this[e]=t&255;++c<n&&(u*=256);)this[e+c]=t/u&255;return e+n};f.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var s=Math.pow(2,8*n)-1;S(this,t,e,n,s,0)}var u=n-1,c=1;for(this[e+u]=t&255;--u>=0&&(c*=256);)this[e+u]=t/c&255;return e+n};f.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};f.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):et(this,t,e,!0),e+2};f.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):et(this,t,e,!1),e+2};f.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):tt(this,t,e,!0),e+4};f.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):tt(this,t,e,!1),e+4};f.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var s=Math.pow(2,8*n-1);S(this,t,e,n,s-1,-s)}var u=0,c=1,m=0;for(this[e]=t&255;++u<n&&(c*=256);)t<0&&m===0&&this[e+u-1]!==0&&(m=1),this[e+u]=(t/c>>0)-m&255;return e+n};f.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var s=Math.pow(2,8*n-1);S(this,t,e,n,s-1,-s)}var u=n-1,c=1,m=0;for(this[e+u]=t&255;--u>=0&&(c*=256);)t<0&&m===0&&this[e+u+1]!==0&&(m=1),this[e+u]=(t/c>>0)-m&255;return e+n};f.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};f.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):et(this,t,e,!0),e+2};f.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):et(this,t,e,!1),e+2};f.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):tt(this,t,e,!0),e+4};f.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||S(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):tt(this,t,e,!1),e+4};f.prototype.writeFloatLE=function(t,e,n){return hr(this,t,e,!0,n)};f.prototype.writeFloatBE=function(t,e,n){return hr(this,t,e,!1,n)};f.prototype.writeDoubleLE=function(t,e,n){return xr(this,t,e,!0,n)};f.prototype.writeDoubleBE=function(t,e,n){return xr(this,t,e,!1,n)};f.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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-n&&(i=t.length-e+n);var s=i-n,u;if(this===t&&n<e&&e<i)for(u=s-1;u>=0;--u)t[u+e]=this[u+n];else if(s<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<s;++u)t[u+e]=this[u+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s};f.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var s=t.charCodeAt(0);s<256&&(t=s)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!f.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var u;if(typeof t=="number")for(u=e;u<n;++u)this[u]=t;else{var c=$(t)?t:Qe(new f(t,i).toString()),m=c.length;for(u=0;u<n-e;++u)this[u+e]=c[u%m]}return this};Ko=/[^+\/0-9A-Za-z-_]/g});var a=_t(()=>{"use strict";vr()});var Ol={};Jt(Ol,{DynamicSnippetsGeneratorContext:()=>Yt});module.exports=eo(Ol);o();a();o();a();o();a();function A(r){throw new Error("Unexpected value: "+JSON.stringify(r))}o();a();o();a();o();a();o();a();o();a();o();a();var ia=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,it=ia;var oa=typeof self=="object"&&self&&self.Object===Object&&self,aa=it||oa||Function("return this")(),C=aa;var sa=C.Symbol,U=sa;o();a();var Tr=Object.prototype,fa=Tr.hasOwnProperty,ua=Tr.toString,ke=U?U.toStringTag:void 0;function pa(r){var t=fa.call(r,ke),e=r[ke];try{r[ke]=void 0;var n=!0}catch(s){}var i=ua.call(r);return n&&(t?r[ke]=e:delete r[ke]),i}var br=pa;o();a();var la=Object.prototype,ca=la.toString;function ma(r){return ca.call(r)}var Ar=ma;var da="[object Null]",ha="[object Undefined]",Er=U?U.toStringTag:void 0;function xa(r){return r==null?r===void 0?ha:da:Er&&Er in Object(r)?br(r):Ar(r)}var M=xa;o();a();function ya(r){return r!=null&&typeof r=="object"}var B=ya;var ga="[object Symbol]";function wa(r){return typeof r=="symbol"||B(r)&&M(r)==ga}var Rr=wa;o();a();o();a();function va(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i}var Cr=va;o();a();var Ta=Array.isArray,Y=Ta;var ba=1/0,Nr=U?U.prototype:void 0,Ir=Nr?Nr.toString:void 0;function Sr(r){if(typeof r=="string")return r;if(Y(r))return Cr(r,Sr)+"";if(Rr(r))return Ir?Ir.call(r):"";var t=r+"";return t=="0"&&1/r==-ba?"-0":t}var _r=Sr;o();a();function Aa(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var ot=Aa;o();a();o();a();o();a();o();a();var Ea="[object AsyncFunction]",Ra="[object Function]",Ca="[object GeneratorFunction]",Na="[object Proxy]";function Ia(r){if(!ot(r))return!1;var t=M(r);return t==Ra||t==Ca||t==Ea||t==Na}var at=Ia;o();a();o();a();var Sa=C["__core-js_shared__"],st=Sa;var Lr=(function(){var r=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function _a(r){return!!Lr&&Lr in r}var Pr=_a;o();a();var La=Function.prototype,Pa=La.toString;function Ua(r){if(r!=null){try{return Pa.call(r)}catch(t){}try{return r+""}catch(t){}}return""}var q=Ua;var Oa=/[\\^$.*+?()[\]{}|]/g,Ma=/^\[object .+?Constructor\]$/,Ba=Function.prototype,Fa=Object.prototype,ka=Ba.toString,Da=Fa.hasOwnProperty,ja=RegExp("^"+ka.call(Da).replace(Oa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $a(r){if(!ot(r)||Pr(r))return!1;var t=at(r)?ja:Ma;return t.test(q(r))}var Ur=$a;o();a();function Wa(r,t){return r==null?void 0:r[t]}var Or=Wa;function Va(r,t){var e=Or(r,t);return Ur(e)?e:void 0}var O=Va;var za=O(C,"WeakMap"),ft=za;o();a();function Ga(){}var Mr=Ga;o();a();o();a();o();a();function Ya(r,t,e,n){for(var i=r.length,s=e+(n?1:-1);n?s--:++s<i;)if(t(r[s],s,r))return s;return-1}var Br=Ya;o();a();function qa(r){return r!==r}var Fr=qa;o();a();function Ha(r,t,e){for(var n=e-1,i=r.length;++n<i;)if(r[n]===t)return n;return-1}var kr=Ha;function Ka(r,t,e){return t===t?kr(r,t,e):Br(r,Fr,e)}var Dr=Ka;function Za(r,t){var e=r==null?0:r.length;return!!e&&Dr(r,t,0)>-1}var jr=Za;o();a();var Ja=9007199254740991,Xa=/^(?:0|[1-9]\d*)$/;function Qa(r,t){var e=typeof r;return t=t==null?Ja:t,!!t&&(e=="number"||e!="symbol"&&Xa.test(r))&&r>-1&&r%1==0&&r<t}var $r=Qa;o();a();function es(r,t){return r===t||r!==r&&t!==t}var ut=es;o();a();o();a();var ts=9007199254740991;function rs(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ts}var pt=rs;function ns(r){return r!=null&&pt(r.length)&&!at(r)}var Wr=ns;o();a();var is=Object.prototype;function os(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||is;return r===e}var Vr=os;o();a();o();a();o();a();function as(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}var zr=as;o();a();o();a();var ss="[object Arguments]";function fs(r){return B(r)&&M(r)==ss}var Mt=fs;var Gr=Object.prototype,us=Gr.hasOwnProperty,ps=Gr.propertyIsEnumerable,ls=Mt((function(){return arguments})())?Mt:function(r){return B(r)&&us.call(r,"callee")&&!ps.call(r,"callee")},Yr=ls;o();a();o();a();function cs(){return!1}var qr=cs;var Zr=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hr=Zr&&typeof module=="object"&&module&&!module.nodeType&&module,ms=Hr&&Hr.exports===Zr,Kr=ms?C.Buffer:void 0,ds=Kr?Kr.isBuffer:void 0,hs=ds||qr,De=hs;o();a();o();a();var xs="[object Arguments]",ys="[object Array]",gs="[object Boolean]",ws="[object Date]",vs="[object Error]",Ts="[object Function]",bs="[object Map]",As="[object Number]",Es="[object Object]",Rs="[object RegExp]",Cs="[object Set]",Ns="[object String]",Is="[object WeakMap]",Ss="[object ArrayBuffer]",_s="[object DataView]",Ls="[object Float32Array]",Ps="[object Float64Array]",Us="[object Int8Array]",Os="[object Int16Array]",Ms="[object Int32Array]",Bs="[object Uint8Array]",Fs="[object Uint8ClampedArray]",ks="[object Uint16Array]",Ds="[object Uint32Array]",T={};T[Ls]=T[Ps]=T[Us]=T[Os]=T[Ms]=T[Bs]=T[Fs]=T[ks]=T[Ds]=!0;T[xs]=T[ys]=T[Ss]=T[gs]=T[_s]=T[ws]=T[vs]=T[Ts]=T[bs]=T[As]=T[Es]=T[Rs]=T[Cs]=T[Ns]=T[Is]=!1;function js(r){return B(r)&&pt(r.length)&&!!T[M(r)]}var Jr=js;o();a();function $s(r){return function(t){return r(t)}}var Xr=$s;o();a();var Qr=typeof exports=="object"&&exports&&!exports.nodeType&&exports,je=Qr&&typeof module=="object"&&module&&!module.nodeType&&module,Ws=je&&je.exports===Qr,Bt=Ws&&it.process,Vs=(function(){try{var r=je&&je.require&&je.require("util").types;return r||Bt&&Bt.binding&&Bt.binding("util")}catch(t){}})(),Ft=Vs;var en=Ft&&Ft.isTypedArray,zs=en?Xr(en):Jr,lt=zs;var Gs=Object.prototype,Ys=Gs.hasOwnProperty;function qs(r,t){var e=Y(r),n=!e&&Yr(r),i=!e&&!n&&De(r),s=!e&&!n&&!i&<(r),u=e||n||i||s,c=u?zr(r.length,String):[],m=c.length;for(var d in r)(t||Ys.call(r,d))&&!(u&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||$r(d,m)))&&c.push(d);return c}var tn=qs;o();a();o();a();o();a();function Hs(r,t){return function(e){return r(t(e))}}var rn=Hs;var Ks=rn(Object.keys,Object),nn=Ks;var Zs=Object.prototype,Js=Zs.hasOwnProperty;function Xs(r){if(!Vr(r))return nn(r);var t=[];for(var e in Object(r))Js.call(r,e)&&e!="constructor"&&t.push(e);return t}var on=Xs;function Qs(r){return Wr(r)?tn(r):on(r)}var an=Qs;o();a();o();a();o();a();o();a();o();a();var ef=O(Object,"create"),H=ef;function tf(){this.__data__=H?H(null):{},this.size=0}var sn=tf;o();a();function rf(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var fn=rf;o();a();var nf="__lodash_hash_undefined__",of=Object.prototype,af=of.hasOwnProperty;function sf(r){var t=this.__data__;if(H){var e=t[r];return e===nf?void 0:e}return af.call(t,r)?t[r]:void 0}var un=sf;o();a();var ff=Object.prototype,uf=ff.hasOwnProperty;function pf(r){var t=this.__data__;return H?t[r]!==void 0:uf.call(t,r)}var pn=pf;o();a();var lf="__lodash_hash_undefined__";function cf(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=H&&t===void 0?lf:t,this}var ln=cf;function _e(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}_e.prototype.clear=sn;_e.prototype.delete=fn;_e.prototype.get=un;_e.prototype.has=pn;_e.prototype.set=ln;var kt=_e;o();a();o();a();function mf(){this.__data__=[],this.size=0}var cn=mf;o();a();o();a();function df(r,t){for(var e=r.length;e--;)if(ut(r[e][0],t))return e;return-1}var ne=df;var hf=Array.prototype,xf=hf.splice;function yf(r){var t=this.__data__,e=ne(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():xf.call(t,e,1),--this.size,!0}var mn=yf;o();a();function gf(r){var t=this.__data__,e=ne(t,r);return e<0?void 0:t[e][1]}var dn=gf;o();a();function wf(r){return ne(this.__data__,r)>-1}var hn=wf;o();a();function vf(r,t){var e=this.__data__,n=ne(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}var xn=vf;function Le(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Le.prototype.clear=cn;Le.prototype.delete=mn;Le.prototype.get=dn;Le.prototype.has=hn;Le.prototype.set=xn;var ie=Le;o();a();var Tf=O(C,"Map"),oe=Tf;function bf(){this.size=0,this.__data__={hash:new kt,map:new(oe||ie),string:new kt}}var yn=bf;o();a();o();a();o();a();function Af(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var gn=Af;function Ef(r,t){var e=r.__data__;return gn(t)?e[typeof t=="string"?"string":"hash"]:e.map}var ae=Ef;function Rf(r){var t=ae(this,r).delete(r);return this.size-=t?1:0,t}var wn=Rf;o();a();function Cf(r){return ae(this,r).get(r)}var vn=Cf;o();a();function Nf(r){return ae(this,r).has(r)}var Tn=Nf;o();a();function If(r,t){var e=ae(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}var bn=If;function Pe(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Pe.prototype.clear=yn;Pe.prototype.delete=wn;Pe.prototype.get=vn;Pe.prototype.has=Tn;Pe.prototype.set=bn;var ct=Pe;o();a();function Sf(r){return r==null?"":_r(r)}var se=Sf;o();a();function _f(r,t){for(var e=-1,n=t.length,i=r.length;++e<n;)r[i+e]=t[e];return r}var An=_f;o();a();o();a();o();a();o();a();o();a();o();a();function Lf(r,t,e){var n=-1,i=r.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 s=Array(i);++n<i;)s[n]=r[n+t];return s}var En=Lf;function Pf(r,t,e){var n=r.length;return e=e===void 0?n:e,!t&&e>=n?r:En(r,t,e)}var Rn=Pf;o();a();var Uf="\\ud800-\\udfff",Of="\\u0300-\\u036f",Mf="\\ufe20-\\ufe2f",Bf="\\u20d0-\\u20ff",Ff=Of+Mf+Bf,kf="\\ufe0e\\ufe0f",Df="\\u200d",jf=RegExp("["+Df+Uf+Ff+kf+"]");function $f(r){return jf.test(r)}var mt=$f;o();a();o();a();function Wf(r){return r.split("")}var Cn=Wf;o();a();var Nn="\\ud800-\\udfff",Vf="\\u0300-\\u036f",zf="\\ufe20-\\ufe2f",Gf="\\u20d0-\\u20ff",Yf=Vf+zf+Gf,qf="\\ufe0e\\ufe0f",Hf="["+Nn+"]",Dt="["+Yf+"]",jt="\\ud83c[\\udffb-\\udfff]",Kf="(?:"+Dt+"|"+jt+")",In="[^"+Nn+"]",Sn="(?:\\ud83c[\\udde6-\\uddff]){2}",_n="[\\ud800-\\udbff][\\udc00-\\udfff]",Zf="\\u200d",Ln=Kf+"?",Pn="["+qf+"]?",Jf="(?:"+Zf+"(?:"+[In,Sn,_n].join("|")+")"+Pn+Ln+")*",Xf=Pn+Ln+Jf,Qf="(?:"+[In+Dt+"?",Dt,Sn,_n,Hf].join("|")+")",eu=RegExp(jt+"(?="+jt+")|"+Qf+Xf,"g");function tu(r){return r.match(eu)||[]}var Un=tu;function ru(r){return mt(r)?Un(r):Cn(r)}var On=ru;function nu(r){return function(t){t=se(t);var e=mt(t)?On(t):void 0,n=e?e[0]:t.charAt(0),i=e?Rn(e,1).join(""):t.slice(1);return n[r]()+i}}var Mn=nu;var iu=Mn("toUpperCase"),Ue=iu;function ou(r){return Ue(se(r).toLowerCase())}var Bn=ou;o();a();o();a();function au(r,t,e,n){var i=-1,s=r==null?0:r.length;for(n&&s&&(e=r[++i]);++i<s;)e=t(e,r[i],i,r);return e}var Fn=au;o();a();o();a();o();a();function su(r){return function(t){return r==null?void 0:r[t]}}var kn=su;var fu={\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"},uu=kn(fu),Dn=uu;var pu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lu="\\u0300-\\u036f",cu="\\ufe20-\\ufe2f",mu="\\u20d0-\\u20ff",du=lu+cu+mu,hu="["+du+"]",xu=RegExp(hu,"g");function yu(r){return r=se(r),r&&r.replace(pu,Dn).replace(xu,"")}var jn=yu;o();a();o();a();var gu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function wu(r){return r.match(gu)||[]}var $n=wu;o();a();var vu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Tu(r){return vu.test(r)}var Wn=Tu;o();a();var qn="\\ud800-\\udfff",bu="\\u0300-\\u036f",Au="\\ufe20-\\ufe2f",Eu="\\u20d0-\\u20ff",Ru=bu+Au+Eu,Hn="\\u2700-\\u27bf",Kn="a-z\\xdf-\\xf6\\xf8-\\xff",Cu="\\xac\\xb1\\xd7\\xf7",Nu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Iu="\\u2000-\\u206f",Su=" \\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",Zn="A-Z\\xc0-\\xd6\\xd8-\\xde",_u="\\ufe0e\\ufe0f",Jn=Cu+Nu+Iu+Su,Xn="['\u2019]",Vn="["+Jn+"]",Lu="["+Ru+"]",Qn="\\d+",Pu="["+Hn+"]",ei="["+Kn+"]",ti="[^"+qn+Jn+Qn+Hn+Kn+Zn+"]",Uu="\\ud83c[\\udffb-\\udfff]",Ou="(?:"+Lu+"|"+Uu+")",Mu="[^"+qn+"]",ri="(?:\\ud83c[\\udde6-\\uddff]){2}",ni="[\\ud800-\\udbff][\\udc00-\\udfff]",Oe="["+Zn+"]",Bu="\\u200d",zn="(?:"+ei+"|"+ti+")",Fu="(?:"+Oe+"|"+ti+")",Gn="(?:"+Xn+"(?:d|ll|m|re|s|t|ve))?",Yn="(?:"+Xn+"(?:D|LL|M|RE|S|T|VE))?",ii=Ou+"?",oi="["+_u+"]?",ku="(?:"+Bu+"(?:"+[Mu,ri,ni].join("|")+")"+oi+ii+")*",Du="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ju="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$u=oi+ii+ku,Wu="(?:"+[Pu,ri,ni].join("|")+")"+$u,Vu=RegExp([Oe+"?"+ei+"+"+Gn+"(?="+[Vn,Oe,"$"].join("|")+")",Fu+"+"+Yn+"(?="+[Vn,Oe+zn,"$"].join("|")+")",Oe+"?"+zn+"+"+Gn,Oe+"+"+Yn,ju,Du,Qn,Wu].join("|"),"g");function zu(r){return r.match(Vu)||[]}var ai=zu;function Gu(r,t,e){return r=se(r),t=e?void 0:t,t===void 0?Wn(r)?ai(r):$n(r):r.match(t)||[]}var si=Gu;var Yu="['\u2019]",qu=RegExp(Yu,"g");function Hu(r){return function(t){return Fn(si(jn(t).replace(qu,"")),r,"")}}var fi=Hu;var Ku=fi(function(r,t,e){return t=t.toLowerCase(),r+(e?Bn(t):t)}),dt=Ku;o();a();o();a();function Zu(){this.__data__=new ie,this.size=0}var ui=Zu;o();a();function Ju(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}var pi=Ju;o();a();function Xu(r){return this.__data__.get(r)}var li=Xu;o();a();function Qu(r){return this.__data__.has(r)}var ci=Qu;o();a();var ep=200;function tp(r,t){var e=this.__data__;if(e instanceof ie){var n=e.__data__;if(!oe||n.length<ep-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new ct(n)}return e.set(r,t),this.size=e.size,this}var mi=tp;function Me(r){var t=this.__data__=new ie(r);this.size=t.size}Me.prototype.clear=ui;Me.prototype.delete=pi;Me.prototype.get=li;Me.prototype.has=ci;Me.prototype.set=mi;var ht=Me;o();a();o();a();function rp(r,t){for(var e=-1,n=r==null?0:r.length,i=0,s=[];++e<n;){var u=r[e];t(u,e,r)&&(s[i++]=u)}return s}var di=rp;o();a();function np(){return[]}var hi=np;var ip=Object.prototype,op=ip.propertyIsEnumerable,xi=Object.getOwnPropertySymbols,ap=xi?function(r){return r==null?[]:(r=Object(r),di(xi(r),function(t){return op.call(r,t)}))}:hi,yi=ap;o();a();o();a();function sp(r,t,e){var n=t(r);return Y(r)?n:An(n,e(r))}var gi=sp;function fp(r){return gi(r,an,yi)}var $t=fp;o();a();o();a();var up=O(C,"DataView"),xt=up;o();a();var pp=O(C,"Promise"),yt=pp;o();a();var lp=O(C,"Set"),fe=lp;var wi="[object Map]",cp="[object Object]",vi="[object Promise]",Ti="[object Set]",bi="[object WeakMap]",Ai="[object DataView]",mp=q(xt),dp=q(oe),hp=q(yt),xp=q(fe),yp=q(ft),ye=M;(xt&&ye(new xt(new ArrayBuffer(1)))!=Ai||oe&&ye(new oe)!=wi||yt&&ye(yt.resolve())!=vi||fe&&ye(new fe)!=Ti||ft&&ye(new ft)!=bi)&&(ye=function(r){var t=M(r),e=t==cp?r.constructor:void 0,n=e?q(e):"";if(n)switch(n){case mp:return Ai;case dp:return wi;case hp:return vi;case xp:return Ti;case yp:return bi}return t});var Wt=ye;o();a();var gp=C.Uint8Array,Vt=gp;o();a();o();a();o();a();o();a();o();a();var wp="__lodash_hash_undefined__";function vp(r){return this.__data__.set(r,wp),this}var Ei=vp;o();a();function Tp(r){return this.__data__.has(r)}var Ri=Tp;function gt(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new ct;++t<e;)this.add(r[t])}gt.prototype.add=gt.prototype.push=Ei;gt.prototype.has=Ri;var wt=gt;o();a();function bp(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1}var Ci=bp;o();a();function Ap(r,t){return r.has(t)}var vt=Ap;var Ep=1,Rp=2;function Cp(r,t,e,n,i,s){var u=e&Ep,c=r.length,m=t.length;if(c!=m&&!(u&&m>c))return!1;var d=s.get(r),h=s.get(t);if(d&&h)return d==t&&h==r;var x=-1,w=!0,b=e&Rp?new wt:void 0;for(s.set(r,t),s.set(t,r);++x<c;){var E=r[x],_=t[x];if(n)var ee=u?n(_,E,x,t,r,s):n(E,_,x,r,t,s);if(ee!==void 0){if(ee)continue;w=!1;break}if(b){if(!Ci(t,function(ce,me){if(!vt(b,me)&&(E===ce||i(E,ce,e,n,s)))return b.push(me)})){w=!1;break}}else if(!(E===_||i(E,_,e,n,s))){w=!1;break}}return s.delete(r),s.delete(t),w}var Tt=Cp;o();a();o();a();function Np(r){var t=-1,e=Array(r.size);return r.forEach(function(n,i){e[++t]=[i,n]}),e}var Ni=Np;o();a();function Ip(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e}var Be=Ip;var Sp=1,_p=2,Lp="[object Boolean]",Pp="[object Date]",Up="[object Error]",Op="[object Map]",Mp="[object Number]",Bp="[object RegExp]",Fp="[object Set]",kp="[object String]",Dp="[object Symbol]",jp="[object ArrayBuffer]",$p="[object DataView]",Ii=U?U.prototype:void 0,zt=Ii?Ii.valueOf:void 0;function Wp(r,t,e,n,i,s,u){switch(e){case $p:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case jp:return!(r.byteLength!=t.byteLength||!s(new Vt(r),new Vt(t)));case Lp:case Pp:case Mp:return ut(+r,+t);case Up:return r.name==t.name&&r.message==t.message;case Bp:case kp:return r==t+"";case Op:var c=Ni;case Fp:var m=n&Sp;if(c||(c=Be),r.size!=t.size&&!m)return!1;var d=u.get(r);if(d)return d==t;n|=_p,u.set(r,t);var h=Tt(c(r),c(t),n,i,s,u);return u.delete(r),h;case Dp:if(zt)return zt.call(r)==zt.call(t)}return!1}var Si=Wp;o();a();var Vp=1,zp=Object.prototype,Gp=zp.hasOwnProperty;function Yp(r,t,e,n,i,s){var u=e&Vp,c=$t(r),m=c.length,d=$t(t),h=d.length;if(m!=h&&!u)return!1;for(var x=m;x--;){var w=c[x];if(!(u?w in t:Gp.call(t,w)))return!1}var b=s.get(r),E=s.get(t);if(b&&E)return b==t&&E==r;var _=!0;s.set(r,t),s.set(t,r);for(var ee=u;++x<m;){w=c[x];var ce=r[w],me=t[w];if(n)var qt=u?n(me,ce,w,t,r,s):n(ce,me,w,r,t,s);if(!(qt===void 0?ce===me||i(ce,me,e,n,s):qt)){_=!1;break}ee||(ee=w=="constructor")}if(_&&!ee){var qe=r.constructor,He=t.constructor;qe!=He&&"constructor"in r&&"constructor"in t&&!(typeof qe=="function"&&qe instanceof qe&&typeof He=="function"&&He instanceof He)&&(_=!1)}return s.delete(r),s.delete(t),_}var _i=Yp;var qp=1,Li="[object Arguments]",Pi="[object Array]",bt="[object Object]",Hp=Object.prototype,Ui=Hp.hasOwnProperty;function Kp(r,t,e,n,i,s){var u=Y(r),c=Y(t),m=u?Pi:Wt(r),d=c?Pi:Wt(t);m=m==Li?bt:m,d=d==Li?bt:d;var h=m==bt,x=d==bt,w=m==d;if(w&&De(r)){if(!De(t))return!1;u=!0,h=!1}if(w&&!h)return s||(s=new ht),u||lt(r)?Tt(r,t,e,n,i,s):Si(r,t,m,e,n,i,s);if(!(e&qp)){var b=h&&Ui.call(r,"__wrapped__"),E=x&&Ui.call(t,"__wrapped__");if(b||E){var _=b?r.value():r,ee=E?t.value():t;return s||(s=new ht),i(_,ee,e,n,s)}}return w?(s||(s=new ht),_i(r,t,e,n,i,s)):!1}var Oi=Kp;function Mi(r,t,e,n,i){return r===t?!0:r==null||t==null||!B(r)&&!B(t)?r!==r&&t!==t:Oi(r,t,e,n,Mi,i)}var Bi=Mi;o();a();function Zp(r,t,e){for(var n=-1,i=r==null?0:r.length;++n<i;)if(e(t,r[n]))return!0;return!1}var Fi=Zp;o();a();function Jp(r,t){return Bi(r,t)}var At=Jp;o();a();o();a();var Xp=1/0,Qp=fe&&1/Be(new fe([,-0]))[1]==Xp?function(r){return new fe(r)}:Mr,ki=Qp;var el=200;function tl(r,t,e){var n=-1,i=jr,s=r.length,u=!0,c=[],m=c;if(e)u=!1,i=Fi;else if(s>=el){var d=t?null:ki(r);if(d)return Be(d);u=!1,i=vt,m=new wt}else m=t?[]:c;e:for(;++n<s;){var h=r[n],x=t?t(h):h;if(h=e||h!==0?h:0,u&&x===x){for(var w=m.length;w--;)if(m[w]===x)continue e;t&&m.push(x),c.push(h)}else i(m,x,e)||(m!==c&&m.push(x),c.push(h))}return c}var Di=tl;o();a();function rl(r,t){return t=typeof t=="function"?t:void 0,r&&r.length?Di(r,void 0,t):[]}var Et=rl;o();a();function $e(r){return Object.keys(r)}o();a();o();a();var K=class{};o();a();o();a();var F=class extends K{constructor(e){super();l(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var nl=4,We=class{constructor(){l(this,"buffer","");l(this,"indentLevel",0);l(this,"hasWrittenAnything",!1);l(this,"lastCharacterIsSemicolon",!1);l(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
|
|
2
|
-
`),
|
|
1
|
+
"use strict";var Qe=Object.defineProperty,uo=Object.defineProperties,po=Object.getOwnPropertyDescriptor,lo=Object.getOwnPropertyDescriptors,co=Object.getOwnPropertyNames,Xe=Object.getOwnPropertySymbols;var Ot=Object.prototype.hasOwnProperty,nr=Object.prototype.propertyIsEnumerable;var kt=(r,t,e)=>t in r?Qe(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ne=(r,t)=>{for(var e in t||(t={}))Ot.call(t,e)&&kt(r,e,t[e]);if(Xe)for(var e of Xe(t))nr.call(t,e)&&kt(r,e,t[e]);return r},_e=(r,t)=>uo(r,lo(t));var ir=r=>typeof r=="symbol"?r:r+"",or=(r,t)=>{var e={};for(var n in r)Ot.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&Xe)for(var n of Xe(r))t.indexOf(n)<0&&nr.call(r,n)&&(e[n]=r[n]);return e};var Ut=(r,t)=>()=>(r&&(t=r(r=0)),t);var ar=(r,t)=>{for(var e in t)Qe(r,e,{get:t[e],enumerable:!0})},mo=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of co(t))!Ot.call(r,i)&&i!==e&&Qe(r,i,{get:()=>t[i],enumerable:!(n=po(t,i))||n.enumerable});return r};var ho=r=>mo(Qe({},"__esModule",{value:!0}),r);var l=(r,t,e)=>kt(r,typeof t!="symbol"?t+"":t,e);function fr(){throw new Error("setTimeout has not been defined")}function ur(){throw new Error("clearTimeout has not been defined")}function pr(r){if(ne===setTimeout)return setTimeout(r,0);if((ne===fr||!ne)&&setTimeout)return ne=setTimeout,setTimeout(r,0);try{return ne(r,0)}catch(t){try{return ne.call(null,r,0)}catch(e){return ne.call(this,r,0)}}}function xo(r){if(ie===clearTimeout)return clearTimeout(r);if((ie===ur||!ie)&&clearTimeout)return ie=clearTimeout,clearTimeout(r);try{return ie(r)}catch(t){try{return ie.call(null,r)}catch(e){return ie.call(this,r)}}}function yo(){!Le||!xe||(Le=!1,xe.length?Y=xe.concat(Y):et=-1,Y.length&&lr())}function lr(){if(!Le){var r=pr(yo);Le=!0;for(var t=Y.length;t;){for(xe=Y,Y=[];++et<t;)xe&&xe[et].run();et=-1,t=Y.length}xe=null,Le=!1,xo(r)}}function go(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];Y.push(new cr(r,t)),Y.length===1&&!Le&&pr(lr)}function cr(r,t){this.fun=r,this.array=t}function ye(){}function Uo(r){throw new Error("process.binding is not supported")}function Fo(){return"/"}function Bo(r){throw new Error("process.chdir is not supported")}function Mo(){return 0}function jo(r){var t=Do.call(Ie)*.001,e=Math.floor(t),n=Math.floor(t%1*1e9);return r&&(e=e-r[0],n=n-r[1],n<0&&(e--,n+=1e9)),[e,n]}function Wo(){var r=new Date,t=r-$o;return t/1e3}var ne,ie,Y,Le,xe,et,wo,vo,To,bo,Ao,Eo,Ro,Co,So,No,_o,Io,Lo,Po,ko,Oo,Ie,Do,$o,p,sr,o=Ut(()=>{"use strict";ne=fr,ie=ur;typeof globalThis.setTimeout=="function"&&(ne=setTimeout);typeof globalThis.clearTimeout=="function"&&(ie=clearTimeout);Y=[],Le=!1,et=-1;cr.prototype.run=function(){this.fun.apply(null,this.array)};wo="browser",vo="browser",To=!0,bo={},Ao=[],Eo="",Ro={},Co={},So={};No=ye,_o=ye,Io=ye,Lo=ye,Po=ye,ko=ye,Oo=ye;Ie=globalThis.performance||{},Do=Ie.now||Ie.mozNow||Ie.msNow||Ie.oNow||Ie.webkitNow||function(){return new Date().getTime()};$o=new Date;p={nextTick:go,title:wo,browser:To,env:bo,argv:Ao,version:Eo,versions:Ro,on:No,addListener:_o,once:Io,off:Lo,removeListener:Po,removeAllListeners:ko,emit:Oo,binding:Uo,cwd:Fo,chdir:Bo,umask:Mo,hrtime:jo,platform:vo,release:Co,config:So,uptime:Wo},sr={};Object.keys(sr).forEach(r=>{let t=r.split("."),e=p;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=sr[r]:e=e[i]||(e[i]={})}})});function xr(){Bt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)$[t]=r[t],P[r.charCodeAt(t)]=t;P[45]=62,P[95]=63}function zo(r){Bt||xr();var t,e,n,i,s,u,c=r.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=r[c-2]==="="?2:r[c-1]==="="?1:0,u=new Vo(c*3/4-s),n=s>0?c-4:c;var m=0;for(t=0,e=0;t<n;t+=4,e+=3)i=P[r.charCodeAt(t)]<<18|P[r.charCodeAt(t+1)]<<12|P[r.charCodeAt(t+2)]<<6|P[r.charCodeAt(t+3)],u[m++]=i>>16&255,u[m++]=i>>8&255,u[m++]=i&255;return s===2?(i=P[r.charCodeAt(t)]<<2|P[r.charCodeAt(t+1)]>>4,u[m++]=i&255):s===1&&(i=P[r.charCodeAt(t)]<<10|P[r.charCodeAt(t+1)]<<4|P[r.charCodeAt(t+2)]>>2,u[m++]=i>>8&255,u[m++]=i&255),u}function Go(r){return $[r>>18&63]+$[r>>12&63]+$[r>>6&63]+$[r&63]}function Yo(r,t,e){for(var n,i=[],s=t;s<e;s+=3)n=(r[s]<<16)+(r[s+1]<<8)+r[s+2],i.push(Go(n));return i.join("")}function mr(r){Bt||xr();for(var t,e=r.length,n=e%3,i="",s=[],u=16383,c=0,m=e-n;c<m;c+=u)s.push(Yo(r,c,c+u>m?m:c+u));return n===1?(t=r[e-1],i+=$[t>>2],i+=$[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=$[t>>10],i+=$[t>>4&63],i+=$[t<<2&63],i+="="),s.push(i),s.join("")}function tt(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function q(r,t){if(tt()<t)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=f.prototype):(r===null&&(r=new f(t)),r.length=t),r}function f(r,t,e){if(!f.TYPED_ARRAY_SUPPORT&&!(this instanceof f))return new f(r,t,e);if(typeof r=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return Mt(this,r)}return yr(this,r,t,e)}function yr(r,t,e,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?Ko(r,t,e,n):typeof t=="string"?Ho(r,t,e):Jo(r,t)}function gr(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function qo(r,t,e,n){return gr(t),t<=0?q(r,t):e!==void 0?typeof n=="string"?q(r,t).fill(e,n):q(r,t).fill(e):q(r,t)}function Mt(r,t){if(gr(t),r=q(r,t<0?0:Dt(t)|0),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Ho(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=wr(t,e)|0;r=q(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function Ft(r,t){var e=t.length<0?0:Dt(t.length)|0;r=q(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Ko(r,t,e,n){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,n),f.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=f.prototype):r=Ft(r,t),r}function Jo(r,t){if(W(t)){var e=Dt(t.length)|0;return r=q(r,e),r.length===0||t.copy(r,0,0,e),r}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||ha(t.length)?q(r,0):Ft(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ft(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Dt(r){if(r>=tt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+tt().toString(16)+" bytes");return r|0}function W(r){return!!(r!=null&&r._isBuffer)}function wr(r,t){if(W(r))return r.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;if(e===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return rt(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Cr(r).length;default:if(n)return rt(r).length;t=(""+t).toLowerCase(),n=!0}}function Zo(r,t,e){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return sa(this,t,e);case"utf8":case"utf-8":return br(this,t,e);case"ascii":return oa(this,t,e);case"latin1":case"binary":return aa(this,t,e);case"base64":return na(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fa(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function ge(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function vr(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=f.from(t,n)),W(t))return t.length===0?-1:dr(r,t,e,n,i);if(typeof t=="number")return t=t&255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):dr(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function dr(r,t,e,n,i){var s=1,u=r.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;s=2,u/=2,c/=2,e/=2}function m(v,A){return s===1?v[A]:v.readUInt16BE(A*s)}var d;if(i){var h=-1;for(d=e;d<u;d++)if(m(r,d)===m(t,h===-1?0:d-h)){if(h===-1&&(h=d),d-h+1===c)return h*s}else h!==-1&&(d-=d-h),h=-1}else for(e+c>u&&(e=u-c),d=e;d>=0;d--){for(var x=!0,g=0;g<c;g++)if(m(r,d+g)!==m(t,g)){x=!1;break}if(x)return d}return-1}function Xo(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var u=0;u<n;++u){var c=parseInt(t.substr(u*2,2),16);if(isNaN(c))return u;r[e+u]=c}return u}function Qo(r,t,e,n){return ot(rt(t,r.length-e),r,e,n)}function Tr(r,t,e,n){return ot(ma(t),r,e,n)}function ea(r,t,e,n){return Tr(r,t,e,n)}function ta(r,t,e,n){return ot(Cr(t),r,e,n)}function ra(r,t,e,n){return ot(da(t,r.length-e),r,e,n)}function na(r,t,e){return t===0&&e===r.length?mr(r):mr(r.slice(t,e))}function br(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var s=r[i],u=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c<=e){var m,d,h,x;switch(c){case 1:s<128&&(u=s);break;case 2:m=r[i+1],(m&192)===128&&(x=(s&31)<<6|m&63,x>127&&(u=x));break;case 3:m=r[i+1],d=r[i+2],(m&192)===128&&(d&192)===128&&(x=(s&15)<<12|(m&63)<<6|d&63,x>2047&&(x<55296||x>57343)&&(u=x));break;case 4:m=r[i+1],d=r[i+2],h=r[i+3],(m&192)===128&&(d&192)===128&&(h&192)===128&&(x=(s&15)<<18|(m&63)<<12|(d&63)<<6|h&63,x>65535&&x<1114112&&(u=x))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=c}return ia(n)}function ia(r){var t=r.length;if(t<=hr)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=hr));return e}function oa(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function aa(r,t,e){var n="";e=Math.min(r.length,e);for(var i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function sa(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",s=t;s<e;++s)i+=ca(r[s]);return i}function fa(r,t,e){for(var n=r.slice(t,e),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}function R(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}function I(r,t,e,n,i,s){if(!W(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function nt(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(r.length-e,2);i<s;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function it(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(r.length-e,4);i<s;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function Ar(r,t,e,n,i,s){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Er(r,t,e,n,i){return i||Ar(r,t,e,4,34028234663852886e22,-34028234663852886e22),Nr(r,t,e,n,23,4),e+4}function Rr(r,t,e,n,i){return i||Ar(r,t,e,8,17976931348623157e292,-17976931348623157e292),Nr(r,t,e,n,52,8),e+8}function pa(r){if(r=la(r).replace(ua,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function la(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function ca(r){return r<16?"0"+r.toString(16):r.toString(16)}function rt(r,t){t=t||1/0;for(var e,n=r.length,i=null,s=[],u=0;u<n;++u){if(e=r.charCodeAt(u),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(u+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&s.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;s.push(e)}else if(e<2048){if((t-=2)<0)break;s.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;s.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;s.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return s}function ma(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function da(r,t){for(var e,n,i,s=[],u=0;u<r.length&&!((t-=2)<0);++u)e=r.charCodeAt(u),n=e>>8,i=e%256,s.push(i),s.push(n);return s}function Cr(r){return zo(pa(r))}function ot(r,t,e,n){for(var i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function ha(r){return r!==r}function xa(r){return r!=null&&(!!r._isBuffer||Sr(r)||ya(r))}function Sr(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function ya(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Sr(r.slice(0,0))}function at(r,t,e,n,i){var s,u,c=i*8-n-1,m=(1<<c)-1,d=m>>1,h=-7,x=e?i-1:0,g=e?-1:1,v=r[t+x];for(x+=g,s=v&(1<<-h)-1,v>>=-h,h+=c;h>0;s=s*256+r[t+x],x+=g,h-=8);for(u=s&(1<<-h)-1,s>>=-h,h+=n;h>0;u=u*256+r[t+x],x+=g,h-=8);if(s===0)s=1-d;else{if(s===m)return u?NaN:(v?-1:1)*(1/0);u=u+Math.pow(2,n),s=s-d}return(v?-1:1)*u*Math.pow(2,s-n)}function Nr(r,t,e,n,i,s){var u,c,m,d=s*8-i-1,h=(1<<d)-1,x=h>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,A=n?1:-1,N=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,u=h):(u=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-u))<1&&(u--,m*=2),u+x>=1?t+=g/m:t+=g*Math.pow(2,1-x),t*m>=2&&(u++,m/=2),u+x>=h?(c=0,u=h):u+x>=1?(c=(t*m-1)*Math.pow(2,i),u=u+x):(c=t*Math.pow(2,x-1)*Math.pow(2,i),u=0));i>=8;r[e+v]=c&255,v+=A,c/=256,i-=8);for(u=u<<i|c,d+=i;d>0;r[e+v]=u&255,v+=A,u/=256,d-=8);r[e+v-A]|=N*128}var $,P,Vo,Bt,hr,ua,_r=Ut(()=>{"use strict";o();a();$=[],P=[],Vo=typeof Uint8Array!="undefined"?Uint8Array:Array,Bt=!1;f.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;f.poolSize=8192;f._augment=function(r){return r.__proto__=f.prototype,r};f.from=function(r,t,e){return yr(null,r,t,e)};f.kMaxLength=tt();f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]);f.alloc=function(r,t,e){return qo(null,r,t,e)};f.allocUnsafe=function(r){return Mt(null,r)};f.allocUnsafeSlow=function(r){return Mt(null,r)};f.isBuffer=xa;f.compare=function(t,e){if(!W(t)||!W(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,s=0,u=Math.min(n,i);s<u;++s)if(t[s]!==e[s]){n=t[s],i=e[s];break}return n<i?-1:i<n?1:0};f.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}};f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return f.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=f.allocUnsafe(e),s=0;for(n=0;n<t.length;++n){var u=t[n];if(!W(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,s),s+=u.length}return i};f.byteLength=wr;f.prototype._isBuffer=!0;f.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)ge(this,e,e+1);return this};f.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)ge(this,e,e+3),ge(this,e+1,e+2);return this};f.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)ge(this,e,e+7),ge(this,e+1,e+6),ge(this,e+2,e+5),ge(this,e+3,e+4);return this};f.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?br(this,0,t):Zo.apply(this,arguments)};f.prototype.equals=function(t){if(!W(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:f.compare(this,t)===0};f.prototype.compare=function(t,e,n,i,s){if(!W(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var u=s-i,c=n-e,m=Math.min(u,c),d=this.slice(i,s),h=t.slice(e,n),x=0;x<m;++x)if(d[x]!==h[x]){u=d[x],c=h[x];break}return u<c?-1:c<u?1:0};f.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};f.prototype.indexOf=function(t,e,n){return vr(this,t,e,n,!0)};f.prototype.lastIndexOf=function(t,e,n){return vr(this,t,e,n,!1)};f.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-e;if((n===void 0||n>s)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return Xo(this,t,e,n);case"utf8":case"utf-8":return Qo(this,t,e,n);case"ascii":return Tr(this,t,e,n);case"latin1":case"binary":return ea(this,t,e,n);case"base64":return ta(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ra(this,t,e,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};hr=4096;f.prototype.slice=function(t,e){var n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);var i;if(f.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=f.prototype;else{var s=e-t;i=new f(s,void 0);for(var u=0;u<s;++u)i[u]=this[u+t]}return i};f.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t],s=1,u=0;++u<e&&(s*=256);)i+=this[t+u]*s;return i};f.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t+--e],s=1;e>0&&(s*=256);)i+=this[t+--e]*s;return i};f.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]};f.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8};f.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]};f.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};f.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};f.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=this[t],s=1,u=0;++u<e&&(s*=256);)i+=this[t+u]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*e)),i};f.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||R(t,e,this.length);for(var i=e,s=1,u=this[t+--i];i>0&&(s*=256);)u+=this[t+--i]*s;return s*=128,u>=s&&(u-=Math.pow(2,8*e)),u};f.prototype.readInt8=function(t,e){return e||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};f.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};f.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};f.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};f.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};f.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),at(this,t,!0,23,4)};f.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),at(this,t,!1,23,4)};f.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),at(this,t,!0,52,8)};f.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),at(this,t,!1,52,8)};f.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var s=Math.pow(2,8*n)-1;I(this,t,e,n,s,0)}var u=1,c=0;for(this[e]=t&255;++c<n&&(u*=256);)this[e+c]=t/u&255;return e+n};f.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var s=Math.pow(2,8*n)-1;I(this,t,e,n,s,0)}var u=n-1,c=1;for(this[e+u]=t&255;--u>=0&&(c*=256);)this[e+u]=t/c&255;return e+n};f.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};f.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):nt(this,t,e,!0),e+2};f.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):nt(this,t,e,!1),e+2};f.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):it(this,t,e,!0),e+4};f.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):it(this,t,e,!1),e+4};f.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var s=Math.pow(2,8*n-1);I(this,t,e,n,s-1,-s)}var u=0,c=1,m=0;for(this[e]=t&255;++u<n&&(c*=256);)t<0&&m===0&&this[e+u-1]!==0&&(m=1),this[e+u]=(t/c>>0)-m&255;return e+n};f.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var s=Math.pow(2,8*n-1);I(this,t,e,n,s-1,-s)}var u=n-1,c=1,m=0;for(this[e+u]=t&255;--u>=0&&(c*=256);)t<0&&m===0&&this[e+u+1]!==0&&(m=1),this[e+u]=(t/c>>0)-m&255;return e+n};f.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};f.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):nt(this,t,e,!0),e+2};f.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):nt(this,t,e,!1),e+2};f.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):it(this,t,e,!0),e+4};f.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):it(this,t,e,!1),e+4};f.prototype.writeFloatLE=function(t,e,n){return Er(this,t,e,!0,n)};f.prototype.writeFloatBE=function(t,e,n){return Er(this,t,e,!1,n)};f.prototype.writeDoubleLE=function(t,e,n){return Rr(this,t,e,!0,n)};f.prototype.writeDoubleBE=function(t,e,n){return Rr(this,t,e,!1,n)};f.prototype.copy=function(t,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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-n&&(i=t.length-e+n);var s=i-n,u;if(this===t&&n<e&&e<i)for(u=s-1;u>=0;--u)t[u+e]=this[u+n];else if(s<1e3||!f.TYPED_ARRAY_SUPPORT)for(u=0;u<s;++u)t[u+e]=this[u+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s};f.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var s=t.charCodeAt(0);s<256&&(t=s)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!f.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var u;if(typeof t=="number")for(u=e;u<n;++u)this[u]=t;else{var c=W(t)?t:rt(new f(t,i).toString()),m=c.length;for(u=0;u<n-e;++u)this[u+e]=c[u%m]}return this};ua=/[^+\/0-9A-Za-z-_]/g});var a=Ut(()=>{"use strict";_r()});var Jl={};ar(Jl,{DynamicSnippetsGeneratorContext:()=>tr});module.exports=ho(Jl);o();a();o();a();o();a();function E(r){throw new Error("Unexpected value: "+JSON.stringify(r))}o();a();o();a();o();a();o();a();o();a();o();a();var ga=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,st=ga;var wa=typeof self=="object"&&self&&self.Object===Object&&self,va=st||wa||Function("return this")(),C=va;var Ta=C.Symbol,k=Ta;o();a();var Ir=Object.prototype,ba=Ir.hasOwnProperty,Aa=Ir.toString,je=k?k.toStringTag:void 0;function Ea(r){var t=ba.call(r,je),e=r[je];try{r[je]=void 0;var n=!0}catch(s){}var i=Aa.call(r);return n&&(t?r[je]=e:delete r[je]),i}var Lr=Ea;o();a();var Ra=Object.prototype,Ca=Ra.toString;function Sa(r){return Ca.call(r)}var Pr=Sa;var Na="[object Null]",_a="[object Undefined]",kr=k?k.toStringTag:void 0;function Ia(r){return r==null?r===void 0?_a:Na:kr&&kr in Object(r)?Lr(r):Pr(r)}var U=Ia;o();a();function La(r){return r!=null&&typeof r=="object"}var F=La;var Pa="[object Symbol]";function ka(r){return typeof r=="symbol"||F(r)&&U(r)==Pa}var Or=ka;o();a();o();a();function Oa(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i}var Ur=Oa;o();a();var Ua=Array.isArray,H=Ua;var Fa=1/0,Fr=k?k.prototype:void 0,Br=Fr?Fr.toString:void 0;function Mr(r){if(typeof r=="string")return r;if(H(r))return Ur(r,Mr)+"";if(Or(r))return Br?Br.call(r):"";var t=r+"";return t=="0"&&1/r==-Fa?"-0":t}var Dr=Mr;o();a();function Ba(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var ft=Ba;o();a();o();a();o();a();o();a();var Ma="[object AsyncFunction]",Da="[object Function]",ja="[object GeneratorFunction]",$a="[object Proxy]";function Wa(r){if(!ft(r))return!1;var t=U(r);return t==Da||t==ja||t==Ma||t==$a}var ut=Wa;o();a();o();a();var Va=C["__core-js_shared__"],pt=Va;var jr=(function(){var r=/[^.]+$/.exec(pt&&pt.keys&&pt.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function za(r){return!!jr&&jr in r}var $r=za;o();a();var Ga=Function.prototype,Ya=Ga.toString;function qa(r){if(r!=null){try{return Ya.call(r)}catch(t){}try{return r+""}catch(t){}}return""}var K=qa;var Ha=/[\\^$.*+?()[\]{}|]/g,Ka=/^\[object .+?Constructor\]$/,Ja=Function.prototype,Za=Object.prototype,Xa=Ja.toString,Qa=Za.hasOwnProperty,es=RegExp("^"+Xa.call(Qa).replace(Ha,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ts(r){if(!ft(r)||$r(r))return!1;var t=ut(r)?es:Ka;return t.test(K(r))}var Wr=ts;o();a();function rs(r,t){return r==null?void 0:r[t]}var Vr=rs;function ns(r,t){var e=Vr(r,t);return Wr(e)?e:void 0}var O=ns;var is=O(C,"WeakMap"),lt=is;o();a();function os(){}var zr=os;o();a();o();a();o();a();function as(r,t,e,n){for(var i=r.length,s=e+(n?1:-1);n?s--:++s<i;)if(t(r[s],s,r))return s;return-1}var Gr=as;o();a();function ss(r){return r!==r}var Yr=ss;o();a();function fs(r,t,e){for(var n=e-1,i=r.length;++n<i;)if(r[n]===t)return n;return-1}var qr=fs;function us(r,t,e){return t===t?qr(r,t,e):Gr(r,Yr,e)}var Hr=us;function ps(r,t){var e=r==null?0:r.length;return!!e&&Hr(r,t,0)>-1}var Kr=ps;o();a();var ls=9007199254740991,cs=/^(?:0|[1-9]\d*)$/;function ms(r,t){var e=typeof r;return t=t==null?ls:t,!!t&&(e=="number"||e!="symbol"&&cs.test(r))&&r>-1&&r%1==0&&r<t}var Jr=ms;o();a();function ds(r,t){return r===t||r!==r&&t!==t}var ct=ds;o();a();o();a();var hs=9007199254740991;function xs(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=hs}var mt=xs;function ys(r){return r!=null&&mt(r.length)&&!ut(r)}var Zr=ys;o();a();var gs=Object.prototype;function ws(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||gs;return r===e}var Xr=ws;o();a();o();a();o();a();function vs(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}var Qr=vs;o();a();o();a();var Ts="[object Arguments]";function bs(r){return F(r)&&U(r)==Ts}var jt=bs;var en=Object.prototype,As=en.hasOwnProperty,Es=en.propertyIsEnumerable,Rs=jt((function(){return arguments})())?jt:function(r){return F(r)&&As.call(r,"callee")&&!Es.call(r,"callee")},tn=Rs;o();a();o();a();function Cs(){return!1}var rn=Cs;var an=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nn=an&&typeof module=="object"&&module&&!module.nodeType&&module,Ss=nn&&nn.exports===an,on=Ss?C.Buffer:void 0,Ns=on?on.isBuffer:void 0,_s=Ns||rn,$e=_s;o();a();o();a();var Is="[object Arguments]",Ls="[object Array]",Ps="[object Boolean]",ks="[object Date]",Os="[object Error]",Us="[object Function]",Fs="[object Map]",Bs="[object Number]",Ms="[object Object]",Ds="[object RegExp]",js="[object Set]",$s="[object String]",Ws="[object WeakMap]",Vs="[object ArrayBuffer]",zs="[object DataView]",Gs="[object Float32Array]",Ys="[object Float64Array]",qs="[object Int8Array]",Hs="[object Int16Array]",Ks="[object Int32Array]",Js="[object Uint8Array]",Zs="[object Uint8ClampedArray]",Xs="[object Uint16Array]",Qs="[object Uint32Array]",b={};b[Gs]=b[Ys]=b[qs]=b[Hs]=b[Ks]=b[Js]=b[Zs]=b[Xs]=b[Qs]=!0;b[Is]=b[Ls]=b[Vs]=b[Ps]=b[zs]=b[ks]=b[Os]=b[Us]=b[Fs]=b[Bs]=b[Ms]=b[Ds]=b[js]=b[$s]=b[Ws]=!1;function ef(r){return F(r)&&mt(r.length)&&!!b[U(r)]}var sn=ef;o();a();function tf(r){return function(t){return r(t)}}var fn=tf;o();a();var un=typeof exports=="object"&&exports&&!exports.nodeType&&exports,We=un&&typeof module=="object"&&module&&!module.nodeType&&module,rf=We&&We.exports===un,$t=rf&&st.process,nf=(function(){try{var r=We&&We.require&&We.require("util").types;return r||$t&&$t.binding&&$t.binding("util")}catch(t){}})(),Wt=nf;var pn=Wt&&Wt.isTypedArray,of=pn?fn(pn):sn,dt=of;var af=Object.prototype,sf=af.hasOwnProperty;function ff(r,t){var e=H(r),n=!e&&tn(r),i=!e&&!n&&$e(r),s=!e&&!n&&!i&&dt(r),u=e||n||i||s,c=u?Qr(r.length,String):[],m=c.length;for(var d in r)(t||sf.call(r,d))&&!(u&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Jr(d,m)))&&c.push(d);return c}var ln=ff;o();a();o();a();o();a();function uf(r,t){return function(e){return r(t(e))}}var cn=uf;var pf=cn(Object.keys,Object),mn=pf;var lf=Object.prototype,cf=lf.hasOwnProperty;function mf(r){if(!Xr(r))return mn(r);var t=[];for(var e in Object(r))cf.call(r,e)&&e!="constructor"&&t.push(e);return t}var dn=mf;function df(r){return Zr(r)?ln(r):dn(r)}var hn=df;o();a();o();a();o();a();o();a();o();a();var hf=O(Object,"create"),J=hf;function xf(){this.__data__=J?J(null):{},this.size=0}var xn=xf;o();a();function yf(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var yn=yf;o();a();var gf="__lodash_hash_undefined__",wf=Object.prototype,vf=wf.hasOwnProperty;function Tf(r){var t=this.__data__;if(J){var e=t[r];return e===gf?void 0:e}return vf.call(t,r)?t[r]:void 0}var gn=Tf;o();a();var bf=Object.prototype,Af=bf.hasOwnProperty;function Ef(r){var t=this.__data__;return J?t[r]!==void 0:Af.call(t,r)}var wn=Ef;o();a();var Rf="__lodash_hash_undefined__";function Cf(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=J&&t===void 0?Rf:t,this}var vn=Cf;function Pe(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Pe.prototype.clear=xn;Pe.prototype.delete=yn;Pe.prototype.get=gn;Pe.prototype.has=wn;Pe.prototype.set=vn;var Vt=Pe;o();a();o();a();function Sf(){this.__data__=[],this.size=0}var Tn=Sf;o();a();o();a();function Nf(r,t){for(var e=r.length;e--;)if(ct(r[e][0],t))return e;return-1}var oe=Nf;var _f=Array.prototype,If=_f.splice;function Lf(r){var t=this.__data__,e=oe(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():If.call(t,e,1),--this.size,!0}var bn=Lf;o();a();function Pf(r){var t=this.__data__,e=oe(t,r);return e<0?void 0:t[e][1]}var An=Pf;o();a();function kf(r){return oe(this.__data__,r)>-1}var En=kf;o();a();function Of(r,t){var e=this.__data__,n=oe(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}var Rn=Of;function ke(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ke.prototype.clear=Tn;ke.prototype.delete=bn;ke.prototype.get=An;ke.prototype.has=En;ke.prototype.set=Rn;var ae=ke;o();a();var Uf=O(C,"Map"),se=Uf;function Ff(){this.size=0,this.__data__={hash:new Vt,map:new(se||ae),string:new Vt}}var Cn=Ff;o();a();o();a();o();a();function Bf(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var Sn=Bf;function Mf(r,t){var e=r.__data__;return Sn(t)?e[typeof t=="string"?"string":"hash"]:e.map}var fe=Mf;function Df(r){var t=fe(this,r).delete(r);return this.size-=t?1:0,t}var Nn=Df;o();a();function jf(r){return fe(this,r).get(r)}var _n=jf;o();a();function $f(r){return fe(this,r).has(r)}var In=$f;o();a();function Wf(r,t){var e=fe(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}var Ln=Wf;function Oe(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}Oe.prototype.clear=Cn;Oe.prototype.delete=Nn;Oe.prototype.get=_n;Oe.prototype.has=In;Oe.prototype.set=Ln;var ht=Oe;o();a();function Vf(r){return r==null?"":Dr(r)}var ue=Vf;o();a();function zf(r,t){for(var e=-1,n=t.length,i=r.length;++e<n;)r[i+e]=t[e];return r}var Pn=zf;o();a();o();a();o();a();o();a();o();a();o();a();function Gf(r,t,e){var n=-1,i=r.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 s=Array(i);++n<i;)s[n]=r[n+t];return s}var kn=Gf;function Yf(r,t,e){var n=r.length;return e=e===void 0?n:e,!t&&e>=n?r:kn(r,t,e)}var On=Yf;o();a();var qf="\\ud800-\\udfff",Hf="\\u0300-\\u036f",Kf="\\ufe20-\\ufe2f",Jf="\\u20d0-\\u20ff",Zf=Hf+Kf+Jf,Xf="\\ufe0e\\ufe0f",Qf="\\u200d",eu=RegExp("["+Qf+qf+Zf+Xf+"]");function tu(r){return eu.test(r)}var xt=tu;o();a();o();a();function ru(r){return r.split("")}var Un=ru;o();a();var Fn="\\ud800-\\udfff",nu="\\u0300-\\u036f",iu="\\ufe20-\\ufe2f",ou="\\u20d0-\\u20ff",au=nu+iu+ou,su="\\ufe0e\\ufe0f",fu="["+Fn+"]",zt="["+au+"]",Gt="\\ud83c[\\udffb-\\udfff]",uu="(?:"+zt+"|"+Gt+")",Bn="[^"+Fn+"]",Mn="(?:\\ud83c[\\udde6-\\uddff]){2}",Dn="[\\ud800-\\udbff][\\udc00-\\udfff]",pu="\\u200d",jn=uu+"?",$n="["+su+"]?",lu="(?:"+pu+"(?:"+[Bn,Mn,Dn].join("|")+")"+$n+jn+")*",cu=$n+jn+lu,mu="(?:"+[Bn+zt+"?",zt,Mn,Dn,fu].join("|")+")",du=RegExp(Gt+"(?="+Gt+")|"+mu+cu,"g");function hu(r){return r.match(du)||[]}var Wn=hu;function xu(r){return xt(r)?Wn(r):Un(r)}var Vn=xu;function yu(r){return function(t){t=ue(t);var e=xt(t)?Vn(t):void 0,n=e?e[0]:t.charAt(0),i=e?On(e,1).join(""):t.slice(1);return n[r]()+i}}var zn=yu;var gu=zn("toUpperCase"),Ue=gu;function wu(r){return Ue(ue(r).toLowerCase())}var Gn=wu;o();a();o();a();function vu(r,t,e,n){var i=-1,s=r==null?0:r.length;for(n&&s&&(e=r[++i]);++i<s;)e=t(e,r[i],i,r);return e}var Yn=vu;o();a();o();a();o();a();function Tu(r){return function(t){return r==null?void 0:r[t]}}var qn=Tu;var bu={\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"},Au=qn(bu),Hn=Au;var Eu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ru="\\u0300-\\u036f",Cu="\\ufe20-\\ufe2f",Su="\\u20d0-\\u20ff",Nu=Ru+Cu+Su,_u="["+Nu+"]",Iu=RegExp(_u,"g");function Lu(r){return r=ue(r),r&&r.replace(Eu,Hn).replace(Iu,"")}var Kn=Lu;o();a();o();a();var Pu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ku(r){return r.match(Pu)||[]}var Jn=ku;o();a();var Ou=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Uu(r){return Ou.test(r)}var Zn=Uu;o();a();var ri="\\ud800-\\udfff",Fu="\\u0300-\\u036f",Bu="\\ufe20-\\ufe2f",Mu="\\u20d0-\\u20ff",Du=Fu+Bu+Mu,ni="\\u2700-\\u27bf",ii="a-z\\xdf-\\xf6\\xf8-\\xff",ju="\\xac\\xb1\\xd7\\xf7",$u="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wu="\\u2000-\\u206f",Vu=" \\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",oi="A-Z\\xc0-\\xd6\\xd8-\\xde",zu="\\ufe0e\\ufe0f",ai=ju+$u+Wu+Vu,si="['\u2019]",Xn="["+ai+"]",Gu="["+Du+"]",fi="\\d+",Yu="["+ni+"]",ui="["+ii+"]",pi="[^"+ri+ai+fi+ni+ii+oi+"]",qu="\\ud83c[\\udffb-\\udfff]",Hu="(?:"+Gu+"|"+qu+")",Ku="[^"+ri+"]",li="(?:\\ud83c[\\udde6-\\uddff]){2}",ci="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+oi+"]",Ju="\\u200d",Qn="(?:"+ui+"|"+pi+")",Zu="(?:"+Fe+"|"+pi+")",ei="(?:"+si+"(?:d|ll|m|re|s|t|ve))?",ti="(?:"+si+"(?:D|LL|M|RE|S|T|VE))?",mi=Hu+"?",di="["+zu+"]?",Xu="(?:"+Ju+"(?:"+[Ku,li,ci].join("|")+")"+di+mi+")*",Qu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ep="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tp=di+mi+Xu,rp="(?:"+[Yu,li,ci].join("|")+")"+tp,np=RegExp([Fe+"?"+ui+"+"+ei+"(?="+[Xn,Fe,"$"].join("|")+")",Zu+"+"+ti+"(?="+[Xn,Fe+Qn,"$"].join("|")+")",Fe+"?"+Qn+"+"+ei,Fe+"+"+ti,ep,Qu,fi,rp].join("|"),"g");function ip(r){return r.match(np)||[]}var hi=ip;function op(r,t,e){return r=ue(r),t=e?void 0:t,t===void 0?Zn(r)?hi(r):Jn(r):r.match(t)||[]}var xi=op;var ap="['\u2019]",sp=RegExp(ap,"g");function fp(r){return function(t){return Yn(xi(Kn(t).replace(sp,"")),r,"")}}var yi=fp;var up=yi(function(r,t,e){return t=t.toLowerCase(),r+(e?Gn(t):t)}),yt=up;o();a();o();a();function pp(){this.__data__=new ae,this.size=0}var gi=pp;o();a();function lp(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}var wi=lp;o();a();function cp(r){return this.__data__.get(r)}var vi=cp;o();a();function mp(r){return this.__data__.has(r)}var Ti=mp;o();a();var dp=200;function hp(r,t){var e=this.__data__;if(e instanceof ae){var n=e.__data__;if(!se||n.length<dp-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new ht(n)}return e.set(r,t),this.size=e.size,this}var bi=hp;function Be(r){var t=this.__data__=new ae(r);this.size=t.size}Be.prototype.clear=gi;Be.prototype.delete=wi;Be.prototype.get=vi;Be.prototype.has=Ti;Be.prototype.set=bi;var gt=Be;o();a();o();a();function xp(r,t){for(var e=-1,n=r==null?0:r.length,i=0,s=[];++e<n;){var u=r[e];t(u,e,r)&&(s[i++]=u)}return s}var Ai=xp;o();a();function yp(){return[]}var Ei=yp;var gp=Object.prototype,wp=gp.propertyIsEnumerable,Ri=Object.getOwnPropertySymbols,vp=Ri?function(r){return r==null?[]:(r=Object(r),Ai(Ri(r),function(t){return wp.call(r,t)}))}:Ei,Ci=vp;o();a();o();a();function Tp(r,t,e){var n=t(r);return H(r)?n:Pn(n,e(r))}var Si=Tp;function bp(r){return Si(r,hn,Ci)}var Yt=bp;o();a();o();a();var Ap=O(C,"DataView"),wt=Ap;o();a();var Ep=O(C,"Promise"),vt=Ep;o();a();var Rp=O(C,"Set"),pe=Rp;var Ni="[object Map]",Cp="[object Object]",_i="[object Promise]",Ii="[object Set]",Li="[object WeakMap]",Pi="[object DataView]",Sp=K(wt),Np=K(se),_p=K(vt),Ip=K(pe),Lp=K(lt),we=U;(wt&&we(new wt(new ArrayBuffer(1)))!=Pi||se&&we(new se)!=Ni||vt&&we(vt.resolve())!=_i||pe&&we(new pe)!=Ii||lt&&we(new lt)!=Li)&&(we=function(r){var t=U(r),e=t==Cp?r.constructor:void 0,n=e?K(e):"";if(n)switch(n){case Sp:return Pi;case Np:return Ni;case _p:return _i;case Ip:return Ii;case Lp:return Li}return t});var qt=we;o();a();var Pp=C.Uint8Array,Ht=Pp;o();a();o();a();o();a();o();a();o();a();var kp="__lodash_hash_undefined__";function Op(r){return this.__data__.set(r,kp),this}var ki=Op;o();a();function Up(r){return this.__data__.has(r)}var Oi=Up;function Tt(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new ht;++t<e;)this.add(r[t])}Tt.prototype.add=Tt.prototype.push=ki;Tt.prototype.has=Oi;var bt=Tt;o();a();function Fp(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1}var Ui=Fp;o();a();function Bp(r,t){return r.has(t)}var At=Bp;var Mp=1,Dp=2;function jp(r,t,e,n,i,s){var u=e&Mp,c=r.length,m=t.length;if(c!=m&&!(u&&m>c))return!1;var d=s.get(r),h=s.get(t);if(d&&h)return d==t&&h==r;var x=-1,g=!0,v=e&Dp?new bt:void 0;for(s.set(r,t),s.set(t,r);++x<c;){var A=r[x],N=t[x];if(n)var j=u?n(N,A,x,t,r,s):n(A,N,x,r,t,s);if(j!==void 0){if(j)continue;g=!1;break}if(v){if(!Ui(t,function(de,he){if(!At(v,he)&&(A===de||i(A,de,e,n,s)))return v.push(he)})){g=!1;break}}else if(!(A===N||i(A,N,e,n,s))){g=!1;break}}return s.delete(r),s.delete(t),g}var Et=jp;o();a();o();a();function $p(r){var t=-1,e=Array(r.size);return r.forEach(function(n,i){e[++t]=[i,n]}),e}var Fi=$p;o();a();function Wp(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e}var Me=Wp;var Vp=1,zp=2,Gp="[object Boolean]",Yp="[object Date]",qp="[object Error]",Hp="[object Map]",Kp="[object Number]",Jp="[object RegExp]",Zp="[object Set]",Xp="[object String]",Qp="[object Symbol]",el="[object ArrayBuffer]",tl="[object DataView]",Bi=k?k.prototype:void 0,Kt=Bi?Bi.valueOf:void 0;function rl(r,t,e,n,i,s,u){switch(e){case tl:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case el:return!(r.byteLength!=t.byteLength||!s(new Ht(r),new Ht(t)));case Gp:case Yp:case Kp:return ct(+r,+t);case qp:return r.name==t.name&&r.message==t.message;case Jp:case Xp:return r==t+"";case Hp:var c=Fi;case Zp:var m=n&Vp;if(c||(c=Me),r.size!=t.size&&!m)return!1;var d=u.get(r);if(d)return d==t;n|=zp,u.set(r,t);var h=Et(c(r),c(t),n,i,s,u);return u.delete(r),h;case Qp:if(Kt)return Kt.call(r)==Kt.call(t)}return!1}var Mi=rl;o();a();var nl=1,il=Object.prototype,ol=il.hasOwnProperty;function al(r,t,e,n,i,s){var u=e&nl,c=Yt(r),m=c.length,d=Yt(t),h=d.length;if(m!=h&&!u)return!1;for(var x=m;x--;){var g=c[x];if(!(u?g in t:ol.call(t,g)))return!1}var v=s.get(r),A=s.get(t);if(v&&A)return v==t&&A==r;var N=!0;s.set(r,t),s.set(t,r);for(var j=u;++x<m;){g=c[x];var de=r[g],he=t[g];if(n)var rr=u?n(he,de,g,t,r,s):n(de,he,g,r,t,s);if(!(rr===void 0?de===he||i(de,he,e,n,s):rr)){N=!1;break}j||(j=g=="constructor")}if(N&&!j){var Je=r.constructor,Ze=t.constructor;Je!=Ze&&"constructor"in r&&"constructor"in t&&!(typeof Je=="function"&&Je instanceof Je&&typeof Ze=="function"&&Ze instanceof Ze)&&(N=!1)}return s.delete(r),s.delete(t),N}var Di=al;var sl=1,ji="[object Arguments]",$i="[object Array]",Rt="[object Object]",fl=Object.prototype,Wi=fl.hasOwnProperty;function ul(r,t,e,n,i,s){var u=H(r),c=H(t),m=u?$i:qt(r),d=c?$i:qt(t);m=m==ji?Rt:m,d=d==ji?Rt:d;var h=m==Rt,x=d==Rt,g=m==d;if(g&&$e(r)){if(!$e(t))return!1;u=!0,h=!1}if(g&&!h)return s||(s=new gt),u||dt(r)?Et(r,t,e,n,i,s):Mi(r,t,m,e,n,i,s);if(!(e&sl)){var v=h&&Wi.call(r,"__wrapped__"),A=x&&Wi.call(t,"__wrapped__");if(v||A){var N=v?r.value():r,j=A?t.value():t;return s||(s=new gt),i(N,j,e,n,s)}}return g?(s||(s=new gt),Di(r,t,e,n,i,s)):!1}var Vi=ul;function zi(r,t,e,n,i){return r===t?!0:r==null||t==null||!F(r)&&!F(t)?r!==r&&t!==t:Vi(r,t,e,n,zi,i)}var Gi=zi;o();a();function pl(r,t,e){for(var n=-1,i=r==null?0:r.length;++n<i;)if(e(t,r[n]))return!0;return!1}var Yi=pl;o();a();function ll(r,t){return Gi(r,t)}var Ct=ll;o();a();o();a();var cl=1/0,ml=pe&&1/Me(new pe([,-0]))[1]==cl?function(r){return new pe(r)}:zr,qi=ml;var dl=200;function hl(r,t,e){var n=-1,i=Kr,s=r.length,u=!0,c=[],m=c;if(e)u=!1,i=Yi;else if(s>=dl){var d=t?null:qi(r);if(d)return Me(d);u=!1,i=At,m=new bt}else m=t?[]:c;e:for(;++n<s;){var h=r[n],x=t?t(h):h;if(h=e||h!==0?h:0,u&&x===x){for(var g=m.length;g--;)if(m[g]===x)continue e;t&&m.push(x),c.push(h)}else i(m,x,e)||(m!==c&&m.push(x),c.push(h))}return c}var Hi=hl;o();a();function xl(r,t){return t=typeof t=="function"?t:void 0,r&&r.length?Hi(r,void 0,t):[]}var St=xl;o();a();function Ve(r){return Object.keys(r)}o();a();o();a();o();a();var Ki,Ji,ze=(Ji=(Ki=p.env.FERN_STACK_TRACK)==null?void 0:Ki.toLowerCase())!=null?Ji:"",V=ze!==""&&ze!=="0"&&ze!=="false",Jt=["single","multiline","box"].includes(ze)?ze:"single";V&&(Error.stackTraceLimit=50);var yl=new Set(["SdkGeneratorCLI","runCli","LoggerImpl","Array.forEach"]),gl=new Set(["stacktrace"]);function _t({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:s=!0,filterJs:u=!0,formatFilename:c=m=>m}={}){var d;if(!V)return[];n=[...n,...yl],e=[...e,...gl],i=[...i,"runInteractiveTask"];let m=!1;return((d=new Error().stack)!=null?d:"").split(`
|
|
2
|
+
`).map(h=>{let x=h.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(x&&x.length===5){let[,g,v,A,N]=x;if(!g||!v||!A||!N)return;if(m||i.some(j=>g==null?void 0:g.includes(j))){m=!0;return}switch(g){case"Object.<anonymous>":g="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":g=`${g.substring(g.indexOf(".")+1)}()=> { ... }`;break}return{fn:g,path:c(v),position:`${A}:${N}`}}}).filter(h=>{var x,g;return h&&!n.some(v=>h.fn.includes(v))&&!(s&&((x=h.path)!=null&&x.startsWith("node:")))&&!(u&&((g=h.path)!=null&&g.endsWith(".js")))&&!e.some(v=>h.path.includes(v))}).slice(t,t+r)}var Nt=class{constructor({maxFrames:t=50,skip:e=0,filterPaths:n=[],filterFunctions:i=[],stopOn:s=[],filterNode:u=!0,filterJs:c=!0,multiline:m=!1,formatFilename:d=h=>h}={}){l(this,"maxFrames");l(this,"skip");l(this,"filterPaths");l(this,"filterFunctions");l(this,"stopOn");l(this,"filterNode");l(this,"filterJs");l(this,"multiline");l(this,"formatFilename");l(this,"tracking",new WeakMap);this.maxFrames=t,this.skip=e,this.filterPaths=n,this.filterFunctions=i,this.stopOn=s,this.filterNode=u,this.filterJs=c,this.multiline=m,this.formatFilename=d}tag(t){let e=this.tracking.get(t)||new Set;_t({maxFrames:this.maxFrames,skip:this.skip,filterPaths:this.filterPaths,filterFunctions:this.filterFunctions,stopOn:this.stopOn,filterNode:this.filterNode,filterJs:this.filterJs,formatFilename:this.formatFilename}).forEach(n=>e.add(n)),this.tracking.set(t,e)}trace(t){if(!V)return"";let e=this.tracking.get(t);return e?[...e].map(n=>`${this.multiline?`
|
|
3
|
+
`:""}${n.fn} - ${n.path}:${n.position}`).join(""):""}frames(t){let e=this.tracking.get(t);return e?[...e]:[]}free(t){this.tracking.delete(t)}clear(){this.tracking=new WeakMap}},Z;function Zi({maxFrames:r=50,skip:t=0,filterPaths:e=[],filterFunctions:n=[],stopOn:i=[],filterNode:s=!0,filterJs:u=!0,multiline:c=!1,formatFilename:m=d=>d}={}){V&&(Z!=null||(Z=new Nt({maxFrames:r,skip:t,filterPaths:e,filterFunctions:n,stopOn:i,filterNode:s,filterJs:u,multiline:c,formatFilename:m})))}function Xi(r){Z==null||Z.tag(r)}function Zt(r){var t;return(t=Z==null?void 0:Z.frames(r))!=null?t:[]}var X=class{constructor(){Xi(this)}};o();a();o();a();o();a();var B=class extends X{constructor(e){super();l(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):typeof this.value=="function"?this.value(e):this.value.write(e)}};var wl=4;Zi({skip:0,maxFrames:15,filterFunctions:["Abstract"]});var Ge=class{constructor(){l(this,"lineBuffer",[]);l(this,"indentLevel",0);l(this,"hasWrittenAnything",!1);l(this,"lastCharacterIsSemicolon",!1);l(this,"lastCharacterIsNewline",!1);l(this,"nodeStackFrames",[])}get buffer(){return V&&this.nodeStackFrames.length>0&&this.writeInternal(`
|
|
4
|
+
`),this.lineBuffer.join(`
|
|
5
|
+
`)+(this.lastCharacterIsNewline?`
|
|
6
|
+
`:"")}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let n=e.length>0&&e.endsWith(`
|
|
7
|
+
`),i=n?e.substring(0,e.length-1):e,s=this.getIndentString(),u=i.replaceAll(`
|
|
3
8
|
`,`
|
|
4
|
-
${
|
|
5
|
-
`),this.writeInternal(
|
|
9
|
+
${s}`);this.isAtStartOfLine()&&(u=s+u),n&&(u+=`
|
|
10
|
+
`),this.writeInternal(u)}else this.writeNode(e)}writeStatement(...t){this.write(...t),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(t){let e=this.indentLevel;this.indentLevel=0,this.write(t),this.indentLevel=e}writeNode(t){V&&this.nodeStackFrames.push(...Zt(t)),t.write(this),V&&Jt!=="single"&&this.writeInternal(`
|
|
11
|
+
`)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){this.writeNode(t),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new B(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new B(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new B(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new B(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new B(t).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(t=!0){this.dedent(),this.writeNewLineIfLastLineNot(),t?this.writeLine("}"):this.write("}")}writeLine(...t){this.write(...t.length===0?[""]:t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
6
12
|
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
7
|
-
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let s=1;s<t.length;s++){this.write(e);let u=t[s];u!=null&&n(u)}}}toString(){return this.buffer}writeInternal(t){
|
|
8
|
-
`),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return nl}};o();a();function Gt(r){return(r==null?void 0:r.name)!=null}o();a();var Ve=class extends K{constructor({condition:e,true_:n,false_:i}){super();l(this,"condition");l(this,"true_");l(this,"false_");this.condition=e,this.true_=n,this.false_=i}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};o();a();o();a();o();a();o();a();var ze=class{constructor(){l(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let n=t.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};o();a();var v={Critical:"CRITICAL",Warning:"WARNING"},Ge=class r{constructor(){l(this,"errors");l(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(Ne(Ce({},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 r;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 n of t){if(typeof n=="string"){e.push(n);continue}e[e.length-1]+=`[${n.index}]`}return e}};var Ye=class{constructor({ir:t,config:e,options:n={}}){l(this,"config");l(this,"options");l(this,"errors");l(this,"_ir");l(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=n,this.errors=new Ge,this.httpEndpointReferenceParser=new ze}associateQueryParametersByWireValue({parameters:t,values:e}){let n=[];for(let[i,s]of Object.entries(e)){this.errors.scope(i);try{let u=t.find(m=>m.name.wireValue===i);if(u==null)throw this.newParameterNotRecognizedError(i);let c=this.isListTypeReference(u.typeReference)&&!Array.isArray(s)?[s]:s;n.push({name:u.name,typeReference:u.typeReference,value:c})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:n}){let i=[];for(let[s,u]of Object.entries(e)){this.errors.scope(s);try{let c=t.find(m=>m.name.wireValue===s);if(c==null){if(n)continue;this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(s).message});continue}i.push({name:c.name,typeReference:c.typeReference,value:u})}finally{this.errors.unscope()}}return i}getSingleFileValue({property:t,record:e}){let n=e[t.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:v.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:t,record:e}){let n=e[t.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let i=[];for(let s of n){if(typeof s!="string"){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof s}`});return}i.push(s)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:v.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:v.Critical,message:`Type identified by "${t}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e}){let n=this.getRecord(e);if(n==null)return;let i=t.discriminant.wireValue,s=n[i];if(s==null){this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof s!="string"){this.errors.add({severity:v.Critical,message:`Expected discriminant value to be a string but got: ${typeof s}`});return}let u=t.types[s];if(u==null){this.errors.add({severity:v.Critical,message:`No type found for discriminant value "${s}"`});return}let d=n,{[i]:c}=d,m=Zt(d,[Kt(i)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.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 n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:t})&&e.push(n);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:n}){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:n}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var n,i;return e&&((i=(n=t.metadata)==null?void 0:n.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:A(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}default:A(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:v.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:v.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=e.environments[0];if(n==null)return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set($e(n.urls));for(let s of $e(t))i.has(s)&&i.delete(s);return i.size>0?(this.errors.add({severity:v.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${$e(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:v.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:A(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:A(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:A(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}};o();a();o();a();var ji="self",$i="static";var y={};Jt(y,{Access:()=>ue,Array:()=>ge,AstNode:()=>g,Attribute:()=>we,Class:()=>Z,ClassInstantiation:()=>V,ClassReference:()=>N,CodeBlock:()=>I,DataClass:()=>ve,Enum:()=>Te,Field:()=>be,Map:()=>Ae,Method:()=>Q,MethodInvocation:()=>X,Parameter:()=>J,Trait:()=>Ee,Type:()=>D,TypeLiteral:()=>k,Writer:()=>W,array:()=>ll,assignVariable:()=>Rl,attribute:()=>cl,classReference:()=>hl,class_:()=>ml,codeblock:()=>Re,dataClass:()=>xl,enum_:()=>yl,field:()=>gl,instantiateClass:()=>Hi,invokeMethod:()=>wl,map:()=>Tl,mergeArrays:()=>Il,method:()=>bl,parameter:()=>Al,string:()=>Nl,ternary:()=>El,this_:()=>Sl,throwException:()=>vl,trait:()=>dl,variable:()=>Cl});o();a();o();a();o();a();var ue={Public:"public",PublicReadonly:"public readonly",Protected:"protected",Private:"private"};o();a();o();a();o();a();function Wi(r){return{namespace:r.substring(0,r.lastIndexOf("\\")),name:r.substring(r.lastIndexOf("\\")+1)}}var W=class extends We{constructor({namespace:e,rootNamespace:n,customConfig:i}){super();l(this,"namespace");l(this,"rootNamespace");l(this,"customConfig");l(this,"references",{});this.namespace=e,this.rootNamespace=n,this.customConfig=i}addReference(e){var u,c;if(e.namespace==null)return;if(Object.keys(this.references).filter(m=>{let d=Wi(m);return d.namespace!==e.namespace&&d.name===e.name}).length>0){e.requireFullyQualified();return}let i=e.namespace===""?e.name:`${e.namespace}\\${e.name}`;((c=(u=this.references)[i])!=null?c:u[i]=[]).push(e)}toString(e=!1){if(e)return this.buffer;let n=`namespace ${this.namespace};`,i=this.stringifyImports();return i.length>0?`${n}
|
|
13
|
+
`)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let s=1;s<t.length;s++){this.write(e);let u=t[s];u!=null&&n(u)}}}toString(){return this.buffer}writeInternal(t){if(t.length===0)return;let e=!this.lastCharacterIsNewline;this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
14
|
+
`),this.lastCharacterIsSemicolon=t.endsWith(";");let n=t.split(`
|
|
15
|
+
`),i=V&&!this.shouldSkipTracking(n)&&this.lastCharacterIsNewline;e&&(this.lastLine=`${this.lastLine}${n.shift()||""}`),this.lastCharacterIsNewline&&n.pop(),this.lineBuffer.push(...n),i&&this.appendTrackingComment()}set lastLine(t){this.lineBuffer.length>0?this.lineBuffer[this.lineBuffer.length-1]=t:this.lineBuffer.push(t)}get lastLine(){return this.lineBuffer[this.lineBuffer.length-1]||""}shouldSkipTracking(t){return!1}formatStack(t,e=""){return t.map(n=>`${e?`(${e}) `:""} ${n.fn} - ${n.path} : ${n.position}`)}filterStack(t){return t.filter(e=>!e.fn.startsWith(`${this.constructor.name}.`))}appendTrackingComment(){let t=[...this.formatStack(this.filterStack(_t({maxFrames:15,skip:3}))),...this.formatStack(this.filterStack(this.nodeStackFrames),"node")];switch(this.nodeStackFrames.length=0,Jt){case"single":return this.singleLineTrackingComment(t);case"multiline":return this.multiLineTrackingComment(t);case"box":return this.boxTrackingComment(t)}}singleLineTrackingComment(t){this.lastLine=`${this.lastLine} // ${t.join(" ")}`}multiLineTrackingComment(t){this.lineBuffer.push(...t.map(e=>` // ${e}`))}boxTrackingComment(t){this.lineBuffer.push("/*",...t.map(e=>` ${e}`),"*/")}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return wl}};o();a();function Xt(r){return(r==null?void 0:r.name)!=null&&(r==null?void 0:r.assignment)!=null}o();a();var Ye=class extends X{constructor({condition:e,true_:n,false_:i}){super();l(this,"condition");l(this,"true_");l(this,"false_");this.condition=e,this.true_=n,this.false_=i}write(e){e.writeNode(this.condition),e.write(" ? "),e.writeNode(this.true_),e.write(" : "),e.writeNode(this.false_)}};o();a();o();a();o();a();o();a();var qe=class{constructor(){l(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let n=t.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};o();a();var T={Critical:"CRITICAL",Warning:"WARNING"},He=class r{constructor(){l(this,"errors");l(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(_e(Ne({},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 r;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 n of t){if(typeof n=="string"){e.push(n);continue}e[e.length-1]+=`[${n.index}]`}return e}};var Ke=class{constructor({ir:t,config:e,options:n={}}){l(this,"config");l(this,"options");l(this,"errors");l(this,"_ir");l(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=n,this.errors=new He,this.httpEndpointReferenceParser=new qe}associateQueryParametersByWireValue({parameters:t,values:e}){let n=[];for(let[i,s]of Object.entries(e)){this.errors.scope(i);try{let u=t.find(m=>m.name.wireValue===i);if(u==null)throw this.newParameterNotRecognizedError(i);let c=this.isListTypeReference(u.typeReference)&&!Array.isArray(s)?[s]:s;n.push({name:u.name,typeReference:u.typeReference,value:c})}finally{this.errors.unscope()}}return n}associateByWireValueOrDefault({parameters:t,values:e}){let n=[];for(let i of t){this.errors.scope(i.name.wireValue);try{let s=e[i.name.wireValue];if(s==null)if(i.typeReference.type==="primitive"&&i.typeReference.value==="STRING")s=`<${i.name.wireValue}>`;else{this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(i.name.wireValue).message});continue}n.push({name:i.name,typeReference:i.typeReference,value:s})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:n}){let i=[];for(let[s,u]of Object.entries(e)){this.errors.scope(s);try{let c=t.find(m=>m.name.wireValue===s);if(c==null){if(n)continue;this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(s).message});continue}i.push({name:c.name,typeReference:c.typeReference,value:u})}finally{this.errors.unscope()}}return i}getExampleObjectProperties({parameters:t,snippetObject:e}){let n=typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{},i=[];for(let s of t){let u=n[s.name.wireValue];u==null?s.typeReference.type==="nullable"&&i.push({name:s.name,typeReference:s.typeReference,value:null}):i.push({name:s.name,typeReference:s.typeReference,value:u})}return i}getSingleFileValue({property:t,record:e}){let n=e[t.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:T.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:t,record:e}){let n=e[t.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:T.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let i=[];for(let s of n){if(typeof s!="string"){this.errors.add({severity:T.Critical,message:`Expected file array value to be an array of strings, got ${typeof s}`});return}i.push(s)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:T.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:T.Critical,message:`Type identified by "${t}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e}){let n=this.getRecord(e);if(n==null)return;let i=t.discriminant.wireValue,s=n[i];if(s==null){this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof s!="string"){this.errors.add({severity:T.Critical,message:`Expected discriminant value to be a string but got: ${typeof s}`});return}let u=t.types[s];if(u==null){this.errors.add({severity:T.Critical,message:`No type found for discriminant value "${s}"`});return}let d=n,{[i]:c}=d,m=or(d,[ir(i)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.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)}resolveEndpointLocation(t){let e=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:t})&&e.push(n);return e}resolveEndpointLocationOrThrow(t){let e=this.resolveEndpointLocation(t);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:n}){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:n}):!((i=t.metadata)!=null&&i.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var n,i;return e&&((i=(n=t.metadata)==null?void 0:n.includePathParameters)!=null?i:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:E(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=e.environments.find(i=>i.id===t);return n==null?void 0:n.name}default:E(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:T.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:T.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=e.environments[0];if(n==null)return this.errors.add({severity:T.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let i=new Set(Ve(n.urls));for(let s of Ve(t))i.has(s)&&i.delete(s);return i.size>0?(this.errors.add({severity:T.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${Ve(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:T.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:T.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:T.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:E(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:E(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:E(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}};o();a();o();a();var Qi="self",eo="static";o();a();var to=new Set(["abstract","and","array","as","break","callable","case","catch","class","clone","const","continue","declare","default","die","do","echo","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","eval","exit","extends","final","finally","fn","for","foreach","function","global","goto","if","implements","include","include_once","instanceof","insteadof","interface","isset","list","match","namespace","new","or","print","private","protected","public","readonly","require","require_once","return","static","switch","throw","trait","try","unset","use","var","while","xor","yield","yield_from","__halt_compiler"]);var y={};ar(y,{Access:()=>le,Array:()=>ve,AstNode:()=>w,Attribute:()=>Te,Class:()=>Q,ClassInstantiation:()=>G,ClassReference:()=>S,CodeBlock:()=>_,DataClass:()=>be,Enum:()=>Ae,Field:()=>Ee,Map:()=>Re,Method:()=>re,MethodInvocation:()=>te,Parameter:()=>ee,Trait:()=>Ce,Type:()=>D,TypeLiteral:()=>M,Writer:()=>z,array:()=>Sl,assignVariable:()=>$l,attribute:()=>Nl,classReference:()=>Ll,class_:()=>_l,codeblock:()=>Se,dataClass:()=>Pl,enum_:()=>kl,escapePhpString:()=>Qt,field:()=>Ol,instantiateClass:()=>fo,invokeMethod:()=>Ul,map:()=>Bl,mergeArrays:()=>zl,method:()=>Ml,parameter:()=>Dl,string:()=>Vl,ternary:()=>jl,this_:()=>Gl,throwException:()=>Fl,trait:()=>Il,variable:()=>Wl});o();a();o();a();o();a();var le={Public:"public",PublicReadonly:"public readonly",Protected:"protected",Private:"private"};o();a();o();a();o();a();function ro(r){return{namespace:r.substring(0,r.lastIndexOf("\\")),name:r.substring(r.lastIndexOf("\\")+1)}}var z=class extends Ge{constructor({namespace:e,rootNamespace:n,customConfig:i}){super();l(this,"namespace");l(this,"rootNamespace");l(this,"customConfig");l(this,"references",{});this.namespace=e,this.rootNamespace=n,this.customConfig=i}addReference(e){var u,c;if(e.namespace==null)return;if(Object.keys(this.references).filter(m=>{let d=ro(m);return d.namespace!==e.namespace&&d.name===e.name}).length>0){e.requireFullyQualified();return}let i=e.namespace===""?e.name:`${e.namespace}\\${e.name}`;((c=(u=this.references)[i])!=null?c:u[i]=[]).push(e)}toString(e=!1){if(e)return this.buffer;let n=`namespace ${this.namespace};`,i=this.stringifyImports();return i.length>0?`${n}
|
|
9
16
|
|
|
10
17
|
${i}
|
|
11
18
|
|
|
12
19
|
${this.buffer}`:n+`
|
|
13
20
|
|
|
14
|
-
`+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(n=>
|
|
15
|
-
`)}};var
|
|
21
|
+
`+this.buffer}stringifyImports(){let e=Object.keys(this.references);return e.length===0?"":e.filter(n=>ro(n).namespace!==this.namespace).map(n=>`use ${n};`).join(`
|
|
22
|
+
`)}};var w=class extends X{toString(t){if(t==null)throw new Error("Internal error; AstNode.toString method called incorrectly.");let{namespace:e,rootNamespace:n,customConfig:i,skipImports:s=!1}=t,u=new z({namespace:e,rootNamespace:n,customConfig:i});return this.write(u),u.toString(s)}async toStringAsync({namespace:t,rootNamespace:e,customConfig:n}){let i=new z({namespace:t,rootNamespace:e,customConfig:n});return this.write(i),i.toString()}};var ve=class extends w{constructor({entries:e}){super();l(this,"entries");this.entries=e!=null?e:[]}write(e){e.write("["),this.entries.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write("]")}};o();a();var Te=class extends w{constructor(e){var n;super();l(this,"reference");l(this,"arguments");this.reference=e.reference,this.arguments=(n=e.arguments)!=null?n:[]}write(e){e.addReference(this.reference),e.write(`${this.reference.name}`),this.arguments.length>0&&(e.write("("),this.arguments.forEach((n,i)=>{i>0&&e.write(","),typeof n=="string"?e.write(n):n.write(e)}),e.write(")"))}};o();a();o();a();var S=class extends w{constructor({name:e,namespace:n,generics:i}){super();l(this,"name");l(this,"namespace");l(this,"generics");l(this,"fullyQualified");this.name=e,this.namespace=n,this.generics=i,this.fullyQualified=!1}requireFullyQualified(){this.fullyQualified=!0}write(e){e.addReference(this);let n=this.fullyQualified?`\\${this.namespace}\\${this.name}`:this.name;e.write(`${n}`)}};o();a();o();a();function ce(r){return r.startsWith("$")?r:`$${r}`}var L=class extends w{constructor({docs:e}={}){super();l(this,"docs");l(this,"tags",[]);this.docs=e}addTag(e){this.tags.push(_e(Ne({},e),{name:e.name!=null?ce(e.name):void 0}))}write(e){e.writeLine("/**"),this.docs!=null&&(this.docs.split(`
|
|
16
23
|
`).forEach(n=>{e.writeLine(` * ${n}`)}),this.tags.length>0&&e.writeLine(" *"));for(let n of this.tags)this.writeTag({writer:e,tag:n});e.writeLine(" */")}writeTag({writer:e,tag:n}){let i=n.docs!=null?n.docs.split(`
|
|
17
|
-
`):void 0;i!=null&&i.length>1&&(i.forEach(s=>{e.writeLine(` * ${s}`)}),e.writeLine(" *")),e.write(` * @${n.tagType} `),n.type.write(e,{comment:!0}),n.name!=null&&e.write(` ${n.name}`),i!=null&&i.length===1&&e.write(` ${i[0]}`),e.newLine()}};o();a();function
|
|
18
|
-
`)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}if(this.internalType.value.includes("'")){e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}e.write(`'${this.internalType.value}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:A(this.internalType)}}isClass(){return this.internalType.type==="class"}asClassOrThrow(){if(this.isClass())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a class")}writeStringWithHeredoc({writer:e,value:n}){e.writeLine("<<<EOT"),e.writeNoIndent(n),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:n}){e.writeNode(new V({classReference:n.reference,arguments_:[r.map({entries:n.fields.map(i=>({key:r.string(i.name),value:i.value}))})]}))}writeList({writer:e,list:n}){let i=pl({values:n.values});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of i)s.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:n}){let i=ul({entries:n.entries});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of i)s.key.write(e),e.write(" => "),s.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:n}){return new this({type:"class",reference:e,fields:n})}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:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:e,value:n});return}this.writeUnknownMap({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:e,value:n}){if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of n)e.writeNode(r.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:n}){let i=Object.entries(n);if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[s,u]of i)e.write(`'${s}' => `),e.writeNode(r.unknown(u)),e.writeLine(",");e.dedent(),e.write("]")}};function sl({writer:r,value:t}){return new V({classReference:new N({name:"DateTime",namespace:""}),arguments_:[new I(`'${t}'`)]})}function fl({writer:r,value:t}){return new X({on:new N({name:"File",namespace:`${r.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new I(`"${t}"`)]})}function ul({entries:r}){return r.filter(t=>!k.isNop(t.key)&&!k.isNop(t.value))}function pl({values:r}){return r.filter(t=>!k.isNop(t))}var D=class r extends g{constructor(e){super();l(this,"internalType");this.internalType=e}write(e,{comment:n}={}){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(Gi),e.write("DateTime");break;case"dateTime":e.addReference(Gi),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!n){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:n}),e.write(">");break;case"map":{if(!n){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:n}),e.write(", "),this.internalType.valueType.write(e,{comment:n}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!n){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");let i=this.internalType.entries.filter(c=>!c.valueType.isOptional()),s=this.internalType.entries.filter(c=>c.valueType.isOptional()),u=[...i,...s];for(let c of u)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:c,comment:n}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((i,s)=>{s>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:i,comment:n})}),e.write("}");break}case"union":{this.writeUnion({writer:e,unionTypes:this.internalType.types,comment:n});break}case"optional":{let i=this.internalType.value.internalType,s=i.type==="mixed",u=i.type==="union";!u&&!s&&e.write("?"),this.internalType.value.write(e,{comment:n}),u&&!this.unionHasOptional(i.types)&&(e.write("|"),e.writeNode(r.null()));break}case"reference":if(n){e.writeNode(this.internalType.value);let i=this.internalType.value.generics;i&&i.length>0&&(e.write("<"),i.forEach((s,u)=>{u>0&&e.write(", "),s.write(e,{comment:n})}),e.write(">"))}else e.writeNode(this.internalType.value);break;case"enumString":n?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;case"literal":if(n)e.writeNode(this.internalType.value);else switch(this.internalType.value.internalType.type){case"string":e.write("string");break;case"boolean":e.write("bool");break;default:A(this.internalType.value.internalType)}break;default:A(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:r.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"}getClassReference(){switch(this.internalType.type){case"date":case"dateTime":return new N({name:"DateTime",namespace:""});case"enumString":case"reference":return this.internalType.value;case"int":case"string":case"bool":case"float":case"object":case"map":case"array":case"null":case"mixed":case"optional":case"typeDict":case"union":case"literal":throw new Error("Cannot get class reference for "+this.internalType.type);default:A(this.internalType)}}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,n){return new this({type:"map",keyType:e,valueType:n})}static typeDict(e,{multiline:n}={}){return new this({type:"typeDict",entries:e,multiline:n})}static union(e){let n=this.flattenUnionTypes(e),i=Et(n,At);return new this({type:"union",types:i})}static flattenUnionTypes(e){let n=[];for(let i of e)i.internalType.type==="union"?n.push(...this.flattenUnionTypes(i.internalType.types)):n.push(i);return n}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 literalString(e){return new this({type:"literal",value:k.string(e)})}static literalBoolean(e){return new this({type:"literal",value:k.boolean(e)})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeUnion({writer:e,unionTypes:n,comment:i}){let s=this.getUniqueTypes({types:n,comment:i,writer:e}),u=this.unwrapOptionalTypes(s),c=u.filter(m=>m.underlyingType().internalType.type==="mixed").length>0;if(c&&!i){e.write("mixed");return}if(u.length>0&&i){e.writeLine("("),u.forEach((m,d)=>{d>0?e.write(" * |"):e.write(" * "),c&&(m=m.underlyingType()),m.write(e,{comment:i}),e.writeLine(),d++}),e.write(" * )");return}u.forEach((m,d)=>{d>0&&e.write("|"),c&&(m=m.underlyingType()),m.write(e,{comment:i}),d++})}writeTypeDictEntry({writer:e,entry:n,comment:i}){e.write(n.key),n.optional&&e.write("?"),e.write(": "),n.valueType.write(e,{comment:i})}getUniqueTypes({writer:e,types:n,comment:i}){let s=Et(n,At),u=new Set;return s.filter(c=>{let m=c.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig,comment:i});return u.has(m)?!1:(u.add(m),!0)})}unwrapOptionalTypes(e){let n=!1,i=e.map(s=>s.internalType.type==="optional"?(n=!0,s.internalType.value):s);return n&&i.push(r.null()),i}unionHasOptional(e){return e.filter(n=>n.internalType.type==="optional").length>0}toString({namespace:e,rootNamespace:n,customConfig:i,comment:s}){let u=new W({namespace:e,rootNamespace:n,customConfig:i});return this.write(u,{comment:s!=null?s:!1}),u.toString()}},Gi=new N({namespace:"",name:"DateTime"});o();a();function Yi(r){return r.startsWith("$")?r.slice(1):r}var qi="values",ve=class extends g{constructor({name:e,namespace:n,abstract:i,docs:s,parentClassReference:u,traits:c,constructorAccess:m}){super();l(this,"name");l(this,"namespace");l(this,"constructorAccess");l(this,"class_");this.name=e,this.namespace=n,this.constructorAccess=m!=null?m:"public",this.class_=new Z({name:e,namespace:n,abstract:i,docs:s,parentClassReference:u,traits:c})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let n=le(this.class_.fields).map(i=>Ne(Ce({},i),{name:Yi(i.name)}));n.length>0&&this.class_.addConstructor({access:this.constructorAccess,parameters:this.getConstructorParameters({orderedFields:n}),body:y.codeblock(i=>{for(let s of n)i.write(`$this->${s.name} = $${qi}['${s.name}']`),s.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 J({name:qi,type:D.typeDict(e.map(n=>({key:n.name,valueType:n.type,optional:n.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new I("[]"):void 0})]}};o();a();o();a();var Q=class extends g{constructor({name:e,access:n,parameters:i,throws:s,return_:u,body:c,docs:m,classReference:d,static_:h}){super();l(this,"name");l(this,"access");l(this,"parameters");l(this,"throws");l(this,"return_");l(this,"body");l(this,"docs");l(this,"classReference");l(this,"static_");this.name=e,this.access=n,this.parameters=i,this.throws=s!=null?s:[],this.return_=u,this.body=c,this.docs=m,this.classReference=d,this.static_=h!=null?h:!1}write(e){var u;this.writeComment(e),e.write(`${this.access}${this.static_?" static":""} function ${this.name}(`);let n=this.parameters.filter(c=>!c.type.isOptional()),i=this.parameters.filter(c=>c.type.isOptional());[...n,...i].forEach((c,m)=>{m>0&&e.write(", "),c.write(e)}),e.write("): "),this.return_!=null?e.writeNodeOrString(this.return_):e.write("void"),e.writeLine(" {"),e.indent(),(u=this.body)==null||u.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let n=new L({docs:this.docs});for(let i of this.parameters)n.addTag({tagType:"param",type:i.type,name:i.name,docs:i.docs});this.return_!=null&&this.return_!==ji&&this.return_!==$i&&n.addTag({tagType:"return",type:this.return_});for(let i of this.throws)n.addTag({tagType:"throws",type:D.reference(i)});e.writeNode(n)}};var Te=class extends g{constructor({name:e,namespace:n,backing:i,docs:s,serializable:u}){super();l(this,"name");l(this,"namespace");l(this,"backing");l(this,"docs");l(this,"members",[]);l(this,"serializable");this.name=e,this.namespace=n,this.backing=i,this.docs=s,this.serializable=u!=null?u:!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 N({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let n of this.members)e.write(`case ${n.name}`),n.value!=null&&(typeof n.value=="string"?e.write(` = "${n.value}"`):e.write(` = ${n.value}`)),e.writeTextStatement("");this.serializable&&(e.newLine(),e.writeNode(new Q({name:"jsonSerialize",return_:D.string(),access:"public",parameters:[],body:new I("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new L({docs:this.docs}).write(e)}};o();a();var be=class extends g{constructor({name:e,type:n,access:i,readonly_:s,initializer:u,docs:c,inlineDocs:m,attributes:d,inherited:h}){super();l(this,"name");l(this,"type");l(this,"access");l(this,"readonly_");l(this,"initializer");l(this,"docs");l(this,"inlineDocs");l(this,"attributes");l(this,"inherited");this.name=pe(e),this.type=n,this.access=i,this.readonly_=s!=null?s:!1,this.initializer=u,this.docs=c,this.inlineDocs=m,this.attributes=d!=null?d:[],this.inherited=h!=null?h:!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 n=new L;n.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),n.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.writeLine("]"))}};o();a();var Ae=class extends g{constructor({entries:e,multiline:n}){super();l(this,"entries");l(this,"multiline");this.entries=e!=null?e:[],this.multiline=n!=null?n:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:n,value:i}of this.entries)n.write(e),e.write(" => "),i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[n,{key:i,value:s}]of this.entries.entries())n>0&&e.write(", "),i.write(e),e.write(" => "),s.write(e);e.write("]")}};o();a();var Ee=class extends g{constructor({name:e,namespace:n,docs:i,traits:s}){super();l(this,"name");l(this,"namespace");l(this,"docs");l(this,"traits");l(this,"fields",[]);l(this,"methods",[]);this.name=e,this.namespace=n,this.docs=i,this.traits=s!=null?s:[]}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((n,i)=>{i>0&&e.write(","),e.writeNode(n)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:le(this.fields)}),this.fields.length>0&&this.methods.length>0&&e.newLine(),this.writeMethods({writer:e,methods:le(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){let n=new L({docs:this.docs});for(let i of this.fields)n.addTag({tagType:"property",type:i.type,name:i.name});n.write(e)}writeFields({writer:e,fields:n}){n.forEach((i,s)=>{s>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:n}){n.forEach((i,s)=>{s>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};o();a();var Rt=class extends g{constructor(e){super();l(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),Fe({writer:e,arguments_:this.arrays.map(n=>Re(i=>{if(typeof n=="string"||n instanceof g){i.writeNodeOrString(n);return}i.writeNodeOrString(n.ref),n.fallback&&(i.write(" ?? "),i.writeNodeOrString(n.fallback))}))})}};function ll(r){return new ge(r)}function cl(r){return new we(r)}function ml(r){return new Z(r)}function dl(r){return new Ee(r)}function hl(r){return new N(r)}function Re(r){return new I(r)}function xl(r){return new ve(r)}function yl(r){return new Te(r)}function gl(r){return new be(r)}function Hi(r){return new V(r)}function wl(r){return new X(r)}function vl(r){return Re(t=>{t.write("throw "),t.writeNode(Hi(r))})}function Tl(r){return new Ae(r)}function bl(r){return new Q(r)}function Al(r){return new J(r)}function El(r){return new Ve(r)}function Rl(r,t){return Re(e=>{e.writeNodeOrString(r),e.write(" = "),e.writeNodeOrString(t)})}function Cl(r){return Re(pe(r))}function Nl(r){return Re(`"${r}"`)}function Il(...r){return new Rt(r)}function Sl(){return new I(r=>{r.write("$this")})}o();a();var Ct=class{constructor({context:t}){l(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?y.TypeLiteral.null():(this.context.errors.add({severity:v.Critical,message:"Expected non-null value, but got null"}),y.TypeLiteral.nop());if(t.value===void 0)return y.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?y.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:A(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let n=this.context.getValueAsBoolean({value:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.string(n)}default:A(t)}}convertList({list:t,value:e}){return Array.isArray(e)?y.TypeLiteral.list({values:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:v.Critical,message:`Expected array but got: ${typeof e}`}),y.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:v.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),y.TypeLiteral.nop()):y.TypeLiteral.map({entries:Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:t.key,value:n,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:n}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:n});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:A(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(n==null)return y.TypeLiteral.nop();let i=n.singleDiscriminatedUnionType,s=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});return s==null?y.TypeLiteral.nop():y.TypeLiteral.reference(y.codeblock(u=>{u.writeNode(y.invokeMethod({on:y.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),method:this.context.getMethodName(i.discriminantValue.name),arguments_:this.convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:n,unionVariant:i,unionProperties:s}),static_:!0}))}))}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){switch(e.type){case"samePropertiesAsObject":{let n=this.context.resolveNamedType({typeId:e.typeId});if(n==null)return;let i=this.convertNamed({named:n,value:t.value});if(!i.isClass()){this.context.errors.add({severity:v.Critical,message:"Internal error; expected union value to be an object"});return}return i.asClassOrThrow().fields}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let n=this.context.getRecord(t.value);return n==null?[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:t.value})}]:[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:n[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return[];default:A(e)}}convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:t,unionVariant:e,unionProperties:n}){let i=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});if(e.type==="singleProperty"&&this.context.getRecord(t.value)==null&&n.length===1)return[...i,this.convert({typeReference:e.typeReference,value:t.value})];if(e.type==="samePropertiesAsObject"){let s=this.context.resolveNamedType({typeId:e.typeId});return s==null?[]:[...i,y.TypeLiteral.class_({reference:y.classReference({name:this.context.getClassName(s.declaration.name),namespace:this.context.getTypesNamespace(s.declaration.fernFilepath)}),fields:n})]}return i}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i,s;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(s=this.context.getRecord(t.value))!=null?s:{},ignoreMissingParameters:!0}).map(u=>{this.context.errors.scope(u.name.wireValue);try{return this.convert(u)}finally{this.context.errors.unscope()}})}convertObject({object_:t,value:e}){var i;let n=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return y.TypeLiteral.class_({reference:y.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),fields:n.map(s=>{this.context.errors.scope(s.name.wireValue);try{return{name:this.context.getPropertyName(s.name.name),value:this.convert(s)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let n=this.getEnumValueName({enum_:t,value:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.reference(y.codeblock(i=>{i.writeNode(y.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)})),i.write("::"),i.write(n),i.write("->value")}))}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:v.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let n=t.values.find(i=>i.wireValue===e);if(n==null){this.context.errors.add({severity:v.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return n==null?y.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{return this.convert({typeReference:n,value:e})}catch(i){continue}this.context.errors.add({severity:v.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return y.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:n}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:n});return i==null?y.TypeLiteral.nop():y.TypeLiteral.number(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?y.TypeLiteral.nop():y.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:n});return i==null?y.TypeLiteral.nop():y.TypeLiteral.boolean(i)}case"DATE":case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?y.TypeLiteral.nop():y.TypeLiteral.datetime(i)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?y.TypeLiteral.nop():y.TypeLiteral.string(i)}default:A(t)}}getValueAsNumber({value:t,as:e}){let n=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:t,as:e}){let n=e==="key"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:n})}};o();a();var Nt=class{constructor({context:t}){l(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var s;let n={fileFields:[],bodyPropertyFields:[]},i=(s=this.context.getRecord(e))!=null?s:{};for(let u of t.properties)switch(u.type){case"file":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getSingleFileProperty({property:u,record:i})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getArrayFileProperty({property:u,record:i})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(u.name.name),value:this.getBodyProperty({property:u,record:i})});break;default:A(u)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.file(n)}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.list({values:n.map(i=>y.TypeLiteral.file(i))})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?y.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:n})}};var _l=["use","clone","list"],Ll="Requests",Pl="Types",Yt=class r extends Ye{constructor({ir:e,config:n}){var i;super({ir:e,config:n});l(this,"ir");l(this,"customConfig");l(this,"dynamicTypeLiteralMapper");l(this,"filePropertyMapper");l(this,"rootNamespace");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new Ct({context:this}),this.filePropertyMapper=new Nt({context:this}),this.rootNamespace=Ul({organization:n.organization,namespaceOverride:(i=this.customConfig)==null?void 0:i.namespace})}clone(){return new r({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 n=e.camelCase.unsafeName;return _l.includes(n)?n:e.camelCase.safeName}getClassName(e){return e.pascalCase.safeName}getRootClientClassName(){var e,n,i;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((n=this.customConfig)==null?void 0:n["client-class-name"])!=null?(i=this.customConfig)==null?void 0:i["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return y.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,Ll)}getTypesNamespace(e){return this.getNamespace(e,Pl)}getNamespace(e,n){let i=e.allParts.map(s=>s.pascalCase.safeName);return i=n!=null?[...i,n]:i,[this.rootNamespace,...i].join("\\")}getEnvironmentClassAccessFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return y.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference(n)),i.write("::"),i.write(this.getClassName(n))})}getEnvironmentClassReference(e){return y.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${Ue(dt(this.config.organization))}`}};function Ul({organization:r,namespaceOverride:t}){return t!=null?t:`${Ue(dt(r))}`}0&&(module.exports={DynamicSnippetsGeneratorContext});
|
|
24
|
+
`):void 0;i!=null&&i.length>1&&(i.forEach(s=>{e.writeLine(` * ${s}`)}),e.writeLine(" *")),e.write(` * @${n.tagType} `),n.type.write(e,{comment:!0}),n.name!=null&&e.write(` ${n.name}`),i!=null&&i.length===1&&e.write(` ${i[0]}`),e.newLine()}};o();a();function me(r){return vl(r,[le.Public,le.PublicReadonly,le.Protected,le.Private])}function vl(r,t){return t.reduce((e,n)=>[...e,...r.filter(i=>i.access===n)],[])}var Q=class extends w{constructor({name:e,namespace:n,abstract:i,docs:s,parentClassReference:u,traits:c}){super();l(this,"name");l(this,"namespace");l(this,"abstract");l(this,"docs");l(this,"parentClassReference");l(this,"traits");l(this,"fields",[]);l(this,"methods",[]);l(this,"constructor_");this.name=e,this.namespace=n,this.abstract=i!=null?i:!1,this.docs=s,this.parentClassReference=u,this.traits=c!=null?c:[]}addConstructor(e){this.constructor_=e}addField(e){this.fields.push(e)}addMethod(e){this.methods.push(e)}addMethods(e){this.methods.push(...e)}addTrait(e){this.traits.push(e)}write(e){e.addReference(new S({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((n,i)=>{i>0&&e.write(","),e.writeNode(n)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:me(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:me(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new L({docs:this.docs}).write(e)}writeConstructor({writer:e,constructor:n}){var i;this.writeConstructorComment({writer:e,constructor:n}),n.access!=null&&e.write(`${n.access} `),e.write("function __construct("),e.indent(),n.parameters.forEach((s,u)=>{u===0&&e.newLine(),s.write(e),e.writeLine(",")}),e.dedent(),e.writeLine(")"),e.writeLine("{"),e.indent(),(i=n.body)==null||i.write(e),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeConstructorComment({writer:e,constructor:n}){if(n.parameters.length===0)return;let i=new L;for(let s of n.parameters)i.addTag(s.getCommentTag());i.write(e)}writeFields({writer:e,fields:n}){n.filter(i=>!i.inherited).forEach((i,s)=>{s>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:n}){n.forEach((i,s)=>{s>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};o();a();o();a();function De({writer:r,arguments_:t,multiline:e}){if(t.length===0){r.write("()");return}if(e){Tl({writer:r,arguments_:t});return}bl({writer:r,arguments_:t})}function Tl({writer:r,arguments_:t}){r.writeLine("("),r.indent();for(let e of t)io({writer:r,argument:e,writeCompact:!1}),r.writeLine(",");r.dedent(),r.write(")")}function bl({writer:r,arguments_:t}){r.write("("),t.forEach((e,n)=>{n>0&&r.write(", "),io({writer:r,argument:e,writeCompact:!0})}),r.write(")")}function io({writer:r,argument:t,writeCompact:e}){Xt(t)?(t.docs&&(e?r.write(`/* ${t.docs} */ `):r.writeLine(`/* ${t.docs} */`)),r.write(`${t.name}: `),r.writeNodeOrString(t.assignment)):t.write(r)}var G=class extends w{constructor({classReference:e,arguments_:n,multiline:i}){super();l(this,"classReference");l(this,"arguments_");l(this,"multiline");this.classReference=e,this.arguments_=n,this.multiline=i!=null?i:!1}write(e){e.write("new "),e.writeNode(this.classReference),De({writer:e,arguments_:this.arguments_,multiline:this.multiline})}};o();a();var _=class extends w{constructor(e){super();l(this,"arg");this.arg=e}write(e){return new B(this.arg).write(e)}};o();a();o();a();var ee=class extends w{constructor({name:e,type:n,docs:i,initializer:s,access:u,readonly_:c}){super();l(this,"name");l(this,"type");l(this,"docs");l(this,"initializer");l(this,"access");l(this,"readonly_");this.name=ce(e),this.type=n,this.docs=i,this.initializer=s,this.access=u,this.readonly_=c!=null?c:!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")}};o();a();o();a();o();a();o();a();var te=class extends w{constructor({method:e,arguments_:n,static_:i,multiline:s,on:u}){super();l(this,"method");l(this,"arguments_");l(this,"multiline");l(this,"static_");l(this,"on");this.method=e,this.arguments_=n,this.static_=i!=null?i:!1,this.multiline=s!=null?s:!1,this.on=u}write(e){this.on!=null&&(this.on.write(e),e.write(this.getMethodAccessor())),e.write(this.method),De({writer:e,arguments_:this.arguments_,multiline:this.multiline})}getMethodAccessor(){return this.static_?"::":"->"}};var M=class r extends w{constructor(e){super();l(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(El({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(Al({writer:e,value:this.internalType.value}));break}case"string":{if(this.internalType.value.includes(`
|
|
25
|
+
`)){this.writeStringWithHeredoc({writer:e,value:this.internalType.value});break}if(this.internalType.value.includes("'")){e.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}e.write(`'${this.internalType.value}'`);break}case"unknown":{this.writeUnknown({writer:e,value:this.internalType.value});break}case"null":{e.write("null");break}case"nop":break;default:E(this.internalType)}}isClass(){return this.internalType.type==="class"}asClassOrThrow(){if(this.isClass())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a class")}writeStringWithHeredoc({writer:e,value:n}){e.writeLine("<<<EOT"),e.writeNoIndent(n),e.newLine(),e.writeNoIndent("EOT")}writeClass({writer:e,class_:n}){e.writeNode(new G({classReference:n.reference,arguments_:[r.map({entries:n.fields.map(i=>({key:r.string(i.name),value:i.value}))})]}))}writeList({writer:e,list:n}){let i=Cl({values:n.values});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of i)s.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeMap({writer:e,map:n}){let i=Rl({entries:n.entries});if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let s of i)s.key.write(e),e.write(" => "),s.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:n}){return new this({type:"class",reference:e,fields:n})}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:n}){switch(typeof n){case"boolean":e.write(n.toString());return;case"string":e.write(n.includes('"')?`\`${n}\``:`"${n}"`);return;case"number":e.write(n.toString());return;case"object":if(n==null){e.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:e,value:n});return}this.writeUnknownMap({writer:e,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:e,value:n}){if(n.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let i of n)e.writeNode(r.unknown(i)),e.writeLine(",");e.dedent(),e.write("]")}writeUnknownMap({writer:e,value:n}){let i=Object.entries(n);if(i.length===0){e.write("[]");return}e.writeLine("["),e.indent();for(let[s,u]of i)e.write(`'${s}' => `),e.writeNode(r.unknown(u)),e.writeLine(",");e.dedent(),e.write("]")}};function Al({writer:r,value:t}){return new G({classReference:new S({name:"DateTime",namespace:""}),arguments_:[new _(`'${t}'`)]})}function El({writer:r,value:t}){return new te({on:new S({name:"File",namespace:`${r.rootNamespace}\\Utils`}),method:"createFromString",arguments_:[new _(`"${t}"`)]})}function Rl({entries:r}){return r.filter(t=>!M.isNop(t.key)&&!M.isNop(t.value))}function Cl({values:r}){return r.filter(t=>!M.isNop(t))}var D=class r extends w{constructor(e){super();l(this,"internalType");this.internalType=e}write(e,{comment:n}={}){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(oo),e.write("DateTime");break;case"dateTime":e.addReference(oo),e.write("DateTime");break;case"mixed":e.write("mixed");break;case"object":e.write("object");break;case"array":if(!n){e.write("array");break}e.write("array<"),this.internalType.value.write(e,{comment:n}),e.write(">");break;case"map":{if(!n){e.write("array");break}e.write("array<"),this.internalType.keyType.write(e,{comment:n}),e.write(", "),this.internalType.valueType.write(e,{comment:n}),e.write(">");break}case"null":{e.write("null");break}case"typeDict":{if(!n){e.write("array");break}if(this.internalType.multiline){e.writeLine("array{");let i=this.internalType.entries.filter(c=>!c.valueType.isOptional()),s=this.internalType.entries.filter(c=>c.valueType.isOptional()),u=[...i,...s];for(let c of u)e.write(" * "),this.writeTypeDictEntry({writer:e,entry:c,comment:n}),e.writeLine(",");e.write(" * }");break}e.write("array{"),this.internalType.entries.forEach((i,s)=>{s>0&&e.write(", "),this.writeTypeDictEntry({writer:e,entry:i,comment:n})}),e.write("}");break}case"union":{this.writeUnion({writer:e,unionTypes:this.internalType.types,comment:n});break}case"optional":{let i=this.internalType.value.internalType,s=i.type==="mixed",u=i.type==="union";!u&&!s&&e.write("?"),this.internalType.value.write(e,{comment:n}),u&&!this.unionHasOptional(i.types)&&(e.write("|"),e.writeNode(r.null()));break}case"reference":if(n){e.writeNode(this.internalType.value);let i=this.internalType.value.generics;i&&i.length>0&&(e.write("<"),i.forEach((s,u)=>{u>0&&e.write(", "),s.write(e,{comment:n})}),e.write(">"))}else e.writeNode(this.internalType.value);break;case"enumString":n?(e.write("value-of<"),e.writeNode(this.internalType.value),e.write(">")):e.write("string");break;case"literal":if(n)e.writeNode(this.internalType.value);else switch(this.internalType.value.internalType.type){case"string":e.write("string");break;case"boolean":e.write("bool");break;default:E(this.internalType.value.internalType)}break;default:E(this.internalType)}}toOptionalIfNotAlready(){return this.internalType.type==="optional"?this:r.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"}getClassReference(){switch(this.internalType.type){case"date":case"dateTime":return new S({name:"DateTime",namespace:""});case"enumString":case"reference":return this.internalType.value;case"int":case"string":case"bool":case"float":case"object":case"map":case"array":case"null":case"mixed":case"optional":case"typeDict":case"union":case"literal":throw new Error("Cannot get class reference for "+this.internalType.type);default:E(this.internalType)}}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,n){return new this({type:"map",keyType:e,valueType:n})}static typeDict(e,{multiline:n}={}){return new this({type:"typeDict",entries:e,multiline:n})}static union(e){let n=this.flattenUnionTypes(e),i=St(n,Ct);return new this({type:"union",types:i})}static flattenUnionTypes(e){let n=[];for(let i of e)i.internalType.type==="union"?n.push(...this.flattenUnionTypes(i.internalType.types)):n.push(i);return n}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 literalString(e){return new this({type:"literal",value:M.string(e)})}static literalBoolean(e){return new this({type:"literal",value:M.boolean(e)})}static isAlreadyOptional(e){return e.internalType.type==="optional"}writeUnion({writer:e,unionTypes:n,comment:i}){let s=this.getUniqueTypes({types:n,comment:i,writer:e}),u=this.unwrapOptionalTypes(s),c=u.filter(m=>m.underlyingType().internalType.type==="mixed").length>0;if(c&&!i){e.write("mixed");return}if(u.length>0&&i){e.writeLine("("),u.forEach((m,d)=>{d>0?e.write(" * |"):e.write(" * "),c&&(m=m.underlyingType()),m.write(e,{comment:i}),e.writeLine(),d++}),e.write(" * )");return}u.forEach((m,d)=>{d>0&&e.write("|"),c&&(m=m.underlyingType()),m.write(e,{comment:i}),d++})}writeTypeDictEntry({writer:e,entry:n,comment:i}){e.write(n.key),n.optional&&e.write("?"),e.write(": "),n.valueType.write(e,{comment:i})}getUniqueTypes({writer:e,types:n,comment:i}){let s=St(n,Ct),u=new Set;return s.filter(c=>{let m=c.toString({namespace:e.namespace,rootNamespace:e.rootNamespace,customConfig:e.customConfig,comment:i});return u.has(m)?!1:(u.add(m),!0)})}unwrapOptionalTypes(e){let n=!1,i=e.map(s=>s.internalType.type==="optional"?(n=!0,s.internalType.value):s);return n&&i.push(r.null()),i}unionHasOptional(e){return e.filter(n=>n.internalType.type==="optional").length>0}toString({namespace:e,rootNamespace:n,customConfig:i,comment:s}){let u=new z({namespace:e,rootNamespace:n,customConfig:i});return this.write(u,{comment:s!=null?s:!1}),u.toString()}},oo=new S({namespace:"",name:"DateTime"});o();a();function ao(r){return r.startsWith("$")?r.slice(1):r}var so="values",be=class extends w{constructor({name:e,namespace:n,abstract:i,docs:s,parentClassReference:u,traits:c,constructorAccess:m}){super();l(this,"name");l(this,"namespace");l(this,"constructorAccess");l(this,"class_");this.name=e,this.namespace=n,this.constructorAccess=m!=null?m:"public",this.class_=new Q({name:e,namespace:n,abstract:i,docs:s,parentClassReference:u,traits:c})}addField(e){this.class_.addField(e)}addMethod(e){this.class_.addMethod(e)}addTrait(e){this.class_.addTrait(e)}write(e){let n=me(this.class_.fields).map(i=>_e(Ne({},i),{name:ao(i.name)}));n.length>0&&this.class_.addConstructor({access:this.constructorAccess,parameters:this.getConstructorParameters({orderedFields:n}),body:y.codeblock(i=>{for(let s of n)i.write(`$this->${s.name} = $${so}['${s.name}']`),s.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 ee({name:so,type:D.typeDict(e.map(n=>({key:n.name,valueType:n.type,optional:n.type.isOptional()})),{multiline:!0}),initializer:this.allFieldsAreOptional()?new _("[]"):void 0})]}};o();a();o();a();var re=class extends w{constructor({name:e,access:n,parameters:i,throws:s,return_:u,body:c,docs:m,classReference:d,static_:h}){super();l(this,"name");l(this,"access");l(this,"parameters");l(this,"throws");l(this,"return_");l(this,"body");l(this,"docs");l(this,"classReference");l(this,"static_");this.name=e,this.access=n,this.parameters=i,this.throws=s!=null?s:[],this.return_=u,this.body=c,this.docs=m,this.classReference=d,this.static_=h!=null?h:!1}write(e){var u;this.writeComment(e),e.write(`${this.access}${this.static_?" static":""} function ${this.name}(`);let n=this.parameters.filter(c=>!c.type.isOptional()),i=this.parameters.filter(c=>c.type.isOptional());[...n,...i].forEach((c,m)=>{m>0&&e.write(", "),c.write(e)}),e.write("): "),this.return_!=null?e.writeNodeOrString(this.return_):e.write("void"),e.writeLine(" {"),e.indent(),(u=this.body)==null||u.write(e),e.dedent(),e.writeLine("}")}writeComment(e){let n=new L({docs:this.docs});for(let i of this.parameters)n.addTag({tagType:"param",type:i.type,name:i.name,docs:i.docs});this.return_!=null&&this.return_!==Qi&&this.return_!==eo&&n.addTag({tagType:"return",type:this.return_});for(let i of this.throws)n.addTag({tagType:"throws",type:D.reference(i)});e.writeNode(n)}};var Ae=class extends w{constructor({name:e,namespace:n,backing:i,docs:s,serializable:u}){super();l(this,"name");l(this,"namespace");l(this,"backing");l(this,"docs");l(this,"members",[]);l(this,"serializable");this.name=e,this.namespace=n,this.backing=i,this.docs=s,this.serializable=u!=null?u:!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 S({name:"JsonSerializable",namespace:""})),e.writeLine(" implements JsonSerializable")),e.writeLine(" {"),e.indent();for(let n of this.members){if(e.write(`case ${n.name}`),n.value!=null)if(typeof n.value=="string"){let i=Qt(n.value);e.write(` = "${i}"`)}else e.write(` = ${n.value}`);e.writeTextStatement("")}this.serializable&&(e.newLine(),e.writeNode(new re({name:"jsonSerialize",return_:D.string(),access:"public",parameters:[],body:new _("return $this->value;")}))),e.writeNewLineIfLastLineNot(),e.dedent(),e.writeLine("}")}writeComment(e){if(this.docs==null)return;new L({docs:this.docs}).write(e)}};o();a();var Ee=class extends w{constructor({name:e,type:n,access:i,readonly_:s,initializer:u,docs:c,inlineDocs:m,attributes:d,inherited:h}){super();l(this,"name");l(this,"type");l(this,"access");l(this,"readonly_");l(this,"initializer");l(this,"docs");l(this,"inlineDocs");l(this,"attributes");l(this,"inherited");this.name=ce(e),this.type=n,this.access=i,this.readonly_=s!=null?s:!1,this.initializer=u,this.docs=c,this.inlineDocs=m,this.attributes=d!=null?d:[],this.inherited=h!=null?h:!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 n=new L;n.addTag({tagType:"var",type:this.type,name:this.name,docs:this.docs}),n.write(e)}writeAttributesIfPresent(e){this.attributes.length>0&&(e.write("#["),this.attributes.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.writeLine("]"))}};o();a();var Re=class extends w{constructor({entries:e,multiline:n}){super();l(this,"entries");l(this,"multiline");this.entries=e!=null?e:[],this.multiline=n!=null?n:!1}write(e){if(this.multiline){this.writeMultiline(e);return}this.writeCompact(e)}writeMultiline(e){e.writeLine("["),e.indent();for(let{key:n,value:i}of this.entries)n.write(e),e.write(" => "),i.write(e),e.writeLine(",");e.dedent(),e.write("]")}writeCompact(e){e.write("[");for(let[n,{key:i,value:s}]of this.entries.entries())n>0&&e.write(", "),i.write(e),e.write(" => "),s.write(e);e.write("]")}};o();a();var Ce=class extends w{constructor({name:e,namespace:n,docs:i,traits:s}){super();l(this,"name");l(this,"namespace");l(this,"docs");l(this,"traits");l(this,"fields",[]);l(this,"methods",[]);this.name=e,this.namespace=n,this.docs=i,this.traits=s!=null?s:[]}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((n,i)=>{i>0&&e.write(","),e.writeNode(n)}),e.writeTextStatement(""),e.newLine()),this.writeFields({writer:e,fields:me(this.fields)}),this.fields.length>0&&this.methods.length>0&&e.newLine(),this.writeMethods({writer:e,methods:me(this.methods)}),e.dedent(),e.writeLine("}")}writeComment(e){let n=new L({docs:this.docs});for(let i of this.fields)n.addTag({tagType:"property",type:i.type,name:i.name});n.write(e)}writeFields({writer:e,fields:n}){n.forEach((i,s)=>{s>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}writeMethods({writer:e,methods:n}){n.forEach((i,s)=>{s>0&&e.newLine(),i.write(e),e.writeNewLineIfLastLineNot()})}};o();a();var It=class extends w{constructor(e){super();l(this,"arrays");this.arrays=e}write(e){e.write("array_merge"),De({writer:e,arguments_:this.arrays.map(n=>Se(i=>{if(typeof n=="string"||n instanceof w){i.writeNodeOrString(n);return}i.writeNodeOrString(n.ref),n.fallback&&(i.write(" ?? "),i.writeNodeOrString(n.fallback))}))})}};function Sl(r){return new ve(r)}function Nl(r){return new Te(r)}function _l(r){return new Q(r)}function Il(r){return new Ce(r)}function Ll(r){return new S(r)}function Se(r){return new _(r)}function Pl(r){return new be(r)}function kl(r){return new Ae(r)}function Ol(r){return new Ee(r)}function fo(r){return new G(r)}function Ul(r){return new te(r)}function Fl(r){return Se(t=>{t.write("throw "),t.writeNode(fo(r))})}function Bl(r){return new Re(r)}function Ml(r){return new re(r)}function Dl(r){return new ee(r)}function jl(r){return new Ye(r)}function $l(r,t){return Se(e=>{e.writeNodeOrString(r),e.write(" = "),e.writeNodeOrString(t)})}function Wl(r){return Se(ce(r))}function Vl(r){return Se(`"${r}"`)}function zl(...r){return new It(r)}function Qt(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\$/g,"\\$")}function Gl(){return new _(r=>{r.write("$this")})}o();a();function er(r){return to.has(r.toLowerCase())?`${r}_`:r}o();a();var Lt=class{constructor({context:t}){l(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?y.TypeLiteral.null():(this.context.errors.add({severity:T.Critical,message:"Expected non-null value, but got null"}),y.TypeLiteral.nop());if(t.value===void 0)return y.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?y.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:E(t.typeReference)}}convertLiteral({literalType:t,value:e}){switch(t.type){case"boolean":{let n=this.context.getValueAsBoolean({value:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.string(n)}default:E(t)}}convertList({list:t,value:e}){return Array.isArray(e)?y.TypeLiteral.list({values:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:T.Critical,message:`Expected array but got: ${typeof e}`}),y.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:T.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),y.TypeLiteral.nop()):y.TypeLiteral.map({entries:Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:t.key,value:n,as:"key"}),value:this.convert({typeReference:t.value,value:i})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:n}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:n});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:E(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(n==null)return y.TypeLiteral.nop();let i=n.singleDiscriminatedUnionType,s=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});return s==null?y.TypeLiteral.nop():y.TypeLiteral.reference(y.codeblock(u=>{u.writeNode(y.invokeMethod({on:y.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),method:this.context.getMethodName(i.discriminantValue.name),arguments_:this.convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:n,unionVariant:i,unionProperties:s}),static_:!0}))}))}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){switch(e.type){case"samePropertiesAsObject":{let n=this.context.resolveNamedType({typeId:e.typeId});if(n==null)return;let i=this.convertNamed({named:n,value:t.value});if(!i.isClass()){this.context.errors.add({severity:T.Critical,message:"Internal error; expected union value to be an object"});return}return i.asClassOrThrow().fields}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let n=this.context.getRecord(t.value);return n==null?[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:t.value})}]:[{name:this.context.getPropertyName(e.discriminantValue.name),value:this.convert({typeReference:e.typeReference,value:n[e.discriminantValue.wireValue]})}]}finally{this.context.errors.unscope()}case"noProperties":return[];default:E(e)}}convertDiscriminatedUnionVariantArgs({discriminatedUnionTypeInstance:t,unionVariant:e,unionProperties:n}){let i=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});if(e.type==="singleProperty"&&this.context.getRecord(t.value)==null&&n.length===1)return[...i,this.convert({typeReference:e.typeReference,value:t.value})];if(e.type==="samePropertiesAsObject"){let s=this.context.resolveNamedType({typeId:e.typeId});return s==null?[]:[...i,y.TypeLiteral.class_({reference:y.classReference({name:this.context.getClassName(s.declaration.name),namespace:this.context.getTypesNamespace(s.declaration.fernFilepath)}),fields:n})]}return i}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i,s;return this.context.associateByWireValue({parameters:(i=e.properties)!=null?i:[],values:(s=this.context.getRecord(t.value))!=null?s:{},ignoreMissingParameters:!0}).map(u=>{this.context.errors.scope(u.name.wireValue);try{return this.convert(u)}finally{this.context.errors.unscope()}})}convertObject({object_:t,value:e}){var i;let n=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return y.TypeLiteral.class_({reference:y.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)}),fields:n.map(s=>{this.context.errors.scope(s.name.wireValue);try{return{name:this.context.getPropertyName(s.name.name),value:this.convert(s)}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let n=this.getEnumValueName({enum_:t,value:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.reference(y.codeblock(i=>{i.writeNode(y.classReference({name:this.context.getClassName(t.declaration.name),namespace:this.context.getTypesNamespace(t.declaration.fernFilepath)})),i.write("::"),i.write(n),i.write("->value")}))}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:T.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let n=t.values.find(i=>i.wireValue===e);if(n==null){this.context.errors.add({severity:T.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getClassName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return n==null?y.TypeLiteral.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{return this.convert({typeReference:n,value:e})}catch(i){continue}this.context.errors.add({severity:T.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown({value:t}){return y.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:n}){switch(t){case"INTEGER":case"LONG":case"UINT":case"UINT_64":{let i=this.getValueAsNumber({value:e,as:n});return i==null?y.TypeLiteral.nop():y.TypeLiteral.number(i)}case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e});return i==null?y.TypeLiteral.nop():y.TypeLiteral.float(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:n});return i==null?y.TypeLiteral.nop():y.TypeLiteral.boolean(i)}case"DATE":case"DATE_TIME":{let i=this.context.getValueAsString({value:e});return i==null?y.TypeLiteral.nop():y.TypeLiteral.datetime(i)}case"BASE_64":case"UUID":case"BIG_INTEGER":case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?y.TypeLiteral.nop():y.TypeLiteral.string(i)}default:E(t)}}getValueAsNumber({value:t,as:e}){let n=e==="key"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:t,as:e}){let n=e==="key"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:n})}};o();a();var Pt=class{constructor({context:t}){l(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var s;let n={fileFields:[],bodyPropertyFields:[]},i=(s=this.context.getRecord(e))!=null?s:{};for(let u of t.properties)switch(u.type){case"file":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getSingleFileProperty({property:u,record:i})});break;case"fileArray":n.fileFields.push({name:this.context.getPropertyName(u.name),value:this.getArrayFileProperty({property:u,record:i})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getPropertyName(u.name.name),value:this.getBodyProperty({property:u,record:i})});break;default:E(u)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.file(n)}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return n==null?y.TypeLiteral.nop():y.TypeLiteral.list({values:n.map(i=>y.TypeLiteral.file(i))})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?y.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:n})}};var Yl=["use","clone","list"],ql="Requests",Hl="Types",tr=class r extends Ke{constructor({ir:e,config:n}){var i;super({ir:e,config:n});l(this,"ir");l(this,"customConfig");l(this,"dynamicTypeLiteralMapper");l(this,"filePropertyMapper");l(this,"rootNamespace");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeLiteralMapper=new Lt({context:this}),this.filePropertyMapper=new Pt({context:this}),this.rootNamespace=Kl({organization:n.organization,namespaceOverride:(i=this.customConfig)==null?void 0:i.namespace})}clone(){return new r({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 n=e.camelCase.unsafeName;return Yl.includes(n)?n:e.camelCase.safeName}getClassName(e){return er(e.pascalCase.safeName)}getRootClientClassName(){var e,n,i;return((e=this.customConfig)==null?void 0:e.clientName)!=null?this.customConfig.clientName:((n=this.customConfig)==null?void 0:n["client-class-name"])!=null?(i=this.customConfig)==null?void 0:i["client-class-name"]:this.getComputedClientName()}getEnvironmentsClassReference(){return y.classReference({name:"Environments",namespace:this.rootNamespace})}getRequestNamespace(e){return this.getNamespace(e,ql)}getTypesNamespace(e){return this.getNamespace(e,Hl)}getNamespace(e,n){let i=e.allParts.map(s=>s.pascalCase.safeName);return i=n!=null?[...i,n]:i,[this.rootNamespace,...i].join("\\")}getEnvironmentClassAccessFromID(e){let n=this.resolveEnvironmentName(e);if(n!=null)return y.codeblock(i=>{i.writeNode(this.getEnvironmentClassReference(n)),i.write("::"),i.write(this.getClassName(n))})}getEnvironmentClassReference(e){return y.classReference({name:"Environments",namespace:this.rootNamespace})}prependUnderscoreIfNeeded(e){return/^[a-zA-Z_]/.test(e)?e:`_${e}`}getComputedClientName(){return`${this.getOrganizationPascalCase()}Client`}getOrganizationPascalCase(){return`${Ue(yt(this.config.organization))}`}};function Kl({organization:r,namespaceOverride:t}){return t!=null?t:`${Ue(yt(r))}`}0&&(module.exports={DynamicSnippetsGeneratorContext});
|
|
19
26
|
/*! Bundled license information:
|
|
20
27
|
|
|
21
28
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|