@fern-api/java-dynamic-snippets 0.0.2 → 0.0.4

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 (76) hide show
  1. package/cjs/Config.cjs +1 -0
  2. package/cjs/Config.cjs.map +1 -0
  3. package/cjs/DynamicSnippetsGenerator.cjs +16 -11
  4. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -0
  5. package/cjs/DynamicSnippetsGenerator.d.cts +1 -1
  6. package/cjs/{DynamicSnippetsGeneratorContext-D5kyHx_O.d.cts → DynamicSnippetsGeneratorContext-FbVOZ8Go.d.cts} +9 -7
  7. package/cjs/EndpointSnippetGenerator.cjs +12 -7
  8. package/cjs/EndpointSnippetGenerator.cjs.map +1 -0
  9. package/cjs/EndpointSnippetGenerator.d.cts +4 -1
  10. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +16 -11
  11. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -0
  12. package/cjs/context/DynamicSnippetsGeneratorContext.d.cts +1 -1
  13. package/cjs/context/DynamicTypeLiteralMapper.cjs +12 -7
  14. package/cjs/context/DynamicTypeLiteralMapper.cjs.map +1 -0
  15. package/cjs/context/DynamicTypeLiteralMapper.d.cts +1 -1
  16. package/cjs/context/DynamicTypeMapper.cjs +12 -7
  17. package/cjs/context/DynamicTypeMapper.cjs.map +1 -0
  18. package/cjs/context/DynamicTypeMapper.d.cts +1 -1
  19. package/cjs/context/FilePropertyMapper.cjs +12 -7
  20. package/cjs/context/FilePropertyMapper.cjs.map +1 -0
  21. package/cjs/context/FilePropertyMapper.d.cts +1 -1
  22. package/cjs/index.cjs +26 -21
  23. package/cjs/index.cjs.map +1 -0
  24. package/cjs/index.d.cts +2 -2
  25. package/esm/Config.js +2 -1
  26. package/esm/Config.js.map +1 -0
  27. package/esm/DynamicSnippetsGenerator.d.ts +1 -1
  28. package/esm/DynamicSnippetsGenerator.js +2 -1
  29. package/esm/DynamicSnippetsGenerator.js.map +1 -0
  30. package/esm/{DynamicSnippetsGeneratorContext-D5kyHx_O.d.ts → DynamicSnippetsGeneratorContext-FbVOZ8Go.d.ts} +9 -7
  31. package/esm/EndpointSnippetGenerator.d.ts +4 -1
  32. package/esm/EndpointSnippetGenerator.js +2 -1
  33. package/esm/EndpointSnippetGenerator.js.map +1 -0
  34. package/esm/chunk-3JSOCWNQ.js +20 -0
  35. package/esm/chunk-3JSOCWNQ.js.map +1 -0
  36. package/esm/chunk-3LOINSB3.js +2 -0
  37. package/esm/chunk-3LOINSB3.js.map +1 -0
  38. package/esm/chunk-6YM2QG7U.js +2 -0
  39. package/esm/chunk-6YM2QG7U.js.map +1 -0
  40. package/esm/{chunk-2AZXIWKY.js → chunk-E6GFFTKW.js} +2 -1
  41. package/esm/chunk-E6GFFTKW.js.map +1 -0
  42. package/esm/chunk-JZ2FDMYI.js +15 -0
  43. package/esm/chunk-JZ2FDMYI.js.map +1 -0
  44. package/esm/{chunk-452HWDL4.js → chunk-JZBCQWQN.js} +2 -1
  45. package/esm/chunk-JZBCQWQN.js.map +1 -0
  46. package/esm/{chunk-7CY27UU7.js → chunk-PUPEW5QI.js} +2 -1
  47. package/esm/chunk-PUPEW5QI.js.map +1 -0
  48. package/esm/chunk-SQKACQJK.js +2 -0
  49. package/esm/chunk-SQKACQJK.js.map +1 -0
  50. package/esm/chunk-WBGWLNLI.js +2 -0
  51. package/esm/chunk-WBGWLNLI.js.map +1 -0
  52. package/esm/chunk-ZYVZJBJN.js +2 -0
  53. package/esm/chunk-ZYVZJBJN.js.map +1 -0
  54. package/esm/context/DynamicSnippetsGeneratorContext.d.ts +1 -1
  55. package/esm/context/DynamicSnippetsGeneratorContext.js +2 -1
  56. package/esm/context/DynamicSnippetsGeneratorContext.js.map +1 -0
  57. package/esm/context/DynamicTypeLiteralMapper.d.ts +1 -1
  58. package/esm/context/DynamicTypeLiteralMapper.js +2 -1
  59. package/esm/context/DynamicTypeLiteralMapper.js.map +1 -0
  60. package/esm/context/DynamicTypeMapper.d.ts +1 -1
  61. package/esm/context/DynamicTypeMapper.js +2 -1
  62. package/esm/context/DynamicTypeMapper.js.map +1 -0
  63. package/esm/context/FilePropertyMapper.d.ts +1 -1
  64. package/esm/context/FilePropertyMapper.js +2 -1
  65. package/esm/context/FilePropertyMapper.js.map +1 -0
  66. package/esm/index.d.ts +2 -2
  67. package/esm/index.js +12 -11
  68. package/esm/index.js.map +1 -0
  69. package/package.json +1 -1
  70. package/esm/chunk-AASPH6YC.js +0 -15
  71. package/esm/chunk-BECJPKDE.js +0 -1
  72. package/esm/chunk-HN67B7VQ.js +0 -1
  73. package/esm/chunk-IBCUQF6Z.js +0 -14
  74. package/esm/chunk-JSEUWNSK.js +0 -1
  75. package/esm/chunk-TTNRR5YY.js +0 -1
  76. package/esm/chunk-WFKWXM7L.js +0 -1
@@ -1,18 +1,22 @@
1
- "use strict";var ue=Object.defineProperty,yr=Object.defineProperties,gr=Object.getOwnPropertyDescriptor,wr=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertyNames,se=Object.getOwnPropertySymbols;var be=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable;var Re=(n,t,e)=>t in n?ue(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,je=(n,t)=>{for(var e in t||(t={}))be.call(t,e)&&Re(n,e,t[e]);if(se)for(var e of se(t))De.call(t,e)&&Re(n,e,t[e]);return n},Ve=(n,t)=>yr(n,wr(t));var We=n=>typeof n=="symbol"?n:n+"",$e=(n,t)=>{var e={};for(var r in n)be.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&se)for(var r of se(n))t.indexOf(r)<0&&De.call(n,r)&&(e[r]=n[r]);return e};var Ae=(n,t)=>()=>(n&&(t=n(n=0)),t);var Ye=(n,t)=>{for(var e in t)ue(n,e,{get:t[e],enumerable:!0})},Tr=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of vr(t))!be.call(n,a)&&a!==e&&ue(n,a,{get:()=>t[a],enumerable:!(r=gr(t,a))||r.enumerable});return n};var Nr=n=>Tr(ue({},"__esModule",{value:!0}),n);var c=(n,t,e)=>Re(n,typeof t!="symbol"?t+"":t,e);function ze(){throw new Error("setTimeout has not been defined")}function qe(){throw new Error("clearTimeout has not been defined")}function He(n){if(F===setTimeout)return setTimeout(n,0);if((F===ze||!F)&&setTimeout)return F=setTimeout,setTimeout(n,0);try{return F(n,0)}catch(t){try{return F.call(null,n,0)}catch(e){return F.call(this,n,0)}}}function Rr(n){if(B===clearTimeout)return clearTimeout(n);if((B===qe||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(n);try{return B(n)}catch(t){try{return B.call(null,n)}catch(e){return B.call(this,n)}}}function br(){!Z||!O||(Z=!1,O.length?S=O.concat(S):fe=-1,S.length&&Je())}function Je(){if(!Z){var n=He(br);Z=!0;for(var t=S.length;t;){for(O=S,S=[];++fe<t;)O&&O[fe].run();fe=-1,t=S.length}O=null,Z=!1,Rr(n)}}function Ar(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];S.push(new Ze(n,t)),S.length===1&&!Z&&He(Je)}function Ze(n,t){this.fun=n,this.array=t}function _(){}function Wr(n){throw new Error("process.binding is not supported")}function $r(){return"/"}function Yr(n){throw new Error("process.chdir is not supported")}function Gr(){return 0}function qr(n){var t=zr.call(J)*.001,e=Math.floor(t),r=Math.floor(t%1*1e9);return n&&(e=e-n[0],r=r-n[1],r<0&&(e--,r+=1e9)),[e,r]}function Jr(){var n=new Date,t=n-Hr;return t/1e3}var F,B,S,Z,O,fe,Er,Ir,kr,Lr,Cr,Sr,Ur,Pr,Fr,Br,Mr,Or,_r,Dr,jr,Vr,J,zr,Hr,p,Ge,u=Ae(()=>{"use strict";F=ze,B=qe;typeof globalThis.setTimeout=="function"&&(F=setTimeout);typeof globalThis.clearTimeout=="function"&&(B=clearTimeout);S=[],Z=!1,fe=-1;Ze.prototype.run=function(){this.fun.apply(null,this.array)};Er="browser",Ir="browser",kr=!0,Lr={},Cr=[],Sr="",Ur={},Pr={},Fr={};Br=_,Mr=_,Or=_,_r=_,Dr=_,jr=_,Vr=_;J=globalThis.performance||{},zr=J.now||J.mozNow||J.msNow||J.oNow||J.webkitNow||function(){return new Date().getTime()};Hr=new Date;p={nextTick:Ar,title:Er,browser:kr,env:Lr,argv:Cr,version:Sr,versions:Ur,on:Br,addListener:Mr,once:Or,off:_r,removeListener:Dr,removeAllListeners:jr,emit:Vr,binding:Wr,cwd:$r,chdir:Yr,umask:Gr,hrtime:qr,platform:Ir,release:Pr,config:Fr,uptime:Jr},Ge={};Object.keys(Ge).forEach(n=>{let t=n.split("."),e=p;for(let r=0;r<t.length;r++){let a=t[r];r===t.length-1?e[a]=Ge[n]:e=e[a]||(e[a]={})}})});function et(){Ie=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,e=n.length;t<e;++t)k[t]=n[t],E[n.charCodeAt(t)]=t;E[45]=62,E[95]=63}function Kr(n){Ie||et();var t,e,r,a,i,o,m=n.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=n[m-2]==="="?2:n[m-1]==="="?1:0,o=new Zr(m*3/4-i),r=i>0?m-4:m;var d=0;for(t=0,e=0;t<r;t+=4,e+=3)a=E[n.charCodeAt(t)]<<18|E[n.charCodeAt(t+1)]<<12|E[n.charCodeAt(t+2)]<<6|E[n.charCodeAt(t+3)],o[d++]=a>>16&255,o[d++]=a>>8&255,o[d++]=a&255;return i===2?(a=E[n.charCodeAt(t)]<<2|E[n.charCodeAt(t+1)]>>4,o[d++]=a&255):i===1&&(a=E[n.charCodeAt(t)]<<10|E[n.charCodeAt(t+1)]<<4|E[n.charCodeAt(t+2)]>>2,o[d++]=a>>8&255,o[d++]=a&255),o}function Xr(n){return k[n>>18&63]+k[n>>12&63]+k[n>>6&63]+k[n&63]}function Qr(n,t,e){for(var r,a=[],i=t;i<e;i+=3)r=(n[i]<<16)+(n[i+1]<<8)+n[i+2],a.push(Xr(r));return a.join("")}function Ke(n){Ie||et();for(var t,e=n.length,r=e%3,a="",i=[],o=16383,m=0,d=e-r;m<d;m+=o)i.push(Qr(n,m,m+o>d?d:m+o));return r===1?(t=n[e-1],a+=k[t>>2],a+=k[t<<4&63],a+="=="):r===2&&(t=(n[e-2]<<8)+n[e-1],a+=k[t>>10],a+=k[t>>4&63],a+=k[t<<2&63],a+="="),i.push(a),i.join("")}function le(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(n,t){if(le()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t),n.__proto__=s.prototype):(n===null&&(n=new s(t)),n.length=t),n}function s(n,t,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(n,t,e);if(typeof n=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return ke(this,n)}return tt(this,n,t,e)}function tt(n,t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer?rn(n,t,e,r):typeof t=="string"?tn(n,t,e):nn(n,t)}function rt(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function en(n,t,e,r){return rt(t),t<=0?U(n,t):e!==void 0?typeof r=="string"?U(n,t).fill(e,r):U(n,t).fill(e):U(n,t)}function ke(n,t){if(rt(t),n=U(n,t<0?0:Le(t)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<t;++e)n[e]=0;return n}function tn(n,t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=nt(t,e)|0;n=U(n,r);var a=n.write(t,e);return a!==r&&(n=n.slice(0,a)),n}function Ee(n,t){var e=t.length<0?0:Le(t.length)|0;n=U(n,e);for(var r=0;r<e;r+=1)n[r]=t[r]&255;return n}function rn(n,t,e,r){if(t.byteLength,e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");return e===void 0&&r===void 0?t=new Uint8Array(t):r===void 0?t=new Uint8Array(t,e):t=new Uint8Array(t,e,r),s.TYPED_ARRAY_SUPPORT?(n=t,n.__proto__=s.prototype):n=Ee(n,t),n}function nn(n,t){if(L(t)){var e=Le(t.length)|0;return n=U(n,e),n.length===0||t.copy(n,0,0,e),n}if(t){if(typeof ArrayBuffer!="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||Rn(t.length)?U(n,0):Ee(n,t);if(t.type==="Buffer"&&Array.isArray(t.data))return Ee(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Le(n){if(n>=le())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+le().toString(16)+" bytes");return n|0}function L(n){return!!(n!=null&&n._isBuffer)}function nt(n,t){if(L(n))return n.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var e=n.length;if(e===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return pe(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return lt(n).length;default:if(r)return pe(n).length;t=(""+t).toLowerCase(),r=!0}}function an(n,t,e){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(n||(n="utf8");;)switch(n){case"hex":return hn(this,t,e);case"utf8":case"utf-8":return ot(this,t,e);case"ascii":return mn(this,t,e);case"latin1":case"binary":return dn(this,t,e);case"base64":return pn(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xn(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}function D(n,t,e){var r=n[t];n[t]=n[e],n[e]=r}function at(n,t,e,r,a){if(n.length===0)return-1;if(typeof e=="string"?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=a?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(a)return-1;e=n.length-1}else if(e<0)if(a)e=0;else return-1;if(typeof t=="string"&&(t=s.from(t,r)),L(t))return t.length===0?-1:Xe(n,t,e,r,a);if(typeof t=="number")return t=t&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(n,t,e):Uint8Array.prototype.lastIndexOf.call(n,t,e):Xe(n,[t],e,r,a);throw new TypeError("val must be string, number or Buffer")}function Xe(n,t,e,r,a){var i=1,o=n.length,m=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||t.length<2)return-1;i=2,o/=2,m/=2,e/=2}function d(A,H){return i===1?A[H]:A.readUInt16BE(H*i)}var x;if(a){var y=-1;for(x=e;x<o;x++)if(d(n,x)===d(t,y===-1?0:x-y)){if(y===-1&&(y=x),x-y+1===m)return y*i}else y!==-1&&(x-=x-y),y=-1}else for(e+m>o&&(e=o-m),x=e;x>=0;x--){for(var h=!0,I=0;I<m;I++)if(d(n,x+I)!==d(t,I)){h=!1;break}if(h)return x}return-1}function on(n,t,e,r){e=Number(e)||0;var a=n.length-e;r?(r=Number(r),r>a&&(r=a)):r=a;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o<r;++o){var m=parseInt(t.substr(o*2,2),16);if(isNaN(m))return o;n[e+o]=m}return o}function sn(n,t,e,r){return de(pe(t,n.length-e),n,e,r)}function it(n,t,e,r){return de(Tn(t),n,e,r)}function un(n,t,e,r){return it(n,t,e,r)}function fn(n,t,e,r){return de(lt(t),n,e,r)}function ln(n,t,e,r){return de(Nn(t,n.length-e),n,e,r)}function pn(n,t,e){return t===0&&e===n.length?Ke(n):Ke(n.slice(t,e))}function ot(n,t,e){e=Math.min(n.length,e);for(var r=[],a=t;a<e;){var i=n[a],o=null,m=i>239?4:i>223?3:i>191?2:1;if(a+m<=e){var d,x,y,h;switch(m){case 1:i<128&&(o=i);break;case 2:d=n[a+1],(d&192)===128&&(h=(i&31)<<6|d&63,h>127&&(o=h));break;case 3:d=n[a+1],x=n[a+2],(d&192)===128&&(x&192)===128&&(h=(i&15)<<12|(d&63)<<6|x&63,h>2047&&(h<55296||h>57343)&&(o=h));break;case 4:d=n[a+1],x=n[a+2],y=n[a+3],(d&192)===128&&(x&192)===128&&(y&192)===128&&(h=(i&15)<<18|(d&63)<<12|(x&63)<<6|y&63,h>65535&&h<1114112&&(o=h))}}o===null?(o=65533,m=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),a+=m}return cn(r)}function cn(n){var t=n.length;if(t<=Qe)return String.fromCharCode.apply(String,n);for(var e="",r=0;r<t;)e+=String.fromCharCode.apply(String,n.slice(r,r+=Qe));return e}function mn(n,t,e){var r="";e=Math.min(n.length,e);for(var a=t;a<e;++a)r+=String.fromCharCode(n[a]&127);return r}function dn(n,t,e){var r="";e=Math.min(n.length,e);for(var a=t;a<e;++a)r+=String.fromCharCode(n[a]);return r}function hn(n,t,e){var r=n.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);for(var a="",i=t;i<e;++i)a+=vn(n[i]);return a}function xn(n,t,e){for(var r=n.slice(t,e),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+r[i+1]*256);return a}function N(n,t,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+t>e)throw new RangeError("Trying to access beyond buffer length")}function R(n,t,e,r,a,i){if(!L(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(e+r>n.length)throw new RangeError("Index out of range")}function ce(n,t,e,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(n.length-e,2);a<i;++a)n[e+a]=(t&255<<8*(r?a:1-a))>>>(r?a:1-a)*8}function me(n,t,e,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(n.length-e,4);a<i;++a)n[e+a]=t>>>(r?a:3-a)*8&255}function st(n,t,e,r,a,i){if(e+r>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ut(n,t,e,r,a){return a||st(n,t,e,4,34028234663852886e22,-34028234663852886e22),ct(n,t,e,r,23,4),e+4}function ft(n,t,e,r,a){return a||st(n,t,e,8,17976931348623157e292,-17976931348623157e292),ct(n,t,e,r,52,8),e+8}function gn(n){if(n=wn(n).replace(yn,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function wn(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function vn(n){return n<16?"0"+n.toString(16):n.toString(16)}function pe(n,t){t=t||1/0;for(var e,r=n.length,a=null,i=[],o=0;o<r;++o){if(e=n.charCodeAt(o),e>55295&&e<57344){if(!a){if(e>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=e;continue}if(e<56320){(t-=3)>-1&&i.push(239,191,189),a=e;continue}e=(a-55296<<10|e-56320)+65536}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,e<128){if((t-=1)<0)break;i.push(e)}else if(e<2048){if((t-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Tn(n){for(var t=[],e=0;e<n.length;++e)t.push(n.charCodeAt(e)&255);return t}function Nn(n,t){for(var e,r,a,i=[],o=0;o<n.length&&!((t-=2)<0);++o)e=n.charCodeAt(o),r=e>>8,a=e%256,i.push(a),i.push(r);return i}function lt(n){return Kr(gn(n))}function de(n,t,e,r){for(var a=0;a<r&&!(a+e>=t.length||a>=n.length);++a)t[a+e]=n[a];return a}function Rn(n){return n!==n}function bn(n){return n!=null&&(!!n._isBuffer||pt(n)||An(n))}function pt(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function An(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&pt(n.slice(0,0))}function he(n,t,e,r,a){var i,o,m=a*8-r-1,d=(1<<m)-1,x=d>>1,y=-7,h=e?a-1:0,I=e?-1:1,A=n[t+h];for(h+=I,i=A&(1<<-y)-1,A>>=-y,y+=m;y>0;i=i*256+n[t+h],h+=I,y-=8);for(o=i&(1<<-y)-1,i>>=-y,y+=r;y>0;o=o*256+n[t+h],h+=I,y-=8);if(i===0)i=1-x;else{if(i===d)return o?NaN:(A?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-x}return(A?-1:1)*o*Math.pow(2,i-r)}function ct(n,t,e,r,a,i){var o,m,d,x=i*8-a-1,y=(1<<x)-1,h=y>>1,I=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:i-1,H=r?1:-1,xr=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,o=y):(o=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-o))<1&&(o--,d*=2),o+h>=1?t+=I/d:t+=I*Math.pow(2,1-h),t*d>=2&&(o++,d/=2),o+h>=y?(m=0,o=y):o+h>=1?(m=(t*d-1)*Math.pow(2,a),o=o+h):(m=t*Math.pow(2,h-1)*Math.pow(2,a),o=0));a>=8;n[e+A]=m&255,A+=H,m/=256,a-=8);for(o=o<<a|m,x+=a;x>0;n[e+A]=o&255,A+=H,o/=256,x-=8);n[e+A-H]|=xr*128}var k,E,Zr,Ie,Qe,yn,mt=Ae(()=>{"use strict";u();f();k=[],E=[],Zr=typeof Uint8Array!="undefined"?Uint8Array:Array,Ie=!1;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;s.poolSize=8192;s._augment=function(n){return n.__proto__=s.prototype,n};s.from=function(n,t,e){return tt(null,n,t,e)};s.kMaxLength=le();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&s[Symbol.species]);s.alloc=function(n,t,e){return en(null,n,t,e)};s.allocUnsafe=function(n){return ke(null,n)};s.allocUnsafeSlow=function(n){return ke(null,n)};s.isBuffer=bn;s.compare=function(t,e){if(!L(t)||!L(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,a=e.length,i=0,o=Math.min(r,a);i<o;++i)if(t[i]!==e[i]){r=t[i],a=e[i];break}return r<a?-1:a<r?1:0};s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return s.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var a=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!L(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(a,i),i+=o.length}return a};s.byteLength=nt;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)D(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)D(this,e,e+3),D(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)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};s.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?ot(this,0,t):an.apply(this,arguments)};s.prototype.equals=function(t){if(!L(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:s.compare(this,t)===0};s.prototype.compare=function(t,e,r,a,i){if(!L(t))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),e<0||r>t.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&e>=r)return 0;if(a>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,a>>>=0,i>>>=0,this===t)return 0;for(var o=i-a,m=r-e,d=Math.min(o,m),x=this.slice(a,i),y=t.slice(e,r),h=0;h<d;++h)if(x[h]!==y[h]){o=x[h],m=y[h];break}return o<m?-1:m<o?1:0};s.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1};s.prototype.indexOf=function(t,e,r){return at(this,t,e,r,!0)};s.prototype.lastIndexOf=function(t,e,r){return at(this,t,e,r,!1)};s.prototype.write=function(t,e,r,a){if(e===void 0)a="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")a=e,r=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(r)?(r=r|0,a===void 0&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((r===void 0||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var o=!1;;)switch(a){case"hex":return on(this,t,e,r);case"utf8":case"utf-8":return sn(this,t,e,r);case"ascii":return it(this,t,e,r);case"latin1":case"binary":return un(this,t,e,r);case"base64":return fn(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ln(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Qe=4096;s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var a;if(s.TYPED_ARRAY_SUPPORT)a=this.subarray(t,e),a.__proto__=s.prototype;else{var i=e-t;a=new s(i,void 0);for(var o=0;o<i;++o)a[o]=this[o+t]}return a};s.prototype.readUIntLE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var a=this[t],i=1,o=0;++o<e&&(i*=256);)a+=this[t+o]*i;return a};s.prototype.readUIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var a=this[t+--e],i=1;e>0&&(i*=256);)a+=this[t+--e]*i;return a};s.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]};s.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8};s.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]};s.prototype.readUInt32LE=function(t,e){return e||N(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||N(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};s.prototype.readIntLE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var a=this[t],i=1,o=0;++o<e&&(i*=256);)a+=this[t+o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readIntBE=function(t,e,r){t=t|0,e=e|0,r||N(t,e,this.length);for(var a=e,i=1,o=this[t+--a];a>0&&(i*=256);)o+=this[t+--a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readInt8=function(t,e){return e||N(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};s.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};s.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};s.prototype.readInt32LE=function(t,e){return e||N(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||N(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||N(t,4,this.length),he(this,t,!0,23,4)};s.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),he(this,t,!1,23,4)};s.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),he(this,t,!0,52,8)};s.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),he(this,t,!1,52,8)};s.prototype.writeUIntLE=function(t,e,r,a){if(t=+t,e=e|0,r=r|0,!a){var i=Math.pow(2,8*r)-1;R(this,t,e,r,i,0)}var o=1,m=0;for(this[e]=t&255;++m<r&&(o*=256);)this[e+m]=t/o&255;return e+r};s.prototype.writeUIntBE=function(t,e,r,a){if(t=+t,e=e|0,r=r|0,!a){var i=Math.pow(2,8*r)-1;R(this,t,e,r,i,0)}var o=r-1,m=1;for(this[e+o]=t&255;--o>=0&&(m*=256);)this[e+o]=t/m&255;return e+r};s.prototype.writeUInt8=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t&255,e+1};s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ce(this,t,e,!0),e+2};s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ce(this,t,e,!1),e+2};s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e|0,r||R(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):me(this,t,e,!0),e+4};s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e|0,r||R(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):me(this,t,e,!1),e+4};s.prototype.writeIntLE=function(t,e,r,a){if(t=+t,e=e|0,!a){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,m=1,d=0;for(this[e]=t&255;++o<r&&(m*=256);)t<0&&d===0&&this[e+o-1]!==0&&(d=1),this[e+o]=(t/m>>0)-d&255;return e+r};s.prototype.writeIntBE=function(t,e,r,a){if(t=+t,e=e|0,!a){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,m=1,d=0;for(this[e+o]=t&255;--o>=0&&(m*=256);)t<0&&d===0&&this[e+o+1]!==0&&(d=1),this[e+o]=(t/m>>0)-d&255;return e+r};s.prototype.writeInt8=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=t&255,e+1};s.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t&255,this[e+1]=t>>>8):ce(this,t,e,!0),e+2};s.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e|0,r||R(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t&255):ce(this,t,e,!1),e+2};s.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e|0,r||R(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):me(this,t,e,!0),e+4};s.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e|0,r||R(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):me(this,t,e,!1),e+4};s.prototype.writeFloatLE=function(t,e,r){return ut(this,t,e,!0,r)};s.prototype.writeFloatBE=function(t,e,r){return ut(this,t,e,!1,r)};s.prototype.writeDoubleLE=function(t,e,r){return ft(this,t,e,!0,r)};s.prototype.writeDoubleBE=function(t,e,r){return ft(this,t,e,!1,r)};s.prototype.copy=function(t,e,r,a){if(r||(r=0),!a&&a!==0&&(a=this.length),e>=t.length&&(e=t.length),e||(e=0),a>0&&a<r&&(a=r),a===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-e<a-r&&(a=t.length-e+r);var i=a-r,o;if(this===t&&r<e&&e<a)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i};s.prototype.fill=function(t,e,r,a){if(typeof t=="string"){if(typeof e=="string"?(a=e,e=0,r=this.length):typeof r=="string"&&(a=r,r=this.length),t.length===1){var i=t.charCodeAt(0);i<256&&(t=i)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!s.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof t=="number"&&(t=t&255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);var o;if(typeof t=="number")for(o=e;o<r;++o)this[o]=t;else{var m=L(t)?t:pe(new s(t,a).toString()),d=m.length;for(o=0;o<r-e;++o)this[o+e]=m[o%d]}return this};yn=/[^+\/0-9A-Za-z-_]/g});var f=Ae(()=>{"use strict";mt()});var Mi={};Ye(Mi,{DynamicSnippetsGeneratorContext:()=>_e});module.exports=Nr(Mi);u();f();u();f();u();f();u();f();u();f();u();f();u();f();var En=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,dt=En;var In=typeof self=="object"&&self&&self.Object===Object&&self,kn=dt||In||Function("return this")(),ht=kn;var Ln=ht.Symbol,P=Ln;u();f();var xt=Object.prototype,Cn=xt.hasOwnProperty,Sn=xt.toString,X=P?P.toStringTag:void 0;function Un(n){var t=Cn.call(n,X),e=n[X];try{n[X]=void 0;var r=!0}catch(i){}var a=Sn.call(n);return r&&(t?n[X]=e:delete n[X]),a}var yt=Un;u();f();var Pn=Object.prototype,Fn=Pn.toString;function Bn(n){return Fn.call(n)}var gt=Bn;var Mn="[object Null]",On="[object Undefined]",wt=P?P.toStringTag:void 0;function _n(n){return n==null?n===void 0?On:Mn:wt&&wt in Object(n)?yt(n):gt(n)}var vt=_n;u();f();function Dn(n){return n!=null&&typeof n=="object"}var Tt=Dn;var jn="[object Symbol]";function Vn(n){return typeof n=="symbol"||Tt(n)&&vt(n)==jn}var Nt=Vn;u();f();u();f();function Wn(n,t){for(var e=-1,r=n==null?0:n.length,a=Array(r);++e<r;)a[e]=t(n[e],e,n);return a}var Rt=Wn;u();f();var $n=Array.isArray,bt=$n;var Yn=1/0,At=P?P.prototype:void 0,Et=At?At.toString:void 0;function It(n){if(typeof n=="string")return n;if(bt(n))return Rt(n,It)+"";if(Nt(n))return Et?Et.call(n):"";var t=n+"";return t=="0"&&1/n==-Yn?"-0":t}var kt=It;u();f();function Gn(n){return n==null?"":kt(n)}var M=Gn;u();f();u();f();u();f();u();f();u();f();u();f();function zn(n,t,e){var r=-1,a=n.length;t<0&&(t=-t>a?0:a+t),e=e>a?a:e,e<0&&(e+=a),a=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(a);++r<a;)i[r]=n[r+t];return i}var Lt=zn;function qn(n,t,e){var r=n.length;return e=e===void 0?r:e,!t&&e>=r?n:Lt(n,t,e)}var Ct=qn;u();f();var Hn="\\ud800-\\udfff",Jn="\\u0300-\\u036f",Zn="\\ufe20-\\ufe2f",Kn="\\u20d0-\\u20ff",Xn=Jn+Zn+Kn,Qn="\\ufe0e\\ufe0f",ea="\\u200d",ta=RegExp("["+ea+Hn+Xn+Qn+"]");function ra(n){return ta.test(n)}var xe=ra;u();f();u();f();function na(n){return n.split("")}var St=na;u();f();var Ut="\\ud800-\\udfff",aa="\\u0300-\\u036f",ia="\\ufe20-\\ufe2f",oa="\\u20d0-\\u20ff",sa=aa+ia+oa,ua="\\ufe0e\\ufe0f",fa="["+Ut+"]",Ce="["+sa+"]",Se="\\ud83c[\\udffb-\\udfff]",la="(?:"+Ce+"|"+Se+")",Pt="[^"+Ut+"]",Ft="(?:\\ud83c[\\udde6-\\uddff]){2}",Bt="[\\ud800-\\udbff][\\udc00-\\udfff]",pa="\\u200d",Mt=la+"?",Ot="["+ua+"]?",ca="(?:"+pa+"(?:"+[Pt,Ft,Bt].join("|")+")"+Ot+Mt+")*",ma=Ot+Mt+ca,da="(?:"+[Pt+Ce+"?",Ce,Ft,Bt,fa].join("|")+")",ha=RegExp(Se+"(?="+Se+")|"+da+ma,"g");function xa(n){return n.match(ha)||[]}var _t=xa;function ya(n){return xe(n)?_t(n):St(n)}var Dt=ya;function ga(n){return function(t){t=M(t);var e=xe(t)?Dt(t):void 0,r=e?e[0]:t.charAt(0),a=e?Ct(e,1).join(""):t.slice(1);return r[n]()+a}}var jt=ga;var wa=jt("toUpperCase"),Vt=wa;function va(n){return Vt(M(n).toLowerCase())}var Wt=va;u();f();u();f();function Ta(n,t,e,r){var a=-1,i=n==null?0:n.length;for(r&&i&&(e=n[++a]);++a<i;)e=t(e,n[a],a,n);return e}var $t=Ta;u();f();u();f();u();f();function Na(n){return function(t){return n==null?void 0:n[t]}}var Yt=Na;var Ra={\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"},ba=Yt(Ra),Gt=ba;var Aa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ea="\\u0300-\\u036f",Ia="\\ufe20-\\ufe2f",ka="\\u20d0-\\u20ff",La=Ea+Ia+ka,Ca="["+La+"]",Sa=RegExp(Ca,"g");function Ua(n){return n=M(n),n&&n.replace(Aa,Gt).replace(Sa,"")}var zt=Ua;u();f();u();f();var Pa=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Fa(n){return n.match(Pa)||[]}var qt=Fa;u();f();var Ba=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ma(n){return Ba.test(n)}var Ht=Ma;u();f();var Qt="\\ud800-\\udfff",Oa="\\u0300-\\u036f",_a="\\ufe20-\\ufe2f",Da="\\u20d0-\\u20ff",ja=Oa+_a+Da,er="\\u2700-\\u27bf",tr="a-z\\xdf-\\xf6\\xf8-\\xff",Va="\\xac\\xb1\\xd7\\xf7",Wa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$a="\\u2000-\\u206f",Ya=" \\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",Ga="\\ufe0e\\ufe0f",nr=Va+Wa+$a+Ya,ar="['\u2019]",Jt="["+nr+"]",za="["+ja+"]",ir="\\d+",qa="["+er+"]",or="["+tr+"]",sr="[^"+Qt+nr+ir+er+tr+rr+"]",Ha="\\ud83c[\\udffb-\\udfff]",Ja="(?:"+za+"|"+Ha+")",Za="[^"+Qt+"]",ur="(?:\\ud83c[\\udde6-\\uddff]){2}",fr="[\\ud800-\\udbff][\\udc00-\\udfff]",K="["+rr+"]",Ka="\\u200d",Zt="(?:"+or+"|"+sr+")",Xa="(?:"+K+"|"+sr+")",Kt="(?:"+ar+"(?:d|ll|m|re|s|t|ve))?",Xt="(?:"+ar+"(?:D|LL|M|RE|S|T|VE))?",lr=Ja+"?",pr="["+Ga+"]?",Qa="(?:"+Ka+"(?:"+[Za,ur,fr].join("|")+")"+pr+lr+")*",ei="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ti="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ri=pr+lr+Qa,ni="(?:"+[qa,ur,fr].join("|")+")"+ri,ai=RegExp([K+"?"+or+"+"+Kt+"(?="+[Jt,K,"$"].join("|")+")",Xa+"+"+Xt+"(?="+[Jt,K+Zt,"$"].join("|")+")",K+"?"+Zt+"+"+Kt,K+"+"+Xt,ti,ei,ir,ni].join("|"),"g");function ii(n){return n.match(ai)||[]}var cr=ii;function oi(n,t,e){return n=M(n),t=e?void 0:t,t===void 0?Ht(n)?cr(n):qt(n):n.match(t)||[]}var mr=oi;var si="['\u2019]",ui=RegExp(si,"g");function fi(n){return function(t){return $t(mr(zt(t).replace(ui,"")),n,"")}}var dr=fi;var li=dr(function(n,t,e){return t=t.toLowerCase(),n+(e?Wt(t):t)}),Ue=li;u();f();u();f();function g(n){throw new Error("Unexpected value: "+JSON.stringify(n))}u();f();function Q(n){return Object.keys(n)}u();f();u();f();var j=class{};u();f();u();f();var C=class extends j{constructor(e){super();c(this,"value");this.value=e}write(e){typeof this.value=="string"?e.write(this.value):this.value(e)}};var pi=4,ee=class{constructor(){c(this,"buffer","");c(this,"indentLevel",0);c(this,"hasWrittenAnything",!1);c(this,"lastCharacterIsSemicolon",!1);c(this,"lastCharacterIsNewline",!1)}write(t){let e=t.length>0&&t.endsWith(`
2
- `),r=e?t.substring(0,t.length-1):t,a=this.getIndentString(),i=r.replaceAll(`
1
+ "use strict";var pt=Object.defineProperty,$n=Object.defineProperties,Wn=Object.getOwnPropertyDescriptor,Zn=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertyNames,ft=Object.getOwnPropertySymbols;var Pt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable;var Ut=(r,e,t)=>e in r?pt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,p=(r,e)=>{for(var t in e||(e={}))Pt.call(e,t)&&Ut(r,t,e[t]);if(ft)for(var t of ft(e))Qt.call(e,t)&&Ut(r,t,e[t]);return r},T=(r,e)=>$n(r,Zn(e));var er=r=>typeof r=="symbol"?r:r+"",tr=(r,e)=>{var t={};for(var n in r)Pt.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&ft)for(var n of ft(r))e.indexOf(n)<0&&Qt.call(r,n)&&(t[n]=r[n]);return t};var jt=(r,e)=>()=>(r&&(e=r(r=0)),e);var Mt=(r,e)=>{for(var t in e)pt(r,t,{get:e[t],enumerable:!0})},Yn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of zn(e))!Pt.call(r,a)&&a!==t&&pt(r,a,{get:()=>e[a],enumerable:!(n=Wn(e,a))||n.enumerable});return r};var Gn=r=>Yn(pt({},"__esModule",{value:!0}),r);var w=(r,e,t)=>Ut(r,typeof e!="symbol"?e+"":e,t);function nr(){throw new Error("setTimeout has not been defined")}function ar(){throw new Error("clearTimeout has not been defined")}function ir(r){if(oe===setTimeout)return setTimeout(r,0);if((oe===nr||!oe)&&setTimeout)return oe=setTimeout,setTimeout(r,0);try{return oe(r,0)}catch(e){try{return oe.call(null,r,0)}catch(t){return oe.call(this,r,0)}}}function qn(r){if(ue===clearTimeout)return clearTimeout(r);if((ue===ar||!ue)&&clearTimeout)return ue=clearTimeout,clearTimeout(r);try{return ue(r)}catch(e){try{return ue.call(null,r)}catch(t){return ue.call(this,r)}}}function Jn(){!We||!me||(We=!1,me.length?ee=me.concat(ee):dt=-1,ee.length&&sr())}function sr(){if(!We){var r=ir(Jn);We=!0;for(var e=ee.length;e;){for(me=ee,ee=[];++dt<e;)me&&me[dt].run();dt=-1,e=ee.length}me=null,We=!1,qn(r)}}function Hn(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ee.push(new or(r,e)),ee.length===1&&!We&&ir(sr)}function or(r,e){this.fun=r,this.array=e}function he(){}function da(r){throw new Error("process.binding is not supported")}function ma(){return"/"}function ha(r){throw new Error("process.chdir is not supported")}function ya(){return 0}function ga(r){var e=xa.call($e)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}function wa(){var r=new Date,e=r-va;return e/1e3}var oe,ue,ee,We,me,dt,Kn,Xn,Qn,ea,ta,ra,na,aa,ia,sa,oa,ua,ca,la,fa,pa,$e,xa,va,y,rr,c=jt(()=>{"use strict";oe=nr,ue=ar;typeof globalThis.setTimeout=="function"&&(oe=setTimeout);typeof globalThis.clearTimeout=="function"&&(ue=clearTimeout);ee=[],We=!1,dt=-1;or.prototype.run=function(){this.fun.apply(null,this.array)};Kn="browser",Xn="browser",Qn=!0,ea={},ta=[],ra="",na={},aa={},ia={};sa=he,oa=he,ua=he,ca=he,la=he,fa=he,pa=he;$e=globalThis.performance||{},xa=$e.now||$e.mozNow||$e.msNow||$e.oNow||$e.webkitNow||function(){return new Date().getTime()};va=new Date;y={nextTick:Hn,title:Kn,browser:Qn,env:ea,argv:ta,version:ra,versions:na,on:sa,addListener:oa,once:ua,off:ca,removeListener:la,removeAllListeners:fa,emit:pa,binding:da,cwd:ma,chdir:ha,umask:ya,hrtime:ga,platform:Xn,release:aa,config:ia,uptime:wa},rr={};Object.keys(rr).forEach(r=>{let e=r.split("."),t=y;for(let n=0;n<e.length;n++){let a=e[n];n===e.length-1?t[a]=rr[r]:t=t[a]||(t[a]={})}})});function fr(){Bt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)J[e]=r[e],W[r.charCodeAt(e)]=e;W[45]=62,W[95]=63}function ba(r){Bt||fr();var e,t,n,a,i,s,o=r.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=r[o-2]==="="?2:r[o-1]==="="?1:0,s=new _a(o*3/4-i),n=i>0?o-4:o;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)a=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],s[f++]=a>>16&255,s[f++]=a>>8&255,s[f++]=a&255;return i===2?(a=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,s[f++]=a&255):i===1&&(a=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,s[f++]=a>>8&255,s[f++]=a&255),s}function Ta(r){return J[r>>18&63]+J[r>>12&63]+J[r>>6&63]+J[r&63]}function ka(r,e,t){for(var n,a=[],i=e;i<t;i+=3)n=(r[i]<<16)+(r[i+1]<<8)+r[i+2],a.push(Ta(n));return a.join("")}function ur(r){Bt||fr();for(var e,t=r.length,n=t%3,a="",i=[],s=16383,o=0,f=t-n;o<f;o+=s)i.push(ka(r,o,o+s>f?f:o+s));return n===1?(e=r[t-1],a+=J[e>>2],a+=J[e<<4&63],a+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],a+=J[e>>10],a+=J[e>>4&63],a+=J[e<<2&63],a+="="),i.push(a),i.join("")}function mt(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function te(r,e){if(mt()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=u.prototype):(r===null&&(r=new u(e)),r.length=e),r}function u(r,e,t){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Dt(this,r)}return pr(this,r,e,t)}function pr(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer?Aa(r,e,t,n):typeof e=="string"?Ra(r,e,t):Ia(r,e)}function dr(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 Na(r,e,t,n){return dr(e),e<=0?te(r,e):t!==void 0?typeof n=="string"?te(r,e).fill(t,n):te(r,e).fill(t):te(r,e)}function Dt(r,e){if(dr(e),r=te(r,e<0?0:Vt(e)|0),!u.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}function Ra(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=mr(e,t)|0;r=te(r,n);var a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function Ft(r,e){var t=e.length<0?0:Vt(e.length)|0;r=te(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Aa(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),u.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=u.prototype):r=Ft(r,e),r}function Ia(r,e){if(H(e)){var t=Vt(e.length)|0;return r=te(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer!="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Ga(e.length)?te(r,0):Ft(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Ft(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Vt(r){if(r>=mt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+mt().toString(16)+" bytes");return r|0}function H(r){return!!(r!=null&&r._isBuffer)}function mr(r,e){if(H(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 t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return ht(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return _r(r).length;default:if(n)return ht(r).length;e=(""+e).toLowerCase(),n=!0}}function Ea(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ba(this,e,t);case"utf8":case"utf-8":return xr(this,e,t);case"ascii":return Ma(this,e,t);case"latin1":case"binary":return Fa(this,e,t);case"base64":return Pa(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Da(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function ye(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function hr(r,e,t,n,a){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(a)return-1;t=r.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof e=="string"&&(e=u.from(e,n)),H(e))return e.length===0?-1:cr(r,e,t,n,a);if(typeof e=="number")return e=e&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):cr(r,[e],t,n,a);throw new TypeError("val must be string, number or Buffer")}function cr(r,e,t,n,a){var i=1,s=r.length,o=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;i=2,s/=2,o/=2,t/=2}function f(P,Ve){return i===1?P[Ve]:P.readUInt16BE(Ve*i)}var d;if(a){var x=-1;for(d=t;d<s;d++)if(f(r,d)===f(e,x===-1?0:d-x)){if(x===-1&&(x=d),d-x+1===o)return x*i}else x!==-1&&(d-=d-x),x=-1}else for(t+o>s&&(t=s-o),d=t;d>=0;d--){for(var b=!0,M=0;M<o;M++)if(f(r,d+M)!==f(e,M)){b=!1;break}if(b)return d}return-1}function Sa(r,e,t,n){t=Number(t)||0;var a=r.length-t;n?(n=Number(n),n>a&&(n=a)):n=a;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var o=parseInt(e.substr(s*2,2),16);if(isNaN(o))return s;r[t+s]=o}return s}function Ca(r,e,t,n){return gt(ht(e,r.length-t),r,t,n)}function yr(r,e,t,n){return gt(za(e),r,t,n)}function La(r,e,t,n){return yr(r,e,t,n)}function Oa(r,e,t,n){return gt(_r(e),r,t,n)}function Ua(r,e,t,n){return gt(Ya(e,r.length-t),r,t,n)}function Pa(r,e,t){return e===0&&t===r.length?ur(r):ur(r.slice(e,t))}function xr(r,e,t){t=Math.min(r.length,t);for(var n=[],a=e;a<t;){var i=r[a],s=null,o=i>239?4:i>223?3:i>191?2:1;if(a+o<=t){var f,d,x,b;switch(o){case 1:i<128&&(s=i);break;case 2:f=r[a+1],(f&192)===128&&(b=(i&31)<<6|f&63,b>127&&(s=b));break;case 3:f=r[a+1],d=r[a+2],(f&192)===128&&(d&192)===128&&(b=(i&15)<<12|(f&63)<<6|d&63,b>2047&&(b<55296||b>57343)&&(s=b));break;case 4:f=r[a+1],d=r[a+2],x=r[a+3],(f&192)===128&&(d&192)===128&&(x&192)===128&&(b=(i&15)<<18|(f&63)<<12|(d&63)<<6|x&63,b>65535&&b<1114112&&(s=b))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),a+=o}return ja(n)}function ja(r){var e=r.length;if(e<=lr)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=lr));return t}function Ma(r,e,t){var n="";t=Math.min(r.length,t);for(var a=e;a<t;++a)n+=String.fromCharCode(r[a]&127);return n}function Fa(r,e,t){var n="";t=Math.min(r.length,t);for(var a=e;a<t;++a)n+=String.fromCharCode(r[a]);return n}function Ba(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var a="",i=e;i<t;++i)a+=Za(r[i]);return a}function Da(r,e,t){for(var n=r.slice(e,t),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+n[i+1]*256);return a}function U(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}function B(r,e,t,n,a,i){if(!H(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}function yt(r,e,t,n){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(r.length-t,2);a<i;++a)r[t+a]=(e&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}function xt(r,e,t,n){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(r.length-t,4);a<i;++a)r[t+a]=e>>>(n?a:3-a)*8&255}function gr(r,e,t,n,a,i){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function vr(r,e,t,n,a){return a||gr(r,e,t,4,34028234663852886e22,-34028234663852886e22),Tr(r,e,t,n,23,4),t+4}function wr(r,e,t,n,a){return a||gr(r,e,t,8,17976931348623157e292,-17976931348623157e292),Tr(r,e,t,n,52,8),t+8}function $a(r){if(r=Wa(r).replace(Va,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Wa(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Za(r){return r<16?"0"+r.toString(16):r.toString(16)}function ht(r,e){e=e||1/0;for(var t,n=r.length,a=null,i=[],s=0;s<n;++s){if(t=r.charCodeAt(s),t>55295&&t<57344){if(!a){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function za(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Ya(r,e){for(var t,n,a,i=[],s=0;s<r.length&&!((e-=2)<0);++s)t=r.charCodeAt(s),n=t>>8,a=t%256,i.push(a),i.push(n);return i}function _r(r){return ba($a(r))}function gt(r,e,t,n){for(var a=0;a<n&&!(a+t>=e.length||a>=r.length);++a)e[a+t]=r[a];return a}function Ga(r){return r!==r}function qa(r){return r!=null&&(!!r._isBuffer||br(r)||Ja(r))}function br(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Ja(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&br(r.slice(0,0))}function vt(r,e,t,n,a){var i,s,o=a*8-n-1,f=(1<<o)-1,d=f>>1,x=-7,b=t?a-1:0,M=t?-1:1,P=r[e+b];for(b+=M,i=P&(1<<-x)-1,P>>=-x,x+=o;x>0;i=i*256+r[e+b],b+=M,x-=8);for(s=i&(1<<-x)-1,i>>=-x,x+=n;x>0;s=s*256+r[e+b],b+=M,x-=8);if(i===0)i=1-d;else{if(i===f)return s?NaN:(P?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-d}return(P?-1:1)*s*Math.pow(2,i-n)}function Tr(r,e,t,n,a,i){var s,o,f,d=i*8-a-1,x=(1<<d)-1,b=x>>1,M=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=n?0:i-1,Ve=n?1:-1,Vn=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=x):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+b>=1?e+=M/f:e+=M*Math.pow(2,1-b),e*f>=2&&(s++,f/=2),s+b>=x?(o=0,s=x):s+b>=1?(o=(e*f-1)*Math.pow(2,a),s=s+b):(o=e*Math.pow(2,b-1)*Math.pow(2,a),s=0));a>=8;r[t+P]=o&255,P+=Ve,o/=256,a-=8);for(s=s<<a|o,d+=a;d>0;r[t+P]=s&255,P+=Ve,s/=256,d-=8);r[t+P-Ve]|=Vn*128}var J,W,_a,Bt,lr,Va,kr=jt(()=>{"use strict";c();l();J=[],W=[],_a=typeof Uint8Array!="undefined"?Uint8Array:Array,Bt=!1;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;u.poolSize=8192;u._augment=function(r){return r.__proto__=u.prototype,r};u.from=function(r,e,t){return pr(null,r,e,t)};u.kMaxLength=mt();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]);u.alloc=function(r,e,t){return Na(null,r,e,t)};u.allocUnsafe=function(r){return Dt(null,r)};u.allocUnsafeSlow=function(r){return Dt(null,r)};u.isBuffer=qa;u.compare=function(e,t){if(!H(e)||!H(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,a=t.length,i=0,s=Math.min(n,a);i<s;++i)if(e[i]!==t[i]){n=e[i],a=t[i];break}return n<a?-1:a<n?1:0};u.isEncoding=function(e){switch(String(e).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}};u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return u.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var a=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!H(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(a,i),i+=s.length}return a};u.byteLength=mr;u.prototype._isBuffer=!0;u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)ye(this,t,t+1);return this};u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)ye(this,t,t+3),ye(this,t+1,t+2);return this};u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)ye(this,t,t+7),ye(this,t+1,t+6),ye(this,t+2,t+5),ye(this,t+3,t+4);return this};u.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?xr(this,0,e):Ea.apply(this,arguments)};u.prototype.equals=function(e){if(!H(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:u.compare(this,e)===0};u.prototype.compare=function(e,t,n,a,i){if(!H(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),a===void 0&&(a=0),i===void 0&&(i=this.length),t<0||n>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=n)return 0;if(a>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,a>>>=0,i>>>=0,this===e)return 0;for(var s=i-a,o=n-t,f=Math.min(s,o),d=this.slice(a,i),x=e.slice(t,n),b=0;b<f;++b)if(d[b]!==x[b]){s=d[b],o=x[b];break}return s<o?-1:o<s?1:0};u.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};u.prototype.indexOf=function(e,t,n){return hr(this,e,t,n,!0)};u.prototype.lastIndexOf=function(e,t,n){return hr(this,e,t,n,!1)};u.prototype.write=function(e,t,n,a){if(t===void 0)a="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")a=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var s=!1;;)switch(a){case"hex":return Sa(this,e,t,n);case"utf8":case"utf-8":return Ca(this,e,t,n);case"ascii":return yr(this,e,t,n);case"latin1":case"binary":return La(this,e,t,n);case"base64":return Oa(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ua(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),s=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};lr=4096;u.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var a;if(u.TYPED_ARRAY_SUPPORT)a=this.subarray(e,t),a.__proto__=u.prototype;else{var i=t-e;a=new u(i,void 0);for(var s=0;s<i;++s)a[s]=this[s+e]}return a};u.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||U(e,t,this.length);for(var a=this[e],i=1,s=0;++s<t&&(i*=256);)a+=this[e+s]*i;return a};u.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||U(e,t,this.length);for(var a=this[e+--t],i=1;t>0&&(i*=256);)a+=this[e+--t]*i;return a};u.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]};u.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8};u.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]};u.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};u.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};u.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||U(e,t,this.length);for(var a=this[e],i=1,s=0;++s<t&&(i*=256);)a+=this[e+s]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a};u.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||U(e,t,this.length);for(var a=t,i=1,s=this[e+--a];a>0&&(i*=256);)s+=this[e+--a]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s};u.prototype.readInt8=function(e,t){return t||U(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};u.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};u.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};u.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),vt(this,e,!0,23,4)};u.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),vt(this,e,!1,23,4)};u.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),vt(this,e,!0,52,8)};u.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),vt(this,e,!1,52,8)};u.prototype.writeUIntLE=function(e,t,n,a){if(e=+e,t=t|0,n=n|0,!a){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var s=1,o=0;for(this[t]=e&255;++o<n&&(s*=256);)this[t+o]=e/s&255;return t+n};u.prototype.writeUIntBE=function(e,t,n,a){if(e=+e,t=t|0,n=n|0,!a){var i=Math.pow(2,8*n)-1;B(this,e,t,n,i,0)}var s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+n};u.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):yt(this,e,t,!0),t+2};u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):yt(this,e,t,!1),t+2};u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):xt(this,e,t,!0),t+4};u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):xt(this,e,t,!1),t+4};u.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=0,o=1,f=0;for(this[t]=e&255;++s<n&&(o*=256);)e<0&&f===0&&this[t+s-1]!==0&&(f=1),this[t+s]=(e/o>>0)-f&255;return t+n};u.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t=t|0,!a){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=n-1,o=1,f=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&f===0&&this[t+s+1]!==0&&(f=1),this[t+s]=(e/o>>0)-f&255;return t+n};u.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1};u.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):yt(this,e,t,!0),t+2};u.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):yt(this,e,t,!1),t+2};u.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):xt(this,e,t,!0),t+4};u.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):xt(this,e,t,!1),t+4};u.prototype.writeFloatLE=function(e,t,n){return vr(this,e,t,!0,n)};u.prototype.writeFloatBE=function(e,t,n){return vr(this,e,t,!1,n)};u.prototype.writeDoubleLE=function(e,t,n){return wr(this,e,t,!0,n)};u.prototype.writeDoubleBE=function(e,t,n){return wr(this,e,t,!1,n)};u.prototype.copy=function(e,t,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<n&&(a=n),a===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-n&&(a=e.length-t+n);var i=a-n,s;if(this===e&&n<t&&t<a)for(s=i-1;s>=0;--s)e[s+t]=this[s+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<i;++s)e[s+t]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i};u.prototype.fill=function(e,t,n,a){if(typeof e=="string"){if(typeof t=="string"?(a=t,t=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!u.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<n;++s)this[s]=e;else{var o=H(e)?e:ht(new u(e,a).toString()),f=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%f]}return this};Va=/[^+\/0-9A-Za-z-_]/g});var l=jt(()=>{"use strict";kr()});var gu={};Mt(gu,{DynamicSnippetsGeneratorContext:()=>Xt});module.exports=Gn(gu);c();l();c();l();c();l();function E(r){throw new Error("Unexpected value: "+JSON.stringify(r))}c();l();c();l();c();l();c();l();c();l();c();l();var Ha=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Nr=Ha;var Ka=typeof self=="object"&&self&&self.Object===Object&&self,Xa=Nr||Ka||Function("return this")(),Rr=Xa;var Qa=Rr.Symbol,re=Qa;c();l();var Ar=Object.prototype,ei=Ar.hasOwnProperty,ti=Ar.toString,Qe=re?re.toStringTag:void 0;function ri(r){var e=ei.call(r,Qe),t=r[Qe];try{r[Qe]=void 0;var n=!0}catch(i){}var a=ti.call(r);return n&&(e?r[Qe]=t:delete r[Qe]),a}var Ir=ri;c();l();var ni=Object.prototype,ai=ni.toString;function ii(r){return ai.call(r)}var Er=ii;var si="[object Null]",oi="[object Undefined]",Sr=re?re.toStringTag:void 0;function ui(r){return r==null?r===void 0?oi:si:Sr&&Sr in Object(r)?Ir(r):Er(r)}var Cr=ui;c();l();function ci(r){return r!=null&&typeof r=="object"}var Lr=ci;var li="[object Symbol]";function fi(r){return typeof r=="symbol"||Lr(r)&&Cr(r)==li}var Or=fi;c();l();c();l();function pi(r,e){for(var t=-1,n=r==null?0:r.length,a=Array(n);++t<n;)a[t]=e(r[t],t,r);return a}var Ur=pi;c();l();var di=Array.isArray,Pr=di;var mi=1/0,jr=re?re.prototype:void 0,Mr=jr?jr.toString:void 0;function Fr(r){if(typeof r=="string")return r;if(Pr(r))return Ur(r,Fr)+"";if(Or(r))return Mr?Mr.call(r):"";var e=r+"";return e=="0"&&1/r==-mi?"-0":e}var Br=Fr;c();l();function hi(r){return r==null?"":Br(r)}var ce=hi;c();l();c();l();c();l();c();l();c();l();c();l();function yi(r,e,t){var n=-1,a=r.length;e<0&&(e=-e>a?0:a+e),t=t>a?a:t,t<0&&(t+=a),a=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(a);++n<a;)i[n]=r[n+e];return i}var Dr=yi;function xi(r,e,t){var n=r.length;return t=t===void 0?n:t,!e&&t>=n?r:Dr(r,e,t)}var Vr=xi;c();l();var gi="\\ud800-\\udfff",vi="\\u0300-\\u036f",wi="\\ufe20-\\ufe2f",_i="\\u20d0-\\u20ff",bi=vi+wi+_i,Ti="\\ufe0e\\ufe0f",ki="\\u200d",Ni=RegExp("["+ki+gi+bi+Ti+"]");function Ri(r){return Ni.test(r)}var wt=Ri;c();l();c();l();function Ai(r){return r.split("")}var $r=Ai;c();l();var Wr="\\ud800-\\udfff",Ii="\\u0300-\\u036f",Ei="\\ufe20-\\ufe2f",Si="\\u20d0-\\u20ff",Ci=Ii+Ei+Si,Li="\\ufe0e\\ufe0f",Oi="["+Wr+"]",$t="["+Ci+"]",Wt="\\ud83c[\\udffb-\\udfff]",Ui="(?:"+$t+"|"+Wt+")",Zr="[^"+Wr+"]",zr="(?:\\ud83c[\\udde6-\\uddff]){2}",Yr="[\\ud800-\\udbff][\\udc00-\\udfff]",Pi="\\u200d",Gr=Ui+"?",qr="["+Li+"]?",ji="(?:"+Pi+"(?:"+[Zr,zr,Yr].join("|")+")"+qr+Gr+")*",Mi=qr+Gr+ji,Fi="(?:"+[Zr+$t+"?",$t,zr,Yr,Oi].join("|")+")",Bi=RegExp(Wt+"(?="+Wt+")|"+Fi+Mi,"g");function Di(r){return r.match(Bi)||[]}var Jr=Di;function Vi(r){return wt(r)?Jr(r):$r(r)}var Hr=Vi;function $i(r){return function(e){e=ce(e);var t=wt(e)?Hr(e):void 0,n=t?t[0]:e.charAt(0),a=t?Vr(t,1).join(""):e.slice(1);return n[r]()+a}}var Kr=$i;var Wi=Kr("toUpperCase"),Xr=Wi;function Zi(r){return Xr(ce(r).toLowerCase())}var Qr=Zi;c();l();c();l();function zi(r,e,t,n){var a=-1,i=r==null?0:r.length;for(n&&i&&(t=r[++a]);++a<i;)t=e(t,r[a],a,r);return t}var en=zi;c();l();c();l();c();l();function Yi(r){return function(e){return r==null?void 0:r[e]}}var tn=Yi;var Gi={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},qi=tn(Gi),rn=qi;var Ji=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hi="\\u0300-\\u036f",Ki="\\ufe20-\\ufe2f",Xi="\\u20d0-\\u20ff",Qi=Hi+Ki+Xi,es="["+Qi+"]",ts=RegExp(es,"g");function rs(r){return r=ce(r),r&&r.replace(Ji,rn).replace(ts,"")}var nn=rs;c();l();c();l();var ns=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function as(r){return r.match(ns)||[]}var an=as;c();l();var is=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ss(r){return is.test(r)}var sn=ss;c();l();var fn="\\ud800-\\udfff",os="\\u0300-\\u036f",us="\\ufe20-\\ufe2f",cs="\\u20d0-\\u20ff",ls=os+us+cs,pn="\\u2700-\\u27bf",dn="a-z\\xdf-\\xf6\\xf8-\\xff",fs="\\xac\\xb1\\xd7\\xf7",ps="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ds="\\u2000-\\u206f",ms=" \\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",mn="A-Z\\xc0-\\xd6\\xd8-\\xde",hs="\\ufe0e\\ufe0f",hn=fs+ps+ds+ms,yn="['\u2019]",on="["+hn+"]",ys="["+ls+"]",xn="\\d+",xs="["+pn+"]",gn="["+dn+"]",vn="[^"+fn+hn+xn+pn+dn+mn+"]",gs="\\ud83c[\\udffb-\\udfff]",vs="(?:"+ys+"|"+gs+")",ws="[^"+fn+"]",wn="(?:\\ud83c[\\udde6-\\uddff]){2}",_n="[\\ud800-\\udbff][\\udc00-\\udfff]",Ze="["+mn+"]",_s="\\u200d",un="(?:"+gn+"|"+vn+")",bs="(?:"+Ze+"|"+vn+")",cn="(?:"+yn+"(?:d|ll|m|re|s|t|ve))?",ln="(?:"+yn+"(?:D|LL|M|RE|S|T|VE))?",bn=vs+"?",Tn="["+hs+"]?",Ts="(?:"+_s+"(?:"+[ws,wn,_n].join("|")+")"+Tn+bn+")*",ks="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ns="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rs=Tn+bn+Ts,As="(?:"+[xs,wn,_n].join("|")+")"+Rs,Is=RegExp([Ze+"?"+gn+"+"+cn+"(?="+[on,Ze,"$"].join("|")+")",bs+"+"+ln+"(?="+[on,Ze+un,"$"].join("|")+")",Ze+"?"+un+"+"+cn,Ze+"+"+ln,Ns,ks,xn,As].join("|"),"g");function Es(r){return r.match(Is)||[]}var kn=Es;function Ss(r,e,t){return r=ce(r),e=t?void 0:e,e===void 0?sn(r)?kn(r):an(r):r.match(e)||[]}var Nn=Ss;var Cs="['\u2019]",Ls=RegExp(Cs,"g");function Os(r){return function(e){return en(Nn(nn(e).replace(Ls,"")),r,"")}}var Rn=Os;var Us=Rn(function(r,e,t){return e=e.toLowerCase(),r+(t?Qr(e):e)}),Zt=Us;c();l();function et(r){return Object.keys(r)}c();l();c();l();var xe=class{};c();l();var _t=class{formatMultiple(e){return Promise.all(e.map(t=>this.format(t)))}formatMultipleSync(e){return e.map(t=>this.formatSync(t))}},tt=class extends _t{async format(e){return e}formatSync(e){return e}};c();l();c();l();var G=class extends xe{constructor(t){super();w(this,"value");this.value=t}write(t){typeof this.value=="string"?t.write(this.value):typeof this.value=="function"?this.value(t):this.value.write(t)}};var Ps=4,An=!!y.env.FERN_STACK_TRACK;An&&(Error.stackTraceLimit=50);var rt=class{constructor(){w(this,"buffer","");w(this,"indentLevel",0);w(this,"hasWrittenAnything",!1);w(this,"lastCharacterIsSemicolon",!1);w(this,"lastCharacterIsNewline",!1)}write(...e){for(let t of e)if(t!=null)if(typeof t=="string"){let n=t.length>0&&t.endsWith(`
2
+ `),a=n?t.substring(0,t.length-1):t,i=this.getIndentString(),s=a.replaceAll(`
3
3
  `,`
4
- ${a}`);this.isAtStartOfLine()&&(i=a+i),e&&(i+=`
5
- `),this.writeInternal(i)}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 C(t).write(this),this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(t,e){new C(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}endControlFlow(){this.dedent(),this.writeLine("}")}contiguousControlFlow(t,e){this.dedent(),this.write("} "),new C(t).write(this),this.write(" ("),this.writeNode(e),this.write(") {"),this.writeNewLineIfLastLineNot(),this.indent()}alternativeControlFlow(t){this.dedent(),this.write("} "),new C(t).write(this),this.write(" {"),this.writeNewLineIfLastLineNot(),this.indent()}openBlock(t,e="{",r,a="}"){let i=t.filter(o=>o!==void 0).join(" ");i?this.write(`${i} ${e!=null?e:""}`):this.write(e!=null?e:"");try{this.indent(),r(),this.dedent()}finally{this.write(a!=null?a:"")}}writeLine(t=""){this.write(t),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
4
+ ${i}`);this.isAtStartOfLine()&&(s=i+s),n&&(s+=`
5
+ `),this.writeInternal(s)}else this.writeNode(t)}writeStatement(...e){this.write(...e),this.write(";"),this.writeNewLineIfLastLineNot()}writeNoIndent(e){let t=this.indentLevel;this.indentLevel=0,this.write(e),this.indentLevel=t}writeNode(e){e.write(this)}writeNodeOrString(e){if(typeof e=="string"){this.write(e);return}this.writeNode(e)}writeNodeStatement(e){e.write(this),this.write(";"),this.writeNewLineIfLastLineNot()}writeTextStatement(e){new G(e).write(this),e.endsWith(";")||this.write(";"),this.writeNewLineIfLastLineNot()}controlFlow(e,t){new G(e).write(this),this.write(" (",t,")"),this.pushScope()}controlFlowWithoutStatement(e){new G(e).write(this),this.pushScope()}endControlFlow(){this.popScope()}contiguousControlFlow(e,t){this.dedent(),this.write("} "),new G(e).write(this),this.write(" (",t,")"),this.pushScope()}alternativeControlFlow(e){this.dedent(),this.write("} "),new G(e).write(this),this.pushScope()}pushScope(){this.writeLine("{"),this.indent()}popScope(e=!0){this.dedent(),this.writeNewLineIfLastLineNot(),e?this.writeLine("}"):this.write("}")}writeLine(e=""){this.write(e),this.writeNewLineIfLastLineNot()}newLine(){this.writeInternal(`
6
6
  `)}writeSemicolonIfLastCharacterIsNot(){this.lastCharacterIsSemicolon||this.writeInternal(";")}writeNewLineIfLastLineNot(){this.lastCharacterIsNewline||this.writeInternal(`
7
- `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:t,delimiter:e,writeFunction:r}){if(t.length>0){let a=t[0];a!=null&&r(a);for(let i=1;i<t.length;i++){this.write(e);let o=t[i];o!=null&&r(o)}}}toString(){return this.buffer}writeInternal(t){return t.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=t.endsWith(`
8
- `),this.lastCharacterIsSemicolon=t.endsWith(";")),this.buffer+=t}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*pi)}};u();f();var ye=class{},te=class extends ye{async format(t){return t}formatSync(t){return t}};u();f();function Pe(n){return(n==null?void 0:n.name)!=null}u();f();u();f();u();f();u();f();var re=class{constructor(){c(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9\/{}_-]*)$/)}validate(t){return this.REFERENCE_REGEX.test(t)?{type:"valid"}:{type:"invalid"}}tryParse(t){if(this.validate(t).type==="invalid")return;let r=t.match(this.REFERENCE_REGEX);if(!(r==null||r[1]==null||r[2]==null))return{method:r[1],path:r[2]}}};u();f();var v={Critical:"CRITICAL",Warning:"WARNING"},ne=class n{constructor(){c(this,"errors");c(this,"path");this.errors=[],this.path=[]}add(t){this.errors.push(Ve(je({},t),{path:[...this.path]}))}scope(t){this.path.push(t)}unscope(){this.path.pop()}getBySeverity(t){return this.errors.filter(e=>e.severity===t)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let t=new n;return t.errors=[...this.errors],t.path=[...this.path],t}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(t=>({severity:t.severity,path:t.path!=null?this.pathToStringArray(t.path):void 0,message:t.message}))}pathToStringArray(t){let e=[];for(let r of t){if(typeof r=="string"){e.push(r);continue}e[e.length-1]+=`[${r.index}]`}return e}};var ae=class{constructor({ir:t,config:e,options:r={}}){c(this,"config");c(this,"options");c(this,"errors");c(this,"_ir");c(this,"httpEndpointReferenceParser");this._ir=t,this.config=e,this.options=r,this.errors=new ne,this.httpEndpointReferenceParser=new re}associateQueryParametersByWireValue({parameters:t,values:e}){let r=[];for(let[a,i]of Object.entries(e)){this.errors.scope(a);try{let o=t.find(d=>d.name.wireValue===a);if(o==null)throw this.newParameterNotRecognizedError(a);let m=this.isListTypeReference(o.typeReference)&&!Array.isArray(i)?[i]:i;r.push({name:o.name,typeReference:o.typeReference,value:m})}finally{this.errors.unscope()}}return r}associateByWireValue({parameters:t,values:e,ignoreMissingParameters:r}){let a=[];for(let[i,o]of Object.entries(e)){this.errors.scope(i);try{let m=t.find(d=>d.name.wireValue===i);if(m==null){if(r)continue;this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(i).message});continue}a.push({name:m.name,typeReference:m.typeReference,value:o})}finally{this.errors.unscope()}}return a}getSingleFileValue({property:t,record:e}){let r=e[t.wireValue];if(r!=null){if(typeof r!="string"){this.errors.add({severity:v.Critical,message:`Expected file value to be a string, got ${typeof r}`});return}return r}}getFileArrayValues({property:t,record:e}){let r=e[t.wireValue];if(r==null)return;if(!Array.isArray(r)){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof r}`});return}let a=[];for(let i of r){if(typeof i!="string"){this.errors.add({severity:v.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}a.push(i)}return a}getRecord(t){if(typeof t!="object"||Array.isArray(t)){this.errors.add({severity:v.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(t)?"array":typeof t}`});return}return t==null?{}:t}resolveNamedType({typeId:t}){let e=this._ir.types[t];if(e==null){this.errors.add({severity:v.Critical,message:`Type identified by "${t}" could not be found`});return}return e}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e}){let r=this.getRecord(e);if(r==null)return;let a=t.discriminant.wireValue,i=r[a];if(i==null){this.errors.add({severity:v.Critical,message:this.newParameterNotRecognizedError(a).message});return}if(typeof i!="string"){this.errors.add({severity:v.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let o=t.types[i];if(o==null){this.errors.add({severity:v.Critical,message:`No type found for discriminant value "${i}"`});return}let x=r,{[a]:m}=x,d=$e(x,[We(a)]);return{singleDiscriminatedUnionType:o,discriminantValue:o.discriminantValue,value:d}}resolveEndpointOrThrow(t){let e=this.httpEndpointReferenceParser.tryParse(t);if(e==null)throw new Error(`Failed to parse endpoint reference "${t}"`);return this.resolveEndpointLocationOrThrow(e)}resolveEndpointLocationOrThrow(t){let e=[];for(let r of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t})&&e.push(r);if(e.length===0)throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`);return e}needsRequestParameter({request:t,inlinePathParameters:e,inlineFileProperties:r}){var a;return this.includePathParametersInWrappedRequest({request:t,inlinePathParameters:e})||t.queryParameters!=null&&t.queryParameters.length>0||t.headers!=null&&t.headers.length>0?!0:t.body!=null?this.includeRequestBodyInWrappedRequest({body:t.body,inlineFileProperties:r}):!((a=t.metadata)!=null&&a.onlyPathParameters)}includePathParametersInWrappedRequest({request:t,inlinePathParameters:e}){var r,a;return e&&((a=(r=t.metadata)==null?void 0:r.includePathParameters)!=null?a:!1)}isFileUploadRequestBody(t){switch(t.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:g(t)}}resolveEnvironmentName(t){if(this._ir.environments==null)return;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":{let r=e.environments.find(a=>a.id===t);return r==null?void 0:r.name}case"multipleBaseUrls":{let r=e.environments.find(a=>a.id===t);return r==null?void 0:r.name}default:g(e)}}isSingleEnvironmentID(t){return typeof t=="string"}isMultiEnvironmentValues(t){return typeof t=="object"}validateMultiEnvironmentUrlValues(t){if(this._ir.environments==null)return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let e=this._ir.environments.environments;switch(e.type){case"singleBaseUrl":return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let r=e.environments[0];if(r==null)return this.errors.add({severity:v.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let a=new Set(Q(r.urls));for(let i of Q(t))a.has(i)&&a.delete(i);return a.size>0?(this.errors.add({severity:v.Critical,message:`The provided environments are invalid; got: [${Object.keys(t).join(", ")}], expected: [${Q(r.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:t}){if(typeof t!="number"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"number",value:t}).message});return}return t}getValueAsBoolean({value:t}){if(typeof t!="boolean"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"boolean",value:t}).message});return}return t}getValueAsString({value:t}){if(typeof t!="string"){this.errors.add({severity:v.Critical,message:this.newTypeMismatchError({expected:"string",value:t}).message});return}return t}isOptional(t){switch(t.type){case"nullable":return this.isOptional(t.value);case"optional":return!0;case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}isNullable(t){switch(t.type){case"nullable":return!0;case"optional":return this.isNullable(t.value);case"named":{let e=this.resolveNamedType({typeId:t.value});return e==null?!1:e.type==="alias"?this.isNullable(e.typeReference):!1}}return!1}newAuthMismatchError({auth:t,values:e}){return new Error(`Expected auth type ${t.type}, got ${e.type}`)}newParameterNotRecognizedError(t){return new Error(`"${t}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:t,value:e}){return new Error(`Expected ${t}, got ${typeof e}`)}includeRequestBodyInWrappedRequest({body:t,inlineFileProperties:e}){switch(t.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e});default:g(t)}}includeFileUploadBodyInWrappedRequest({fileUpload:t,inlineFileProperties:e}){return this.fileUploadHasBodyProperties({fileUpload:t})||e&&this.fileUploadHasFileProperties({fileUpload:t})}fileUploadHasBodyProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:g(e)}})}fileUploadHasFileProperties({fileUpload:t}){return t.properties.some(e=>{switch(e.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:g(e)}})}isListTypeReference(t){return t.type==="optional"?this.isListTypeReference(t.value):t.type==="list"||t.type==="set"}parsedEndpointMatches({endpoint:t,parsedEndpoint:e}){return t.location.method===e.method&&t.location.path===e.path}};u();f();var l={};Ye(l,{Access:()=>Fe,AstNode:()=>T,Class:()=>W,ClassInstantiation:()=>$,ClassReference:()=>w,CodeBlock:()=>Y,Method:()=>G,MethodInvocation:()=>z,Parameter:()=>q,Type:()=>oe,TypeLiteral:()=>b,Writer:()=>V,classReference:()=>Ci,class_:()=>Li,codeblock:()=>ki,instantiateClass:()=>Si,invokeMethod:()=>Ui,method:()=>Pi,parameter:()=>Fi});u();f();u();f();u();f();var Fe={Public:"public",Protected:"protected",Private:"private"};u();f();u();f();u();f();var V=class extends ee{constructor({packageName:e,customConfig:r,formatter:a}){super();c(this,"packageName");c(this,"customConfig");c(this,"formatter");c(this,"imports",new Set);this.packageName=e,this.customConfig=r,this.formatter=a!=null?a:new te}addImport(e){this.imports.add(e)}};var ie=class extends V{constructor({packageName:t,customConfig:e,formatter:r}){super({packageName:t,customConfig:e,formatter:r})}async toStringAsync(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.format(t)}catch(e){throw new Error(`Failed to format Java file: ${e}
9
- ${t}`)}return t}toString(){let t=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(t)}catch(e){throw new Error(`Failed to format Java file: ${e}
10
- ${t}`)}return t}getContent(){let t=`package ${this.packageName};
7
+ `)}indent(){this.indentLevel++}dedent(){this.indentLevel--}delimit({nodes:e,delimiter:t,writeFunction:n}){if(e.length>0){let a=e[0];a!=null&&n(a);for(let i=1;i<e.length;i++){this.write(t);let s=e[i];s!=null&&n(s)}}}toString(){return this.buffer}writeInternal(e){if(e.length>0&&(this.hasWrittenAnything=!0,this.lastCharacterIsNewline=e.endsWith(`
8
+ `),this.lastCharacterIsSemicolon=e.endsWith(";")),this.buffer+=e,An&&this.buffer.endsWith(`
9
+ `)&&!this.buffer.endsWith(`"""
10
+ `)){let t=this.stacktrace(15).map(n=>`${n.fn} - ${n.path}:${n.position}`).join(" ");t&&(this.buffer=this.buffer.slice(0,-1),this.buffer+=`//@@ ${t}
11
+ `)}return this.buffer}isAtStartOfLine(){return this.lastCharacterIsNewline||!this.hasWrittenAnything}getIndentString(){return" ".repeat(this.indentLevel*this.getTabSize())}getTabSize(){return Ps}stacktrace(e=50){var n;let t=!1;return((n=new Error().stack)!=null?n:"").split(`
12
+ `).map(a=>{var s;let i=a.match(/at\s+(.*)\s+\((.*):(\d+):(\d+)\)/);if(i&&i.length===5){let[,o,f,d,x]=i;if(t||o!=null&&o.includes("runInteractiveTask")){t=!0;return}switch(o){case"Object.<anonymous>":o="";break;case"Object.object":case"Object.alias":case"Object.union":case"Object.enum":case"Object.undiscriminatedUnion":o=`${o.substring(o.indexOf(".")+1)}()=> { ... }`;break}return{fn:o,path:(s=f==null?void 0:f.replace(/^.*?fern.*?\//,""))!=null?s:"",position:`${d}:${x}`}}}).filter(a=>{var i,s,o,f,d,x,b;return a&&!((i=a.path)!=null&&i.startsWith("node:"))&&!((s=a.path)!=null&&s.endsWith(".js"))&&!((o=a.path)!=null&&o.includes("AbstractWriter"))&&!((f=a.fn)!=null&&f.includes("stacktrace"))&&!((d=a.fn)!=null&&d.includes("stackLine"))&&!((x=a.fn)!=null&&x.includes("SdkGeneratorCLI"))&&!((b=a.fn)!=null&&b.includes("runCli"))}).slice(0,e)}};c();l();function zt(r){return(r==null?void 0:r.name)!=null}c();l();c();l();c();l();c();l();var nt=class{constructor(){w(this,"REFERENCE_REGEX",/^(GET|POST|PUT|DELETE|PATCH|HEAD)\s(\/\S*)$/)}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let n=e.match(this.REFERENCE_REGEX);if(!(n==null||n[1]==null||n[2]==null))return{method:n[1],path:n[2]}}};c();l();var L={Critical:"CRITICAL",Warning:"WARNING"},at=class r{constructor(){w(this,"errors");w(this,"path");this.errors=[],this.path=[]}add(e){this.errors.push(T(p({},e),{path:[...this.path]}))}scope(e){this.path.push(e)}unscope(){this.path.pop()}getBySeverity(e){return this.errors.filter(t=>t.severity===e)}empty(){return this.errors.length===0}size(){return this.errors.length}clone(){let e=new r;return e.errors=[...this.errors],e.path=[...this.path],e}reset(){this.errors=[],this.path=[]}toDynamicSnippetErrors(){return this.errors.map(e=>({severity:e.severity,path:e.path!=null?this.pathToStringArray(e.path):void 0,message:e.message}))}pathToStringArray(e){let t=[];for(let n of e){if(typeof n=="string"){t.push(n);continue}t[t.length-1]+=`[${n.index}]`}return t}};var it=class{constructor({ir:e,config:t,options:n={}}){w(this,"config");w(this,"options");w(this,"errors");w(this,"_ir");w(this,"httpEndpointReferenceParser");this._ir=e,this.config=t,this.options=n,this.errors=new at,this.httpEndpointReferenceParser=new nt}associateQueryParametersByWireValue({parameters:e,values:t}){let n=[];for(let[a,i]of Object.entries(t)){this.errors.scope(a);try{let s=e.find(f=>f.name.wireValue===a);if(s==null)throw this.newParameterNotRecognizedError(a);let o=this.isListTypeReference(s.typeReference)&&!Array.isArray(i)?[i]:i;n.push({name:s.name,typeReference:s.typeReference,value:o})}finally{this.errors.unscope()}}return n}associateByWireValueOrDefault({parameters:e,values:t}){let n=[];for(let a of e){this.errors.scope(a.name.wireValue);try{let i=t[a.name.wireValue];if(i==null)if(a.typeReference.type==="primitive"&&a.typeReference.value==="STRING")i=`<${a.name.wireValue}>`;else{this.errors.add({severity:L.Critical,message:this.newParameterNotRecognizedError(a.name.wireValue).message});continue}n.push({name:a.name,typeReference:a.typeReference,value:i})}finally{this.errors.unscope()}}return n}associateByWireValue({parameters:e,values:t,ignoreMissingParameters:n}){let a=[];for(let[i,s]of Object.entries(t)){this.errors.scope(i);try{let o=e.find(f=>f.name.wireValue===i);if(o==null){if(n)continue;this.errors.add({severity:L.Critical,message:this.newParameterNotRecognizedError(i).message});continue}a.push({name:o.name,typeReference:o.typeReference,value:s})}finally{this.errors.unscope()}}return a}getExampleObjectProperties({parameters:e,snippetObject:t}){let n=typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{},a=[];for(let i of e){let s=n[i.name.wireValue];s==null?i.typeReference.type==="nullable"&&a.push({name:i.name,typeReference:i.typeReference,value:null}):a.push({name:i.name,typeReference:i.typeReference,value:s})}return a}getSingleFileValue({property:e,record:t}){let n=t[e.wireValue];if(n!=null){if(typeof n!="string"){this.errors.add({severity:L.Critical,message:`Expected file value to be a string, got ${typeof n}`});return}return n}}getFileArrayValues({property:e,record:t}){let n=t[e.wireValue];if(n==null)return;if(!Array.isArray(n)){this.errors.add({severity:L.Critical,message:`Expected file array value to be an array of strings, got ${typeof n}`});return}let a=[];for(let i of n){if(typeof i!="string"){this.errors.add({severity:L.Critical,message:`Expected file array value to be an array of strings, got ${typeof i}`});return}a.push(i)}return a}getRecord(e){if(typeof e!="object"||Array.isArray(e)){this.errors.add({severity:L.Critical,message:`Expected object with key, value pairs but got: ${Array.isArray(e)?"array":typeof e}`});return}return e==null?{}:e}resolveNamedType({typeId:e}){let t=this._ir.types[e];if(t==null){this.errors.add({severity:L.Critical,message:`Type identified by "${e}" could not be found`});return}return t}resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t}){let n=this.getRecord(t);if(n==null)return;let a=e.discriminant.wireValue,i=n[a];if(i==null){this.errors.add({severity:L.Critical,message:this.newParameterNotRecognizedError(a).message});return}if(typeof i!="string"){this.errors.add({severity:L.Critical,message:`Expected discriminant value to be a string but got: ${typeof i}`});return}let s=e.types[i];if(s==null){this.errors.add({severity:L.Critical,message:`No type found for discriminant value "${i}"`});return}let d=n,{[a]:o}=d,f=tr(d,[er(a)]);return{singleDiscriminatedUnionType:s,discriminantValue:s.discriminantValue,value:f}}resolveEndpointOrThrow(e){let t=this.httpEndpointReferenceParser.tryParse(e);if(t==null)throw new Error(`Failed to parse endpoint reference "${e}"`);return this.resolveEndpointLocationOrThrow(t)}resolveEndpointLocation(e){let t=[];for(let n of Object.values(this._ir.endpoints))this.parsedEndpointMatches({endpoint:n,parsedEndpoint:e})&&t.push(n);return t}resolveEndpointLocationOrThrow(e){let t=this.resolveEndpointLocation(e);if(t.length===0)throw new Error(`Failed to find endpoint identified by "${e.method} ${e.path}"`);return t}needsRequestParameter({request:e,inlinePathParameters:t,inlineFileProperties:n}){var a;return this.includePathParametersInWrappedRequest({request:e,inlinePathParameters:t})||e.queryParameters!=null&&e.queryParameters.length>0||e.headers!=null&&e.headers.length>0?!0:e.body!=null?this.includeRequestBodyInWrappedRequest({body:e.body,inlineFileProperties:n}):!((a=e.metadata)!=null&&a.onlyPathParameters)}includePathParametersInWrappedRequest({request:e,inlinePathParameters:t}){var n,a;return t&&((a=(n=e.metadata)==null?void 0:n.includePathParameters)!=null?a:!1)}isFileUploadRequestBody(e){switch(e.type){case"fileUpload":return!0;case"properties":case"referenced":return!1;default:E(e)}}resolveEnvironmentName(e){if(this._ir.environments==null)return;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":{let n=t.environments.find(a=>a.id===e);return n==null?void 0:n.name}case"multipleBaseUrls":{let n=t.environments.find(a=>a.id===e);return n==null?void 0:n.name}default:E(t)}}isSingleEnvironmentID(e){return typeof e=="string"}isMultiEnvironmentValues(e){return typeof e=="object"}validateMultiEnvironmentUrlValues(e){if(this._ir.environments==null)return this.errors.add({severity:L.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;let t=this._ir.environments.environments;switch(t.type){case"singleBaseUrl":return this.errors.add({severity:L.Critical,message:"Multiple environments are not supported for single base URL environments; use the baseUrl option instead"}),!1;case"multipleBaseUrls":{let n=t.environments[0];if(n==null)return this.errors.add({severity:L.Critical,message:"Multiple environments are not supported; use the baseUrl option instead"}),!1;let a=new Set(et(n.urls));for(let i of et(e))a.has(i)&&a.delete(i);return a.size>0?(this.errors.add({severity:L.Critical,message:`The provided environments are invalid; got: [${Object.keys(e).join(", ")}], expected: [${et(n.urls).join(", ")}]`}),!1):!0}}}getValueAsNumber({value:e}){if(typeof e!="number"){this.errors.add({severity:L.Critical,message:this.newTypeMismatchError({expected:"number",value:e}).message});return}return e}getValueAsBoolean({value:e}){if(typeof e!="boolean"){this.errors.add({severity:L.Critical,message:this.newTypeMismatchError({expected:"boolean",value:e}).message});return}return e}getValueAsString({value:e}){if(typeof e!="string"){this.errors.add({severity:L.Critical,message:this.newTypeMismatchError({expected:"string",value:e}).message});return}return e}isOptional(e){switch(e.type){case"nullable":return this.isOptional(e.value);case"optional":return!0;case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}isNullable(e){switch(e.type){case"nullable":return!0;case"optional":return this.isNullable(e.value);case"named":{let t=this.resolveNamedType({typeId:e.value});return t==null?!1:t.type==="alias"?this.isNullable(t.typeReference):!1}}return!1}newAuthMismatchError({auth:e,values:t}){return new Error(`Expected auth type ${e.type}, got ${t.type}`)}newParameterNotRecognizedError(e){return new Error(`"${e}" is not a recognized parameter for this endpoint`)}newTypeMismatchError({expected:e,value:t}){return new Error(`Expected ${e}, got ${typeof t}`)}includeRequestBodyInWrappedRequest({body:e,inlineFileProperties:t}){switch(e.type){case"properties":case"referenced":return!0;case"fileUpload":return this.includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t});default:E(e)}}includeFileUploadBodyInWrappedRequest({fileUpload:e,inlineFileProperties:t}){return this.fileUploadHasBodyProperties({fileUpload:e})||t&&this.fileUploadHasFileProperties({fileUpload:e})}fileUploadHasBodyProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!1;case"bodyProperty":return!0;default:E(t)}})}fileUploadHasFileProperties({fileUpload:e}){return e.properties.some(t=>{switch(t.type){case"file":case"fileArray":return!0;case"bodyProperty":return!1;default:E(t)}})}isListTypeReference(e){return e.type==="optional"?this.isListTypeReference(e.value):e.type==="list"||e.type==="set"}parsedEndpointMatches({endpoint:e,parsedEndpoint:t}){return e.location.method===t.method&&e.location.path===t.path}};c();l();c();l();c();l();var ge=class extends rt{constructor({packageName:t,customConfig:n,formatter:a}){super();w(this,"packageName");w(this,"customConfig");w(this,"formatter");w(this,"imports",new Set);this.packageName=t,this.customConfig=n,this.formatter=a!=null?a:new tt}addImport(t){this.imports.add(t)}getImports(){return new Set(this.imports)}};var st=class extends ge{constructor({packageName:e,customConfig:t,formatter:n}){super({packageName:e,customConfig:t,formatter:n})}async toStringAsync(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.format(e)}catch(t){throw new Error(`Failed to format Java file: ${t}
13
+ ${e}`)}return e}toString(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(e)}catch(t){throw new Error(`Failed to format Java file: ${t}
14
+ ${e}`)}return e}getContent(){let e=`package ${this.packageName};
11
15
 
12
- `,e=this.stringifyImports();return e.length>0?`${t}${e}
16
+ `,t=this.stringifyImports();return t.length>0?`${e}${t}
13
17
 
14
- ${this.buffer}`:t+this.buffer}stringifyImports(){return Array.from(this.imports).filter(t=>t!==this.packageName).map(t=>`import ${t};`).sort().join(`
15
- `)}};var T=class extends j{async toStringAsync({packageName:t,customConfig:e,formatter:r}){let a=new ie({packageName:t,customConfig:e,formatter:r});return this.write(a),a.toStringAsync()}toString({packageName:t,customConfig:e,formatter:r}){let a=new ie({packageName:t,customConfig:e,formatter:r});return this.write(a),a.toString()}};u();f();var W=class extends T{constructor({name:e,access:r}){super();c(this,"name");c(this,"access");c(this,"methods",[]);this.name=e,this.access=r}write(e){if(e.write(`${this.access} class ${this.name}`),this.isEmpty()){e.writeLine(" {}");return}e.writeLine(" {"),e.indent();for(let r of this.methods)e.writeNode(r),e.newLine();e.dedent(),e.write("}")}addMethod(e){this.methods.push(e)}isEmpty(){return this.methods.length===0}};u();f();var w=class extends T{constructor({name:e,packageName:r,fullyQualified:a}){super();c(this,"name");c(this,"packageName");c(this,"fullyQualified");this.name=e,this.packageName=r,this.fullyQualified=a!=null?a:!1}write(e){if(e.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){e.write(`${this.packageName}.${this.name}`);return}e.write(this.name)}};u();f();u();f();u();f();u();f();var oe=class extends T{constructor(e){super();c(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"bigInteger":e.writeNode(ci);break;case"boolean":e.write("Boolean");break;case"bytes":e.write("byte[]");break;case"float":e.write("Float");break;case"date":e.write("String");break;case"dateTime":e.writeNode(hi);break;case"double":e.write("Double");break;case"integer":e.write("Integer");break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write("Long");break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"object":{e.write("Object");break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write("String");break;case"uuid":e.writeNode(yi);break;default:g(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(e){return new this({type:"list",value:e})}static long(){return new this({type:"long"})}static map(e,r){return new this({type:"map",keyType:e,valueType:r})}static object(){return new this({type:"object"})}static optional(e){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e})}static reference(e){return new this({type:"reference",value:e})}static set(e){return new this({type:"set",value:e})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}writeList({writer:e,list:r}){e.writeNode(mi),e.write("<"),r.value.write(e),e.write(">")}writeMap({writer:e,map:r}){e.writeNode(di),e.write("<"),r.keyType.write(e),e.write(", "),r.valueType.write(e),e.write(">")}writeOptional({writer:e,optional:r}){e.writeNode(Me),e.write("<"),r.value.write(e),e.write(">")}writeSet({writer:e,set:r}){e.writeNode(xi),e.write("<"),r.value.write(e),e.write(">")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},Be=new w({name:"Arrays",packageName:"java.util"}),ci=new w({name:"BigInteger",packageName:"java.math"}),il=new w({name:"HashMap",packageName:"java.util"}),mi=new w({name:"List",packageName:"java.util"}),di=new w({name:"Map",packageName:"java.util"}),hi=new w({name:"OffsetDateTime",packageName:"java.time"}),Me=new w({name:"Optional",packageName:"java.util"}),xi=new w({name:"Set",packageName:"java.util"}),yi=new w({name:"UUID",packageName:"java.util"});var b=class n extends T{constructor(e){super();c(this,"internalType");this.internalType=e}write(e){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:e,bigInteger:this.internalType});break;case"boolean":e.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:e,builder:this.internalType});break;case"bytes":e.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:e,class_:this.internalType});break}case"date":e.write(`"${this.internalType.value}"`);break;case"dateTime":this.writeDateTime({writer:e,dateTime:this.internalType});break;case"double":e.write(this.internalType.value.toString());break;case"enum":this.writeEnum({writer:e,enum_:this.internalType});break;case"float":e.write(`${this.internalType.value}f`);break;case"integer":e.write(this.internalType.value.toString());break;case"list":{this.writeList({writer:e,list:this.internalType});break}case"long":{e.write(`${this.internalType.value}L`);break}case"map":{this.writeMap({writer:e,map:this.internalType});break}case"optional":{this.writeOptional({writer:e,optional:this.internalType});break}case"raw":{e.write(this.internalType.value);break}case"reference":e.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:e,set:this.internalType});break}case"string":e.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:e,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:e,uuid:this.internalType});break;case"nop":break;default:g(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(e){return new this({type:"bigInteger",value:e})}static boolean(e){return new this({type:"boolean",value:e})}static builder({classReference:e,parameters:r}){return new this({type:"builder",classReference:e,parameters:r})}static bytes(e){return new this({type:"bytes",value:e})}static class_({reference:e,parameters:r}){return new this({type:"class",reference:e,parameters:r})}static date(e){return new this({type:"date",value:e})}static dateTime(e){return new this({type:"dateTime",value:e})}static double(e){return new this({type:"double",value:e})}static enum_({classReference:e,value:r}){return new this({type:"enum",classReference:e,value:r})}static float(e){return new this({type:"float",value:e})}static integer(e){return new this({type:"integer",value:e})}static list({valueType:e,values:r}){return new this({type:"list",valueType:e,values:r})}static long(e){return new this({type:"long",value:e})}static map({keyType:e,valueType:r,entries:a}){return new this({type:"map",keyType:e,valueType:r,entries:a})}static optional({value:e,useOf:r}){return this.isAlreadyOptional(e)?e:new this({type:"optional",value:e,useOf:r})}static raw(e){return new this({type:"raw",value:e})}static reference(e){return new this({type:"reference",value:e})}static set({valueType:e,values:r}){return new this({type:"set",valueType:e,values:r})}static string(e){return new this({type:"string",value:e})}static unknown(e){return new this({type:"unknown",value:e})}static uuid(e){return new this({type:"uuid",value:e})}static nop(){return new this({type:"nop"})}static isNop(e){return e.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:g(this.internalType)}}writeBigInteger({writer:e,bigInteger:r}){e.write("new "),e.writeNode(l.instantiateClass({classReference:gi,arguments_:[n.string(r.value)]}))}writeBuilder({writer:e,builder:r}){e.writeNode(r.classReference),e.writeNewLineIfLastLineNot(),e.indent(),this.writeBuilderParameters({writer:e,parameters:this.orderBuilderParameters(Ri({parameters:r.parameters}))}),e.dedent()}writeBuilderParameters({writer:e,parameters:r}){e.writeLine(".builder()");for(let a of r)e.write(`.${a.name}(`),a.value.shouldWriteInLine()||e.newLine(),e.indent(),e.writeNode(a.value),e.dedent(),a.value.shouldWriteInLine()||e.newLine(),e.writeLine(")");e.writeNewLineIfLastLineNot(),e.write(".build()")}orderBuilderParameters(e){return e.sort((r,a)=>r.value.isOptional()&&!a.value.isOptional()?1:!r.value.isOptional()&&a.value.isOptional()?-1:0)}writeClass({writer:e,class_:r}){let a=Ni({parameters:r.parameters});e.writeNode(l.instantiateClass({classReference:r.reference,arguments_:a.map(i=>i.value)}))}writeDateTime({writer:e,dateTime:r}){e.writeNode(l.invokeMethod({on:vi,method:"parse",arguments_:[n.string(r.value)]}))}writeEnum({writer:e,enum_:r}){e.writeNode(r.classReference),e.write("."+r.value)}writeList({writer:e,list:r}){this.writeIterable({writer:e,iterable:r})}writeMap({writer:e,map:r}){let a=bi({entries:r.entries});if(a.length===0){e.write("new "),e.writeNode(ge),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(ge),e.write("<"),e.writeNode(r.keyType),e.write(", "),e.writeNode(r.valueType),e.writeLine(">() {{"),e.indent();for(let i of a)e.write("put("),e.writeNode(i.key),e.write(", "),e.writeNode(i.value),e.writeLine(");");e.dedent(),e.write("}}")}writeOptional({writer:e,optional:r}){if(!r.useOf){e.writeNode(r.value);return}e.writeNode(l.invokeMethod({on:Me,method:"of",arguments_:[r.value]}))}writeSet({writer:e,set:r}){this.writeIterable({writer:e,iterable:r})}writeIterable({writer:e,iterable:r}){let a=r.type==="list"?Oe:wi,i=Ai({values:r.values});if(i.length===0){e.write(`new ${a.name}<`),e.writeNode(r.valueType),e.write(">()");return}e.write("new "),e.writeNode(a),e.write("<"),e.writeNode(r.valueType),e.writeLine(">("),e.indent(),e.writeNode(l.invokeMethod({on:Be,method:"asList",arguments_:i})),e.writeNewLineIfLastLineNot(),e.dedent(),e.write(")")}writeUnknown({writer:e,value:r}){switch(typeof r){case"boolean":e.write(r.toString());return;case"string":e.write(`"${this.escapeString(r)}"`);return;case"number":e.write(r.toString());return;case"object":if(r==null){e.write("null");return}if(Array.isArray(r)){this.writeUnknownArray({writer:e,value:r});return}this.writeUnknownMap({writer:e,value:r});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof r}`)}}writeUnknownArray({writer:e,value:r}){if(r.length===0){e.write("new"),e.writeNode(Oe),e.write("<Object>()");return}e.writeLine("new"),e.writeNode(Oe),e.write("<Object>() {"),e.indent(),e.writeNode(l.invokeMethod({on:Be,method:"asList",arguments_:r.map(a=>n.unknown(a))})),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("}")}writeUnknownMap({writer:e,value:r}){let a=Object.entries(r);if(a.length===0){e.write("new "),e.writeNode(ge),e.write("<String, Object>()");return}e.writeLine("new "),e.writeNode(ge),e.write("<String, Object>() {{"),e.indent();for(let[i,o]of a)e.write(`put("${i}", `),e.writeNode(n.unknown(o)),e.writeLine(");");e.dedent(),e.write("}}")}writeUUID({writer:e,uuid:r}){e.writeNode(l.invokeMethod({on:Ti,method:"fromString",arguments_:[n.string(r.value)]}))}escapeString(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(e){return e.internalType.type==="optional"}},Oe=new w({name:"ArrayList",packageName:"java.util"}),gi=new w({name:"BigInteger",packageName:"java.math"}),ge=new w({name:"HashMap",packageName:"java.util"}),wi=new w({name:"HashSet",packageName:"java.util"}),hl=new w({name:"List",packageName:"java.util"}),xl=new w({name:"Map",packageName:"java.util"}),vi=new w({name:"OffsetDateTime",packageName:"java.time"}),yl=new w({name:"Set",packageName:"java.util"}),Ti=new w({name:"UUID",packageName:"java.util"});function Ni({parameters:n}){return n.filter(t=>!b.isNop(t.value))}function Ri({parameters:n}){return n.filter(t=>!b.isNop(t.value))}function bi({entries:n}){return n.filter(t=>!b.isNop(t.key)&&!b.isNop(t.value))}function Ai({values:n}){return n.filter(t=>!b.isNop(t))}function we({writer:n,arguments_:t}){let e=Ii(t);if(e.length===0){n.write("()");return}if(e.some(a=>a instanceof b&&!a.shouldWriteInLine())){Ei({writer:n,arguments_:e});return}n.write("("),e.forEach((a,i)=>{i>0&&n.write(", "),hr({writer:n,argument:a})}),n.write(")")}function Ei({writer:n,arguments_:t}){n.writeLine("("),n.indent(),t.forEach((e,r)=>{r>0&&n.writeLine(","),hr({writer:n,argument:e})}),n.dedent(),t.length>0&&n.newLine(),n.write(")")}function hr({writer:n,argument:t}){Pe(t)?n.writeNodeOrString(t.assignment):t.write(n)}function Ii(n){return n.filter(t=>!(t instanceof b&&b.isNop(t)))}var $=class extends T{constructor({classReference:e,arguments_:r}){super();c(this,"classReference");c(this,"arguments_");this.classReference=e,this.arguments_=r}write(e){e.writeNode(this.classReference),we({writer:e,arguments_:this.arguments_})}};u();f();var Y=class extends T{constructor(e){super();c(this,"arg");this.arg=e}write(e){return new C(this.arg).write(e)}};u();f();var G=class extends T{constructor({name:e,access:r,parameters:a,body:i,static_:o,return_:m}){super();c(this,"name");c(this,"access");c(this,"parameters");c(this,"body");c(this,"return_");c(this,"static_");this.name=e,this.access=r,this.parameters=a,this.body=i,this.return_=m,this.static_=o!=null?o:!1}write(e){if(e.write(`${this.access} `),this.static_&&e.write("static "),this.return_!=null?e.writeNode(this.return_):e.write("void"),e.write(` ${this.name}`),this.parameters.length===0?e.write("()"):(e.writeLine("("),e.indent(),this.parameters.forEach((r,a)=>{a>0&&e.writeLine(", "),e.writeNode(r)}),e.dedent(),e.write(")")),this.body==null){e.write(";");return}e.writeLine(" {"),e.indent(),e.writeNode(this.body),e.writeNewLineIfLastLineNot(),e.dedent(),e.write("}")}};u();f();var z=class extends T{constructor({method:e,arguments_:r,on:a}){super();c(this,"on");c(this,"method");c(this,"arguments_");this.on=a,this.method=e,this.arguments_=r}write(e){this.on.write(e),e.write("."),e.write(this.method),we({writer:e,arguments_:this.arguments_})}};u();f();var q=class extends T{constructor({name:e,type:r}){super();c(this,"name");c(this,"type");this.name=e,this.type=r}write(e){e.writeNode(this.type),e.write(` ${this.name}`)}};function ki(n){return new Y(n)}function Li(n){return new W(n)}function Ci(n){return new w(n)}function Si(n){return new $(n)}function Ui(n){return new z(n)}function Pi(n){return new G(n)}function Fi(n){return new q(n)}u();f();var ve=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){if(t.value===null)return this.context.isNullable(t.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:v.Critical,message:"Expected non-null value, but got null"}),l.TypeLiteral.nop());if(t.value===void 0)return l.TypeLiteral.nop();switch(t.typeReference.type){case"list":return this.convertList({list:t.typeReference.value,value:t.value});case"literal":return this.convertLiteral({literal:t.typeReference.value,value:t.value});case"map":return this.convertMap({map:t.typeReference,value:t.value});case"named":{let e=this.context.resolveNamedType({typeId:t.typeReference.value});return e==null?l.TypeLiteral.nop():this.convertNamed({named:e,value:t.value,as:t.as})}case"nullable":case"optional":return l.TypeLiteral.optional({value:this.convert({typeReference:t.typeReference.value,value:t.value,as:t.as}),useOf:t.as==="mapValue"});case"primitive":return this.convertPrimitive({primitive:t.typeReference.value,value:t.value,as:t.as});case"set":return this.convertSet({set:t.typeReference.value,value:t.value});case"unknown":return this.convertUnknown({value:t.value});default:g(t.typeReference)}}convertList({list:t,value:e}){return Array.isArray(e)?l.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((r,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:v.Critical,message:`Expected array but got: ${typeof e}`}),l.TypeLiteral.nop())}convertLiteral({literal:t,value:e}){switch(t.type){case"boolean":{let r=this.context.getValueAsBoolean({value:e});return r==null?l.TypeLiteral.nop():l.TypeLiteral.boolean(r)}case"string":{let r=this.context.getValueAsString({value:e});return r==null?l.TypeLiteral.nop():l.TypeLiteral.string(r)}default:g(t)}}convertSet({set:t,value:e}){return Array.isArray(e)?l.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:t}),values:e.map((r,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:t,value:r})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:v.Critical,message:`Expected array but got: ${typeof e}`}),l.TypeLiteral.nop())}convertMap({map:t,value:e}){return typeof e!="object"||e==null?(this.context.errors.add({severity:v.Critical,message:`Expected object but got: ${e==null?"null":typeof e}`}),l.TypeLiteral.nop()):l.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:t.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:t.value}),entries:Object.entries(e).map(([r,a])=>{this.context.errors.scope(r);try{return{key:this.convert({typeReference:t.key,value:r,as:"mapKey"}),value:this.convert({typeReference:t.value,value:a,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:t,value:e,as:r}){switch(t.type){case"alias":return this.convert({typeReference:t.typeReference,value:e,as:r});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:t,value:e});case"enum":return this.convertEnum({enum_:t,value:e});case"object":return this.convertObject({object_:t,value:e,as:r});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e});default:g(t)}}convertDiscriminatedUnion({discriminatedUnion:t,value:e}){let r=this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:t,value:e});if(a==null)return l.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let o=this.context.resolveNamedType({typeId:i.typeId});return o==null?l.TypeLiteral.nop():l.TypeLiteral.reference(l.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:o,value:a.value})]}))}case"singleProperty":{let o=this.context.getRecord(a.value);if(o==null)return l.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),l.TypeLiteral.reference(l.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:o[i.discriminantValue.wireValue]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return l.TypeLiteral.reference(l.invokeMethod({on:r,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:g(i)}}convertObject({object_:t,value:e,as:r}){var i;let a=this.context.associateByWireValue({parameters:t.properties,values:(i=this.context.getRecord(e))!=null?i:{}});return l.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),parameters:a.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getMethodName(o.name.name),value:this.convert({typeReference:o.typeReference,value:o.value,as:r})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:t,value:e}){let r=this.getEnumValueName({enum_:t,value:e});return r==null?l.TypeLiteral.nop():l.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),value:r})}getEnumValueName({enum_:t,value:e}){if(typeof e!="string"){this.context.errors.add({severity:v.Critical,message:`Expected enum value string, got: ${typeof e}`});return}let r=t.values.find(a=>a.wireValue===e);if(r==null){this.context.errors.add({severity:v.Critical,message:`An enum value named "${e}" does not exist in this context`});return}return this.context.getEnumName(r.name)}convertUndiscriminatedUnion({undiscriminatedUnion:t,value:e}){let r=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e});if(r==null)return l.TypeLiteral.nop();if(this.context.isPrimitive(r.valueTypeReference))return l.TypeLiteral.reference(l.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:"of",arguments_:[r.typeInstantiation]}));let a=this.getUndiscriminatedUnionFieldName({typeReference:r.valueTypeReference});return a==null?l.TypeLiteral.nop():l.TypeLiteral.reference(l.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:t.declaration}),method:`of${a}`,arguments_:[r.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:t,value:e}){for(let r of t.types)try{let a=this.convert({typeReference:r,value:e});return{valueTypeReference:r,typeInstantiation:a}}catch(a){continue}this.context.errors.add({severity:v.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof e}" value`})}getUndiscriminatedUnionFieldName({typeReference:t}){switch(t.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:t});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:t.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:t});case"named":{let e=this.context.resolveNamedType({typeId:t.value});return e==null?void 0:this.context.getClassName(e.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:t});case"nullable":return this.getUndiscriminatedUnionFieldNameForNullable({typeReference:t});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:t.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:t});case"unknown":return"Unknown";default:g(t)}}getUndiscriminatedUnionFieldNameForList({list:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`ListOf${e}`}getUndiscriminatedUnionFieldNameForMap({map:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t.key});if(e==null)return;let r=this.getUndiscriminatedUnionFieldName({typeReference:t.value});if(r!=null)return`MapOf${e}To${r}`}getUndiscriminatedUnionFieldNameForOptional({typeReference:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`Optional${e}`}getUndiscriminatedUnionFieldNameForNullable({typeReference:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`Nullable${e}`}getUndiscriminatedUnionFieldNameForSet({set:t}){let e=this.getUndiscriminatedUnionFieldName({typeReference:t});if(e!=null)return`SetOf${e}`}getUndiscriminatedUnionFieldNameForLiteral({literal:t}){}getUndiscriminatedUnionFieldNameForPrimitive({primitive:t}){switch(t){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":return"Float";case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":return"BigInteger";case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:g(t)}}convertUnknown({value:t}){return l.TypeLiteral.unknown(t)}convertPrimitive({primitive:t,value:e,as:r}){switch(t){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.integer(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.long(a)}case"FLOAT":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.float(a)}case"DOUBLE":{let a=this.getValueAsNumber({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.double(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:e,as:r});return a==null?l.TypeLiteral.nop():l.TypeLiteral.boolean(a)}case"STRING":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.string(a)}case"DATE":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.dateTime(a)}case"UUID":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.uuid(a)}case"BASE_64":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.bytes(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:e});return a==null?l.TypeLiteral.nop():l.TypeLiteral.bigInteger(a)}default:g(t)}}getValueAsNumber({value:t,as:e}){let r=e==="mapKey"&&typeof t=="string"?Number(t):t;return this.context.getValueAsNumber({value:r})}getValueAsBoolean({value:t,as:e}){let r=e==="mapKey"?typeof t=="string"?t==="true":t==="false"?!1:t:t;return this.context.getValueAsBoolean({value:r})}};u();f();var Te=class{constructor({context:t}){c(this,"context");this.context=t}convert(t){switch(t.typeReference.type){case"list":return l.Type.list(this.convert({typeReference:t.typeReference}));case"literal":return this.convertLiteral({literal:t.typeReference.value});case"map":return l.Type.map(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":case"nullable":return l.Type.optional(this.convert({typeReference:t.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:t.typeReference.value});case"set":return l.Type.set(this.convert({typeReference:t.typeReference}));case"unknown":return this.convertUnknown();default:g(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 l.Type.reference(l.classReference({name:this.context.getClassName(t.declaration.name),packageName:this.context.getTypesPackageName(t.declaration.fernFilepath)}));default:g(t)}}convertLiteral({literal:t}){switch(t.type){case"boolean":return l.Type.boolean();case"string":return l.Type.string()}}convertUnknown(){return l.Type.object()}convertPrimitive({primitive:t}){switch(t){case"INTEGER":return l.Type.integer();case"UINT":return l.Type.integer();case"LONG":return l.Type.long();case"UINT_64":return l.Type.long();case"FLOAT":return l.Type.float();case"DOUBLE":return l.Type.double();case"BOOLEAN":return l.Type.boolean();case"STRING":return l.Type.string();case"DATE":return l.Type.date();case"DATE_TIME":return l.Type.dateTime();case"UUID":return l.Type.uuid();case"BASE_64":return l.Type.bytes();case"BIG_INTEGER":return l.Type.bigInteger();default:g(t)}}};u();f();var Ne=class{constructor({context:t}){c(this,"context");this.context=t}getFilePropertyInfo({body:t,value:e}){var i;let r={fileFields:[],bodyPropertyFields:[]},a=(i=this.context.getRecord(e))!=null?i:{};for(let o of t.properties)switch(o.type){case"file":r.fileFields.push({name:this.context.getMethodName(o.name),value:this.getSingleFileProperty({property:o,record:a})});break;case"fileArray":r.fileFields.push({name:this.context.getMethodName(o.name),value:this.getArrayFileProperty({property:o,record:a})});break;case"bodyProperty":r.bodyPropertyFields.push({name:this.context.getMethodName(o.name.name),value:this.getBodyProperty({property:o,record:a})});break;default:g(o)}return r}getSingleFileProperty({property:t,record:e}){let r=this.context.getSingleFileValue({property:t,record:e});return r==null?l.TypeLiteral.nop():l.TypeLiteral.reference(this.context.getFileStreamFromString(r))}getArrayFileProperty({property:t,record:e}){let r=this.context.getFileArrayValues({property:t,record:e});if(r==null)return l.TypeLiteral.nop();for(let a of r)return l.TypeLiteral.reference(this.context.getFileStreamFromString(a));return l.TypeLiteral.nop()}getBodyProperty({property:t,record:e}){let r=e[t.name.wireValue];return r==null?l.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:t.typeReference,value:r})}};var Bi=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),_e=class n extends ae{constructor({ir:e,config:r,options:a}){super({ir:e,config:r,options:a});c(this,"ir");c(this,"customConfig");c(this,"dynamicTypeMapper");c(this,"dynamicTypeLiteralMapper");c(this,"filePropertyMapper");this.ir=e,this.customConfig=r.customConfig!=null?r.customConfig:void 0,this.dynamicTypeMapper=new Te({context:this}),this.dynamicTypeLiteralMapper=new ve({context:this}),this.filePropertyMapper=new Ne({context:this})}clone(){return new n({ir:this.ir,config:this.config,options:this.options})}getClassName(e){return this.getName(e.pascalCase.safeName)}getEnumName(e){return this.getName(e.screamingSnakeCase.safeName)}getPropertyName(e){return this.getName(e.camelCase.safeName)}getMethodName(e){return this.getName(e.camelCase.safeName)}getRootClientClassReference(){return l.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["client-class-name"])!=null?r:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(e){let r=this.resolveEnvironmentName(e);if(r!=null)return this.getEnvironmentClassReferenceForEnumName(r)}getEnvironmentClassReference(){return l.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getEnvironmentClassReferenceForEnumName(e){return l.classReference({name:`${this.getEnvironmentClassName()}.${this.getEnumName(e)}`,packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:e}){return l.classReference({name:e.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(e.fernFilepath)})}getNullableClassReference(){return l.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return l.TypeLiteral.reference(l.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getFileStreamFromString(e){return l.TypeLiteral.reference(l.codeblock(r=>{r.write("new "),r.writeNode(this.getFileStreamClassReference()),r.write("("),r.writeNode(this.getByteArrayInputStreamClassReference()),r.write("("),r.writeNode(l.TypeLiteral.string(e)),r.write(".getBytes("),r.writeNode(this.getStandardCharsetsClassReference()),r.write(".UTF_8)))")}))}getFileStreamClassReference(){return l.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return l.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return l.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(e){switch(e.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(e.value);case"named":{let r=this.resolveNamedType({typeId:e.value});if(r==null)return!1;switch(r.type){case"alias":return this.isPrimitive(r.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:g(r)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:g(e)}}getRootPackageName(){let e=this.getPackagePrefixTokens();return this.joinPackageTokens(e)}getCorePackageName(){let e=this.getPackagePrefixTokens();return e.push("core"),this.joinPackageTokens(e)}getTypesPackageName(e){return this.getResourcesPackage(e,"types")}getRequestsPackageName(e){return this.getPackageLayout()==="flat"?this.getTypesPackageName(e):this.getResourcesPackage(e,"requests")}getResourcesPackage(e,r){let a=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":e!=null&&a.push(...e.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:e!=null&&e.allParts.length>0&&a.push("resources"),e!=null&&a.push(...e.allParts.map(i=>this.getPackageNameSegment(i)))}return r!=null&&a.push(r),this.joinPackageTokens(a)}getPackageName(e,r){let a=this.getPackageNameSegments(e);return a=r!=null?[...a,r]:a,[...this.getPackagePrefixTokens(),...a].join(".")}getPackageLayout(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["package-layout"])!=null?r:"nested"}shouldInlinePathParameters(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["inline-path-parameters"])!=null?r:!1}shouldInlineFileProperties(){var e,r;return(r=(e=this.customConfig)==null?void 0:e["inline-file-properties"])!=null?r:!1}getPackageNameSegments(e){return e.packagePath.map(r=>this.getPackageNameSegment(r))}getPackageNameSegment(e){return e.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var r;if(((r=this.customConfig)==null?void 0:r["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let e=[];return e.push("com"),e.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),e.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),e}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return Ue(this.config.workspaceName)}startsWithNumber(e){return/^\d/.test(e)}splitOnNonAlphaNumericChar(e){return e.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(e){return e.replace(/-([a-z])/g,(r,a)=>a.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}joinPackageTokens(e){return e.map(a=>this.startsWithNumber(a)?"_"+a:a).join(".")}getName(e){return this.isReservedName(e)?"_"+e:e}isReservedName(e){return Bi.has(e)}};0&&(module.exports={DynamicSnippetsGeneratorContext});
18
+ ${this.buffer}`:e+this.buffer}stringifyImports(){return Array.from(this.imports).filter(e=>e!==this.packageName).map(e=>`import ${e};`).sort().join(`
19
+ `)}};c();l();c();l();var S={};Mt(S,{BRAND:()=>oo,DIRTY:()=>ve,EMPTY_PATH:()=>Bs,INVALID:()=>k,NEVER:()=>Yo,OK:()=>F,ParseStatus:()=>j,Schema:()=>A,ZodAny:()=>pe,ZodArray:()=>se,ZodBigInt:()=>_e,ZodBoolean:()=>be,ZodBranded:()=>ut,ZodCatch:()=>Oe,ZodDate:()=>Te,ZodDefault:()=>Le,ZodDiscriminatedUnion:()=>kt,ZodEffects:()=>Y,ZodEnum:()=>Se,ZodError:()=>D,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>Rt,ZodIntersection:()=>Ae,ZodIssueCode:()=>h,ZodLazy:()=>Ie,ZodLiteral:()=>Ee,ZodMap:()=>He,ZodNaN:()=>Xe,ZodNativeEnum:()=>Ce,ZodNever:()=>q,ZodNull:()=>Ne,ZodNullable:()=>Q,ZodNumber:()=>we,ZodObject:()=>V,ZodOptional:()=>Z,ZodParsedType:()=>v,ZodPipeline:()=>ct,ZodPromise:()=>de,ZodReadonly:()=>Ue,ZodRecord:()=>Nt,ZodSchema:()=>A,ZodSet:()=>Ke,ZodString:()=>fe,ZodSymbol:()=>qe,ZodTransformer:()=>Y,ZodTuple:()=>X,ZodType:()=>A,ZodUndefined:()=>ke,ZodUnion:()=>Re,ZodUnknown:()=>ie,ZodVoid:()=>Je,addIssueToContext:()=>g,any:()=>xo,array:()=>_o,bigint:()=>fo,boolean:()=>Fn,coerce:()=>zo,custom:()=>Pn,date:()=>po,datetimeRegex:()=>On,defaultErrorMap:()=>ne,discriminatedUnion:()=>No,effect:()=>Mo,enum:()=>Uo,function:()=>Co,getErrorMap:()=>ze,getParsedType:()=>K,instanceof:()=>co,intersection:()=>Ro,isAborted:()=>bt,isAsync:()=>Ye,isDirty:()=>Tt,isValid:()=>le,late:()=>uo,lazy:()=>Lo,literal:()=>Oo,makeIssue:()=>ot,map:()=>Eo,nan:()=>lo,nativeEnum:()=>Po,never:()=>vo,null:()=>yo,nullable:()=>Bo,number:()=>Mn,object:()=>bo,objectUtil:()=>Yt,oboolean:()=>Zo,onumber:()=>Wo,optional:()=>Fo,ostring:()=>$o,pipeline:()=>Vo,preprocess:()=>Do,promise:()=>jo,quotelessJson:()=>js,record:()=>Io,set:()=>So,setErrorMap:()=>Fs,strictObject:()=>To,string:()=>jn,symbol:()=>mo,transformer:()=>Mo,tuple:()=>Ao,undefined:()=>ho,union:()=>ko,unknown:()=>go,util:()=>I,void:()=>wo});c();l();c();l();c();l();c();l();c();l();var I;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{let i={};for(let s of a)i[s]=s;return i},r.getValidEnumValues=a=>{let i=r.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(let o of i)s[o]=a[o];return r.objectValues(s)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},r.find=(a,i)=>{for(let s of a)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(I||(I={}));var Yt;(function(r){r.mergeShapes=(e,t)=>p(p({},e),t)})(Yt||(Yt={}));var v=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),K=r=>{switch(typeof r){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(r)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(r)?v.array:r===null?v.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?v.promise:typeof Map!="undefined"&&r instanceof Map?v.map:typeof Set!="undefined"&&r instanceof Set?v.set:typeof Date!="undefined"&&r instanceof Date?v.date:v.object;default:return v.unknown}};var h=I.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),js=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),D=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let o=n,f=0;for(;f<s.path.length;){let d=s.path[f];f===s.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(s))):o[d]=o[d]||{_errors:[]},o=o[d],f++}}};return a(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let a of this.issues)if(a.path.length>0){let i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};D.create=r=>new D(r);var Ms=(r,e)=>{let t;switch(r.code){case h.invalid_type:r.received===v.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case h.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,I.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:t=`Unrecognized key(s) in object: ${I.joinValues(r.keys,", ")}`;break;case h.invalid_union:t="Invalid input";break;case h.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${I.joinValues(r.options)}`;break;case h.invalid_enum_value:t=`Invalid enum value. Expected ${I.joinValues(r.options)}, received '${r.received}'`;break;case h.invalid_arguments:t="Invalid function arguments";break;case h.invalid_return_type:t="Invalid function return type";break;case h.invalid_date:t="Invalid date";break;case h.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:I.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case h.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case h.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case h.custom:t="Invalid input";break;case h.invalid_intersection_types:t="Intersection results could not be merged";break;case h.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case h.not_finite:t="Number must be finite";break;default:t=e.defaultError,I.assertNever(r)}return{message:t}},ne=Ms;var In=ne;function Fs(r){In=r}function ze(){return In}c();l();var ot=r=>{let{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],s=T(p({},a),{path:i});if(a.message!==void 0)return T(p({},a),{path:i,message:a.message});let o="",f=n.filter(d=>!!d).slice().reverse();for(let d of f)o=d(s,{data:e,defaultError:o}).message;return T(p({},a),{path:i,message:o})},Bs=[];function g(r,e){let t=ze(),n=ot({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===ne?void 0:ne].filter(a=>!!a)});r.common.issues.push(n)}var j=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let a of t){if(a.status==="aborted")return k;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let a of t){let i=await a.key,s=await a.value;n.push({key:i,value:s})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let a of t){let{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return k;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||a.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}},k=Object.freeze({status:"aborted"}),ve=r=>({status:"dirty",value:r}),F=r=>({status:"valid",value:r}),bt=r=>r.status==="aborted",Tt=r=>r.status==="dirty",le=r=>r.status==="valid",Ye=r=>typeof Promise!="undefined"&&r instanceof Promise;c();l();c();l();var _;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(_||(_={}));var z=class{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},En=(r,e)=>{if(le(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new D(r.common.issues);return this._error=t,this._error}}};function R(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{var d,x;let{message:f}=r;return s.code==="invalid_enum_value"?{message:f!=null?f:o.defaultError}:typeof o.data=="undefined"?{message:(d=f!=null?f:n)!=null?d:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(x=f!=null?f:t)!=null?x:o.defaultError}},description:a}}var A=class{get description(){return this._def.description}_getType(e){return K(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:K(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new j,ctx:{common:e.parent.common,data:e.data,parsedType:K(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ye(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var i;let n={common:{issues:[],async:(i=t==null?void 0:t.async)!=null?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:K(e)},a=this._parseSync({data:e,path:n.path,parent:n});return En(n,a)}"~validate"(e){var n,a;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:K(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:t});return le(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>le(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:K(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Ye(a)?a:Promise.resolve(a));return En(n,i)}refine(e,t){let n=a=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{let s=e(a),o=()=>i.addIssue(p({code:h.custom},n(a)));return typeof Promise!="undefined"&&s instanceof Promise?s.then(f=>f?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new Y({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Z.create(this,this._def)}nullable(){return Q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return se.create(this)}promise(){return de.create(this,this._def)}or(e){return Re.create([this,e],this._def)}and(e){return Ae.create(this,e,this._def)}transform(e){return new Y(T(p({},R(this._def)),{schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new Le(T(p({},R(this._def)),{innerType:this,defaultValue:t,typeName:N.ZodDefault}))}brand(){return new ut(p({typeName:N.ZodBranded,type:this},R(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new Oe(T(p({},R(this._def)),{innerType:this,catchValue:t,typeName:N.ZodCatch}))}describe(e){let t=this.constructor;return new t(T(p({},this._def),{description:e}))}pipe(e){return ct.create(this,e)}readonly(){return Ue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ds=/^c[^\s-]{8,}$/i,Vs=/^[0-9a-z]+$/,$s=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ws=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Zs=/^[a-z0-9_-]{21}$/i,zs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ys=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Gs=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Gt,Js=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ks=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Xs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Cn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",to=new RegExp(`^${Cn}$`);function Ln(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ro(r){return new RegExp(`^${Ln(r)}$`)}function On(r){let e=`${Cn}T${Ln(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function no(r,e){return!!((e==="v4"||!e)&&Js.test(r)||(e==="v6"||!e)&&Ks.test(r))}function ao(r,e){if(!zs.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch(t){return!1}}function io(r,e){return!!((e==="v4"||!e)&&Hs.test(r)||(e==="v6"||!e)&&Xs.test(r))}var fe=class r extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){let i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_type,expected:v.string,received:i.parsedType}),k}let n=new j,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?g(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&g(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Gs.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"email",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Gt||(Gt=new RegExp(qs,"u")),Gt.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"emoji",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Ws.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"uuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Zs.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"nanoid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Ds.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Vs.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid2",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")$s.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ulid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),g(a,{validation:"url",code:h.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"regex",code:h.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?On(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?to.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ro(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Ys.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"duration",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?no(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ip",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?ao(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"jwt",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?io(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cidr",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?Qs.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?eo.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64url",code:h.invalid_string,message:i.message}),n.dirty()):I.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),p({validation:t,code:h.invalid_string},_.errToObj(n)))}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(p({kind:"email"},_.errToObj(e)))}url(e){return this._addCheck(p({kind:"url"},_.errToObj(e)))}emoji(e){return this._addCheck(p({kind:"emoji"},_.errToObj(e)))}uuid(e){return this._addCheck(p({kind:"uuid"},_.errToObj(e)))}nanoid(e){return this._addCheck(p({kind:"nanoid"},_.errToObj(e)))}cuid(e){return this._addCheck(p({kind:"cuid"},_.errToObj(e)))}cuid2(e){return this._addCheck(p({kind:"cuid2"},_.errToObj(e)))}ulid(e){return this._addCheck(p({kind:"ulid"},_.errToObj(e)))}base64(e){return this._addCheck(p({kind:"base64"},_.errToObj(e)))}base64url(e){return this._addCheck(p({kind:"base64url"},_.errToObj(e)))}jwt(e){return this._addCheck(p({kind:"jwt"},_.errToObj(e)))}ip(e){return this._addCheck(p({kind:"ip"},_.errToObj(e)))}cidr(e){return this._addCheck(p({kind:"cidr"},_.errToObj(e)))}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(p({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},_.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(p({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},_.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(p({kind:"duration"},_.errToObj(e)))}regex(e,t){return this._addCheck(p({kind:"regex",regex:e},_.errToObj(t)))}includes(e,t){return this._addCheck(p({kind:"includes",value:e,position:t==null?void 0:t.position},_.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(p({kind:"startsWith",value:e},_.errToObj(t)))}endsWith(e,t){return this._addCheck(p({kind:"endsWith",value:e},_.errToObj(t)))}min(e,t){return this._addCheck(p({kind:"min",value:e},_.errToObj(t)))}max(e,t){return this._addCheck(p({kind:"max",value:e},_.errToObj(t)))}length(e,t){return this._addCheck(p({kind:"length",value:e},_.errToObj(t)))}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};fe.create=r=>{var e;return new fe(p({checks:[],typeName:N.ZodString,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};function so(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}var we=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){let i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_type,expected:v.number,received:i.parsedType}),k}let n,a=new j;for(let i of this._def.checks)i.kind==="int"?I.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?so(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),g(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:h.not_finite,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,n,a){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_.toString(a)}]}))}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&I.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};we.create=r=>new we(p({checks:[],typeName:N.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var _e=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(i){return this._getInvalidInput(e)}if(this._getType(e)!==v.bigint)return this._getInvalidInput(e);let n,a=new j;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),g(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:v.bigint,received:t.parsedType}),k}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,n,a){return new r(T(p({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_.toString(a)}]}))}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};_e.create=r=>{var e;return new _e(p({checks:[],typeName:N.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};var be=class extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){let n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.boolean,received:n.parsedType}),k}return F(e.data)}};be.create=r=>new be(p({typeName:N.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var Te=class r extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){let i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_type,expected:v.date,received:i.parsedType}),k}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_date}),k}let n=new j,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):I.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r(T(p({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Te.create=r=>new Te(p({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:N.ZodDate},R(r)));var qe=class extends A{_parse(e){if(this._getType(e)!==v.symbol){let n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.symbol,received:n.parsedType}),k}return F(e.data)}};qe.create=r=>new qe(p({typeName:N.ZodSymbol},R(r)));var ke=class extends A{_parse(e){if(this._getType(e)!==v.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.undefined,received:n.parsedType}),k}return F(e.data)}};ke.create=r=>new ke(p({typeName:N.ZodUndefined},R(r)));var Ne=class extends A{_parse(e){if(this._getType(e)!==v.null){let n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.null,received:n.parsedType}),k}return F(e.data)}};Ne.create=r=>new Ne(p({typeName:N.ZodNull},R(r)));var pe=class extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return F(e.data)}};pe.create=r=>new pe(p({typeName:N.ZodAny},R(r)));var ie=class extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return F(e.data)}};ie.create=r=>new ie(p({typeName:N.ZodUnknown},R(r)));var q=class extends A{_parse(e){let t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:v.never,received:t.parsedType}),k}};q.create=r=>new q(p({typeName:N.ZodNever},R(r)));var Je=class extends A{_parse(e){if(this._getType(e)!==v.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.void,received:n.parsedType}),k}return F(e.data)}};Je.create=r=>new Je(p({typeName:N.ZodVoid},R(r)));var se=class r extends A{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==v.array)return g(t,{code:h.invalid_type,expected:v.array,received:t.parsedType}),k;if(a.exactLength!==null){let s=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(s||o)&&(g(t,{code:s?h.too_big:h.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(g(t,{code:h.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(g(t,{code:h.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>a.type._parseAsync(new z(t,s,t.path,o)))).then(s=>j.mergeArray(n,s));let i=[...t.data].map((s,o)=>a.type._parseSync(new z(t,s,t.path,o)));return j.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new r(T(p({},this._def),{minLength:{value:e,message:_.toString(t)}}))}max(e,t){return new r(T(p({},this._def),{maxLength:{value:e,message:_.toString(t)}}))}length(e,t){return new r(T(p({},this._def),{exactLength:{value:e,message:_.toString(t)}}))}nonempty(e){return this.min(1,e)}};se.create=(r,e)=>new se(p({type:r,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray},R(e)));function Ge(r){if(r instanceof V){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Z.create(Ge(n))}return new V(T(p({},r._def),{shape:()=>e}))}else return r instanceof se?new se(T(p({},r._def),{type:Ge(r.element)})):r instanceof Z?Z.create(Ge(r.unwrap())):r instanceof Q?Q.create(Ge(r.unwrap())):r instanceof X?X.create(r.items.map(e=>Ge(e))):r}var V=class r extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=I.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==v.object){let d=this._getOrReturnCtx(e);return g(d,{code:h.invalid_type,expected:v.object,received:d.parsedType}),k}let{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof q&&this._def.unknownKeys==="strip"))for(let d in a.data)s.includes(d)||o.push(d);let f=[];for(let d of s){let x=i[d],b=a.data[d];f.push({key:{status:"valid",value:d},value:x._parse(new z(a,b,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof q){let d=this._def.unknownKeys;if(d==="passthrough")for(let x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:a.data[x]}});else if(d==="strict")o.length>0&&(g(a,{code:h.unrecognized_keys,keys:o}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let x of o){let b=a.data[x];f.push({key:{status:"valid",value:x},value:d._parse(new z(a,b,a.path,x)),alwaysSet:x in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let d=[];for(let x of f){let b=await x.key,M=await x.value;d.push({key:b,value:M,alwaysSet:x.alwaysSet})}return d}).then(d=>j.mergeObjectSync(n,d)):j.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new r(p(T(p({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,o,f;let a=(o=(s=(i=this._def).errorMap)==null?void 0:s.call(i,t,n).message)!=null?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=_.errToObj(e).message)!=null?f:a}:{message:a}}}:{}))}strip(){return new r(T(p({},this._def),{unknownKeys:"strip"}))}passthrough(){return new r(T(p({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new r(T(p({},this._def),{shape:()=>p(p({},this._def.shape()),e)}))}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>p(p({},this._def.shape()),e._def.shape()),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r(T(p({},this._def),{catchall:e}))}pick(e){let t={};for(let n of I.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r(T(p({},this._def),{shape:()=>t}))}omit(e){let t={};for(let n of I.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r(T(p({},this._def),{shape:()=>t}))}deepPartial(){return Ge(this)}partial(e){let t={};for(let n of I.objectKeys(this.shape)){let a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new r(T(p({},this._def),{shape:()=>t}))}required(e){let t={};for(let n of I.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Z;)i=i._def.innerType;t[n]=i}return new r(T(p({},this._def),{shape:()=>t}))}keyof(){return Un(I.objectKeys(this.shape))}};V.create=(r,e)=>new V(p({shape:()=>r,unknownKeys:"strip",catchall:q.create(),typeName:N.ZodObject},R(e)));V.strictCreate=(r,e)=>new V(p({shape:()=>r,unknownKeys:"strict",catchall:q.create(),typeName:N.ZodObject},R(e)));V.lazycreate=(r,e)=>new V(p({shape:r,unknownKeys:"strip",catchall:q.create(),typeName:N.ZodObject},R(e)));var Re=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(o=>new D(o.ctx.common.issues));return g(t,{code:h.invalid_union,unionErrors:s}),k}if(t.common.async)return Promise.all(n.map(async i=>{let s=T(p({},t),{common:T(p({},t.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(a);{let i,s=[];for(let f of n){let d=T(p({},t),{common:T(p({},t.common),{issues:[]}),parent:null}),x=f._parseSync({data:t.data,path:t.path,parent:d});if(x.status==="valid")return x;x.status==="dirty"&&!i&&(i={result:x,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map(f=>new D(f));return g(t,{code:h.invalid_union,unionErrors:o}),k}}get options(){return this._def.options}};Re.create=(r,e)=>new Re(p({options:r,typeName:N.ZodUnion},R(e)));var ae=r=>r instanceof Ie?ae(r.schema):r instanceof Y?ae(r.innerType()):r instanceof Ee?[r.value]:r instanceof Se?r.options:r instanceof Ce?I.objectValues(r.enum):r instanceof Le?ae(r._def.innerType):r instanceof ke?[void 0]:r instanceof Ne?[null]:r instanceof Z?[void 0,...ae(r.unwrap())]:r instanceof Q?[null,...ae(r.unwrap())]:r instanceof ut||r instanceof Ue?ae(r.unwrap()):r instanceof Oe?ae(r._def.innerType):[],kt=class r extends A{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.object)return g(t,{code:h.invalid_type,expected:v.object,received:t.parsedType}),k;let n=this.discriminator,a=t.data[n],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(g(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let a=new Map;for(let i of t){let s=ae(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,i)}}return new r(p({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a},R(n)))}};function qt(r,e){let t=K(r),n=K(e);if(r===e)return{valid:!0,data:r};if(t===v.object&&n===v.object){let a=I.objectKeys(e),i=I.objectKeys(r).filter(o=>a.indexOf(o)!==-1),s=p(p({},r),e);for(let o of i){let f=qt(r[o],e[o]);if(!f.valid)return{valid:!1};s[o]=f.data}return{valid:!0,data:s}}else if(t===v.array&&n===v.array){if(r.length!==e.length)return{valid:!1};let a=[];for(let i=0;i<r.length;i++){let s=r[i],o=e[i],f=qt(s,o);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return t===v.date&&n===v.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var Ae=class extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=(i,s)=>{if(bt(i)||bt(s))return k;let o=qt(i.value,s.value);return o.valid?((Tt(i)||Tt(s))&&t.dirty(),{status:t.value,value:o.data}):(g(n,{code:h.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ae.create=(r,e,t)=>new Ae(p({left:r,right:e,typeName:N.ZodIntersection},R(t)));var X=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.array)return g(n,{code:h.invalid_type,expected:v.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return g(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...n.data].map((s,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new z(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>j.mergeArray(t,s)):j.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new r(T(p({},this._def),{rest:e}))}};X.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new X(p({items:r,typeName:N.ZodTuple,rest:null},R(e)))};var Nt=class r extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.object)return g(n,{code:h.invalid_type,expected:v.object,received:n.parsedType}),k;let a=[],i=this._def.keyType,s=this._def.valueType;for(let o in n.data)a.push({key:i._parse(new z(n,o,n.path,o)),value:s._parse(new z(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?j.mergeObjectAsync(t,a):j.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof A?new r(p({keyType:e,valueType:t,typeName:N.ZodRecord},R(n))):new r(p({keyType:fe.create(),valueType:e,typeName:N.ZodRecord},R(t)))}},He=class extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.map)return g(n,{code:h.invalid_type,expected:v.map,received:n.parsedType}),k;let a=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([o,f],d)=>({key:a._parse(new z(n,o,n.path,[d,"key"])),value:i._parse(new z(n,f,n.path,[d,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of s){let d=await f.key,x=await f.value;if(d.status==="aborted"||x.status==="aborted")return k;(d.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(d.value,x.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let f of s){let d=f.key,x=f.value;if(d.status==="aborted"||x.status==="aborted")return k;(d.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(d.value,x.value)}return{status:t.value,value:o}}}};He.create=(r,e,t)=>new He(p({valueType:e,keyType:r,typeName:N.ZodMap},R(t)));var Ke=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.set)return g(n,{code:h.invalid_type,expected:v.set,received:n.parsedType}),k;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(g(n,{code:h.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(g(n,{code:h.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let i=this._def.valueType;function s(f){let d=new Set;for(let x of f){if(x.status==="aborted")return k;x.status==="dirty"&&t.dirty(),d.add(x.value)}return{status:t.value,value:d}}let o=[...n.data.values()].map((f,d)=>i._parse(new z(n,f,n.path,d)));return n.common.async?Promise.all(o).then(f=>s(f)):s(o)}min(e,t){return new r(T(p({},this._def),{minSize:{value:e,message:_.toString(t)}}))}max(e,t){return new r(T(p({},this._def),{maxSize:{value:e,message:_.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ke.create=(r,e)=>new Ke(p({valueType:r,minSize:null,maxSize:null,typeName:N.ZodSet},R(e)));var Rt=class r extends A{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.function)return g(t,{code:h.invalid_type,expected:v.function,received:t.parsedType}),k;function n(o,f){return ot({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ze(),ne].filter(d=>!!d),issueData:{code:h.invalid_arguments,argumentsError:f}})}function a(o,f){return ot({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ze(),ne].filter(d=>!!d),issueData:{code:h.invalid_return_type,returnTypeError:f}})}let i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof de){let o=this;return F(async function(...f){let d=new D([]),x=await o._def.args.parseAsync(f,i).catch(P=>{throw d.addIssue(n(f,P)),d}),b=await Reflect.apply(s,this,x);return await o._def.returns._def.type.parseAsync(b,i).catch(P=>{throw d.addIssue(a(b,P)),d})})}else{let o=this;return F(function(...f){let d=o._def.args.safeParse(f,i);if(!d.success)throw new D([n(f,d.error)]);let x=Reflect.apply(s,this,d.data),b=o._def.returns.safeParse(x,i);if(!b.success)throw new D([a(x,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r(T(p({},this._def),{args:X.create(e).rest(ie.create())}))}returns(e){return new r(T(p({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r(p({args:e||X.create([]).rest(ie.create()),returns:t||ie.create(),typeName:N.ZodFunction},R(n)))}},Ie=class extends A{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ie.create=(r,e)=>new Ie(p({getter:r,typeName:N.ZodLazy},R(e)));var Ee=class extends A{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ee.create=(r,e)=>new Ee(p({value:r,typeName:N.ZodLiteral},R(e)));function Un(r,e){return new Se(p({values:r,typeName:N.ZodEnum},R(e)))}var Se=class r extends A{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return g(t,{expected:I.joinValues(n),received:t.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return g(t,{received:t.data,code:h.invalid_enum_value,options:n}),k}return F(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,p(p({},this._def),t))}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),p(p({},this._def),t))}};Se.create=Un;var Ce=class extends A{_parse(e){let t=I.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==v.string&&n.parsedType!==v.number){let a=I.objectValues(t);return g(n,{expected:I.joinValues(a),received:n.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(I.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=I.objectValues(t);return g(n,{received:n.data,code:h.invalid_enum_value,options:a}),k}return F(e.data)}get enum(){return this._def.values}};Ce.create=(r,e)=>new Ce(p({values:r,typeName:N.ZodNativeEnum},R(e)));var de=class extends A{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.promise&&t.common.async===!1)return g(t,{code:h.invalid_type,expected:v.promise,received:t.parsedType}),k;let n=t.parsedType===v.promise?t.data:Promise.resolve(t.data);return F(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};de.create=(r,e)=>new de(p({type:r,typeName:N.ZodPromise},R(e)));var Y=class extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{g(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let s=a.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return k;let f=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return f.status==="aborted"?k:f.status==="dirty"?ve(f.value):t.value==="dirty"?ve(f.value):f});{if(t.value==="aborted")return k;let o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?ve(o.value):t.value==="dirty"?ve(o.value):o}}if(a.type==="refinement"){let s=o=>{let f=a.refinement(o,i);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!le(s))return k;let o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>le(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:t.value,value:o})):k);I.assertNever(a)}};Y.create=(r,e,t)=>new Y(p({schema:r,typeName:N.ZodEffects,effect:e},R(t)));Y.createWithPreprocess=(r,e,t)=>new Y(p({schema:e,effect:{type:"preprocess",transform:r},typeName:N.ZodEffects},R(t)));var Z=class extends A{_parse(e){return this._getType(e)===v.undefined?F(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(r,e)=>new Z(p({innerType:r,typeName:N.ZodOptional},R(e)));var Q=class extends A{_parse(e){return this._getType(e)===v.null?F(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Q.create=(r,e)=>new Q(p({innerType:r,typeName:N.ZodNullable},R(e)));var Le=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===v.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Le.create=(r,e)=>new Le(p({innerType:r,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},R(e)));var Oe=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=T(p({},t),{common:T(p({},t.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:p({},n)});return Ye(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Oe.create=(r,e)=>new Oe(p({innerType:r,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},R(e)));var Xe=class extends A{_parse(e){if(this._getType(e)!==v.nan){let n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.nan,received:n.parsedType}),k}return{status:"valid",value:e.data}}};Xe.create=r=>new Xe(p({typeName:N.ZodNaN},R(r)));var oo=Symbol("zod_brand"),ut=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},ct=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?k:i.status==="dirty"?(t.dirty(),ve(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:N.ZodPipeline})}},Ue=class extends A{_parse(e){let t=this._def.innerType._parse(e),n=a=>(le(a)&&(a.value=Object.freeze(a.value)),a);return Ye(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}};Ue.create=(r,e)=>new Ue(p({innerType:r,typeName:N.ZodReadonly},R(e)));function Sn(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Pn(r,e={},t){return r?pe.create().superRefine((n,a)=>{var s,o;let i=r(n);if(i instanceof Promise)return i.then(f=>{var d,x;if(!f){let b=Sn(e,n),M=(x=(d=b.fatal)!=null?d:t)!=null?x:!0;a.addIssue(T(p({code:"custom"},b),{fatal:M}))}});if(!i){let f=Sn(e,n),d=(o=(s=f.fatal)!=null?s:t)!=null?o:!0;a.addIssue(T(p({code:"custom"},f),{fatal:d}))}}):pe.create()}var uo={object:V.lazycreate},N;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(N||(N={}));var co=(r,e={message:`Input not instance of ${r.name}`})=>Pn(t=>t instanceof r,e),jn=fe.create,Mn=we.create,lo=Xe.create,fo=_e.create,Fn=be.create,po=Te.create,mo=qe.create,ho=ke.create,yo=Ne.create,xo=pe.create,go=ie.create,vo=q.create,wo=Je.create,_o=se.create,bo=V.create,To=V.strictCreate,ko=Re.create,No=kt.create,Ro=Ae.create,Ao=X.create,Io=Nt.create,Eo=He.create,So=Ke.create,Co=Rt.create,Lo=Ie.create,Oo=Ee.create,Uo=Se.create,Po=Ce.create,jo=de.create,Mo=Y.create,Fo=Z.create,Bo=Q.create,Do=Y.createWithPreprocess,Vo=ct.create,$o=()=>jn().optional(),Wo=()=>Mn().optional(),Zo=()=>Fn().optional(),zo={string:(r=>fe.create(T(p({},r),{coerce:!0}))),number:(r=>we.create(T(p({},r),{coerce:!0}))),boolean:(r=>be.create(T(p({},r),{coerce:!0}))),bigint:(r=>_e.create(T(p({},r),{coerce:!0}))),date:(r=>Te.create(T(p({},r),{coerce:!0})))};var Yo=k;c();l();var Bn=S.strictObject({title:S.string(),content:S.string()});var Jt=S.object({"base-api-exception-class-name":S.string().optional(),"base-exception-class-name":S.string().optional(),"client-class-name":S.string().optional(),"inline-file-properties":S.boolean().optional(),"inline-path-parameters":S.boolean().optional(),"package-layout":S.enum(["flat","nested"]).optional(),"package-prefix":S.string().optional(),"custom-dependencies":S.array(S.string()).optional(),"disable-required-property-builder-checks":S.boolean().optional(),"enable-forward-compatible-enums":S.boolean().optional(),"enable-inline-types":S.boolean().optional(),"enable-public-constructors":S.boolean().optional(),"generate-unknown-as-json-node":S.boolean().optional(),"json-include":S.enum(["non-absent","non-empty"]).optional(),"enable-extensible-builders":S.boolean().optional(),"use-default-request-parameter-values":S.boolean().optional(),"enable-wire-tests":S.boolean().default(!0),"custom-readme-sections":S.array(Bn).optional(),"wrapped-aliases":S.boolean().optional()});var m={};Mt(m,{Access:()=>Ht,AstNode:()=>O,Class:()=>Pe,ClassInstantiation:()=>je,ClassReference:()=>C,CodeBlock:()=>Me,Method:()=>Fe,MethodInvocation:()=>Be,Parameter:()=>De,Type:()=>lt,TypeLiteral:()=>$,Writer:()=>ge,classReference:()=>pu,class_:()=>fu,codeblock:()=>lu,instantiateClass:()=>du,invokeMethod:()=>mu,method:()=>hu,parameter:()=>yu});c();l();c();l();c();l();var Ht={Public:"public",Protected:"protected",Private:"private"};c();l();c();l();var O=class extends xe{async toStringAsync({packageName:e,customConfig:t,formatter:n}){let a=new st({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toStringAsync()}toString({packageName:e,customConfig:t,formatter:n}){let a=new st({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toString()}};var Pe=class extends O{constructor({name:t,access:n}){super();w(this,"name");w(this,"access");w(this,"methods",[]);this.name=t,this.access=n}write(t){if(t.write(`${this.access} class ${this.name}`),this.isEmpty()){t.writeLine(" {}");return}t.writeLine(" {"),t.indent();for(let n of this.methods)t.writeNode(n),t.newLine();t.dedent(),t.write("}")}addMethod(t){this.methods.push(t)}isEmpty(){return this.methods.length===0}};c();l();c();l();c();l();c();l();var C=class extends O{constructor({name:t,packageName:n,fullyQualified:a}){super();w(this,"name");w(this,"packageName");w(this,"fullyQualified");this.name=t,this.packageName=n,this.fullyQualified=a!=null?a:!1}write(t){if(t.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){t.write(`${this.packageName}.${this.name}`);return}t.write(this.name)}};c();l();var lt=class extends O{constructor(t){super();w(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"array":t.writeNode(this.internalType.value),t.write("[]");break;case"bigInteger":t.writeNode(Go);break;case"boolean":t.write("Boolean");break;case"bytes":t.write("byte[]");break;case"date":t.write("String");break;case"dateTime":t.writeNode(Ho);break;case"double":t.write("Double");break;case"float":t.write("Float");break;case"generic":t.writeNode(this.internalType.value),t.write("<");for(let[n,a]of this.internalType.parameters.entries())t.writeNode(a),n<this.internalType.parameters.length-1&&t.write(", ");t.write(">");break;case"inputStream":t.writeNode(Qo);break;case"integer":t.write("Integer");break;case"iterable":this.writeIterable({writer:t,iterable:this.internalType});break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write("Long");break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"object":{t.write("Object");break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write("String");break;case"uuid":t.writeNode(Xo);break;case"void":t.write("Void");break;default:E(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(t){return new this({type:"array",value:t})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(t){return new this({type:"list",value:t})}static long(){return new this({type:"long"})}static map(t,n){return new this({type:"map",keyType:t,valueType:n})}static object(){return new this({type:"object"})}static optional(t){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t})}static reference(t){return new this({type:"reference",value:t})}static generic(t,n){return new this({type:"generic",value:t,parameters:n})}static set(t){return new this({type:"set",value:t})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(t){return new this({type:"iterable",value:t})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:t,list:n}){t.writeNode(qo),t.write("<"),n.value.write(t),t.write(">")}writeMap({writer:t,map:n}){t.writeNode(Jo),t.write("<"),n.keyType.write(t),t.write(", "),n.valueType.write(t),t.write(">")}writeOptional({writer:t,optional:n}){t.writeNode(At),t.write("<"),n.value.write(t),t.write(">")}writeIterable({writer:t,iterable:n}){t.writeNode(At),t.write("<"),n.value.write(t),t.write(">")}writeSet({writer:t,set:n}){t.writeNode(Ko),t.write("<"),n.value.write(t),t.write(">")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},It=new C({name:"Arrays",packageName:"java.util"}),Go=new C({name:"BigInteger",packageName:"java.math"}),$d=new C({name:"HashMap",packageName:"java.util"}),qo=new C({name:"List",packageName:"java.util"}),Jo=new C({name:"Map",packageName:"java.util"}),Ho=new C({name:"OffsetDateTime",packageName:"java.time"}),At=new C({name:"Optional",packageName:"java.util"}),Ko=new C({name:"Set",packageName:"java.util"}),Xo=new C({name:"UUID",packageName:"java.util"}),Qo=new C({name:"InputStream",packageName:"java.io"});var $=class r extends O{constructor(t){super();w(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:t,bigInteger:this.internalType});break;case"boolean":t.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:t,builder:this.internalType});break;case"bytes":t.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:t,class_:this.internalType});break}case"date":t.write(`"${this.internalType.value}"`);break;case"dateTime":this.writeDateTime({writer:t,dateTime:this.internalType});break;case"double":{let n=this.internalType.value.toString();!n.includes(".")&&!n.includes("e")&&!n.includes("E")?t.write(`${n}.0`):t.write(n);break}case"enum":this.writeEnum({writer:t,enum_:this.internalType});break;case"float":t.write(`${this.internalType.value}f`);break;case"integer":t.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"raw":{this.internalType.value instanceof O?t.writeNode(this.internalType.value):t.write(this.internalType.value);break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:t,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:t,uuid:this.internalType});break;case"nop":break;default:E(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(t){return new this({type:"bigInteger",value:t})}static boolean(t){return new this({type:"boolean",value:t})}static builder({classReference:t,parameters:n}){return new this({type:"builder",classReference:t,parameters:n})}static bytes(t){return new this({type:"bytes",value:t})}static class_({reference:t,parameters:n}){return new this({type:"class",reference:t,parameters:n})}static date(t){return new this({type:"date",value:t})}static dateTime(t){return new this({type:"dateTime",value:t})}static double(t){return new this({type:"double",value:t})}static enum_({classReference:t,value:n}){return new this({type:"enum",classReference:t,value:n})}static float(t){return new this({type:"float",value:t})}static integer(t){return new this({type:"integer",value:t})}static list({valueType:t,values:n,isParameter:a}){return new this({type:"list",valueType:t,values:n,isParameter:a})}static long(t){return new this({type:"long",value:t})}static map({keyType:t,valueType:n,entries:a}){return new this({type:"map",keyType:t,valueType:n,entries:a})}static optional({value:t,useOf:n}){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t,useOf:n})}static raw(t){return new this({type:"raw",value:t})}static reference(t){return new this({type:"reference",value:t})}static set({valueType:t,values:n}){return new this({type:"set",valueType:t,values:n})}static string(t){return new this({type:"string",value:t})}static unknown(t){return new this({type:"unknown",value:t})}static uuid(t){return new this({type:"uuid",value:t})}static nop(){return new this({type:"nop"})}static isNop(t){return t.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:E(this.internalType)}}writeBigInteger({writer:t,bigInteger:n}){t.write("new "),t.writeNode(m.instantiateClass({classReference:eu,arguments_:[r.string(n.value)]}))}writeBuilder({writer:t,builder:n}){t.writeNode(n.classReference),t.writeNewLineIfLastLineNot(),t.indent(),this.writeBuilderParameters({writer:t,parameters:this.orderBuilderParameters(iu({parameters:n.parameters}))}),t.dedent()}writeBuilderParameters({writer:t,parameters:n}){t.writeLine(".builder()");for(let a of n)t.write(`.${a.name}(`),a.value.shouldWriteInLine()||t.newLine(),t.indent(),t.writeNode(a.value),t.dedent(),a.value.shouldWriteInLine()||t.newLine(),t.writeLine(")");t.writeNewLineIfLastLineNot(),t.write(".build()")}orderBuilderParameters(t){return t.sort((n,a)=>n.value.isOptional()&&!a.value.isOptional()?1:!n.value.isOptional()&&a.value.isOptional()?-1:0)}writeClass({writer:t,class_:n}){let a=au({parameters:n.parameters});t.writeNode(m.instantiateClass({classReference:n.reference,arguments_:a.map(i=>i.value)}))}writeDateTime({writer:t,dateTime:n}){t.writeNode(m.invokeMethod({on:ru,method:"parse",arguments_:[r.string(n.value)]}))}writeEnum({writer:t,enum_:n}){t.writeNode(n.classReference),t.write("."+n.value)}writeList({writer:t,list:n}){this.writeIterable({writer:t,iterable:n})}writeMap({writer:t,map:n}){let a=su({entries:n.entries});if(a.length===0){t.write("new "),t.writeNode(Et),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(Et),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.writeLine(">() {{"),t.indent();for(let i of a)t.write("put("),t.writeNode(i.key),t.write(", "),t.writeNode(i.value),t.writeLine(");");t.dedent(),t.write("}}")}writeOptional({writer:t,optional:n}){if(!n.useOf){t.writeNode(n.value);return}t.writeNode(m.invokeMethod({on:At,method:"of",arguments_:[n.value]}))}writeSet({writer:t,set:n}){this.writeIterable({writer:t,iterable:n})}writeIterable({writer:t,iterable:n}){let a=n.type==="list"?Kt:tu,i=ou({values:n.values});if(n.type==="list"&&n.isParameter&&i.length>0){t.writeNode(m.invokeMethod({on:It,method:"asList",arguments_:i}));return}if(i.length===0){t.write(`new ${a.name}<`),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(a),t.write("<"),t.writeNode(n.valueType),t.writeLine(">("),t.indent(),t.writeNode(m.invokeMethod({on:It,method:"asList",arguments_:i})),t.writeNewLineIfLastLineNot(),t.dedent(),t.write(")")}writeUnknown({writer:t,value:n}){switch(typeof n){case"boolean":t.write(n.toString());return;case"string":t.write(`"${this.escapeString(n)}"`);return;case"number":t.write(n.toString());return;case"object":if(n==null){t.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:t,value:n});return}this.writeUnknownMap({writer:t,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:t,value:n}){if(n.length===0){t.write("new "),t.writeNode(Kt),t.write("<Object>()");return}t.write("new "),t.writeNode(Kt),t.write("<Object>("),t.writeNode(m.invokeMethod({on:It,method:"asList",arguments_:n.map(a=>r.unknown(a))})),t.write(")")}writeUnknownMap({writer:t,value:n}){let a=Object.entries(n);if(a.length===0){t.write("new "),t.writeNode(Et),t.write("<String, Object>()");return}t.writeLine("new "),t.writeNode(Et),t.write("<String, Object>() {{"),t.indent();for(let[i,s]of a)t.write(`put("${i}", `),t.writeNode(r.unknown(s)),t.writeLine(");");t.dedent(),t.write("}}")}writeUUID({writer:t,uuid:n}){t.writeNode(m.invokeMethod({on:nu,method:"fromString",arguments_:[r.string(n.value)]}))}escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},Kt=new C({name:"ArrayList",packageName:"java.util"}),eu=new C({name:"BigInteger",packageName:"java.math"}),Et=new C({name:"HashMap",packageName:"java.util"}),tu=new C({name:"HashSet",packageName:"java.util"}),Xd=new C({name:"List",packageName:"java.util"}),Qd=new C({name:"Map",packageName:"java.util"}),ru=new C({name:"OffsetDateTime",packageName:"java.time"}),em=new C({name:"Set",packageName:"java.util"}),nu=new C({name:"UUID",packageName:"java.util"});function au({parameters:r}){return r.filter(e=>!$.isNop(e.value))}function iu({parameters:r}){return r.filter(e=>!$.isNop(e.value))}function su({entries:r}){return r.filter(e=>!$.isNop(e.key)&&!$.isNop(e.value))}function ou({values:r}){return r.filter(e=>!$.isNop(e))}function St({writer:r,arguments_:e}){let t=cu(e);if(t.length===0){r.write("()");return}if(t.some(a=>a instanceof $&&!a.shouldWriteInLine())){uu({writer:r,arguments_:t});return}r.write("("),t.forEach((a,i)=>{i>0&&r.write(", "),Dn({writer:r,argument:a})}),r.write(")")}function uu({writer:r,arguments_:e}){r.writeLine("("),r.indent(),e.forEach((t,n)=>{n>0&&r.writeLine(","),Dn({writer:r,argument:t})}),r.dedent(),e.length>0&&r.newLine(),r.write(")")}function Dn({writer:r,argument:e}){zt(e)?r.writeNodeOrString(e.assignment):e.write(r)}function cu(r){return r.filter(e=>!(e instanceof $&&$.isNop(e)))}var je=class extends O{constructor({classReference:t,arguments_:n}){super();w(this,"classReference");w(this,"arguments_");this.classReference=t,this.arguments_=n}write(t){t.writeNode(this.classReference),St({writer:t,arguments_:this.arguments_})}};c();l();var Me=class extends O{constructor(t){super();w(this,"arg");this.arg=t}write(t){return new G(this.arg).write(t)}};c();l();var Fe=class extends O{constructor({name:t,access:n,parameters:a,body:i,static_:s,return_:o}){super();w(this,"name");w(this,"access");w(this,"parameters");w(this,"body");w(this,"return_");w(this,"static_");this.name=t,this.access=n,this.parameters=a,this.body=i,this.return_=o,this.static_=s!=null?s:!1}write(t){if(t.write(`${this.access} `),this.static_&&t.write("static "),this.return_!=null?t.writeNode(this.return_):t.write("void"),t.write(` ${this.name}`),this.parameters.length===0)t.write("()");else if(this.parameters.length===1){if(t.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);t.writeNode(this.parameters[0]),t.write(")")}else t.writeLine("("),t.indent(),this.parameters.forEach((n,a)=>{a>0&&t.writeLine(", "),t.writeNode(n)}),t.dedent(),t.write(")");if(this.body==null){t.write(";");return}t.writeLine(" {"),t.indent(),t.writeNode(this.body),t.writeNewLineIfLastLineNot(),t.dedent(),t.write("}")}};c();l();var Be=class extends O{constructor({method:t,arguments_:n,on:a}){super();w(this,"on");w(this,"method");w(this,"arguments_");this.on=a,this.method=t,this.arguments_=n}write(t){this.on.write(t),t.write("."),t.write(this.method),St({writer:t,arguments_:this.arguments_})}};c();l();var De=class extends O{constructor({name:t,type:n}){super();w(this,"name");w(this,"type");this.name=t,this.type=n}write(t){t.writeNode(this.type),t.write(` ${this.name}`)}};function lu(r){return new Me(r)}function fu(r){return new Pe(r)}function pu(r){return new C(r)}function du(r){return new je(r)}function mu(r){return new Be(r)}function hu(r){return new Fe(r)}function yu(r){return new De(r)}c();l();var Ct=class{constructor({context:e}){w(this,"context");this.context=e}isNopTypeLiteral(e){var n;return((n=e.internalType)==null?void 0:n.type)==="nop"}wrapInOptionalIfNotNop(e,t=!1){return this.isNopTypeLiteral(e)?e:m.TypeLiteral.optional({value:e,useOf:t})}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:L.Critical,message:"Expected non-null value, but got null"}),m.TypeLiteral.nop());if(e.value===void 0)return m.TypeLiteral.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value});case"literal":return this.convertLiteral({literal:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value});case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?m.TypeLiteral.nop():this.convertNamed({named:t,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion})}case"nullable":case"optional":{if(e.value===void 0||typeof e.value=="object"&&e.value!==null&&Object.keys(e.value).length===0&&e.typeReference.value.type==="named")return m.TypeLiteral.reference(m.invokeMethod({on:m.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(e.typeReference.value.type==="list"){let a=this.convertList({list:e.typeReference.value.value,value:e.value});return this.wrapInOptionalIfNotNop(a,!0)}let t=this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion}),n=e.as==="mapValue"||e.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(t,n)}case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value});case"unknown":return this.convertUnknown({value:e.value});default:E(e.typeReference)}}convertList({list:e,value:t}){if(!Array.isArray(t))return this.context.errors.add({severity:L.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop();let n=e.type==="optional"||e.type==="nullable";return m.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((a,i)=>{this.context.errors.scope({index:i});try{if(n){let s=this.convert({typeReference:e.value,value:a});return this.wrapInOptionalIfNotNop(s,!0)}return this.convert({typeReference:e,value:a})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:e,value:t}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.string(n)}default:E(e)}}convertSet({set:e,value:t}){return Array.isArray(t)?m.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((n,a)=>{this.context.errors.scope({index:a});try{return this.convert({typeReference:e,value:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:L.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop())}convertMap({map:e,value:t}){return typeof t!="object"||t==null?(this.context.errors.add({severity:L.Critical,message:`Expected object but got: ${t==null?"null":typeof t}`}),m.TypeLiteral.nop()):m.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(t).map(([n,a])=>{this.context.errors.scope(n);try{return{key:this.convert({typeReference:e.key,value:n,as:"mapKey"}),value:this.convert({typeReference:e.value,value:a,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:t,as:n,inUndiscriminatedUnion:a}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:t,as:n,inUndiscriminatedUnion:a});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:t});case"enum":return this.convertEnum({enum_:e,value:t});case"object":return this.convertObject({object_:e,value:t,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t});default:E(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:t}){let n=this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t});if(a==null)return m.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let s=this.context.resolveNamedType({typeId:i.typeId});return s==null?m.TypeLiteral.nop():m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:s,value:a.value})]}))}case"singleProperty":{let s=this.context.getRecord(a.value);if(s==null)return m.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:s[i.discriminantValue.wireValue]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:E(i)}}convertObject({object_:e,value:t,as:n}){var i;let a=this.context.associateByWireValue({parameters:e.properties,values:(i=this.context.getRecord(t))!=null?i:{}});return m.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),parameters:a.map(s=>{this.context.errors.scope(s.name.wireValue);try{return{name:this.context.getMethodName(s.name.name),value:this.convert({typeReference:s.typeReference,value:s.value,as:n})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:t}){let n=this.getEnumValueName({enum_:e,value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),value:n})}getEnumValueName({enum_:e,value:t}){if(typeof t!="string"){this.context.errors.add({severity:L.Critical,message:`Expected enum value string, got: ${typeof t}`});return}let n=e.values.find(a=>a.wireValue===t);if(n==null){this.context.errors.add({severity:L.Critical,message:`An enum value named "${t}" does not exist in this context`});return}return this.context.getEnumName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t});return n==null?m.TypeLiteral.nop():this.context.isPrimitive(n.valueTypeReference)?m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]})):m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t}){for(let n of e.types)try{let a=this.convert({typeReference:n,value:t,inUndiscriminatedUnion:!0});return{valueTypeReference:n,typeInstantiation:a}}catch(a){continue}this.context.errors.add({severity:L.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof t}" value`})}getUndiscriminatedUnionFieldName({typeReference:e}){switch(e.type){case"list":return this.getUndiscriminatedUnionFieldNameForList({list:e});case"literal":return this.getUndiscriminatedUnionFieldNameForLiteral({literal:e.value});case"map":return this.getUndiscriminatedUnionFieldNameForMap({map:e});case"named":{let t=this.context.resolveNamedType({typeId:e.value});return t==null?void 0:this.context.getClassName(t.declaration.name)}case"optional":return this.getUndiscriminatedUnionFieldNameForOptional({typeReference:e});case"nullable":return this.getUndiscriminatedUnionFieldNameForNullable({typeReference:e});case"primitive":return this.getUndiscriminatedUnionFieldNameForPrimitive({primitive:e.value});case"set":return this.getUndiscriminatedUnionFieldNameForSet({set:e});case"unknown":return"Unknown";default:E(e)}}getUndiscriminatedUnionFieldNameForList({list:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`ListOf${t}`}getUndiscriminatedUnionFieldNameForMap({map:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e.key});if(t==null)return;let n=this.getUndiscriminatedUnionFieldName({typeReference:e.value});if(n!=null)return`MapOf${t}To${n}`}getUndiscriminatedUnionFieldNameForOptional({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Optional${t}`}getUndiscriminatedUnionFieldNameForNullable({typeReference:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`Nullable${t}`}getUndiscriminatedUnionFieldNameForSet({set:e}){let t=this.getUndiscriminatedUnionFieldName({typeReference:e});if(t!=null)return`SetOf${t}`}getUndiscriminatedUnionFieldNameForLiteral({literal:e}){}getUndiscriminatedUnionFieldNameForPrimitive({primitive:e}){switch(e){case"INTEGER":case"UINT":return"Integer";case"LONG":case"UINT_64":return"Long";case"FLOAT":return"Float";case"DOUBLE":return"Double";case"BOOLEAN":return"Boolean";case"BIG_INTEGER":return"BigInteger";case"STRING":return"String";case"UUID":return"Uuid";case"DATE":return"Date";case"DATE_TIME":return"DateTime";case"BASE_64":return"Base64";default:E(e)}}convertUnknown({value:e}){return m.TypeLiteral.unknown(e)}convertPrimitive({primitive:e,value:t,as:n}){switch(e){case"INTEGER":case"UINT":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.integer(a)}case"LONG":case"UINT_64":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.long(a)}case"FLOAT":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.float(a)}case"DOUBLE":{let a=this.getValueAsNumber({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.double(a)}case"BOOLEAN":{let a=this.getValueAsBoolean({value:t,as:n});return a==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(a)}case"STRING":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.string(a)}case"DATE":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.string(a)}case"DATE_TIME":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.dateTime(a)}case"UUID":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.uuid(a)}case"BASE_64":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.bytes(a)}case"BIG_INTEGER":{let a=this.context.getValueAsString({value:t});return a==null?m.TypeLiteral.nop():m.TypeLiteral.bigInteger(a)}default:E(e)}}getValueAsNumber({value:e,as:t}){let n=t==="mapKey"&&typeof e=="string"?Number(e):e;return this.context.getValueAsNumber({value:n})}getValueAsBoolean({value:e,as:t}){let n=t==="mapKey"?typeof e=="string"?e==="true":e==="false"?!1:e:e;return this.context.getValueAsBoolean({value:n})}};c();l();var Lt=class{constructor({context:e}){w(this,"context");this.context=e}convert(e){switch(e.typeReference.type){case"list":return m.Type.list(this.convert({typeReference:e.typeReference}));case"literal":return this.convertLiteral({literal:e.typeReference.value});case"map":return m.Type.map(this.convert({typeReference:e.typeReference.key}),this.convert({typeReference:e.typeReference.value}));case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?this.convertUnknown():this.convertNamed({named:t})}case"optional":case"nullable":return m.Type.optional(this.convert({typeReference:e.typeReference.value}));case"primitive":return this.convertPrimitive({primitive:e.typeReference.value});case"set":return m.Type.set(this.convert({typeReference:e.typeReference}));case"unknown":return this.convertUnknown();default:E(e.typeReference)}}convertNamed({named:e}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference});case"enum":case"discriminatedUnion":case"object":case"undiscriminatedUnion":return m.Type.reference(m.classReference({name:this.context.getClassName(e.declaration.name),packageName:this.context.getTypesPackageName(e.declaration.fernFilepath)}));default:E(e)}}convertLiteral({literal:e}){switch(e.type){case"boolean":return m.Type.boolean();case"string":return m.Type.string()}}convertUnknown(){return m.Type.object()}convertPrimitive({primitive:e}){switch(e){case"INTEGER":return m.Type.integer();case"UINT":return m.Type.integer();case"LONG":return m.Type.long();case"UINT_64":return m.Type.long();case"FLOAT":return m.Type.float();case"DOUBLE":return m.Type.double();case"BOOLEAN":return m.Type.boolean();case"STRING":return m.Type.string();case"DATE":return m.Type.date();case"DATE_TIME":return m.Type.dateTime();case"UUID":return m.Type.uuid();case"BASE_64":return m.Type.bytes();case"BIG_INTEGER":return m.Type.bigInteger();default:E(e)}}};c();l();var Ot=class{constructor({context:e}){w(this,"context");this.context=e}getFilePropertyInfo({body:e,value:t}){var i;let n={fileFields:[],bodyPropertyFields:[]},a=(i=this.context.getRecord(t))!=null?i:{};for(let s of e.properties)switch(s.type){case"file":n.fileFields.push({name:this.context.getMethodName(s.name),value:this.getSingleFileProperty({property:s,record:a})});break;case"fileArray":n.fileFields.push({name:this.context.getMethodName(s.name),value:this.getArrayFileProperty({property:s,record:a})});break;case"bodyProperty":n.bodyPropertyFields.push({name:this.context.getMethodName(s.name.name),value:this.getBodyProperty({property:s,record:a})});break;default:E(s)}return n}getSingleFileProperty({property:e,record:t}){let n=this.context.getSingleFileValue({property:e,record:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.reference(this.context.getFileStreamFromString(n))}getArrayFileProperty({property:e,record:t}){let n=this.context.getFileArrayValues({property:e,record:t});if(n==null)return m.TypeLiteral.nop();for(let a of n)return m.TypeLiteral.reference(this.context.getFileStreamFromString(a));return m.TypeLiteral.nop()}getBodyProperty({property:e,record:t}){let n=t[e.name.wireValue];return n==null?m.TypeLiteral.nop():this.context.dynamicTypeLiteralMapper.convert({typeReference:e.typeReference,value:n})}};var xu=new Set(["enum","extends","package","void","short","class","abstract","return","import","for","assert","switch","getClass"]),Xt=class r extends it{constructor({ir:t,config:n,options:a}){var i;super({ir:t,config:n,options:a});w(this,"ir");w(this,"customConfig");w(this,"dynamicTypeMapper");w(this,"dynamicTypeLiteralMapper");w(this,"filePropertyMapper");this.ir=t,this.customConfig=Jt.parse((i=n.customConfig)!=null?i:{}),this.dynamicTypeMapper=new Lt({context:this}),this.dynamicTypeLiteralMapper=new Ct({context:this}),this.filePropertyMapper=new Ot({context:this})}clone(){return new r({ir:this.ir,config:this.config,options:this.options})}getClassName(t){return this.getName(t.pascalCase.safeName)}getEnumName(t){return this.getName(t.screamingSnakeCase.safeName)}getPropertyName(t){return this.getName(t.camelCase.safeName)}getMethodName(t){return this.getName(t.camelCase.safeName)}getRootClientClassReference(){return m.classReference({name:this.getRootClientClassName(),packageName:this.getRootPackageName()})}getRootClientClassName(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["client-class-name"])!=null?n:`${this.getBaseNamePrefix()}Client`}getEnvironmentClassName(){return"Environment"}getEnvironmentTypeReferenceFromID(t){let n=this.resolveEnvironmentName(t);if(n!=null)return m.codeblock(a=>{a.writeNode(this.getEnvironmentClassReference()),a.write("."),a.write(this.getEnumName(n))})}getEnvironmentClassReference(){return m.classReference({name:this.getEnvironmentClassName(),packageName:this.getCorePackageName()})}getJavaClassReferenceFromDeclaration({declaration:t}){return m.classReference({name:t.name.pascalCase.unsafeName,packageName:this.getTypesPackageName(t.fernFilepath)})}getNullableClassReference(){return m.classReference({name:"Nullable",packageName:this.getCorePackageName()})}getNullableOfNull(){return m.TypeLiteral.reference(m.invokeMethod({on:this.getNullableClassReference(),method:"ofNull",arguments_:[]}))}getFileStreamFromString(t){return m.TypeLiteral.reference(m.codeblock(n=>{n.write("new "),n.writeNode(this.getFileStreamClassReference()),n.write("("),n.writeNode(this.getByteArrayInputStreamClassReference()),n.write("("),n.writeNode(m.TypeLiteral.string(t)),n.write(".getBytes("),n.writeNode(this.getStandardCharsetsClassReference()),n.write(".UTF_8)))")}))}getFileStreamClassReference(){return m.classReference({name:"FileStream",packageName:this.getCorePackageName()})}getByteArrayInputStreamClassReference(){return m.classReference({name:"ByteArrayInputStream",packageName:"java.io"})}getStandardCharsetsClassReference(){return m.classReference({name:"StandardCharsets",packageName:"java.nio.charset"})}isPrimitive(t){switch(t.type){case"primitive":return!0;case"optional":case"nullable":return this.isPrimitive(t.value);case"named":{let n=this.resolveNamedType({typeId:t.value});if(n==null)return!1;switch(n.type){case"alias":return this.isPrimitive(n.typeReference);case"discriminatedUnion":case"undiscriminatedUnion":case"object":case"enum":return!1;default:E(n)}break}case"list":case"set":case"map":case"literal":case"unknown":return!1;default:E(t)}}getRootPackageName(){let t=this.getPackagePrefixTokens();return this.joinPackageTokens(t)}getCorePackageName(){let t=this.getPackagePrefixTokens();return t.push("core"),this.joinPackageTokens(t)}getTypesPackageName(t){return this.getResourcesPackage(t,"types")}getRequestsPackageName(t){return this.getPackageLayout()==="flat"?this.getTypesPackageName(t):this.getResourcesPackage(t,"requests")}getResourcesPackage(t,n){let a=this.getPackagePrefixTokens();switch(this.getPackageLayout()){case"flat":t!=null&&a.push(...t.packagePath.map(i=>this.getPackageNameSegment(i)));break;case"nested":default:t!=null&&t.allParts.length>0&&a.push("resources"),t!=null&&a.push(...t.allParts.map(i=>this.getPackageNameSegment(i)))}return n!=null&&a.push(n),this.joinPackageTokens(a)}getPackageName(t,n){let a=this.getPackageNameSegments(t);return a=n!=null?[...a,n]:a,[...this.getPackagePrefixTokens(),...a].join(".")}getPackageLayout(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["package-layout"])!=null?n:"nested"}shouldInlinePathParameters(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["inline-path-parameters"])!=null?n:!1}shouldInlineFileProperties(){var t,n;return(n=(t=this.customConfig)==null?void 0:t["inline-file-properties"])!=null?n:!1}getPackageNameSegments(t){return t.packagePath.map(n=>this.getPackageNameSegment(n))}getPackageNameSegment(t){return t.camelCase.safeName.toLowerCase()}getPackagePrefixTokens(){var n;if(((n=this.customConfig)==null?void 0:n["package-prefix"])!=null)return this.customConfig["package-prefix"].split(".");let t=[];return t.push("com"),t.push(...this.splitOnNonAlphaNumericChar(this.config.organization)),t.push(...this.splitOnNonAlphaNumericChar(this.getApiName())),t}getBaseNamePrefix(){return this.convertKebabCaseToUpperCamelCase(this.config.organization)+this.convertKebabCaseToUpperCamelCase(this.getApiName())}getApiName(){return Zt(this.config.workspaceName)}startsWithNumber(t){return/^\d/.test(t)}splitOnNonAlphaNumericChar(t){return t.split(/[^a-zA-Z0-9]/)}convertKebabCaseToUpperCamelCase(t){return t.replace(/-([a-z])/g,(n,a)=>a.toUpperCase()).replace(/^[a-z]/,n=>n.toUpperCase())}joinPackageTokens(t){return t.map(a=>this.startsWithNumber(a)?"_"+a:a).join(".")}getName(t){return this.isReservedName(t)?"_"+t:t}isReservedName(t){return xu.has(t)}};0&&(module.exports={DynamicSnippetsGeneratorContext});
16
20
  /*! Bundled license information:
17
21
 
18
22
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -34,3 +38,4 @@ lodash-es/lodash.js:
34
38
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
35
39
  *)
36
40
  */
41
+ //# sourceMappingURL=DynamicSnippetsGeneratorContext.cjs.map