@tsed/schema 7.10.0-rc.5 → 7.10.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see schema.umd.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@tsed/core")):"function"==typeof define&&define.amd?define(["@tsed/core"],t):"object"==typeof exports?exports.schema=t(require("@tsed/core")):e.schema=t(e["@tsed/core"])}(self,(e=>(()=>{var t={737:(e,t,r)=>{"use strict";var n=r(34),o=r(235),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},235:(e,t,r)=>{"use strict";var n=r(156),o=r(34),i=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),a=o("%Reflect.apply%",!0)||n.call(s,i),c=o("%Object.getOwnPropertyDescriptor%",!0),p=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(p)try{p({},"a",{value:1})}catch(e){p=null}e.exports=function(e){var t=a(n,s,arguments);if(c&&p){var r=c(t,"length");r.configurable&&p(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var l=function(){return a(n,i,arguments)};p?p(e.exports,"apply",{value:l}):e.exports.apply=l},34:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var p=function(){throw new s},u=c?function(){try{return p}catch(e){try{return c(arguments,"callee").get}catch(e){return p}}}():p,l=r(465)(),h=Object.getPrototypeOf||function(e){return e.__proto__},f={},y="undefined"==typeof Uint8Array?n:h(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},m=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=h(o.prototype))}return d[t]=r,r},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(156),v=r(776),S=b.call(Function.call,Array.prototype.concat),O=b.call(Function.apply,Array.prototype.splice),A=b.call(Function.call,String.prototype.replace),E=b.call(Function.call,String.prototype.slice),w=b.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,x=function(e){var t=E(e,0,1),r=E(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(e,T,(function(e,t,r,o){n[n.length]=r?A(o,R,"$1"):t||e})),n},P=function(e,t){var r,n=e;if(v(g,n)&&(n="%"+(r=g[n])[0]+"%"),v(d,n)){var i=d[n];if(i===f&&(i=m(n)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===w(/^%?[^%]*%?$/g,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=x(e),n=r.length>0?r[0]:"",i=P("%"+n+"%",t),a=i.name,p=i.value,u=!1,l=i.alias;l&&(n=l[0],O(r,S([0,1],l)));for(var h=1,f=!0;h<r.length;h+=1){var y=r[h],m=E(y,0,1),g=E(y,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new o("property names with quotes must have matching quotes");if("constructor"!==y&&f||(u=!0),v(d,a="%"+(n+="."+y)+"%"))p=d[a];else if(null!=p){if(!(y in p)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&h+1>=r.length){var b=c(p,y);p=(f=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:p[y]}else f=v(p,y),p=p[y];f&&!u&&(d[a]=p)}}return p}},147:e=>{function t(e){if(e)return function(e){for(var r in t.prototype)e[r]=t.prototype[r];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},641:e=>{e.exports=s,s.default=s,s.stable=u,s.stableStringify=u;var t="[...]",r="[Circular]",n=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=i()),c(e,"",0,[],void 0,0,s);try{a=0===o.length?JSON.stringify(e,t,r):JSON.stringify(e,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var p=n.pop();4===p.length?Object.defineProperty(p[0],p[1],p[3]):p[0][p[1]]=p[2]}}return a}function a(e,t,r,i){var s=Object.getOwnPropertyDescriptor(i,r);void 0!==s.get?s.configurable?(Object.defineProperty(i,r,{value:e}),n.push([i,r,t,s])):o.push([t,r,e]):(i[r]=e,n.push([i,r,t]))}function c(e,n,o,i,s,p,u){var l;if(p+=1,"object"==typeof e&&null!==e){for(l=0;l<i.length;l++)if(i[l]===e)return void a(r,e,n,s);if(void 0!==u.depthLimit&&p>u.depthLimit)return void a(t,e,n,s);if(void 0!==u.edgesLimit&&o+1>u.edgesLimit)return void a(t,e,n,s);if(i.push(e),Array.isArray(e))for(l=0;l<e.length;l++)c(e[l],l,l,i,e,p,u);else{var h=Object.keys(e);for(l=0;l<h.length;l++){var f=h[l];c(e[f],f,l,i,e,p,u)}}i.pop()}}function p(e,t){return e<t?-1:e>t?1:0}function u(e,t,r,s){void 0===s&&(s=i());var a,c=l(e,"",0,[],void 0,0,s)||e;try{a=0===o.length?JSON.stringify(c,t,r):JSON.stringify(c,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var p=n.pop();4===p.length?Object.defineProperty(p[0],p[1],p[3]):p[0][p[1]]=p[2]}}return a}function l(e,o,i,s,c,u,h){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<s.length;f++)if(s[f]===e)return void a(r,e,o,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==h.depthLimit&&u>h.depthLimit)return void a(t,e,o,c);if(void 0!==h.edgesLimit&&i+1>h.edgesLimit)return void a(t,e,o,c);if(s.push(e),Array.isArray(e))for(f=0;f<e.length;f++)l(e[f],f,f,s,e,u,h);else{var y={},d=Object.keys(e).sort(p);for(f=0;f<d.length;f++){var m=d[f];l(e[m],m,f,s,e,u,h),y[m]=e[m]}if(void 0===c)return y;n.push([c,o,e]),c[o]=y}s.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(o.length>0)for(var n=0;n<o.length;n++){var i=o[n];if(i[1]===t&&i[0]===r){r=i[2],o.splice(n,1);break}}return e.call(this,t,r)}}},521:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(t+i);for(var s,a=r.call(arguments,1),c=function(){if(this instanceof s){var t=i.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return i.apply(e,a.concat(r.call(arguments)))},p=Math.max(0,i.length-a.length),u=[],l=0;l<p;l++)u.push("$"+l);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var h=function(){};h.prototype=i.prototype,s.prototype=new h,h.prototype=null}return s}},156:(e,t,r)=>{"use strict";var n=r(521);e.exports=Function.prototype.bind||n},465:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(73);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},73:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},776:(e,t,r)=>{"use strict";var n=r(156);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},379:e=>{"use strict";const t="\\\\/",r=`[^${t}]`,n="\\.",o="\\/",i="[^/]",s=`(?:${o}|$)`,a=`(?:^|${o})`,c=`${n}{1,2}${s}`,p={DOT_LITERAL:n,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:s,DOTS_SLASH:c,NO_DOT:`(?!${n})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${n}{0,1}${s})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${i}*?`,START_ANCHOR:a,SEP:"/"},u={...p,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?u:p}},390:(e,t,r)=>{"use strict";const n=r(379),o=r(290),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:p}=n,u=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>o.escapeRegex(e))).join("..")}return r},l=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,h=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=p[e]||e;const r={...t},h="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let f=e.length;if(f>h)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${h}`);const y={type:"bos",value:"",output:r.prepend||""},d=[y],m=r.capture?"":"?:",g=n.globChars(r.windows),b=n.extglobChars(g),{DOT_LITERAL:v,PLUS_LITERAL:S,SLASH_LITERAL:O,ONE_CHAR:A,DOTS_SLASH:E,NO_DOT:w,NO_DOT_SLASH:T,NO_DOTS_SLASH:R,QMARK:x,QMARK_NO_DOT:P,STAR:_,START_ANCHOR:C}=g,j=e=>`(${m}(?:(?!${C}${e.dot?E:v}).)*?)`,M=r.dot?"":w,N=r.dot?x:P;let k=!0===r.bash?j(r):_;r.capture&&(k=`(${k})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const $={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:d};e=o.removePrefix(e,$),f=e.length;const I=[],D=[],L=[];let H,U=y;const F=()=>$.index===f-1,q=$.peek=(t=1)=>e[$.index+t],G=$.advance=()=>e[++$.index],B=()=>e.slice($.index+1),J=(e="",t=0)=>{$.consumed+=e,$.index+=t},K=e=>{$.output+=null!=e.output?e.output:e.value,J(e.value)},W=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)G(),$.start++,e++;return e%2!=0&&($.negated=!0,$.start++,!0)},z=e=>{$[e]++,L.push(e)},V=e=>{$[e]--,L.pop()},X=e=>{if("globstar"===U.type){const t=$.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||I.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||($.output=$.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=k,$.output+=U.output)}if(I.length&&"paren"!==e.type&&!b[e.value]&&(I[I.length-1].inner+=e.value),(e.value||e.output)&&K(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,d.push(e),U=e},Q=(e,t)=>{const n={...b[t],conditions:1,inner:""};n.prev=U,n.parens=$.parens,n.output=$.output;const o=(r.capture?"(":"")+n.open;z("parens"),X({type:e,value:t,output:$.output?"":A}),X({type:"paren",extglob:!0,value:G(),output:o}),I.push(n)},Z=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let n=k;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=j(r)),(n!==k||F()||/^\)+$/.test(B()))&&(t=e.close=`)$))${n}`),"bos"===e.prev.type&&F()&&($.negatedExtglob=!0)}X({type:"paren",extglob:!0,value:H,output:t}),V("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(c,((e,t,r,o,i,s)=>"\\"===o?(n=!0,e):"?"===o?t?t+o+(i?x.repeat(i.length):""):0===s?N+(i?x.repeat(i.length):""):x.repeat(r.length):"."===o?v.repeat(r.length):"*"===o?t?t+o+(i?k:""):k:t?e:`\\${e}`));return!0===n&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?($.output=e,$):($.output=o.wrapOutput(i,$,t),$)}for(;!F();){if(H=G(),"\0"===H)continue;if("\\"===H){const e=q();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",X({type:"text",value:H});continue}const t=/^\\+/.exec(B());let n=0;if(t&&t[0].length>2&&(n=t[0].length,$.index+=n,n%2!=0&&(H+="\\")),!0===r.unescape?H=G()||"":H+=G()||"",0===$.brackets){X({type:"text",value:H});continue}}if($.brackets>0&&("]"!==H||"["===U.value||"[^"===U.value)){if(!1!==r.posix&&":"===H){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),r=U.value.slice(e+2),n=s[r];if(n){U.value=t+n,$.backtrack=!0,G(),y.output||1!==d.indexOf(U)||(y.output=A);continue}}}("["===H&&":"!==q()||"-"===H&&"]"===q())&&(H=`\\${H}`),"]"!==H||"["!==U.value&&"[^"!==U.value||(H=`\\${H}`),!0===r.posix&&"!"===H&&"["===U.value&&(H="^"),U.value+=H,K({value:H});continue}if(1===$.quotes&&'"'!==H){H=o.escapeRegex(H),U.value+=H,K({value:H});continue}if('"'===H){$.quotes=1===$.quotes?0:1,!0===r.keepQuotes&&X({type:"text",value:H});continue}if("("===H){z("parens"),X({type:"paren",value:H});continue}if(")"===H){if(0===$.parens&&!0===r.strictBrackets)throw new SyntaxError(l("opening","("));const e=I[I.length-1];if(e&&$.parens===e.parens+1){Z(I.pop());continue}X({type:"paren",value:H,output:$.parens?")":"\\)"}),V("parens");continue}if("["===H){if(!0!==r.nobracket&&B().includes("]"))z("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(l("closing","]"));H=`\\${H}`}X({type:"bracket",value:H});continue}if("]"===H){if(!0===r.nobracket||U&&"bracket"===U.type&&1===U.value.length){X({type:"text",value:H,output:`\\${H}`});continue}if(0===$.brackets){if(!0===r.strictBrackets)throw new SyntaxError(l("opening","["));X({type:"text",value:H,output:`\\${H}`});continue}V("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),U.value+=H,K({value:H}),!1===r.literalBrackets||o.hasRegexChars(e))continue;const t=o.escapeRegex(U.value);if($.output=$.output.slice(0,-U.value.length),!0===r.literalBrackets){$.output+=t,U.value=t;continue}U.value=`(${m}${t}|${U.value})`,$.output+=U.value;continue}if("{"===H&&!0!==r.nobrace){z("braces");const e={type:"brace",value:H,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};D.push(e),X(e);continue}if("}"===H){const e=D[D.length-1];if(!0===r.nobrace||!e){X({type:"text",value:H,output:H});continue}let t=")";if(!0===e.dots){const e=d.slice(),n=[];for(let t=e.length-1;t>=0&&(d.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=u(n,r),$.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=$.output.slice(0,e.outputIndex),n=$.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",$.output=r;for(const e of n)$.output+=e.output||e.value}X({type:"brace",value:H,output:t}),V("braces"),D.pop();continue}if("|"===H){I.length>0&&I[I.length-1].conditions++,X({type:"text",value:H});continue}if(","===H){let e=H;const t=D[D.length-1];t&&"braces"===L[L.length-1]&&(t.comma=!0,e="|"),X({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===U.type&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",d.pop(),U=y;continue}X({type:"slash",value:H,output:O});continue}if("."===H){if($.braces>0&&"dot"===U.type){"."===U.value&&(U.output=v);const e=D[D.length-1];U.type="dots",U.output+=H,U.value+=H,e.dots=!0;continue}if($.braces+$.parens===0&&"bos"!==U.type&&"slash"!==U.type){X({type:"text",value:H,output:v});continue}X({type:"dot",value:H,output:v});continue}if("?"===H){if((!U||"("!==U.value)&&!0!==r.noextglob&&"("===q()&&"?"!==q(2)){Q("qmark",H);continue}if(U&&"paren"===U.type){const e=q();let t=H;if("<"===e&&!o.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(B()))&&(t=`\\${H}`),X({type:"text",value:H,output:t});continue}if(!0!==r.dot&&("slash"===U.type||"bos"===U.type)){X({type:"qmark",value:H,output:P});continue}X({type:"qmark",value:H,output:x});continue}if("!"===H){if(!0!==r.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){Q("negate",H);continue}if(!0!==r.nonegate&&0===$.index){W();continue}}if("+"===H){if(!0!==r.noextglob&&"("===q()&&"?"!==q(2)){Q("plus",H);continue}if(U&&"("===U.value||!1===r.regex){X({type:"plus",value:H,output:S});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||$.parens>0){X({type:"plus",value:H});continue}X({type:"plus",value:S});continue}if("@"===H){if(!0!==r.noextglob&&"("===q()&&"?"!==q(2)){X({type:"at",extglob:!0,value:H,output:""});continue}X({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=a.exec(B());e&&(H+=e[0],$.index+=e[0].length),X({type:"text",value:H});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=H,U.output=k,$.backtrack=!0,$.globstar=!0,J(H);continue}let t=B();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",H);continue}if("star"===U.type){if(!0===r.noglobstar){J(H);continue}const n=U.prev,o=n.prev,i="slash"===n.type||"bos"===n.type,s=o&&("star"===o.type||"globstar"===o.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){X({type:"star",value:H,output:""});continue}const a=$.braces>0&&("comma"===n.type||"brace"===n.type),c=I.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!a&&!c){X({type:"star",value:H,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[$.index+4];if(r&&"/"!==r)break;t=t.slice(3),J("/**",3)}if("bos"===n.type&&F()){U.type="globstar",U.value+=H,U.output=j(r),$.output=U.output,$.globstar=!0,J(H);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!s&&F()){$.output=$.output.slice(0,-(n.output+U.output).length),n.output=`(?:${n.output}`,U.type="globstar",U.output=j(r)+(r.strictSlashes?")":"|$)"),U.value+=H,$.globstar=!0,$.output+=n.output+U.output,J(H);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";$.output=$.output.slice(0,-(n.output+U.output).length),n.output=`(?:${n.output}`,U.type="globstar",U.output=`${j(r)}${O}|${O}${e})`,U.value+=H,$.output+=n.output+U.output,$.globstar=!0,J(H+G()),X({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){U.type="globstar",U.value+=H,U.output=`(?:^|${O}|${j(r)}${O})`,$.output=U.output,$.globstar=!0,J(H+G()),X({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-U.output.length),U.type="globstar",U.output=j(r),U.value+=H,$.output+=U.output,$.globstar=!0,J(H);continue}const n={type:"star",value:H,output:k};!0!==r.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==r.regex?($.index!==$.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?($.output+=T,U.output+=T):!0===r.dot?($.output+=R,U.output+=R):($.output+=M,U.output+=M),"*"!==q()&&($.output+=A,U.output+=A)),X(n)):(n.output=H,X(n)):(n.output=".*?","bos"!==U.type&&"slash"!==U.type||(n.output=M+n.output),X(n))}for(;$.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(l("closing","]"));$.output=o.escapeLast($.output,"["),V("brackets")}for(;$.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(l("closing",")"));$.output=o.escapeLast($.output,"("),V("parens")}for(;$.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(l("closing","}"));$.output=o.escapeLast($.output,"{"),V("braces")}if(!0===r.strictSlashes||"star"!==U.type&&"bracket"!==U.type||X({type:"maybe_slash",value:"",output:`${O}?`}),!0===$.backtrack){$.output="";for(const e of $.tokens)$.output+=null!=e.output?e.output:e.value,e.suffix&&($.output+=e.suffix)}return $};h.fastpaths=(e,t)=>{const r={...t},s="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>s)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${s}`);e=p[e]||e;const{DOT_LITERAL:c,SLASH_LITERAL:u,ONE_CHAR:l,DOTS_SLASH:h,NO_DOT:f,NO_DOTS:y,NO_DOTS_SLASH:d,STAR:m,START_ANCHOR:g}=n.globChars(r.windows),b=r.dot?y:f,v=r.dot?d:f,S=r.capture?"":"?:";let O=!0===r.bash?".*?":m;r.capture&&(O=`(${O})`);const A=e=>!0===e.noglobstar?O:`(${S}(?:(?!${g}${e.dot?h:c}).)*?)`,E=e=>{switch(e){case"*":return`${b}${l}${O}`;case".*":return`${c}${l}${O}`;case"*.*":return`${b}${O}${c}${l}${O}`;case"*/*":return`${b}${O}${u}${l}${v}${O}`;case"**":return b+A(r);case"**/*":return`(?:${b}${A(r)}${u})?${v}${l}${O}`;case"**/*.*":return`(?:${b}${A(r)}${u})?${v}${O}${c}${l}${O}`;case"**/.*":return`(?:${b}${A(r)}${u})?${c}${l}${O}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=E(t[1]);if(!r)return;return r+c+t[2]}}},w=o.removePrefix(e,{negated:!1,prefix:""});let T=E(w);return T&&!0!==r.strictSlashes&&(T+=`${u}?`),T},e.exports=h},555:(e,t,r)=>{"use strict";const n=r(270),o=r(390),i=r(290),s=r(379),a=(e,t,r=!1)=>{if(Array.isArray(e)){const n=e.map((e=>a(e,t,r))),o=e=>{for(const t of n){const r=t(e);if(r)return r}return!1};return o}const n=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!n)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},s=i.windows,c=n?a.compileRe(e,t):a.makeRe(e,t,!1,!0),p=c.state;delete c.state;let u=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};u=a(i.ignore,e,r)}const l=(r,n=!1)=>{const{isMatch:o,match:l,output:h}=a.test(r,c,t,{glob:e,posix:s}),f={glob:e,state:p,regex:c,posix:s,input:r,output:h,match:l,isMatch:o};return"function"==typeof i.onResult&&i.onResult(f),!1===o?(f.isMatch=!1,!!n&&f):u(r)?("function"==typeof i.onIgnore&&i.onIgnore(f),f.isMatch=!1,!!n&&f):("function"==typeof i.onMatch&&i.onMatch(f),!n||f)};return r&&(l.state=p),l};a.test=(e,t,r,{glob:n,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const s=r||{},c=s.format||(o?i.toPosixSlashes:null);let p=e===n,u=p&&c?c(e):e;return!1===p&&(u=c?c(e):e,p=u===n),!1!==p&&!0!==s.capture||(p=!0===s.matchBase||!0===s.basename?a.matchBase(e,t,r,o):t.exec(u)),{isMatch:Boolean(p),match:p,output:u}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map((e=>a.parse(e,t))):o(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;const o=t||{},i=o.contains?"":"^",s=o.contains?"":"$";let c=`${i}(?:${e.output})${s}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const p=a.toRegex(c,t);return!0===n&&(p.state=e),p},a.makeRe=(e,t,r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let s,c={negated:!1,fastpaths:!0},p="";return e.startsWith("./")&&(e=e.slice(2),p=c.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(s=o.fastpaths(e,t)),void 0===s?(c=o(e,t),c.prefix=p+(c.prefix||"")):c.output=s,a.compileRe(c,t,r,n)},a.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=s,e.exports=a},270:(e,t,r)=>{"use strict";const n=r(290),{CHAR_ASTERISK:o,CHAR_AT:i,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:p,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:l,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:y,CHAR_QUESTION_MARK:d,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:b}=r(379),v=e=>e===u||e===s,S=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},O=e.length-1,A=!0===r.parts||!0===r.scanToEnd,E=[],w=[],T=[];let R,x,P=e,_=-1,C=0,j=0,M=!1,N=!1,k=!1,$=!1,I=!1,D=!1,L=!1,H=!1,U=!1,F=0,q={value:"",depth:0,isGlob:!1};const G=()=>_>=O,B=()=>(R=x,P.charCodeAt(++_));for(;_<O;){let e;if(x=B(),x!==s){if(!0===D||x===l){for(F++;!0!==G()&&(x=B());)if(x!==s)if(x!==l){if(!0!==D&&x===c&&(x=B())===c){if(M=q.isBrace=!0,k=q.isGlob=!0,U=!0,!0===A)continue;break}if(!0!==D&&x===a){if(M=q.isBrace=!0,k=q.isGlob=!0,U=!0,!0===A)continue;break}if(x===m&&(F--,0===F)){D=!1,M=q.isBrace=!0,U=!0;break}}else F++;else L=q.backslashes=!0,B();if(!0===A)continue;break}if(x!==u){if(!0!==r.noext&&!0==(x===y||x===i||x===o||x===d||x===p)&&P.charCodeAt(_+1)===h){if(k=q.isGlob=!0,$=q.isExtglob=!0,U=!0,!0===A){for(;!0!==G()&&(x=B());)if(x!==s){if(x===g){k=q.isGlob=!0,U=!0;break}}else L=q.backslashes=!0,x=B();continue}break}if(x===o){if(R===o&&(I=q.isGlobstar=!0),k=q.isGlob=!0,U=!0,!0===A)continue;break}if(x===d){if(k=q.isGlob=!0,U=!0,!0===A)continue;break}if(x===f)for(;!0!==G()&&(e=B());)if(e!==s){if(e===b){if(N=q.isBracket=!0,k=q.isGlob=!0,U=!0,!0===A)continue;break}}else L=q.backslashes=!0,B();if(!0===r.nonegate||x!==p||_!==C){if(!0!==r.noparen&&x===h){if(k=q.isGlob=!0,!0===A){for(;!0!==G()&&(x=B());)if(x!==h){if(x===g){U=!0;break}}else L=q.backslashes=!0,x=B();continue}break}if(!0===k){if(U=!0,!0===A)continue;break}}else H=q.negated=!0,C++}else{if(E.push(_),w.push(q),q={value:"",depth:0,isGlob:!1},!0===U)continue;if(R===c&&_===C+1){C+=2;continue}j=_+1}}else L=q.backslashes=!0,x=B(),x===l&&(D=!0)}!0===r.noext&&($=!1,k=!1);let J=P,K="",W="";C>0&&(K=P.slice(0,C),P=P.slice(C),j-=C),J&&!0===k&&j>0?(J=P.slice(0,j),W=P.slice(j)):!0===k?(J="",W=P):J=P,J&&""!==J&&"/"!==J&&J!==P&&v(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),!0===r.unescape&&(W&&(W=n.removeBackslashes(W)),J&&!0===L&&(J=n.removeBackslashes(J)));const z={prefix:K,input:e,start:C,base:J,glob:W,isBrace:M,isBracket:N,isGlob:k,isExtglob:$,isGlobstar:I,negated:H};if(!0===r.tokens&&(z.maxDepth=0,v(x)||w.push(q),z.tokens=w),!0===r.parts||!0===r.tokens){let t;for(let n=0;n<E.length;n++){const o=t?t+1:C,i=E[n],s=e.slice(o,i);r.tokens&&(0===n&&0!==C?(w[n].isPrefix=!0,w[n].value=K):w[n].value=s,S(w[n]),z.maxDepth+=w[n].depth),0===n&&""===s||T.push(s),t=i}if(t&&t+1<e.length){const n=e.slice(t+1);T.push(n),r.tokens&&(w[w.length-1].value=n,S(w[w.length-1]),z.maxDepth+=w[w.length-1].depth)}z.slashes=E,z.parts=T}return z}},290:(e,t,r)=>{"use strict";const{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:s}=r(379);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>i.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(s,"\\$1"),t.toPosixSlashes=e=>e.replace(n,"/"),t.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.escapeLast=(e,r,n)=>{const o=e.lastIndexOf(r,n);return-1===o?e:"\\"===e[o-1]?t.escapeLast(e,r,o-1):`${e.slice(0,o)}\\${e.slice(o)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let n=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(n=`(?:^(?!${n}).*$)`),n},t.basename=(e,{windows:t}={})=>t?e.replace(/[\\/]$/,"").replace(/.*[\\/]/,""):e.replace(/\/$/,"").replace(/.*\//,"")},870:(e,t,r)=>{"use strict";e.exports=r(555)},490:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},348:(e,t,r)=>{"use strict";var n=r(530),o=r(429),i=r(490);e.exports={formats:i,parse:o,stringify:n}},429:(e,t,r)=>{"use strict";var n=r(422),o=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},p=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(i),p=a?i.slice(0,a.index):i,u=[];if(p){if(!r.plainObjects&&o.call(Object.prototype,p)&&!r.allowPrototypes)return;u.push(p)}for(var l=0;r.depth>0&&null!==(a=s.exec(i))&&l<r.depth;){if(l+=1,!r.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+i.slice(a.index)+"]"),function(e,t,r,n){for(var o=n?t:c(t,r),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var p="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(p,10);r.parseArrays||""!==p?!isNaN(u)&&a!==p&&String(u)===p&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=o:"__proto__"!==p&&(s[p]=o):s={0:o}}o=s}return o}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,p={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,l=t.parameterLimit===1/0?void 0:t.parameterLimit,h=u.split(t.delimiter,l),f=-1,y=t.charset;if(t.charsetSentinel)for(r=0;r<h.length;++r)0===h[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[r]?y="utf-8":"utf8=%26%2310003%3B"===h[r]&&(y="iso-8859-1"),f=r,r=h.length);for(r=0;r<h.length;++r)if(r!==f){var d,m,g=h[r],b=g.indexOf("]="),v=-1===b?g.indexOf("="):b+1;-1===v?(d=t.decoder(g,s.decoder,y,"key"),m=t.strictNullHandling?null:""):(d=t.decoder(g.slice(0,v),s.decoder,y,"key"),m=n.maybeMap(c(g.slice(v+1),t),(function(e){return t.decoder(e,s.decoder,y,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===y&&(m=a(m)),g.indexOf("[]=")>-1&&(m=i(m)?[m]:m),o.call(p,d)?p[d]=n.combine(p[d],m):p[d]=m}return p}(e,r):e,l=r.plainObjects?Object.create(null):{},h=Object.keys(u),f=0;f<h.length;++f){var y=h[f],d=p(y,u[y],r,"string"==typeof e);l=n.merge(l,d,r)}return!0===r.allowSparse?l:n.compact(l)}},530:(e,t,r)=>{"use strict";var n=r(538),o=r(422),i=r(490),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,p=String.prototype.split,u=Array.prototype.push,l=function(e,t){u.apply(e,c(t)?t:[t])},h=Date.prototype.toISOString,f=i.default,y={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return h.call(e)},skipNulls:!1,strictNullHandling:!1},d={},m=function e(t,r,i,s,a,u,h,f,m,g,b,v,S,O,A){for(var E,w=t,T=A,R=0,x=!1;void 0!==(T=T.get(d))&&!x;){var P=T.get(t);if(R+=1,void 0!==P){if(P===R)throw new RangeError("Cyclic object value");x=!0}void 0===T.get(d)&&(R=0)}if("function"==typeof h?w=h(r,w):w instanceof Date?w=g(w):"comma"===i&&c(w)&&(w=o.maybeMap(w,(function(e){return e instanceof Date?g(e):e}))),null===w){if(s)return u&&!S?u(r,y.encoder,O,"key",b):r;w=""}if("string"==typeof(E=w)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||o.isBuffer(w)){if(u){var _=S?r:u(r,y.encoder,O,"key",b);if("comma"===i&&S){for(var C=p.call(String(w),","),j="",M=0;M<C.length;++M)j+=(0===M?"":",")+v(u(C[M],y.encoder,O,"value",b));return[v(_)+"="+j]}return[v(_)+"="+v(u(w,y.encoder,O,"value",b))]}return[v(r)+"="+v(String(w))]}var N,k=[];if(void 0===w)return k;if("comma"===i&&c(w))N=[{value:w.length>0?w.join(",")||null:void 0}];else if(c(h))N=h;else{var $=Object.keys(w);N=f?$.sort(f):$}for(var I=0;I<N.length;++I){var D=N[I],L="object"==typeof D&&void 0!==D.value?D.value:w[D];if(!a||null!==L){var H=c(w)?"function"==typeof i?i(r,D):r:r+(m?"."+D:"["+D+"]");A.set(t,R);var U=n();U.set(d,A),l(k,e(L,H,i,s,a,u,h,f,m,g,b,v,S,O,U))}}return k};e.exports=function(e,t){var r,o=e,p=function(e){if(!e)return y;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||y.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],o=y.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:y.addQueryPrefix,allowDots:void 0===e.allowDots?y.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:y.charsetSentinel,delimiter:void 0===e.delimiter?y.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:y.encode,encoder:"function"==typeof e.encoder?e.encoder:y.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:y.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:y.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:y.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:y.strictNullHandling}}(t);"function"==typeof p.filter?o=(0,p.filter)("",o):c(p.filter)&&(r=p.filter);var u,h=[];if("object"!=typeof o||null===o)return"";u=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=a[u];r||(r=Object.keys(o)),p.sort&&r.sort(p.sort);for(var d=n(),g=0;g<r.length;++g){var b=r[g];p.skipNulls&&null===o[b]||l(h,m(o[b],b,f,p.strictNullHandling,p.skipNulls,p.encode?p.encoder:null,p.filter,p.sort,p.allowDots,p.serializeDate,p.format,p.formatter,p.encodeValuesOnly,p.charset,d))}var v=h.join(p.delimiter),S=!0===p.addQueryPrefix?"?":"";return p.charsetSentinel&&("iso-8859-1"===p.charset?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),v.length>0?S+v:""}},422:(e,t,r)=>{"use strict";var n=r(490),o=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],s=o.obj[o.prop],a=Object.keys(s),c=0;c<a.length;++c){var p=a[c],u=s[p];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:p}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",p=0;p<a.length;++p){var u=a.charCodeAt(p);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===n.RFC1738&&(40===u||41===u)?c+=a.charAt(p):u<128?c+=s[u]:u<2048?c+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?c+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(p+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(p)),c+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,n)),i(t)&&i(r)?(r.forEach((function(r,i){if(o.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var s=r[i];return o.call(t,i)?t[i]=e(t[i],s,n):t[i]=s,t}),s)}}},538:(e,t,r)=>{"use strict";var n=r(828),o=r(737),i=r(683),s=n("%TypeError%"),a=n("%WeakMap%",!0),c=n("%Map%",!0),p=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),l=o("WeakMap.prototype.has",!0),h=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),y=o("Map.prototype.has",!0),d=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new s("Side channel does not contain "+i(e))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(c){if(t)return h(t,n)}else if(r)return function(e,t){var r=d(e,t);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return l(e,n)}else if(c){if(t)return y(t,n)}else if(r)return function(e,t){return!!d(e,t)}(r,n);return!1},set:function(n,o){a&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new a),u(e,n,o)):c?(t||(t=new c),f(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=d(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},828:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var p=function(){throw new s},u=c?function(){try{return p}catch(e){try{return c(arguments,"callee").get}catch(e){return p}}}():p,l=r(465)(),h=Object.getPrototypeOf||function(e){return e.__proto__},f={},y="undefined"==typeof Uint8Array?n:h(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},m=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=h(o.prototype))}return d[t]=r,r},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(156),v=r(776),S=b.call(Function.call,Array.prototype.concat),O=b.call(Function.apply,Array.prototype.splice),A=b.call(Function.call,String.prototype.replace),E=b.call(Function.call,String.prototype.slice),w=b.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,x=function(e){var t=E(e,0,1),r=E(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(e,T,(function(e,t,r,o){n[n.length]=r?A(o,R,"$1"):t||e})),n},P=function(e,t){var r,n=e;if(v(g,n)&&(n="%"+(r=g[n])[0]+"%"),v(d,n)){var i=d[n];if(i===f&&(i=m(n)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===w(/^%?[^%]*%?$/g,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=x(e),n=r.length>0?r[0]:"",i=P("%"+n+"%",t),a=i.name,p=i.value,u=!1,l=i.alias;l&&(n=l[0],O(r,S([0,1],l)));for(var h=1,f=!0;h<r.length;h+=1){var y=r[h],m=E(y,0,1),g=E(y,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new o("property names with quotes must have matching quotes");if("constructor"!==y&&f||(u=!0),v(d,a="%"+(n+="."+y)+"%"))p=d[a];else if(null!=p){if(!(y in p)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&h+1>=r.length){var b=c(p,y);p=(f=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:p[y]}else f=v(p,y),p=p[y];f&&!u&&(d[a]=p)}}return p}},683:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,p=a&&c&&"function"==typeof c.get?c.get:null,u=a&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,d=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,S=String.prototype.toUpperCase,O=String.prototype.toLowerCase,A=RegExp.prototype.test,E=Array.prototype.concat,w=Array.prototype.join,T=Array.prototype.slice,R=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function k(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||A.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-R(-e):R(e);if(n!==e){var o=String(n),i=b.call(t,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,r,"$&_")}var $=r(758),I=$.custom,D=q(I)?I:null;function L(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function H(e){return v.call(String(e),/"/g,""")}function U(e){return!("[object Array]"!==J(e)||j&&"object"==typeof e&&j in e)}function F(e){return!("[object RegExp]"!==J(e)||j&&"object"==typeof e&&j in e)}function q(e){if(C)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!_)return!1;try{return _.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,o){var a=r||{};if(B(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(B(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!B(a,"customInspect")||a.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(B(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(B(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return W(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return d?k(t,S):S}if("bigint"==typeof t){var A=String(t)+"n";return d?k(t,A):A}var R=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=R&&R>0&&"object"==typeof t)return U(t)?"[Array]":"[Object]";var P,I=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=w.call(Array(e.indent+1)," ")}return{base:r,prev:w.call(Array(t+1),r)}}(a,n);if(void 0===o)o=[];else if(K(o,t)>=0)return"[Circular]";function G(t,r,i){if(r&&(o=T.call(o)).push(r),i){var s={depth:a.depth};return B(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,n+1,o)}return e(t,a,n+1,o)}if("function"==typeof t&&!F(t)){var z=function(e){if(e.name)return e.name;var t=g.call(m.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=Y(t,G);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(ee.length>0?" { "+w.call(ee,", ")+" }":"")}if(q(t)){var te=C?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):_.call(t);return"object"!=typeof t||C?te:V(te)}if((P=t)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var re="<"+O.call(String(t.nodeName)),ne=t.attributes||[],oe=0;oe<ne.length;oe++)re+=" "+ne[oe].name+"="+L(H(ne[oe].value),"double",a);return re+=">",t.childNodes&&t.childNodes.length&&(re+="..."),re+"</"+O.call(String(t.nodeName))+">"}if(U(t)){if(0===t.length)return"[]";var ie=Y(t,G);return I&&!function(e){for(var t=0;t<e.length;t++)if(K(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Z(ie,I)+"]":"[ "+w.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==J(e)||j&&"object"==typeof e&&j in e)}(t)){var se=Y(t,G);return"cause"in Error.prototype||!("cause"in t)||M.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+w.call(se,", ")+" }":"{ ["+String(t)+"] "+w.call(E.call("[cause]: "+G(t.cause),se),", ")+" }"}if("object"==typeof t&&c){if(D&&"function"==typeof t[D]&&$)return $(t,{depth:R-n});if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{p.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ae=[];return s.call(t,(function(e,r){ae.push(G(r,t,!0)+" => "+G(e,t))})),Q("Map",i.call(t),ae,I)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return u.call(t,(function(e){ce.push(G(e,t))})),Q("Set",p.call(t),ce,I)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{h.call(e,h)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{h.call(e,h);try{l.call(e,l)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return!("[object Number]"!==J(e)||j&&"object"==typeof e&&j in e)}(t))return V(G(Number(t)));if(function(e){if(!e||"object"!=typeof e||!x)return!1;try{return x.call(e),!0}catch(e){}return!1}(t))return V(G(x.call(t)));if(function(e){return!("[object Boolean]"!==J(e)||j&&"object"==typeof e&&j in e)}(t))return V(y.call(t));if(function(e){return!("[object String]"!==J(e)||j&&"object"==typeof e&&j in e)}(t))return V(G(String(t)));if(!function(e){return!("[object Date]"!==J(e)||j&&"object"==typeof e&&j in e)}(t)&&!F(t)){var pe=Y(t,G),ue=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,le=t instanceof Object?"":"null prototype",he=!ue&&j&&Object(t)===t&&j in t?b.call(J(t),8,-1):le?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||le?"["+w.call(E.call([],he||[],le||[]),": ")+"] ":"");return 0===pe.length?fe+"{}":I?fe+"{"+Z(pe,I)+"}":fe+"{ "+w.call(pe,", ")+" }"}return String(t)};var G=Object.prototype.hasOwnProperty||function(e){return e in this};function B(e,t){return G.call(e,t)}function J(e){return d.call(e)}function K(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function W(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return W(b.call(e,0,t.maxStringLength),t)+n}return L(v.call(v.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,z),"single",t)}function z(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+S.call(t.toString(16))}function V(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Q(e,t,r,n){return e+" ("+t+") {"+(n?Z(r,n):w.call(r,", "))+"}"}function Z(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+w.call(e,","+r)+"\n"+t.prev}function Y(e,t){var r=U(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=B(e,o)?t(e[o],e):""}var i,s="function"==typeof P?P(e):[];if(C){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var c in e)B(e,c)&&(r&&String(Number(c))===c&&c<e.length||C&&i["$"+c]instanceof Symbol||(A.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var p=0;p<s.length;p++)M.call(e,s[p])&&n.push("["+t(s[p])+"]: "+t(e[s[p]],e));return n}},203:(e,t,r)=>{"use strict";var n=r(739);function o(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return o(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):o(t)}e.exports=i,i.message=n,i.code=function(e){var t={};return Object.keys(e).forEach((function(r){var n=e[r],o=Number(r);t[n.toLowerCase()]=o})),t}(n),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(n),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},248:e=>{"use strict";function t(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(){this._defaults=[]}for(var o=function(){var e=s[i];n.prototype[e]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this._defaults.push({fn:e,args:r}),this}},i=0,s=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];i<s.length;i++)o();n.prototype._setDefaults=function(e){var n,o,i=function(e,r){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=t(e))){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}(this._defaults);try{for(i.s();!(n=i.n()).done;){var s=n.value;e[s.fn].apply(e,function(e){if(Array.isArray(e))return r(e)}(o=s.args)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||t(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}catch(e){i.e(e)}finally{i.f()}},e.exports=n},427:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var i;"undefined"!=typeof window?i=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),i=void 0):i=self;var s=r(147),a=r(641),c=r(348),p=r(595),u=r(659),l=u.isObject,h=u.mixin,f=u.hasOwn,y=r(835),d=r(248);function m(){}e.exports=function(e,r){return"function"==typeof r?new t.Request("GET",e).end(r):1===arguments.length?new t.Request("GET",e):new t.Request(e,r)};var g=t=e.exports;t.Request=w,g.getXHR=function(){if(i.XMLHttpRequest&&(!i.location||"file:"!==i.location.protocol||!i.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("Browser-only version of superagent could not find XHR")};var b="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function v(e){if(!l(e))return e;var t=[];for(var r in e)f(e,r)&&S(t,r,e[r]);return t.join("&")}function S(e,t,r){if(void 0!==r)if(null!==r)if(Array.isArray(r)){var n,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}(r);try{for(i.s();!(n=i.n()).done;)S(e,t,n.value)}catch(e){i.e(e)}finally{i.f()}}else if(l(r))for(var s in r)f(r,s)&&S(e,"".concat(t,"[").concat(s,"]"),r[s]);else e.push(encodeURI(t)+"="+encodeURIComponent(r));else e.push(encodeURI(t))}function O(e){for(var t,r,n={},o=e.split("&"),i=0,s=o.length;i<s;++i)-1===(r=(t=o[i]).indexOf("="))?n[decodeURIComponent(t)]="":n[decodeURIComponent(t.slice(0,r))]=decodeURIComponent(t.slice(r+1));return n}function A(e){return/[/+]json($|[^-\w])/i.test(e)}function E(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){for(var t,r,n,o,i=e.split(/\r?\n/),s={},a=0,c=i.length;a<c;++a)-1!==(t=(r=i[a]).indexOf(":"))&&(n=r.slice(0,t).toLowerCase(),o=b(r.slice(t+1)),s[n]=o);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function w(e,t){var r=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(function(){var e,t=null,n=null;try{n=new E(r)}catch(e){return(t=new Error("Parser is unable to parse the response")).parse=!0,t.original=e,r.xhr?(t.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,t.status=r.xhr.status?r.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),r.callback(t)}r.emit("response",n);try{r._isResponseOK(n)||(e=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=n,e.status=n.status,r.callback(e,n)):r.callback(null,n)}))}g.serializeObject=v,g.parseString=O,g.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},g.serialize={"application/x-www-form-urlencoded":c.stringify,"application/json":a},g.parse={"application/x-www-form-urlencoded":O,"application/json":JSON.parse},h(E.prototype,y.prototype),E.prototype._parseBody=function(e){var t=g.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&A(this.type)&&(t=g.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},E.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot ".concat(t," ").concat(r," (").concat(this.status,")"),o=new Error(n);return o.status=this.status,o.method=t,o.url=r,o},g.Response=E,s(w.prototype),h(w.prototype,p.prototype),w.prototype.type=function(e){return this.set("Content-Type",g.types[e]||e),this},w.prototype.accept=function(e){return this.set("Accept",g.types[e]||e),this},w.prototype.auth=function(e,t,r){1===arguments.length&&(t=""),"object"===n(t)&&null!==t&&(r=t,t=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var o=function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,r,o)},w.prototype.query=function(e){return"string"!=typeof e&&(e=v(e)),e&&this._query.push(e),this},w.prototype.attach=function(e,t,r){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,r||t.name)}return this},w.prototype._getFormData=function(){return this._formData||(this._formData=new i.FormData),this._formData},w.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var r=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),r(e,t)},w.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},w.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},w.prototype.ca=w.prototype.agent,w.prototype.buffer=w.prototype.ca,w.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},w.prototype.pipe=w.prototype.write,w.prototype._isHost=function(e){return e&&"object"===n(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},w.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||m,this._finalizeQueryString(),this._end()},w.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},w.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=g.getXHR();var t=this.xhr,r=this._formData||this._data;this._setTimeouts(),t.addEventListener("readystatechange",(function(){var r=t.readyState;if(r>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===r){var n;try{n=t.status}catch(e){n=0}if(!n){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}}));var n=function(t,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(e._uploadTimeoutTimer)),r.direction=t,e.emit("progress",r)};if(this.hasListeners("progress"))try{t.addEventListener("progress",n.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",n.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||g.serialize[o?o.split(";")[0]:""];!i&&A(o)&&(i=g.serialize["application/json"]),i&&(r=i(r))}for(var s in this.header)null!==this.header[s]&&f(this.header,s)&&t.setRequestHeader(s,this.header[s]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===r?null:r)},g.agent=function(){return new d};for(var T=function(){var e=x[R];d.prototype[e.toLowerCase()]=function(t,r){var n=new g.Request(e,t);return this._setDefaults(n),r&&n.end(r),n}},R=0,x=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];R<x.length;R++)T();function P(e,t,r){var n=g("DELETE",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}d.prototype.del=d.prototype.delete,g.get=function(e,t,r){var n=g("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},g.head=function(e,t,r){var n=g("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},g.options=function(e,t,r){var n=g("OPTIONS",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},g.del=P,g.delete=P,g.patch=function(e,t,r){var n=g("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},g.post=function(e,t,r){var n=g("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},g.put=function(e,t,r){var n=g("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}},595:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=r(423),i=r(659),s=i.isObject,a=i.hasOwn;function c(){}e.exports=c,c.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},c.prototype.parse=function(e){return this._parser=e,this},c.prototype.responseType=function(e){return this._responseType=e,this},c.prototype.serialize=function(e){return this._serializer=e,this},c.prototype.timeout=function(e){if(!e||"object"!==n(e))return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(var t in e)if(a(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},c.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var p=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),u=new Set([408,413,429,500,502,503,504,521,522,524]);c.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(!0===r)return!0;if(!1===r)return!1}catch(e){console.error(e)}if(t&&t.status&&u.has(t.status))return!0;if(e){if(e.code&&p.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},c.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},c.prototype.then=function(e,t){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(e,t){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)t(r.timedoutError);else{var e=new Error("Aborted");e.code="ABORTED",e.status=r.status,e.method=r.method,e.url=r.url,t(e)}})),n.end((function(r,n){r?t(r):e(n)}))}))}return this._fullfilledPromise.then(e,t)},c.prototype.catch=function(e){return this.then(void 0,e)},c.prototype.use=function(e){return e(this),this},c.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},c.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},c.prototype.get=function(e){return this._header[e.toLowerCase()]},c.prototype.getHeader=c.prototype.get,c.prototype.set=function(e,t){if(s(e)){for(var r in e)a(e,r)&&this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},c.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},c.prototype.field=function(e,t,r){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(s(e)){for(var n in e)a(e,n)&&this.field(n,e[n]);return this}if(Array.isArray(t)){for(var o in t)a(t,o)&&this.field(e,t[o]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),this._getFormData().append(e,t,r),this},c.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(o.gte(process.version,"v13.0.0")&&o.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");o.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},c.prototype._auth=function(e,t,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e))}return this},c.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},c.prototype.redirects=function(e){return this._maxRedirects=e,this},c.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},c.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},c.prototype.send=function(e){var t=s(e),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&s(this._data))for(var n in e)a(e,n)&&(this._data[n]=e[n]);else"string"==typeof e?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(e):e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||r||this.type("json"),this},c.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},c.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var r=this.url.slice(t+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,t)+"?"+r.join("&")}}},c.prototype._appendQueryString=function(){console.warn("Unsupported")},c.prototype._timeoutError=function(e,t,r){if(!this._aborted){var n=new Error("".concat(e+t,"ms exceeded"));n.timeout=t,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},c.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},835:(e,t,r)=>{"use strict";var n=r(659);function o(){}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=n.type(t);var r=n.params(t);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this[o]=r[o]);this.links={};try{e.link&&(this.links=n.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){var t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},659:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){var t,r={},o=n(e.split(/ *; */));try{for(o.s();!(t=o.n()).done;){var i=t.value.split(/ *= */),s=i.shift(),a=i.shift();s&&a&&(r[s]=a)}}catch(e){o.e(e)}finally{o.f()}return r},t.parseLinks=function(e){var t,r={},o=n(e.split(/ *, */));try{for(o.s();!(t=o.n()).done;){var i=t.value.split(/ *; */),s=i[0].slice(1,-1);r[i[1].split(/ *= */)[1].slice(1,-1)]=s}}catch(e){o.e(e)}finally{o.f()}return r},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e},t.isObject=function(e){return null!==e&&"object"===r(e)},t.hasOwn=Object.hasOwn||function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(e),t)},t.mixin=function(e,r){for(var n in r)t.hasOwn(r,n)&&(e[n]=r[n])}},803:t=>{"use strict";t.exports=e},758:()=>{},423:()=>{},739:e=>{"use strict";e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{AcceptMime:()=>gr,AdditionalProperties:()=>We,All:()=>Ur,AllOf:()=>ze,Allow:()=>Xe,Any:()=>Qe,AnyOf:()=>Ze,ArrayOf:()=>He,Children:()=>Ie,CollectionContains:()=>Fe,CollectionOf:()=>Le,Const:()=>Ye,Consumes:()=>br,ContentType:()=>Rr,Converter:()=>$n,CustomKey:()=>et,CustomKeys:()=>tt,DateFormat:()=>gt,DateTime:()=>mt,DecoratorContext:()=>vr,Default:()=>rt,Delete:()=>Br,Deprecated:()=>xr,Description:()=>nt,Discriminator:()=>v,DiscriminatorKey:()=>ot,DiscriminatorValue:()=>De,Email:()=>dt,EndpointMetadata:()=>pe,Enum:()=>it,Example:()=>st,Examples:()=>at,ExclusiveMaximum:()=>ut,ExclusiveMinimum:()=>ft,For:()=>qt,Format:()=>yt,ForwardGroups:()=>Ot,GenericOf:()=>yr,Generics:()=>dr,Get:()=>Fr,Groups:()=>xt,HTTP_METHODS:()=>Me,HTTP_STATUS_MESSAGES:()=>Q,Head:()=>Jr,Header:()=>Pr,Hidden:()=>Pt,Ignore:()=>Ct,In:()=>_r,InFile:()=>Cr,Integer:()=>jt,JSON_TYPES:()=>y,JsonClassStore:()=>w,JsonEntitiesContainer:()=>c,JsonEntityComponent:()=>E,JsonEntityFn:()=>$e,JsonEntityStore:()=>p,JsonFormatTypes:()=>ke,JsonLazyRef:()=>le,JsonMap:()=>C,JsonMedia:()=>ie,JsonMethodStore:()=>ce,JsonOperation:()=>ae,JsonOperationPathsMap:()=>Yr,JsonOperationRoute:()=>tn,JsonParameter:()=>J,JsonParameterStore:()=>K,JsonParameterTypes:()=>j,JsonPropertyStore:()=>T,JsonRequestBody:()=>ne,JsonResponse:()=>se,JsonSchema:()=>A,Location:()=>jr,MapOf:()=>Ue,Max:()=>pt,MaxItems:()=>qe,MaxLength:()=>Mt,MaxProperties:()=>Ge,Maximum:()=>ct,Min:()=>ht,MinItems:()=>Be,MinLength:()=>Nt,MinProperties:()=>Je,Minimum:()=>lt,MultipleOf:()=>kt,Name:()=>$t,Nullable:()=>It,OneOf:()=>Dt,OperationId:()=>Mr,OperationMethods:()=>Ne,OperationPath:()=>Nr,Optional:()=>Lt,Options:()=>Wr,ParamMetadata:()=>W,Partial:()=>kr,Patch:()=>Kr,Path:()=>$r,Pattern:()=>Ht,Post:()=>qr,Produces:()=>mr,Property:()=>Ve,PropertyMetadata:()=>R,Put:()=>Gr,ReadOnly:()=>Ut,RecordOf:()=>Gt,Redirect:()=>Ir,Required:()=>Bt,RequiredGroups:()=>Jt,Returns:()=>Tr,Route:()=>Hr,Schema:()=>Ft,Security:()=>zr,SpecTypes:()=>$,Status:()=>Vr,Summary:()=>Xr,Tags:()=>Qr,TimeFormat:()=>bt,Title:()=>Kt,UniqueItems:()=>Ke,Uri:()=>vt,Url:()=>St,View:()=>Zr,WriteOnly:()=>Wt,allOf:()=>hr,alterIgnore:()=>Se,alterOneOf:()=>Pe,alterRequiredGroups:()=>Re,any:()=>pr,anyMapper:()=>he,anyOf:()=>ur,array:()=>ir,boolean:()=>Zt,buildPath:()=>rn,classMapper:()=>fe,concatParameters:()=>nn,concatPath:()=>en,createRef:()=>G,createRefName:()=>q,date:()=>Yt,datetime:()=>er,defineStatusModel:()=>Or,email:()=>rr,execMapper:()=>s,formatParameterType:()=>M,from:()=>zt,generateSpec:()=>Dn,genericsMapper:()=>ye,getComputedType:()=>f,getGenericsMap:()=>x,getInheritedStores:()=>de,getJsonEntityStore:()=>ue,getJsonPathParameters:()=>sn,getJsonSchema:()=>Hn,getJsonSchemaMapper:()=>i,getJsonType:()=>d,getOperationsRoutes:()=>Un,getOperationsStores:()=>on,getProperties:()=>qn,getPropertiesStores:()=>Fn,getRequiredProperties:()=>xe,getSpec:()=>bn,getSpecType:()=>vn,getSpecTypeFromSpec:()=>Sn,getStatusConstant:()=>Z,getStatusMessage:()=>Y,getStatusModel:()=>Ar,hasMapper:()=>a,inheritedClassMapper:()=>me,integer:()=>Xt,isParameterType:()=>N,isRedirectionStatus:()=>te,isSuccessStatus:()=>ee,itemMapper:()=>ge,lazyRef:()=>fr,lazyRefMapper:()=>be,map:()=>sr,mapAliasedProperties:()=>Te,mapGenericsOptions:()=>P,mapHeaders:()=>oe,mapMapper:()=>ve,mapNullableType:()=>Oe,mapOpenSpec:()=>wn,mapOpenSpec2:()=>An,mapOpenSpec3:()=>En,mapOpenSpecInfo:()=>On,mapRouteOptions:()=>Dr,matchGroups:()=>Rt,mergeOperation:()=>an,mergeSpec:()=>mn,number:()=>Vt,object:()=>cr,objectMapper:()=>Ae,ofMapper:()=>Ee,oneOf:()=>lr,operationIdFormatter:()=>un,parameters:()=>hn,popGenerics:()=>_,propertiesMapper:()=>we,registerJsonSchemaMapper:()=>r,schemaMapper:()=>je,schemesReducer:()=>ln,security:()=>fn,serializeEnum:()=>m,serializeEnumValues:()=>g,set:()=>ar,string:()=>Qt,tagsReducer:()=>yn,time:()=>tr,toJsonMapCollection:()=>re,toJsonRegex:()=>b,toRef:()=>B,transformInformation:()=>kn,transformSecurity:()=>Nn,transformToOS2:()=>In,uri:()=>nr,url:()=>or});var e=n(803);const t=new Map;function r(e,r){return t.set(e,r)}function i(e){if(!t.has(e))throw new Error(`JsonSchema ${e} mapper doesn't exists`);return t.get(e)}function s(e,t,r,n){return i(e)(t,r,n)}function a(e){return t.has(e)}const c=new Map;class p{propertyKey;propertyName;index;descriptor;decoratorType;collectionType;token;store;isStore=!0;parent;target;_type;_schema;constructor(e){const{target:t,propertyKey:r,descriptor:n,index:o,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=String(r),this.descriptor=n,this.index=o,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get targetName(){return(0,e.nameOf)(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return(0,e.isArrayOrArrayClass)(this.collectionType)}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.target).find((e=>p.from(e).schema.isDiscriminator));return t&&p.from(t)}get isPrimitive(){return(0,e.isPrimitiveOrPrimitiveClass)(this._type)}get isDate(){return(0,e.isDate)(this.computedType)}get isObject(){return(0,e.isObject)(this.computedType)}get isClass(){return(0,e.isClass)(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){return this.schema.isDiscriminator&&this.discriminatorAncestor?.schema.discriminator().base!==this.target}static from(...t){if(t[0].isStore)return t[0];const r=t[0];t.length>1&&(t[0]=(0,e.prototypeOf)(t[0]));const n=e.Store.from(...t);if(!n.has("JsonEntityStore")){const o=(0,e.decoratorTypeOf)(t),i=c.get(o);if(!i)throw Error("Unsupported json entity type");const s=new i({store:n,decoratorType:o,target:(0,e.classOf)(r),propertyKey:t[1],index:"number"==typeof t[2]?t[2]:void 0,descriptor:"object"==typeof t[2]?t[2]:void 0});s.build(),n.set("JsonEntityStore",s)}return n.get("JsonEntityStore")}static fromMethod(t,r){return this.from(t,r,(0,e.descriptorOf)(t,r))}static get(t,r,n){return p.from((0,e.prototypeOf)(t),r,n)}isGetterOnly(){return(0,e.isObject)(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,t){return this.store.get(e,t)}set(e,t){return this.store.set(e,t)}toString(){return[this.targetName,this.propertyName,this.index].filter((e=>void 0!==e)).join(":")}buildType(t){(0,e.isCollection)(t)?this.collectionType=t:(this._type=t,this._type&&(0,e.isPlainObject)(this._type)&&(this._type=String))}}var u=function(){return u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)};function l(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(t){return(0,e.isPromise)(t)?Object:(0,e.isClass)(t)||(0,e.isSymbol)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(0,e.isClassObject)(t)||(0,e.isDate)(t)||(0,e.isCollection)(t)?(0,e.classOf)(t):(0,e.isArrowFn)(t)?t():t}Object.create,Object.create;const y=["string","number","integer","boolean","object","array","null","any"];function d(t){return null===t?"null":(0,e.isPrimitiveOrPrimitiveClass)(t)?y.indexOf(t)>-1?t:"string"==typeof t?"file"===t?"file":"generic":(0,e.primitiveOf)(t):t===Array?"array":(0,e.isArray)(t)?t.map(d):t===Set?"array":(0,e.isDate)(t)||(0,e.isBuffer)(t)?"string":"object"}const m=t=>(0,e.isObject)(t)&&null!==t?Object.entries(t).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):t;function g(t){const r=t.reduce(((e,t)=>e.concat(m(t))),[]),n=r.reduce(((e,t)=>e.add((e=>null===e?"null":typeof e)(t))),new Set);return{values:(0,e.uniq)(r),types:n}}function b(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class v{propertyName;base;values=new Map;types=new Map;constructor({base:t,propertyName:r,types:n,values:o}={}){Object.assign(this,(0,e.cleanObject)({base:t,propertyName:r,types:n?new Map(n):void 0,values:o?new Map(o):void 0}))}add(e,t){return t.forEach((t=>{this.values.set(t,e)})),this.types.set(e,t),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const t=this.types.get(e);return t?t[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function S(e){return e instanceof A?e:Object.entries(e).reduce(((e,[t,r])=>(e[b(t)]=O(r),e)),{})}function O(t){return(0,e.isArray)(t)?t.map(O):t.isStore||t.isJsonSchema||t.isLazyRef?t:(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?p.from(t).schema:(0,e.isObject)(t)?A.from(t):(0,e.isPrimitiveClass)(t)?A.from({type:t}):t}class A extends Map{isJsonSchema=!0;$hooks=new e.Hooks;$required=new Set;$allow=[];$selfRequired;$forwardGroups=!1;isDiscriminatorKey=!1;isDiscriminator=!1;#e=!1;#t=null;#r;#n=[];#o=new Map;#i;#s;#a=!1;#c=!1;#p=!1;constructor(e={}){super(),e&&this.assign(e)}get alias(){return this.#o}get nestedGenerics(){return this.#n}set nestedGenerics(e){this.#n=e}get genericLabels(){return this.#r}set genericLabels(e){this.#r=e}get isClass(){return(0,e.isClass)(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes(this.#s)}get isCollection(){return this.#c}get isGeneric(){return this.#a}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.#s).find((e=>p.from(e).schema.isDiscriminator));return t&&p.from(t).schema}get hasGenerics(){return!(!this.nestedGenerics||!this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return this.#p}get isNullable(){return this.#e||this.$allow.includes(null)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}static from(e={}){return new A(e)}nullable(e){this.#e=e}itemSchema(e={}){return this.#i=this.#i||O(e),this.#i.assign(e),this.#i}getAliasOf(e){return this.#o.get(e)}addAlias(e,t){return this.#o.set(e,t),this.#o.set(t,e),this}removeAlias(e){const t=this.#o.get(e);return t&&this.#o.delete(t),this.#o.delete(e),this}$id(e){return super.set("$id",e),this}$ref(e){return super.set("$ref",e),this}$schema(e){return super.set("$schema",e),this}label(e){return this.#p=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){if("boolean"==typeof e){const t=e;e=()=>t}return this.$hooks.on("ignore",e),this}default(e){return super.set("default",e),this}const(e){return super.set("const",e),this}description(e){return super.set("description",e),this}discriminator(){return this.isDiscriminator=!0,this.#t=this.#t||new v({base:this.#s})}discriminatorKey(e){return this.discriminator().propertyName=e,this.isDiscriminator=!0,this}discriminatorValue(...e){const t=this.discriminatorAncestor.discriminator();t.add(this.#s,e),this.isDiscriminator=!0;const r=this.get("properties"),n=r[t.propertyName]||new A({type:"string"});return 1===e.length?(n.const(e[0]),n.examples([e[0]])):(n.enum(...e),n.examples(e)),r[t.propertyName]=n,this.set("properties",r),this}additionalItems(e){return super.set("additionalItems",O(e)),this}contains(e){return super.set("contains",O(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#i=O(e)),this}maxItems(e){return super.set("maxItems",e),this}minItems(e){return super.set("minItems",e),this}uniqueItems(e){return super.set("uniqueItems",e),this}maxProperties(e){return super.set("maxProperties",e),this}minProperties(e){return super.set("minProperties",e),this}allow(...e){return this.$allow.push(...e),this}required(t=!0){if(!(0,e.isArray)(t)){const e=this.clone();return e.$selfRequired=t,e}return this.$required.clear(),t.forEach((e=>this.$required.add(e))),this}addRequired(e){return this.$required.add(e),this}removeRequired(e){return this.$required.delete(e),this}isRequired(e){return this.$required.has(e)}properties(e){return super.set("properties",S(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",S(r)),this}patternProperties(e){return super.set("patternProperties",S(e)),this}additionalProperties(e){return super.set("additionalProperties",O(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",S(e)),this}propertyNames(e){return super.set("propertyNames",O(e)),this}enum(e,...t){const{values:r,types:n}=g([e,t].flat());return super.set("enum",r).any(...n),this}definitions(e){return super.set("definitions",S(e)),this}allOf(e){return super.set("allOf",e.map(O)),this}anyOf(e){return super.set("anyOf",e.map(O)),this}oneOf(e){let t=e.map(O);if(1===t.length&&!(e[0]instanceof A)){if(!t[0].#t)return this.type(e[0]);const r=t[0].discriminator().children();t=r.map(O)}super.set("oneOf",t);const r=t[0];if(r.isDiscriminator){const e=r.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t}),this.isDiscriminator=!0,this.#t=e}return this}not(e){return super.set("not",O(e)),this}multipleOf(e){return super.set("multipleOf",e),this}maximum(e){return super.set("maximum",e),this}exclusiveMaximum(e){return super.set("exclusiveMaximum",e),this}minimum(e){return super.set("minimum",e),this}exclusiveMinimum(e){return super.set("exclusiveMinimum",e),this}maxLength(e){return super.set("maxLength",e),this}minLength(e){return super.set("minLength",e),this}pattern(e){return super.set("pattern",b(e)),this}format(e){return super.set("format",e),this}type(t){switch(t){case Map:super.set("type",d(t)),this.#s=t,this.#c=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case Array:super.set("type",d(t)),this.#s=t,this.#c=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case Set:super.set("type",d(t)),this.#s=t,this.#c=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":super.set("type",d(t)),this.integer();break;case Object:case Date:case Boolean:case Number:case String:super.set("type",d(t)),this.#s=t,this.has("properties")||super.set("properties",{});break;default:if((0,e.isClass)(t)||(0,e.isFunction)(t))super.set("type",void 0),this.#s=t,this.has("properties")||super.set("properties",{});else{const e=d(t);"generic"===e?(this.#a=!0,super.set("$ref",t)):super.set("type",e)}}return this}any(...t){return t.filter((t=>(0,e.isClass)(t))).length>=2?this.oneOf(t.filter((e=>null!==e&&(this.nullable(!0),!0)))):(t.length?(t=(0,e.uniq)(t).map(d)).includes("null")&&(this.nullable(!0),t=t.filter((e=>"null"!==e))):(t=["integer","number","string","boolean","array","object"],this.nullable(!0)),this.type(1===t.length?t[0]:t)),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(e){return super.set("title",e),this}readOnly(e){return super.set("readOnly",e),this}writeOnly(e){return super.set("writeOnly",e),this}customKey(e,t){return super.set(`#${e}`,t),this}toObject(e){return this.toJSON(e)}toJSON(e){let t=!1;e||(t=!0,e={schemas:{}});const r=s("schema",this,e);return t&&e.schemas&&Object.keys(e.schemas).length&&(r.definitions=e.schemas),r}assign(e={}){return(e instanceof A?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof A&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),e.$required.forEach((e=>{this.$required.add(e)})),this.#t=this.#t?new v(this.#t):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#p=e.#p,this.#o=new Map(this.#o.entries()),e.#r&&(this.#r=[...e.#r]),this.#n=e.#n.map((e=>[...e])),this.#s=e.#s,this.#a=e.#a,this.#c=e.#c,this.#p=e.#p,super.set("type",e.get("type"))),this}set(t,r){return t in this?(0,e.isFunction)(this[t])&&this[t](r):super.set(t,r),this}getComputedType(){return f(this.#s)}getComputedItemType(){return this.#i?this.#i.getComputedType():this.getComputedType()}getJsonType(){return this.get("type")||d(this.getComputedType())}getTarget(){return this.#s}getName(){return this.get("name")||(this.#s?(0,e.nameOf)((0,e.classOf)(this.getComputedType())):"")}clone(){return new A(this)}}function E(e){return t=>{c.set(e,t)}}let w=class extends p{children=new Map;get path(){return this.store.get("path","/")}set path(e){this.store.set("path",e)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=A.from({type:this.type})}};w=l([E(e.DecoratorTypes.CLASS)],w);let T=class extends p{parent=p.from(this.target);get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(e){e?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){this._type||this.buildType(e.Metadata.getType((0,e.prototypeOf)(this.target),this.propertyKey)),this._type=this._type||Object;let t=this.parent.schema.get("properties")[this.propertyName];t||(this.parent.children.set(this.propertyName,this),t=A.from({type:this.collectionType||this.type}),this.collectionType&&t.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}static get(t,r){return p.from((0,e.prototypeOf)(t),r)}};T=l([E(e.DecoratorTypes.PROP)],T);const R=T;function x(e,t){return e.reduce(((e,r,n)=>e.set(r,t[n])),new Map)}function P(e){if(e.genericLabels&&e.genericTypes){const{genericLabels:t,genericTypes:r,...n}=e;return{...n,generics:x(t,r)}}return e}function _(e){const[t,...r]=e.nestedGenerics;return{genericTypes:t,nestedGenerics:r}}class C extends Map{constructor(e={}){super(),this.assign(e)}assign(t={}){return Object.entries(t).forEach((([t,r])=>{(0,e.isFunction)(this[t])?this[t](r):this.set(t,r)})),this}toJSON(e={}){return s("map",this,e)}}var j;function M(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function N(e){return Object.values(j).includes(M(e))}function k(e){return e.toLowerCase()}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}(j||(j={}));var $,I=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],D=/[^A-Z0-9]+/gi;function L(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,n=void 0===r?I:r,o=t.stripRegexp,i=void 0===o?D:o,s=t.transform,a=void 0===s?k:s,c=t.delimiter,p=void 0===c?" ":c,u=H(H(e,n,"$1\0$2"),i,"\0"),l=0,h=u.length;"\0"===u.charAt(l);)l++;for(;"\0"===u.charAt(h-1);)h--;return u.slice(l,h).split("\0").map(a).join(p)}function H(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}function U(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function F(e,t){return void 0===t&&(t={}),L(e,u({delimiter:"",transform:U},t))}function q(e,t){return t.groups&&t.groups.length?F(`${e} ${t.groups.join(" ")}`):e}function G(t,r,n){const o=function(e){const{host:t="#/"+("openapi3"===e.specType?"components/schemas":"definitions")}=e;return t}(n),i={$ref:`${o}/${t}`},s=r.isNullable,a=r.isReadOnly,c=r.isWriteOnly;if(s||a||c)switch(n.specType){case $.OPENAPI:return(0,e.cleanObject)({nullable:!!s||void 0,readOnly:!!a||void 0,writeOnly:!!c||void 0,oneOf:[i]});case $.JSON:return(0,e.cleanObject)({readOnly:a,writeOnly:c,oneOf:[i]})}return i}function B(e,t,r){const n=q(e.getName(),r);return r.schemas[e.getName()]=t,G(n,e,r)}!function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3"}($||($={}));class J extends C{nestedGenerics=[];groups;$schema;expression;getName(){const e=this.get("name");return"files"===this.get("in")?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,t=""){return this.set("in",M(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return this.$schema=e,this}toJSON(t={}){if(!N(this.get("in")))return null;const r=(0,e.toMap)(t.schemas||{});return this.build({...t,groups:this.groups},r)}build(e,t){const{type:r,schema:n,...o}=super.toJSON(e),i=s("item",this.$schema,{...e,..._(this)});switch(o.required=o.required||this.get("in")===j.PATH,this.get("in")){case j.FILES:return this.getFileSchema(i,o);case j.QUERY:if(i.$ref){if(!o.name)return this.refToParameters(o,e,t);o.style="deepObject"}}return o.schema=i,o}getFileSchema(t,r){const n={type:"string",format:"binary",oneOf:void 0};return"array"===t.type?(t.items=(0,e.cleanObject)({...t.items,...n}),r.schema=t):r.schema=(0,e.cleanObject)({...t,...n}),r}refToParameters(t,r,n){const o=q(this.$schema.getName(),r),i=r.schemas[o];return r.schemas[o]&&!n.has(o)&&delete r.schemas[this.$schema.getName()],Object.entries(i.properties||{}).reduce(((r,[n,{description:o,...s}])=>[...r,(0,e.cleanObject)({...t,name:n,required:(i.required||[]).includes(n),description:o,schema:s,style:s.$ref?"deepObject":void 0})]),[])}}let K=class extends p{paramType;expression;dataPath;pipes;parameter=new J;parent=p.fromMethod(this.target,this.propertyKey);constructor(e){super(e),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(e){this.parameter.nestedGenerics=e}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.$allow}static getParams(t,r){const n=[],o=(0,e.ancestorsOf)(t).reverse().find((t=>(0,e.isMethodDescriptor)(t,r)&&p.fromMethod(t,r).children.size));return o?(p.fromMethod(o,r).children.forEach(((e,t)=>{n[+t]=e})),n):[]}static get(t,r,n){return p.from((0,e.prototypeOf)(t),r,n)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}getSchema(t){return(0,e.isCollection)(t)||!(0,e.isClass)(t)?A.from({type:t}):p.from(t).schema}build(){if(!this._type){const t=e.Metadata.getParamTypes((0,e.prototypeOf)(this.target),this.propertyKey)[this.index];this.buildType(t)}this._type=this._type||Object,this._schema||(this.parent.children.set(this.index,this),this._schema=this.getSchema(this.collectionType||this.type),this.parameter.schema(this._schema),this.collectionType&&this._schema.itemSchema(this.getSchema(this.type)),this.parent.operation.addParameter(this.index,this.parameter))}};K=l([E(e.DecoratorTypes.PARAM),h("design:paramtypes",[Object])],K);const W=K;var z=n(203),V=n.n(z);function X(e){return e.toUpperCase()}const Q=V().codes.reduce(((e,t)=>{const r=String(V()(t));return{...e,[String(t)]:{label:r,code:(n=r,void 0===o&&(o={}),L(n,u({delimiter:"_",transform:X},o)))}};var n,o}),{});function Z(e){return Q[e]?.code}function Y(e){return Q[e]?.label}Q[200].label="Success",Q[200].code="SUCCESS";const ee=e=>Number(e)&&200<=Number(e)&&Number(e)<300,te=e=>Number(e)&&300<=Number(e)&&Number(e)<400;function re(e,t=C){return Object.entries(e).reduce(((e,[r,n])=>(e.set(r,new t(n)),e)),new C)}class ne extends C{constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",re(e)),this}addContent(e,t,r){const n=this.get("content"),o=new C;return o.set("schema",t),r&&o.set("examples",r),n.set(e,o),this}required(e){return this.set("required",e),this}}function oe(t){return Object.keys(t).reduce(((r,n)=>{const o=t[n];let i=typeof o,s={example:o};return"object"===i&&(s=o,s.example=void 0===s.value?s.example:s.value,delete s.value,i=typeof s.example),s.type=s.type||i,r[n]=(0,e.cleanObject)(s),r}),{})}class ie extends C{groups=[];allowedGroups;schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}toJSON(e={}){let t=[...this.groups||[]];return super.toJSON({...e,groups:t})}}class se extends C{status;constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",oe(e)),this}content(e){return this.set("content",re(e,ie)),this}getContent(){return this.get("content")}getMedia(e,t=!0){return t&&this.addMedia(e),this.getContent()?.get(e)}addMedia(e){const t=this.get("content");return t.has(e)||t.set(e,new ie),this}toJSON(e={}){const t=super.toJSON(e);return 204===this.status&&delete t.content,t.headers&&Object.entries(t.headers).forEach((([e,{type:r,...n}])=>{t.headers[e]={...n,schema:{type:r}}})),t}}class ae extends C{operationPaths=new Map;#u;#l=!1;constructor(e={}){super({parameters:[],responses:new C,...e})}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return this.#u}tags(e){return super.set("tags",e),this}addTags(t){return t=(0,e.uniqBy)([...this.get("tags")||[],...t],"name"),this.tags(t)}summary(e){return super.set("summary",e),this}operationId(e){return this.set("operationId",e),this}responses(e){return this.set("responses",e),this}defaultStatus(e){return this.#u=e,this}getStatus(){return this.#u||200}setRedirection(e=302){return this.#l=!0,this.#u=e,this}isRedirection(e){return this.#l&&e?te(e):this.#l}addResponse(t,r){if((ee(t)||te(t))&&!this.#u){const e=this.getResponseOf(200);this.getResponses().set(t.toString(),e).delete("200"),this.defaultStatus(Number(t))}const n="default"===t?this.getStatus().toString():t.toString(),o=this.getResponses().get(n);return o?(r.forEach(((t,r)=>{["content"].includes(r)||o.set(r,(0,e.deepMerge)(o.get(r),t))})),o.status=Number(n)):(r.status=Number(n),this.getResponses().set(n,r)),this}getResponses(){return this.get("responses")}getResponseOf(e){return("default"===e?this.response:this.getResponses().get(String(e)))||new se}ensureResponseOf(e){return this.addResponse(e,this.getResponseOf(e)),this.getResponseOf(e)}getHeadersOf(e){return this.getResponseOf(e).get("headers")||{}}getContentTypeOf(e){return[...this.getResponseOf(e).get("content").keys()].slice(-1)[0]}security(e){return this.set("security",e),this}addSecurityScopes(t,r){const n=this.get("security")||{};return n[t]=(0,e.uniq)([...n[t]||[],...r]),this.security(n)}description(e){return super.set("description",e),this}deprecated(e){return super.set("deprecated",e),this}parameters(e){return super.set("parameters",e),this}addParameter(e,t){-1===e&&(e=this.get("parameters").length),this.get("parameters")[e]=t}consumes(e){return super.set("consumes",e),this}produces(e){return super.set("produces",e),this}addProduce(t){const r=(0,e.uniq)([].concat(this.get("produces"),t)).filter(Boolean);this.set("produces",r)}addOperationPath(e,t,r={}){return this.operationPaths.set(String(e)+String(t),{...r,method:e,path:t}),this}toJSON(e={}){const t=super.toJSON({...e,ignore:["parameters"]}),r=[],n=[];if(t.security&&(t.security=[].concat(t.security)),this.get("parameters").forEach((t=>{N(this.get("in"))||t.get("in")&&([j.BODY,j.FILES].includes(t.get("in"))?r.push(t):n.push(...[].concat(t.toJSON(e))))})),t.parameters=n.filter(Boolean),0===this.get("responses").size&&(t.responses={200:{description:Y(200)}}),r.length){const n=function(e,t){let r=new A;const n={},o=[];let i=0;return e.forEach((e=>{const s=e.getName();Array.from(e.entries()).filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===n[e]&&(n[e]=t)}));const a=e.toJSON(t);s?(r.addProperty(s,a.schema||{type:a.type}),e.get("required")&&r.addRequired(s),i++):o.push(a)})),i||1!==o.length?(r.type("object"),{schema:r.toJSON(t),required:!1,...n}):o[0]}(r,e);t.requestBody=function(e,{schema:t,examples:r,in:n,...o}){const i=new ne(o);return(e.get("consumes")?.length?e.get("consumes"):["application/json"]).forEach((e=>{i.addContent(e,t,r)})),i}(this,n).toJSON(e)}return delete t.consumes,delete t.produces,t}}let ce=class extends p{parent=p.from(this.target);middlewares=[];beforeMiddlewares=[];afterMiddlewares=[];operation=new ae;children=new Map;constructor(t){super({store:e.Store.fromMethod(t.target,t.propertyKey),descriptor:(0,e.descriptorOf)(t.target,t.propertyKey),...t});const{beforeMiddlewares:r=[],middlewares:n=[],afterMiddlewares:o=[]}=t;this.after(o),this.before(r),this.use(n)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(e){this.store.set("view",e)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(e){this.store.set("acceptMimes",e)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(t,r,n){return n=n||(0,e.descriptorOf)((0,e.prototypeOf)(t),r),p.from((0,e.prototypeOf)(t),r,n)}getResponseOptions(e,{contentType:t="application/json",includes:r}={}){const n=this.operation.getResponseOf(e).getMedia(t,!1);if(n&&n.has("schema")){const e=n.get("schema");let t=n.groups;return r&&n.allowedGroups?.size&&(t=[...t||[],...r.filter((e=>n.allowedGroups.has(e)))]),{type:e.getComputedItemType(),groups:t}}return{type:this.type}}before(t){return this.beforeMiddlewares=this.beforeMiddlewares.concat(t).filter(e.isFunction),this}after(t){return this.afterMiddlewares=this.afterMiddlewares.concat(t).filter(e.isFunction),this}use(t){return this.middlewares=this.middlewares.concat(t).filter(e.isFunction),this}get(t){const r=e.Store.from(this.target).get(t);return(0,e.deepMerge)(r,this.store.get(t))}getParamTypes(){return[...this.children.values()].reduce(((e,t)=>({...e,[t.paramType]:!0})),{})}build(){if(!this._type){let t=e.Metadata.getReturnType(this.target,this.propertyKey);t=(0,e.isPromise)(t)?void 0:t,this.buildType(t)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),(0,e.isCollection)(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=A.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}};ce=l([E(e.DecoratorTypes.METHOD),h("design:paramtypes",[Object])],ce);const pe=ce;function ue(...e){return p.from(...e)}c.set(e.DecoratorTypes.CLASS,w),c.set(e.DecoratorTypes.PROP,T),c.set(e.DecoratorTypes.PARAM,K),c.set(e.DecoratorTypes.METHOD,ce);class le{getType;isLazyRef=!0;constructor(e){this.getType=e}get target(){return this.getType()}get schema(){return ue(this.getType()).schema}get name(){return(0,e.nameOf)(this.getType())}toJSON(e){return this.getType()&&s("schema",this.schema,e)}}function he(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof le)return s("lazyRef",e,t);if("toJSON"in e){const r=e.toJSON(P(t));return e.canRef?B(e,r,t):r}return s("object",e,t)}function fe(e,t){const r=p.from(e.class),n=q(r.schema.getName()||e.getName(),t);if(e.hasGenerics){const{type:n,properties:o,additionalProperties:i,items:a,...c}=e.toJSON(t),p={...s("any",r.schema,{...t,..._(e),root:!1}),...c};if(p.title){const r=q(p.title,t);return t.schemas[r]=p,delete p.title,G(r,e,t)}return p}return t.schemas&&!t.schemas[n]&&(t.schemas[n]={},t.schemas[n]=s("any",r.schema,P({...t,root:!1}))),G(n,e,t)}function ye(t,r){const{generics:n}=r;if(n&&t.$ref&&n.has(t.$ref)){let o=n.get(t.$ref);if((0,e.isPrimitiveClass)(o))return{type:d(o)};if(o===Date)return{type:"string",format:"date-time"};if(o.toJSON)return o.toJSON({...r,generics:void 0});if(o===Object)return{type:"object"};if((0,e.isClass)(o)){const e={class:o};return 0===r.nestedGenerics.length?s("class",e,{...r,generics:void 0}):s("schema",p.from(e.class).schema,{...r,..._(r),root:!1})}}return t}function de(t){const r=t.isStore?t:ue(t);return r.$inherited||(r.$inherited=(0,e.ancestorsOf)(r.target).reverse().reduce(((e,t)=>e.set(t,ue(t))),new Map)),r.$inherited}function me(t,{target:r,...n}){const o=Array.from(de(r).entries()).filter((([t])=>(0,e.classOf)(t)!==(0,e.classOf)(r)));if(o.length){const r=o.reduce(((t,[,r])=>(0,e.deepMerge)(t,s("schema",r.schema,n))),{});t=(0,e.deepMerge)(r,t)}return t}function ge(e,t){return e&&e.isClass?s("class",e,t):s("any",e,t)}function be(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return G(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const n=e.toJSON(P(t));return B(e.schema,n,t)}function ve(e,{ignore:t=[],...r}){return r=P(r),Array.from(e.entries()).reduce(((e,[n,o])=>(t.includes(n)||(e[n]=s("item",o,r)),e)),{})}function Se(e,t){let r=e?.$hooks?.alter("ignore",!1,[t]);return r||(!1!==t.groups?e?.$hooks?.alter("groups",!1,[t.groups]):r)}function Oe(t,r,n){if(!r?.isNullable)return t;let o=[].concat(t.type).filter(Boolean);switch(n.specType){default:case $.JSON:t.discriminator||(t.oneOf?function(e){return e.oneOf.find((e=>"null"===e.type))}(t)||t.oneOf.unshift({type:"null"}):t.type=(0,e.uniq)(["null",...o]));break;case $.OPENAPI:t.nullable=!0,t.oneOf||(o.length>1?(t.oneOf=o.map((e=>({type:e}))),delete t.type):t.type=o[0])}return t}function Ae(t,r){const{specType:n,operationIdFormatter:o,root:i,schemas:a,genericTypes:c,nestedGenerics:p,useAlias:u,genericLabels:l,...h}=r;return Object.entries(t).reduce(((e,[n,o])=>{if(!1!==r.withIgnoredProps&&!Se(o,h)){const i={...r,groups:t?.$forwardGroups||o?.$forwardGroups?r.groups:void 0};e[n]=s("item",o,i),e[n]=Oe(e[n],o,i)}return e}),(0,e.isArray)(t)?[]:{})}function Ee(e,t,r){return e.map((e=>s("item",e,{...t,genericLabels:r.genericLabels})))}function we(e,t,r){return e.isClass?s("class",e,t):s("any",e,{...t,genericLabels:r.genericLabels})}function Te(e,t){return Object.entries(e).reduce(((e,[r,n])=>(e[r=t.get(r)||r]=n,e)),{})}function Re(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function xe(t,r,n){if(n.groups&&n.groups.includes("partial"))return t;let o=function(t,r,n){let o=t.required||[];return o=[...o,...r.$required],r.get("properties")&&(o=Object.entries(r.get("properties")).reduce(((e,[t,r])=>r&&void 0!==r.$selfRequired?r.$selfRequired?e.concat(t):e.filter((e=>e===t)):e),o)),Re((0,e.uniq)(o),r,n)}(t,r,n);return o=(0,e.uniq)(o).reduce(function(e,t,r={}){const{useAlias:n}=r,o=Object.keys(e.properties||{});return(r,i)=>{const s=n&&t.alias.get(i)||i;if(o.includes(s)){const n=t.get("properties")[i],o=e.properties[s];return e.properties[s]=function(e,t){if(!t?.$allow.includes("")&&[].concat(t?.get("type")).includes("string")){const t=e?.minLength;if(void 0===t)return{...e,minLength:1}}return e}(o,n),r.concat(s)}return r}}(t,r,n),[]),t.discriminator&&o.push(t.discriminator.propertyName),o.length?{...t,required:o}:t}function Pe(e,t,r){return e.oneOf&&!1!==r.groups&&(e={...e,oneOf:t.$hooks.alter("oneOf",e.oneOf,[r.groups])}),!(e.oneOf||e.allOf||e.anyOf)||e.items||e.properties||delete e.type,e}r("any",he),r("class",fe),r("generics",ye),r("inheritedClass",me),r("item",ge),r("lazyRef",be),r("map",ve),r("object",Ae),r("anyOf",Ee),r("allOf",Ee),r("oneOf",Ee),r("properties",we),r("items",we),r("additionalProperties",we),r("propertyNames",we),r("contains",we),r("dependencies",we),r("patternProperties",we),r("additionalItems",we),r("not",we),r("definitions",we);const _e=["name","$required","$hooks","_nestedGenerics",$.OPENAPI,$.SWAGGER,$.JSON],Ce=["const"];function je(t,r){const{useAlias:n=!0,schemas:o={}}=r;r={...r,useAlias:n,schemas:o};let i=[...t.keys()].filter((e=>!function(e,{specType:t=$.JSON,customKeys:r=!1}){return _e.includes(e)||e.startsWith("#")&&(!1===r||t!==$.JSON)||t!==$.JSON&&Ce.includes(e)}(e,r))).reduce(((o,i)=>{let c=t.get(i);if("type"===(i=i.replace(/^#/,"")))return{...o,[i]:t.getJsonType()};if(function(t,r,n){return"examples"===t&&(0,e.isObject)(r)&&$.OPENAPI===n.specType}(i,c,r)&&(i="example",c=Object.values(c)[0]),c&&"object"==typeof c&&a(i)){if(c=s(i,c,r,t),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(i,c))return o;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(i,c,n)&&(c=Te(c,t.alias))}return{...o,[i]:c}}),{});return t.isClass&&(i=s("inheritedClass",i,{...r,root:!1,schemas:o,target:t.getComputedType()})),i=s("generics",i,{...r,root:!1,schemas:o}),t.has(r.specType)&&(i={...i,...t.get(r.specType).toJSON(r)}),i=xe(i,t,{...r,useAlias:n}),i=Oe(i,t,r),i=Pe(i,t,r),i}r("schema",je);const Me=["all","checkout","connect","copy","delete","get","head","lock","merge","mkactivity","mkcol","move","m-search","notify","options","param","patch","post","propfind","propatch","purge","put","report","search","subscribe","trace","unlock","unsuscribe"];var Ne,ke;function $e(e){return(...t)=>{const r=e(ue(...t),t);"function"==typeof r&&r(...t)}}function Ie(...t){return $e((r=>{r.store.set("childrenControllers",t),t.forEach((t=>{e.Store.from(t).set("parentController",r.token)}))}))}function De(e,...t){return $e((r=>{var n,o;e=e||(n=r.targetName,void 0===o&&(o={}),function(e,t){return void 0===t&&(t={}),L(e,u({delimiter:"."},t))}(n,u({delimiter:"_"},o))),r.discriminatorAncestor&&r.schema.discriminatorValue(e,...t)}))}function Le(e,t){if(!e)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const r={};let n=!1;const o=(...o)=>{const i=p.from(...o);t&&(i.collectionType=t,i.schema.type(t)),i.type=e,i.itemSchema.type(e),i.schema.assign(r),i.isArray&&n&&(i.schema.set("contains",i.schema.get("items")),i.schema.delete("items"))};return o.MinItems=e=>(r.minItems=e,o),o.MaxItems=e=>(r.maxItems=e,o),o.MinProperties=e=>(r.minProperties=e,o),o.MaxProperties=e=>(r.maxProperties=e,o),o.Contains=()=>(n=!0,o),o.UniqueItems=(e=!0)=>(r.uniqueItems=e,o),o}function He(e){return Le(e,Array)}function Ue(e){return Le(e,Map)}function Fe(e){return Le(e).Contains()}function qe(e){if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return $e((t=>{t.schema.maxItems(e)}))}function Ge(e){if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return $e((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))}function Be(e){if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return $e((t=>{t.schema.minItems(e)}))}function Je(e){if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return $e((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))}function Ke(e=!0){return $e((t=>{t.schema.uniqueItems(e)}))}function We(e){return $e(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function ze(...e){return $e((t=>{t.itemSchema.allOf(e)}))}function Ve(t){return $e((r=>{t&&((0,e.isClass)(t)&&(r.type=t),r.itemSchema.type(t))}))}function Xe(...t){const r=t.find((t=>(0,e.isClass)(t)));return(0,e.useDecorators)(r&&Ve(r),$e(((r,n)=>{r.schema.allow(...t),r.decoratorType===e.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===e.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName)})))}function Qe(...e){return $e((t=>{t.itemSchema.any(...e)}))}function Ze(...e){return $e((t=>{t.itemSchema.anyOf(e)}))}function Ye(e){return $e((t=>{t.itemSchema.const(e)}))}function et(e,t){return $e((r=>{r.itemSchema.customKey(e,t)}))}function tt(e){return $e((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function rt(e){return $e((t=>{t.itemSchema.default(e)}))}function nt(t){return $e(((r,n)=>{switch((0,e.decoratorTypeOf)(n)){case e.DecoratorTypes.PROP:case e.DecoratorTypes.CLASS:r.schema.description(t);break;case e.DecoratorTypes.PARAM:r.parameter.description(t);break;case e.DecoratorTypes.METHOD:r.operation?.description(t)}}))}function ot(){return(0,e.useDecorators)(Ve(),$e((e=>{e.discriminatorKey()})))}function it(e,...t){return $e((r=>{r.itemSchema.enum(e,...t)}))}function st(...e){return $e((t=>{t.schema.examples(e)}))}function at(e){return $e((t=>{t.parameter.examples(e)}))}function ct(e,t=!1){return $e((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)}))}function pt(e,t=!1){return ct(e,t)}function ut(e,t=!0){return ct(e,t)}function lt(e,t=!1){return $e((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)}))}function ht(e,t=!1){return lt(e,t)}function ft(e,t=!0){return lt(e,t)}function yt(e){return $e((t=>{t.itemSchema.format(e)}))}function dt(){return yt(ke.EMAIL)}function mt(){return yt(ke.DATE_TIME)}function gt(){return yt(ke.DATE)}function bt(){return yt(ke.TIME)}function vt(){return yt(ke.URI)}function St(){return yt(ke.URL)}function Ot(e=!0){return $e((t=>{t.schema.$forwardGroups=e}))}!function(e){e.ALL="ALL",e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.HEAD="HEAD",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.CUSTOM="CUSTOM"}(Ne||(Ne={})),function(e){e.DATE_TIME="date-time",e.DATE="date",e.TIME="time",e.EMAIL="email",e.HOSTNAME="hostname",e.IPV4="ipv4",e.IPV6="ipv6",e.URI="uri",e.URL="url",e.URI_REF="uri-reference",e.URI_TEMPLATE="uri-template",e.JSON_POINTER="json-pointer",e.RELATIVE_JSON_POINTER="relative-json-pointer",e.UUID="uuid",e.REGEX="regex"}(ke||(ke={}));var At=n(870),Et=n.n(At),wt=n(427);function Tt(e,t){t=[].concat(t),e=[].concat(e);let r=new Set,n=new Set,o=new Set,i=0,s=e=>{o.add(e.output)};for(let o=0;o<t.length;o++){let a=Et()(String(t[o]),{...wt.options,onResult:s},!0),c=a.state.negated||a.state.negatedExtglob;c&&i++;for(let t of e){let e=a(t,!0);(c?!e.isMatch:e.isMatch)&&(c?r.add(e.output):(r.delete(e.output),n.add(e.output)))}}return!!(i===t.length?[...o]:[...n]).filter((e=>!r.has(e))).length}function Rt(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),n=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&Tt(r,t))||!!n.length&&!Tt(e.filter((e=>!e.startsWith("!"))),t)}function xt(...t){return $e((r=>{switch(r.decoratorType){case e.DecoratorTypes.CLASS:!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{xt(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(t,r);break;case e.DecoratorTypes.PROP:r.schema.$hooks.on("groups",((e,r)=>!(e||!Rt(t,r))||e));break;case e.DecoratorTypes.PARAM:r.parameter.groups=t}}))}function Pt(){return(0,e.StoreSet)("hidden",!0)}const _t=(e,t)=>!0!==t.mongoose;function Ct(e=_t){return $e((t=>{t.schema.ignore(e)}))}function jt(){return $e((e=>{e.itemSchema.type("integer")}))}function Mt(e){if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return $e((t=>{t.itemSchema.maxLength(e)}))}function Nt(e){if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return $e((t=>{t.itemSchema.minLength(e)}))}function kt(e){if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return $e((t=>{t.itemSchema.multipleOf(e)}))}function $t(t){return $e(((r,n)=>{switch((0,e.decoratorTypeOf)(n)){case e.DecoratorTypes.CLASS:r.schema.name(t);break;case e.DecoratorTypes.PARAM:r.parameter.name(t);break;default:r.parent.schema.addAlias(n[1],t)}}))}function It(t,...r){return r=[t,...r],(0,e.useDecorators)(1===r.length&&Ve(r[0]),Qe(null,...r))}function Dt(...e){return $e((t=>{t.itemSchema.oneOf(e),t.type=Object}))}function Lt(){return $e((t=>{switch(t.decoratorType){case e.DecoratorTypes.PARAM:t.required=!1;break;case e.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName)}}))}function Ht(e){return $e((t=>{t.itemSchema.pattern(e)}))}function Ut(e=!0){return $e((t=>{t.itemSchema.readOnly(e)}))}function Ft(e){return $e((t=>{Object.entries(e).forEach((([e,r])=>{t.schema.set(e,r)}))}))}function qt(e,t){return $e((r=>{r.schema.set(e,t)}))}function Gt(e,...t){return Ft({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}function Bt(e=!0,...t){return e?Xe(...t):Lt()}function Jt(...e){return $e((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,n)=>Rt(e,n)?r.filter((e=>e!==t.propertyKey)):r))}))}function Kt(e){return $e((t=>{t.schema.title(e)}))}function Wt(e=!0){return $e((t=>{t.itemSchema.writeOnly(e)}))}function zt(t=Object){if((0,e.isClass)(t)){const{schema:e}=ue(t);return e.properties=function(e){return Object.entries(e).forEach((([e,r])=>{ue(t.prototype,e).schema.assign(r)})),this},e}return A.from({type:t})}function Vt(){return zt(Number)}function Xt(){return zt(Number).integer()}function Qt(){return zt(String)}function Zt(){return zt(Boolean)}function Yt(){return zt(Date).format(ke.DATE)}function er(){return zt(Date).format(ke.DATE_TIME)}function tr(){return zt(Date).format(ke.TIME)}function rr(){return zt(String).format(ke.EMAIL)}function nr(){return zt(String).format(ke.URI)}function or(){return zt(String).format(ke.URL)}function ir(){return zt(Array)}function sr(){return zt(Map).unknown(!0)}function ar(){return zt(Array).uniqueItems(!0)}function cr(e={}){return zt(Object).properties(e)}function pr(...e){return zt().any(...e)}function ur(...e){return zt().anyOf(e)}function lr(...e){return zt().oneOf(e)}function hr(...e){return zt().allOf(e)}function fr(e){try{if(e())return p.from(e()).schema}catch(e){}return new le(e)}function yr(...t){const r=[t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?Qt().enum(Object.values(t)):t))],n=(...e)=>{p.from(...e).nestedGenerics=r};return n.Nested=(...e)=>(r.push(e),n),n}function dr(...e){return t=>{p.from(t).schema.genericLabels=e}}function mr(...t){return $e(((r,n)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.produces(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],mr(...t));break;default:throw new e.UnsupportedDecoratorType(mr,n)}}))}function gr(...t){return(0,e.useDecorators)(mr(...t),(0,e.StoreSet)("acceptMimes",t))}function br(...t){return $e(((r,n)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.consumes(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],br(...t));break;default:throw new e.UnsupportedDecoratorType(br,n)}}))}class vr extends Map{methods;decoratorType;entity;actions=[];constructor(e={}){super(),Object.entries(e).forEach((([e,t])=>{this.set(e,t)}))}addAction(e){return this.actions.push(e),this}build(){const e=(...t)=>this.bind(t,e),t=t=>{return r=(...e)=>{t in this?this[t](...e):this.set(t,e[0])},(...t)=>(r(...t),e);var r};return this.methods.forEach((r=>{e[F(r)]=t(r)})),e}toObject(){return[...this.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{})}getMergedKey(t,r){let n=this.get(t)||r;if(n)return this.decoratorType===e.DecoratorTypes.CLASS&&(n={...n,...r||{}}),{...r||{},...n}}bind(e,t){this.entity=p.from(...e),this.beforeInit(),this.onInit(e,t),this.afterInit()}onInit(e,t){this.forEach(((e,t)=>{this.onMapKey(t,e)}))}onMapKey(e,t){this.entity.set(e,t)}runActions(){return this.actions.forEach((e=>{e(this)})),this}beforeInit(){}afterInit(){}}const Sr=new Map;function Or(e,t){Sr.set(e,t)}function Ar(e){return Sr.get(e)}function Er(t){return t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?Qt().enum(Object.values(t)):t))}class wr extends vr{methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location"];constructor({status:e,model:t}){super(),this.model(t),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&Y(e)&&!this.get("description")&&(this.set("description",Y(e)),this.get("model")||this.model(Ar(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...oe(e)}),this}header(e,t){return this.headers({[e]:t})}location(e,t={}){return this.headers({Location:{...t,value:e}}),this}groups(...e){return this.set("groups",e),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const t=this.get("model");return this.checkPrimitive(t),this.checkCollection(t),this.addAction((t=>{this.get("schema").nestedGenerics.push(Er(e))})),this}of(...t){const r=this.get("model");return this.checkPrimitive(r),this.addAction((()=>{const n=this.get("schema");(0,e.isCollection)(r)?n?.itemSchema({type:t[0]}):n?.nestedGenerics.push(Er(t))})),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction((()=>{this.get("schema").assign(e)})),this}examples(t){return this.set("examples",(0,e.isString)(t)?[t]:t),this}title(e){return this.schema({title:e})}checkPrimitive(t){if((0,e.isPrimitiveOrPrimitiveClass)(t))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(t){if((0,e.isCollection)(t))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const t=this.get("model");let r=this.get("contentType");return!t||(0,e.isPlainObject)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(r=r||"application/json"),r}getStatus(){return this.get("status")||"default"}onInit(t,r){switch((0,e.decoratorTypeOf)(t)){case e.DecoratorTypes.METHOD:this.entity=p.from(...t),this.entity.operation&&this.map();break;case e.DecoratorTypes.CLASS:this.decoratorType=e.DecoratorTypes.CLASS,(0,e.decorateMethodsOf)(t[0],r)}}map(){const t=this.get("model"),{entity:r,decoratorType:n}=this,o=this.entity.operation,i=this.getStatus(),s=o.ensureResponseOf(i),a=this.getContentType();let{description:c=s.get("description")}=this.toObject();c&&(c=n===e.DecoratorTypes.CLASS&&s.get("description")||c,s.description(c));const p=this.getMergedKey("headers",s.get("headers"));return p&&s.headers(p),this.mapMedia(s),(ee(this.get("status"))||"default"===i)&&t&&(r.type=t),a&&o.addProduce(a),this.runActions()}mapMedia(t){const r=this.getContentType(),n=this.get("model"),o=t.getMedia(r||"*/*"),i=o.get("schema")||new A({type:n}),s=this.get("groups"),a=this.get("allowedGroups"),c=this.entity.operation;if(n&&((0,e.isArray)(n)?i.oneOf(n.map((e=>({type:e})))):i.type(n)),this.set("schema",i),o.schema(i),o.groups=s,a){o.allowedGroups=a;const e=new J;e.in("query").name("includes"),e.schema(A.from({type:"array",items:{type:"string",enum:[...a]}})),c.addParameter(-1,e)}const p=this.get("examples");return p&&o.examples(p),o}manyOf(t,r){const n=this.get("model");return this.addAction((()=>{const o=this.get("schema");(0,e.isCollection)(n)?(o.type(n||Object),o.itemSchema().set(t,r)):o.set(t,r)})),this}}function Tr(e,t){return new wr({status:e,model:t}).build()}function Rr(e){return Tr().ContentType(e)}function xr(t=!0){return $e(((r,n)=>{switch((0,e.decoratorTypeOf)(n)){case e.DecoratorTypes.METHOD:r.operation.deprecated(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],xr(t));break;case e.DecoratorTypes.PARAM:r.parameter.set("deprecated",t);break;case e.DecoratorTypes.PROP:r.schema.set("deprecated",t);break;default:throw new e.UnsupportedDecoratorType(xr,n)}}))}function Pr(e,t){return void 0!==t&&(e={[e]:t}),Tr().Headers(e)}function _r(t){const r=new J,n={},o=(i,s,a)=>{const c=p.from(i,s,a);switch(c.decoratorType){case e.DecoratorTypes.PARAM:c.parameter.in(t);break;case e.DecoratorTypes.METHOD:r.in(t),c.operation.addParameter(-1,r),r.schema(A.from(n));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(i,o);break;default:throw new e.UnsupportedDecoratorType(_r,[i,s,a])}};return o.Type=e=>(n.type=e,o),o.Name=e=>(r.name(e),o),o.Description=e=>(r.description(e),o),o.Required=(e=!0)=>(r.required(e),o),o.Pattern=e=>o.Schema({pattern:e.toString()}),o.Schema=e=>(Object.assign(n,e),o),o}function Cr(t){return(...r)=>{const[n,o,i]=r,s=e.Metadata.getParamTypes(n,o)[i]===Array,a=[t="object"==typeof t?void 0:t,!s&&"0"].filter(Boolean).join(".");(0,e.useDecorators)(_r(j.FILES),$t(a),(0,e.useMethodDecorators)(Tr(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),br("multipart/form-data")))(...r)}}function jr(e,t){return Tr().Location(e,t)}function Mr(t){return $e(((r,n)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Mr,n);r.operation.operationId(t)}))}function Nr(t,r="/"){return $e(((n,o)=>{if(n.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Nr,o);n.operation.addOperationPath(t.toUpperCase(),r)}))}function kr(){return xt("partial")}function $r(t){return $e(((r,n)=>{if(r.decoratorType!==e.DecoratorTypes.CLASS)throw new e.UnsupportedDecoratorType($r,n);r.path=t}))}function Ir(...t){const{status:r,url:n,meta:o}=t.reduce(((t,r)=>(0,e.isNumber)(r)?(t.status=r,t):(0,e.isString)(r)?(t.url=r,t):(t.meta=r,t)),{status:302,url:"",meta:{}});return(0,e.useDecorators)(Tr(r).Location(n,o),$e((e=>{e.operation?.setRedirection(r)})))}function Dr(e){let t,r;const n=e.filter((e=>"string"==typeof e&&Me.includes(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:n}}class Lr extends vr{methods=["name","description","summary","method","id","use","useAfter","useBefore"];beforeInit(){const e=this.get("path"),t=Ne[this.get("method")]||Ne.CUSTOM;e&&this.entity.operation.addOperationPath(t,e)}onMapKey(e,t){switch(e){case"name":case"id":return void this.entity.operation.operationId(t);case"summary":return void this.entity.operation.summary(t);case"description":return void this.entity.operation.description(t);case"use":return void this.entity.use(t);case"useAfter":return void this.entity.after(t);case"useBefore":return void this.entity.before(t)}return super.onMapKey(e,t)}}function Hr(...e){const t=Dr(e);return new Lr(t).build()}function Ur(e="/",...t){return Hr(...[Ne.ALL,e].concat(t))}function Fr(e="/",...t){return Hr(...[Ne.GET,e].concat(t))}function qr(e="/",...t){return Hr(...[Ne.POST,e].concat(t))}function Gr(e="/",...t){return Hr(...[Ne.PUT,e].concat(t))}function Br(e="/",...t){return Hr(...[Ne.DELETE,e].concat(t))}function Jr(e="/",...t){return Hr(...[Ne.HEAD,e].concat(t))}function Kr(e="/",...t){return Hr(...[Ne.PATCH,e].concat(t))}function Wr(e="/",...t){return Hr(...[Ne.OPTIONS,e].concat(t))}function zr(t,...r){return $e(((n,o)=>{switch(n.decoratorType){case e.DecoratorTypes.METHOD:n.operation.addSecurityScopes(t,r);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(o[0],zr(t,...r));break;default:throw new e.UnsupportedDecoratorType(zr,o)}}))}function Vr(e,t){return Tr(e,t)}function Xr(t){return $e(((r,n)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Xr,n);r.operation.summary(t)}))}function Qr(...t){return $e(((r,n)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.addTags(function(e){return e.map((e=>"string"==typeof e?{name:e}:e))}(t));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],Qr(...t));break;default:throw new e.UnsupportedDecoratorType(Qr,n)}}))}function Zr(t,r){return(0,e.StoreSet)("view",{path:t,options:r})}class Yr extends Map{setOperationPath(e){if(e.method!==Ne.CUSTOM){const t=this.getKey(e.method,e.path);this.set(t,e)}}getKey=(e,t)=>`${e}-${t}`}function en(e,t){if(e instanceof RegExp||t instanceof RegExp){if(!e)return t;if(!t)return e;const r=e instanceof RegExp?e:new RegExp(e,"gi"),n=t instanceof RegExp?t:new RegExp(t,"gi");return new RegExp(r.source+n.source,(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":""))}e&&t&&e.endsWith("/")&&t.startsWith("/")&&(t=t.slice(1));const r=(e||"")+(t||"");return r.endsWith("/")&&r.length>1?r.slice(0,-1):r}class tn{token;endpoint;operationPath;basePath;paramsTypes;constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){return this.operationPath?.path}get fullPath(){return en(this.basePath,this.path)}get method(){return this.operationPath?.method||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}function rn(e){return e.split("/").filter(Boolean).join("/")}function nn(e,t){return e.map((e=>t.parameters.find((t=>t.in===e.in&&t.name===e.name))||e)).concat(...t.parameters.filter((e=>"path"!==e.in)))}function on(e){const t=e.isStore?e:ue(e);if(!t.$operations){const e=new Yr;t.$operations=new Map,de(t).forEach((e=>{e.children.forEach((e=>{e instanceof ce&&!t.$operations.has(e.propertyKey)&&t.$operations.set(e.propertyKey,e)}))})),t.$operations.forEach((t=>{t.operation.operationPaths.forEach((t=>{e.setOperationPath(t)}))})),e.clear()}return t.$operations}function sn(e,t=""){t instanceof RegExp&&(t=t.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const r=[],n=[];let o=!1,i="";return function(e){let t=0;return e.split("").filter((e=>{"("===e&&t++;const r=0===t;return")"===e&&t--,r})).join("").split("/").filter((e=>!!e))}(`${e}${t}`).map((e=>{const t=e.replace(":","").replace("?","");if(e.includes(":")){const s=e.includes("?");s&&!o&&(o=!0,n.push({path:i,parameters:[].concat(r)}));const{prefix:a,name:c,postfix:p}=function(e){const[t,r]=e.split("="),n=(r||t).split(".");return{prefix:r&&t?`${t}=`:"",name:n.splice(0,1)[0],postfix:n.length?`.${n.join(".")}`:""}}(t);i+=`/${a}{${c}}${p}`,r.push({in:"path",name:c,type:"string",required:!0}),s&&o&&n.push({path:i,parameters:[].concat(r)})}else i+=`/${e}`})),n.length?n:[{path:i,parameters:[].concat(r)}]}function an(e,t,{rootPath:r,specType:n,operationId:o,defaultTags:i,tags:s,path:a,method:c}){const p=sn(r,a).map((({path:e,parameters:t})=>(e=e||"/",n===$.OPENAPI&&(t=t.map((({type:e,...t})=>({...t,schema:{type:e}})))),{path:e,parameters:t})));return p.reduce(((e,{path:r,parameters:n})=>{n=nn(n,t),r=r||"/";const a=t.tags?.length?t.tags:[i];return e.paths[r]={...e.paths[r],[c.toLowerCase()]:{operationId:t.operationId||o(r),...t,tags:a.map((({name:e})=>e)),parameters:n}},s.push(...a),e}),e)}function cn(e,t){return 0===t?e.toLowerCase():U(e,t)}function pn(e,t){return void 0===t&&(t={}),F(e,u({transform:cn},t))}function un(e=""){const t=new Map;return(r,n,o="")=>{const i=((t,r)=>{const n=(e||"%c.%m").replace(/%c/,t).replace(/%m/,r);return""===e?pn(n):n})(r,n),s=r+n;if(!t.has(s))return t.set(s,0),i;const a=o.match(/{(\w+)}/gi);if(a){const e=r+n+a[0];if(!t.has(e))return t.set(e,0),pn(`${i} By ${a}`)}const c=t.get(s)+1;return t.set(s,c),`${i}_${c}`}}const ln=(0,e.mergeReducerBuilder)(((e,t)=>e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),hn=(0,e.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),fn=(0,e.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),yn=(0,e.mergeReducerBuilder)(((e,t)=>e.name===t.name)),dn={security:fn,parameters:hn,oneOf:ln,anyOf:ln,allOf:ln,tags:yn};function mn(t,r){return(0,e.deepMerge)(t,r,{reducers:dn,cleanUndefinedProps:!0})}const gn=new Map;function bn(t,r={}){if(r={...r,operationIdFormatter:r.operationIdFormatter||un(r.operationIdPattern),root:!1},(0,e.isArray)(t)){let e={};return r={...r,specType:$.OPENAPI,paths:{},tags:[],schemas:{},append(t){e=mn(e,t)}},t.forEach((({token:e,...t})=>{const n=bn(e,{...r,...t});r.append(n)})),e}return function(e,t,r){gn.has(e)||gn.set(e,new Map);const n=gn.get(e),o=JSON.stringify(t);return n.has(o)||n.set(o,r()),n.get(o)}(t,r,(()=>function(t,r){const n=ue(t),{schemas:o={},paths:i={},rootPath:s="/",tags:a=[]}=r,c=$.OPENAPI,p=n.path,u=(0,e.cleanObject)({name:n.schema.getName(),description:n.schema.get("description")}),l={paths:i};return on(t).forEach((e=>{if(e.store.get("hidden"))return;const t=e.operation.toJSON({...r,specType:c,schemas:o});e.operation.operationPaths.forEach((({path:n,method:o})=>{o&&an(l,t,{rootPath:rn(s+p),path:n,method:o,defaultTags:u,tags:a,specType:c,operationId:t=>r.operationIdFormatter(e.parent.schema.get("name")||e.parent.targetName,e.propertyName,t)})}))})),l.tags=(0,e.uniqBy)(a,"name"),Object.keys(o).length&&(l.components={schemas:o}),l}(t,r)))}function vn(e){return e.startsWith("3.")?$.OPENAPI:$.SWAGGER}function Sn(e){return"openapi"in e?$.OPENAPI:$.SWAGGER}function On(t){const{title:r,description:n,version:o,termsOfService:i,contact:s,license:a}=t;return(0,e.cleanObject)({version:o,title:r,description:n,termsOfService:i,contact:s,license:a})}function An(t,{version:r,specVersion:n,acceptMimes:o=["application/json"]}){const{paths:i,security:s,tags:a,host:c,basePath:p,schemes:u,consumes:l=[],produces:h=["application/json"],definitions:f,parameters:y,responses:d,securityDefinitions:m,externalDocs:g}=t;return{swagger:n,consumes:(0,e.uniq)([...o,...l]),produces:(0,e.uniq)([...h]),info:On((0,e.getValue)(t,"info",{})),paths:i,host:c,basePath:p,schemes:u,definitions:f,parameters:y,responses:d,security:s,securityDefinitions:m,tags:a,externalDocs:g}}function En(t,{specVersion:r}){const{servers:n,paths:o,components:i,security:s,tags:a,externalDocs:c}=t;return{openapi:r,info:On((0,e.getValue)(t,"info",{})),servers:n,paths:o,components:i,security:s,tags:a,externalDocs:c}}function wn(t,{fileSpec:r,acceptMimes:n,specVersion:o,version:i}){const s={specVersion:o=o||(0,e.getValue)(t,"openapi",(0,e.getValue)(t,"swagger","2.0")),acceptMimes:n};switch(vn(o)){case $.OPENAPI:t=En(t,s),r=r?En(r,s):r;break;default:case $.SWAGGER:t=An(t,s),r=r?An(r,s):r}return t=mn(t,r),(0,e.setValue)(t,"info.title",(0,e.getValue)(t,"info.title","Api documentation")),(0,e.setValue)(t,"info.version",(0,e.getValue)(t,"info.version",i)),t}const Tn=["get","put","post","delete","options","head","patch","trace"],Rn=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],xn=["type","items"],Pn=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,_n={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function Cn(e){if(Array.isArray(e))e.forEach(Cn);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):Cn(e[t])}function jn(e){return new RegExp(Pn,"i").test(e)}function Mn(e){const t=Object.keys(_n).map((e=>_n[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||jn(e)))}function Nn(e){function t(e){const{scheme:t,type:r,name:n,bearerFormat:o,flows:i,...s}=e;switch(r){case"http":if("basic"===t)return{...s,type:t};if("bearer"===t)return{...s,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const e=Object.keys(i)[0],n=i[e];let o=e;return"clientCredentials"===o?o="application":"authorizationCode"===o&&(o="accessCode"),{type:r,flow:o,authorizationUrl:n.authorizationUrl,tokenUrl:n.tokenUrl,scopes:n.scopes}}}return Object.entries(e).reduce(((e,[r,n])=>({...e,[r]:t(n)})),{})}function kn(e){let t=e.url;const r=e.variables||{};for(const e in r){const n=r[e]||{};if(n.default){const r=RegExp(`{${e}}`,"g");t=t.replace(r,n.default)}}const n=new URL(t);return{host:n.host?n.host:void 0,basePath:n.pathname,schemes:null!==n.protocol?[n.protocol.substring(0,n.protocol.length-1)]:void 0}}class $n{spec;constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?kn(e):{}}resolveReference(e,t,r){if(!t||!t.$ref)return t;const n=t.$ref;if(n.startsWith("#")){const t=n.split("/").map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~")));t.shift();let o=e;return t.forEach((e=>{o=o[e]})),r?JSON.parse(JSON.stringify(o)):o}}convert(){const t={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,Cn(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],(0,e.cleanObject)({...t,...this.spec})}convertOperations(e,t){return Object.entries(e).reduce(((e,[r,n])=>{const o=e[r]=this.resolveReference({...t,paths:e},n,!0);return this.convertParameters(o),Object.keys(o).forEach((r=>{if(Tn.indexOf(r)>=0){const n=o[r]=this.resolveReference({...t,paths:e},o[r],!0);this.convertOperationParameters(n),this.convertResponses(n)}})),e}),e)}convertOperationParameters(e){let t,r,n,o;if(e.parameters=e.parameters||[],e.requestBody){let i=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const t=Mn(e.requestBody.content)[0],r={content:{}},n=e.requestBody.content[t];n&&n.schema&&n.schema.$ref&&!n.schema.$ref.startsWith("#")&&(i=this.resolveReference(this.spec,n.schema,!0),r.content[`${t}`]={schema:i},i=r)}if(i.name="body",t=i.content,t&&Object.keys(t).length){if(n=Object.keys(t).filter((e=>e.indexOf("/")>0)),o=n.filter((e=>e.indexOf("*")<0)),r=Mn(t)[0],delete i.content,[_n.APPLICATION_X_WWW_URLENCODED,_n.MULTIPART_FORM_DATA].includes(r))if(e.consumes=o,i.in="formData",i.schema=t[r].schema,i.schema=this.resolveReference(this.spec,i.schema,!0),"object"===i.schema.type&&i.schema.properties){const t=i.schema.required||[];Object.keys(i.schema.properties).forEach((r=>{const n=i.schema.properties[r];if(!n.readOnly){const o={name:r,in:"formData",schema:n};t.indexOf(r)>=0&&(o.required=!0),e.parameters?.push(o)}}))}else e.parameters.push(i);else r?(e.consumes=o,i.in="body",i.schema=t[r].schema,e.parameters.push(i)):n&&(e.consumes=o||["application/octet-stream"],i.in="body",i.name=i.name||"file",delete i.type,i.schema=t[n[0]].schema||{type:"string",format:"binary"},e.parameters.push(i));i.schema&&this.convertSchema(i.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){void 0!==e.parameters&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach(((t,r)=>{if("body"!==(t=e.parameters[r]=this.resolveReference(this.spec,t,!1)).in){if(this.copySchemaProperties(t,Rn),this.copySchemaProperties(t,xn),this.copySchemaXProperties(t),!t.description){const e=this.resolveReference(this.spec,t.schema,!1);e&&e.description&&(t.description=e.description)}void 0!==t.example&&(t["x-example"]=t.example),delete t.schema,delete t.allowReserved,delete t.example}if("array"===t.type)switch(t.style||("query"===t.in||"cookie"===t.in?"form":"simple")){case"matrix":t.collectionFormat=t.explode?void 0:"csv";break;case"label":t.collectionFormat=void 0;break;case"simple":t.collectionFormat="csv";break;case"spaceDelimited":t.collectionFormat="ssv";break;case"pipeDelimited":t.collectionFormat="pipes";break;case"deepOpbject":t.collectionFormat="multi";break;case"form":t.collectionFormat=!1===t.explode?"csv":"multi"}delete t.style,delete t.explode})))}copySchemaProperties(e,t){let r=this.resolveReference(this.spec,e.schema,!0);r&&t.forEach((t=>{const n=r[t];"additionalProperties"===t&&"boolean"==typeof n||void 0!==n&&(e[t]=n)}))}copySchemaXProperties(e){let t=this.resolveReference(this.spec,e.schema,!0);t&&Object.keys(t).forEach((r=>{Reflect.hasOwnProperty.call(t,r)&&!Reflect.hasOwnProperty.call(e,r)&&r.startsWith("x-")&&(e[r]=t[r])}))}convertResponses(e){Object.keys(e.responses||{}).forEach((t=>{const r=e.responses[t]=this.resolveReference(this.spec,e.responses[t],!0);if(r.content){let t=null,n=null;if(Object.keys(r.content).forEach((o=>{const i=o.indexOf("*")<0?o:"application/octet-stream";e.produces?e.produces.indexOf(i)<0&&e.produces.push(i):e.produces=[i];const s=r.content[o];t=t||s.schema,!n&&jn(i)&&(n=s.schema),s.example&&(r.examples=r.examples||{},r.examples[i]=s.example)})),t){r.schema=n||t;const e=this.resolveReference(this.spec,r.schema,!0);e&&r.schema.$ref&&!r.schema.$ref.startsWith("#")&&(r.schema=e),this.convertSchema(r.schema,"response")}}Object.keys(r.headers||{}).forEach((e=>{const t=this.resolveReference(this.spec,r.headers[e],!0);t.schema&&(t.type=t.schema.type,t.format=t.schema.format,delete t.schema),r.headers[e]=t})),delete r.content}))}convertSchema(e,t){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const r in e.allOf)this.convertSchema(e.allOf[r],t);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach((r=>{!0===e.properties[r].writeOnly&&"response"===t?delete e.properties[r]:(this.convertSchema(e.properties[r],t),delete e.properties[r].writeOnly)}));break;case"array":e.items&&this.convertSchema(e.items,t)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),void 0!==e.deprecated&&(void 0===e["x-deprecated"]&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach((e=>{this.convertSchema(this.spec.definitions[e])})),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach((t=>{const r=e[t];if("string"!=typeof r)return void console.warn(`Ignoring ${r} for ${t} in discriminator.mapping.`);let n;if(/^[a-zA-Z0-9._-]+$/.test(r))try{n=this.resolveReference(this.spec,{$ref:`#/components/schemas/${r}`},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} as schema name in discriminator.mapping: ${e}`)}if(!n)try{n=this.resolveReference(this.spec,{$ref:r},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} in discriminator.mapping: ${e}`)}n?(n["x-discriminator-value"]=t,n["x-ms-discriminator-value"]=t):console.warn(`Unable to resolve ${r} for ${t} in discriminator.mapping.`)}))}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=Nn(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function In(e){return new $n(e).convert()}async function Dn({tokens:t,...r}){const{version:n="1.0.0",acceptMimes:o,specPath:i,specVersion:s}=r,a=wn((0,e.getValue)(r,"spec",{}),{fileSpec:{},version:n,specVersion:s,acceptMimes:o}),c=Sn(a),p=mn(a,bn(t,r));return c===$.SWAGGER?In(p):p}const Ln="$cache:schemes";function Hn(e,t={}){const r=ue(e);return t={endpoint:!0,groups:[],...t,specType:t.specType||$.JSON,schemas:{}},"parameter"===r.decoratorType&&(t={...t,genericTypes:r.nestedGenerics[0],nestedGenerics:r.nestedGenerics,groups:r.parameter?.groups}),function(e,t){const r=e.store.get(Ln)||new Map,n=function(e){return JSON.stringify(e)}(t);if(!r.has(n)){const o=s("schema",e.schema,t);Object.keys(t.schemas).length&&(o.definitions=t.schemas),r.set(n,o)}return e.store.set(Ln,r),r.get(n)}(r,t)}function Un(e,t={}){const r=e.isStore?e:ue(e),n=en(t.basePath,r.path);let o=[];return t.withChildren&&(o=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(Un(r,{...t,basePath:n}))),o)),[...on(e).values()].reduce(((t,r)=>{const{operation:o}=r;return o&&o.operationPaths.forEach((o=>{t.push(new tn({basePath:n,token:e,endpoint:r,operationPath:o}))})),t}),o)}function Fn(e){const t=e.isStore?e:ue(e);if(!t.$properties){const e=de(t);t.$properties=new Map,e.forEach((e=>{e.children.forEach((e=>{t.$properties.has(e.propertyKey)||t.$properties.set(e.propertyKey,e)}))}))}return t.$properties}function qn(e,t={}){const r=Fn(e),n=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&Se(e.itemSchema,t)||n.set(r,e)})),n}})(),o})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@tsed/core")):"function"==typeof define&&define.amd?define(["@tsed/core"],t):"object"==typeof exports?exports.schema=t(require("@tsed/core")):e.schema=t(e["@tsed/core"])}(self,(e=>(()=>{"use strict";var t={379:e=>{const t="\\\\/",r=`[^${t}]`,s="\\.",n="\\/",i="[^/]",o=`(?:${n}|$)`,a=`(?:^|${n})`,c=`${s}{1,2}${o}`,u={DOT_LITERAL:s,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:n,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${s})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${s}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${n}]`,STAR:`${i}*?`,START_ANCHOR:a,SEP:"/"},p={...u,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${s}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${s})`,NO_DOTS:`(?!(?:^|[${t}])${s}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${s}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${s}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?p:u}},390:(e,t,r)=>{const s=r(379),n=r(290),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:u}=s,p=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>n.escapeRegex(e))).join("..")}return r},h=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,l=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=u[e]||e;const r={...t},l="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let m=e.length;if(m>l)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${l}`);const d={type:"bos",value:"",output:r.prepend||""},f=[d],y=r.capture?"":"?:",g=s.globChars(r.windows),O=s.extglobChars(g),{DOT_LITERAL:S,PLUS_LITERAL:b,SLASH_LITERAL:R,ONE_CHAR:T,DOTS_SLASH:A,NO_DOT:E,NO_DOT_SLASH:v,NO_DOTS_SLASH:x,QMARK:C,QMARK_NO_DOT:P,STAR:w,START_ANCHOR:$}=g,_=e=>`(${y}(?:(?!${$}${e.dot?A:S}).)*?)`,M=r.dot?"":E,N=r.dot?C:P;let D=!0===r.bash?_(r):w;r.capture&&(D=`(${D})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const L={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};e=n.removePrefix(e,L),m=e.length;const k=[],I=[],H=[];let j,G=d;const q=()=>L.index===m-1,U=L.peek=(t=1)=>e[L.index+t],K=L.advance=()=>e[++L.index],J=()=>e.slice(L.index+1),B=(e="",t=0)=>{L.consumed+=e,L.index+=t},F=e=>{L.output+=null!=e.output?e.output:e.value,B(e.value)},W=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)K(),L.start++,e++;return e%2!=0&&(L.negated=!0,L.start++,!0)},V=e=>{L[e]++,H.push(e)},X=e=>{L[e]--,H.pop()},z=e=>{if("globstar"===G.type){const t=L.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(L.output=L.output.slice(0,-G.output.length),G.type="star",G.value="*",G.output=D,L.output+=G.output)}if(k.length&&"paren"!==e.type&&!O[e.value]&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&F(e),G&&"text"===G.type&&"text"===e.type)return G.value+=e.value,void(G.output=(G.output||"")+e.value);e.prev=G,f.push(e),G=e},Q=(e,t)=>{const s={...O[t],conditions:1,inner:""};s.prev=G,s.parens=L.parens,s.output=L.output;const n=(r.capture?"(":"")+s.open;V("parens"),z({type:e,value:t,output:L.output?"":T}),z({type:"paren",extglob:!0,value:K(),output:n}),k.push(s)},Z=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let s=D;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=_(r)),(s!==D||q()||/^\)+$/.test(J()))&&(t=e.close=`)$))${s}`),"bos"===e.prev.type&&q()&&(L.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:j,output:t}),X("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,i=e.replace(c,((e,t,r,n,i,o)=>"\\"===n?(s=!0,e):"?"===n?t?t+n+(i?C.repeat(i.length):""):0===o?N+(i?C.repeat(i.length):""):C.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?t?t+n+(i?D:""):D:t?e:`\\${e}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?(L.output=e,L):(L.output=n.wrapOutput(i,L,t),L)}for(;!q();){if(j=K(),"\0"===j)continue;if("\\"===j){const e=U();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){j+="\\",z({type:"text",value:j});continue}const t=/^\\+/.exec(J());let s=0;if(t&&t[0].length>2&&(s=t[0].length,L.index+=s,s%2!=0&&(j+="\\")),!0===r.unescape?j=K()||"":j+=K()||"",0===L.brackets){z({type:"text",value:j});continue}}if(L.brackets>0&&("]"!==j||"["===G.value||"[^"===G.value)){if(!1!==r.posix&&":"===j){const e=G.value.slice(1);if(e.includes("[")&&(G.posix=!0,e.includes(":"))){const e=G.value.lastIndexOf("["),t=G.value.slice(0,e),r=G.value.slice(e+2),s=o[r];if(s){G.value=t+s,L.backtrack=!0,K(),d.output||1!==f.indexOf(G)||(d.output=T);continue}}}("["===j&&":"!==U()||"-"===j&&"]"===U())&&(j=`\\${j}`),"]"!==j||"["!==G.value&&"[^"!==G.value||(j=`\\${j}`),!0===r.posix&&"!"===j&&"["===G.value&&(j="^"),G.value+=j,F({value:j});continue}if(1===L.quotes&&'"'!==j){j=n.escapeRegex(j),G.value+=j,F({value:j});continue}if('"'===j){L.quotes=1===L.quotes?0:1,!0===r.keepQuotes&&z({type:"text",value:j});continue}if("("===j){V("parens"),z({type:"paren",value:j});continue}if(")"===j){if(0===L.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=k[k.length-1];if(e&&L.parens===e.parens+1){Z(k.pop());continue}z({type:"paren",value:j,output:L.parens?")":"\\)"}),X("parens");continue}if("["===j){if(!0!==r.nobracket&&J().includes("]"))V("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));j=`\\${j}`}z({type:"bracket",value:j});continue}if("]"===j){if(!0===r.nobracket||G&&"bracket"===G.type&&1===G.value.length){z({type:"text",value:j,output:`\\${j}`});continue}if(0===L.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));z({type:"text",value:j,output:`\\${j}`});continue}X("brackets");const e=G.value.slice(1);if(!0===G.posix||"^"!==e[0]||e.includes("/")||(j=`/${j}`),G.value+=j,F({value:j}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(G.value);if(L.output=L.output.slice(0,-G.value.length),!0===r.literalBrackets){L.output+=t,G.value=t;continue}G.value=`(${y}${t}|${G.value})`,L.output+=G.value;continue}if("{"===j&&!0!==r.nobrace){V("braces");const e={type:"brace",value:j,output:"(",outputIndex:L.output.length,tokensIndex:L.tokens.length};I.push(e),z(e);continue}if("}"===j){const e=I[I.length-1];if(!0===r.nobrace||!e){z({type:"text",value:j,output:j});continue}let t=")";if(!0===e.dots){const e=f.slice(),s=[];for(let t=e.length-1;t>=0&&(f.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=p(s,r),L.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=L.output.slice(0,e.outputIndex),s=L.tokens.slice(e.tokensIndex);e.value=e.output="\\{",j=t="\\}",L.output=r;for(const e of s)L.output+=e.output||e.value}z({type:"brace",value:j,output:t}),X("braces"),I.pop();continue}if("|"===j){k.length>0&&k[k.length-1].conditions++,z({type:"text",value:j});continue}if(","===j){let e=j;const t=I[I.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:j,output:e});continue}if("/"===j){if("dot"===G.type&&L.index===L.start+1){L.start=L.index+1,L.consumed="",L.output="",f.pop(),G=d;continue}z({type:"slash",value:j,output:R});continue}if("."===j){if(L.braces>0&&"dot"===G.type){"."===G.value&&(G.output=S);const e=I[I.length-1];G.type="dots",G.output+=j,G.value+=j,e.dots=!0;continue}if(L.braces+L.parens===0&&"bos"!==G.type&&"slash"!==G.type){z({type:"text",value:j,output:S});continue}z({type:"dot",value:j,output:S});continue}if("?"===j){if((!G||"("!==G.value)&&!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("qmark",j);continue}if(G&&"paren"===G.type){const e=U();let t=j;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===G.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(J()))&&(t=`\\${j}`),z({type:"text",value:j,output:t});continue}if(!0!==r.dot&&("slash"===G.type||"bos"===G.type)){z({type:"qmark",value:j,output:P});continue}z({type:"qmark",value:j,output:C});continue}if("!"===j){if(!0!==r.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Q("negate",j);continue}if(!0!==r.nonegate&&0===L.index){W();continue}}if("+"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("plus",j);continue}if(G&&"("===G.value||!1===r.regex){z({type:"plus",value:j,output:b});continue}if(G&&("bracket"===G.type||"paren"===G.type||"brace"===G.type)||L.parens>0){z({type:"plus",value:j});continue}z({type:"plus",value:b});continue}if("@"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){z({type:"at",extglob:!0,value:j,output:""});continue}z({type:"text",value:j});continue}if("*"!==j){"$"!==j&&"^"!==j||(j=`\\${j}`);const e=a.exec(J());e&&(j+=e[0],L.index+=e[0].length),z({type:"text",value:j});continue}if(G&&("globstar"===G.type||!0===G.star)){G.type="star",G.star=!0,G.value+=j,G.output=D,L.backtrack=!0,L.globstar=!0,B(j);continue}let t=J();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",j);continue}if("star"===G.type){if(!0===r.noglobstar){B(j);continue}const s=G.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){z({type:"star",value:j,output:""});continue}const a=L.braces>0&&("comma"===s.type||"brace"===s.type),c=k.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){z({type:"star",value:j,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[L.index+4];if(r&&"/"!==r)break;t=t.slice(3),B("/**",3)}if("bos"===s.type&&q()){G.type="globstar",G.value+=j,G.output=_(r),L.output=G.output,L.globstar=!0,B(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&q()){L.output=L.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=_(r)+(r.strictSlashes?")":"|$)"),G.value+=j,L.globstar=!0,L.output+=s.output+G.output,B(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";L.output=L.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=`${_(r)}${R}|${R}${e})`,G.value+=j,L.output+=s.output+G.output,L.globstar=!0,B(j+K()),z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){G.type="globstar",G.value+=j,G.output=`(?:^|${R}|${_(r)}${R})`,L.output=G.output,L.globstar=!0,B(j+K()),z({type:"slash",value:"/",output:""});continue}L.output=L.output.slice(0,-G.output.length),G.type="globstar",G.output=_(r),G.value+=j,L.output+=G.output,L.globstar=!0,B(j);continue}const s={type:"star",value:j,output:D};!0!==r.bash?!G||"bracket"!==G.type&&"paren"!==G.type||!0!==r.regex?(L.index!==L.start&&"slash"!==G.type&&"dot"!==G.type||("dot"===G.type?(L.output+=v,G.output+=v):!0===r.dot?(L.output+=x,G.output+=x):(L.output+=M,G.output+=M),"*"!==U()&&(L.output+=T,G.output+=T)),z(s)):(s.output=j,z(s)):(s.output=".*?","bos"!==G.type&&"slash"!==G.type||(s.output=M+s.output),z(s))}for(;L.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));L.output=n.escapeLast(L.output,"["),X("brackets")}for(;L.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));L.output=n.escapeLast(L.output,"("),X("parens")}for(;L.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));L.output=n.escapeLast(L.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==G.type&&"bracket"!==G.type||z({type:"maybe_slash",value:"",output:`${R}?`}),!0===L.backtrack){L.output="";for(const e of L.tokens)L.output+=null!=e.output?e.output:e.value,e.suffix&&(L.output+=e.suffix)}return L};l.fastpaths=(e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;const{DOT_LITERAL:c,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:l,NO_DOT:m,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:y,START_ANCHOR:g}=s.globChars(r.windows),O=r.dot?d:m,S=r.dot?f:m,b=r.capture?"":"?:";let R=!0===r.bash?".*?":y;r.capture&&(R=`(${R})`);const T=e=>!0===e.noglobstar?R:`(${b}(?:(?!${g}${e.dot?l:c}).)*?)`,A=e=>{switch(e){case"*":return`${O}${h}${R}`;case".*":return`${c}${h}${R}`;case"*.*":return`${O}${R}${c}${h}${R}`;case"*/*":return`${O}${R}${p}${h}${S}${R}`;case"**":return O+T(r);case"**/*":return`(?:${O}${T(r)}${p})?${S}${h}${R}`;case"**/*.*":return`(?:${O}${T(r)}${p})?${S}${R}${c}${h}${R}`;case"**/.*":return`(?:${O}${T(r)}${p})?${c}${h}${R}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=A(t[1]);if(!r)return;return r+c+t[2]}}},E=n.removePrefix(e,{negated:!1,prefix:""});let v=A(E);return v&&!0!==r.strictSlashes&&(v+=`${p}?`),v},e.exports=l},555:(e,t,r)=>{const s=r(270),n=r(390),i=r(290),o=r(379),a=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>a(e,t,r))),n=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return n}const s=(n=e)&&"object"==typeof n&&!Array.isArray(n)&&e.tokens&&e.input;var n;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},o=i.windows,c=s?a.compileRe(e,t):a.makeRe(e,t,!1,!0),u=c.state;delete c.state;let p=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=a(i.ignore,e,r)}const h=(r,s=!1)=>{const{isMatch:n,match:h,output:l}=a.test(r,c,t,{glob:e,posix:o}),m={glob:e,state:u,regex:c,posix:o,input:r,output:l,match:h,isMatch:n};return"function"==typeof i.onResult&&i.onResult(m),!1===n?(m.isMatch=!1,!!s&&m):p(r)?("function"==typeof i.onIgnore&&i.onIgnore(m),m.isMatch=!1,!!s&&m):("function"==typeof i.onMatch&&i.onMatch(m),!s||m)};return r&&(h.state=u),h};a.test=(e,t,r,{glob:s,posix:n}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const o=r||{},c=o.format||(n?i.toPosixSlashes:null);let u=e===s,p=u&&c?c(e):e;return!1===u&&(p=c?c(e):e,u=p===s),!1!==u&&!0!==o.capture||(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,n):t.exec(p)),{isMatch:Boolean(u),match:u,output:p}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map((e=>a.parse(e,t))):n(e,{...t,fastpaths:!1}),a.scan=(e,t)=>s(e,t),a.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const n=t||{},i=n.contains?"":"^",o=n.contains?"":"$";let c=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=a.toRegex(c,t);return!0===s&&(u.state=e),u},a.makeRe=(e,t,r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let o,c={negated:!1,fastpaths:!0},u="";return e.startsWith("./")&&(e=e.slice(2),u=c.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(o=n.fastpaths(e,t)),void 0===o?(c=n(e,t),c.prefix=u+(c.prefix||"")):c.output=o,a.compileRe(c,t,r,s)},a.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,e.exports=a},270:(e,t,r)=>{const s=r(290),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:y,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:O}=r(379),S=e=>e===p||e===o,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},R=e.length-1,T=!0===r.parts||!0===r.scanToEnd,A=[],E=[],v=[];let x,C,P=e,w=-1,$=0,_=0,M=!1,N=!1,D=!1,L=!1,k=!1,I=!1,H=!1,j=!1,G=!1,q=0,U={value:"",depth:0,isGlob:!1};const K=()=>w>=R,J=()=>(x=C,P.charCodeAt(++w));for(;w<R;){let e;if(C=J(),C!==o){if(!0===I||C===h){for(q++;!0!==K()&&(C=J());)if(C!==o)if(C!==h){if(!0!==I&&C===c&&(C=J())===c){if(M=U.isBrace=!0,D=U.isGlob=!0,G=!0,!0===T)continue;break}if(!0!==I&&C===a){if(M=U.isBrace=!0,D=U.isGlob=!0,G=!0,!0===T)continue;break}if(C===y&&(q--,0===q)){I=!1,M=U.isBrace=!0,G=!0;break}}else q++;else H=U.backslashes=!0,J();if(!0===T)continue;break}if(C!==p){if(!0!==r.noext&&!0==(C===d||C===i||C===n||C===f||C===u)&&P.charCodeAt(w+1)===l){if(D=U.isGlob=!0,L=U.isExtglob=!0,G=!0,!0===T){for(;!0!==K()&&(C=J());)if(C!==o){if(C===g){D=U.isGlob=!0,G=!0;break}}else H=U.backslashes=!0,C=J();continue}break}if(C===n){if(x===n&&(k=U.isGlobstar=!0),D=U.isGlob=!0,G=!0,!0===T)continue;break}if(C===f){if(D=U.isGlob=!0,G=!0,!0===T)continue;break}if(C===m)for(;!0!==K()&&(e=J());)if(e!==o){if(e===O){if(N=U.isBracket=!0,D=U.isGlob=!0,G=!0,!0===T)continue;break}}else H=U.backslashes=!0,J();if(!0===r.nonegate||C!==u||w!==$){if(!0!==r.noparen&&C===l){if(D=U.isGlob=!0,!0===T){for(;!0!==K()&&(C=J());)if(C!==l){if(C===g){G=!0;break}}else H=U.backslashes=!0,C=J();continue}break}if(!0===D){if(G=!0,!0===T)continue;break}}else j=U.negated=!0,$++}else{if(A.push(w),E.push(U),U={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===c&&w===$+1){$+=2;continue}_=w+1}}else H=U.backslashes=!0,C=J(),C===h&&(I=!0)}!0===r.noext&&(L=!1,D=!1);let B=P,F="",W="";$>0&&(F=P.slice(0,$),P=P.slice($),_-=$),B&&!0===D&&_>0?(B=P.slice(0,_),W=P.slice(_)):!0===D?(B="",W=P):B=P,B&&""!==B&&"/"!==B&&B!==P&&S(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),!0===r.unescape&&(W&&(W=s.removeBackslashes(W)),B&&!0===H&&(B=s.removeBackslashes(B)));const V={prefix:F,input:e,start:$,base:B,glob:W,isBrace:M,isBracket:N,isGlob:D,isExtglob:L,isGlobstar:k,negated:j};if(!0===r.tokens&&(V.maxDepth=0,S(C)||E.push(U),V.tokens=E),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<A.length;s++){const n=t?t+1:$,i=A[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==$?(E[s].isPrefix=!0,E[s].value=F):E[s].value=o,b(E[s]),V.maxDepth+=E[s].depth),0===s&&""===o||v.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);v.push(s),r.tokens&&(E[E.length-1].value=s,b(E[E.length-1]),V.maxDepth+=E[E.length-1].depth)}V.slashes=A,V.parts=v}return V}},290:(e,t,r)=>{const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=r(379);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>i.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(o,"\\$1"),t.toPosixSlashes=e=>e.replace(s,"/"),t.removeBackslashes=e=>e.replace(n,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.escapeLast=(e,r,s)=>{const n=e.lastIndexOf(r,s);return-1===n?e:"\\"===e[n-1]?t.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s},t.basename=(e,{windows:t}={})=>t?e.replace(/[\\/]$/,"").replace(/.*[\\/]/,""):e.replace(/\/$/,"").replace(/.*\//,"")},870:(e,t,r)=>{e.exports=r(555)},203:(e,t,r)=>{var s=r(739);function n(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return n(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):n(t)}e.exports=i,i.message=s,i.code=function(e){var t={};return Object.keys(e).forEach((function(r){var s=e[r],n=Number(r);t[s.toLowerCase()]=n})),t}(s),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(s),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},803:t=>{t.exports=e},739:e=>{e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')}},r={};function s(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,s),i.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{s.r(n),s.d(n,{AcceptMime:()=>yr,AdditionalProperties:()=>We,All:()=>jr,AllOf:()=>Ve,Allow:()=>ze,Any:()=>Qe,AnyOf:()=>Ze,ArrayOf:()=>je,Children:()=>ke,CollectionContains:()=>qe,CollectionOf:()=>He,Const:()=>Ye,Consumes:()=>gr,ContentType:()=>vr,Converter:()=>Ns,CustomKey:()=>et,CustomKeys:()=>tt,DateFormat:()=>gt,DateTime:()=>yt,DecoratorContext:()=>Or,Default:()=>rt,Delete:()=>Kr,Deprecated:()=>xr,Description:()=>st,Discriminator:()=>S,DiscriminatorKey:()=>nt,DiscriminatorValue:()=>Ie,Email:()=>ft,EndpointMetadata:()=>ue,Enum:()=>it,Example:()=>ot,Examples:()=>at,ExclusiveMaximum:()=>pt,ExclusiveMinimum:()=>mt,For:()=>qt,Format:()=>dt,ForwardGroups:()=>Rt,GenericOf:()=>mr,Generics:()=>dr,Get:()=>Gr,Groups:()=>xt,HTTP_METHODS:()=>Me,HTTP_STATUS_MESSAGES:()=>Q,Head:()=>Jr,Header:()=>Cr,Hidden:()=>Ct,Ignore:()=>wt,In:()=>Pr,InFile:()=>wr,Integer:()=>$t,JSON_TYPES:()=>d,JsonClassStore:()=>E,JsonEntitiesContainer:()=>c,JsonEntityComponent:()=>A,JsonEntityFn:()=>Le,JsonEntityStore:()=>u,JsonFormatTypes:()=>De,JsonLazyRef:()=>he,JsonMap:()=>$,JsonMedia:()=>ie,JsonMethodStore:()=>ce,JsonOperation:()=>ae,JsonOperationPathsMap:()=>Zr,JsonOperationRoute:()=>es,JsonParameter:()=>B,JsonParameterStore:()=>F,JsonParameterTypes:()=>_,JsonPropertyStore:()=>v,JsonRequestBody:()=>se,JsonResponse:()=>oe,JsonSchema:()=>T,Location:()=>$r,MapOf:()=>Ge,Max:()=>ut,MaxItems:()=>Ue,MaxLength:()=>_t,MaxProperties:()=>Ke,Maximum:()=>ct,Min:()=>lt,MinItems:()=>Je,MinLength:()=>Mt,MinProperties:()=>Be,Minimum:()=>ht,MultipleOf:()=>Nt,Name:()=>Dt,Nullable:()=>Lt,OneOf:()=>kt,OperationId:()=>_r,OperationMethods:()=>Ne,OperationPath:()=>Mr,Optional:()=>It,Options:()=>Fr,ParamMetadata:()=>W,Partial:()=>Nr,Patch:()=>Br,Path:()=>Dr,Pattern:()=>Ht,Post:()=>qr,Produces:()=>fr,Property:()=>Xe,PropertyMetadata:()=>x,Put:()=>Ur,ReadOnly:()=>jt,RecordOf:()=>Ut,Redirect:()=>Lr,Required:()=>Kt,RequiredGroups:()=>Jt,Returns:()=>Er,Route:()=>Hr,Schema:()=>Gt,Security:()=>Wr,SpecTypes:()=>L,Status:()=>Vr,Summary:()=>Xr,Tags:()=>zr,TimeFormat:()=>Ot,Title:()=>Bt,UniqueItems:()=>Fe,Uri:()=>St,Url:()=>bt,View:()=>Qr,WriteOnly:()=>Ft,allOf:()=>hr,alterIgnore:()=>be,alterOneOf:()=>Pe,alterRequiredGroups:()=>xe,any:()=>cr,anyMapper:()=>le,anyOf:()=>ur,array:()=>nr,boolean:()=>Qt,buildPath:()=>ts,classMapper:()=>me,concatParameters:()=>rs,concatPath:()=>Yr,createRef:()=>K,createRefName:()=>U,date:()=>Zt,datetime:()=>Yt,defineStatusModel:()=>br,email:()=>tr,execMapper:()=>o,formatParameterType:()=>M,from:()=>Wt,generateSpec:()=>Ls,genericsMapper:()=>de,getComputedType:()=>m,getGenericsMap:()=>C,getInheritedStores:()=>fe,getJsonEntityStore:()=>pe,getJsonPathParameters:()=>ns,getJsonSchema:()=>Is,getJsonSchemaMapper:()=>i,getJsonType:()=>f,getOperationsRoutes:()=>Hs,getOperationsStores:()=>ss,getProperties:()=>Gs,getPropertiesStores:()=>js,getRequiredProperties:()=>Ce,getSpec:()=>ys,getSpecType:()=>gs,getSpecTypeFromSpec:()=>Os,getStatusConstant:()=>Z,getStatusMessage:()=>Y,getStatusModel:()=>Rr,hasMapper:()=>a,inheritedClassMapper:()=>ye,integer:()=>Xt,isParameterType:()=>N,isRedirectionStatus:()=>te,isSuccessStatus:()=>ee,itemMapper:()=>ge,lazyRef:()=>lr,lazyRefMapper:()=>Oe,map:()=>ir,mapAliasedProperties:()=>ve,mapGenericsOptions:()=>P,mapHeaders:()=>ne,mapMapper:()=>Se,mapNullableType:()=>Re,mapOpenSpec:()=>Ts,mapOpenSpec2:()=>bs,mapOpenSpec3:()=>Rs,mapOpenSpecInfo:()=>Ss,mapRouteOptions:()=>kr,matchGroups:()=>vt,mergeOperation:()=>is,mergeSpec:()=>ds,number:()=>Vt,object:()=>ar,objectMapper:()=>Te,ofMapper:()=>Ae,oneOf:()=>pr,operationIdFormatter:()=>cs,parameters:()=>ps,popGenerics:()=>w,propertiesMapper:()=>Ee,registerJsonSchemaMapper:()=>r,schemaMapper:()=>_e,schemesReducer:()=>us,security:()=>hs,serializeEnum:()=>y,serializeEnumValues:()=>g,set:()=>or,string:()=>zt,tagsReducer:()=>ls,time:()=>er,toJsonMapCollection:()=>re,toJsonRegex:()=>O,toRef:()=>J,transformInformation:()=>Ms,transformSecurity:()=>_s,transformToOS2:()=>Ds,uri:()=>rr,url:()=>sr});var e=s(803);const t=new Map;function r(e,r){return t.set(e,r)}function i(e){if(!t.has(e))throw new Error(`JsonSchema ${e} mapper doesn't exists`);return t.get(e)}function o(e,t,r,s){return i(e)(t,r,s)}function a(e){return t.has(e)}const c=new Map;class u{propertyKey;propertyName;index;descriptor;decoratorType;collectionType;token;store;isStore=!0;parent;target;_type;_schema;constructor(e){const{target:t,propertyKey:r,descriptor:s,index:n,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=String(r),this.descriptor=s,this.index=n,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get targetName(){return(0,e.nameOf)(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return(0,e.isArrayOrArrayClass)(this.collectionType)}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.target).find((e=>u.from(e).schema.isDiscriminator));return t&&u.from(t)}get isPrimitive(){return(0,e.isPrimitiveOrPrimitiveClass)(this._type)}get isDate(){return(0,e.isDate)(this.computedType)}get isObject(){return(0,e.isObject)(this.computedType)}get isClass(){return(0,e.isClass)(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){return this.schema.isDiscriminator&&this.discriminatorAncestor?.schema.discriminator().base!==this.target}static from(...t){if(t[0].isStore)return t[0];const r=t[0];t.length>1&&(t[0]=(0,e.prototypeOf)(t[0]));const s=e.Store.from(...t);if(!s.has("JsonEntityStore")){const n=(0,e.decoratorTypeOf)(t),i=c.get(n);if(!i)throw Error("Unsupported json entity type");const o=new i({store:s,decoratorType:n,target:(0,e.classOf)(r),propertyKey:t[1],index:"number"==typeof t[2]?t[2]:void 0,descriptor:"object"==typeof t[2]?t[2]:void 0});o.build(),s.set("JsonEntityStore",o)}return s.get("JsonEntityStore")}static fromMethod(t,r){return this.from(t,r,(0,e.descriptorOf)(t,r))}static get(t,r,s){return u.from((0,e.prototypeOf)(t),r,s)}isGetterOnly(){return(0,e.isObject)(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,t){return this.store.get(e,t)}set(e,t){return this.store.set(e,t)}toString(){return[this.targetName,this.propertyName,this.index].filter((e=>void 0!==e)).join(":")}buildType(t){(0,e.isCollection)(t)?this.collectionType=t:(this._type=t,this._type&&(0,e.isPlainObject)(this._type)&&(this._type=String))}}var p=function(){return p=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},p.apply(this,arguments)};function h(e,t,r,s){var n,i=arguments.length,o=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(i<3?n(o):i>3?n(t,r,o):n(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function m(t){return(0,e.isPromise)(t)?Object:(0,e.isClass)(t)||(0,e.isSymbol)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(0,e.isClassObject)(t)||(0,e.isDate)(t)||(0,e.isCollection)(t)?(0,e.classOf)(t):(0,e.isArrowFn)(t)?t():t}Object.create,Object.create;const d=["string","number","integer","boolean","object","array","null","any"];function f(t){return null===t?"null":(0,e.isPrimitiveOrPrimitiveClass)(t)?d.indexOf(t)>-1?t:"string"==typeof t?"file"===t?"file":"generic":(0,e.primitiveOf)(t):t===Array?"array":(0,e.isArray)(t)?t.map(f):t===Set?"array":(0,e.isDate)(t)||(0,e.isBuffer)(t)?"string":"object"}const y=t=>(0,e.isObject)(t)&&null!==t?Object.entries(t).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):t;function g(t){const r=t.reduce(((e,t)=>e.concat(y(t))),[]),s=r.reduce(((e,t)=>e.add((e=>null===e?"null":typeof e)(t))),new Set);return{values:(0,e.uniq)(r),types:s}}function O(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class S{propertyName;base;values=new Map;types=new Map;constructor({base:t,propertyName:r,types:s,values:n}={}){Object.assign(this,(0,e.cleanObject)({base:t,propertyName:r,types:s?new Map(s):void 0,values:n?new Map(n):void 0}))}add(e,t){return t.forEach((t=>{this.values.set(t,e)})),this.types.set(e,t),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const t=this.types.get(e);return t?t[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function b(e){return e instanceof T?e:Object.entries(e).reduce(((e,[t,r])=>(e[O(t)]=R(r),e)),{})}function R(t){return(0,e.isArray)(t)?t.map(R):t.isStore||t.isJsonSchema||t.isLazyRef?t:(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?u.from(t).schema:(0,e.isObject)(t)?T.from(t):(0,e.isPrimitiveClass)(t)?T.from({type:t}):t}class T extends Map{isJsonSchema=!0;$hooks=new e.Hooks;$required=new Set;$allow=[];$selfRequired;$forwardGroups=!1;isDiscriminatorKey=!1;isDiscriminator=!1;#e=!1;#t=null;#r;#s=[];#n=new Map;#i;#o;#a=!1;#c=!1;#u=!1;constructor(e={}){super(),e&&this.assign(e)}get alias(){return this.#n}get nestedGenerics(){return this.#s}set nestedGenerics(e){this.#s=e}get genericLabels(){return this.#r}set genericLabels(e){this.#r=e}get isClass(){return(0,e.isClass)(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes(this.#o)}get isCollection(){return this.#c}get isGeneric(){return this.#a}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.#o).find((e=>u.from(e).schema.isDiscriminator));return t&&u.from(t).schema}get hasGenerics(){return!(!this.nestedGenerics||!this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return this.#u}get isNullable(){return this.#e||this.$allow.includes(null)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}static from(e={}){return new T(e)}nullable(e){this.#e=e}itemSchema(e={}){return this.#i=this.#i||R(e),this.#i.assign(e),this.#i}getAliasOf(e){return this.#n.get(e)}addAlias(e,t){return this.#n.set(e,t),this.#n.set(t,e),this}removeAlias(e){const t=this.#n.get(e);return t&&this.#n.delete(t),this.#n.delete(e),this}$id(e){return super.set("$id",e),this}$ref(e){return super.set("$ref",e),this}$schema(e){return super.set("$schema",e),this}label(e){return this.#u=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){if("boolean"==typeof e){const t=e;e=()=>t}return this.$hooks.on("ignore",e),this}default(e){return super.set("default",e),this}const(e){return super.set("const",e),this}description(e){return super.set("description",e),this}discriminator(){return this.isDiscriminator=!0,this.#t=this.#t||new S({base:this.#o})}discriminatorKey(e){return this.discriminator().propertyName=e,this.isDiscriminator=!0,this}discriminatorValue(...e){const t=this.discriminatorAncestor.discriminator();t.add(this.#o,e),this.isDiscriminator=!0;const r=this.get("properties"),s=r[t.propertyName]||new T({type:"string"});return 1===e.length?(s.const(e[0]),s.examples([e[0]])):(s.enum(...e),s.examples(e)),r[t.propertyName]=s,this.set("properties",r),this}additionalItems(e){return super.set("additionalItems",R(e)),this}contains(e){return super.set("contains",R(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#i=R(e)),this}maxItems(e){return super.set("maxItems",e),this}minItems(e){return super.set("minItems",e),this}uniqueItems(e){return super.set("uniqueItems",e),this}maxProperties(e){return super.set("maxProperties",e),this}minProperties(e){return super.set("minProperties",e),this}allow(...e){return this.$allow.push(...e),this}required(t=!0){if(!(0,e.isArray)(t)){const e=this.clone();return e.$selfRequired=t,e}return this.$required.clear(),t.forEach((e=>this.$required.add(e))),this}addRequired(e){return this.$required.add(e),this}removeRequired(e){return this.$required.delete(e),this}isRequired(e){return this.$required.has(e)}properties(e){return super.set("properties",b(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",b(r)),this}patternProperties(e){return super.set("patternProperties",b(e)),this}additionalProperties(e){return super.set("additionalProperties",R(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",b(e)),this}propertyNames(e){return super.set("propertyNames",R(e)),this}enum(e,...t){const{values:r,types:s}=g([e,t].flat());return super.set("enum",r).any(...s),this}definitions(e){return super.set("definitions",b(e)),this}allOf(e){return super.set("allOf",e.map(R)),this}anyOf(e){return super.set("anyOf",e.map(R)),this}oneOf(e){let t=e.map(R);if(1===t.length&&!(e[0]instanceof T)){if(!t[0].#t)return this.type(e[0]);const r=t[0].discriminator().children();t=r.map(R)}super.set("oneOf",t);const r=t[0];if(r.isDiscriminator){const e=r.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t}),this.isDiscriminator=!0,this.#t=e}return this}not(e){return super.set("not",R(e)),this}multipleOf(e){return super.set("multipleOf",e),this}maximum(e){return super.set("maximum",e),this}exclusiveMaximum(e){return super.set("exclusiveMaximum",e),this}minimum(e){return super.set("minimum",e),this}exclusiveMinimum(e){return super.set("exclusiveMinimum",e),this}maxLength(e){return super.set("maxLength",e),this}minLength(e){return super.set("minLength",e),this}pattern(e){return super.set("pattern",O(e)),this}format(e){return super.set("format",e),this}type(t){switch(t){case Map:super.set("type",f(t)),this.#o=t,this.#c=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case Array:super.set("type",f(t)),this.#o=t,this.#c=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case Set:super.set("type",f(t)),this.#o=t,this.#c=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":super.set("type",f(t)),this.integer();break;case Object:case Date:case Boolean:case Number:case String:super.set("type",f(t)),this.#o=t,this.has("properties")||super.set("properties",{});break;default:if((0,e.isClass)(t)||(0,e.isFunction)(t))super.set("type",void 0),this.#o=t,this.has("properties")||super.set("properties",{});else{const e=f(t);"generic"===e?(this.#a=!0,super.set("$ref",t)):super.set("type",e)}}return this}any(...t){return t.filter((t=>(0,e.isClass)(t))).length>=2?this.oneOf(t.filter((e=>null!==e&&(this.nullable(!0),!0)))):(t.length?(t=(0,e.uniq)(t).map(f)).includes("null")&&(this.nullable(!0),t=t.filter((e=>"null"!==e))):(t=["integer","number","string","boolean","array","object"],this.nullable(!0)),this.type(1===t.length?t[0]:t)),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(e){return super.set("title",e),this}readOnly(e){return super.set("readOnly",e),this}writeOnly(e){return super.set("writeOnly",e),this}customKey(e,t){return super.set(`#${e}`,t),this}toObject(e){return this.toJSON(e)}toJSON(e){let t=!1;e||(t=!0,e={schemas:{}});const r=o("schema",this,e);return t&&e.schemas&&Object.keys(e.schemas).length&&(r.definitions=e.schemas),r}assign(e={}){return(e instanceof T?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof T&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),e.$required.forEach((e=>{this.$required.add(e)})),this.#t=this.#t?new S(this.#t):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#u=e.#u,this.#n=new Map(this.#n.entries()),e.#r&&(this.#r=[...e.#r]),this.#s=e.#s.map((e=>[...e])),this.#o=e.#o,this.#a=e.#a,this.#c=e.#c,this.#u=e.#u,super.set("type",e.get("type"))),this}set(t,r){return t in this?(0,e.isFunction)(this[t])&&this[t](r):super.set(t,r),this}getComputedType(){return m(this.#o)}getComputedItemType(){return this.#i?this.#i.getComputedType():this.getComputedType()}getJsonType(){return this.get("type")||f(this.getComputedType())}getTarget(){return this.#o}getName(){return this.get("name")||(this.#o?(0,e.nameOf)((0,e.classOf)(this.getComputedType())):"")}clone(){return new T(this)}}function A(e){return t=>{c.set(e,t)}}let E=class extends u{children=new Map;get path(){return this.store.get("path","/")}set path(e){this.store.set("path",e)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=T.from({type:this.type})}};E=h([A(e.DecoratorTypes.CLASS)],E);let v=class extends u{parent=u.from(this.target);get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(e){e?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){this._type||this.buildType(e.Metadata.getType((0,e.prototypeOf)(this.target),this.propertyKey)),this._type=this._type||Object;let t=this.parent.schema.get("properties")[this.propertyName];t||(this.parent.children.set(this.propertyName,this),t=T.from({type:this.collectionType||this.type}),this.collectionType&&t.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}static get(t,r){return u.from((0,e.prototypeOf)(t),r)}};v=h([A(e.DecoratorTypes.PROP)],v);const x=v;function C(e,t){return e.reduce(((e,r,s)=>e.set(r,t[s])),new Map)}function P(e){if(e.genericLabels&&e.genericTypes){const{genericLabels:t,genericTypes:r,...s}=e;return{...s,generics:C(t,r)}}return e}function w(e){const[t,...r]=e.nestedGenerics;return{genericTypes:t,nestedGenerics:r}}class $ extends Map{constructor(e={}){super(),this.assign(e)}assign(t={}){return Object.entries(t).forEach((([t,r])=>{(0,e.isFunction)(this[t])?this[t](r):this.set(t,r)})),this}toJSON(e={}){return o("map",this,e)}}var _;function M(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function N(e){return Object.values(_).includes(M(e))}function D(e){return e.toLowerCase()}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}(_||(_={}));var L,k=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],I=/[^A-Z0-9]+/gi;function H(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,s=void 0===r?k:r,n=t.stripRegexp,i=void 0===n?I:n,o=t.transform,a=void 0===o?D:o,c=t.delimiter,u=void 0===c?" ":c,p=j(j(e,s,"$1\0$2"),i,"\0"),h=0,l=p.length;"\0"===p.charAt(h);)h++;for(;"\0"===p.charAt(l-1);)l--;return p.slice(h,l).split("\0").map(a).join(u)}function j(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}function G(e,t){var r=e.charAt(0),s=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+s:""+r.toUpperCase()+s}function q(e,t){return void 0===t&&(t={}),H(e,p({delimiter:"",transform:G},t))}function U(e,t){return t.groups&&t.groups.length?q(`${e} ${t.groups.join(" ")}`):e}function K(t,r,s){const n=function(e){const{host:t="#/"+("openapi3"===e.specType?"components/schemas":"definitions")}=e;return t}(s),i={$ref:`${n}/${t}`},o=r.isNullable,a=r.isReadOnly,c=r.isWriteOnly;if(o||a||c)switch(s.specType){case L.OPENAPI:return(0,e.cleanObject)({nullable:!!o||void 0,readOnly:!!a||void 0,writeOnly:!!c||void 0,oneOf:[i]});case L.JSON:return(0,e.cleanObject)({readOnly:a,writeOnly:c,oneOf:[i]})}return i}function J(e,t,r){const s=U(e.getName(),r);return r.schemas[e.getName()]=t,K(s,e,r)}!function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3"}(L||(L={}));class B extends ${nestedGenerics=[];groups;$schema;expression;getName(){const e=this.get("name");return"files"===this.get("in")?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,t=""){return this.set("in",M(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return this.$schema=e,this}toJSON(t={}){if(!N(this.get("in")))return null;const r=(0,e.toMap)(t.schemas||{});return this.build({...t,groups:this.groups},r)}build(e,t){const{type:r,schema:s,...n}=super.toJSON(e),i=o("item",this.$schema,{...e,...w(this)});switch(n.required=n.required||this.get("in")===_.PATH,this.get("in")){case _.FILES:return this.getFileSchema(i,n);case _.QUERY:if(i.$ref){if(!n.name)return this.refToParameters(n,e,t);n.style="deepObject"}}return n.schema=i,n}getFileSchema(t,r){const s={type:"string",format:"binary",oneOf:void 0};return"array"===t.type?(t.items=(0,e.cleanObject)({...t.items,...s}),r.schema=t):r.schema=(0,e.cleanObject)({...t,...s}),r}refToParameters(t,r,s){const n=U(this.$schema.getName(),r),i=r.schemas[n];return r.schemas[n]&&!s.has(n)&&delete r.schemas[this.$schema.getName()],Object.entries(i.properties||{}).reduce(((r,[s,{description:n,...o}])=>[...r,(0,e.cleanObject)({...t,name:s,required:(i.required||[]).includes(s),description:n,schema:o,style:o.$ref?"deepObject":void 0})]),[])}}let F=class extends u{paramType;expression;dataPath;pipes;parameter=new B;parent=u.fromMethod(this.target,this.propertyKey);constructor(e){super(e),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(e){this.parameter.nestedGenerics=e}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.$allow}static getParams(t,r){const s=[],n=(0,e.ancestorsOf)(t).reverse().find((t=>(0,e.isMethodDescriptor)(t,r)&&u.fromMethod(t,r).children.size));return n?(u.fromMethod(n,r).children.forEach(((e,t)=>{s[+t]=e})),s):[]}static get(t,r,s){return u.from((0,e.prototypeOf)(t),r,s)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}getSchema(t){return(0,e.isCollection)(t)||!(0,e.isClass)(t)?T.from({type:t}):u.from(t).schema}build(){if(!this._type){const t=e.Metadata.getParamTypes((0,e.prototypeOf)(this.target),this.propertyKey)[this.index];this.buildType(t)}this._type=this._type||Object,this._schema||(this.parent.children.set(this.index,this),this._schema=this.getSchema(this.collectionType||this.type),this.parameter.schema(this._schema),this.collectionType&&this._schema.itemSchema(this.getSchema(this.type)),this.parent.operation.addParameter(this.index,this.parameter))}};F=h([A(e.DecoratorTypes.PARAM),l("design:paramtypes",[Object])],F);const W=F;var V=s(203),X=s.n(V);function z(e){return e.toUpperCase()}const Q=X().codes.reduce(((e,t)=>{const r=String(X()(t));return{...e,[String(t)]:{label:r,code:(s=r,void 0===n&&(n={}),H(s,p({delimiter:"_",transform:z},n)))}};var s,n}),{});function Z(e){return Q[e]?.code}function Y(e){return Q[e]?.label}Q[200].label="Success",Q[200].code="SUCCESS";const ee=e=>Number(e)&&200<=Number(e)&&Number(e)<300,te=e=>Number(e)&&300<=Number(e)&&Number(e)<400;function re(e,t=$){return Object.entries(e).reduce(((e,[r,s])=>(e.set(r,new t(s)),e)),new $)}class se extends ${constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",re(e)),this}addContent(e,t,r){const s=this.get("content"),n=new $;return n.set("schema",t),r&&n.set("examples",r),s.set(e,n),this}required(e){return this.set("required",e),this}}function ne(t){return Object.keys(t).reduce(((r,s)=>{const n=t[s];let i=typeof n,o={example:n};return"object"===i&&(o=n,o.example=void 0===o.value?o.example:o.value,delete o.value,i=typeof o.example),o.type=o.type||i,r[s]=(0,e.cleanObject)(o),r}),{})}class ie extends ${groups=[];allowedGroups;schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}toJSON(e={}){let t=[...this.groups||[]];return super.toJSON({...e,groups:t})}}class oe extends ${status;constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",ne(e)),this}content(e){return this.set("content",re(e,ie)),this}getContent(){return this.get("content")}getMedia(e,t=!0){return t&&this.addMedia(e),this.getContent()?.get(e)}addMedia(e){const t=this.get("content");return t.has(e)||t.set(e,new ie),this}toJSON(e={}){const t=super.toJSON(e);return 204===this.status&&delete t.content,t.headers&&Object.entries(t.headers).forEach((([e,{type:r,...s}])=>{t.headers[e]={...s,schema:{type:r}}})),t}}class ae extends ${operationPaths=new Map;#p;#h=!1;constructor(e={}){super({parameters:[],responses:new $,...e})}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return this.#p}tags(e){return super.set("tags",e),this}addTags(t){return t=(0,e.uniqBy)([...this.get("tags")||[],...t],"name"),this.tags(t)}summary(e){return super.set("summary",e),this}operationId(e){return this.set("operationId",e),this}responses(e){return this.set("responses",e),this}defaultStatus(e){return this.#p=e,this}getStatus(){return this.#p||200}setRedirection(e=302){return this.#h=!0,this.#p=e,this}isRedirection(e){return this.#h&&e?te(e):this.#h}addResponse(t,r){if((ee(t)||te(t))&&!this.#p){const e=this.getResponseOf(200);this.getResponses().set(t.toString(),e).delete("200"),this.defaultStatus(Number(t))}const s="default"===t?this.getStatus().toString():t.toString(),n=this.getResponses().get(s);return n?(r.forEach(((t,r)=>{["content"].includes(r)||n.set(r,(0,e.deepMerge)(n.get(r),t))})),n.status=Number(s)):(r.status=Number(s),this.getResponses().set(s,r)),this}getResponses(){return this.get("responses")}getResponseOf(e){return("default"===e?this.response:this.getResponses().get(String(e)))||new oe}ensureResponseOf(e){return this.addResponse(e,this.getResponseOf(e)),this.getResponseOf(e)}getHeadersOf(e){return this.getResponseOf(e).get("headers")||{}}getContentTypeOf(e){return[...this.getResponseOf(e).get("content").keys()].slice(-1)[0]}security(e){return this.set("security",e),this}addSecurityScopes(t,r){const s=this.get("security")||{};return s[t]=(0,e.uniq)([...s[t]||[],...r]),this.security(s)}description(e){return super.set("description",e),this}deprecated(e){return super.set("deprecated",e),this}parameters(e){return super.set("parameters",e),this}addParameter(e,t){-1===e&&(e=this.get("parameters").length),this.get("parameters")[e]=t}consumes(e){return super.set("consumes",e),this}produces(e){return super.set("produces",e),this}addProduce(t){const r=(0,e.uniq)([].concat(this.get("produces"),t)).filter(Boolean);this.set("produces",r)}addOperationPath(e,t,r={}){return this.operationPaths.set(String(e)+String(t),{...r,method:e,path:t}),this}toJSON(e={}){const t=super.toJSON({...e,ignore:["parameters"]}),r=[],s=[];if(t.security&&(t.security=[].concat(t.security)),this.get("parameters").forEach((t=>{N(this.get("in"))||t.get("in")&&([_.BODY,_.FILES].includes(t.get("in"))?r.push(t):s.push(...[].concat(t.toJSON(e))))})),t.parameters=s.filter(Boolean),0===this.get("responses").size&&(t.responses={200:{description:Y(200)}}),r.length){const s=function(e,t){let r=new T;const s={},n=[];let i=0;return e.forEach((e=>{const o=e.getName();Array.from(e.entries()).filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===s[e]&&(s[e]=t)}));const a=e.toJSON(t);o?(r.addProperty(o,a.schema||{type:a.type}),e.get("required")&&r.addRequired(o),i++):n.push(a)})),i||1!==n.length?(r.type("object"),{schema:r.toJSON(t),required:!1,...s}):n[0]}(r,e);t.requestBody=function(e,{schema:t,examples:r,in:s,...n}){const i=new se(n);return(e.get("consumes")?.length?e.get("consumes"):["application/json"]).forEach((e=>{i.addContent(e,t,r)})),i}(this,s).toJSON(e)}return delete t.consumes,delete t.produces,t}}let ce=class extends u{parent=u.from(this.target);middlewares=[];beforeMiddlewares=[];afterMiddlewares=[];operation=new ae;children=new Map;constructor(t){super({store:e.Store.fromMethod(t.target,t.propertyKey),descriptor:(0,e.descriptorOf)(t.target,t.propertyKey),...t});const{beforeMiddlewares:r=[],middlewares:s=[],afterMiddlewares:n=[]}=t;this.after(n),this.before(r),this.use(s)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(e){this.store.set("view",e)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(e){this.store.set("acceptMimes",e)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(t,r,s){return s=s||(0,e.descriptorOf)((0,e.prototypeOf)(t),r),u.from((0,e.prototypeOf)(t),r,s)}getResponseOptions(e,{contentType:t="application/json",includes:r}={}){const s=this.operation.getResponseOf(e).getMedia(t,!1);if(s&&s.has("schema")){const e=s.get("schema");let t=s.groups;return r&&s.allowedGroups?.size&&(t=[...t||[],...r.filter((e=>s.allowedGroups.has(e)))]),{type:e.getComputedItemType(),groups:t}}return{type:this.type}}before(t){return this.beforeMiddlewares=this.beforeMiddlewares.concat(t).filter(e.isFunction),this}after(t){return this.afterMiddlewares=this.afterMiddlewares.concat(t).filter(e.isFunction),this}use(t){return this.middlewares=this.middlewares.concat(t).filter(e.isFunction),this}get(t){const r=e.Store.from(this.target).get(t);return(0,e.deepMerge)(r,this.store.get(t))}getParamTypes(){return[...this.children.values()].reduce(((e,t)=>({...e,[t.paramType]:!0})),{})}build(){if(!this._type){let t=e.Metadata.getReturnType(this.target,this.propertyKey);t=(0,e.isPromise)(t)?void 0:t,this.buildType(t)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),(0,e.isCollection)(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=T.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}};ce=h([A(e.DecoratorTypes.METHOD),l("design:paramtypes",[Object])],ce);const ue=ce;function pe(...e){return u.from(...e)}c.set(e.DecoratorTypes.CLASS,E),c.set(e.DecoratorTypes.PROP,v),c.set(e.DecoratorTypes.PARAM,F),c.set(e.DecoratorTypes.METHOD,ce);class he{getType;isLazyRef=!0;constructor(e){this.getType=e}get target(){return this.getType()}get schema(){return pe(this.getType()).schema}get name(){return(0,e.nameOf)(this.getType())}toJSON(e){return this.getType()&&o("schema",this.schema,e)}}function le(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof he)return o("lazyRef",e,t);if("toJSON"in e){const r=e.toJSON(P(t));return e.canRef?J(e,r,t):r}return o("object",e,t)}function me(e,t){const r=u.from(e.class),s=U(r.schema.getName()||e.getName(),t);if(e.hasGenerics){const{type:s,properties:n,additionalProperties:i,items:a,...c}=e.toJSON(t),u={...o("any",r.schema,{...t,...w(e),root:!1}),...c};if(u.title){const r=U(u.title,t);return t.schemas[r]=u,delete u.title,K(r,e,t)}return u}return t.schemas&&!t.schemas[s]&&(t.schemas[s]={},t.schemas[s]=o("any",r.schema,P({...t,root:!1}))),K(s,e,t)}function de(t,r){const{generics:s}=r;if(s&&t.$ref&&s.has(t.$ref)){let n=s.get(t.$ref);if((0,e.isPrimitiveClass)(n))return{type:f(n)};if(n===Date)return{type:"string",format:"date-time"};if(n.toJSON)return n.toJSON({...r,generics:void 0});if(n===Object)return{type:"object"};if((0,e.isClass)(n)){const e={class:n};return 0===r.nestedGenerics.length?o("class",e,{...r,generics:void 0}):o("schema",u.from(e.class).schema,{...r,...w(r),root:!1})}}return t}function fe(t){const r=t.isStore?t:pe(t);return r.$inherited||(r.$inherited=(0,e.ancestorsOf)(r.target).reverse().reduce(((e,t)=>e.set(t,pe(t))),new Map)),r.$inherited}function ye(t,{target:r,...s}){const n=Array.from(fe(r).entries()).filter((([t])=>(0,e.classOf)(t)!==(0,e.classOf)(r)));if(n.length){const r=n.reduce(((t,[,r])=>(0,e.deepMerge)(t,o("schema",r.schema,s))),{});t=(0,e.deepMerge)(r,t)}return t}function ge(e,t){return e&&e.isClass?o("class",e,t):o("any",e,t)}function Oe(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return K(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const s=e.toJSON(P(t));return J(e.schema,s,t)}function Se(e,{ignore:t=[],...r}){return r=P(r),Array.from(e.entries()).reduce(((e,[s,n])=>(t.includes(s)||(e[s]=o("item",n,r)),e)),{})}function be(e,t){let r=e?.$hooks?.alter("ignore",!1,[t]);return r||(!1!==t.groups?e?.$hooks?.alter("groups",!1,[t.groups]):r)}function Re(t,r,s){if(!r?.isNullable)return t;let n=[].concat(t.type).filter(Boolean);switch(s.specType){default:case L.JSON:t.discriminator||(t.oneOf?function(e){return e.oneOf.find((e=>"null"===e.type))}(t)||t.oneOf.unshift({type:"null"}):t.type=(0,e.uniq)(["null",...n]));break;case L.OPENAPI:t.nullable=!0,t.oneOf||(n.length>1?(t.oneOf=n.map((e=>({type:e}))),delete t.type):t.type=n[0])}return t}function Te(t,r){const{specType:s,operationIdFormatter:n,root:i,schemas:a,genericTypes:c,nestedGenerics:u,useAlias:p,genericLabels:h,...l}=r;return Object.entries(t).reduce(((e,[s,n])=>{if(!1!==r.withIgnoredProps&&!be(n,l)){const i={...r,groups:t?.$forwardGroups||n?.$forwardGroups?r.groups:void 0};e[s]=o("item",n,i),e[s]=Re(e[s],n,i)}return e}),(0,e.isArray)(t)?[]:{})}function Ae(e,t,r){return e.map((e=>o("item",e,{...t,genericLabels:r.genericLabels})))}function Ee(e,t,r){return e.isClass?o("class",e,t):o("any",e,{...t,genericLabels:r.genericLabels})}function ve(e,t){return Object.entries(e).reduce(((e,[r,s])=>(e[r=t.get(r)||r]=s,e)),{})}function xe(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function Ce(t,r,s){if(s.groups&&s.groups.includes("partial"))return t;let n=function(t,r,s){let n=t.required||[];return n=[...n,...r.$required],r.get("properties")&&(n=Object.entries(r.get("properties")).reduce(((e,[t,r])=>r&&void 0!==r.$selfRequired?r.$selfRequired?e.concat(t):e.filter((e=>e===t)):e),n)),xe((0,e.uniq)(n),r,s)}(t,r,s);return n=(0,e.uniq)(n).reduce(function(e,t,r={}){const{useAlias:s}=r,n=Object.keys(e.properties||{});return(r,i)=>{const o=s&&t.alias.get(i)||i;if(n.includes(o)){const s=t.get("properties")[i],n=e.properties[o];return e.properties[o]=function(e,t){if(!t?.$allow.includes("")&&[].concat(t?.get("type")).includes("string")){const t=e?.minLength;if(void 0===t)return{...e,minLength:1}}return e}(n,s),r.concat(o)}return r}}(t,r,s),[]),t.discriminator&&n.push(t.discriminator.propertyName),n.length?{...t,required:n}:t}function Pe(e,t,r){return e.oneOf&&!1!==r.groups&&(e={...e,oneOf:t.$hooks.alter("oneOf",e.oneOf,[r.groups])}),!(e.oneOf||e.allOf||e.anyOf)||e.items||e.properties||delete e.type,e}r("any",le),r("class",me),r("generics",de),r("inheritedClass",ye),r("item",ge),r("lazyRef",Oe),r("map",Se),r("object",Te),r("anyOf",Ae),r("allOf",Ae),r("oneOf",Ae),r("properties",Ee),r("items",Ee),r("additionalProperties",Ee),r("propertyNames",Ee),r("contains",Ee),r("dependencies",Ee),r("patternProperties",Ee),r("additionalItems",Ee),r("not",Ee),r("definitions",Ee);const we=["name","$required","$hooks","_nestedGenerics",L.OPENAPI,L.SWAGGER,L.JSON],$e=["const"];function _e(t,r){const{useAlias:s=!0,schemas:n={}}=r;r={...r,useAlias:s,schemas:n};let i=[...t.keys()].filter((e=>!function(e,{specType:t=L.JSON,customKeys:r=!1}){return we.includes(e)||e.startsWith("#")&&(!1===r||t!==L.JSON)||t!==L.JSON&&$e.includes(e)}(e,r))).reduce(((n,i)=>{let c=t.get(i);if("type"===(i=i.replace(/^#/,"")))return{...n,[i]:t.getJsonType()};if(function(t,r,s){return"examples"===t&&(0,e.isObject)(r)&&L.OPENAPI===s.specType}(i,c,r)&&(i="example",c=Object.values(c)[0]),c&&"object"==typeof c&&a(i)){if(c=o(i,c,r,t),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(i,c))return n;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(i,c,s)&&(c=ve(c,t.alias))}return{...n,[i]:c}}),{});return t.isClass&&(i=o("inheritedClass",i,{...r,root:!1,schemas:n,target:t.getComputedType()})),i=o("generics",i,{...r,root:!1,schemas:n}),t.has(r.specType)&&(i={...i,...t.get(r.specType).toJSON(r)}),i=Ce(i,t,{...r,useAlias:s}),i=Re(i,t,r),i=Pe(i,t,r),i}r("schema",_e);const Me=["all","checkout","connect","copy","delete","get","head","lock","merge","mkactivity","mkcol","move","m-search","notify","options","param","patch","post","propfind","propatch","purge","put","report","search","subscribe","trace","unlock","unsuscribe"];var Ne,De;function Le(e){return(...t)=>{const r=e(pe(...t),t);"function"==typeof r&&r(...t)}}function ke(...t){return Le((r=>{r.store.set("childrenControllers",t),t.forEach((t=>{e.Store.from(t).set("parentController",r.token)}))}))}function Ie(e,...t){return Le((r=>{var s,n;e=e||(s=r.targetName,void 0===n&&(n={}),function(e,t){return void 0===t&&(t={}),H(e,p({delimiter:"."},t))}(s,p({delimiter:"_"},n))),r.discriminatorAncestor&&r.schema.discriminatorValue(e,...t)}))}function He(e,t){if(!e)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const r={};let s=!1;const n=(...n)=>{const i=u.from(...n);t&&(i.collectionType=t,i.schema.type(t)),i.type=e,i.itemSchema.type(e),i.schema.assign(r),i.isArray&&s&&(i.schema.set("contains",i.schema.get("items")),i.schema.delete("items"))};return n.MinItems=e=>(r.minItems=e,n),n.MaxItems=e=>(r.maxItems=e,n),n.MinProperties=e=>(r.minProperties=e,n),n.MaxProperties=e=>(r.maxProperties=e,n),n.Contains=()=>(s=!0,n),n.UniqueItems=(e=!0)=>(r.uniqueItems=e,n),n}function je(e){return He(e,Array)}function Ge(e){return He(e,Map)}function qe(e){return He(e).Contains()}function Ue(e){if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return Le((t=>{t.schema.maxItems(e)}))}function Ke(e){if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return Le((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))}function Je(e){if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return Le((t=>{t.schema.minItems(e)}))}function Be(e){if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return Le((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))}function Fe(e=!0){return Le((t=>{t.schema.uniqueItems(e)}))}function We(e){return Le(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function Ve(...e){return Le((t=>{t.itemSchema.allOf(e)}))}function Xe(t){return Le((r=>{t&&((0,e.isClass)(t)&&(r.type=t),r.itemSchema.type(t))}))}function ze(...t){const r=t.find((t=>(0,e.isClass)(t)));return(0,e.useDecorators)(r&&Xe(r),Le(((r,s)=>{r.schema.allow(...t),r.decoratorType===e.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===e.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName)})))}function Qe(...e){return Le((t=>{t.itemSchema.any(...e)}))}function Ze(...e){return Le((t=>{t.itemSchema.anyOf(e)}))}function Ye(e){return Le((t=>{t.itemSchema.const(e)}))}function et(e,t){return Le((r=>{r.itemSchema.customKey(e,t)}))}function tt(e){return Le((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function rt(e){return Le((t=>{t.itemSchema.default(e)}))}function st(t){return Le(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.PROP:case e.DecoratorTypes.CLASS:r.schema.description(t);break;case e.DecoratorTypes.PARAM:r.parameter.description(t);break;case e.DecoratorTypes.METHOD:r.operation?.description(t)}}))}function nt(){return(0,e.useDecorators)(Xe(),Le((e=>{e.discriminatorKey()})))}function it(e,...t){return Le((r=>{r.itemSchema.enum(e,...t)}))}function ot(...e){return Le((t=>{t.schema.examples(e)}))}function at(e){return Le((t=>{t.parameter.examples(e)}))}function ct(e,t=!1){return Le((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)}))}function ut(e,t=!1){return ct(e,t)}function pt(e,t=!0){return ct(e,t)}function ht(e,t=!1){return Le((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)}))}function lt(e,t=!1){return ht(e,t)}function mt(e,t=!0){return ht(e,t)}function dt(e){return Le((t=>{t.itemSchema.format(e)}))}function ft(){return dt(De.EMAIL)}function yt(){return dt(De.DATE_TIME)}function gt(){return dt(De.DATE)}function Ot(){return dt(De.TIME)}function St(){return dt(De.URI)}function bt(){return dt(De.URL)}function Rt(e=!0){return Le((t=>{t.schema.$forwardGroups=e}))}!function(e){e.ALL="ALL",e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.HEAD="HEAD",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.CUSTOM="CUSTOM"}(Ne||(Ne={})),function(e){e.DATE_TIME="date-time",e.DATE="date",e.TIME="time",e.EMAIL="email",e.HOSTNAME="hostname",e.IPV4="ipv4",e.IPV6="ipv6",e.URI="uri",e.URL="url",e.URI_REF="uri-reference",e.URI_TEMPLATE="uri-template",e.JSON_POINTER="json-pointer",e.RELATIVE_JSON_POINTER="relative-json-pointer",e.UUID="uuid",e.REGEX="regex"}(De||(De={}));var Tt=s(870),At=s.n(Tt);function Et(e,t){t=[].concat(t),e=[].concat(e);let r=new Set,s=new Set,n=new Set,i=0,o=e=>{n.add(e.output)};for(let n=0;n<t.length;n++){let a=At()(String(t[n]),{onResult:o},!0),c=a.state.negated||a.state.negatedExtglob;c&&i++;for(let t of e){let e=a(t,!0);(c?!e.isMatch:e.isMatch)&&(c?r.add(e.output):(r.delete(e.output),s.add(e.output)))}}return!!(i===t.length?[...n]:[...s]).filter((e=>!r.has(e))).length}function vt(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),s=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&Et(r,t))||!!s.length&&!Et(e.filter((e=>!e.startsWith("!"))),t)}function xt(...t){return Le((r=>{switch(r.decoratorType){case e.DecoratorTypes.CLASS:!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{xt(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(t,r);break;case e.DecoratorTypes.PROP:r.schema.$hooks.on("groups",((e,r)=>!(e||!vt(t,r))||e));break;case e.DecoratorTypes.PARAM:r.parameter.groups=t}}))}function Ct(){return(0,e.StoreSet)("hidden",!0)}const Pt=(e,t)=>!0!==t.mongoose;function wt(e=Pt){return Le((t=>{t.schema.ignore(e)}))}function $t(){return Le((e=>{e.itemSchema.type("integer")}))}function _t(e){if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return Le((t=>{t.itemSchema.maxLength(e)}))}function Mt(e){if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return Le((t=>{t.itemSchema.minLength(e)}))}function Nt(e){if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return Le((t=>{t.itemSchema.multipleOf(e)}))}function Dt(t){return Le(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.CLASS:r.schema.name(t);break;case e.DecoratorTypes.PARAM:r.parameter.name(t);break;default:r.parent.schema.addAlias(s[1],t)}}))}function Lt(t,...r){return r=[t,...r],(0,e.useDecorators)(1===r.length&&Xe(r[0]),Qe(null,...r))}function kt(...e){return Le((t=>{t.itemSchema.oneOf(e),t.type=Object}))}function It(){return Le((t=>{switch(t.decoratorType){case e.DecoratorTypes.PARAM:t.required=!1;break;case e.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName)}}))}function Ht(e){return Le((t=>{t.itemSchema.pattern(e)}))}function jt(e=!0){return Le((t=>{t.itemSchema.readOnly(e)}))}function Gt(e){return Le((t=>{Object.entries(e).forEach((([e,r])=>{t.schema.set(e,r)}))}))}function qt(e,t){return Le((r=>{r.schema.set(e,t)}))}function Ut(e,...t){return Gt({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}function Kt(e=!0,...t){return e?ze(...t):It()}function Jt(...e){return Le((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,s)=>vt(e,s)?r.filter((e=>e!==t.propertyKey)):r))}))}function Bt(e){return Le((t=>{t.schema.title(e)}))}function Ft(e=!0){return Le((t=>{t.itemSchema.writeOnly(e)}))}function Wt(t=Object){if((0,e.isClass)(t)){const{schema:e}=pe(t);return e.properties=function(e){return Object.entries(e).forEach((([e,r])=>{pe(t.prototype,e).schema.assign(r)})),this},e}return T.from({type:t})}function Vt(){return Wt(Number)}function Xt(){return Wt(Number).integer()}function zt(){return Wt(String)}function Qt(){return Wt(Boolean)}function Zt(){return Wt(Date).format(De.DATE)}function Yt(){return Wt(Date).format(De.DATE_TIME)}function er(){return Wt(Date).format(De.TIME)}function tr(){return Wt(String).format(De.EMAIL)}function rr(){return Wt(String).format(De.URI)}function sr(){return Wt(String).format(De.URL)}function nr(){return Wt(Array)}function ir(){return Wt(Map).unknown(!0)}function or(){return Wt(Array).uniqueItems(!0)}function ar(e={}){return Wt(Object).properties(e)}function cr(...e){return Wt().any(...e)}function ur(...e){return Wt().anyOf(e)}function pr(...e){return Wt().oneOf(e)}function hr(...e){return Wt().allOf(e)}function lr(e){try{if(e())return u.from(e()).schema}catch(e){}return new he(e)}function mr(...t){const r=[t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?zt().enum(Object.values(t)):t))],s=(...e)=>{u.from(...e).nestedGenerics=r};return s.Nested=(...e)=>(r.push(e),s),s}function dr(...e){return t=>{u.from(t).schema.genericLabels=e}}function fr(...t){return Le(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.produces(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],fr(...t));break;default:throw new e.UnsupportedDecoratorType(fr,s)}}))}function yr(...t){return(0,e.useDecorators)(fr(...t),(0,e.StoreSet)("acceptMimes",t))}function gr(...t){return Le(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.consumes(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],gr(...t));break;default:throw new e.UnsupportedDecoratorType(gr,s)}}))}class Or extends Map{methods;decoratorType;entity;actions=[];constructor(e={}){super(),Object.entries(e).forEach((([e,t])=>{this.set(e,t)}))}addAction(e){return this.actions.push(e),this}build(){const e=(...t)=>this.bind(t,e),t=t=>{return r=(...e)=>{t in this?this[t](...e):this.set(t,e[0])},(...t)=>(r(...t),e);var r};return this.methods.forEach((r=>{e[q(r)]=t(r)})),e}toObject(){return[...this.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{})}getMergedKey(t,r){let s=this.get(t)||r;if(s)return this.decoratorType===e.DecoratorTypes.CLASS&&(s={...s,...r||{}}),{...r||{},...s}}bind(e,t){this.entity=u.from(...e),this.beforeInit(),this.onInit(e,t),this.afterInit()}onInit(e,t){this.forEach(((e,t)=>{this.onMapKey(t,e)}))}onMapKey(e,t){this.entity.set(e,t)}runActions(){return this.actions.forEach((e=>{e(this)})),this}beforeInit(){}afterInit(){}}const Sr=new Map;function br(e,t){Sr.set(e,t)}function Rr(e){return Sr.get(e)}function Tr(t){return t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?zt().enum(Object.values(t)):t))}class Ar extends Or{methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location"];constructor({status:e,model:t}){super(),this.model(t),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&Y(e)&&!this.get("description")&&(this.set("description",Y(e)),this.get("model")||this.model(Rr(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...ne(e)}),this}header(e,t){return this.headers({[e]:t})}location(e,t={}){return this.headers({Location:{...t,value:e}}),this}groups(...e){return this.set("groups",e),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const t=this.get("model");return this.checkPrimitive(t),this.checkCollection(t),this.addAction((t=>{this.get("schema").nestedGenerics.push(Tr(e))})),this}of(...t){const r=this.get("model");return this.checkPrimitive(r),this.addAction((()=>{const s=this.get("schema");(0,e.isCollection)(r)?s?.itemSchema({type:t[0]}):s?.nestedGenerics.push(Tr(t))})),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction((()=>{this.get("schema").assign(e)})),this}examples(t){return this.set("examples",(0,e.isString)(t)?[t]:t),this}title(e){return this.schema({title:e})}checkPrimitive(t){if((0,e.isPrimitiveOrPrimitiveClass)(t))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(t){if((0,e.isCollection)(t))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const t=this.get("model");let r=this.get("contentType");return!t||(0,e.isPlainObject)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(r=r||"application/json"),r}getStatus(){return this.get("status")||"default"}onInit(t,r){switch((0,e.decoratorTypeOf)(t)){case e.DecoratorTypes.METHOD:this.entity=u.from(...t),this.entity.operation&&this.map();break;case e.DecoratorTypes.CLASS:this.decoratorType=e.DecoratorTypes.CLASS,(0,e.decorateMethodsOf)(t[0],r)}}map(){const t=this.get("model"),{entity:r,decoratorType:s}=this,n=this.entity.operation,i=this.getStatus(),o=n.ensureResponseOf(i),a=this.getContentType();let{description:c=o.get("description")}=this.toObject();c&&(c=s===e.DecoratorTypes.CLASS&&o.get("description")||c,o.description(c));const u=this.getMergedKey("headers",o.get("headers"));return u&&o.headers(u),this.mapMedia(o),(ee(this.get("status"))||"default"===i)&&t&&(r.type=t),a&&n.addProduce(a),this.runActions()}mapMedia(t){const r=this.getContentType(),s=this.get("model"),n=t.getMedia(r||"*/*"),i=n.get("schema")||new T({type:s}),o=this.get("groups"),a=this.get("allowedGroups"),c=this.entity.operation;if(s&&((0,e.isArray)(s)?i.oneOf(s.map((e=>({type:e})))):i.type(s)),this.set("schema",i),n.schema(i),n.groups=o,a){n.allowedGroups=a;const e=new B;e.in("query").name("includes"),e.schema(T.from({type:"array",items:{type:"string",enum:[...a]}})),c.addParameter(-1,e)}const u=this.get("examples");return u&&n.examples(u),n}manyOf(t,r){const s=this.get("model");return this.addAction((()=>{const n=this.get("schema");(0,e.isCollection)(s)?(n.type(s||Object),n.itemSchema().set(t,r)):n.set(t,r)})),this}}function Er(e,t){return new Ar({status:e,model:t}).build()}function vr(e){return Er().ContentType(e)}function xr(t=!0){return Le(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.METHOD:r.operation.deprecated(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],xr(t));break;case e.DecoratorTypes.PARAM:r.parameter.set("deprecated",t);break;case e.DecoratorTypes.PROP:r.schema.set("deprecated",t);break;default:throw new e.UnsupportedDecoratorType(xr,s)}}))}function Cr(e,t){return void 0!==t&&(e={[e]:t}),Er().Headers(e)}function Pr(t){const r=new B,s={},n=(i,o,a)=>{const c=u.from(i,o,a);switch(c.decoratorType){case e.DecoratorTypes.PARAM:c.parameter.in(t);break;case e.DecoratorTypes.METHOD:r.in(t),c.operation.addParameter(-1,r),r.schema(T.from(s));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(i,n);break;default:throw new e.UnsupportedDecoratorType(Pr,[i,o,a])}};return n.Type=e=>(s.type=e,n),n.Name=e=>(r.name(e),n),n.Description=e=>(r.description(e),n),n.Required=(e=!0)=>(r.required(e),n),n.Pattern=e=>n.Schema({pattern:e.toString()}),n.Schema=e=>(Object.assign(s,e),n),n}function wr(t){return(...r)=>{const[s,n,i]=r,o=e.Metadata.getParamTypes(s,n)[i]===Array,a=[t="object"==typeof t?void 0:t,!o&&"0"].filter(Boolean).join(".");(0,e.useDecorators)(Pr(_.FILES),Dt(a),(0,e.useMethodDecorators)(Er(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),gr("multipart/form-data")))(...r)}}function $r(e,t){return Er().Location(e,t)}function _r(t){return Le(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(_r,s);r.operation.operationId(t)}))}function Mr(t,r="/"){return Le(((s,n)=>{if(s.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Mr,n);s.operation.addOperationPath(t.toUpperCase(),r)}))}function Nr(){return xt("partial")}function Dr(t){return Le(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.CLASS)throw new e.UnsupportedDecoratorType(Dr,s);r.path=t}))}function Lr(...t){const{status:r,url:s,meta:n}=t.reduce(((t,r)=>(0,e.isNumber)(r)?(t.status=r,t):(0,e.isString)(r)?(t.url=r,t):(t.meta=r,t)),{status:302,url:"",meta:{}});return(0,e.useDecorators)(Er(r).Location(s,n),Le((e=>{e.operation?.setRedirection(r)})))}function kr(e){let t,r;const s=e.filter((e=>"string"==typeof e&&Me.includes(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:s}}class Ir extends Or{methods=["name","description","summary","method","id","use","useAfter","useBefore"];beforeInit(){const e=this.get("path"),t=Ne[this.get("method")]||Ne.CUSTOM;e&&this.entity.operation.addOperationPath(t,e)}onMapKey(e,t){switch(e){case"name":case"id":return void this.entity.operation.operationId(t);case"summary":return void this.entity.operation.summary(t);case"description":return void this.entity.operation.description(t);case"use":return void this.entity.use(t);case"useAfter":return void this.entity.after(t);case"useBefore":return void this.entity.before(t)}return super.onMapKey(e,t)}}function Hr(...e){const t=kr(e);return new Ir(t).build()}function jr(e="/",...t){return Hr(...[Ne.ALL,e].concat(t))}function Gr(e="/",...t){return Hr(...[Ne.GET,e].concat(t))}function qr(e="/",...t){return Hr(...[Ne.POST,e].concat(t))}function Ur(e="/",...t){return Hr(...[Ne.PUT,e].concat(t))}function Kr(e="/",...t){return Hr(...[Ne.DELETE,e].concat(t))}function Jr(e="/",...t){return Hr(...[Ne.HEAD,e].concat(t))}function Br(e="/",...t){return Hr(...[Ne.PATCH,e].concat(t))}function Fr(e="/",...t){return Hr(...[Ne.OPTIONS,e].concat(t))}function Wr(t,...r){return Le(((s,n)=>{switch(s.decoratorType){case e.DecoratorTypes.METHOD:s.operation.addSecurityScopes(t,r);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],Wr(t,...r));break;default:throw new e.UnsupportedDecoratorType(Wr,n)}}))}function Vr(e,t){return Er(e,t)}function Xr(t){return Le(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Xr,s);r.operation.summary(t)}))}function zr(...t){return Le(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.addTags(function(e){return e.map((e=>"string"==typeof e?{name:e}:e))}(t));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],zr(...t));break;default:throw new e.UnsupportedDecoratorType(zr,s)}}))}function Qr(t,r){return(0,e.StoreSet)("view",{path:t,options:r})}class Zr extends Map{setOperationPath(e){if(e.method!==Ne.CUSTOM){const t=this.getKey(e.method,e.path);this.set(t,e)}}getKey=(e,t)=>`${e}-${t}`}function Yr(e,t){if(e instanceof RegExp||t instanceof RegExp){if(!e)return t;if(!t)return e;const r=e instanceof RegExp?e:new RegExp(e,"gi"),s=t instanceof RegExp?t:new RegExp(t,"gi");return new RegExp(r.source+s.source,(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":""))}e&&t&&e.endsWith("/")&&t.startsWith("/")&&(t=t.slice(1));const r=(e||"")+(t||"");return r.endsWith("/")&&r.length>1?r.slice(0,-1):r}class es{token;endpoint;operationPath;basePath;paramsTypes;constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){return this.operationPath?.path}get fullPath(){return Yr(this.basePath,this.path)}get method(){return this.operationPath?.method||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}function ts(e){return e.split("/").filter(Boolean).join("/")}function rs(e,t){return e.map((e=>t.parameters.find((t=>t.in===e.in&&t.name===e.name))||e)).concat(...t.parameters.filter((e=>"path"!==e.in)))}function ss(e){const t=e.isStore?e:pe(e);if(!t.$operations){const e=new Zr;t.$operations=new Map,fe(t).forEach((e=>{e.children.forEach((e=>{e instanceof ce&&!t.$operations.has(e.propertyKey)&&t.$operations.set(e.propertyKey,e)}))})),t.$operations.forEach((t=>{t.operation.operationPaths.forEach((t=>{e.setOperationPath(t)}))})),e.clear()}return t.$operations}function ns(e,t=""){t instanceof RegExp&&(t=t.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const r=[],s=[];let n=!1,i="";return function(e){let t=0;return e.split("").filter((e=>{"("===e&&t++;const r=0===t;return")"===e&&t--,r})).join("").split("/").filter((e=>!!e))}(`${e}${t}`).map((e=>{const t=e.replace(":","").replace("?","");if(e.includes(":")){const o=e.includes("?");o&&!n&&(n=!0,s.push({path:i,parameters:[].concat(r)}));const{prefix:a,name:c,postfix:u}=function(e){const[t,r]=e.split("="),s=(r||t).split(".");return{prefix:r&&t?`${t}=`:"",name:s.splice(0,1)[0],postfix:s.length?`.${s.join(".")}`:""}}(t);i+=`/${a}{${c}}${u}`,r.push({in:"path",name:c,type:"string",required:!0}),o&&n&&s.push({path:i,parameters:[].concat(r)})}else i+=`/${e}`})),s.length?s:[{path:i,parameters:[].concat(r)}]}function is(e,t,{rootPath:r,specType:s,operationId:n,defaultTags:i,tags:o,path:a,method:c}){const u=ns(r,a).map((({path:e,parameters:t})=>(e=e||"/",s===L.OPENAPI&&(t=t.map((({type:e,...t})=>({...t,schema:{type:e}})))),{path:e,parameters:t})));return u.reduce(((e,{path:r,parameters:s})=>{s=rs(s,t),r=r||"/";const a=t.tags?.length?t.tags:[i];return e.paths[r]={...e.paths[r],[c.toLowerCase()]:{operationId:t.operationId||n(r),...t,tags:a.map((({name:e})=>e)),parameters:s}},o.push(...a),e}),e)}function os(e,t){return 0===t?e.toLowerCase():G(e,t)}function as(e,t){return void 0===t&&(t={}),q(e,p({transform:os},t))}function cs(e=""){const t=new Map;return(r,s,n="")=>{const i=((t,r)=>{const s=(e||"%c.%m").replace(/%c/,t).replace(/%m/,r);return""===e?as(s):s})(r,s),o=r+s;if(!t.has(o))return t.set(o,0),i;const a=n.match(/{(\w+)}/gi);if(a){const e=r+s+a[0];if(!t.has(e))return t.set(e,0),as(`${i} By ${a}`)}const c=t.get(o)+1;return t.set(o,c),`${i}_${c}`}}const us=(0,e.mergeReducerBuilder)(((e,t)=>e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),ps=(0,e.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),hs=(0,e.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),ls=(0,e.mergeReducerBuilder)(((e,t)=>e.name===t.name)),ms={security:hs,parameters:ps,oneOf:us,anyOf:us,allOf:us,tags:ls};function ds(t,r){return(0,e.deepMerge)(t,r,{reducers:ms,cleanUndefinedProps:!0})}const fs=new Map;function ys(t,r={}){if(r={...r,operationIdFormatter:r.operationIdFormatter||cs(r.operationIdPattern),root:!1},(0,e.isArray)(t)){let e={};return r={...r,specType:L.OPENAPI,paths:{},tags:[],schemas:{},append(t){e=ds(e,t)}},t.forEach((({token:e,...t})=>{const s=ys(e,{...r,...t});r.append(s)})),e}return function(e,t,r){fs.has(e)||fs.set(e,new Map);const s=fs.get(e),n=JSON.stringify(t);return s.has(n)||s.set(n,r()),s.get(n)}(t,r,(()=>function(t,r){const s=pe(t),{schemas:n={},paths:i={},rootPath:o="/",tags:a=[]}=r,c=L.OPENAPI,u=s.path,p=(0,e.cleanObject)({name:s.schema.getName(),description:s.schema.get("description")}),h={paths:i};return ss(t).forEach((e=>{if(e.store.get("hidden"))return;const t=e.operation.toJSON({...r,specType:c,schemas:n});e.operation.operationPaths.forEach((({path:s,method:n})=>{n&&is(h,t,{rootPath:ts(o+u),path:s,method:n,defaultTags:p,tags:a,specType:c,operationId:t=>r.operationIdFormatter(e.parent.schema.get("name")||e.parent.targetName,e.propertyName,t)})}))})),h.tags=(0,e.uniqBy)(a,"name"),Object.keys(n).length&&(h.components={schemas:n}),h}(t,r)))}function gs(e){return e.startsWith("3.")?L.OPENAPI:L.SWAGGER}function Os(e){return"openapi"in e?L.OPENAPI:L.SWAGGER}function Ss(t){const{title:r,description:s,version:n,termsOfService:i,contact:o,license:a}=t;return(0,e.cleanObject)({version:n,title:r,description:s,termsOfService:i,contact:o,license:a})}function bs(t,{version:r,specVersion:s,acceptMimes:n=["application/json"]}){const{paths:i,security:o,tags:a,host:c,basePath:u,schemes:p,consumes:h=[],produces:l=["application/json"],definitions:m,parameters:d,responses:f,securityDefinitions:y,externalDocs:g}=t;return{swagger:s,consumes:(0,e.uniq)([...n,...h]),produces:(0,e.uniq)([...l]),info:Ss((0,e.getValue)(t,"info",{})),paths:i,host:c,basePath:u,schemes:p,definitions:m,parameters:d,responses:f,security:o,securityDefinitions:y,tags:a,externalDocs:g}}function Rs(t,{specVersion:r}){const{servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}=t;return{openapi:r,info:Ss((0,e.getValue)(t,"info",{})),servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}}function Ts(t,{fileSpec:r,acceptMimes:s,specVersion:n,version:i}){const o={specVersion:n=n||(0,e.getValue)(t,"openapi",(0,e.getValue)(t,"swagger","2.0")),acceptMimes:s};switch(gs(n)){case L.OPENAPI:t=Rs(t,o),r=r?Rs(r,o):r;break;default:case L.SWAGGER:t=bs(t,o),r=r?bs(r,o):r}return t=ds(t,r),(0,e.setValue)(t,"info.title",(0,e.getValue)(t,"info.title","Api documentation")),(0,e.setValue)(t,"info.version",(0,e.getValue)(t,"info.version",i)),t}const As=["get","put","post","delete","options","head","patch","trace"],Es=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],vs=["type","items"],xs=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,Cs={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function Ps(e){if(Array.isArray(e))e.forEach(Ps);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):Ps(e[t])}function ws(e){return new RegExp(xs,"i").test(e)}function $s(e){const t=Object.keys(Cs).map((e=>Cs[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||ws(e)))}function _s(e){function t(e){const{scheme:t,type:r,name:s,bearerFormat:n,flows:i,...o}=e;switch(r){case"http":if("basic"===t)return{...o,type:t};if("bearer"===t)return{...o,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const e=Object.keys(i)[0],s=i[e];let n=e;return"clientCredentials"===n?n="application":"authorizationCode"===n&&(n="accessCode"),{type:r,flow:n,authorizationUrl:s.authorizationUrl,tokenUrl:s.tokenUrl,scopes:s.scopes}}}return Object.entries(e).reduce(((e,[r,s])=>({...e,[r]:t(s)})),{})}function Ms(e){let t=e.url;const r=e.variables||{};for(const e in r){const s=r[e]||{};if(s.default){const r=RegExp(`{${e}}`,"g");t=t.replace(r,s.default)}}const s=new URL(t);return{host:s.host?s.host:void 0,basePath:s.pathname,schemes:null!==s.protocol?[s.protocol.substring(0,s.protocol.length-1)]:void 0}}class Ns{spec;constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?Ms(e):{}}resolveReference(e,t,r){if(!t||!t.$ref)return t;const s=t.$ref;if(s.startsWith("#")){const t=s.split("/").map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~")));t.shift();let n=e;return t.forEach((e=>{n=n[e]})),r?JSON.parse(JSON.stringify(n)):n}}convert(){const t={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,Ps(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],(0,e.cleanObject)({...t,...this.spec})}convertOperations(e,t){return Object.entries(e).reduce(((e,[r,s])=>{const n=e[r]=this.resolveReference({...t,paths:e},s,!0);return this.convertParameters(n),Object.keys(n).forEach((r=>{if(As.indexOf(r)>=0){const s=n[r]=this.resolveReference({...t,paths:e},n[r],!0);this.convertOperationParameters(s),this.convertResponses(s)}})),e}),e)}convertOperationParameters(e){let t,r,s,n;if(e.parameters=e.parameters||[],e.requestBody){let i=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const t=$s(e.requestBody.content)[0],r={content:{}},s=e.requestBody.content[t];s&&s.schema&&s.schema.$ref&&!s.schema.$ref.startsWith("#")&&(i=this.resolveReference(this.spec,s.schema,!0),r.content[`${t}`]={schema:i},i=r)}if(i.name="body",t=i.content,t&&Object.keys(t).length){if(s=Object.keys(t).filter((e=>e.indexOf("/")>0)),n=s.filter((e=>e.indexOf("*")<0)),r=$s(t)[0],delete i.content,[Cs.APPLICATION_X_WWW_URLENCODED,Cs.MULTIPART_FORM_DATA].includes(r))if(e.consumes=n,i.in="formData",i.schema=t[r].schema,i.schema=this.resolveReference(this.spec,i.schema,!0),"object"===i.schema.type&&i.schema.properties){const t=i.schema.required||[];Object.keys(i.schema.properties).forEach((r=>{const s=i.schema.properties[r];if(!s.readOnly){const n={name:r,in:"formData",schema:s};t.indexOf(r)>=0&&(n.required=!0),e.parameters?.push(n)}}))}else e.parameters.push(i);else r?(e.consumes=n,i.in="body",i.schema=t[r].schema,e.parameters.push(i)):s&&(e.consumes=n||["application/octet-stream"],i.in="body",i.name=i.name||"file",delete i.type,i.schema=t[s[0]].schema||{type:"string",format:"binary"},e.parameters.push(i));i.schema&&this.convertSchema(i.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){void 0!==e.parameters&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach(((t,r)=>{if("body"!==(t=e.parameters[r]=this.resolveReference(this.spec,t,!1)).in){if(this.copySchemaProperties(t,Es),this.copySchemaProperties(t,vs),this.copySchemaXProperties(t),!t.description){const e=this.resolveReference(this.spec,t.schema,!1);e&&e.description&&(t.description=e.description)}void 0!==t.example&&(t["x-example"]=t.example),delete t.schema,delete t.allowReserved,delete t.example}if("array"===t.type)switch(t.style||("query"===t.in||"cookie"===t.in?"form":"simple")){case"matrix":t.collectionFormat=t.explode?void 0:"csv";break;case"label":t.collectionFormat=void 0;break;case"simple":t.collectionFormat="csv";break;case"spaceDelimited":t.collectionFormat="ssv";break;case"pipeDelimited":t.collectionFormat="pipes";break;case"deepOpbject":t.collectionFormat="multi";break;case"form":t.collectionFormat=!1===t.explode?"csv":"multi"}delete t.style,delete t.explode})))}copySchemaProperties(e,t){let r=this.resolveReference(this.spec,e.schema,!0);r&&t.forEach((t=>{const s=r[t];"additionalProperties"===t&&"boolean"==typeof s||void 0!==s&&(e[t]=s)}))}copySchemaXProperties(e){let t=this.resolveReference(this.spec,e.schema,!0);t&&Object.keys(t).forEach((r=>{Reflect.hasOwnProperty.call(t,r)&&!Reflect.hasOwnProperty.call(e,r)&&r.startsWith("x-")&&(e[r]=t[r])}))}convertResponses(e){Object.keys(e.responses||{}).forEach((t=>{const r=e.responses[t]=this.resolveReference(this.spec,e.responses[t],!0);if(r.content){let t=null,s=null;if(Object.keys(r.content).forEach((n=>{const i=n.indexOf("*")<0?n:"application/octet-stream";e.produces?e.produces.indexOf(i)<0&&e.produces.push(i):e.produces=[i];const o=r.content[n];t=t||o.schema,!s&&ws(i)&&(s=o.schema),o.example&&(r.examples=r.examples||{},r.examples[i]=o.example)})),t){r.schema=s||t;const e=this.resolveReference(this.spec,r.schema,!0);e&&r.schema.$ref&&!r.schema.$ref.startsWith("#")&&(r.schema=e),this.convertSchema(r.schema,"response")}}Object.keys(r.headers||{}).forEach((e=>{const t=this.resolveReference(this.spec,r.headers[e],!0);t.schema&&(t.type=t.schema.type,t.format=t.schema.format,delete t.schema),r.headers[e]=t})),delete r.content}))}convertSchema(e,t){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const r in e.allOf)this.convertSchema(e.allOf[r],t);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach((r=>{!0===e.properties[r].writeOnly&&"response"===t?delete e.properties[r]:(this.convertSchema(e.properties[r],t),delete e.properties[r].writeOnly)}));break;case"array":e.items&&this.convertSchema(e.items,t)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),void 0!==e.deprecated&&(void 0===e["x-deprecated"]&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach((e=>{this.convertSchema(this.spec.definitions[e])})),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach((t=>{const r=e[t];if("string"!=typeof r)return void console.warn(`Ignoring ${r} for ${t} in discriminator.mapping.`);let s;if(/^[a-zA-Z0-9._-]+$/.test(r))try{s=this.resolveReference(this.spec,{$ref:`#/components/schemas/${r}`},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} as schema name in discriminator.mapping: ${e}`)}if(!s)try{s=this.resolveReference(this.spec,{$ref:r},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} in discriminator.mapping: ${e}`)}s?(s["x-discriminator-value"]=t,s["x-ms-discriminator-value"]=t):console.warn(`Unable to resolve ${r} for ${t} in discriminator.mapping.`)}))}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=_s(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function Ds(e){return new Ns(e).convert()}async function Ls({tokens:t,...r}){const{version:s="1.0.0",acceptMimes:n,specPath:i,specVersion:o}=r,a=Ts((0,e.getValue)(r,"spec",{}),{fileSpec:{},version:s,specVersion:o,acceptMimes:n}),c=Os(a),u=ds(a,ys(t,r));return c===L.SWAGGER?Ds(u):u}const ks="$cache:schemes";function Is(e,t={}){const r=pe(e);return t={endpoint:!0,groups:[],...t,specType:t.specType||L.JSON,schemas:{}},"parameter"===r.decoratorType&&(t={...t,genericTypes:r.nestedGenerics[0],nestedGenerics:r.nestedGenerics,groups:r.parameter?.groups}),function(e,t){const r=e.store.get(ks)||new Map,s=function(e){return JSON.stringify(e)}(t);if(!r.has(s)){const n=o("schema",e.schema,t);Object.keys(t.schemas).length&&(n.definitions=t.schemas),r.set(s,n)}return e.store.set(ks,r),r.get(s)}(r,t)}function Hs(e,t={}){const r=e.isStore?e:pe(e),s=Yr(t.basePath,r.path);let n=[];return t.withChildren&&(n=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(Hs(r,{...t,basePath:s}))),n)),[...ss(e).values()].reduce(((t,r)=>{const{operation:n}=r;return n&&n.operationPaths.forEach((n=>{t.push(new es({basePath:s,token:e,endpoint:r,operationPath:n}))})),t}),n)}function js(e){const t=e.isStore?e:pe(e);if(!t.$properties){const e=fe(t);t.$properties=new Map,e.forEach((e=>{e.children.forEach((e=>{t.$properties.has(e.propertyKey)||t.$properties.set(e.propertyKey,e)}))}))}return t.$properties}function Gs(e,t={}){const r=js(e),s=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&be(e.itemSchema,t)||s.set(r,e)})),s}})(),n})()));
|
|
3
3
|
//# sourceMappingURL=schema.umd.min.js.map
|