@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.
Files changed (95) hide show
  1. package/dist/index.cjs +39 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +145 -0
  4. package/dist/index.d.ts +145 -0
  5. package/dist/index.js +39 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +11 -12
  8. package/cjs/Config.cjs +0 -12
  9. package/cjs/Config.cjs.map +0 -1
  10. package/cjs/Config.d.cts +0 -4
  11. package/cjs/DynamicSnippetsGenerator.cjs +0 -41
  12. package/cjs/DynamicSnippetsGenerator.cjs.map +0 -1
  13. package/cjs/DynamicSnippetsGenerator.d.cts +0 -18
  14. package/cjs/EndpointSnippetGenerator.cjs +0 -41
  15. package/cjs/EndpointSnippetGenerator.cjs.map +0 -1
  16. package/cjs/EndpointSnippetGenerator.d.cts +0 -54
  17. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +0 -41
  18. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +0 -1
  19. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +0 -4
  20. package/cjs/context/DynamicTypeLiteralMapper.cjs +0 -41
  21. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +0 -1
  22. package/cjs/context/DynamicTypeLiteralMapper.d.cts +0 -4
  23. package/cjs/context/DynamicTypeMapper.cjs +0 -41
  24. package/cjs/context/DynamicTypeMapper.cjs.map +0 -1
  25. package/cjs/context/DynamicTypeMapper.d.cts +0 -4
  26. package/cjs/context/FilePropertyMapper.cjs +0 -41
  27. package/cjs/context/FilePropertyMapper.cjs.map +0 -1
  28. package/cjs/context/FilePropertyMapper.d.cts +0 -4
  29. package/cjs/context/index.cjs +0 -41
  30. package/cjs/context/index.cjs.map +0 -1
  31. package/cjs/context/index.d.cts +0 -4
  32. package/cjs/index-DS-GXEiz.d.cts +0 -89
  33. package/cjs/index.cjs +0 -53
  34. package/cjs/index.cjs.map +0 -1
  35. package/cjs/index.d.cts +0 -7
  36. package/cjs/util/pascal-case.cjs +0 -23
  37. package/cjs/util/pascal-case.cjs.map +0 -1
  38. package/cjs/util/pascal-case.d.cts +0 -3
  39. package/esm/Config.d.ts +0 -4
  40. package/esm/Config.js +0 -2
  41. package/esm/Config.js.map +0 -1
  42. package/esm/DynamicSnippetsGenerator.d.ts +0 -18
  43. package/esm/DynamicSnippetsGenerator.js +0 -2
  44. package/esm/DynamicSnippetsGenerator.js.map +0 -1
  45. package/esm/EndpointSnippetGenerator.d.ts +0 -54
  46. package/esm/EndpointSnippetGenerator.js +0 -2
  47. package/esm/EndpointSnippetGenerator.js.map +0 -1
  48. package/esm/chunk-2M2RBZK2.js +0 -2
  49. package/esm/chunk-2M2RBZK2.js.map +0 -1
  50. package/esm/chunk-6DFEQNIA.js +0 -2
  51. package/esm/chunk-6DFEQNIA.js.map +0 -1
  52. package/esm/chunk-7RC2HH3P.js +0 -2
  53. package/esm/chunk-7RC2HH3P.js.map +0 -1
  54. package/esm/chunk-FX6IFKZ7.js +0 -2
  55. package/esm/chunk-FX6IFKZ7.js.map +0 -1
  56. package/esm/chunk-HTU5V5TT.js +0 -2
  57. package/esm/chunk-HTU5V5TT.js.map +0 -1
  58. package/esm/chunk-IHG2VZKL.js +0 -2
  59. package/esm/chunk-IHG2VZKL.js.map +0 -1
  60. package/esm/chunk-JFTYS7SI.js +0 -20
  61. package/esm/chunk-JFTYS7SI.js.map +0 -1
  62. package/esm/chunk-KIHSBETU.js +0 -2
  63. package/esm/chunk-KIHSBETU.js.map +0 -1
  64. package/esm/chunk-PJTPV2D6.js +0 -15
  65. package/esm/chunk-PJTPV2D6.js.map +0 -1
  66. package/esm/chunk-PYMG6Y4R.js +0 -12
  67. package/esm/chunk-PYMG6Y4R.js.map +0 -1
  68. package/esm/chunk-WG3NZOM6.js +0 -2
  69. package/esm/chunk-WG3NZOM6.js.map +0 -1
  70. package/esm/chunk-WXHVUJ6D.js +0 -2
  71. package/esm/chunk-WXHVUJ6D.js.map +0 -1
  72. package/esm/chunk-ZIQ5ITTV.js +0 -2
  73. package/esm/chunk-ZIQ5ITTV.js.map +0 -1
  74. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +0 -4
  75. package/esm/context/DynamicSnippetsGeneratorContext.js +0 -2
  76. package/esm/context/DynamicSnippetsGeneratorContext.js.map +0 -1
  77. package/esm/context/DynamicTypeLiteralMapper.d.ts +0 -4
  78. package/esm/context/DynamicTypeLiteralMapper.js +0 -2
  79. package/esm/context/DynamicTypeLiteralMapper.js.map +0 -1
  80. package/esm/context/DynamicTypeMapper.d.ts +0 -4
  81. package/esm/context/DynamicTypeMapper.js +0 -2
  82. package/esm/context/DynamicTypeMapper.js.map +0 -1
  83. package/esm/context/FilePropertyMapper.d.ts +0 -4
  84. package/esm/context/FilePropertyMapper.js +0 -2
  85. package/esm/context/FilePropertyMapper.js.map +0 -1
  86. package/esm/context/index.d.ts +0 -4
  87. package/esm/context/index.js +0 -2
  88. package/esm/context/index.js.map +0 -1
  89. package/esm/index-DS-GXEiz.d.ts +0 -89
  90. package/esm/index.d.ts +0 -7
  91. package/esm/index.js +0 -14
  92. package/esm/index.js.map +0 -1
  93. package/esm/util/pascal-case.d.ts +0 -3
  94. package/esm/util/pascal-case.js +0 -2
  95. package/esm/util/pascal-case.js.map +0 -1
@@ -1,4 +0,0 @@
1
- import '@fern-api/browser-compatible-base-generator';
2
- import '@fern-api/dynamic-ir-sdk';
3
- import '@fern-api/swift-codegen';
4
- export { D as DynamicSnippetsGeneratorContext } from '../index-DS-GXEiz.cjs';
@@ -1,41 +0,0 @@
1
- "use strict";var cn=Object.create;var ye=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var dn=Object.getOwnPropertyNames,yt=Object.getOwnPropertySymbols,hn=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable;var Ze=(r,t,e)=>t in r?ye(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,b=(r,t)=>{for(var e in t||(t={}))wt.call(t,e)&&Ze(r,e,t[e]);if(yt)for(var e of yt(t))xn.call(t,e)&&Ze(r,e,t[e]);return r};var Ke=(r,t)=>()=>(r&&(t=r(r=0)),t);var z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Ee=(r,t)=>{for(var e in t)ye(r,e,{get:t[e],enumerable:!0})},gt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dn(t))!wt.call(r,i)&&i!==e&&ye(r,i,{get:()=>t[i],enumerable:!(n=mn(t,i))||n.enumerable});return r};var yn=(r,t,e)=>(e=r!=null?cn(hn(r)):{},gt(t||!r||!r.__esModule?ye(e,"default",{value:r,enumerable:!0}):e,r)),wn=r=>gt(ye({},"__esModule",{value:!0}),r);var f=(r,t,e)=>Ze(r,typeof t!="symbol"?t+"":t,e);function bt(){throw new Error("setTimeout has not been defined")}function Tt(){throw new Error("clearTimeout has not been defined")}function Et(r){if(V===setTimeout)return setTimeout(r,0);if((V===bt||!V)&&setTimeout)return V=setTimeout,setTimeout(r,0);try{return V(r,0)}catch(t){try{return V.call(null,r,0)}catch(e){return V.call(this,r,0)}}}function gn(r){if(j===clearTimeout)return clearTimeout(r);if((j===Tt||!j)&&clearTimeout)return j=clearTimeout,clearTimeout(r);try{return j(r)}catch(t){try{return j.call(null,r)}catch(e){return j.call(this,r)}}}function vn(){!ee||!G||(ee=!1,G.length?P=G.concat(P):Se=-1,P.length&&St())}function St(){if(!ee){var r=Et(vn);ee=!0;for(var t=P.length;t;){for(G=P,P=[];++Se<t;)G&&G[Se].run();Se=-1,t=P.length}G=null,ee=!1,gn(r)}}function bn(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];P.push(new Nt(r,t)),P.length===1&&!ee&&Et(St)}function Nt(r,t){this.fun=r,this.array=t}function H(){}function Pn(r){throw new Error("process.binding is not supported")}function Wn(){return"/"}function _n(r){throw new Error("process.chdir is not supported")}function zn(){return 0}function jn(r){var t=Vn.call(Q)*.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 Yn(){var r=new Date,t=r-$n;return t/1e3}var V,j,P,ee,G,Se,Tn,En,Sn,Nn,An,In,Ln,Rn,Cn,kn,Un,Dn,Mn,Bn,On,Fn,Q,Vn,$n,m,vt,l=Ke(()=>{"use strict";V=bt,j=Tt;typeof globalThis.setTimeout=="function"&&(V=setTimeout);typeof globalThis.clearTimeout=="function"&&(j=clearTimeout);P=[],ee=!1,Se=-1;Nt.prototype.run=function(){this.fun.apply(null,this.array)};Tn="browser",En="browser",Sn=!0,Nn={},An=[],In="",Ln={},Rn={},Cn={};kn=H,Un=H,Dn=H,Mn=H,Bn=H,On=H,Fn=H;Q=globalThis.performance||{},Vn=Q.now||Q.mozNow||Q.msNow||Q.oNow||Q.webkitNow||function(){return new Date().getTime()};$n=new Date;m={nextTick:bn,title:Tn,browser:Sn,env:Nn,argv:An,version:In,versions:Ln,on:kn,addListener:Un,once:Dn,off:Mn,removeListener:Bn,removeAllListeners:On,emit:Fn,binding:Pn,cwd:Wn,chdir:_n,umask:zn,hrtime:jn,platform:En,release:Rn,config:Cn,uptime:Yn},vt={};Object.keys(vt).forEach(r=>{let t=r.split("."),e=m;for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e[i]=vt[r]:e=e[i]||(e[i]={})}})});function Rt(){Xe=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=r.length;t<e;++t)B[t]=r[t],C[r.charCodeAt(t)]=t;C[45]=62,C[95]=63}function Gn(r){Xe||Rt();var t,e,n,i,a,o,p=r.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[p-2]==="="?2:r[p-1]==="="?1:0,o=new qn(p*3/4-a),n=a>0?p-4:p;var c=0;for(t=0,e=0;t<n;t+=4,e+=3)i=C[r.charCodeAt(t)]<<18|C[r.charCodeAt(t+1)]<<12|C[r.charCodeAt(t+2)]<<6|C[r.charCodeAt(t+3)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=i&255;return a===2?(i=C[r.charCodeAt(t)]<<2|C[r.charCodeAt(t+1)]>>4,o[c++]=i&255):a===1&&(i=C[r.charCodeAt(t)]<<10|C[r.charCodeAt(t+1)]<<4|C[r.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=i&255),o}function Hn(r){return B[r>>18&63]+B[r>>12&63]+B[r>>6&63]+B[r&63]}function Zn(r,t,e){for(var n,i=[],a=t;a<e;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(Hn(n));return i.join("")}function At(r){Xe||Rt();for(var t,e=r.length,n=e%3,i="",a=[],o=16383,p=0,c=e-n;p<c;p+=o)a.push(Zn(r,p,p+o>c?c:p+o));return n===1?(t=r[e-1],i+=B[t>>2],i+=B[t<<4&63],i+="=="):n===2&&(t=(r[e-2]<<8)+r[e-1],i+=B[t>>10],i+=B[t>>4&63],i+=B[t<<2&63],i+="="),a.push(i),a.join("")}function Ne(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function W(r,t){if(Ne()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=s.prototype):(r===null&&(r=new s(t)),r.length=t),r}function s(r,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(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 Qe(this,r)}return Ct(this,r,t,e)}function Ct(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?Xn(r,t,e,n):typeof t=="string"?Jn(r,t,e):Qn(r,t)}function kt(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 Kn(r,t,e,n){return kt(t),t<=0?W(r,t):e!==void 0?typeof n=="string"?W(r,t).fill(e,n):W(r,t).fill(e):W(r,t)}function Qe(r,t){if(kt(t),r=W(r,t<0?0:et(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)r[e]=0;return r}function Jn(r,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Ut(t,e)|0;r=W(r,n);var i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function Je(r,t){var e=t.length<0?0:et(t.length)|0;r=W(r,e);for(var n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Xn(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),s.TYPED_ARRAY_SUPPORT?(r=t,r.__proto__=s.prototype):r=Je(r,t),r}function Qn(r,t){if(O(t)){var e=et(t.length)|0;return r=W(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"||wi(t.length)?W(r,0):Je(r,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Je(r,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function et(r){if(r>=Ne())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ne().toString(16)+" bytes");return r|0}function O(r){return!!(r!=null&&r._isBuffer)}function Ut(r,t){if(O(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 Ae(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Wt(r).length;default:if(n)return Ae(r).length;t=(""+t).toLowerCase(),n=!0}}function ei(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 fi(this,t,e);case"utf8":case"utf-8":return Bt(this,t,e);case"ascii":return li(this,t,e);case"latin1":case"binary":return ui(this,t,e);case"base64":return oi(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pi(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function Z(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function Dt(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=s.from(t,n)),O(t))return t.length===0?-1:It(r,t,e,n,i);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):It(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function It(r,t,e,n,i){var a=1,o=r.length,p=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;a=2,o/=2,p/=2,e/=2}function c(L,X){return a===1?L[X]:L.readUInt16BE(X*a)}var h;if(i){var y=-1;for(h=e;h<o;h++)if(c(r,h)===c(t,y===-1?0:h-y)){if(y===-1&&(y=h),h-y+1===p)return y*a}else y!==-1&&(h-=h-y),y=-1}else for(e+p>o&&(e=o-p),h=e;h>=0;h--){for(var g=!0,U=0;U<p;U++)if(c(r,h+U)!==c(t,U)){g=!1;break}if(g)return h}return-1}function ti(r,t,e,n){e=Number(e)||0;var i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var p=parseInt(t.substr(o*2,2),16);if(isNaN(p))return o;r[e+o]=p}return o}function ri(r,t,e,n){return Re(Ae(t,r.length-e),r,e,n)}function Mt(r,t,e,n){return Re(xi(t),r,e,n)}function ni(r,t,e,n){return Mt(r,t,e,n)}function ii(r,t,e,n){return Re(Wt(t),r,e,n)}function ai(r,t,e,n){return Re(yi(t,r.length-e),r,e,n)}function oi(r,t,e){return t===0&&e===r.length?At(r):At(r.slice(t,e))}function Bt(r,t,e){e=Math.min(r.length,e);for(var n=[],i=t;i<e;){var a=r[i],o=null,p=a>239?4:a>223?3:a>191?2:1;if(i+p<=e){var c,h,y,g;switch(p){case 1:a<128&&(o=a);break;case 2:c=r[i+1],(c&192)===128&&(g=(a&31)<<6|c&63,g>127&&(o=g));break;case 3:c=r[i+1],h=r[i+2],(c&192)===128&&(h&192)===128&&(g=(a&15)<<12|(c&63)<<6|h&63,g>2047&&(g<55296||g>57343)&&(o=g));break;case 4:c=r[i+1],h=r[i+2],y=r[i+3],(c&192)===128&&(h&192)===128&&(y&192)===128&&(g=(a&15)<<18|(c&63)<<12|(h&63)<<6|y&63,g>65535&&g<1114112&&(o=g))}}o===null?(o=65533,p=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=p}return si(n)}function si(r){var t=r.length;if(t<=Lt)return String.fromCharCode.apply(String,r);for(var e="",n=0;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Lt));return e}function li(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 ui(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 fi(r,t,e){var n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=t;a<e;++a)i+=hi(r[a]);return i}function pi(r,t,e){for(var n=r.slice(t,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}function E(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 A(r,t,e,n,i,a){if(!O(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}function Ie(r,t,e,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(r.length-e,2);i<a;++i)r[e+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function Le(r,t,e,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(r.length-e,4);i<a;++i)r[e+i]=t>>>(n?i:3-i)*8&255}function Ot(r,t,e,n,i,a){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Ft(r,t,e,n,i){return i||Ot(r,t,e,4,34028234663852886e22,-34028234663852886e22),zt(r,t,e,n,23,4),e+4}function Pt(r,t,e,n,i){return i||Ot(r,t,e,8,17976931348623157e292,-17976931348623157e292),zt(r,t,e,n,52,8),e+8}function mi(r){if(r=di(r).replace(ci,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function di(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function hi(r){return r<16?"0"+r.toString(16):r.toString(16)}function Ae(r,t){t=t||1/0;for(var e,n=r.length,i=null,a=[],o=0;o<n;++o){if(e=r.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;a.push(e)}else if(e<2048){if((t-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function xi(r){for(var t=[],e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function yi(r,t){for(var e,n,i,a=[],o=0;o<r.length&&!((t-=2)<0);++o)e=r.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function Wt(r){return Gn(mi(r))}function Re(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 wi(r){return r!==r}function gi(r){return r!=null&&(!!r._isBuffer||_t(r)||vi(r))}function _t(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function vi(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&_t(r.slice(0,0))}function Ce(r,t,e,n,i){var a,o,p=i*8-n-1,c=(1<<p)-1,h=c>>1,y=-7,g=e?i-1:0,U=e?-1:1,L=r[t+g];for(g+=U,a=L&(1<<-y)-1,L>>=-y,y+=p;y>0;a=a*256+r[t+g],g+=U,y-=8);for(o=a&(1<<-y)-1,a>>=-y,y+=n;y>0;o=o*256+r[t+g],g+=U,y-=8);if(a===0)a=1-h;else{if(a===c)return o?NaN:(L?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-h}return(L?-1:1)*o*Math.pow(2,a-n)}function zt(r,t,e,n,i,a){var o,p,c,h=a*8-i-1,y=(1<<h)-1,g=y>>1,U=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=n?0:a-1,X=n?1:-1,pn=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(p=isNaN(t)?1:0,o=y):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+g>=1?t+=U/c:t+=U*Math.pow(2,1-g),t*c>=2&&(o++,c/=2),o+g>=y?(p=0,o=y):o+g>=1?(p=(t*c-1)*Math.pow(2,i),o=o+g):(p=t*Math.pow(2,g-1)*Math.pow(2,i),o=0));i>=8;r[e+L]=p&255,L+=X,p/=256,i-=8);for(o=o<<i|p,h+=i;h>0;r[e+L]=o&255,L+=X,o/=256,h-=8);r[e+L-X]|=pn*128}var B,C,qn,Xe,Lt,ci,Vt=Ke(()=>{"use strict";l();u();B=[],C=[],qn=typeof Uint8Array!="undefined"?Uint8Array:Array,Xe=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(r){return r.__proto__=s.prototype,r};s.from=function(r,t,e){return Ct(null,r,t,e)};s.kMaxLength=Ne();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(r,t,e){return Kn(null,r,t,e)};s.allocUnsafe=function(r){return Qe(null,r)};s.allocUnsafeSlow=function(r){return Qe(null,r)};s.isBuffer=gi;s.compare=function(t,e){if(!O(t)||!O(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(t[a]!==e[a]){n=t[a],i=e[a];break}return n<i?-1:i<n?1:0};s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=s.allocUnsafe(e),a=0;for(n=0;n<t.length;++n){var o=t[n];if(!O(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};s.byteLength=Ut;s.prototype._isBuffer=!0;s.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Z(this,e,e+1);return this};s.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Z(this,e,e+3),Z(this,e+1,e+2);return this};s.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Z(this,e,e+7),Z(this,e+1,e+6),Z(this,e+2,e+5),Z(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?Bt(this,0,t):ei.apply(this,arguments)};s.prototype.equals=function(t){if(!O(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,n,i,a){if(!O(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),a===void 0&&(a=this.length),e<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var o=a-i,p=n-e,c=Math.min(o,p),h=this.slice(i,a),y=t.slice(e,n),g=0;g<c;++g)if(h[g]!==y[g]){o=h[g],p=y[g];break}return o<p?-1:p<o?1:0};s.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};s.prototype.indexOf=function(t,e,n){return Dt(this,t,e,n,!0)};s.prototype.lastIndexOf=function(t,e,n){return Dt(this,t,e,n,!1)};s.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 a=this.length-e;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return ti(this,t,e,n);case"utf8":case"utf-8":return ri(this,t,e,n);case"ascii":return Mt(this,t,e,n);case"latin1":case"binary":return ni(this,t,e,n);case"base64":return ii(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ai(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Lt=4096;s.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(s.TYPED_ARRAY_SUPPORT)i=this.subarray(t,e),i.__proto__=s.prototype;else{var a=e-t;i=new s(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+t]}return i};s.prototype.readUIntLE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=this[t],a=1,o=0;++o<e&&(a*=256);)i+=this[t+o]*a;return i};s.prototype.readUIntBE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=this[t+--e],a=1;e>0&&(a*=256);)i+=this[t+--e]*a;return i};s.prototype.readUInt8=function(t,e){return e||E(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||E(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||E(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};s.prototype.readUInt32BE=function(t,e){return e||E(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=this[t],a=1,o=0;++o<e&&(a*=256);)i+=this[t+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(t,e,n){t=t|0,e=e|0,n||E(t,e,this.length);for(var i=e,a=1,o=this[t+--i];i>0&&(a*=256);)o+=this[t+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readInt8=function(t,e){return e||E(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||E(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(t,e){e||E(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(t,e){return e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};s.prototype.readInt32BE=function(t,e){return e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};s.prototype.readFloatLE=function(t,e){return e||E(t,4,this.length),Ce(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||E(t,4,this.length),Ce(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||E(t,8,this.length),Ce(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||E(t,8,this.length),Ce(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;A(this,t,e,n,a,0)}var o=1,p=0;for(this[e]=t&255;++p<n&&(o*=256);)this[e+p]=t/o&255;return e+n};s.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;A(this,t,e,n,a,0)}var o=n-1,p=1;for(this[e+o]=t&255;--o>=0&&(p*=256);)this[e+o]=t/p&255;return e+n};s.prototype.writeUInt8=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Ie(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Ie(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255):Le(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Le(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e|0,!i){var a=Math.pow(2,8*n-1);A(this,t,e,n,a-1,-a)}var o=0,p=1,c=0;for(this[e]=t&255;++o<n&&(p*=256);)t<0&&c===0&&this[e+o-1]!==0&&(c=1),this[e+o]=(t/p>>0)-c&255;return e+n};s.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e|0,!i){var a=Math.pow(2,8*n-1);A(this,t,e,n,a-1,-a)}var o=n-1,p=1,c=0;for(this[e+o]=t&255;--o>=0&&(p*=256);)t<0&&c===0&&this[e+o+1]!==0&&(c=1),this[e+o]=(t/p>>0)-c&255;return e+n};s.prototype.writeInt8=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):Ie(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):Ie(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Le(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e|0,n||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255):Le(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,n){return Ft(this,t,e,!0,n)};s.prototype.writeFloatBE=function(t,e,n){return Ft(this,t,e,!1,n)};s.prototype.writeDoubleLE=function(t,e,n){return Pt(this,t,e,!0,n)};s.prototype.writeDoubleBE=function(t,e,n){return Pt(this,t,e,!1,n)};s.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 a=i-n,o;if(this===t&&n<e&&e<i)for(o=a-1;o>=0;--o)t[o+e]=this[o+n];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+a),e);return a};s.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 a=t.charCodeAt(0);a<256&&(t=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<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 o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{var p=O(t)?t:Ae(new s(t,i).toString()),c=p.length;for(o=0;o<n-e;++o)this[o+e]=p[o%c]}return this};ci=/[^+\/0-9A-Za-z-_]/g});var u=Ke(()=>{"use strict";Vt()});var it=z((Cf,jr)=>{"use strict";l();u();function lo(r){return!(typeof r!="number"||r!==r||r===1/0||r===-1/0)}jr.exports=lo});var Yr=z((Df,$r)=>{"use strict";l();u();var uo=9007199254740991;$r.exports=uo});var at=z((Of,qr)=>{"use strict";l();u();var fo=Yr();function po(r){return typeof r=="number"&&Math.abs(r)<=fo}qr.exports=po});var Hr=z((Wf,Gr)=>{"use strict";l();u();var co=it(),mo=at();function ho(r){var t=parseInt(r,10);if(!co(t))throw new TypeError("Not a finite number: "+r+" ("+typeof r+")");if(!mo(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,a=e.charAt(e.length-1);return e+(i?"th":a==="1"?"st":a==="2"?"nd":a==="3"?"rd":"th")}Gr.exports=ho});var ot=z((Vf,Jr)=>{"use strict";l();u();var xo=/(hundred|thousand|(m|b|tr|quadr)illion)$/,yo=/teen$/,Zr=/y$/,Kr=/(zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)$/,wo={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 go(r){return xo.test(r)||yo.test(r)?r+"th":Zr.test(r)?r.replace(Zr,"ieth"):Kr.test(r)?r.replace(Kr,vo):r}function vo(r,t){return wo[t]}Jr.exports=go});var mt=z((Yf,en)=>{"use strict";l();u();var bo=ot(),To=it(),Eo=at(),Xr=10,st=100,lt=1e3,ut=1e6,ft=1e9,pt=1e12,ct=1e15,So=9007199254740992,Qr=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],No=["zero","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function Ao(r,t){var e,n=parseInt(r,10);if(!To(n))throw new TypeError("Not a finite number: "+r+" ("+typeof r+")");if(!Eo(n))throw new RangeError("Input is not a safe number, it\u2019s either too large or too small.");return e=q(n),t?bo(e):e}function q(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=Qr[r]):r<st?(t=r%Xr,e=No[Math.floor(r/Xr)],t&&(e+="-"+Qr[t],t=0)):r<lt?(t=r%st,e=q(Math.floor(r/st))+" hundred"):r<ut?(t=r%lt,e=q(Math.floor(r/lt))+" thousand,"):r<ft?(t=r%ut,e=q(Math.floor(r/ut))+" million,"):r<pt?(t=r%ft,e=q(Math.floor(r/ft))+" billion,"):r<ct?(t=r%pt,e=q(Math.floor(r/pt))+" trillion,"):r<=So&&(t=r%ct,e=q(Math.floor(r/ct))+" quadrillion,"),n.push(e),q(t,n))}en.exports=Ao});var rn=z((Hf,tn)=>{"use strict";l();u();var Io=ot(),Lo=mt();function Ro(r){var t=Lo(r);return Io(t)}tn.exports=Ro});var an=z((Jf,nn)=>{"use strict";l();u();nn.exports={toOrdinal:Hr(),toWords:mt(),toWordsOrdinal:rn()}});var Jo={};Ee(Jo,{DynamicTypeLiteralMapper:()=>xt});module.exports=wn(Jo);l();u();l();u();l();u();function ke(r,t){if(r===void 0)throw new Error(t!=null?t:"Expected value to be defined but got undefined.")}function k(r,t){if(r===null)throw new Error(t!=null?t:"Expected value to be non-null but got null.")}function v(r){throw new Error("Unexpected value: "+JSON.stringify(r))}l();u();l();u();l();u();l();u();l();u();l();u();var bi=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,jt=bi;var Ti=typeof self=="object"&&self&&self.Object===Object&&self,Ei=jt||Ti||Function("return this")(),$t=Ei;var Si=$t.Symbol,_=Si;l();u();var Yt=Object.prototype,Ni=Yt.hasOwnProperty,Ai=Yt.toString,we=_?_.toStringTag:void 0;function Ii(r){var t=Ni.call(r,we),e=r[we];try{r[we]=void 0;var n=!0}catch(a){}var i=Ai.call(r);return n&&(t?r[we]=e:delete r[we]),i}var qt=Ii;l();u();var Li=Object.prototype,Ri=Li.toString;function Ci(r){return Ri.call(r)}var Gt=Ci;var ki="[object Null]",Ui="[object Undefined]",Ht=_?_.toStringTag:void 0;function Di(r){return r==null?r===void 0?Ui:ki:Ht&&Ht in Object(r)?qt(r):Gt(r)}var Zt=Di;l();u();function Mi(r){return r!=null&&typeof r=="object"}var Kt=Mi;var Bi="[object Symbol]";function Oi(r){return typeof r=="symbol"||Kt(r)&&Zt(r)==Bi}var Jt=Oi;l();u();l();u();function Fi(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 Xt=Fi;l();u();var Pi=Array.isArray,Qt=Pi;var Wi=1/0,er=_?_.prototype:void 0,tr=er?er.toString:void 0;function rr(r){if(typeof r=="string")return r;if(Qt(r))return Xt(r,rr)+"";if(Jt(r))return tr?tr.call(r):"";var t=r+"";return t=="0"&&1/r==-Wi?"-0":t}var nr=rr;l();u();function _i(r){return r==null?"":nr(r)}var $=_i;l();u();l();u();l();u();l();u();l();u();l();u();function zi(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 a=Array(i);++n<i;)a[n]=r[n+t];return a}var ir=zi;function Vi(r,t,e){var n=r.length;return e=e===void 0?n:e,!t&&e>=n?r:ir(r,t,e)}var ar=Vi;l();u();var ji="\\ud800-\\udfff",$i="\\u0300-\\u036f",Yi="\\ufe20-\\ufe2f",qi="\\u20d0-\\u20ff",Gi=$i+Yi+qi,Hi="\\ufe0e\\ufe0f",Zi="\\u200d",Ki=RegExp("["+Zi+ji+Gi+Hi+"]");function Ji(r){return Ki.test(r)}var Ue=Ji;l();u();l();u();function Xi(r){return r.split("")}var or=Xi;l();u();var sr="\\ud800-\\udfff",Qi="\\u0300-\\u036f",ea="\\ufe20-\\ufe2f",ta="\\u20d0-\\u20ff",ra=Qi+ea+ta,na="\\ufe0e\\ufe0f",ia="["+sr+"]",tt="["+ra+"]",rt="\\ud83c[\\udffb-\\udfff]",aa="(?:"+tt+"|"+rt+")",lr="[^"+sr+"]",ur="(?:\\ud83c[\\udde6-\\uddff]){2}",fr="[\\ud800-\\udbff][\\udc00-\\udfff]",oa="\\u200d",pr=aa+"?",cr="["+na+"]?",sa="(?:"+oa+"(?:"+[lr,ur,fr].join("|")+")"+cr+pr+")*",la=cr+pr+sa,ua="(?:"+[lr+tt+"?",tt,ur,fr,ia].join("|")+")",fa=RegExp(rt+"(?="+rt+")|"+ua+la,"g");function pa(r){return r.match(fa)||[]}var mr=pa;function ca(r){return Ue(r)?mr(r):or(r)}var dr=ca;function ma(r){return function(t){t=$(t);var e=Ue(t)?dr(t):void 0,n=e?e[0]:t.charAt(0),i=e?ar(e,1).join(""):t.slice(1);return n[r]()+i}}var De=ma;var da=De("toUpperCase"),N=da;function ha(r){return N($(r).toLowerCase())}var hr=ha;l();u();l();u();function xa(r,t,e,n){var i=-1,a=r==null?0:r.length;for(n&&a&&(e=r[++i]);++i<a;)e=t(e,r[i],i,r);return e}var xr=xa;l();u();l();u();l();u();function ya(r){return function(t){return r==null?void 0:r[t]}}var yr=ya;var wa={\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"},ga=yr(wa),wr=ga;var va=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ba="\\u0300-\\u036f",Ta="\\ufe20-\\ufe2f",Ea="\\u20d0-\\u20ff",Sa=ba+Ta+Ea,Na="["+Sa+"]",Aa=RegExp(Na,"g");function Ia(r){return r=$(r),r&&r.replace(va,wr).replace(Aa,"")}var gr=Ia;l();u();l();u();var La=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ra(r){return r.match(La)||[]}var vr=Ra;l();u();var Ca=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ka(r){return Ca.test(r)}var br=ka;l();u();var Ar="\\ud800-\\udfff",Ua="\\u0300-\\u036f",Da="\\ufe20-\\ufe2f",Ma="\\u20d0-\\u20ff",Ba=Ua+Da+Ma,Ir="\\u2700-\\u27bf",Lr="a-z\\xdf-\\xf6\\xf8-\\xff",Oa="\\xac\\xb1\\xd7\\xf7",Fa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Pa="\\u2000-\\u206f",Wa=" \\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",Rr="A-Z\\xc0-\\xd6\\xd8-\\xde",_a="\\ufe0e\\ufe0f",Cr=Oa+Fa+Pa+Wa,kr="['\u2019]",Tr="["+Cr+"]",za="["+Ba+"]",Ur="\\d+",Va="["+Ir+"]",Dr="["+Lr+"]",Mr="[^"+Ar+Cr+Ur+Ir+Lr+Rr+"]",ja="\\ud83c[\\udffb-\\udfff]",$a="(?:"+za+"|"+ja+")",Ya="[^"+Ar+"]",Br="(?:\\ud83c[\\udde6-\\uddff]){2}",Or="[\\ud800-\\udbff][\\udc00-\\udfff]",te="["+Rr+"]",qa="\\u200d",Er="(?:"+Dr+"|"+Mr+")",Ga="(?:"+te+"|"+Mr+")",Sr="(?:"+kr+"(?:d|ll|m|re|s|t|ve))?",Nr="(?:"+kr+"(?:D|LL|M|RE|S|T|VE))?",Fr=$a+"?",Pr="["+_a+"]?",Ha="(?:"+qa+"(?:"+[Ya,Br,Or].join("|")+")"+Pr+Fr+")*",Za="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ka="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ja=Pr+Fr+Ha,Xa="(?:"+[Va,Br,Or].join("|")+")"+Ja,Qa=RegExp([te+"?"+Dr+"+"+Sr+"(?="+[Tr,te,"$"].join("|")+")",Ga+"+"+Nr+"(?="+[Tr,te+Er,"$"].join("|")+")",te+"?"+Er+"+"+Sr,te+"+"+Nr,Ka,Za,Ur,Xa].join("|"),"g");function eo(r){return r.match(Qa)||[]}var Wr=eo;function to(r,t,e){return r=$(r),t=e?void 0:t,t===void 0?br(r)?Wr(r):vr(r):r.match(t)||[]}var _r=to;var ro="['\u2019]",no=RegExp(ro,"g");function io(r){return function(t){return xr(_r(gr(t).replace(no,"")),r,"")}}var zr=io;var ao=zr(function(r,t,e){return t=t.toLowerCase(),r+(e?hr(t):t)}),R=ao;l();u();var oo=De("toLowerCase"),Me=oo;l();u();function nt(){}l();u();function Be(r){return Object.values(r)}l();u();l();u();var K=class{};l();u();l();u();var D=class extends K{constructor(e){super();f(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 so=4,Vr=!!m.env.FERN_STACK_TRACK;Vr&&(Error.stackTraceLimit=50);var ge=class{constructor(){f(this,"buffer","");f(this,"indentLevel",0);f(this,"hasWrittenAnything",!1);f(this,"lastCharacterIsSemicolon",!1);f(this,"lastCharacterIsNewline",!1)}write(...t){for(let e of t)if(e!=null)if(typeof e=="string"){let n=e.length>0&&e.endsWith(`
2
- `),i=n?e.substring(0,e.length-1):e,a=this.getIndentString(),o=i.replaceAll(`
3
- `,`
4
- ${a}`);this.isAtStartOfLine()&&(o=a+o),n&&(o+=`
5
- `),this.writeInternal(o)}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 D(t).write(this),t.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new D(t).write(this),this.write(" (",e,")"),this.pushScope()}controlFlowWithoutStatement(t){new D(t).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new D(t).write(this),this.write(" (",e,")"),this.pushScope()}alternativeControlFlow(t){this.dedent(),this.write("} "),new D(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(`
6
- `)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:n}){if(t.length>0){let i=t[0];i!=null&&n(i);for(let a=1;a<t.length;a++){this.write(e);let o=t[a];o!=null&&n(o)}}}toString(){return this.buffer}writeInternal(t){if(t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
8
- `),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t,Vr&&this.buffer.endsWith(`
9
- `)&&!this.buffer.endsWith(`"""
10
- `)){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}
11
- `)}return this.buffer}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return so}stacktrace(t=50){var n;let e=!1;return((n=new Error().stack)!=null?n:"").split(`
12
- `).map(i=>{var o;let a=i.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(a&&a.length===5){let[,p,c,h,y]=a;if(e||p!=null&&p.includes("runInteractiveTask")){e=!0;return}switch(p){case"Object.<anonymous>":p="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":p=`${p.substring(p.indexOf(".")+1)}()=> { ... }`;break}return{fn:p,path:(o=c==null?void 0:c.replace(/^.*?fern.*?\//,""))!=null?o:"",position:`${h}:${y}`}}}).filter(i=>{var a,o,p,c,h,y,g;return i&&!((a=i.path)!=null&&a.startsWith("node:"))&&!((o=i.path)!=null&&o.endsWith(".js"))&&!((p=i.path)!=null&&p.includes("AbstractWriter"))&&!((c=i.fn)!=null&&c.includes("stacktrace"))&&!((h=i.fn)!=null&&h.includes("stackLine"))&&!((y=i.fn)!=null&&y.includes("SdkGeneratorCLI"))&&!((g=i.fn)!=null&&g.includes("runCli"))}).slice(0,t)}};l();u();l();u();var Y={Critical:"CRITICAL",Warning:"WARNING"};l();u();l();u();var re={};Ee(re,{sanitizeForIdentifier:()=>dt,sanitizeToCamelCase:()=>ko,sanitizeToPascalCase:()=>Co});l();u();var on=yn(an(),1);l();u();function Oe(r){return N(R(r))}function Co(r){let t=dt(r);return Oe(t)}function ko(r){let t=dt(r);return R(t)}function dt(r){if(r==="")return"empty";let t=r;if(/^\d/.test(t)){let n=Uo(t);t=n.numberAsWords+N(n.rest)}return/^[a-zA-Z][a-zA-Z0-9]*$/.test(t)||(t=t.replace(/^[^a-zA-Z0-9]+/,""),t=R(t)),/^\d/.test(t)&&(t="value"+t),t===""?"value":t}function Uo(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,on.toWords)(parseInt(e,10)),rest:n}}catch(i){let a={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(p=>a[p]||p).join(""),rest:n}}}l();u();var ve={};Ee(ve,{generateEnumCaseLabel:()=>Mo,generateName:()=>Do,sanitizeLiteralValue:()=>ht});l();u();function Do(r){let t=ht(r);return Oe(t)}function Mo(r){let t=ht(r);return R(t)}function ht(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=R(t)),/^\d/.test(t)||t===""?"value":t}var d={};Ee(d,{AccessLevel:()=>sn,Class:()=>ne,CodeBlock:()=>S,Comment:()=>ie,ComputedProperty:()=>oe,DeclarationType:()=>be,DocComment:()=>se,EnumWithAssociatedValues:()=>le,EnumWithRawValues:()=>ue,Expression:()=>F,Extension:()=>fe,FunctionArgument:()=>pe,FunctionParameter:()=>ce,Initializer:()=>me,LineBreak:()=>We,Method:()=>de,Pattern:()=>_e,Property:()=>he,Protocol:()=>un,Statement:()=>ae,Struct:()=>xe,Symbol:()=>T,SymbolRegistry:()=>Ge,Type:()=>Ve,TypeReference:()=>je,class_:()=>Fo,codeBlock:()=>Po,comment:()=>Wo,computedProperty:()=>_o,docComment:()=>zo,enumWithAssociatedValues:()=>Vo,enumWithRawValues:()=>jo,extension:()=>$o,functionArgument:()=>Yo,functionParameter:()=>qo,initializer:()=>Go,method:()=>Ho,property:()=>Zo,struct:()=>Ko});l();u();l();u();l();u();var sn={Open:"open",Public:"public",Package:"package",Internal:"internal",Fileprivate:"fileprivate",Private:"private"};l();u();l();u();l();u();l();u();var Fe=class extends ge{toString(){return this.buffer}};var w=class extends K{toString(){let t=new Fe;return this.write(t),t.toString()}};var ne=class extends w{constructor({accessLevel:e,name:n,final:i,conformances:a,properties:o,initializers:p,methods:c,docs:h}){super();f(this,"name");f(this,"final");f(this,"accessLevel");f(this,"conformances");f(this,"properties");f(this,"initializers");f(this,"methods");f(this,"docs");this.name=n,this.final=i,this.accessLevel=e,this.conformances=a!=null?a:[],this.properties=o,this.initializers=p!=null?p:[],this.methods=c!=null?c:[],this.docs=h}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("}")}};l();u();var S=class r extends w{constructor(e){super();f(this,"args");this.args=e}write(e){let n=new D(this.args);e.write("{"),e.newLine(),e.indent(),n.write(e),e.dedent(),e.write("}")}static empty(){return new r(nt)}static withStatements(e){return new r(n=>{e.forEach(i=>{i.write(n)})})}};l();u();var ie=class extends w{constructor({content:e}){super();f(this,"content");this.content=e}write(e){this.content.split(`
13
- `).forEach(i=>{e.write(`// ${i}`),e.newLine()})}};l();u();l();u();function ln(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"),'\\"')}l();u();var Bo=["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"],Oo=new Set(Bo);function J(r){return Oo.has(r)}function I(r){return J(r)?`\`${r}\``:r}function Pe(r){return r==="self"?"self_":r}l();u();var F=class extends w{constructor(e){super();f(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(I(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:I(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"struct-initialization":this.writeCallableExpression({writer:e,target:I(this.internalExpression.unsafeName),arguments_:this.internalExpression.arguments_,multiline:!!this.internalExpression.multiline});break;case"class-initialization":this.writeCallableExpression({writer:e,target:I(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:v(this.internalExpression)}}writeCallableExpression({writer:e,target:n,arguments_:i,multiline:a}){e.write(n),e.write("("),a&&(e.newLine(),e.indent()),i==null||i.forEach((o,p)=>{p>0&&(e.write(","),a?e.newLine():e.write(" ")),o.write(e)}),a&&(e.newLine(),e.dedent()),e.write(")")}writeDictionaryLiteral(e,n){var a;if(!n.entries||n.entries.length===0){e.write("[:]");return}e.write("[");let i=!!n.multiline;i&&(e.newLine(),e.indent()),(a=n.entries)==null||a.forEach(([o,p],c)=>{c>0&&(e.write(", "),i&&e.newLine()),o.write(e),e.write(": "),p.write(e)}),i&&(e.newLine(),e.dedent()),e.write("]")}writeArrayLiteral(e,n){var a;if(!n.elements||n.elements.length===0){e.write("[]");return}e.write("[");let i=!!n.multiline;i&&(e.newLine(),e.indent()),(a=n.elements)==null||a.forEach((o,p)=>{p>0&&(e.write(","),i?e.newLine():e.write(" ")),o.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(b({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(b({type:"function-call"},e))}static structInitialization(e){return new this(b({type:"struct-initialization"},e))}static classInitialization(e){return new this(b({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(b({type:"dictionary-literal"},e))}static arrayLiteral(e){return new this(b({type:"array-literal"},e))}static dataLiteral(e){return new this({type:"data-literal",value:e})}static methodCall(e){return new this(b({type:"method-call"},e))}static methodCallWithTrailingClosure(e){return new this(b({type:"method-call-with-trailing-closure"},e))}static contextualMethodCall(e){return new this(b({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"})}};l();u();l();u();var be={Var:"var",Let:"let"};var ae=class extends w{constructor(e){super();f(this,"internalStatement");this.internalStatement=e}write(e){var n,i,a;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(be.Let),e.write(" "),e.write(I(this.internalStatement.unsafeName)),e.write(" = "),this.internalStatement.value.write(e),this.internalStatement.noTrailingNewline||e.newLine();break;case"variable-declaration":e.write(be.Var),e.write(" "),e.write(I(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(I(this.internalStatement.unsafeName)),e.write("("),(n=this.internalStatement.parameters)==null||n.forEach((o,p)=>{p>0&&e.write(", "),o.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:S.empty()).write(e),e.newLine();break;case"variable-assignment":e.write(I(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 o of this.internalStatement.cases)if(e.write("case "),o.pattern.write(e),e.write(":"),e.newLine(),o.body.length>0){e.indent();for(let p of o.body)p.write(e);e.dedent()}if(this.internalStatement.defaultCase&&(e.write("default:"),e.newLine(),this.internalStatement.defaultCase.length>0)){e.indent();for(let o of this.internalStatement.defaultCase)o.write(e);e.dedent()}e.write("}"),e.newLine();break;case"if":{e.write("if "),this.internalStatement.condition.write(e),e.write(" "),S.withStatements(this.internalStatement.body).write(e);for(let o of(a=this.internalStatement.elseIfs)!=null?a:[])e.write(" else if "),o.condition.write(e),e.write(" "),S.withStatements(o.body).write(e);this.internalStatement.else&&(e.write(" else "),S.withStatements(this.internalStatement.else).write(e)),e.newLine();break}case"raw":e.write(this.internalStatement.content),e.newLine();break;default:v(this.internalStatement)}}static typealiasDeclaration(e){return new this(b({type:"typealias-declaration"},e))}static constantDeclaration(e){return new this(b({type:"constant-declaration"},e))}static variableDeclaration(e){return new this(b({type:"variable-declaration"},e))}static functionDeclaration(e){return new this(b({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(b({type:"switch"},e))}static if(e){return new this(b({type:"if"},e))}static raw(e){return new this({type:"raw",content:e})}};var oe=class extends w{constructor({unsafeName:e,accessLevel:n,type:i,body:a,docs:o}){super();f(this,"unsafeName");f(this,"accessLevel");f(this,"type");f(this,"body");f(this,"docs");this.unsafeName=e,this.accessLevel=n,this.type=i,this.body=a,this.docs=o}write(e){this.docs!=null&&this.docs.write(e),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write("var "),e.write(I(this.unsafeName)),e.write(": "),this.type.write(e),e.write(" "),this.body instanceof S?this.body.write(e):this.body instanceof F?S.withStatements([ae.expressionStatement(this.body)]).write(e):v(this.body)}};l();u();var se=class r extends w{constructor({summary:e,description:n,parameters:i,returns:a,throws:o}){super();f(this,"summary");f(this,"description");f(this,"parameters");f(this,"returns");f(this,"throws");this.summary=r.sanitizeText(e),this.description=n!=null?r.sanitizeText(n):void 0,this.parameters=(i!=null?i:[]).map(p=>({name:p.name,description:r.sanitizeText(p.description)})),this.returns=a!=null?r.sanitizeText(a):void 0,this.throws=(o!=null?o:[]).map(p=>r.sanitizeText(p))}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(`
14
- `).forEach((a,o)=>{o===0?(e.write("/// - Parameter "),e.write(n.name),e.write(": "),e.write(a)):(e.write("/// "),e.write(a)),e.newLine()})}if(this.returns!=null&&this.returns.split(`
15
- `).forEach((i,a)=>{a===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(`
16
- `).forEach((a,o)=>{o===0?(e.write("/// - Throws: "),e.write(a)):(e.write("/// "),e.write(a)),e.newLine()})}writeMultilineText(e,n){let i=n.split(`
17
- `);for(let a of i)e.write("/// "),e.write(a),e.newLine()}static sanitizeText(e){return e=e.replace(/\r\n/g,`
18
- `).replace(/\r/g,`
19
- `),e=e.replace(/\x00/g,""),e}};l();u();var le=class extends w{constructor({accessLevel:e,name:n,conformances:i,cases:a,initializers:o,methods:p,nestedTypes:c,docs:h}){super();f(this,"name");f(this,"accessLevel");f(this,"conformances");f(this,"cases");f(this,"initializers");f(this,"methods");f(this,"nestedTypes");f(this,"docs");this.name=n,this.accessLevel=e,this.conformances=i!=null?i:[],this.cases=a,this.initializers=o!=null?o:[],this.methods=p!=null?p:[],this.nestedTypes=c!=null?c:[],this.docs=h}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 "),J(n.unsafeName)?e.write(`\`${n.unsafeName}\``):e.write(n.unsafeName),e.write("("),n.associatedValue.forEach((i,a)=>{a>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("}")}};l();u();var ue=class extends w{constructor({accessLevel:e,name:n,conformances:i,cases:a,docs:o}){super();f(this,"name");f(this,"accessLevel");f(this,"conformances");f(this,"cases");f(this,"docs");this.name=n,this.accessLevel=e,this.conformances=i!=null?i:[],this.cases=a,this.docs=o}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 "),J(n.unsafeName)?e.write(`\`${n.unsafeName}\``):e.write(n.unsafeName),n.rawValue!==n.unsafeName&&(e.write(" = "),e.write(`"${ln(n.rawValue)}"`)),e.newLine()}),e.dedent(),e.write("}")}};l();u();var fe=class extends w{constructor({name:e,conformances:n,initializers:i,computedProperties:a,methods:o,nestedTypes:p,docs:c}){super();f(this,"name");f(this,"conformances");f(this,"initializers");f(this,"computedProperties");f(this,"methods");f(this,"nestedTypes");f(this,"docs");this.name=e,this.conformances=n!=null?n:[],this.initializers=i!=null?i:[],this.computedProperties=a!=null?a:[],this.methods=o!=null?o:[],this.nestedTypes=p!=null?p:[],this.docs=c}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("}")}};l();u();var pe=class extends w{constructor({label:e,value:n}){super();f(this,"label");f(this,"value");this.label=e,this.value=n}write(e){this.label!=null&&(e.write(this.label),e.write(": ")),this.value.write(e)}};l();u();var ce=class extends w{constructor({argumentLabel:e,unsafeName:n,escaping:i,type:a,defaultValue:o,docsContent:p}){super();f(this,"argumentLabel");f(this,"unsafeName");f(this,"escaping");f(this,"type");f(this,"defaultValue");f(this,"docsContent");this.argumentLabel=e,this.unsafeName=n,this.escaping=i,this.type=a,this.defaultValue=o,this.docsContent=p}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))}};l();u();var me=class extends w{constructor({accessLevel:e,convenience:n,failable:i,throws:a,parameters:o,body:p,multiline:c,docs:h}){super();f(this,"accessLevel");f(this,"convenience");f(this,"failable");f(this,"throws");f(this,"parameters");f(this,"body");f(this,"multiline");f(this,"docs");this.accessLevel=e,this.convenience=n,this.failable=i,this.throws=a,this.parameters=o!=null?o:[],this.body=p!=null?p:S.empty(),this.multiline=c,this.docs=h}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)}};l();u();var We=class r extends w{constructor({count:e=1}={}){super();f(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})}};l();u();var de=class extends w{constructor({attributes:e,unsafeName:n,accessLevel:i,static_:a,parameters:o,async:p,throws:c,returnType:h,body:y,docs:g}){super();f(this,"attributes");f(this,"unsafeName");f(this,"accessLevel");f(this,"static_");f(this,"parameters");f(this,"async");f(this,"throws");f(this,"returnType");f(this,"body");f(this,"docs");this.attributes=e!=null?e:[],this.unsafeName=n,this.accessLevel=i,this.static_=a,this.parameters=o!=null?o:[],this.async=p,this.throws=c,this.returnType=h,this.body=y!=null?y:S.empty(),this.docs=g}write(e){this.docs!=null&&this.docs.write(e),this.attributes.forEach(n=>{var i;(i=n.arguments)!=null&&i.length?F.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(I(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)}};l();u();var _e=class extends w{constructor(e){super();f(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:v(this.internalPattern.type)}}static enumCaseValueBinding(e){return new this(b({type:"enum-case-value-binding"},e))}};l();u();var he=class extends w{constructor({unsafeName:e,accessLevel:n,static_:i,declarationType:a,type:o,defaultValue:p,docs:c}){super();f(this,"unsafeName");f(this,"accessLevel");f(this,"static_");f(this,"declarationType");f(this,"type");f(this,"defaultValue");f(this,"docs");this.unsafeName=e,this.accessLevel=n,this.static_=i,this.declarationType=a,this.type=o,this.defaultValue=p,this.docs=c}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(" "),J(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))}};l();u();var un={CaseIterable:"CaseIterable",Codable:"Codable",CodingKey:"CodingKey",Decodable:"Decodable",Encodable:"Encodable",Equatable:"Equatable",Error:"Error",Hashable:"Hashable",Sendable:"Sendable",MultipartFormDataConvertible:"MultipartFormDataConvertible"};l();u();var xe=class extends w{constructor({attributes:e,accessLevel:n,name:i,conformances:a,properties:o,initializers:p,methods:c,nestedTypes:h,docs:y}){super();f(this,"attributes");f(this,"name");f(this,"accessLevel");f(this,"conformances");f(this,"properties");f(this,"initializers");f(this,"methods");f(this,"nestedTypes");f(this,"docs");this.attributes=e!=null?e:[],this.name=i,this.accessLevel=n,this.conformances=a!=null?a:[],this.properties=o!=null?o:[],this.initializers=p!=null?p:[],this.methods=c!=null?c:[],this.nestedTypes=h!=null?h:[],this.docs=y}write(e){this.docs!=null&&this.docs.write(e),this.attributes.forEach(c=>{var h;(h=c.arguments)!=null&&h.length?F.functionCall({unsafeName:`@${c.name}`,arguments_:c.arguments}).write(e):(e.write("@"),e.write(c.name)),e.write(" ")}),this.accessLevel!=null&&(e.write(this.accessLevel),e.write(" ")),e.write(`struct ${this.name}`),this.conformances.forEach((c,h)=>{h===0?e.write(": "):h>0&&e.write(", "),e.write(c)}),e.write(" {"),e.newLine(),e.indent();let n=this.properties.length>0,i=this.initializers.length>0,a=this.methods.length>0,o=this.nestedTypes.length>0;this.properties.forEach(c=>{c.write(e),e.newLine()});let p=n;i&&(p&&e.newLine(),this.initializers.forEach((c,h)=>{h>0&&e.newLine(),c.write(e),e.newLine()}),p=!0),a&&(p&&e.newLine(),this.methods.forEach((c,h)=>{h>0&&e.newLine(),c.write(e),e.newLine()}),p=!0),o&&(p&&e.newLine(),this.nestedTypes.forEach((c,h)=>{h>0&&e.newLine(),c.write(e),e.newLine()})),e.dedent(),e.write("}")}};l();u();var M={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"}},ze={Data:{type:"data",symbolName:"Data"},Date:{type:"date",symbolName:"Date"},UUID:{type:"uuid",symbolName:"UUID"}},Ve=class r extends w{constructor(e){super();f(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],a=e.internalType.elements[n];if(!i||!a||!i.equals(a))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:v(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${N(n)}`}case"array":return`${Me(r.toCaseName(e.internalType.elementType))}Array`;case"dictionary":{let n=Me(r.toCaseName(e.internalType.keyType)),i=N(r.toCaseName(e.internalType.valueType));return`${n}To${i}Dictionary`}case"optional":return`optional${N(r.toCaseName(e.internalType.valueType))}`;case"nullable":return`nullable${N(r.toCaseName(e.internalType.valueType))}`;case"custom":return R(e.internalType.name);case"existential-any":return`any${N(e.internalType.protocolName)}`;case"calendar-date":return"calendarDate";case"json-value":return"json";default:v(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:v(this.internalType)}}static primitiveSymbolNames(){return Be(M).map(e=>e.symbolName)}static foundationSymbolNames(){return Be(ze).map(e=>e.symbolName)}static string(){return new this(M.String)}static bool(){return new this(M.Bool)}static int(){return new this(M.Int)}static uint(){return new this(M.UInt)}static uint64(){return new this(M.UInt64)}static int64(){return new this(M.Int64)}static float(){return new this(M.Float)}static double(){return new this(M.Double)}static void(){return new this(M.Void)}static any(){return new this(M.Any)}static data(){return new this(ze.Data)}static date(){return new this(ze.Date)}static uuid(){return new this(ze.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"})}};l();u();var je=class r extends w{constructor(e){super();f(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,a)=>{i.write(e),a<n.arguments.length-1&&e.write(", ")}),e.write(">"));break}case"tuple":e.write("("),n.elements.forEach((i,a)=>{a>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:v(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:v(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)}};l();u();l();u();var x=class x{constructor(t,e,n){f(this,"id");f(this,"name");f(this,"shape");this.id=t,this.name=e,this.shape=n}static isSwiftSymbol(t){return x.SWIFT_SYMBOL_ID===t||t.startsWith(`${x.SWIFT_SYMBOL_ID}.`)}static isSwiftSymbolName(t){return t in x.swiftTypeSymbolsByName}static isFoundationSymbol(t){return x.FOUNDATION_SYMBOL_ID===t||t.startsWith(`${x.FOUNDATION_SYMBOL_ID}.`)}static isFoundationSymbolName(t){return t in x.foundationTypeSymbolsByName}static isCustomSymbol(t){return!x.isSwiftSymbol(t)&&!x.isFoundationSymbol(t)}static create(t,e,n){return new x(t,e,n)}static swiftType(t){return x.create(`${x.SWIFT_SYMBOL_ID}.${t}`,t,{type:"system"})}static foundationType(t){return x.create(`${x.FOUNDATION_SYMBOL_ID}.${t}`,t,{type:"system"})}get isSwiftSymbol(){return x.isSwiftSymbol(this.id)}get isFoundationSymbol(){return x.isFoundationSymbol(this.id)}get isCustomSymbol(){return x.isCustomSymbol(this.id)}};f(x,"SWIFT_SYMBOL_NAME","Swift"),f(x,"SWIFT_SYMBOL_ID",x.SWIFT_SYMBOL_NAME),f(x,"swiftTypeSymbolsByName",{String:x.swiftType("String"),Bool:x.swiftType("Bool"),Int:x.swiftType("Int"),Int64:x.swiftType("Int64"),UInt:x.swiftType("UInt"),UInt64:x.swiftType("UInt64"),Float:x.swiftType("Float"),Double:x.swiftType("Double"),Void:x.swiftType("Void"),Encoder:x.swiftType("Encoder"),Decoder:x.swiftType("Decoder"),Any:x.swiftType("Any")}),f(x,"swiftTypeSymbols",Object.values(x.swiftTypeSymbolsByName)),f(x,"FOUNDATION_SYMBOL_NAME","Foundation"),f(x,"FOUNDATION_SYMBOL_ID",x.FOUNDATION_SYMBOL_NAME),f(x,"foundationTypeSymbolsByName",{Data:x.foundationType("Data"),Date:x.foundationType("Date"),URLSession:x.foundationType("URLSession"),UUID:x.foundationType("UUID")}),f(x,"foundationTypeSymbols",Object.values(x.foundationTypeSymbolsByName));var T=x;l();u();l();u();l();u();l();u();var $e=class{constructor(t,e){f(this,"id");f(this,"name");f(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)}},Ye=class extends $e{constructor(e,n){super(e,n);f(this,"kind","module");f(this,"imports");f(this,"parent",null);this.imports=[]}addImport(e){this.imports.push(e)}get qualifiedPath(){return[this.name]}get qualifiedName(){return this.name}},qe=class extends $e{constructor(e,n,i){super(n,e);f(this,"kind","type");f(this,"shape");f(this,"parent");this.parent=null,this.shape=i}getNearestModuleAncestorOrThrow(){let e=this.parent;for(;e!==null&&e.kind!=="module";)e=e.parent;return k(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 Te=class{constructor(){f(this,"symbolsById",new Map)}createModuleSymbol({symbolId:t,symbolName:e}){this.validateSymbolNotExists(t);let n=new Ye(t,e);return this.symbolsById.set(t,n),n}createTypeSymbol({symbolId:t,symbolName:e,shape:n}){this.validateSymbolNotExists(t);let i=new qe(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),a=i.qualifiedPath;for(let o=1;o<=a.length;o++){let p=a.slice(a.length-o),c=this.resolvePath(n,p);if((c==null?void 0:c.id)===i.id)return p.join(".")}return i.qualifiedName}resolveReference({fromSymbolId:t,reference:e}){let n=this.getSymbolByIdOrThrow(t),i=e.split(".").filter(a=>a.length>0);return this.resolvePath(n,i)}resolvePath(t,e){var p;let[n,...i]=e;if(n===void 0)return null;let a=this.resolveFirstSegment(t,n);if(a===null)return null;let o=a;for(let c=0;c<i.length;c++){let h=i[c];if(ke(h),o=(p=o.getChildByName(h))!=null?p:null,o===null)return null}return o}resolveFirstSegment(t,e){let n=t;for(;n!==null;){let o=n.getChildByName(e);if(o)return o;n=n.parent}let i=t.kind==="module"?t:t.getNearestModuleAncestorOrThrow();if(i.name===e)return i;for(let o of i.imports)if(o.name===e)return o;let a=null;for(let o of i.imports){let p=o.getChildByName(e);if(p){if(a!=null&&a.id!==p.id)return null;a=p}}return a}getSymbolByIdOrThrow(t){let e=this.symbolsById.get(t);return ke(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 Ge=class r{constructor(t,e,n){f(this,"graph");f(this,"swiftSymbol");f(this,"foundationSymbol");f(this,"registeredSourceModule");f(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 Te,e=()=>{let o=t.createModuleSymbol({symbolId:T.SWIFT_SYMBOL_ID,symbolName:T.SWIFT_SYMBOL_NAME});return T.swiftTypeSymbols.forEach(p=>{let c=t.createTypeSymbol({symbolId:p.id,symbolName:p.name,shape:{type:"system"}});t.nestSymbol({parentSymbolId:o.id,childSymbolId:c.id})}),o},n=()=>{let o=t.createModuleSymbol({symbolId:T.FOUNDATION_SYMBOL_ID,symbolName:T.FOUNDATION_SYMBOL_NAME});return T.foundationTypeSymbols.forEach(p=>{let c=t.createTypeSymbol({symbolId:p.id,symbolName:p.name,shape:{type:"system"}});t.nestSymbol({parentSymbolId:o.id,childSymbolId:c.id})}),o},i=e(),a=n();return{graph:t,swiftSymbol:i,foundationSymbol:a}}getRegisteredSourceModuleSymbolOrThrow(){return k(this.registeredSourceModule,"Module symbol not found."),T.create(this.registeredSourceModule.id,this.registeredSourceModule.name,{type:"other"})}getRegisteredTestModuleSymbolOrThrow(){return k(this.registeredTestModule,"Module symbol not found."),T.create(this.registeredTestModule.id,this.registeredTestModule.name,{type:"other"})}getSymbolByIdOrThrow(t){let e=this.graph.getSymbolById(t);return k(e,`Symbol with ID '${t}' not found in registry.`),T.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,T.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),k(this.registeredSourceModule,"Cannot register a test module before registering a source module."),n.addImport(this.registeredSourceModule),this.registeredTestModule=n,T.create(n.id,n.name,{type:"other"})}registerSourceModuleType(t,e){k(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}),T.create(i.id,i.name,e)}registerTestModuleType(t,e){k(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}),T.create(i.id,i.name,e)}registerNestedType({parentSymbol:t,symbolName:e,shape:n}){let i=typeof t=="string"?t:t.id,a=this.inferSymbolIdForNestedType(i,e),o=this.graph.createTypeSymbol({symbolId:a,symbolName:e,shape:n});return this.graph.nestSymbol({parentSymbolId:i,childSymbolId:o.id}),T.create(o.id,o.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?T.create(i.id,i.name,i.kind==="type"?i.shape:{type:"other"}):null}inferSymbolIdForSourceModuleType(t){return k(this.registeredSourceModule,"Cannot get symbol id for a type before registering a module."),`${this.registeredSourceModule.id}.${t}`}inferSymbolIdForTestModuleType(t){return k(this.registeredTestModule,"Cannot get symbol id for a type before registering a module."),`${this.registeredTestModule.id}.${t}`}inferSymbolIdForNestedType(t,e){return`${t}.${e}`}};function Fo(r){return new ne(r)}function Po(r){return new S(r)}function Wo(r){return new ie(r)}function _o(r){return new oe(r)}function zo(r){return new se(r)}function Vo(r){return new le(r)}function jo(r){return new ue(r)}function $o(r){return new fe(r)}function Yo(r){return new pe(r)}function qo(r){return new ce(r)}function Go(r){return new me(r)}function Ho(r){return new de(r)}function Zo(r){return new he(r)}function Ko(r){return new xe(r)}l();u();l();u();function fn(r){return N(R(r))}var He=class{constructor({context:t}){f(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return d.Type.array(this.convert({typeReference:t.typeReference.value}));case"literal":return this.convertLiteral({literal:t.typeReference.value});case"map":return d.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 d.Type.optional(this.convert({typeReference:t.typeReference.value}));case"nullable":return d.Type.nullable(this.convert({typeReference:t.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:t.typeReference.value});case"set":return d.Type.jsonValue();case"unknown":return this.convertUnknown();default:v(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 d.Type.custom(t.declaration.name.pascalCase.unsafeName);default:v(t)}}convertLiteral({literal:t}){switch(t.type){case"boolean":return d.Type.bool();case"string":return d.Type.custom(fn(t.value))}}convertUnknown(){return d.Type.jsonValue()}convertPrimitive({primitive:t}){switch(t){case"INTEGER":return d.Type.int();case"UINT":return d.Type.int();case"LONG":return d.Type.int64();case"UINT_64":return d.Type.uint64();case"FLOAT":return d.Type.float();case"DOUBLE":return d.Type.double();case"BOOLEAN":return d.Type.bool();case"STRING":return d.Type.string();case"DATE":return d.Type.date();case"DATE_TIME":return d.Type.date();case"UUID":return d.Type.uuid();case"BASE_64":return d.Type.string();case"BIG_INTEGER":return d.Type.string();default:v(t)}}};var xt=class{constructor({context:t}){f(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 d.Expression.enumCaseShorthand(ve.generateEnumCaseLabel(t.typeReference.value.value));if(t.typeReference.value.type==="boolean")return d.Expression.nop();v(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?d.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 d.Expression.nop();case"unknown":return this.convertUnknown(t.value);default:v(t.typeReference)}}convertList({list:t,value:e}){return Array.isArray(e)?d.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:Y.Critical,message:`Expected array but got: ${typeof e}`}),d.Expression.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:Y.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),d.Expression.nop()):d.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:v(t)}}convertNullable({nullable:t,value:e,as:n}){return e==null?d.Expression.enumCaseShorthand("null"):d.Expression.contextualMethodCall({methodName:"value",arguments_:[d.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 d.Expression.nop();let i=n.singleDiscriminatedUnionType,a=this.convertDiscriminatedUnionProperties({discriminatedUnionTypeInstance:n,unionVariant:i});return a==null?d.Expression.nop():d.Expression.methodCall({target:d.Expression.reference(t.declaration.name.pascalCase.unsafeName),methodName:re.sanitizeToCamelCase(i.discriminantValue.name.camelCase.unsafeName),arguments_:[d.functionArgument({value:d.Expression.contextualMethodCall({methodName:"init",arguments_:a,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 a=this.context.resolveNamedType({typeId:e.typeId});if(a==null)return;let o=this.convertNamed({named:a,value:t.value});if(!o.isStructInitialization()){this.context.errors.add({severity:Y.Critical,message:"Internal error; expected union value to be a struct"});return}let p=o.asStructInitializationOrThrow();return[...n,...(i=p.arguments_)!=null?i:[]]}case"singleProperty":try{this.context.errors.scope(e.discriminantValue.wireValue);let a=this.context.getRecord(t.value);return a==null?[...n]:[...n,d.functionArgument({label:Pe(re.sanitizeToCamelCase(e.discriminantValue.name.camelCase.unsafeName)),value:this.convert({typeReference:e.typeReference,value:a[e.discriminantValue.wireValue]})})]}finally{this.context.errors.unscope()}case"noProperties":return n;default:v(e)}}getBaseFields({discriminatedUnionTypeInstance:t,singleDiscriminatedUnionType:e}){var i;return this.context.getExampleObjectProperties({parameters:(i=e.properties)!=null?i:[],snippetObject:t.value}).map(a=>{this.context.errors.scope(a.name.wireValue);try{return d.functionArgument({label:Pe(a.name.name.camelCase.unsafeName),value:this.convert(a)})}finally{this.context.errors.unscope()}})}convertEnum({enum_:t,value:e}){let n=this.getEnumValue({enum_:t,value:e});return n==null?d.Expression.nop():d.Expression.enumCaseShorthand(n.name.camelCase.unsafeName)}getEnumValue({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:Y.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:Y.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return n}convertObject({object_:t,value:e,as:n}){return d.Expression.structInitialization({unsafeName:t.declaration.name.pascalCase.unsafeName,arguments_:this.context.getExampleObjectProperties({parameters:t.properties,snippetObject:e}).map(i=>this.convert(i).isNop()?null:d.functionArgument({label:Pe(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?d.Expression.nop():n}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let n of t.types)try{let i=this.convert({typeReference:n,value:e}),o=new He({context:this.context}).convert({typeReference:n});return d.Expression.methodCall({target:d.Expression.reference(t.declaration.name.pascalCase.unsafeName),methodName:o.toCaseName(),arguments_:[d.functionArgument({value:i})],multiline:!0})}catch(i){continue}this.context.errors.add({severity:Y.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}convertUnknown(t){switch(typeof t){case"boolean":return d.Expression.contextualMethodCall({methodName:"bool",arguments_:[d.functionArgument({value:d.Expression.boolLiteral(t)})]});case"string":return d.Expression.contextualMethodCall({methodName:"string",arguments_:[d.functionArgument({value:d.Expression.stringLiteral(t)})]});case"number":return d.Expression.contextualMethodCall({methodName:"number",arguments_:[d.functionArgument({value:d.Expression.numberLiteral(t)})]});case"object":return t===null?d.Expression.enumCaseShorthand("null"):Array.isArray(t)?d.Expression.contextualMethodCall({methodName:"array",arguments_:[d.functionArgument({value:d.Expression.arrayLiteral({elements:t.map(e=>this.convertUnknown(e)),multiline:!0})})]}):d.Expression.contextualMethodCall({methodName:"object",arguments_:[d.functionArgument({value:d.Expression.dictionaryLiteral({entries:Object.entries(t).map(([e,n])=>[d.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?d.Expression.nop():d.Expression.numberLiteral(i)}case"BOOLEAN":{let i=this.getValueAsBoolean({value:e,as:n});return i==null?d.Expression.nop():d.Expression.boolLiteral(i)}case"STRING":{let i=this.context.getValueAsString({value:e});return i==null?d.Expression.nop():d.Expression.stringLiteral(i)}case"DATE":{let i=this.context.getValueAsString({value:e});return i==null?d.Expression.nop():d.Expression.calendarDateLiteral(i)}case"DATE_TIME":{let i=this.context.getValueAsString({value:e});if(i==null)return d.Expression.nop();let a=new Date(i).getTime(),o=Math.round(a/1e3),c=new Date(o*1e3).toISOString().replace(/\.\d{3}Z$/,"Z");return d.Expression.dateLiteral(c)}case"UUID":{let i=this.context.getValueAsString({value:e});return i==null?d.Expression.nop():d.Expression.uuidLiteral(i)}case"BASE_64":{let i=this.context.getValueAsString({value:e});return i==null?d.Expression.nop():d.Expression.stringLiteral(i)}case"BIG_INTEGER":return this.context.getValueAsString({value:e})==null?d.Expression.nop():d.Expression.nop();default:v(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:v(e)}})();return this.context.getValueAsBoolean({value:n})}};0&&(module.exports={DynamicTypeLiteralMapper});
20
- /*! Bundled license information:
21
-
22
- @esbuild-plugins/node-globals-polyfill/Buffer.js:
23
- (*!
24
- * The buffer module from node.js, for the browser.
25
- *
26
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
27
- * @license MIT
28
- *)
29
-
30
- lodash-es/lodash.js:
31
- (**
32
- * @license
33
- * Lodash (Custom Build) <https://lodash.com/>
34
- * Build: `lodash modularize exports="es" -o ./`
35
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
36
- * Released under MIT license <https://lodash.com/license>
37
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
38
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
39
- *)
40
- */
41
- //# sourceMappingURL=DynamicTypeLiteralMapper.cjs.map