@fern-api/swift-dynamic-snippets 0.1.1 → 0.26.0
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/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +145 -0
- package/dist/index.d.ts +145 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/package.json +11 -12
- package/cjs/Config.cjs +0 -12
- package/cjs/Config.cjs.map +0 -1
- package/cjs/Config.d.cts +0 -4
- package/cjs/DynamicSnippetsGenerator.cjs +0 -41
- package/cjs/DynamicSnippetsGenerator.cjs.map +0 -1
- package/cjs/DynamicSnippetsGenerator.d.cts +0 -18
- package/cjs/EndpointSnippetGenerator.cjs +0 -41
- package/cjs/EndpointSnippetGenerator.cjs.map +0 -1
- package/cjs/EndpointSnippetGenerator.d.cts +0 -54
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs +0 -41
- package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +0 -1
- package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +0 -4
- package/cjs/context/DynamicTypeLiteralMapper.cjs +0 -41
- package/cjs/context/DynamicTypeLiteralMapper.cjs.map +0 -1
- package/cjs/context/DynamicTypeLiteralMapper.d.cts +0 -4
- package/cjs/context/DynamicTypeMapper.cjs +0 -41
- package/cjs/context/DynamicTypeMapper.cjs.map +0 -1
- package/cjs/context/DynamicTypeMapper.d.cts +0 -4
- package/cjs/context/FilePropertyMapper.cjs +0 -41
- package/cjs/context/FilePropertyMapper.cjs.map +0 -1
- package/cjs/context/FilePropertyMapper.d.cts +0 -4
- package/cjs/context/index.cjs +0 -41
- package/cjs/context/index.cjs.map +0 -1
- package/cjs/context/index.d.cts +0 -4
- package/cjs/index-DS-GXEiz.d.cts +0 -89
- package/cjs/index.cjs +0 -53
- package/cjs/index.cjs.map +0 -1
- package/cjs/index.d.cts +0 -7
- package/cjs/util/pascal-case.cjs +0 -23
- package/cjs/util/pascal-case.cjs.map +0 -1
- package/cjs/util/pascal-case.d.cts +0 -3
- package/esm/Config.d.ts +0 -4
- package/esm/Config.js +0 -2
- package/esm/Config.js.map +0 -1
- package/esm/DynamicSnippetsGenerator.d.ts +0 -18
- package/esm/DynamicSnippetsGenerator.js +0 -2
- package/esm/DynamicSnippetsGenerator.js.map +0 -1
- package/esm/EndpointSnippetGenerator.d.ts +0 -54
- package/esm/EndpointSnippetGenerator.js +0 -2
- package/esm/EndpointSnippetGenerator.js.map +0 -1
- package/esm/chunk-2M2RBZK2.js +0 -2
- package/esm/chunk-2M2RBZK2.js.map +0 -1
- package/esm/chunk-6DFEQNIA.js +0 -2
- package/esm/chunk-6DFEQNIA.js.map +0 -1
- package/esm/chunk-7RC2HH3P.js +0 -2
- package/esm/chunk-7RC2HH3P.js.map +0 -1
- package/esm/chunk-FX6IFKZ7.js +0 -2
- package/esm/chunk-FX6IFKZ7.js.map +0 -1
- package/esm/chunk-HTU5V5TT.js +0 -2
- package/esm/chunk-HTU5V5TT.js.map +0 -1
- package/esm/chunk-IHG2VZKL.js +0 -2
- package/esm/chunk-IHG2VZKL.js.map +0 -1
- package/esm/chunk-JFTYS7SI.js +0 -20
- package/esm/chunk-JFTYS7SI.js.map +0 -1
- package/esm/chunk-KIHSBETU.js +0 -2
- package/esm/chunk-KIHSBETU.js.map +0 -1
- package/esm/chunk-PJTPV2D6.js +0 -15
- package/esm/chunk-PJTPV2D6.js.map +0 -1
- package/esm/chunk-PYMG6Y4R.js +0 -12
- package/esm/chunk-PYMG6Y4R.js.map +0 -1
- package/esm/chunk-WG3NZOM6.js +0 -2
- package/esm/chunk-WG3NZOM6.js.map +0 -1
- package/esm/chunk-WXHVUJ6D.js +0 -2
- package/esm/chunk-WXHVUJ6D.js.map +0 -1
- package/esm/chunk-ZIQ5ITTV.js +0 -2
- package/esm/chunk-ZIQ5ITTV.js.map +0 -1
- package/esm/context/DynamicSnippetsGeneratorContext.d.ts +0 -4
- package/esm/context/DynamicSnippetsGeneratorContext.js +0 -2
- package/esm/context/DynamicSnippetsGeneratorContext.js.map +0 -1
- package/esm/context/DynamicTypeLiteralMapper.d.ts +0 -4
- package/esm/context/DynamicTypeLiteralMapper.js +0 -2
- package/esm/context/DynamicTypeLiteralMapper.js.map +0 -1
- package/esm/context/DynamicTypeMapper.d.ts +0 -4
- package/esm/context/DynamicTypeMapper.js +0 -2
- package/esm/context/DynamicTypeMapper.js.map +0 -1
- package/esm/context/FilePropertyMapper.d.ts +0 -4
- package/esm/context/FilePropertyMapper.js +0 -2
- package/esm/context/FilePropertyMapper.js.map +0 -1
- package/esm/context/index.d.ts +0 -4
- package/esm/context/index.js +0 -2
- package/esm/context/index.js.map +0 -1
- package/esm/index-DS-GXEiz.d.ts +0 -89
- package/esm/index.d.ts +0 -7
- package/esm/index.js +0 -14
- package/esm/index.js.map +0 -1
- package/esm/util/pascal-case.d.ts +0 -3
- package/esm/util/pascal-case.js +0 -2
- package/esm/util/pascal-case.js.map +0 -1
package/cjs/context/index.d.cts
DELETED
package/cjs/index-DS-GXEiz.d.cts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { AbstractDynamicSnippetsGeneratorContext, FernGeneratorExec, Options } from '@fern-api/browser-compatible-base-generator';
|
|
2
|
-
import { FernIr } from '@fern-api/dynamic-ir-sdk';
|
|
3
|
-
import { swift, BaseSwiftCustomConfigSchema } from '@fern-api/swift-codegen';
|
|
4
|
-
|
|
5
|
-
declare namespace DynamicTypeLiteralMapper {
|
|
6
|
-
interface Args {
|
|
7
|
-
typeReference: FernIr.dynamic.TypeReference;
|
|
8
|
-
value: unknown;
|
|
9
|
-
as?: ConvertedAs;
|
|
10
|
-
}
|
|
11
|
-
type ConvertedAs = "mapKey" | "mapValue";
|
|
12
|
-
}
|
|
13
|
-
declare class DynamicTypeLiteralMapper {
|
|
14
|
-
private context;
|
|
15
|
-
constructor({ context }: {
|
|
16
|
-
context: DynamicSnippetsGeneratorContext;
|
|
17
|
-
});
|
|
18
|
-
convert(args: DynamicTypeLiteralMapper.Args): swift.Expression;
|
|
19
|
-
private convertList;
|
|
20
|
-
private convertMap;
|
|
21
|
-
private convertNamed;
|
|
22
|
-
private convertNullable;
|
|
23
|
-
private convertDiscriminatedUnion;
|
|
24
|
-
private convertDiscriminatedUnionProperties;
|
|
25
|
-
private getBaseFields;
|
|
26
|
-
private convertEnum;
|
|
27
|
-
private getEnumValue;
|
|
28
|
-
private convertObject;
|
|
29
|
-
private convertUndiscriminatedUnion;
|
|
30
|
-
private findMatchingUndiscriminatedUnionType;
|
|
31
|
-
private convertUnknown;
|
|
32
|
-
private convertPrimitive;
|
|
33
|
-
private getValueAsNumber;
|
|
34
|
-
private getValueAsBoolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare namespace DynamicTypeMapper {
|
|
38
|
-
interface Args {
|
|
39
|
-
typeReference: FernIr.dynamic.TypeReference;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
declare class DynamicTypeMapper {
|
|
43
|
-
private context;
|
|
44
|
-
constructor({ context }: {
|
|
45
|
-
context: DynamicSnippetsGeneratorContext;
|
|
46
|
-
});
|
|
47
|
-
convert(args: DynamicTypeMapper.Args): swift.Type;
|
|
48
|
-
private convertNamed;
|
|
49
|
-
private convertLiteral;
|
|
50
|
-
private convertUnknown;
|
|
51
|
-
private convertPrimitive;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface FilePropertyInfo {
|
|
55
|
-
fileFields: swift.FunctionArgument[];
|
|
56
|
-
bodyPropertyFields: swift.FunctionArgument[];
|
|
57
|
-
}
|
|
58
|
-
declare class FilePropertyMapper {
|
|
59
|
-
private context;
|
|
60
|
-
constructor({ context }: {
|
|
61
|
-
context: DynamicSnippetsGeneratorContext;
|
|
62
|
-
});
|
|
63
|
-
getFilePropertyInfo({ body, value }: {
|
|
64
|
-
body: FernIr.dynamic.FileUploadRequestBody;
|
|
65
|
-
value: unknown;
|
|
66
|
-
}): FilePropertyInfo;
|
|
67
|
-
private getSingleFileProperty;
|
|
68
|
-
private getArrayFileProperty;
|
|
69
|
-
private getBodyProperty;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext {
|
|
73
|
-
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
74
|
-
customConfig: BaseSwiftCustomConfigSchema | undefined;
|
|
75
|
-
dynamicTypeMapper: DynamicTypeMapper;
|
|
76
|
-
dynamicTypeLiteralMapper: DynamicTypeLiteralMapper;
|
|
77
|
-
filePropertyMapper: FilePropertyMapper;
|
|
78
|
-
constructor({ ir, config, options }: {
|
|
79
|
-
ir: FernIr.dynamic.DynamicIntermediateRepresentation;
|
|
80
|
-
config: FernGeneratorExec.GeneratorConfig;
|
|
81
|
-
options?: Options;
|
|
82
|
-
});
|
|
83
|
-
clone(): DynamicSnippetsGeneratorContext;
|
|
84
|
-
getModuleName(): string;
|
|
85
|
-
getRootClientClassName(): string;
|
|
86
|
-
private getApiName;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export { DynamicSnippetsGeneratorContext as D, type FilePropertyInfo as F, DynamicTypeLiteralMapper as a, DynamicTypeMapper as b, FilePropertyMapper as c };
|
package/cjs/index.cjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";var Wf=Object.create;var lt=Object.defineProperty,jf=Object.defineProperties,zf=Object.getOwnPropertyDescriptor,Vf=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertyNames,jt=Object.getOwnPropertySymbols,Yf=Object.getPrototypeOf,tn=Object.prototype.hasOwnProperty,Bi=Object.prototype.propertyIsEnumerable;var en=(r,t,e)=>t in r?lt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,N=(r,t)=>{for(var e in t||(t={}))tn.call(t,e)&&en(r,e,t[e]);if(jt)for(var e of jt(t))Bi.call(t,e)&&en(r,e,t[e]);return r},qi=(r,t)=>jf(r,Vf(t));var Mi=r=>typeof r=="symbol"?r:r+"",Di=(r,t)=>{var e={};for(var n in r)tn.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&jt)for(var n of jt(r))t.indexOf(n)<0&&Bi.call(r,n)&&(e[n]=r[n]);return e};var Oe=(r,t)=>()=>(r&&(t=r(r=0)),t);var h=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ft=(r,t)=>{for(var e in t)lt(r,e,{get:t[e],enumerable:!0})},Ui=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gf(t))!tn.call(r,i)&&i!==e&<(r,i,{get:()=>t[i],enumerable:!(n=zf(t,i))||n.enumerable});return r};var ki=(r,t,e)=>(e=r!=null?Wf(Yf(r)):{},Ui(t||!r||!r.__esModule?lt(e,"default",{value:r,enumerable:!0}):e,r)),$i=r=>Ui(lt({},"__esModule",{value:!0}),r);var d=(r,t,e)=>en(r,typeof t!="symbol"?t+"":t,e);function Wi(){throw new Error("setTimeout has not been defined")}function ji(){throw new Error("clearTimeout has not been defined")}function zi(r){if(ae===setTimeout)return setTimeout(r,0);if((ae===Wi||!ae)&&setTimeout)return ae=setTimeout,setTimeout(r,0);try{return ae(r,0)}catch(t){try{return ae.call(null,r,0)}catch(e){return ae.call(this,r,0)}}}function Hf(r){if(se===clearTimeout)return clearTimeout(r);if((se===ji||!se)&&clearTimeout)return se=clearTimeout,clearTimeout(r);try{return se(r)}catch(t){try{return se.call(null,r)}catch(e){return se.call(this,r)}}}function Kf(){!Ce||!ge||(Ce=!1,ge.length?Q=ge.concat(Q):zt=-1,Q.length&&Vi())}function Vi(){if(!Ce){var r=zi(Kf);Ce=!0;for(var t=Q.length;t;){for(ge=Q,Q=[];++zt<t;)ge&&ge[zt].run();zt=-1,t=Q.length}ge=null,Ce=!1,Hf(r)}}function Jf(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];Q.push(new Gi(r,t)),Q.length===1&&!Ce&&zi(Vi)}function Gi(r,t){this.fun=r,this.array=t}function xe(){}function dp(r){throw new Error("process.binding is not supported")}function mp(){return"/"}function yp(r){throw new Error("process.chdir is not supported")}function hp(){return 0}function xp(r){var t=gp.call(Le)*.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 wp(){var r=new Date,t=r-vp;return t/1e3}var ae,se,Q,Ce,ge,zt,Zf,Xf,Qf,ep,tp,rp,np,ip,op,ap,sp,up,lp,fp,pp,cp,Le,gp,vp,c,_i,a=Oe(()=>{"use strict";ae=Wi,se=ji;typeof globalThis.setTimeout=="function"&&(ae=setTimeout);typeof globalThis.clearTimeout=="function"&&(se=clearTimeout);Q=[],Ce=!1,zt=-1;Gi.prototype.run=function(){this.fun.apply(null,this.array)};Zf="browser",Xf="browser",Qf=!0,ep={},tp=[],rp="",np={},ip={},op={};ap=xe,sp=xe,up=xe,lp=xe,fp=xe,pp=xe,cp=xe;Le=globalThis.performance||{},gp=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};vp=new Date;c={nextTick:Jf,title:Zf,browser:Qf,env:ep,argv:tp,version:rp,versions:np,on:ap,addListener:sp,once:up,off:lp,removeListener:fp,removeAllListeners:pp,emit:cp,binding:dp,cwd:mp,chdir:yp,umask:hp,hrtime:xp,platform:Xf,release:ip,config:op,uptime:wp},_i={};Object.keys(_i).forEach(r=>{let t=r.split("."),e=c;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=_i[r]:e=e[i]||(e[i]={})}})});function Ji(){nn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)z[t]=r[t],$[r.charCodeAt(t)]=t;$[45]=62,$[95]=63}function Sp(r){nn||Ji();var t,e,n,i,o,u,f=r.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=r[f-2]==="="?2:r[f-1]==="="?1:0,u=new bp(f*3/4-o),n=o>0?f-4:f;var p=0;for(t=0,e=0;t<n;t+=4,e+=3)i=$[r.charCodeAt(t)]<<18|$[r.charCodeAt(t+1)]<<12|$[r.charCodeAt(t+2)]<<6|$[r.charCodeAt(t+3)],u[p++]=i>>16&255,u[p++]=i>>8&255,u[p++]=i&255;return o===2?(i=$[r.charCodeAt(t)]<<2|$[r.charCodeAt(t+1)]>>4,u[p++]=i&255):o===1&&(i=$[r.charCodeAt(t)]<<10|$[r.charCodeAt(t+1)]<<4|$[r.charCodeAt(t+2)]>>2,u[p++]=i>>8&255,u[p++]=i&255),u}function Ep(r){return z[r>>18&63]+z[r>>12&63]+z[r>>6&63]+z[r&63]}function Tp(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16)+(r[o+1]<<8)+r[o+2],i.push(Ep(n));return i.join("")}function Yi(r){nn||Ji();for(var t,e=r.length,n=e%3,i="",o=[],u=16383,f=0,p=e-n;f<p;f+=u)o.push(Tp(r,f,f+u>p?p:f+u));return n===1?(t=r[e-1],i+=z[t>>2],i+=z[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=z[t>>10],i+=z[t>>4&63],i+=z[t<<2&63],i+="="),o.push(i),o.join("")}function Vt(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ee(r,t){if(Vt()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=l.prototype):(r===null&&(r=new l(t)),r.length=t),r}function l(r,t,e){if(!l.TYPED_ARRAY_SUPPORT&&!(this instanceof l))return new l(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 on(this,r)}return Zi(this,r,t,e)}function Zi(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?Np(r,t,e,n):typeof t=="string"?Ip(r,t,e):Rp(r,t)}function Xi(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 Ap(r,t,e,n){return Xi(t),t<=0?ee(r,t):e!==void 0?typeof n=="string"?ee(r,t).fill(e,n):ee(r,t).fill(e):ee(r,t)}function on(r,t){if(Xi(t),r=ee(r,t<0?0:an(t)|0),!l.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Ip(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!l.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Qi(t,e)|0;r=ee(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function rn(r,t){var e=t.length<0?0:an(t.length)|0;r=ee(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Np(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),l.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=l.prototype):r=rn(r,t),r}function Rp(r,t){if(V(t)){var e=an(t.length)|0;return r=ee(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"||Yp(t.length)?ee(r,0):rn(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return rn(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function an(r){if(r>=Vt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Vt().toString(16)+" bytes");return r|0}function V(r){return!!(r!=null&&r._isBuffer)}function Qi(r,t){if(V(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 Gt(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ao(r).length;default:if(n)return Gt(r).length;t=(""+t).toLowerCase(),n=!0}}function Op(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 kp(this,t,e);case"utf8":case"utf-8":return ro(this,t,e);case"ascii":return Dp(this,t,e);case"latin1":case"binary":return Up(this,t,e);case"base64":return qp(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $p(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function ve(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function eo(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=l.from(t,n)),V(t))return t.length===0?-1:Hi(r,t,e,n,i);if(typeof t=="number")return t=t&255,l.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Hi(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Hi(r,t,e,n,i){var o=1,u=r.length,f=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;o=2,u/=2,f/=2,e/=2}function p(A,R){return o===1?A[R]:A.readUInt16BE(R*o)}var y;if(i){var g=-1;for(y=e;y<u;y++)if(p(r,y)===p(t,g===-1?0:y-g)){if(g===-1&&(g=y),y-g+1===f)return g*o}else g!==-1&&(y-=y-g),g=-1}else for(e+f>u&&(e=u-f),y=e;y>=0;y--){for(var x=!0,v=0;v<f;v++)if(p(r,y+v)!==p(t,v)){x=!1;break}if(x)return y}return-1}function Lp(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(t.substr(u*2,2),16);if(isNaN(f))return u;r[e+u]=f}return u}function Cp(r,t,e,n){return Kt(Gt(t,r.length-e),r,e,n)}function to(r,t,e,n){return Kt(Vp(t),r,e,n)}function Pp(r,t,e,n){return to(r,t,e,n)}function Fp(r,t,e,n){return Kt(ao(t),r,e,n)}function Bp(r,t,e,n){return Kt(Gp(t,r.length-e),r,e,n)}function qp(r,t,e){return t===0&&e===r.length?Yi(r):Yi(r.slice(t,e))}function ro(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var o=r[i],u=null,f=o>239?4:o>223?3:o>191?2:1;if(i+f<=e){var p,y,g,x;switch(f){case 1:o<128&&(u=o);break;case 2:p=r[i+1],(p&192)===128&&(x=(o&31)<<6|p&63,x>127&&(u=x));break;case 3:p=r[i+1],y=r[i+2],(p&192)===128&&(y&192)===128&&(x=(o&15)<<12|(p&63)<<6|y&63,x>2047&&(x<55296||x>57343)&&(u=x));break;case 4:p=r[i+1],y=r[i+2],g=r[i+3],(p&192)===128&&(y&192)===128&&(g&192)===128&&(x=(o&15)<<18|(p&63)<<12|(y&63)<<6|g&63,x>65535&&x<1114112&&(u=x))}}u===null?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=f}return Mp(n)}function Mp(r){var t=r.length;if(t<=Ki)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Ki));return e}function Dp(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 Up(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 kp(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=t;o<e;++o)i+=zp(r[o]);return i}function $p(r,t,e){for(var n=r.slice(t,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function L(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 D(r,t,e,n,i,o){if(!V(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function Yt(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(r.length-e,2);i<o;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function Ht(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(r.length-e,4);i<o;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function no(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function io(r,t,e,n,i){return i||no(r,t,e,4,34028234663852886e22,-34028234663852886e22),uo(r,t,e,n,23,4),e+4}function oo(r,t,e,n,i){return i||no(r,t,e,8,17976931348623157e292,-17976931348623157e292),uo(r,t,e,n,52,8),e+8}function Wp(r){if(r=jp(r).replace(_p,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function jp(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function zp(r){return r<16?"0"+r.toString(16):r.toString(16)}function Gt(r,t){t=t||1/0;for(var e,n=r.length,i=null,o=[],u=0;u<n;++u){if(e=r.charCodeAt(u),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Vp(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Gp(r,t){for(var e,n,i,o=[],u=0;u<r.length&&!((t-=2)<0);++u)e=r.charCodeAt(u),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ao(r){return Sp(Wp(r))}function Kt(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 Yp(r){return r!==r}function Hp(r){return r!=null&&(!!r._isBuffer||so(r)||Kp(r))}function so(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Kp(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&so(r.slice(0,0))}function Jt(r,t,e,n,i){var o,u,f=i*8-n-1,p=(1<<f)-1,y=p>>1,g=-7,x=e?i-1:0,v=e?-1:1,A=r[t+x];for(x+=v,o=A&(1<<-g)-1,A>>=-g,g+=f;g>0;o=o*256+r[t+x],x+=v,g-=8);for(u=o&(1<<-g)-1,o>>=-g,g+=n;g>0;u=u*256+r[t+x],x+=v,g-=8);if(o===0)o=1-y;else{if(o===p)return u?NaN:(A?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-y}return(A?-1:1)*u*Math.pow(2,o-n)}function uo(r,t,e,n,i,o){var u,f,p,y=o*8-i-1,g=(1<<y)-1,x=g>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:o-1,R=n?1:-1,I=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,u=g):(u=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-u))<1&&(u--,p*=2),u+x>=1?t+=v/p:t+=v*Math.pow(2,1-x),t*p>=2&&(u++,p/=2),u+x>=g?(f=0,u=g):u+x>=1?(f=(t*p-1)*Math.pow(2,i),u=u+x):(f=t*Math.pow(2,x-1)*Math.pow(2,i),u=0));i>=8;r[e+A]=f&255,A+=R,f/=256,i-=8);for(u=u<<i|f,y+=i;y>0;r[e+A]=u&255,A+=R,u/=256,y-=8);r[e+A-R]|=I*128}var z,$,bp,nn,Ki,_p,lo=Oe(()=>{"use strict";a();s();z=[],$=[],bp=typeof Uint8Array!="undefined"?Uint8Array:Array,nn=!1;l.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;l.poolSize=8192;l._augment=function(r){return r.__proto__=l.prototype,r};l.from=function(r,t,e){return Zi(null,r,t,e)};l.kMaxLength=Vt();l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&l[Symbol.species]);l.alloc=function(r,t,e){return Ap(null,r,t,e)};l.allocUnsafe=function(r){return on(null,r)};l.allocUnsafeSlow=function(r){return on(null,r)};l.isBuffer=Hp;l.compare=function(t,e){if(!V(t)||!V(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,o=0,u=Math.min(n,i);o<u;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};l.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}};l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return l.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=l.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var u=t[n];if(!V(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i};l.byteLength=Qi;l.prototype._isBuffer=!0;l.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)ve(this,e,e+1);return this};l.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)ve(this,e,e+3),ve(this,e+1,e+2);return this};l.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)ve(this,e,e+7),ve(this,e+1,e+6),ve(this,e+2,e+5),ve(this,e+3,e+4);return this};l.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?ro(this,0,t):Op.apply(this,arguments)};l.prototype.equals=function(t){if(!V(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:l.compare(this,t)===0};l.prototype.compare=function(t,e,n,i,o){if(!V(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),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var u=o-i,f=n-e,p=Math.min(u,f),y=this.slice(i,o),g=t.slice(e,n),x=0;x<p;++x)if(y[x]!==g[x]){u=y[x],f=g[x];break}return u<f?-1:f<u?1:0};l.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};l.prototype.indexOf=function(t,e,n){return eo(this,t,e,n,!0)};l.prototype.lastIndexOf=function(t,e,n){return eo(this,t,e,n,!1)};l.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 o=this.length-e;if((n===void 0||n>o)&&(n=o),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 Lp(this,t,e,n);case"utf8":case"utf-8":return Cp(this,t,e,n);case"ascii":return to(this,t,e,n);case"latin1":case"binary":return Pp(this,t,e,n);case"base64":return Fp(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bp(this,t,e,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ki=4096;l.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(l.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=l.prototype;else{var o=e-t;i=new l(o,void 0);for(var u=0;u<o;++u)i[u]=this[u+t]}return i};l.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=this[t],o=1,u=0;++u<e&&(o*=256);)i+=this[t+u]*o;return i};l.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=this[t+--e],o=1;e>0&&(o*=256);)i+=this[t+--e]*o;return i};l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]};l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8};l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]};l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};l.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=this[t],o=1,u=0;++u<e&&(o*=256);)i+=this[t+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};l.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||L(t,e,this.length);for(var i=e,o=1,u=this[t+--i];i>0&&(o*=256);)u+=this[t+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*e)),u};l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),Jt(this,t,!0,23,4)};l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),Jt(this,t,!1,23,4)};l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),Jt(this,t,!0,52,8)};l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),Jt(this,t,!1,52,8)};l.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;D(this,t,e,n,o,0)}var u=1,f=0;for(this[e]=t&255;++f<n&&(u*=256);)this[e+f]=t/u&255;return e+n};l.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;D(this,t,e,n,o,0)}var u=n-1,f=1;for(this[e+u]=t&255;--u>=0&&(f*=256);)this[e+u]=t/f&255;return e+n};l.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Yt(this,t,e,!0),e+2};l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Yt(this,t,e,!1),e+2};l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):Ht(this,t,e,!0),e+4};l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Ht(this,t,e,!1),e+4};l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);D(this,t,e,n,o-1,-o)}var u=0,f=1,p=0;for(this[e]=t&255;++u<n&&(f*=256);)t<0&&p===0&&this[e+u-1]!==0&&(p=1),this[e+u]=(t/f>>0)-p&255;return e+n};l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var o=Math.pow(2,8*n-1);D(this,t,e,n,o-1,-o)}var u=n-1,f=1,p=0;for(this[e+u]=t&255;--u>=0&&(f*=256);)t<0&&p===0&&this[e+u+1]!==0&&(p=1),this[e+u]=(t/f>>0)-p&255;return e+n};l.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};l.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Yt(this,t,e,!0),e+2};l.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Yt(this,t,e,!1),e+2};l.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Ht(this,t,e,!0),e+4};l.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Ht(this,t,e,!1),e+4};l.prototype.writeFloatLE=function(t,e,n){return io(this,t,e,!0,n)};l.prototype.writeFloatBE=function(t,e,n){return io(this,t,e,!1,n)};l.prototype.writeDoubleLE=function(t,e,n){return oo(this,t,e,!0,n)};l.prototype.writeDoubleBE=function(t,e,n){return oo(this,t,e,!1,n)};l.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 o=i-n,u;if(this===t&&n<e&&e<i)for(u=o-1;u>=0;--u)t[u+e]=this[u+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(u=0;u<o;++u)t[u+e]=this[u+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o};l.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 o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!l.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 f=V(t)?t:Gt(new l(t,i).toString()),p=f.length;for(u=0;u<n-e;++u)this[u+e]=f[u%p]}return this};_p=/[^+\/0-9A-Za-z-_]/g});var s=Oe(()=>{"use strict";lo()});var sn=h((e0,fo)=>{"use strict";a();s();fo.exports=Object});var co=h((n0,po)=>{"use strict";a();s();po.exports=Error});var yo=h((a0,mo)=>{"use strict";a();s();mo.exports=EvalError});var go=h((l0,ho)=>{"use strict";a();s();ho.exports=RangeError});var vo=h((c0,xo)=>{"use strict";a();s();xo.exports=ReferenceError});var un=h((y0,wo)=>{"use strict";a();s();wo.exports=SyntaxError});var C=h((x0,bo)=>{"use strict";a();s();bo.exports=TypeError});var Eo=h((b0,So)=>{"use strict";a();s();So.exports=URIError});var ln=h((T0,To)=>{"use strict";a();s();To.exports=Math.abs});var fn=h((N0,Ao)=>{"use strict";a();s();Ao.exports=Math.floor});var No=h((L0,Io)=>{"use strict";a();s();Io.exports=Math.max});var pn=h((F0,Ro)=>{"use strict";a();s();Ro.exports=Math.min});var Lo=h((M0,Oo)=>{"use strict";a();s();Oo.exports=Math.pow});var Po=h((k0,Co)=>{"use strict";a();s();Co.exports=Math.round});var Zt=h((W0,Fo)=>{"use strict";a();s();Fo.exports=Number.isNaN||function(t){return t!==t}});var qo=h((V0,Bo)=>{"use strict";a();s();var Jp=Zt();Bo.exports=function(t){return Jp(t)||t===0?t:t<0?-1:1}});var Do=h((H0,Mo)=>{"use strict";a();s();Mo.exports=Object.getOwnPropertyDescriptor});var Pe=h((Z0,Uo)=>{"use strict";a();s();var Xt=Do();if(Xt)try{Xt([],"length")}catch(r){Xt=null}Uo.exports=Xt});var pt=h((ev,ko)=>{"use strict";a();s();var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch(r){Qt=!1}ko.exports=Qt});var cn=h((nv,$o)=>{"use strict";a();s();$o.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==i||f.enumerable!==!0)return!1}return!0}});var dn=h((av,Wo)=>{"use strict";a();s();var _o=typeof Symbol!="undefined"&&Symbol,Zp=cn();Wo.exports=function(){return typeof _o!="function"||typeof Symbol!="function"||typeof _o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Zp()}});var mn=h((lv,jo)=>{"use strict";a();s();jo.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var yn=h((cv,zo)=>{"use strict";a();s();var Xp=sn();zo.exports=Xp.getPrototypeOf||null});var Yo=h((yv,Go)=>{"use strict";a();s();var Qp="Function.prototype.bind called on incompatible ",ec=Object.prototype.toString,tc=Math.max,rc="[object Function]",Vo=function(t,e){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var o=0;o<e.length;o+=1)n[o+t.length]=e[o];return n},nc=function(t,e){for(var n=[],i=e||0,o=0;i<t.length;i+=1,o+=1)n[o]=t[i];return n},ic=function(r,t){for(var e="",n=0;n<r.length;n+=1)e+=r[n],n+1<r.length&&(e+=t);return e};Go.exports=function(t){var e=this;if(typeof e!="function"||ec.apply(e)!==rc)throw new TypeError(Qp+e);for(var n=nc(arguments,1),i,o=function(){if(this instanceof i){var g=e.apply(this,Vo(n,arguments));return Object(g)===g?g:this}return e.apply(t,Vo(n,arguments))},u=tc(0,e.length-n.length),f=[],p=0;p<u;p++)f[p]="$"+p;if(i=Function("binder","return function ("+ic(f,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var y=function(){};y.prototype=e.prototype,i.prototype=new y,y.prototype=null}return i}});var Fe=h((xv,Ho)=>{"use strict";a();s();var oc=Yo();Ho.exports=Function.prototype.bind||oc});var er=h((bv,Ko)=>{"use strict";a();s();Ko.exports=Function.prototype.call});var tr=h((Tv,Jo)=>{"use strict";a();s();Jo.exports=Function.prototype.apply});var Xo=h((Nv,Zo)=>{"use strict";a();s();Zo.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var hn=h((Lv,Qo)=>{"use strict";a();s();var ac=Fe(),sc=tr(),uc=er(),lc=Xo();Qo.exports=lc||ac.call(uc,sc)});var rr=h((Fv,ea)=>{"use strict";a();s();var fc=Fe(),pc=C(),cc=er(),dc=hn();ea.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new pc("a function is required");return dc(fc,cc,t)}});var aa=h((Mv,oa)=>{"use strict";a();s();var mc=rr(),ta=Pe(),na;try{na=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var gn=!!na&&ta&&ta(Object.prototype,"__proto__"),ia=Object,ra=ia.getPrototypeOf;oa.exports=gn&&typeof gn.get=="function"?mc([gn.get]):typeof ra=="function"?function(t){return ra(t==null?t:ia(t))}:!1});var pa=h((kv,fa)=>{"use strict";a();s();var sa=mn(),ua=yn(),la=aa();fa.exports=sa?function(t){return sa(t)}:ua?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ua(t)}:la?function(t){return la(t)}:null});var xn=h((Wv,ca)=>{"use strict";a();s();var yc=Function.prototype.call,hc=Object.prototype.hasOwnProperty,gc=Fe();ca.exports=gc.call(yc,hc)});var G=h((Vv,xa)=>{"use strict";a();s();var E,xc=sn(),vc=co(),wc=yo(),bc=go(),Sc=vo(),De=un(),Me=C(),Ec=Eo(),Tc=ln(),Ac=fn(),Ic=No(),Nc=pn(),Rc=Lo(),Oc=Po(),Lc=qo(),ha=Function,vn=function(r){try{return ha('"use strict"; return ('+r+").constructor;")()}catch(t){}},ct=Pe(),Cc=pt(),wn=function(){throw new Me},Pc=ct?(function(){try{return arguments.callee,wn}catch(r){try{return ct(arguments,"callee").get}catch(t){return wn}}})():wn,Be=dn()(),P=pa(),Fc=yn(),Bc=mn(),ga=tr(),dt=er(),qe={},qc=typeof Uint8Array=="undefined"||!P?E:P(Uint8Array),we={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?E:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?E:ArrayBuffer,"%ArrayIteratorPrototype%":Be&&P?P([][Symbol.iterator]()):E,"%AsyncFromSyncIteratorPrototype%":E,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics=="undefined"?E:Atomics,"%BigInt%":typeof BigInt=="undefined"?E:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?E:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?E:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?E:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vc,"%eval%":eval,"%EvalError%":wc,"%Float16Array%":typeof Float16Array=="undefined"?E:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?E:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?E:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?E:FinalizationRegistry,"%Function%":ha,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array=="undefined"?E:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?E:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?E:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Be&&P?P(P([][Symbol.iterator]())):E,"%JSON%":typeof JSON=="object"?JSON:E,"%Map%":typeof Map=="undefined"?E:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Be||!P?E:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":xc,"%Object.getOwnPropertyDescriptor%":ct,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?E:Promise,"%Proxy%":typeof Proxy=="undefined"?E:Proxy,"%RangeError%":bc,"%ReferenceError%":Sc,"%Reflect%":typeof Reflect=="undefined"?E:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?E:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Be||!P?E:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?E:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Be&&P?P(""[Symbol.iterator]()):E,"%Symbol%":Be?Symbol:E,"%SyntaxError%":De,"%ThrowTypeError%":Pc,"%TypedArray%":qc,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array=="undefined"?E:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?E:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?E:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?E:Uint32Array,"%URIError%":Ec,"%WeakMap%":typeof WeakMap=="undefined"?E:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?E:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?E:WeakSet,"%Function.prototype.call%":dt,"%Function.prototype.apply%":ga,"%Object.defineProperty%":Cc,"%Object.getPrototypeOf%":Fc,"%Math.abs%":Tc,"%Math.floor%":Ac,"%Math.max%":Ic,"%Math.min%":Nc,"%Math.pow%":Rc,"%Math.round%":Oc,"%Math.sign%":Lc,"%Reflect.getPrototypeOf%":Bc};if(P)try{null.error}catch(r){da=P(P(r)),we["%Error.prototype%"]=da}var da,Mc=function r(t){var e;if(t==="%AsyncFunction%")e=vn("async function () {}");else if(t==="%GeneratorFunction%")e=vn("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=vn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&P&&(e=P(i.prototype))}return we[t]=e,e},ma={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},mt=Fe(),nr=xn(),Dc=mt.call(dt,Array.prototype.concat),Uc=mt.call(ga,Array.prototype.splice),ya=mt.call(dt,String.prototype.replace),ir=mt.call(dt,String.prototype.slice),kc=mt.call(dt,RegExp.prototype.exec),$c=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_c=/\\(\\)?/g,Wc=function(t){var e=ir(t,0,1),n=ir(t,-1);if(e==="%"&&n!=="%")throw new De("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new De("invalid intrinsic syntax, expected opening `%`");var i=[];return ya(t,$c,function(o,u,f,p){i[i.length]=f?ya(p,_c,"$1"):u||o}),i},jc=function(t,e){var n=t,i;if(nr(ma,n)&&(i=ma[n],n="%"+i[0]+"%"),nr(we,n)){var o=we[n];if(o===qe&&(o=Mc(n)),typeof o=="undefined"&&!e)throw new Me("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new De("intrinsic "+t+" does not exist!")};xa.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(kc(/^%?[^%]*%?$/,t)===null)throw new De("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Wc(t),i=n.length>0?n[0]:"",o=jc("%"+i+"%",e),u=o.name,f=o.value,p=!1,y=o.alias;y&&(i=y[0],Uc(n,Dc([0,1],y)));for(var g=1,x=!0;g<n.length;g+=1){var v=n[g],A=ir(v,0,1),R=ir(v,-1);if((A==='"'||A==="'"||A==="`"||R==='"'||R==="'"||R==="`")&&A!==R)throw new De("property names with quotes must have matching quotes");if((v==="constructor"||!x)&&(p=!0),i+="."+v,u="%"+i+"%",nr(we,u))f=we[u];else if(f!=null){if(!(v in f)){if(!e)throw new Me("base intrinsic for "+t+" exists, but the property is not available.");return}if(ct&&g+1>=n.length){var I=ct(f,v);x=!!I,x&&"get"in I&&!("originalValue"in I.get)?f=I.get:f=f[v]}else x=nr(f,v),f=f[v];x&&!p&&(we[u]=f)}}return f}});var or=h((Hv,ba)=>{"use strict";a();s();var va=pt(),zc=un(),Ue=C(),wa=Pe();ba.exports=function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Ue("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ue("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ue("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ue("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ue("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ue("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!wa&&wa(t,e);if(va)va(t,e,{configurable:u===null&&p?p.configurable:!u,enumerable:i===null&&p?p.enumerable:!i,value:n,writable:o===null&&p?p.writable:!o});else if(f||!i&&!o&&!u)t[e]=n;else throw new zc("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var ar=h((Zv,Ea)=>{"use strict";a();s();var bn=pt(),Sa=function(){return!!bn};Sa.hasArrayLengthDefineBug=function(){if(!bn)return null;try{return bn([],"length",{value:1}).length!==1}catch(t){return!0}};Ea.exports=Sa});var Ra=h((ew,Na)=>{"use strict";a();s();var Vc=G(),Ta=or(),Gc=ar()(),Aa=Pe(),Ia=C(),Yc=Vc("%Math.floor%");Na.exports=function(t,e){if(typeof t!="function")throw new Ia("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||Yc(e)!==e)throw new Ia("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in t&&Aa){var u=Aa(t,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(o=!1)}return(i||o||!n)&&(Gc?Ta(t,"length",e,!0,!0):Ta(t,"length",e)),t}});var La=h((nw,Oa)=>{"use strict";a();s();var Hc=Fe(),Kc=tr(),Jc=hn();Oa.exports=function(){return Jc(Hc,Kc,arguments)}});var ur=h((aw,sr)=>{"use strict";a();s();var Zc=Ra(),Ca=pt(),Xc=rr(),Pa=La();sr.exports=function(t){var e=Xc(arguments),n=t.length-(arguments.length-1);return Zc(e,1+(n>0?n:0),!0)};Ca?Ca(sr.exports,"apply",{value:Pa}):sr.exports.apply=Pa});var Sn=h((lw,Ba)=>{"use strict";a();s();var Fa=Object.prototype.toString;Ba.exports=function(t){var e=Fa.call(t),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Fa.call(t.callee)==="[object Function]"),n}});var ja=h((cw,Wa)=>{"use strict";a();s();var _a;Object.keys||(yt=Object.prototype.hasOwnProperty,En=Object.prototype.toString,qa=Sn(),Tn=Object.prototype.propertyIsEnumerable,Ma=!Tn.call({toString:null},"toString"),Da=Tn.call(function(){},"prototype"),ht=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lr=function(r){var t=r.constructor;return t&&t.prototype===r},Ua={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},ka=(function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!Ua["$"+r]&&yt.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{lr(window[r])}catch(t){return!0}}catch(t){return!0}return!1})(),$a=function(r){if(typeof window=="undefined"||!ka)return lr(r);try{return lr(r)}catch(t){return!1}},_a=function(t){var e=t!==null&&typeof t=="object",n=En.call(t)==="[object Function]",i=qa(t),o=e&&En.call(t)==="[object String]",u=[];if(!e&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var f=Da&&n;if(o&&t.length>0&&!yt.call(t,0))for(var p=0;p<t.length;++p)u.push(String(p));if(i&&t.length>0)for(var y=0;y<t.length;++y)u.push(String(y));else for(var g in t)!(f&&g==="prototype")&&yt.call(t,g)&&u.push(String(g));if(Ma)for(var x=$a(t),v=0;v<ht.length;++v)!(x&&ht[v]==="constructor")&&yt.call(t,ht[v])&&u.push(ht[v]);return u});var yt,En,qa,Tn,Ma,Da,ht,lr,Ua,ka,$a;Wa.exports=_a});var Ya=h((yw,Ga)=>{"use strict";a();s();var Qc=Array.prototype.slice,ed=Sn(),za=Object.keys,fr=za?function(t){return za(t)}:ja(),Va=Object.keys;fr.shim=function(){if(Object.keys){var t=(function(){var e=Object.keys(arguments);return e&&e.length===arguments.length})(1,2);t||(Object.keys=function(n){return ed(n)?Va(Qc.call(n)):Va(n)})}else Object.keys=fr;return Object.keys||fr};Ga.exports=fr});var pr=h((xw,Za)=>{"use strict";a();s();var td=Ya(),rd=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",nd=Object.prototype.toString,id=Array.prototype.concat,Ha=or(),od=function(r){return typeof r=="function"&&nd.call(r)==="[object Function]"},Ka=ar()(),ad=function(r,t,e,n){if(t in r){if(n===!0){if(r[t]===e)return}else if(!od(n)||!n())return}Ka?Ha(r,t,e,!0):Ha(r,t,e)},Ja=function(r,t){var e=arguments.length>2?arguments[2]:{},n=td(t);rd&&(n=id.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)ad(r,n[i],t[n[i]],e[n[i]])};Ja.supportsDescriptors=!!Ka;Za.exports=Ja});var Y=h((bw,es)=>{"use strict";a();s();var Xa=G(),Qa=rr(),sd=Qa([Xa("%String.prototype.indexOf%")]);es.exports=function(t,e){var n=Xa(t,!!e);return typeof n=="function"&&sd(t,".prototype.")>-1?Qa([n]):n}});var ns=h((Tw,rs)=>{"use strict";a();s();var ud=G(),ts=ud("%Array%"),ld=!ts.isArray&&Y()("Object.prototype.toString");rs.exports=ts.isArray||function(t){return ld(t)==="[object Array]"}});var An=h((Nw,is)=>{"use strict";a();s();is.exports=ns()});var as=h((Lw,os)=>{"use strict";a();s();var fd=G(),pd=Y(),cd=C(),dd=An(),md=fd("%Reflect.apply%",!0)||pd("Function.prototype.apply");os.exports=function(t,e){var n=arguments.length>2?arguments[2]:[];if(!dd(n))throw new cd("Assertion failed: optional `argumentsList`, if provided, must be a List");return md(t,e,n)}});function ss(){throw new Error("setTimeout has not been defined")}function us(){throw new Error("clearTimeout has not been defined")}function ls(r){if(ue===setTimeout)return setTimeout(r,0);if((ue===ss||!ue)&&setTimeout)return ue=setTimeout,setTimeout(r,0);try{return ue(r,0)}catch(t){try{return ue.call(null,r,0)}catch(e){return ue.call(this,r,0)}}}function yd(r){if(le===clearTimeout)return clearTimeout(r);if((le===us||!le)&&clearTimeout)return le=clearTimeout,clearTimeout(r);try{return le(r)}catch(t){try{return le.call(null,r)}catch(e){return le.call(this,r)}}}function hd(){!$e||!be||($e=!1,be.length?te=be.concat(te):cr=-1,te.length&&fs())}function fs(){if(!$e){var r=ls(hd);$e=!0;for(var t=te.length;t;){for(be=te,te=[];++cr<t;)be&&be[cr].run();cr=-1,t=te.length}be=null,$e=!1,yd(r)}}function gd(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];te.push(new ps(r,t)),te.length===1&&!$e&&ls(fs)}function ps(r,t){this.fun=r,this.array=t}function Se(){}function Bd(r){throw new Error("process.binding is not supported")}function qd(){return"/"}function Md(r){throw new Error("process.chdir is not supported")}function Dd(){return 0}function kd(r){var t=Ud.call(ke)*.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 _d(){var r=new Date,t=r-$d;return t/1e3}var ue,le,te,$e,be,cr,xd,vd,wd,bd,Sd,Ed,Td,Ad,Id,Nd,Rd,Od,Ld,Cd,Pd,Fd,ke,Ud,$d,Wd,gt,cs=Oe(()=>{"use strict";a();s();ue=ss,le=us;typeof globalThis.setTimeout=="function"&&(ue=setTimeout);typeof globalThis.clearTimeout=="function"&&(le=clearTimeout);te=[],$e=!1,cr=-1;ps.prototype.run=function(){this.fun.apply(null,this.array)};xd="browser",vd="browser",wd=!0,bd={},Sd=[],Ed="",Td={},Ad={},Id={};Nd=Se,Rd=Se,Od=Se,Ld=Se,Cd=Se,Pd=Se,Fd=Se;ke=globalThis.performance||{},Ud=ke.now||ke.mozNow||ke.msNow||ke.oNow||ke.webkitNow||function(){return new Date().getTime()};$d=new Date;Wd={nextTick:gd,title:xd,browser:wd,env:bd,argv:Sd,version:Ed,versions:Td,on:Nd,addListener:Rd,once:Od,off:Ld,removeListener:Cd,removeAllListeners:Pd,emit:Fd,binding:Bd,cwd:qd,chdir:Md,umask:Dd,hrtime:kd,platform:vd,release:Ad,config:Id,uptime:_d},gt=Wd});var In,Nn,ds=Oe(()=>{"use strict";a();s();typeof Object.create=="function"?In=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:In=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t};Nn=In});var bs={};ft(bs,{_extend:()=>Mn,debuglog:()=>ms,default:()=>Xd,deprecate:()=>Pn,format:()=>hr,inherits:()=>Nn,inspect:()=>K,isArray:()=>Fn,isBoolean:()=>gr,isBuffer:()=>xs,isDate:()=>yr,isError:()=>vt,isFunction:()=>wt,isNull:()=>bt,isNullOrUndefined:()=>ys,isNumber:()=>Bn,isObject:()=>Ee,isPrimitive:()=>gs,isRegExp:()=>xt,isString:()=>St,isSymbol:()=>hs,isUndefined:()=>H,log:()=>vs});function hr(r){if(!St(r)){for(var t=[],e=0;e<arguments.length;e++)t.push(K(arguments[e]));return t.join(" ")}for(var e=1,n=arguments,i=n.length,o=String(r).replace(jd,function(f){if(f==="%%")return"%";if(e>=i)return f;switch(f){case"%s":return String(n[e++]);case"%d":return Number(n[e++]);case"%j":try{return JSON.stringify(n[e++])}catch(p){return"[Circular]"}default:return f}}),u=n[e];e<i;u=n[++e])bt(u)||!Ee(u)?o+=" "+u:o+=" "+K(u);return o}function Pn(r,t){if(H(globalThis.process))return function(){return Pn(r,t).apply(this,arguments)};if(gt.noDeprecation===!0)return r;var e=!1;function n(){if(!e){if(gt.throwDeprecation)throw new Error(t);gt.traceDeprecation?console.trace(t):console.error(t),e=!0}return r.apply(this,arguments)}return n}function ms(r){if(H(Rn)&&(Rn=gt.env.NODE_DEBUG||""),r=r.toUpperCase(),!dr[r])if(new RegExp("\\b"+r+"\\b","i").test(Rn)){var t=0;dr[r]=function(){var e=hr.apply(null,arguments);console.error("%s %d: %s",r,t,e)}}else dr[r]=function(){};return dr[r]}function K(r,t){var e={seen:[],stylize:Vd};return arguments.length>=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),gr(t)?e.showHidden=t:t&&Mn(e,t),H(e.showHidden)&&(e.showHidden=!1),H(e.depth)&&(e.depth=2),H(e.colors)&&(e.colors=!1),H(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=zd),mr(e,r,e.depth)}function zd(r,t){var e=K.styles[t];return e?"\x1B["+K.colors[e][0]+"m"+r+"\x1B["+K.colors[e][1]+"m":r}function Vd(r,t){return r}function Gd(r){var t={};return r.forEach(function(e,n){t[e]=!0}),t}function mr(r,t,e){if(r.customInspect&&t&&wt(t.inspect)&&t.inspect!==K&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(e,r);return St(n)||(n=mr(r,n,e)),n}var i=Yd(r,t);if(i)return i;var o=Object.keys(t),u=Gd(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(t)),vt(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return On(t);if(o.length===0){if(wt(t)){var f=t.name?": "+t.name:"";return r.stylize("[Function"+f+"]","special")}if(xt(t))return r.stylize(RegExp.prototype.toString.call(t),"regexp");if(yr(t))return r.stylize(Date.prototype.toString.call(t),"date");if(vt(t))return On(t)}var p="",y=!1,g=["{","}"];if(Fn(t)&&(y=!0,g=["[","]"]),wt(t)){var x=t.name?": "+t.name:"";p=" [Function"+x+"]"}if(xt(t)&&(p=" "+RegExp.prototype.toString.call(t)),yr(t)&&(p=" "+Date.prototype.toUTCString.call(t)),vt(t)&&(p=" "+On(t)),o.length===0&&(!y||t.length==0))return g[0]+p+g[1];if(e<0)return xt(t)?r.stylize(RegExp.prototype.toString.call(t),"regexp"):r.stylize("[Object]","special");r.seen.push(t);var v;return y?v=Hd(r,t,e,u,o):v=o.map(function(A){return Cn(r,t,e,u,A,y)}),r.seen.pop(),Kd(v,p,g)}function Yd(r,t){if(H(t))return r.stylize("undefined","undefined");if(St(t)){var e="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(e,"string")}if(Bn(t))return r.stylize(""+t,"number");if(gr(t))return r.stylize(""+t,"boolean");if(bt(t))return r.stylize("null","null")}function On(r){return"["+Error.prototype.toString.call(r)+"]"}function Hd(r,t,e,n,i){for(var o=[],u=0,f=t.length;u<f;++u)ws(t,String(u))?o.push(Cn(r,t,e,n,String(u),!0)):o.push("");return i.forEach(function(p){p.match(/^\d+$/)||o.push(Cn(r,t,e,n,p,!0))}),o}function Cn(r,t,e,n,i,o){var u,f,p;if(p=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},p.get?p.set?f=r.stylize("[Getter/Setter]","special"):f=r.stylize("[Getter]","special"):p.set&&(f=r.stylize("[Setter]","special")),ws(n,i)||(u="["+i+"]"),f||(r.seen.indexOf(p.value)<0?(bt(e)?f=mr(r,p.value,null):f=mr(r,p.value,e-1),f.indexOf(`
|
|
2
|
-
`)>-1&&(o?f=f.split(`
|
|
3
|
-
`).map(function(y){return" "+y}).join(`
|
|
4
|
-
`).substr(2):f=`
|
|
5
|
-
`+f.split(`
|
|
6
|
-
`).map(function(y){return" "+y}).join(`
|
|
7
|
-
`))):f=r.stylize("[Circular]","special")),H(u)){if(o&&i.match(/^\d+$/))return f;u=JSON.stringify(""+i),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=r.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=r.stylize(u,"string"))}return u+": "+f}function Kd(r,t,e){var n=0,i=r.reduce(function(o,u){return n++,u.indexOf(`
|
|
8
|
-
`)>=0&&n++,o+u.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?e[0]+(t===""?"":t+`
|
|
9
|
-
`)+" "+r.join(`,
|
|
10
|
-
`)+" "+e[1]:e[0]+t+" "+r.join(", ")+" "+e[1]}function Fn(r){return Array.isArray(r)}function gr(r){return typeof r=="boolean"}function bt(r){return r===null}function ys(r){return r==null}function Bn(r){return typeof r=="number"}function St(r){return typeof r=="string"}function hs(r){return typeof r=="symbol"}function H(r){return r===void 0}function xt(r){return Ee(r)&&qn(r)==="[object RegExp]"}function Ee(r){return typeof r=="object"&&r!==null}function yr(r){return Ee(r)&&qn(r)==="[object Date]"}function vt(r){return Ee(r)&&(qn(r)==="[object Error]"||r instanceof Error)}function wt(r){return typeof r=="function"}function gs(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r=="undefined"}function xs(r){return l.isBuffer(r)}function qn(r){return Object.prototype.toString.call(r)}function Ln(r){return r<10?"0"+r.toString(10):r.toString(10)}function Zd(){var r=new Date,t=[Ln(r.getHours()),Ln(r.getMinutes()),Ln(r.getSeconds())].join(":");return[r.getDate(),Jd[r.getMonth()],t].join(" ")}function vs(){console.log("%s - %s",Zd(),hr.apply(null,arguments))}function Mn(r,t){if(!t||!Ee(t))return r;for(var e=Object.keys(t),n=e.length;n--;)r[e[n]]=t[e[n]];return r}function ws(r,t){return Object.prototype.hasOwnProperty.call(r,t)}var jd,dr,Rn,Jd,Xd,Ss=Oe(()=>{"use strict";a();s();cs();ds();jd=/%[sdj%]/g;dr={};K.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};K.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};Jd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Xd={inherits:Nn,_extend:Mn,log:vs,isBuffer:xs,isPrimitive:gs,isFunction:wt,isError:vt,isDate:yr,isObject:Ee,isRegExp:xt,isUndefined:H,isSymbol:hs,isString:St,isNumber:Bn,isNullOrUndefined:ys,isNull:bt,isBoolean:gr,isArray:Fn,inspect:K,deprecate:Pn,format:hr,debuglog:ms}});var Es=h((jw,xr)=>{"use strict";a();s();var Te=(Ss(),$i(bs));if(Te&&Te.default){xr.exports=Te.default;for(let r in Te)xr.exports[r]=Te[r]}else Te&&(xr.exports=Te)});var As=h((Gw,Ts)=>{"use strict";a();s();Ts.exports=Es().inspect});var Nt=h((Kw,Vs)=>{"use strict";a();s();var Gn=typeof Map=="function"&&Map.prototype,Dn=Object.getOwnPropertyDescriptor&&Gn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,wr=Gn&&Dn&&typeof Dn.get=="function"?Dn.get:null,Is=Gn&&Map.prototype.forEach,Yn=typeof Set=="function"&&Set.prototype,Un=Object.getOwnPropertyDescriptor&&Yn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,br=Yn&&Un&&typeof Un.get=="function"?Un.get:null,Ns=Yn&&Set.prototype.forEach,Qd=typeof WeakMap=="function"&&WeakMap.prototype,Tt=Qd?WeakMap.prototype.has:null,em=typeof WeakSet=="function"&&WeakSet.prototype,At=em?WeakSet.prototype.has:null,tm=typeof WeakRef=="function"&&WeakRef.prototype,Rs=tm?WeakRef.prototype.deref:null,rm=Boolean.prototype.valueOf,nm=Object.prototype.toString,im=Function.prototype.toString,om=String.prototype.match,Hn=String.prototype.slice,fe=String.prototype.replace,am=String.prototype.toUpperCase,Os=String.prototype.toLowerCase,Us=RegExp.prototype.test,Ls=Array.prototype.concat,J=Array.prototype.join,sm=Array.prototype.slice,Cs=Math.floor,_n=typeof BigInt=="function"?BigInt.prototype.valueOf:null,kn=Object.getOwnPropertySymbols,Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,_e=typeof Symbol=="function"&&typeof Symbol.iterator=="object",It=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_e||!0)?Symbol.toStringTag:null,ks=Object.prototype.propertyIsEnumerable,Ps=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Fs(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Us.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Cs(-r):Cs(r);if(n!==r){var i=String(n),o=Hn.call(t,i.length+1);return fe.call(i,e,"$&_")+"."+fe.call(fe.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fe.call(t,e,"$&_")}var jn=As(),Bs=jn.custom,qs=Ws(Bs)?Bs:null,$s={__proto__:null,double:'"',single:"'"},um={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Vs.exports=function r(t,e,n,i){var o=e||{};if(re(o,"quoteStyle")&&!re($s,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(re(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=re(o,"customInspect")?o.customInspect:!0;if(typeof u!="boolean"&&u!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(re(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(re(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=o.numericSeparator;if(typeof t=="undefined")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return zs(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var p=String(t);return f?Fs(t,p):p}if(typeof t=="bigint"){var y=String(t)+"n";return f?Fs(t,y):y}var g=typeof o.depth=="undefined"?5:o.depth;if(typeof n=="undefined"&&(n=0),n>=g&&g>0&&typeof t=="object")return zn(t)?"[Array]":"[Object]";var x=Im(o,n);if(typeof i=="undefined")i=[];else if(js(i,t)>=0)return"[Circular]";function v(Re,Wt,_f){if(Wt&&(i=sm.call(i),i.push(Wt)),_f){var Fi={depth:o.depth};return re(o,"quoteStyle")&&(Fi.quoteStyle=o.quoteStyle),r(Re,Fi,n+1,i)}return r(Re,o,n+1,i)}if(typeof t=="function"&&!Ms(t)){var A=gm(t),R=vr(t,v);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(R.length>0?" { "+J.call(R,", ")+" }":"")}if(Ws(t)){var I=_e?fe.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Wn.call(t);return typeof t=="object"&&!_e?Et(I):I}if(Em(t)){for(var M="<"+Os.call(String(t.nodeName)),k=t.attributes||[],X=0;X<k.length;X++)M+=" "+k[X].name+"="+_s(lm(k[X].value),"double",o);return M+=">",t.childNodes&&t.childNodes.length&&(M+="..."),M+="</"+Os.call(String(t.nodeName))+">",M}if(zn(t)){if(t.length===0)return"[]";var he=vr(t,v);return x&&!Am(he)?"["+Vn(he,x)+"]":"[ "+J.call(he,", ")+" ]"}if(pm(t)){var ut=vr(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!ks.call(t,"cause")?"{ ["+String(t)+"] "+J.call(Ls.call("[cause]: "+v(t.cause),ut),", ")+" }":ut.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+J.call(ut,", ")+" }"}if(typeof t=="object"&&u){if(qs&&typeof t[qs]=="function"&&jn)return jn(t,{depth:g-n});if(u!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(xm(t)){var _t=[];return Is&&Is.call(t,function(Re,Wt){_t.push(v(Wt,t,!0)+" => "+v(Re,t))}),Ds("Map",wr.call(t),_t,x)}if(bm(t)){var Li=[];return Ns&&Ns.call(t,function(Re){Li.push(v(Re,t))}),Ds("Set",br.call(t),Li,x)}if(vm(t))return $n("WeakMap");if(Sm(t))return $n("WeakSet");if(wm(t))return $n("WeakRef");if(dm(t))return Et(v(Number(t)));if(ym(t))return Et(v(_n.call(t)));if(mm(t))return Et(rm.call(t));if(cm(t))return Et(v(String(t)));if(typeof window!="undefined"&&t===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&t===globalThis||typeof globalThis!="undefined"&&t===globalThis)return"{ [object globalThis] }";if(!fm(t)&&!Ms(t)){var Zr=vr(t,v),Ci=Ps?Ps(t)===Object.prototype:t instanceof Object||t.constructor===Object,Xr=t instanceof Object?"":"null prototype",Pi=!Ci&&It&&Object(t)===t&&It in t?Hn.call(pe(t),8,-1):Xr?"Object":"",$f=Ci||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Qr=$f+(Pi||Xr?"["+J.call(Ls.call([],Pi||[],Xr||[]),": ")+"] ":"");return Zr.length===0?Qr+"{}":x?Qr+"{"+Vn(Zr,x)+"}":Qr+"{ "+J.call(Zr,", ")+" }"}return String(t)};function _s(r,t,e){var n=e.quoteStyle||t,i=$s[n];return i+r+i}function lm(r){return fe.call(String(r),/"/g,""")}function Ae(r){return!It||!(typeof r=="object"&&(It in r||typeof r[It]!="undefined"))}function zn(r){return pe(r)==="[object Array]"&&Ae(r)}function fm(r){return pe(r)==="[object Date]"&&Ae(r)}function Ms(r){return pe(r)==="[object RegExp]"&&Ae(r)}function pm(r){return pe(r)==="[object Error]"&&Ae(r)}function cm(r){return pe(r)==="[object String]"&&Ae(r)}function dm(r){return pe(r)==="[object Number]"&&Ae(r)}function mm(r){return pe(r)==="[object Boolean]"&&Ae(r)}function Ws(r){if(_e)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Wn)return!1;try{return Wn.call(r),!0}catch(t){}return!1}function ym(r){if(!r||typeof r!="object"||!_n)return!1;try{return _n.call(r),!0}catch(t){}return!1}var hm=Object.prototype.hasOwnProperty||function(r){return r in this};function re(r,t){return hm.call(r,t)}function pe(r){return nm.call(r)}function gm(r){if(r.name)return r.name;var t=om.call(im.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function js(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1}function xm(r){if(!wr||!r||typeof r!="object")return!1;try{wr.call(r);try{br.call(r)}catch(t){return!0}return r instanceof Map}catch(t){}return!1}function vm(r){if(!Tt||!r||typeof r!="object")return!1;try{Tt.call(r,Tt);try{At.call(r,At)}catch(t){return!0}return r instanceof WeakMap}catch(t){}return!1}function wm(r){if(!Rs||!r||typeof r!="object")return!1;try{return Rs.call(r),!0}catch(t){}return!1}function bm(r){if(!br||!r||typeof r!="object")return!1;try{br.call(r);try{wr.call(r)}catch(t){return!0}return r instanceof Set}catch(t){}return!1}function Sm(r){if(!At||!r||typeof r!="object")return!1;try{At.call(r,At);try{Tt.call(r,Tt)}catch(t){return!0}return r instanceof WeakSet}catch(t){}return!1}function Em(r){return!r||typeof r!="object"?!1:typeof HTMLElement!="undefined"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function zs(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,n="... "+e+" more character"+(e>1?"s":"");return zs(Hn.call(r,0,t.maxStringLength),t)+n}var i=um[t.quoteStyle||"single"];i.lastIndex=0;var o=fe.call(fe.call(r,i,"\\$1"),/[\x00-\x1f]/g,Tm);return _s(o,"single",t)}function Tm(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+am.call(t.toString(16))}function Et(r){return"Object("+r+")"}function $n(r){return r+" { ? }"}function Ds(r,t,e,n){var i=n?Vn(e,n):J.call(e,", ");return r+" ("+t+") {"+i+"}"}function Am(r){for(var t=0;t<r.length;t++)if(js(r[t],`
|
|
11
|
-
`)>=0)return!1;return!0}function Im(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=J.call(Array(r.indent+1)," ");else return null;return{base:e,prev:J.call(Array(t+1),e)}}function Vn(r,t){if(r.length===0)return"";var e=`
|
|
12
|
-
`+t.prev+t.base;return e+J.call(r,","+e)+`
|
|
13
|
-
`+t.prev}function vr(r,t){var e=zn(r),n=[];if(e){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=re(r,i)?t(r[i],r):""}var o=typeof kn=="function"?kn(r):[],u;if(_e){u={};for(var f=0;f<o.length;f++)u["$"+o[f]]=o[f]}for(var p in r)re(r,p)&&(e&&String(Number(p))===p&&p<r.length||_e&&u["$"+p]instanceof Symbol||(Us.call(/[^\w$]/,p)?n.push(t(p,r)+": "+t(r[p],r)):n.push(p+": "+t(r[p],r))));if(typeof kn=="function")for(var y=0;y<o.length;y++)ks.call(r,o[y])&&n.push("["+t(o[y])+"]: "+t(r[o[y]],r));return n}});var Sr=h((Xw,Gs)=>{"use strict";a();s();Gs.exports=function(t){return typeof t=="string"||typeof t=="symbol"}});var Hs=h((tb,Ys)=>{"use strict";a();s();var Nm=C(),Rm=Nt(),Om=Sr();Ys.exports=function(t,e){if(!Om(e))throw new Nm("Assertion failed: P is not a Property Key, got "+Rm(e));return t[e]}});var Xs=h((ib,Zs)=>{"use strict";a();s();var Js=Function.prototype.toString,We=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Jn,Er;if(typeof We=="function"&&typeof Object.defineProperty=="function")try{Jn=Object.defineProperty({},"length",{get:function(){throw Er}}),Er={},We(function(){throw 42},null,Jn)}catch(r){r!==Er&&(We=null)}else We=null;var Lm=/^\s*class\b/,Zn=function(t){try{var e=Js.call(t);return Lm.test(e)}catch(n){return!1}},Kn=function(t){try{return Zn(t)?!1:(Js.call(t),!0)}catch(e){return!1}},Tr=Object.prototype.toString,Cm="[object Object]",Pm="[object Function]",Fm="[object GeneratorFunction]",Bm="[object HTMLAllCollection]",qm="[object HTML document.all class]",Mm="[object HTMLCollection]",Dm=typeof Symbol=="function"&&!!Symbol.toStringTag,Um=!(0 in[,]),Xn=function(){return!1};typeof document=="object"&&(Ks=document.all,Tr.call(Ks)===Tr.call(document.all)&&(Xn=function(t){if((Um||!t)&&(typeof t=="undefined"||typeof t=="object"))try{var e=Tr.call(t);return(e===Bm||e===qm||e===Mm||e===Cm)&&t("")==null}catch(n){}return!1}));var Ks;Zs.exports=We?function(t){if(Xn(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{We(t,null,Jn)}catch(e){if(e!==Er)return!1}return!Zn(t)&&Kn(t)}:function(t){if(Xn(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Dm)return Kn(t);if(Zn(t))return!1;var e=Tr.call(t);return e!==Pm&&e!==Fm&&!/^\[object HTML/.test(e)?!1:Kn(t)}});var Qn=h((sb,Qs)=>{"use strict";a();s();Qs.exports=Xs()});var nu=h((fb,ru)=>{"use strict";a();s();var eu=C(),km=Hs(),$m=Qn(),_m=Sr(),tu=Nt();ru.exports=function(t,e){if(!_m(e))throw new eu("Assertion failed: P is not a Property Key");var n=km(t,e);if(n!=null){if(!$m(n))throw new eu(tu(e)+" is not a function: "+tu(n));return n}}});var ou=h((db,iu)=>{"use strict";a();s();var Wm=Zt();iu.exports=function(t){return(typeof t=="number"||typeof t=="bigint")&&!Wm(t)&&t!==1/0&&t!==-1/0}});var Ar=h((hb,au)=>{"use strict";a();s();var jm=ln(),zm=fn(),Vm=Zt(),Gm=ou();au.exports=function(t){if(typeof t!="number"||Vm(t)||!Gm(t))return!1;var e=jm(t);return zm(e)===e}});var ei=h((vb,su)=>{"use strict";a();s();su.exports=function(t){return!!t&&(typeof t=="function"||typeof t=="object")}});var lu=h((Sb,uu)=>{"use strict";a();s();var Ym=cn();uu.exports=function(){return Ym()&&!!Symbol.toStringTag}});var ii=h((Ab,mu)=>{"use strict";a();s();var fu=Y(),Hm=lu()(),Km=xn(),Jm=Pe(),ni;Hm?(pu=fu("RegExp.prototype.exec"),ti={},Ir=function(){throw ti},ri={toString:Ir,valueOf:Ir},typeof Symbol.toPrimitive=="symbol"&&(ri[Symbol.toPrimitive]=Ir),ni=function(t){if(!t||typeof t!="object")return!1;var e=Jm(t,"lastIndex"),n=e&&Km(e,"value");if(!n)return!1;try{pu(t,ri)}catch(i){return i===ti}}):(cu=fu("Object.prototype.toString"),du="[object RegExp]",ni=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:cu(t)===du});var pu,ti,Ir,ri,cu,du;mu.exports=ni});var oi=h((Rb,yu)=>{"use strict";a();s();var Zm=Y(),Xm=ii(),Qm=Zm("RegExp.prototype.exec"),ey=C();yu.exports=function(t){if(!Xm(t))throw new ey("`regex` must be a RegExp");return function(n){return Qm(t,n)!==null}}});var xu=h((Cb,gu)=>{"use strict";a();s();var hu=C(),ty=Nt(),ry=Sr(),ny=ei();gu.exports=function(t,e){if(!ny(t))throw new hu("Assertion failed: Type(O) is not Object");if(!ry(e))throw new hu("Assertion failed: P is not a Property Key, got "+ty(e));return t[e]}});var wu=h((Bb,vu)=>{"use strict";a();s();vu.exports=pn()});var si=h((Db,bu)=>{"use strict";a();s();var iy=Y(),ai=C(),oy=Ar(),ay=iy("String.prototype.slice");bu.exports=function(t,e,n){if(typeof t!="string")throw new ai("Assertion failed: `string` must be a String");if(typeof e!="string")throw new ai("Assertion failed: `searchValue` must be a String");if(!oy(n)||n<0)throw new ai("Assertion failed: `fromIndex` must be a non-negative integer");var i=t.length;if(e===""&&n<=i)return n;for(var o=e.length,u=n;u<=i-o;u+=1){var f=ay(t,u,u+o);if(f===e)return u}return"NOT-FOUND"}});var Nr=h(($b,Su)=>{"use strict";a();s();var sy=C();Su.exports=function(t){if(t==null)throw new sy(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}});var Tu=h((jb,Eu)=>{"use strict";a();s();var uy=G(),ly=uy("%String%"),fy=C();Eu.exports=function(t){if(typeof t=="symbol")throw new fy("Cannot convert a Symbol value to a string");return ly(t)}});var ui=h((Gb,Nu)=>{"use strict";a();s();var py=Nr(),cy=Tu(),dy=Y(),Au=dy("String.prototype.replace"),Iu=/^\s$/.test("\u180E"),my=Iu?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,yy=Iu?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;Nu.exports=function(){var t=cy(py(this));return Au(Au(t,my,""),yy,"")}});var li=h((Kb,Ou)=>{"use strict";a();s();var hy=ui(),Ru="\u200B",je="\u180E";Ou.exports=function(){return String.prototype.trim&&Ru.trim()===Ru&&je.trim()===je&&("_"+je).trim()==="_"+je&&(je+"_").trim()===je+"_"?String.prototype.trim:hy}});var Pu=h((Xb,Cu)=>{"use strict";a();s();var gy=ar()(),Lu=or(),xy=li();Cu.exports=function(){var t=xy();return String.prototype.trim!==t&&(gy?Lu(String.prototype,"trim",t,!0):Lu(String.prototype,"trim",t)),t}});var Mu=h((tS,qu)=>{"use strict";a();s();var vy=ur(),wy=pr(),by=Nr(),Sy=ui(),Fu=li(),Ey=Pu(),Ty=vy(Fu()),Bu=function(t){return by(t),Ty(t)};wy(Bu,{getPolyfill:Fu,implementation:Sy,shim:Ey});qu.exports=Bu});var _u=h((iS,$u)=>{"use strict";a();s();var ku=G(),Ay=ku("%RegExp%"),Iy=C(),Du=ku("%parseInt%"),Ny=Y(),Rr=oi(),Uu=Ny("String.prototype.slice"),Ry=Rr(/^0b[01]+$/i),Oy=Rr(/^0o[0-7]+$/i),Ly=Rr(/^[-+]0x[0-9a-f]+$/i),Cy=["\x85","\u200B","\uFFFE"].join(""),Py=new Ay("["+Cy+"]","g"),Fy=Rr(Py),By=Mu();$u.exports=function r(t){if(typeof t!="string")throw new Iy("Assertion failed: `argument` is not a String");if(Ry(t))return+Du(Uu(t,2),2);if(Oy(t))return+Du(Uu(t,2),8);if(Fy(t)||Ly(t))return NaN;var e=By(t);return e!==t?r(e):+t}});var zu=h((sS,ju)=>{"use strict";a();s();var qy=C(),Wu=Ar(),My=Y(),Dy=My("String.prototype.slice");ju.exports=function(t,e,n){if(typeof t!="string"||!Wu(e)||arguments.length>2&&!Wu(n))throw new qy("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return Dy(t,e,arguments.length>2?n:t.length)}});var fi=h((fS,Vu)=>{"use strict";a();s();var Uy=G(),ky=Uy("%String%"),$y=C();Vu.exports=function(t){if(typeof t=="symbol")throw new $y("Cannot convert a Symbol value to a string");return ky(t)}});var Yu=h((dS,Gu)=>{"use strict";a();s();Gu.exports=function(t,e){for(var n=0;n<t.length;n+=1)if(!e(t[n],n,t))return!1;return!0}});var Ku=h((hS,Hu)=>{"use strict";a();s();var _y=Y()("String.prototype.slice");Hu.exports=function(t,e){return t===e?!0:t.length>e.length?!1:_y(e,0,t.length)===t}});var Zu=h((vS,Ju)=>{"use strict";a();s();Ju.exports=function(t){return typeof t=="string"||typeof t=="undefined"}});var rl=h((SS,tl)=>{"use strict";a();s();var ne=C(),pi=Nt(),Wy=Ar(),Xu=ei(),el=oi(),jy=xu(),zy=An(),Vy=wu(),Gy=si(),Qu=_u(),ie=zu(),Yy=fi(),Hy=Yu(),Rt=Ku(),Ky=Zu(),Jy=el(/^\$[0-9]/),Zy=el(/^\$[0-9][0-9]/);tl.exports=function(t,e,n,i,o,u){if(typeof t!="string")throw new ne("Assertion failed: `matched` must be a String");if(typeof e!="string")throw new ne("Assertion failed: `str` must be a String");if(!Wy(n)||n<0)throw new ne("Assertion failed: `position` must be a nonnegative integer, got "+pi(n));if(!zy(i)||!Hy(i,Ky))throw new ne("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+pi(i));if(typeof o!="undefined"&&!Xu(o))throw new ne("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof u!="string")throw new ne("Assertion failed: `replacementTemplate` must be a String");var f=e.length;if(n>f)throw new ne("Assertion failed: position > stringLength, got "+pi(n));for(var p=u,y="";p!=="";){var g,x,v;if(Rt("$$",p))g="$$",x="$";else if(Rt("$`",p))g="$`",x=ie(e,0,n);else if(Rt("$&",p))g="$&",x=t;else if(Rt("$'",p)){g="$'";var A=t.length,R=n+A;x=ie(e,Vy(R,f))}else if(Jy(p)){var I=Zy(p)?2:1,M=ie(p,1,1+I),k=Qu(M);if(k<0||k>99)throw new ne("Assertion failed: `index` must be >= 0 and <= 99");var X=i.length;k>X&&I===2&&(I=1,M=ie(M,0,1),k=Qu(M)),g=ie(p,0,1+I),1<=k&&k<=X?(v=i[k-1],typeof v=="undefined"?x="":x=v):x=g}else if(Rt("$<",p)){var he=Gy(p,">",0);if(!(he>-1)||typeof o=="undefined")g="$<",x=g;else{g=ie(p,0,he+1);var ut=ie(p,2,he);if(!Xu(o))throw new ne("Assertion failed: Type(namedCaptures) is not Object");v=jy(o,ut),typeof v=="undefined"?x="":x=Yy(v)}}else g=ie(p,0,1),x=g;var _t=g.length;p=ie(p,_t),y+=x}return y}});var al=h((AS,ol)=>{"use strict";a();s();var nl=G(),il=ur(),Xy=il(nl("String.prototype.indexOf"));ol.exports=function(t,e){var n=nl(t,!!e);return typeof n=="function"&&Xy(t,".prototype.")>-1?il(n):n}});var di=h((RS,fl)=>{"use strict";a();s();var sl=as(),Qy=nu(),eh=rl(),th=Qn(),rh=Nr(),Or=fi(),ul=si(),nh=G(),Lr=al(),ih=dn()(),oh=ii(),ah=nh("%Math.max%"),ll=C(),sh=Lr("Array.prototype.push"),ci=Lr("String.prototype.slice"),uh=Lr("String.prototype.indexOf"),lh=Lr("String.prototype.replace");fl.exports=function(t,e){var n=rh(this),i=oh(t);if(i&&uh(ci(t,t.source.length+2),"g")===-1)throw new ll("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(ih&&Symbol.replace){if(t!=null){var o=Qy(t,Symbol.replace);if(typeof o!="undefined")return sl(o,t,[n,e])}}else if(i)return lh(n,t,e);var u=Or(n),f=Or(t),p=th(e);p||(e=Or(e));for(var y=f.length,g=ah(1,y),x=[],v=ul(u,f,0);v!=="NOT-FOUND";)sh(x,v),v=ul(u,f,v+g);for(var A=0,R="",I=0;I<x.length;I+=1){var M;if(p)M=Or(sl(e,void 0,[f,x[I],u]));else{if(typeof e!="string")throw new ll("Assertion failed: `replaceValue` should be a string at this point");var k=[];M=eh(f,u,x[I],k,void 0,e)}var X=ci(u,A,x[I]);R+=X+M,A=x[I]+y}return A<u.length&&(R+=ci(u,A)),R}});var mi=h((CS,pl)=>{"use strict";a();s();var fh=di();pl.exports=function(){return String.prototype.replaceAll||fh}});var dl=h((BS,cl)=>{"use strict";a();s();var ph=pr(),ch=mi();cl.exports=function(){var t=ch();return ph(String.prototype,{replaceAll:t},{replaceAll:function(){return String.prototype.replaceAll!==t}}),t}});var gl=h((DS,hl)=>{"use strict";a();s();var dh=ur(),mh=pr(),ml=di(),yh=mi(),hh=dl(),yl=dh(ml);mh(yl,{getPolyfill:yh,implementation:ml,shim:hh});hl.exports=yl});var xi=h((H1,vf)=>{"use strict";a();s();function ix(r){return!(typeof r!="number"||r!==r||r===1/0||r===-1/0)}vf.exports=ix});var bf=h((Z1,wf)=>{"use strict";a();s();var ox=9007199254740991;wf.exports=ox});var vi=h((eI,Sf)=>{"use strict";a();s();var ax=bf();function sx(r){return typeof r=="number"&&Math.abs(r)<=ax}Sf.exports=sx});var Tf=h((nI,Ef)=>{"use strict";a();s();var ux=xi(),lx=vi();function fx(r){var t=parseInt(r,10);if(!ux(t))throw new TypeError("Not a finite number: "+r+" ("+typeof r+")");if(!lx(t))throw new RangeError("Input is not a safe number, it\u2019s either too large or too small.");var e=String(t),n=Math.abs(t%100),i=n>=11&&n<=13,o=e.charAt(e.length-1);return e+(i?"th":o==="1"?"st":o==="2"?"nd":o==="3"?"rd":"th")}Ef.exports=fx});var wi=h((aI,Nf)=>{"use strict";a();s();var px=/(hundred|thousand|(m|b|tr|quadr)illion)$/,cx=/teen$/,Af=/y$/,If=/(zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)$/,dx={zero:"zeroth",one:"first",two:"second",three:"third",four:"fourth",five:"fifth",six:"sixth",seven:"seventh",eight:"eighth",nine:"ninth",ten:"tenth",eleven:"eleventh",twelve:"twelfth"};function mx(r){return px.test(r)||cx.test(r)?r+"th":Af.test(r)?r.replace(Af,"ieth"):If.test(r)?r.replace(If,yx):r}function yx(r,t){return dx[t]}Nf.exports=mx});var Ni=h((lI,Lf)=>{"use strict";a();s();var hx=wi(),gx=xi(),xx=vi(),Rf=10,bi=100,Si=1e3,Ei=1e6,Ti=1e9,Ai=1e12,Ii=1e15,vx=9007199254740992,Of=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],wx=["zero","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function bx(r,t){var e,n=parseInt(r,10);if(!gx(n))throw new TypeError("Not a finite number: "+r+" ("+typeof r+")");if(!xx(n))throw new RangeError("Input is not a safe number, it\u2019s either too large or too small.");return e=me(n),t?hx(e):e}function me(r){var t,e,n=arguments[1];return r===0?n?n.join(" ").replace(/,$/,""):"zero":(n||(n=[]),r<0&&(n.push("minus"),r=Math.abs(r)),r<20?(t=0,e=Of[r]):r<bi?(t=r%Rf,e=wx[Math.floor(r/Rf)],t&&(e+="-"+Of[t],t=0)):r<Si?(t=r%bi,e=me(Math.floor(r/bi))+" hundred"):r<Ei?(t=r%Si,e=me(Math.floor(r/Si))+" thousand,"):r<Ti?(t=r%Ei,e=me(Math.floor(r/Ei))+" million,"):r<Ai?(t=r%Ti,e=me(Math.floor(r/Ti))+" billion,"):r<Ii?(t=r%Ai,e=me(Math.floor(r/Ai))+" trillion,"):r<=vx&&(t=r%Ii,e=me(Math.floor(r/Ii))+" quadrillion,"),n.push(e),me(t,n))}Lf.exports=bx});var Pf=h((cI,Cf)=>{"use strict";a();s();var Sx=wi(),Ex=Ni();function Tx(r){var t=Ex(r);return Sx(t)}Cf.exports=Tx});var Bf=h((yI,Ff)=>{"use strict";a();s();Ff.exports={toOrdinal:Tf(),toWords:Ni(),toWordsOrdinal:Pf()}});var Gx={};ft(Gx,{DynamicSnippetsGenerator:()=>Jr,EndpointSnippetGenerator:()=>st});module.exports=$i(Gx);a();s();var DC=ki(gl(),1);a();s();a();s();a();s();function Cr(r,t){if(r===void 0)throw new Error(t!=null?t:"Expected value to be defined but got undefined.")}function _(r,t){if(r===null)throw new Error(t!=null?t:"Expected value to be non-null but got null.")}function S(r){throw new Error("Unexpected value: "+JSON.stringify(r))}a();s();a();s();a();s();a();s();a();s();a();s();var gh=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,xl=gh;var xh=typeof self=="object"&&self&&self.Object===Object&&self,vh=xl||xh||Function("return this")(),vl=vh;var wh=vl.Symbol,oe=wh;a();s();var wl=Object.prototype,bh=wl.hasOwnProperty,Sh=wl.toString,Ot=oe?oe.toStringTag:void 0;function Eh(r){var t=bh.call(r,Ot),e=r[Ot];try{r[Ot]=void 0;var n=!0}catch(o){}var i=Sh.call(r);return n&&(t?r[Ot]=e:delete r[Ot]),i}var bl=Eh;a();s();var Th=Object.prototype,Ah=Th.toString;function Ih(r){return Ah.call(r)}var Sl=Ih;var Nh="[object Null]",Rh="[object Undefined]",El=oe?oe.toStringTag:void 0;function Oh(r){return r==null?r===void 0?Rh:Nh:El&&El in Object(r)?bl(r):Sl(r)}var Tl=Oh;a();s();function Lh(r){return r!=null&&typeof r=="object"}var Al=Lh;var Ch="[object Symbol]";function Ph(r){return typeof r=="symbol"||Al(r)&&Tl(r)==Ch}var Il=Ph;a();s();a();s();function Fh(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 Nl=Fh;a();s();var Bh=Array.isArray,Rl=Bh;var qh=1/0,Ol=oe?oe.prototype:void 0,Ll=Ol?Ol.toString:void 0;function Cl(r){if(typeof r=="string")return r;if(Rl(r))return Nl(r,Cl)+"";if(Il(r))return Ll?Ll.call(r):"";var t=r+"";return t=="0"&&1/r==-qh?"-0":t}var Pl=Cl;a();s();function Mh(r){return r==null?"":Pl(r)}var ce=Mh;a();s();a();s();a();s();a();s();a();s();a();s();function Dh(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 o=Array(i);++n<i;)o[n]=r[n+t];return o}var Fl=Dh;function Uh(r,t,e){var n=r.length;return e=e===void 0?n:e,!t&&e>=n?r:Fl(r,t,e)}var Bl=Uh;a();s();var kh="\\ud800-\\udfff",$h="\\u0300-\\u036f",_h="\\ufe20-\\ufe2f",Wh="\\u20d0-\\u20ff",jh=$h+_h+Wh,zh="\\ufe0e\\ufe0f",Vh="\\u200d",Gh=RegExp("["+Vh+kh+jh+zh+"]");function Yh(r){return Gh.test(r)}var Pr=Yh;a();s();a();s();function Hh(r){return r.split("")}var ql=Hh;a();s();var Ml="\\ud800-\\udfff",Kh="\\u0300-\\u036f",Jh="\\ufe20-\\ufe2f",Zh="\\u20d0-\\u20ff",Xh=Kh+Jh+Zh,Qh="\\ufe0e\\ufe0f",eg="["+Ml+"]",yi="["+Xh+"]",hi="\\ud83c[\\udffb-\\udfff]",tg="(?:"+yi+"|"+hi+")",Dl="[^"+Ml+"]",Ul="(?:\\ud83c[\\udde6-\\uddff]){2}",kl="[\\ud800-\\udbff][\\udc00-\\udfff]",rg="\\u200d",$l=tg+"?",_l="["+Qh+"]?",ng="(?:"+rg+"(?:"+[Dl,Ul,kl].join("|")+")"+_l+$l+")*",ig=_l+$l+ng,og="(?:"+[Dl+yi+"?",yi,Ul,kl,eg].join("|")+")",ag=RegExp(hi+"(?="+hi+")|"+og+ig,"g");function sg(r){return r.match(ag)||[]}var Wl=sg;function ug(r){return Pr(r)?Wl(r):ql(r)}var jl=ug;function lg(r){return function(t){t=ce(t);var e=Pr(t)?jl(t):void 0,n=e?e[0]:t.charAt(0),i=e?Bl(e,1).join(""):t.slice(1);return n[r]()+i}}var Fr=lg;var fg=Fr("toUpperCase"),B=fg;function pg(r){return B(ce(r).toLowerCase())}var zl=pg;a();s();a();s();function cg(r,t,e,n){var i=-1,o=r==null?0:r.length;for(n&&o&&(e=r[++i]);++i<o;)e=t(e,r[i],i,r);return e}var Vl=cg;a();s();a();s();a();s();function dg(r){return function(t){return r==null?void 0:r[t]}}var Gl=dg;var mg={\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"},yg=Gl(mg),Yl=yg;var hg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gg="\\u0300-\\u036f",xg="\\ufe20-\\ufe2f",vg="\\u20d0-\\u20ff",wg=gg+xg+vg,bg="["+wg+"]",Sg=RegExp(bg,"g");function Eg(r){return r=ce(r),r&&r.replace(hg,Yl).replace(Sg,"")}var Hl=Eg;a();s();a();s();var Tg=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ag(r){return r.match(Tg)||[]}var Kl=Ag;a();s();var Ig=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ng(r){return Ig.test(r)}var Jl=Ng;a();s();var tf="\\ud800-\\udfff",Rg="\\u0300-\\u036f",Og="\\ufe20-\\ufe2f",Lg="\\u20d0-\\u20ff",Cg=Rg+Og+Lg,rf="\\u2700-\\u27bf",nf="a-z\\xdf-\\xf6\\xf8-\\xff",Pg="\\xac\\xb1\\xd7\\xf7",Fg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bg="\\u2000-\\u206f",qg=" \\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",of="A-Z\\xc0-\\xd6\\xd8-\\xde",Mg="\\ufe0e\\ufe0f",af=Pg+Fg+Bg+qg,sf="['\u2019]",Zl="["+af+"]",Dg="["+Cg+"]",uf="\\d+",Ug="["+rf+"]",lf="["+nf+"]",ff="[^"+tf+af+uf+rf+nf+of+"]",kg="\\ud83c[\\udffb-\\udfff]",$g="(?:"+Dg+"|"+kg+")",_g="[^"+tf+"]",pf="(?:\\ud83c[\\udde6-\\uddff]){2}",cf="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+of+"]",Wg="\\u200d",Xl="(?:"+lf+"|"+ff+")",jg="(?:"+ze+"|"+ff+")",Ql="(?:"+sf+"(?:d|ll|m|re|s|t|ve))?",ef="(?:"+sf+"(?:D|LL|M|RE|S|T|VE))?",df=$g+"?",mf="["+Mg+"]?",zg="(?:"+Wg+"(?:"+[_g,pf,cf].join("|")+")"+mf+df+")*",Vg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Gg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yg=mf+df+zg,Hg="(?:"+[Ug,pf,cf].join("|")+")"+Yg,Kg=RegExp([ze+"?"+lf+"+"+Ql+"(?="+[Zl,ze,"$"].join("|")+")",jg+"+"+ef+"(?="+[Zl,ze+Xl,"$"].join("|")+")",ze+"?"+Xl+"+"+Ql,ze+"+"+ef,Gg,Vg,uf,Hg].join("|"),"g");function Jg(r){return r.match(Kg)||[]}var yf=Jg;function Zg(r,t,e){return r=ce(r),t=e?void 0:t,t===void 0?Jl(r)?yf(r):Kl(r):r.match(t)||[]}var hf=Zg;var Xg="['\u2019]",Qg=RegExp(Xg,"g");function ex(r){return function(t){return Vl(hf(Hl(t).replace(Qg,"")),r,"")}}var gf=ex;var tx=gf(function(r,t,e){return t=t.toLowerCase(),r+(e?zl(t):t)}),q=tx;a();s();var rx=Fr("toLowerCase"),Br=rx;a();s();function gi(){}a();s();function Lt(r){return Object.keys(r)}a();s();function qr(r){return Object.values(r)}a();s();a();s();var Ie=class{};a();s();a();s();var W=class extends Ie{constructor(e){super();d(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 nx=4,xf=!!c.env.FERN_STACK_TRACK;xf&&(Error.stackTraceLimit=50);var Ct=class{constructor(){d(this,"buffer","");d(this,"indentLevel",0);d(this,"hasWrittenAnything",!1);d(this,"lastCharacterIsSemicolon",!1);d(this,"lastCharacterIsNewline",!1)}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let n=e.length>0&&e.endsWith(`
|
|
14
|
-
`),i=n?e.substring(0,e.length-1):e,o=this.getIndentString(),u=i.replaceAll(`
|
|
15
|
-
`,`
|
|
16
|
-
${o}`);this.isAtStartOfLine()&&(u=o+u),n&&(u+=`
|
|
17
|
-
`),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){t.write(this)}writeNodeOrString(t){if(typeof t=="string"){this.write(t);return}this.writeNode(t)}writeNodeStatement(t){t.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(t){new W(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new W(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new W(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new W(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new W(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),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
|
|
18
|
-
`)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
|
|
19
|
-
`)}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 o=1;o<t.length;o++){this.write(e);let u=t[o];u!=null&&n(u)}}}toString(){return this.buffer}writeInternal(t){if(t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
|
|
20
|
-
`),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t,xf&&this.buffer.endsWith(`
|
|
21
|
-
`)&&!this.buffer.endsWith(`"""
|
|
22
|
-
`)){let e=this.stacktrace(15).map(n=>`${n.fn} - ${n.path}:${n.position}`).join(" ");e&&(this.buffer=this.buffer.slice(0,-1),this.buffer+=`//@@ ${e}
|
|
23
|
-
`)}return this.buffer}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return nx}stacktrace(t=50){var n;let e=!1;return((n=new Error().stack)!=null?n:"").split(`
|
|
24
|
-
`).map(i=>{var u;let o=i.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(o&&o.length===5){let[,f,p,y,g]=o;if(e||f!=null&&f.includes("runInteractiveTask")){e=!0;return}switch(f){case"Object.<anonymous>":f="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":f=`${f.substring(f.indexOf(".")+1)}()=> { ... }`;break}return{fn:f,path:(u=p==null?void 0:p.replace(/^.*?fern.*?\//,""))!=null?u:"",position:`${y}:${g}`}}}).filter(i=>{var o,u,f,p,y,g,x;return i&&!((o=i.path)!=null&&o.startsWith("node:"))&&!((u=i.path)!=null&&u.endsWith(".js"))&&!((f=i.path)!=null&&f.includes("AbstractWriter"))&&!((p=i.fn)!=null&&p.includes("stacktrace"))&&!((y=i.fn)!=null&&y.includes("stackLine"))&&!((g=i.fn)!=null&&g.includes("SdkGeneratorCLI"))&&!((x=i.fn)!=null&&x.includes("runCli"))}).slice(0,t)}};a();s();a();s();a();s();var Pt=class{constructor(){d(this,"reporter");d(this,"snippet");d(this,"err");this.snippet=void 0,this.reporter=void 0,this.err=void 0}update({context:t,snippet:e}){this.shouldUpdate({snippet:e,reporter:t.errors})&&(this.reporter=t.errors.clone(),this.snippet=e)}getResponseOrThrow({endpoint:t}){var e;if(this.snippet!=null&&this.reporter!=null)return{snippet:this.snippet,errors:this.reporter.toDynamicSnippetErrors()};throw(e=this.err)!=null?e:new Error(`Failed to generate snippet for endpoint "${t.method} ${t.path}"`)}shouldUpdate({snippet:t,reporter:e}){var n,i;return this.reporter==null||this.reporter.size()>0&&e.size()===0?!0:t.length>((i=(n=this.snippet)==null?void 0:n.length)!=null?i:0)}};var Ft=class{constructor(t){d(this,"context");this.context=t}async generate(t,e={}){let n=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new Pt;for(let o of n){let u=this.context.clone(),f=this.createSnippetGenerator(u);try{let p=await f.generateSnippet({endpoint:o,request:t,options:e});if(u.errors.empty())return{snippet:p,errors:void 0};i.update({context:u,snippet:p})}catch(p){i.err==null&&(i.err=p)}}return i.getResponseOrThrow({endpoint:t.endpoint})}generateSync(t,e={}){let n=this.context.resolveEndpointLocationOrThrow(t.endpoint);if(n.length===0)throw new Error(`No endpoints found that match "${t.endpoint.method} ${t.endpoint.path}"`);let i=new Pt;for(let o of n){let u=this.context.clone(),f=this.createSnippetGenerator(u);try{let p=f.generateSnippetSync({endpoint:o,request:t,options:e});if(u.errors.empty())return{snippet:p,errors:void 0};i.update({context:u,snippet:p})}catch(p){i.err==null&&(i.err=p)}}return i.getResponseOrThrow({endpoint:t.endpoint})}};a();s();a();s();a();s();var Bt=class{constructor(){d(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]}}};a();s();var T={Critical:"CRITICAL",Warning:"WARNING"},qt=class r{constructor(){d(this,"errors");d(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(qi(N({},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 Mt=class{constructor({ir:t,config:e,options:n={}}){d(this,"config");d(this,"options");d(this,"errors");d(this,"_ir");d(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=n,this.errors=new qt,this.httpEndpointReferenceParser=new Bt}associateQueryParametersByWireValue({parameters:t,values:e}){let n=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let u=t.find(p=>p.name.wireValue===i);if(u==null)throw this.newParameterNotRecognizedError(i);let f=this.isListTypeReference(u.typeReference)&&!Array.isArray(o)?[o]:o;n.push({name:u.name,typeReference:u.typeReference,value:f})}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 o=e[i.name.wireValue];if(o==null)if(i.typeReference.type==="primitive"&&i.typeReference.value==="STRING")o=`<${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:o})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:n}){let i=[];for(let[o,u]of Object.entries(e)){this.errors.scope(o);try{let f=t.find(p=>p.name.wireValue===o);if(f==null){if(n)continue;this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(o).message});continue}i.push({name:f.name,typeReference:f.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 o of t){let u=n[o.name.wireValue];u==null?o.typeReference.type==="nullable"&&i.push({name:o.name,typeReference:o.typeReference,value:null}):i.push({name:o.name,typeReference:o.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 o of n){if(typeof o!="string"){this.errors.add({severity:T.Critical,message:`Expected file array value to be an array of strings, got ${typeof o}`});return}i.push(o)}return i}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity: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,o=n[i];if(o==null){this.errors.add({severity:T.Critical,message:this.newParameterNotRecognizedError(i).message});return}if(typeof o!="string"){this.errors.add({severity:T.Critical,message:`Expected discriminant value to be a string but got: ${typeof o}`});return}let u=t.types[o];if(u==null){this.errors.add({severity:T.Critical,message:`No type found for discriminant value "${o}"`});return}let y=n,{[i]:f}=y,p=Di(y,[Mi(i)]);return{singleDiscriminatedUnionType:u,discriminantValue:u.discriminantValue,value:p}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}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:S(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:S(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(Lt(n.urls));for(let o of Lt(t))i.has(o)&&i.delete(o);return i.size>0?(this.errors.add({severity:T.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${Lt(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:S(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:S(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:S(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}};a();s();var de={PathParameters:"pathParameters",QueryParameters:"queryParameters",Headers:"headers",RequestBody:"requestBody"};a();s();a();s();function Dt(r){return B(q(r))}a();s();a();s();a();s();var Ve={};ft(Ve,{sanitizeForIdentifier:()=>Ri,sanitizeToCamelCase:()=>Ix,sanitizeToPascalCase:()=>Ax});a();s();var qf=ki(Bf(),1);a();s();function Mr(r){return B(q(r))}function Ax(r){let t=Ri(r);return Mr(t)}function Ix(r){let t=Ri(r);return q(t)}function Ri(r){if(r==="")return"empty";let t=r;if(/^\d/.test(t)){let n=Nx(t);t=n.numberAsWords+B(n.rest)}return/^[a-zA-Z][a-zA-Z0-9]*$/.test(t)||(t=t.replace(/^[^a-zA-Z0-9]+/,""),t=q(t)),/^\d/.test(t)&&(t="value"+t),t===""?"value":t}function Nx(r){let t=r.match(/^(\d+)/);if(!t||!t[1])return{numberAsWords:"",rest:r};let e=t[1],n=r.slice(e.length);try{return{numberAsWords:(0,qf.toWords)(parseInt(e,10)),rest:n}}catch(i){let o={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};return{numberAsWords:e.split("").map(f=>o[f]||f).join(""),rest:n}}}a();s();var Ut={};ft(Ut,{generateEnumCaseLabel:()=>Ox,generateName:()=>Rx,sanitizeLiteralValue:()=>Oi});a();s();function Rx(r){let t=Oi(r);return Mr(t)}function Ox(r){let t=Oi(r);return q(t)}function Oi(r){if(r==="")return"empty";let t=r;return/^[a-zA-Z][a-zA-Z0-9]*$/.test(r)||(t=t.replace(/^[^a-zA-Z0-9]+/,""),t=q(t)),/^\d/.test(t)||t===""?"value":t}var m={};ft(m,{AccessLevel:()=>Mf,Class:()=>Ge,CodeBlock:()=>F,Comment:()=>Ye,ComputedProperty:()=>Ke,DeclarationType:()=>kt,DocComment:()=>Je,EnumWithAssociatedValues:()=>Ze,EnumWithRawValues:()=>Xe,Expression:()=>Z,Extension:()=>Qe,FunctionArgument:()=>et,FunctionParameter:()=>tt,Initializer:()=>rt,LineBreak:()=>Ur,Method:()=>nt,Pattern:()=>kr,Property:()=>it,Protocol:()=>Uf,Statement:()=>He,Struct:()=>ot,Symbol:()=>O,SymbolRegistry:()=>Gr,Type:()=>_r,TypeReference:()=>Wr,class_:()=>Px,codeBlock:()=>Fx,comment:()=>Bx,computedProperty:()=>qx,docComment:()=>Mx,enumWithAssociatedValues:()=>Dx,enumWithRawValues:()=>Ux,extension:()=>kx,functionArgument:()=>$x,functionParameter:()=>_x,initializer:()=>Wx,method:()=>jx,property:()=>zx,struct:()=>Vx});a();s();a();s();a();s();var Mf={Open:"open",Public:"public",Package:"package",Internal:"internal",Fileprivate:"fileprivate",Private:"private"};a();s();a();s();a();s();a();s();var Dr=class extends Ct{toString(){return this.buffer}};var b=class extends Ie{toString(){let t=new Dr;return this.write(t),t.toString()}};var Ge=class extends b{constructor({accessLevel:e,name:n,final:i,conformances:o,properties:u,initializers:f,methods:p,docs:y}){super();d(this,"name");d(this,"final");d(this,"accessLevel");d(this,"conformances");d(this,"properties");d(this,"initializers");d(this,"methods");d(this,"docs");this.name=n,this.final=i,this.accessLevel=e,this.conformances=o!=null?o:[],this.properties=u,this.initializers=f!=null?f:[],this.methods=p!=null?p:[],this.docs=y}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.final&&e.write("final "),e.write(`class ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),e.write(" {"),e.newLine(),e.indent(),this.properties.forEach(n=>{n.write(e),e.newLine()}),this.initializers.length>0&&(e.newLine(),this.initializers.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),this.methods.length>0&&(e.newLine(),this.methods.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),e.dedent(),e.write("}")}};a();s();var F=class r extends b{constructor(e){super();d(this,"args");this.args=e}write(e){let n=new W(this.args);e.write("{"),e.newLine(),e.indent(),n.write(e),e.dedent(),e.write("}")}static empty(){return new r(gi)}static withStatements(e){return new r(n=>{e.forEach(i=>{i.write(n)})})}};a();s();var Ye=class extends b{constructor({content:e}){super();d(this,"content");this.content=e}write(e){this.content.split(`
|
|
25
|
-
`).forEach(i=>{e.write(`// ${i}`),e.newLine()})}};a();s();a();s();function Df(r){return r.replace(/\\u([0-9a-fA-F]{4})/g,"\\u{$1}").replace(new RegExp("(?<!\\\\)\\\\f","g"),"\\u{000C}").replace(new RegExp("(?<!\\\\)\\\\v","g"),"\\u{000B}").replace(new RegExp("(?<!\\\\)\\\\0","g"),"\\u{0000}").replace(new RegExp('(?<!\\\\)"',"g"),'\\"')}a();s();var Lx=["Any","as","associatedtype","break","case","catch","class","continue","default","defer","deinit","do","else","fallthrough","false","for","guard","enum","extension","fileprivate","func","if","import","in","init","inout","internal","is","let","nil","operator","private","precedencegroup","Protocol","protocol","public","repeat","rethrows","return","Self","self","static","struct","subscript","super","switch","throw","throws","true","try","Type","typealias","var","where","while"],Cx=new Set(Lx);function Ne(r){return Cx.has(r)}function U(r){return Ne(r)?`\`${r}\``:r}function ye(r){return r==="self"?"self_":r}a();s();var Z=class extends b{constructor(e){super();d(this,"internalExpression");this.internalExpression=e}isNop(){return this.internalExpression.type==="nop"}isStructInitialization(){return this.internalExpression.type==="struct-initialization"}asStructInitializationOrThrow(){if(this.internalExpression.type!=="struct-initialization")throw new Error("Internal error; swift.Expression is not a struct initialization");return this.internalExpression}write(e){switch(this.internalExpression.type){case"reference":e.write(U(this.internalExpression.unsafeName));break;case"member-access":this.internalExpression.target.write(e),this.internalExpression.optionalChain&&e.write("?"),e.write("."),e.write(this.internalExpression.memberName);break;case"equals":this.internalExpression.left.write(e),e.write(" == "),this.internalExpression.right.write(e);break;case"enum-case-shorthand":e.write("."),e.write(this.internalExpression.caseName);break;case"function-call":this.writeCallableExpression({writer:e,target:U(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"struct-initialization":this.writeCallableExpression({writer:e,target:U(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"class-initialization":this.writeCallableExpression({writer:e,target:U(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"method-call":this.internalExpression.target.write(e),e.write("."),this.writeCallableExpression({writer:e,target:this.internalExpression.methodName,arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"method-call-with-trailing-closure":this.internalExpression.target.write(e),e.write("."),e.write(this.internalExpression.methodName),e.write(" {"),this.internalExpression.multiline?(e.newLine(),e.indent()):e.write(" "),this.internalExpression.closureBody.write(e),this.internalExpression.multiline?(e.newLine(),e.dedent()):e.write(" "),e.write("}");break;case"contextual-method-call":e.write("."),this.writeCallableExpression({writer:e,target:this.internalExpression.methodName,arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"try":e.write("try "),this.internalExpression.expression.write(e);break;case"optional-try":e.write("try? "),this.internalExpression.expression.write(e);break;case"force-try":e.write("try! "),this.internalExpression.expression.write(e);break;case"await":e.write("await "),this.internalExpression.expression.write(e);break;case"string-literal":e.write(`"${this.internalExpression.value}"`);break;case"number-literal":e.write(this.internalExpression.value.toString());break;case"bool-literal":e.write(this.internalExpression.value?"true":"false");break;case"date-literal":e.write(`try! Date("${this.internalExpression.isoString}", strategy: .iso8601)`);break;case"calendar-date-literal":e.write(`CalendarDate("${this.internalExpression.isoString}")!`);break;case"uuid-literal":e.write(`UUID(uuidString: "${this.internalExpression.value}")!`);break;case"dictionary-literal":this.writeDictionaryLiteral(e,this.internalExpression);break;case"array-literal":this.writeArrayLiteral(e,this.internalExpression);break;case"data-literal":e.write(`Data("${this.internalExpression.value}".utf8)`);break;case"raw-value":e.write(this.internalExpression.value);break;case"nop":break;default:S(this.internalExpression)}}writeCallableExpression({writer:e,target:n,arguments_:i,multiline:o}){e.write(n),e.write("("),o&&(e.newLine(),e.indent()),i==null||i.forEach((u,f)=>{f>0&&(e.write(","),o?e.newLine():e.write(" ")),u.write(e)}),o&&(e.newLine(),e.dedent()),e.write(")")}writeDictionaryLiteral(e,n){var o;if(!n.entries||n.entries.length===0){e.write("[:]");return}e.write("[");let i=!!n.multiline;i&&(e.newLine(),e.indent()),(o=n.entries)==null||o.forEach(([u,f],p)=>{p>0&&(e.write(", "),i&&e.newLine()),u.write(e),e.write(": "),f.write(e)}),i&&(e.newLine(),e.dedent()),e.write("]")}writeArrayLiteral(e,n){var o;if(!n.elements||n.elements.length===0){e.write("[]");return}e.write("[");let i=!!n.multiline;i&&(e.newLine(),e.indent()),(o=n.elements)==null||o.forEach((u,f)=>{f>0&&(e.write(","),i?e.newLine():e.write(" ")),u.write(e)}),i&&(e.newLine(),e.dedent()),e.write("]")}static reference(e){return new this({type:"reference",unsafeName:e})}static memberAccess(e){return new this(N({type:"member-access"},e))}static equals(e,n){return new this({type:"equals",left:e,right:n})}static enumCaseShorthand(e){return new this({type:"enum-case-shorthand",caseName:e})}static functionCall(e){return new this(N({type:"function-call"},e))}static structInitialization(e){return new this(N({type:"struct-initialization"},e))}static classInitialization(e){return new this(N({type:"class-initialization"},e))}static stringLiteral(e){return new this({type:"string-literal",value:e})}static numberLiteral(e){return new this({type:"number-literal",value:e})}static boolLiteral(e){return new this({type:"bool-literal",value:e})}static dateLiteral(e){return new this({type:"date-literal",isoString:e})}static calendarDateLiteral(e){return new this({type:"calendar-date-literal",isoString:e})}static uuidLiteral(e){return new this({type:"uuid-literal",value:e})}static dictionaryLiteral(e){return new this(N({type:"dictionary-literal"},e))}static arrayLiteral(e){return new this(N({type:"array-literal"},e))}static dataLiteral(e){return new this({type:"data-literal",value:e})}static methodCall(e){return new this(N({type:"method-call"},e))}static methodCallWithTrailingClosure(e){return new this(N({type:"method-call-with-trailing-closure"},e))}static contextualMethodCall(e){return new this(N({type:"contextual-method-call"},e))}static try(e){return new this({type:"try",expression:e})}static optionalTry(e){return new this({type:"optional-try",expression:e})}static forceTry(e){return new this({type:"force-try",expression:e})}static await(e){return new this({type:"await",expression:e})}static rawValue(e){return new this({type:"raw-value",value:e})}static nop(){return new this({type:"nop"})}static nil(){return new this({type:"raw-value",value:"nil"})}static self(){return new this({type:"raw-value",value:"self"})}};a();s();a();s();var kt={Var:"var",Let:"let"};var He=class extends b{constructor(e){super();d(this,"internalStatement");this.internalStatement=e}write(e){var n,i,o;switch(this.internalStatement.type){case"typealias-declaration":this.internalStatement.docs!=null&&this.internalStatement.docs.write(e),this.internalStatement.accessLevel&&(e.write(this.internalStatement.accessLevel),e.write(" ")),e.write("typealias "),e.write(this.internalStatement.unsafeName),e.write(" = "),this.internalStatement.aliasedType.write(e),e.newLine();break;case"constant-declaration":e.write(kt.Let),e.write(" "),e.write(U(this.internalStatement.unsafeName)),e.write(" = "),this.internalStatement.value.write(e),this.internalStatement.noTrailingNewline||e.newLine();break;case"variable-declaration":e.write(kt.Var),e.write(" "),e.write(U(this.internalStatement.unsafeName)),e.write(" = "),this.internalStatement.value.write(e),this.internalStatement.noTrailingNewline||e.newLine();break;case"function-declaration":this.internalStatement.docs!=null&&this.internalStatement.docs.write(e),this.internalStatement.accessLevel!=null&&(e.write(this.internalStatement.accessLevel),e.write(" ")),e.write("func "),e.write(U(this.internalStatement.unsafeName)),e.write("("),(n=this.internalStatement.parameters)==null||n.forEach((u,f)=>{f>0&&e.write(", "),u.write(e)}),e.write(")"),this.internalStatement.async&&e.write(" async"),this.internalStatement.throws&&e.write(" throws"),this.internalStatement.returnType&&(e.write(" -> "),this.internalStatement.returnType.write(e)),e.write(" "),((i=this.internalStatement.body)!=null?i:F.empty()).write(e),e.newLine();break;case"variable-assignment":e.write(U(this.internalStatement.unsafeName)),e.write(" = "),this.internalStatement.value.write(e),e.newLine();break;case"self-assignment":e.write("self = "),e.write(this.internalStatement.value.toString()),e.newLine();break;case"property-assignment":e.write("self."),e.write(this.internalStatement.unsafeName),e.write(" = "),this.internalStatement.value.write(e),e.newLine();break;case"discard-assignment":e.write("_ = "),this.internalStatement.value.write(e),e.newLine();break;case"return":e.write("return "),this.internalStatement.expression.write(e),e.newLine();break;case"throw":e.write("throw "),this.internalStatement.expression.write(e),e.newLine();break;case"expression-statement":this.internalStatement.expression.write(e),e.newLine();break;case"import":e.write("import "),e.write(this.internalStatement.moduleName),e.newLine();break;case"switch":e.write("switch "),this.internalStatement.target.write(e),e.write(" {"),e.newLine();for(let u of this.internalStatement.cases)if(e.write("case "),u.pattern.write(e),e.write(":"),e.newLine(),u.body.length>0){e.indent();for(let f of u.body)f.write(e);e.dedent()}if(this.internalStatement.defaultCase&&(e.write("default:"),e.newLine(),this.internalStatement.defaultCase.length>0)){e.indent();for(let u of this.internalStatement.defaultCase)u.write(e);e.dedent()}e.write("}"),e.newLine();break;case"if":{e.write("if "),this.internalStatement.condition.write(e),e.write(" "),F.withStatements(this.internalStatement.body).write(e);for(let u of(o=this.internalStatement.elseIfs)!=null?o:[])e.write(" else if "),u.condition.write(e),e.write(" "),F.withStatements(u.body).write(e);this.internalStatement.else&&(e.write(" else "),F.withStatements(this.internalStatement.else).write(e)),e.newLine();break}case"raw":e.write(this.internalStatement.content),e.newLine();break;default:S(this.internalStatement)}}static typealiasDeclaration(e){return new this(N({type:"typealias-declaration"},e))}static constantDeclaration(e){return new this(N({type:"constant-declaration"},e))}static variableDeclaration(e){return new this(N({type:"variable-declaration"},e))}static functionDeclaration(e){return new this(N({type:"function-declaration"},e))}static variableAssignment(e,n){return new this({type:"variable-assignment",unsafeName:e,value:n})}static selfAssignment(e){return new this({type:"self-assignment",value:e})}static propertyAssignment(e,n){return new this({type:"property-assignment",unsafeName:e,value:n})}static discardAssignment(e){return new this({type:"discard-assignment",value:e})}static return(e){return new this({type:"return",expression:e})}static throw(e){return new this({type:"throw",expression:e})}static expressionStatement(e){return new this({type:"expression-statement",expression:e})}static import(e){return new this({type:"import",moduleName:e})}static switch(e){return new this(N({type:"switch"},e))}static if(e){return new this(N({type:"if"},e))}static raw(e){return new this({type:"raw",content:e})}};var Ke=class extends b{constructor({unsafeName:e,accessLevel:n,type:i,body:o,docs:u}){super();d(this,"unsafeName");d(this,"accessLevel");d(this,"type");d(this,"body");d(this,"docs");this.unsafeName=e,this.accessLevel=n,this.type=i,this.body=o,this.docs=u}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write("var "),e.write(U(this.unsafeName)),e.write(": "),this.type.write(e),e.write(" "),this.body instanceof F?this.body.write(e):this.body instanceof Z?F.withStatements([He.expressionStatement(this.body)]).write(e):S(this.body)}};a();s();var Je=class r extends b{constructor({summary:e,description:n,parameters:i,returns:o,throws:u}){super();d(this,"summary");d(this,"description");d(this,"parameters");d(this,"returns");d(this,"throws");this.summary=r.sanitizeText(e),this.description=n!=null?r.sanitizeText(n):void 0,this.parameters=(i!=null?i:[]).map(f=>({name:f.name,description:r.sanitizeText(f.description)})),this.returns=o!=null?r.sanitizeText(o):void 0,this.throws=(u!=null?u:[]).map(f=>r.sanitizeText(f))}write(e){if(this.writeMultilineText(e,this.summary),this.description!=null&&(e.write("///"),e.newLine(),this.writeMultilineText(e,this.description)),this.parameters.length>0){e.write("///"),e.newLine();for(let n of this.parameters)n.description.split(`
|
|
26
|
-
`).forEach((o,u)=>{u===0?(e.write("/// - Parameter "),e.write(n.name),e.write(": "),e.write(o)):(e.write("/// "),e.write(o)),e.newLine()})}if(this.returns!=null&&this.returns.split(`
|
|
27
|
-
`).forEach((i,o)=>{o===0?(e.write("/// - Returns: "),e.write(i)):(e.write("/// "),e.write(i)),e.newLine()}),this.throws.length>0)for(let n of this.throws)n.split(`
|
|
28
|
-
`).forEach((o,u)=>{u===0?(e.write("/// - Throws: "),e.write(o)):(e.write("/// "),e.write(o)),e.newLine()})}writeMultilineText(e,n){let i=n.split(`
|
|
29
|
-
`);for(let o of i)e.write("/// "),e.write(o),e.newLine()}static sanitizeText(e){return e=e.replace(/\r\n/g,`
|
|
30
|
-
`).replace(/\r/g,`
|
|
31
|
-
`),e=e.replace(/\x00/g,""),e}};a();s();var Ze=class extends b{constructor({accessLevel:e,name:n,conformances:i,cases:o,initializers:u,methods:f,nestedTypes:p,docs:y}){super();d(this,"name");d(this,"accessLevel");d(this,"conformances");d(this,"cases");d(this,"initializers");d(this,"methods");d(this,"nestedTypes");d(this,"docs");this.name=n,this.accessLevel=e,this.conformances=i!=null?i:[],this.cases=o,this.initializers=u!=null?u:[],this.methods=f!=null?f:[],this.nestedTypes=p!=null?p:[],this.docs=y}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write(`enum ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),e.write(" {"),e.newLine(),e.indent(),this.cases.forEach(n=>{n.docs!=null&&n.docs.write(e),e.write("case "),Ne(n.unsafeName)?e.write(`\`${n.unsafeName}\``):e.write(n.unsafeName),e.write("("),n.associatedValue.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write(")"),e.newLine()}),this.initializers.length>0&&(e.newLine(),this.initializers.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),this.methods.length>0&&(e.newLine(),this.methods.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),this.nestedTypes.length>0&&(e.newLine(),this.nestedTypes.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()})),e.dedent(),e.write("}")}};a();s();var Xe=class extends b{constructor({accessLevel:e,name:n,conformances:i,cases:o,docs:u}){super();d(this,"name");d(this,"accessLevel");d(this,"conformances");d(this,"cases");d(this,"docs");this.name=n,this.accessLevel=e,this.conformances=i!=null?i:[],this.cases=o,this.docs=u}write(e){if(this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write(`enum ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),this.cases.length===0){e.write(" {}");return}e.write(" {"),e.newLine(),e.indent(),this.cases.forEach(n=>{n.docs!=null&&n.docs.write(e),e.write("case "),Ne(n.unsafeName)?e.write(`\`${n.unsafeName}\``):e.write(n.unsafeName),n.rawValue!==n.unsafeName&&(e.write(" = "),e.write(`"${Df(n.rawValue)}"`)),e.newLine()}),e.dedent(),e.write("}")}};a();s();var Qe=class extends b{constructor({name:e,conformances:n,initializers:i,computedProperties:o,methods:u,nestedTypes:f,docs:p}){super();d(this,"name");d(this,"conformances");d(this,"initializers");d(this,"computedProperties");d(this,"methods");d(this,"nestedTypes");d(this,"docs");this.name=e,this.conformances=n!=null?n:[],this.initializers=i!=null?i:[],this.computedProperties=o!=null?o:[],this.methods=u!=null?u:[],this.nestedTypes=f!=null?f:[],this.docs=p}write(e){this.docs!=null&&this.docs.write(e),e.write(`extension ${this.name}`),this.conformances.forEach((n,i)=>{i===0?e.write(": "):i>0&&e.write(", "),e.write(n)}),e.write(" {"),this.initializers.length>0&&(e.newLine(),e.indent(),this.initializers.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),this.computedProperties.length>0&&(e.newLine(),e.indent(),this.computedProperties.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),this.methods.length>0&&(e.newLine(),e.indent(),this.methods.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),this.nestedTypes.length>0&&(e.newLine(),e.indent(),this.nestedTypes.forEach((n,i)=>{i>0&&e.newLine(),n.write(e),e.newLine()}),e.dedent()),e.write("}")}};a();s();var et=class extends b{constructor({label:e,value:n}){super();d(this,"label");d(this,"value");this.label=e,this.value=n}write(e){this.label!=null&&(e.write(this.label),e.write(": ")),this.value.write(e)}};a();s();var tt=class extends b{constructor({argumentLabel:e,unsafeName:n,escaping:i,type:o,defaultValue:u,docsContent:f}){super();d(this,"argumentLabel");d(this,"unsafeName");d(this,"escaping");d(this,"type");d(this,"defaultValue");d(this,"docsContent");this.argumentLabel=e,this.unsafeName=n,this.escaping=i,this.type=o,this.defaultValue=u,this.docsContent=f}write(e){this.argumentLabel==null?e.write("_ "):this.argumentLabel!==this.unsafeName&&(e.write(this.argumentLabel),e.write(" ")),e.write(this.unsafeName),e.write(": "),this.escaping&&e.write("@escaping "),this.type.write(e),this.defaultValue!=null&&(e.write(" = "),this.defaultValue.write(e))}};a();s();var rt=class extends b{constructor({accessLevel:e,convenience:n,failable:i,throws:o,parameters:u,body:f,multiline:p,docs:y}){super();d(this,"accessLevel");d(this,"convenience");d(this,"failable");d(this,"throws");d(this,"parameters");d(this,"body");d(this,"multiline");d(this,"docs");this.accessLevel=e,this.convenience=n,this.failable=i,this.throws=o,this.parameters=u!=null?u:[],this.body=f!=null?f:F.empty(),this.multiline=p,this.docs=y}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.convenience&&e.write("convenience "),e.write("init"),this.failable&&e.write("?"),e.write("("),this.multiline&&(e.newLine(),e.indent()),this.parameters.forEach((n,i)=>{i>0&&(e.write(","),this.multiline?e.newLine():e.write(" ")),n.write(e)}),this.multiline&&(e.newLine(),e.dedent()),e.write(") "),this.throws&&e.write("throws "),this.body.write(e)}};a();s();var Ur=class r extends b{constructor({count:e=1}={}){super();d(this,"count");this.count=e}write(e){for(let n=0;n<this.count;n++)e.newLine()}static single(){return new r({count:1})}static double(){return new r({count:2})}static multiple(e){return new r({count:e})}};a();s();var nt=class extends b{constructor({attributes:e,unsafeName:n,accessLevel:i,static_:o,parameters:u,async:f,throws:p,returnType:y,body:g,docs:x}){super();d(this,"attributes");d(this,"unsafeName");d(this,"accessLevel");d(this,"static_");d(this,"parameters");d(this,"async");d(this,"throws");d(this,"returnType");d(this,"body");d(this,"docs");this.attributes=e!=null?e:[],this.unsafeName=n,this.accessLevel=i,this.static_=o,this.parameters=u!=null?u:[],this.async=f,this.throws=p,this.returnType=y,this.body=g!=null?g:F.empty(),this.docs=x}write(e){this.docs!=null&&this.docs.write(e),this.attributes.forEach(n=>{var i;(i=n.arguments)!=null&&i.length?Z.functionCall({unsafeName:`@${n.name}`,arguments_:n.arguments}).write(e):(e.write("@"),e.write(n.name)),e.write(" ")}),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.static_&&e.write("static "),e.write("func "),e.write(U(this.unsafeName)),e.write("("),this.parameters.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write(")"),this.async&&e.write(" async"),this.throws&&e.write(" throws"),e.write(" -> "),this.returnType.write(e),e.write(" "),this.body.write(e)}};a();s();var kr=class extends b{constructor(e){super();d(this,"internalPattern");this.internalPattern=e}write(e){switch(this.internalPattern.type){case"enum-case-value-binding":e.write("."),e.write(this.internalPattern.caseName),e.write("("),e.write(this.internalPattern.declarationType),e.write(" "),e.write(this.internalPattern.referenceName),e.write(")");break;default:S(this.internalPattern.type)}}static enumCaseValueBinding(e){return new this(N({type:"enum-case-value-binding"},e))}};a();s();var it=class extends b{constructor({unsafeName:e,accessLevel:n,static_:i,declarationType:o,type:u,defaultValue:f,docs:p}){super();d(this,"unsafeName");d(this,"accessLevel");d(this,"static_");d(this,"declarationType");d(this,"type");d(this,"defaultValue");d(this,"docs");this.unsafeName=e,this.accessLevel=n,this.static_=i,this.declarationType=o,this.type=u,this.defaultValue=f,this.docs=p}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),this.static_&&e.write("static "),e.write(this.declarationType),e.write(" "),Ne(this.unsafeName)?e.write(`\`${this.unsafeName}\``):e.write(this.unsafeName),e.write(": "),this.type.write(e),this.defaultValue!=null&&(e.write(" = "),this.defaultValue.write(e))}};a();s();var Uf={CaseIterable:"CaseIterable",Codable:"Codable",CodingKey:"CodingKey",Decodable:"Decodable",Encodable:"Encodable",Equatable:"Equatable",Error:"Error",Hashable:"Hashable",Sendable:"Sendable",MultipartFormDataConvertible:"MultipartFormDataConvertible"};a();s();var ot=class extends b{constructor({attributes:e,accessLevel:n,name:i,conformances:o,properties:u,initializers:f,methods:p,nestedTypes:y,docs:g}){super();d(this,"attributes");d(this,"name");d(this,"accessLevel");d(this,"conformances");d(this,"properties");d(this,"initializers");d(this,"methods");d(this,"nestedTypes");d(this,"docs");this.attributes=e!=null?e:[],this.name=i,this.accessLevel=n,this.conformances=o!=null?o:[],this.properties=u!=null?u:[],this.initializers=f!=null?f:[],this.methods=p!=null?p:[],this.nestedTypes=y!=null?y:[],this.docs=g}write(e){this.docs!=null&&this.docs.write(e),this.attributes.forEach(p=>{var y;(y=p.arguments)!=null&&y.length?Z.functionCall({unsafeName:`@${p.name}`,arguments_:p.arguments}).write(e):(e.write("@"),e.write(p.name)),e.write(" ")}),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write(`struct ${this.name}`),this.conformances.forEach((p,y)=>{y===0?e.write(": "):y>0&&e.write(", "),e.write(p)}),e.write(" {"),e.newLine(),e.indent();let n=this.properties.length>0,i=this.initializers.length>0,o=this.methods.length>0,u=this.nestedTypes.length>0;this.properties.forEach(p=>{p.write(e),e.newLine()});let f=n;i&&(f&&e.newLine(),this.initializers.forEach((p,y)=>{y>0&&e.newLine(),p.write(e),e.newLine()}),f=!0),o&&(f&&e.newLine(),this.methods.forEach((p,y)=>{y>0&&e.newLine(),p.write(e),e.newLine()}),f=!0),u&&(f&&e.newLine(),this.nestedTypes.forEach((p,y)=>{y>0&&e.newLine(),p.write(e),e.newLine()})),e.dedent(),e.write("}")}};a();s();var j={String:{type:"string",symbolName:"String"},Bool:{type:"bool",symbolName:"Bool"},Int:{type:"int",symbolName:"Int"},Int64:{type:"int64",symbolName:"Int64"},UInt:{type:"uint",symbolName:"UInt"},UInt64:{type:"uint64",symbolName:"UInt64"},Float:{type:"float",symbolName:"Float"},Double:{type:"double",symbolName:"Double"},Void:{type:"void",symbolName:"Void"},Any:{type:"any",symbolName:"Any"}},$r={Data:{type:"data",symbolName:"Data"},Date:{type:"date",symbolName:"Date"},UUID:{type:"uuid",symbolName:"UUID"}},_r=class r extends b{constructor(e){super();d(this,"internalType");this.internalType=e}get type(){return this.internalType.type}get nonOptionalType(){return this.internalType.type==="optional"?this.internalType.valueType.nonOptionalType:this.internalType.type}get nonNullableType(){return this.internalType.type==="nullable"?this.internalType.valueType.nonNullableType:this.internalType.type}get isOptional(){return this.internalType.type==="optional"}get isNullable(){return this.internalType.type==="nullable"}get isOptionalNullable(){return this.isOptional&&this.nonOptional().isNullable}nonOptional(){return r.nonOptional(this)}nonNullable(){return r.nonNullable(this)}equals(e){switch(this.internalType.type){case"string":case"bool":case"int":case"int64":case"uint":case"uint64":case"float":case"double":case"void":case"any":case"data":case"date":case"uuid":case"json-value":return this.internalType.type===e.internalType.type;case"tuple":{if(e.internalType.type!=="tuple"||this.internalType.elements.length!==e.internalType.elements.length)return!1;for(let n=0;n<this.internalType.elements.length;n++){let i=this.internalType.elements[n],o=e.internalType.elements[n];if(!i||!o||!i.equals(o))return!1}return!0}case"array":return e.internalType.type==="array"&&this.internalType.elementType.equals(e.internalType.elementType);case"dictionary":return e.internalType.type==="dictionary"&&this.internalType.keyType.equals(e.internalType.keyType)&&this.internalType.valueType.equals(e.internalType.valueType);case"optional":return e.internalType.type=="optional"&&this.internalType.valueType.equals(e.internalType.valueType);case"nullable":return e.internalType.type==="nullable"&&this.internalType.valueType.equals(e.internalType.valueType);case"custom":return e.internalType.type==="custom"&&this.internalType.name===e.internalType.name;case"existential-any":return e.internalType.type==="existential-any"&&this.internalType.protocolName===e.internalType.protocolName;case"calendar-date":return e.internalType.type==="calendar-date";default:S(this.internalType)}}toCaseName(){return r.toCaseName(this)}static toCaseName(e){switch(e.internalType.type){case"string":return"string";case"bool":return"bool";case"int":return"int";case"int64":return"int64";case"uint":return"uint";case"uint64":return"uint64";case"float":return"float";case"double":return"double";case"void":return"void";case"any":return"any";case"data":return"data";case"date":return"date";case"uuid":return"uuid";case"tuple":{let n=e.internalType.elements.map(i=>r.toCaseName(i)).join("And");return`tuple${B(n)}`}case"array":return`${Br(r.toCaseName(e.internalType.elementType))}Array`;case"dictionary":{let n=Br(r.toCaseName(e.internalType.keyType)),i=B(r.toCaseName(e.internalType.valueType));return`${n}To${i}Dictionary`}case"optional":return`optional${B(r.toCaseName(e.internalType.valueType))}`;case"nullable":return`nullable${B(r.toCaseName(e.internalType.valueType))}`;case"custom":return q(e.internalType.name);case"existential-any":return`any${B(e.internalType.protocolName)}`;case"calendar-date":return"calendarDate";case"json-value":return"json";default:S(e.internalType)}}write(e){switch(this.internalType.type){case"string":e.write("String");break;case"bool":e.write("Bool");break;case"int":e.write("Int");break;case"int64":e.write("Int64");break;case"uint":e.write("UInt");break;case"uint64":e.write("UInt64");break;case"float":e.write("Float");break;case"double":e.write("Double");break;case"void":e.write("Void");break;case"any":e.write("Any");break;case"data":e.write("Data");break;case"date":e.write("Date");break;case"uuid":e.write("UUID");break;case"tuple":e.write("("),this.internalType.elements.forEach((n,i)=>{i>0&&e.write(", "),n.write(e)}),e.write(")");break;case"array":e.write("["),this.internalType.elementType.write(e),e.write("]");break;case"dictionary":e.write("["),this.internalType.keyType.write(e),e.write(": "),this.internalType.valueType.write(e),e.write("]");break;case"optional":this.internalType.valueType.write(e),e.write("?");break;case"nullable":e.write("Nullable<"),this.internalType.valueType.write(e),e.write(">");break;case"custom":e.write(this.internalType.name);break;case"existential-any":e.write("any "),e.write(this.internalType.protocolName);break;case"calendar-date":e.write("CalendarDate");break;case"json-value":e.write("JSONValue");break;default:S(this.internalType)}}static primitiveSymbolNames(){return qr(j).map(e=>e.symbolName)}static foundationSymbolNames(){return qr($r).map(e=>e.symbolName)}static string(){return new this(j.String)}static bool(){return new this(j.Bool)}static int(){return new this(j.Int)}static uint(){return new this(j.UInt)}static uint64(){return new this(j.UInt64)}static int64(){return new this(j.Int64)}static float(){return new this(j.Float)}static double(){return new this(j.Double)}static void(){return new this(j.Void)}static any(){return new this(j.Any)}static data(){return new this($r.Data)}static date(){return new this($r.Date)}static uuid(){return new this($r.UUID)}static tuple(e){return new this({type:"tuple",elements:e})}static array(e){return new this({type:"array",elementType:e})}static dictionary(e,n){return new this({type:"dictionary",keyType:e,valueType:n})}static optional(e){return e.internalType.type==="optional"?e:new this({type:"optional",valueType:e})}static nullable(e){return new this({type:"nullable",valueType:e})}static nonOptional(e){return e.internalType.type==="optional"?r.nonOptional(e.internalType.valueType):e}static nonNullable(e){return e.internalType.type==="nullable"?r.nonNullable(e.internalType.valueType):e}static custom(e){return new this({type:"custom",name:e})}static existentialAny(e){return new this({type:"existential-any",protocolName:e})}static calendarDate(){return new this({type:"calendar-date"})}static jsonValue(){return new this({type:"json-value"})}};a();s();var Wr=class r extends b{constructor(e){super();d(this,"variant");this.variant=e}nonOptional(){return r.nonOptional(this)}nonNullable(){return r.nonNullable(this)}getReferenceIfSymbolType(){return this.variant.type==="symbol"?this.variant.symbol:null}write(e){let{variant:n}=this;switch(n.type){case"symbol":e.write(n.symbol);break;case"generic":{n.reference.write(e),n.arguments.length>0&&(e.write("<"),n.arguments.forEach((i,o)=>{i.write(e),o<n.arguments.length-1&&e.write(", ")}),e.write(">"));break}case"tuple":e.write("("),n.elements.forEach((i,o)=>{o>0&&e.write(", "),i.write(e)}),e.write(")");break;case"array":e.write("["),n.elementType.write(e),e.write("]");break;case"dictionary":e.write("["),n.keyType.write(e),e.write(": "),n.valueType.write(e),e.write("]");break;case"optional":n.valueType.write(e),e.write("?");break;case"nullable":e.write("Nullable<"),n.valueType.write(e),e.write(">");break;case"member-access":n.target.write(e),e.write("."),e.write(n.memberName);break;default:S(n)}}equals(e){switch(this.variant.type){case"symbol":return e.variant.type==="symbol"&&this.variant.symbol===e.variant.symbol;case"generic":return e.variant.type==="generic"&&this.variant.reference.equals(e.variant.reference)&&this.variant.arguments.every((n,i)=>e.variant.type==="generic"&&e.variant.arguments[i]&&n.equals(e.variant.arguments[i]));case"tuple":return e.variant.type==="tuple"&&this.variant.elements.every((n,i)=>e.variant.type==="tuple"&&e.variant.elements[i]&&n.equals(e.variant.elements[i]));case"array":return e.variant.type==="array"&&this.variant.elementType.equals(e.variant.elementType);case"dictionary":return e.variant.type==="dictionary"&&this.variant.keyType.equals(e.variant.keyType)&&this.variant.valueType.equals(e.variant.valueType);case"optional":return e.variant.type=="optional"&&this.variant.valueType.equals(e.variant.valueType);case"nullable":return e.variant.type==="nullable"&&this.variant.valueType.equals(e.variant.valueType);case"member-access":return e.variant.type==="member-access"&&this.variant.target.equals(e.variant.target)&&this.variant.memberName===e.variant.memberName;default:S(this.variant)}}static symbol(e){return new this({type:"symbol",symbol:e})}static generic(e,n){return new this({type:"generic",reference:e,arguments:n})}static tuple(e){return new this({type:"tuple",elements:e})}static array(e){return new this({type:"array",elementType:e})}static dictionary(e,n){return new this({type:"dictionary",keyType:e,valueType:n})}static optional(e){return e.variant.type==="optional"?e:new this({type:"optional",valueType:e})}static nullable(e){return e.variant.type==="nullable"?e:new this({type:"nullable",valueType:e})}static memberAccess(e,n){return new this({type:"member-access",target:e,memberName:n})}static nonOptional(e){return e.variant.type==="optional"?r.nonOptional(e.variant.valueType):e}static nonNullable(e){return e.variant.type==="nullable"?r.nonNullable(e.variant.valueType):e}static unqualifiedToSwiftType(e){return r.symbol(e)}static unqualifiedToFoundationType(e){return r.symbol(e)}};a();s();a();s();var w=class w{constructor(t,e,n){d(this,"id");d(this,"name");d(this,"shape");this.id=t,this.name=e,this.shape=n}static isSwiftSymbol(t){return w.SWIFT_SYMBOL_ID===t||t.startsWith(`${w.SWIFT_SYMBOL_ID}.`)}static isSwiftSymbolName(t){return t in w.swiftTypeSymbolsByName}static isFoundationSymbol(t){return w.FOUNDATION_SYMBOL_ID===t||t.startsWith(`${w.FOUNDATION_SYMBOL_ID}.`)}static isFoundationSymbolName(t){return t in w.foundationTypeSymbolsByName}static isCustomSymbol(t){return!w.isSwiftSymbol(t)&&!w.isFoundationSymbol(t)}static create(t,e,n){return new w(t,e,n)}static swiftType(t){return w.create(`${w.SWIFT_SYMBOL_ID}.${t}`,t,{type:"system"})}static foundationType(t){return w.create(`${w.FOUNDATION_SYMBOL_ID}.${t}`,t,{type:"system"})}get isSwiftSymbol(){return w.isSwiftSymbol(this.id)}get isFoundationSymbol(){return w.isFoundationSymbol(this.id)}get isCustomSymbol(){return w.isCustomSymbol(this.id)}};d(w,"SWIFT_SYMBOL_NAME","Swift"),d(w,"SWIFT_SYMBOL_ID",w.SWIFT_SYMBOL_NAME),d(w,"swiftTypeSymbolsByName",{String:w.swiftType("String"),Bool:w.swiftType("Bool"),Int:w.swiftType("Int"),Int64:w.swiftType("Int64"),UInt:w.swiftType("UInt"),UInt64:w.swiftType("UInt64"),Float:w.swiftType("Float"),Double:w.swiftType("Double"),Void:w.swiftType("Void"),Encoder:w.swiftType("Encoder"),Decoder:w.swiftType("Decoder"),Any:w.swiftType("Any")}),d(w,"swiftTypeSymbols",Object.values(w.swiftTypeSymbolsByName)),d(w,"FOUNDATION_SYMBOL_NAME","Foundation"),d(w,"FOUNDATION_SYMBOL_ID",w.FOUNDATION_SYMBOL_NAME),d(w,"foundationTypeSymbolsByName",{Data:w.foundationType("Data"),Date:w.foundationType("Date"),URLSession:w.foundationType("URLSession"),UUID:w.foundationType("UUID")}),d(w,"foundationTypeSymbols",Object.values(w.foundationTypeSymbolsByName));var O=w;a();s();a();s();a();s();a();s();var jr=class{constructor(t,e){d(this,"id");d(this,"name");d(this,"childrenByName");this.id=t,this.name=e,this.childrenByName=new Map}get children(){return Array.from(this.childrenByName.values())}addChild(t){if(this.childrenByName.has(t.name))throw new Error(`A child with the name '${t.name}' already exists in module '${this.name}'.`);this.childrenByName.set(t.name,t)}getChildByName(t){return this.childrenByName.get(t)}},zr=class extends jr{constructor(e,n){super(e,n);d(this,"kind","module");d(this,"imports");d(this,"parent",null);this.imports=[]}addImport(e){this.imports.push(e)}get qualifiedPath(){return[this.name]}get qualifiedName(){return this.name}},Vr=class extends jr{constructor(e,n,i){super(n,e);d(this,"kind","type");d(this,"shape");d(this,"parent");this.parent=null,this.shape=i}getNearestModuleAncestorOrThrow(){let e=this.parent;for(;e!==null&&e.kind!=="module";)e=e.parent;return _(e,`No module ancestor found for type symbol '${this.id}'`),e}get qualifiedPath(){var e,n;return[...(n=(e=this.parent)==null?void 0:e.qualifiedPath)!=null?n:[],this.name]}get qualifiedName(){return this.qualifiedPath.join(".")}};var $t=class{constructor(){d(this,"symbolsById",new Map)}createModuleSymbol({symbolId:t,symbolName:e}){this.validateSymbolNotExists(t);let n=new zr(t,e);return this.symbolsById.set(t,n),n}createTypeSymbol({symbolId:t,symbolName:e,shape:n}){this.validateSymbolNotExists(t);let i=new Vr(e,t,n);return this.symbolsById.set(t,i),i}addImportRelation({clientSymbolId:t,importedSymbolId:e}){let n=this.getSymbolByIdOrThrow(t),i=this.getSymbolByIdOrThrow(e);if(n.kind!=="module"||i.kind!=="module")throw new Error(`Client module '${n.id}' and imported module '${i.id}' must both be module symbols.`);n.addImport(i)}nestSymbol({parentSymbolId:t,childSymbolId:e}){let n=this.getSymbolByIdOrThrow(t),i=this.getSymbolByIdOrThrow(e);n.addChild(i),i.parent=n}reference({fromSymbolId:t,targetSymbolId:e}){let n=this.getSymbolByIdOrThrow(t),i=this.getSymbolByIdOrThrow(e),o=i.qualifiedPath;for(let u=1;u<=o.length;u++){let f=o.slice(o.length-u),p=this.resolvePath(n,f);if((p==null?void 0:p.id)===i.id)return f.join(".")}return i.qualifiedName}resolveReference({fromSymbolId:t,reference:e}){let n=this.getSymbolByIdOrThrow(t),i=e.split(".").filter(o=>o.length>0);return this.resolvePath(n,i)}resolvePath(t,e){var f;let[n,...i]=e;if(n===void 0)return null;let o=this.resolveFirstSegment(t,n);if(o===null)return null;let u=o;for(let p=0;p<i.length;p++){let y=i[p];if(Cr(y),u=(f=u.getChildByName(y))!=null?f:null,u===null)return null}return u}resolveFirstSegment(t,e){let n=t;for(;n!==null;){let u=n.getChildByName(e);if(u)return u;n=n.parent}let i=t.kind==="module"?t:t.getNearestModuleAncestorOrThrow();if(i.name===e)return i;for(let u of i.imports)if(u.name===e)return u;let o=null;for(let u of i.imports){let f=u.getChildByName(e);if(f){if(o!=null&&o.id!==f.id)return null;o=f}}return o}getSymbolByIdOrThrow(t){let e=this.symbolsById.get(t);return Cr(e,`A symbol with the ID '${t}' was not found in the registry.`),e}getSymbolById(t){var e;return(e=this.symbolsById.get(t))!=null?e:null}validateSymbolNotExists(t){if(this.symbolsById.has(t))throw new Error(`A symbol with the ID '${t}' already exists in the registry.`)}};var Gr=class r{constructor(t,e,n){d(this,"graph");d(this,"swiftSymbol");d(this,"foundationSymbol");d(this,"registeredSourceModule");d(this,"registeredTestModule");this.graph=t,this.swiftSymbol=e,this.foundationSymbol=n,this.registeredSourceModule=null,this.registeredTestModule=null}static create(){let{graph:t,swiftSymbol:e,foundationSymbol:n}=r.createGraph();return new r(t,e,n)}static createGraph(){let t=new $t,e=()=>{let u=t.createModuleSymbol({symbolId:O.SWIFT_SYMBOL_ID,symbolName:O.SWIFT_SYMBOL_NAME});return O.swiftTypeSymbols.forEach(f=>{let p=t.createTypeSymbol({symbolId:f.id,symbolName:f.name,shape:{type:"system"}});t.nestSymbol({parentSymbolId:u.id,childSymbolId:p.id})}),u},n=()=>{let u=t.createModuleSymbol({symbolId:O.FOUNDATION_SYMBOL_ID,symbolName:O.FOUNDATION_SYMBOL_NAME});return O.foundationTypeSymbols.forEach(f=>{let p=t.createTypeSymbol({symbolId:f.id,symbolName:f.name,shape:{type:"system"}});t.nestSymbol({parentSymbolId:u.id,childSymbolId:p.id})}),u},i=e(),o=n();return{graph:t,swiftSymbol:i,foundationSymbol:o}}getRegisteredSourceModuleSymbolOrThrow(){return _(this.registeredSourceModule,"Module symbol not found."),O.create(this.registeredSourceModule.id,this.registeredSourceModule.name,{type:"other"})}getRegisteredTestModuleSymbolOrThrow(){return _(this.registeredTestModule,"Module symbol not found."),O.create(this.registeredTestModule.id,this.registeredTestModule.name,{type:"other"})}getSymbolByIdOrThrow(t){let e=this.graph.getSymbolById(t);return _(e,`Symbol with ID '${t}' not found in registry.`),O.create(e.id,e.name,e.kind==="type"?e.shape:{type:"other"})}registerSourceModule(t){let e=t,n=this.graph.createModuleSymbol({symbolId:e,symbolName:t});return n.addImport(this.swiftSymbol),n.addImport(this.foundationSymbol),this.registeredSourceModule=n,O.create(n.id,n.name,{type:"other"})}registerTestModule(t){let e=t,n=this.graph.createModuleSymbol({symbolId:e,symbolName:t});return n.addImport(this.swiftSymbol),n.addImport(this.foundationSymbol),_(this.registeredSourceModule,"Cannot register a test module before registering a source module."),n.addImport(this.registeredSourceModule),this.registeredTestModule=n,O.create(n.id,n.name,{type:"other"})}registerSourceModuleType(t,e){_(this.registeredSourceModule,"Cannot register a type before registering a module.");let n=this.inferSymbolIdForSourceModuleType(t),i=this.graph.createTypeSymbol({symbolId:n,symbolName:t,shape:e});return this.graph.nestSymbol({parentSymbolId:this.registeredSourceModule.id,childSymbolId:i.id}),O.create(i.id,i.name,e)}registerTestModuleType(t,e){_(this.registeredTestModule,"Cannot register a type before registering a module.");let n=this.inferSymbolIdForTestModuleType(t),i=this.graph.createTypeSymbol({symbolId:n,symbolName:t,shape:e});return this.graph.nestSymbol({parentSymbolId:this.registeredTestModule.id,childSymbolId:i.id}),O.create(i.id,i.name,e)}registerNestedType({parentSymbol:t,symbolName:e,shape:n}){let i=typeof t=="string"?t:t.id,o=this.inferSymbolIdForNestedType(i,e),u=this.graph.createTypeSymbol({symbolId:o,symbolName:e,shape:n});return this.graph.nestSymbol({parentSymbolId:i,childSymbolId:u.id}),O.create(u.id,u.name,n)}reference({fromSymbol:t,toSymbol:e}){let n=typeof t=="string"?t:t.id,i=typeof e=="string"?e:e.id;return this.graph.reference({fromSymbolId:n,targetSymbolId:i})}resolveReference({fromSymbol:t,reference:e}){let n=typeof t=="string"?t:t.id,i=this.graph.resolveReference({fromSymbolId:n,reference:e});return i?O.create(i.id,i.name,i.kind==="type"?i.shape:{type:"other"}):null}inferSymbolIdForSourceModuleType(t){return _(this.registeredSourceModule,"Cannot get symbol id for a type before registering a module."),`${this.registeredSourceModule.id}.${t}`}inferSymbolIdForTestModuleType(t){return _(this.registeredTestModule,"Cannot get symbol id for a type before registering a module."),`${this.registeredTestModule.id}.${t}`}inferSymbolIdForNestedType(t,e){return`${t}.${e}`}};function Px(r){return new Ge(r)}function Fx(r){return new F(r)}function Bx(r){return new Ye(r)}function qx(r){return new Ke(r)}function Mx(r){return new Je(r)}function Dx(r){return new Ze(r)}function Ux(r){return new Xe(r)}function kx(r){return new Qe(r)}function $x(r){return new et(r)}function _x(r){return new tt(r)}function Wx(r){return new rt(r)}function jx(r){return new nt(r)}function zx(r){return new it(r)}function Vx(r){return new ot(r)}a();s();var at=class{constructor({context:t}){d(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return m.Type.array(this.convert({typeReference:t.typeReference.value}));case"literal":return this.convertLiteral({literal:t.typeReference.value});case"map":return m.Type.dictionary(this.convert({typeReference:t.typeReference.key}),this.convert({typeReference:t.typeReference.value}));case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?this.convertUnknown():this.convertNamed({named:e})}case"optional":return m.Type.optional(this.convert({typeReference:t.typeReference.value}));case"nullable":return m.Type.nullable(this.convert({typeReference:t.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:t.typeReference.value});case"set":return m.Type.jsonValue();case"unknown":return this.convertUnknown();default:S(t.typeReference)}}convertNamed({named:t}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return m.Type.custom(t.declaration.name.pascalCase.unsafeName);default:S(t)}}convertLiteral({literal:t}){switch(t.type){case"boolean":return m.Type.bool();case"string":return m.Type.custom(Dt(t.value))}}convertUnknown(){return m.Type.jsonValue()}convertPrimitive({primitive:t}){switch(t){case"INTEGER":return m.Type.int();case"UINT":return m.Type.int();case"LONG":return m.Type.int64();case"UINT_64":return m.Type.uint64();case"FLOAT":return m.Type.float();case"DOUBLE":return m.Type.double();case"BOOLEAN":return m.Type.bool();case"STRING":return m.Type.string();case"DATE":return m.Type.date();case"DATE_TIME":return m.Type.date();case"UUID":return m.Type.uuid();case"BASE_64":return m.Type.string();case"BIG_INTEGER":return m.Type.string();default:S(t)}}};var Yr=class{constructor({context:t}){d(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":{if(t.typeReference.value.type==="string")return m.Expression.enumCaseShorthand(Ut.generateEnumCaseLabel(t.typeReference.value.value));if(t.typeReference.value.type==="boolean")return m.Expression.nop();S(t.typeReference.value);break}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?m.Expression.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"nullable":return this.convertNullable({nullable:t.typeReference,value:t.value,as:t.as});case"optional":return this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return m.Expression.nop();case"unknown":return this.convertUnknown(t.value);default:S(t.typeReference)}}convertList({list:t,value:e}){return Array.isArray(e)?m.Expression.arrayLiteral({elements:e.map((n,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:t,value:n})}finally{this.context.errors.unscope()}}),multiline:!0}):(this.context.errors.add({severity:T.Critical,message:`Expected array but got: ${typeof e}`}),m.Expression.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}`}),m.Expression.nop()):m.Expression.dictionaryLiteral({entries:Object.entries(e).map(([n,i])=>{this.context.errors.scope(n);try{return[this.convert({typeReference:t.key,value:n,as:"mapKey"}),this.convert({typeReference:t.value,value:i,as:"mapValue"})]}finally{this.context.errors.unscope()}}),multiline:!0})}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,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:S(t)}}convertNullable({nullable:t,value:e,as:n}){return e==null?m.Expression.enumCaseShorthand("null"):m.Expression.contextualMethodCall({methodName:"value",arguments_:[m.functionArgument({value:this.convert({typeReference:t.value,value:e,as:n})})]})}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let n=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(n==null)return m.Expression.nop();let i=n.singleDiscriminatedUnionType,o=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});return o==null?m.Expression.nop():m.Expression.methodCall({target:m.Expression.reference(t.declaration.name.pascalCase.unsafeName),methodName:Ve.sanitizeToCamelCase(i.discriminantValue.name.camelCase.unsafeName),arguments_:[m.functionArgument({value:m.Expression.contextualMethodCall({methodName:"init",arguments_:o,multiline:!0})})],multiline:!0})}convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:t,unionVariant:e}){var i;let n=this.getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e});switch(e.type){case"samePropertiesAsObject":{let o=this.context.resolveNamedType({typeId:e.typeId});if(o==null)return;let u=this.convertNamed({named:o,value:t.value});if(!u.isStructInitialization()){this.context.errors.add({severity:T.Critical,message:"Internal error; expected union value to be a struct"});return}let f=u.asStructInitializationOrThrow();return[...n,...(i=f.arguments_)!=null?i:[]]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let o=this.context.getRecord(t.value);return o==null?[...n]:[...n,m.functionArgument({label:ye(Ve.sanitizeToCamelCase(e.discriminantValue.name.camelCase.unsafeName)),value:this.convert({typeReference:e.typeReference,value:o[e.discriminantValue.wireValue]})})]}finally{this.context.errors.unscope()}case"noProperties":return n;default:S(e)}}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i;return this.context.getExampleObjectProperties({parameters:(i=e.properties)!=null?i:[],snippetObject:t.value}).map(o=>{this.context.errors.scope(o.name.wireValue);try{return m.functionArgument({label:ye(o.name.name.camelCase.unsafeName),value:this.convert(o)})}finally{this.context.errors.unscope()}})}convertEnum({enum_:t,value:e}){let n=this.getEnumValue({enum_:t,value:e});return n==null?m.Expression.nop():m.Expression.enumCaseShorthand(n.name.camelCase.unsafeName)}getEnumValue({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 n}convertObject({object_:t,value:e,as:n}){return m.Expression.structInitialization({unsafeName:t.declaration.name.pascalCase.unsafeName,arguments_:this.context.getExampleObjectProperties({parameters:t.properties,snippetObject:e}).map(i=>this.convert(i).isNop()?null:m.functionArgument({label:ye(i.name.name.camelCase.unsafeName),value:this.convert(i)})).filter(i=>i!=null),multiline:!0})}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});return n==null?m.Expression.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{let i=this.convert({typeReference:n,value:e}),u=new at({context:this.context}).convert({typeReference:n});return m.Expression.methodCall({target:m.Expression.reference(t.declaration.name.pascalCase.unsafeName),methodName:u.toCaseName(),arguments_:[m.functionArgument({value:i})],multiline:!0})}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(t){switch(typeof t){case"boolean":return m.Expression.contextualMethodCall({methodName:"bool",arguments_:[m.functionArgument({value:m.Expression.boolLiteral(t)})]});case"string":return m.Expression.contextualMethodCall({methodName:"string",arguments_:[m.functionArgument({value:m.Expression.stringLiteral(t)})]});case"number":return m.Expression.contextualMethodCall({methodName:"number",arguments_:[m.functionArgument({value:m.Expression.numberLiteral(t)})]});case"object":return t===null?m.Expression.enumCaseShorthand("null"):Array.isArray(t)?m.Expression.contextualMethodCall({methodName:"array",arguments_:[m.functionArgument({value:m.Expression.arrayLiteral({elements:t.map(e=>this.convertUnknown(e)),multiline:!0})})]}):m.Expression.contextualMethodCall({methodName:"object",arguments_:[m.functionArgument({value:m.Expression.dictionaryLiteral({entries:Object.entries(t).map(([e,n])=>[m.Expression.stringLiteral(e),this.convertUnknown(n)]),multiline:!0})})]});default:throw new Error(`Internal error; unsupported unknown type: ${typeof t}`)}}convertPrimitive({primitive:t,value:e,as:n}){switch(t){case"INTEGER":case"UINT":case"LONG":case"UINT_64":case"FLOAT":case"DOUBLE":{let i=this.getValueAsNumber({value:e,as:n});return i==null?m.Expression.nop():m.Expression.numberLiteral(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:n});return i==null?m.Expression.nop():m.Expression.boolLiteral(i)}case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.stringLiteral(i)}case"DATE":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.calendarDateLiteral(i)}case"DATE_TIME":{let i=this.context.getValueAsString({value:e});if(i==null)return m.Expression.nop();let o=new Date(i).getTime(),u=Math.round(o/1e3),p=new Date(u*1e3).toISOString().replace(/\.\d{3}Z$/,"Z");return m.Expression.dateLiteral(p)}case"UUID":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.uuidLiteral(i)}case"BASE_64":{let i=this.context.getValueAsString({value:e});return i==null?m.Expression.nop():m.Expression.stringLiteral(i)}case"BIG_INTEGER":return this.context.getValueAsString({value:e})==null?m.Expression.nop():m.Expression.nop();default:S(t)}}getValueAsNumber({value:t,as:e}){let n=e==="mapKey"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:t,as:e}){let n=(()=>{switch(e){case"mapKey":return t==="true"?!0:t==="false"?!1:t;case"mapValue":case void 0:return t;default:S(e)}})();return this.context.getValueAsBoolean({value:n})}};a();s();var Hr=class{constructor({context:t}){d(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var o;let n={fileFields:[],bodyPropertyFields:[]},i=(o=this.context.getRecord(e))!=null?o:{};for(let u of t.properties)switch(u.type){case"file":{let f=m.functionArgument({label:ye(u.name.camelCase.unsafeName),value:this.getSingleFileProperty({property:u,record:i})});n.fileFields.push(f);break}case"fileArray":{let f=m.functionArgument({label:ye(u.name.camelCase.unsafeName),value:this.getArrayFileProperty({property:u,record:i})});n.fileFields.push(f);break}case"bodyProperty":{let f=m.functionArgument({label:ye(u.name.name.camelCase.unsafeName),value:this.getBodyProperty({property:u,record:i})});n.bodyPropertyFields.push(f);break}default:S(u)}return n}getSingleFileProperty({property:t,record:e}){let n=this.context.getSingleFileValue({property:t,record:e});return m.Expression.contextualMethodCall({methodName:"init",arguments_:[m.functionArgument({label:"data",value:m.Expression.dataLiteral(n!=null?n:"")})]})}getArrayFileProperty({property:t,record:e}){let n=this.context.getFileArrayValues({property:t,record:e});return m.Expression.arrayLiteral({elements:(n!=null?n:[]).map(i=>m.Expression.contextualMethodCall({methodName:"init",arguments_:[m.functionArgument({label:"data",value:m.Expression.dataLiteral(i)})]})),multiline:!0})}getBodyProperty({property:t,record:e}){let n=e[t.name.wireValue];return n==null?m.Expression.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:n})}};var Kr=class r extends Mt{constructor({ir:e,config:n,options:i}){super({ir:e,config:n,options:i});d(this,"ir");d(this,"customConfig");d(this,"dynamicTypeMapper");d(this,"dynamicTypeLiteralMapper");d(this,"filePropertyMapper");this.ir=e,this.customConfig=n.customConfig!=null?n.customConfig:void 0,this.dynamicTypeMapper=new at({context:this}),this.dynamicTypeLiteralMapper=new Yr({context:this}),this.filePropertyMapper=new Hr({context:this})}clone(){return new r({ir:this.ir,config:this.config,options:this.options})}getModuleName(){var e,n;return(n=(e=this.customConfig)==null?void 0:e.moduleName)!=null?n:Dt(this.getApiName())}getRootClientClassName(){var e,n;return(n=(e=this.customConfig)==null?void 0:e.clientClassName)!=null?n:`${Dt(this.getApiName())}Client`}getApiName(){return q(this.config.workspaceName)}};a();s();var kf="client",st=class{constructor({context:t}){d(this,"context");this.context=t}async generateSnippet({endpoint:t,request:e,options:n}){return this.buildCodeBlock({endpoint:t,snippetRequest:e,options:n})}generateSnippetSync({endpoint:t,request:e,options:n}){return this.buildCodeBlock({endpoint:t,snippetRequest:e,options:n})}buildCodeBlock({endpoint:t,snippetRequest:e,options:n}){return[this.generateImportFoundationStatement(),this.generateImportModuleStatement(),m.LineBreak.single(),this.generateMainFunctionDeclarationWithEndpointSnippet({endpoint:t,snippet:e}),m.LineBreak.single(),this.generateMainFunctionInvocationStatement()].map(o=>o.toString()).join("")}generateImportFoundationStatement(){return m.Statement.import("Foundation")}generateImportModuleStatement(){return m.Statement.import(this.context.getModuleName())}generateMainFunctionDeclarationWithEndpointSnippet({endpoint:t,snippet:e}){return m.Statement.functionDeclaration({unsafeName:"main",accessLevel:"private",async:!0,throws:!0,body:m.CodeBlock.withStatements([this.generateRootClientInitializationStatement({auth:t.auth,snippet:e}),m.LineBreak.single(),this.generateEndpointMethodCallStatement({endpoint:t,snippet:e})])})}generateRootClientInitializationStatement({auth:t,snippet:e,additionalArgs:n=[]}){let i=[],o=this.getRootClientBaseURLArg({snippet:e});o!=null&&i.push(o);let u=t?this.getRootClientAuthArgs({auth:t,snippet:e}):[];i.push(...u),i.push(...n);let f=i.filter(p=>!p.value.isNop());return m.Statement.constantDeclaration({unsafeName:kf,value:m.Expression.classInitialization({unsafeName:this.context.getRootClientClassName(),arguments_:f,multiline:f.length>1?!0:void 0})})}getRootClientBaseURLArg({snippet:t}){var e;return t.baseURL!=null&&t.environment!=null?(this.context.errors.add({severity:T.Critical,message:"Cannot specify both baseUrl and environment options"}),null):t.baseURL!=null?((e=this.context.ir.environments)==null?void 0:e.environments.type)==="multipleBaseUrls"?null:m.functionArgument({label:"baseURL",value:m.Expression.stringLiteral(t.baseURL)}):null}getRootClientAuthArgs({auth:t,snippet:e}){let n=[],i=e.auth;if(i==null)return n;switch(t.type){case"basic":if(i.type!=="basic"){this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message});break}n.push(m.functionArgument({label:t.username.camelCase.unsafeName,value:m.Expression.stringLiteral(i.username)}),m.functionArgument({label:t.password.camelCase.unsafeName,value:m.Expression.stringLiteral(i.password)}));break;case"bearer":if(i.type!=="bearer")return this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;n.push(m.functionArgument({label:t.token.camelCase.unsafeName,value:m.Expression.stringLiteral(i.token)}));break;case"header":if(i.type!=="header")return this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;n.push(m.functionArgument({label:t.header.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.header.typeReference,value:i.value})}));break;case"oauth":return i.type!=="oauth"&&this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;case"inferred":return i.type!=="inferred"&&this.context.errors.add({severity:T.Critical,message:this.context.newAuthMismatchError({auth:t,values:i}).message}),n;default:S(t)}return n}generateEndpointMethodCallStatement({endpoint:t,snippet:e}){return m.Statement.discardAssignment(this.generateEndpointMethodCallExpression({endpoint:t,snippet:e}))}generateEndpointMethodCallExpression({endpoint:t,snippet:e}){let n=this.getMethodArguments({endpoint:t,snippet:e}).filter(i=>!i.value.isNop());return m.Expression.try(m.Expression.await(m.Expression.methodCall({target:m.Expression.rawValue(kf),methodName:this.getMethodName({endpoint:t}),arguments_:n,multiline:n.length>1?!0:void 0})))}generateMainFunctionInvocationStatement(){return m.Statement.expressionStatement(m.Expression.try(m.Expression.await(m.Expression.functionCall({unsafeName:"main"}))))}getMethodName({endpoint:t}){return t.declaration.fernFilepath.allParts.length>0?`${`${t.declaration.fernFilepath.allParts.map(n=>n.camelCase.unsafeName).join(".")}`}.${t.declaration.name.camelCase.unsafeName}`:t.declaration.name.camelCase.unsafeName}getMethodArguments({endpoint:t,snippet:e}){switch(t.request.type){case"inlined":return this.getMethodArgsForInlinedRequest({request:t.request,snippet:e});case"body":return this.getMethodArgsForBodyRequest({request:t.request,snippet:e});default:S(t.request)}}getMethodArgsForInlinedRequest({request:t,snippet:e}){let n=[];this.context.errors.scope(de.PathParameters);let i=[];t.pathParameters!=null&&i.push(...this.getPathParameters({namedParameters:t.pathParameters,snippet:e})),this.context.errors.unscope(),n.push(...i),this.context.errors.scope(de.QueryParameters);let o=[];t.queryParameters!=null&&o.push(...this.getQueryParameters({namedParameters:t.queryParameters,snippet:e})),this.context.errors.unscope(),n.push(...o),this.context.errors.scope(de.RequestBody);let u=this.getFilePropertyInfo({request:t,snippet:e});return this.context.errors.unscope(),t.body!=null&&n.push(m.functionArgument({label:"request",value:this.getInlinedRequestArg({request:t,snippet:e,filePropertyInfo:u})})),n}getPathParameters({namedParameters:t,snippet:e}){var n;return this.context.getExampleObjectProperties({parameters:t,snippetObject:(n=e.pathParameters)!=null?n:{}}).map(i=>m.functionArgument({label:i.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(i)}))}getQueryParameters({namedParameters:t,snippet:e}){var n;return this.context.getExampleObjectProperties({parameters:t,snippetObject:(n=e.queryParameters)!=null?n:{}}).map(i=>m.functionArgument({label:i.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(i)}))}getFilePropertyInfo({request:t,snippet:e}){return t.body==null||!this.context.isFileUploadRequestBody(t.body)?{fileFields:[],bodyPropertyFields:[]}:this.context.filePropertyMapper.getFilePropertyInfo({body:t.body,value:e.requestBody})}getInlinedRequestArg({request:t,snippet:e,filePropertyInfo:n}){this.context.errors.scope(de.RequestBody);let i=t.body!=null?this.getInlinedRequestBodyObjectFields({body:t.body,value:e.requestBody,filePropertyInfo:n}):[];this.context.errors.unscope();let o=i.filter(u=>!u.value.isNop());return m.Expression.contextualMethodCall({methodName:"init",arguments_:o,multiline:o.length>1?!0:void 0})}getInlinedRequestBodyObjectFields({body:t,value:e,filePropertyInfo:n}){switch(t.type){case"fileUpload":return[...n.fileFields,...n.bodyPropertyFields];case"properties":return this.getInlinedRequestBodyPropertyObjectFields({parameters:t.value,value:e});case"referenced":return[this.getReferencedRequestBodyPropertyObjectField({body:t,value:e})];default:S(t)}}getInlinedRequestBodyPropertyObjectFields({parameters:t,value:e}){return this.context.getExampleObjectProperties({parameters:t,snippetObject:e}).map(n=>m.functionArgument({label:n.name.name.camelCase.unsafeName,value:this.context.dynamicTypeLiteralMapper.convert(n)}))}getReferencedRequestBodyPropertyObjectField({body:t,value:e}){return m.functionArgument({label:t.bodyKey.camelCase.unsafeName,value:this.getReferencedRequestBodyPropertyTypeLiteral({body:t.bodyType,value:e})})}getReferencedRequestBodyPropertyTypeLiteral({body:t,value:e}){switch(t.type){case"bytes":return this.getBytesBodyRequestArg({value:e});case"typeReference":return this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e});default:S(t)}}getBytesBodyRequestArg({value:t}){return typeof t!="string"?(this.context.errors.add({severity:T.Critical,message:`Expected bytes value to be a string, got ${typeof t}`}),m.Expression.dataLiteral("data")):m.Expression.dataLiteral(t)}getMethodArgsForBodyRequest({request:t,snippet:e}){var o,u;let n=[];this.context.errors.scope(de.PathParameters);let i=[...(o=this.context.ir.pathParameters)!=null?o:[],...(u=t.pathParameters)!=null?u:[]];return i.length>0&&n.push(...this.getPathParameters({namedParameters:i,snippet:e})),this.context.errors.unscope(),this.context.errors.scope(de.RequestBody),t.body!=null&&n.push(this.getBodyRequestArg({body:t.body,value:e.requestBody})),this.context.errors.unscope(),n}getBodyRequestArg({body:t,value:e}){switch(t.type){case"bytes":return m.functionArgument({label:"request",value:this.getBytesBodyRequestArg({value:e})});case"typeReference":return m.functionArgument({label:"request",value:this.context.dynamicTypeLiteralMapper.convert({typeReference:t.value,value:e})});default:S(t)}}};var Jr=class extends Ft{constructor({ir:t,config:e,options:n={}}){super(new Kr({ir:t,config:e,options:n}))}async generate(t,e={}){return super.generate(t,e)}generateSync(t,e={}){return super.generateSync(t,e)}createSnippetGenerator(t){return new st({context:t})}};0&&(module.exports={DynamicSnippetsGenerator,EndpointSnippetGenerator});
|
|
32
|
-
/*! Bundled license information:
|
|
33
|
-
|
|
34
|
-
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
35
|
-
(*!
|
|
36
|
-
* The buffer module from node.js, for the browser.
|
|
37
|
-
*
|
|
38
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
39
|
-
* @license MIT
|
|
40
|
-
*)
|
|
41
|
-
|
|
42
|
-
lodash-es/lodash.js:
|
|
43
|
-
(**
|
|
44
|
-
* @license
|
|
45
|
-
* Lodash (Custom Build) <https://lodash.com/>
|
|
46
|
-
* Build: `lodash modularize exports="es" -o ./`
|
|
47
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
48
|
-
* Released under MIT license <https://lodash.com/license>
|
|
49
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
50
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
51
|
-
*)
|
|
52
|
-
*/
|
|
53
|
-
//# sourceMappingURL=index.cjs.map
|