@tsed/schema 7.87.6 → 7.87.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/schema.umd.min.js +1 -1
- package/lib/browser/schema.umd.min.js.map +1 -1
- package/lib/cjs/components/default/nullableMapper.js +46 -44
- package/lib/cjs/components/default/nullableMapper.js.map +1 -1
- package/lib/cjs/domain/JsonSchema.js +2 -4
- package/lib/cjs/domain/JsonSchema.js.map +1 -1
- package/lib/cjs/hooks/alterOneOf.js.map +1 -1
- package/lib/esm/components/default/nullableMapper.js +47 -45
- package/lib/esm/components/default/nullableMapper.js.map +1 -1
- package/lib/esm/domain/JsonSchema.js +2 -4
- package/lib/esm/domain/JsonSchema.js.map +1 -1
- package/lib/esm/hooks/alterOneOf.js.map +1 -1
- package/package.json +6 -6
|
@@ -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"),require("change-case")):"function"==typeof define&&define.amd?define(["@tsed/core","change-case"],t):"object"==typeof exports?exports["@tsed/schema"]=t(require("@tsed/core"),require("change-case")):e["@tsed/schema"]=t(e["@tsed/core"],e["change-case"])}(self,((e,t)=>(()=>{"use strict";var r={133:(e,t,r)=>{e.exports=r(555)},379:e=>{const t="\\\\/",r=`[^${t}]`,s="\\.",n="\\/",i="[^/]",o=`(?:${n}|$)`,a=`(?:^|${n})`,c=`${s}{1,2}${o}`,p={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:"/"},u={...p,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?u:p}},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:p}=s,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=>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=p[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],g=r.capture?"":"?:",y=s.globChars(r.windows),O=s.extglobChars(y),{DOT_LITERAL:S,PLUS_LITERAL:b,SLASH_LITERAL:R,ONE_CHAR:A,DOTS_SLASH:E,NO_DOT:T,NO_DOT_SLASH:P,NO_DOTS_SLASH:v,QMARK:C,QMARK_NO_DOT:x,STAR:$,START_ANCHOR:M}=y,_=e=>`(${g}(?:(?!${M}${e.dot?E:S}).)*?)`,w=r.dot?"":T,L=r.dot?C:x;let N=!0===r.bash?_(r):$;r.capture&&(N=`(${N})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const I={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,I),m=e.length;const D=[],k=[],j=[];let H,G=d;const q=()=>I.index===m-1,U=I.peek=(t=1)=>e[I.index+t],B=I.advance=()=>e[++I.index],K=()=>e.slice(I.index+1),F=(e="",t=0)=>{I.consumed+=e,I.index+=t},J=e=>{I.output+=null!=e.output?e.output:e.value,F(e.value)},W=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)B(),I.start++,e++;return e%2!=0&&(I.negated=!0,I.start++,!0)},V=e=>{I[e]++,j.push(e)},X=e=>{I[e]--,j.pop()},z=e=>{if("globstar"===G.type){const t=I.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||D.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(I.output=I.output.slice(0,-G.output.length),G.type="star",G.value="*",G.output=N,I.output+=G.output)}if(D.length&&"paren"!==e.type&&!O[e.value]&&(D[D.length-1].inner+=e.value),(e.value||e.output)&&J(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=I.parens,s.output=I.output;const n=(r.capture?"(":"")+s.open;V("parens"),z({type:e,value:t,output:I.output?"":A}),z({type:"paren",extglob:!0,value:B(),output:n}),D.push(s)},Y=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let s=N;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=_(r)),(s!==N||q()||/^\)+$/.test(K()))&&(t=e.close=`)$))${s}`),"bos"===e.prev.type&&q()&&(I.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:H,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?L+(i?C.repeat(i.length):""):C.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?t?t+n+(i?N:""):N: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?(I.output=e,I):(I.output=n.wrapOutput(i,I,t),I)}for(;!q();){if(H=B(),"\0"===H)continue;if("\\"===H){const e=U();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",z({type:"text",value:H});continue}const t=/^\\+/.exec(K());let s=0;if(t&&t[0].length>2&&(s=t[0].length,I.index+=s,s%2!=0&&(H+="\\")),!0===r.unescape?H=B()||"":H+=B()||"",0===I.brackets){z({type:"text",value:H});continue}}if(I.brackets>0&&("]"!==H||"["===G.value||"[^"===G.value)){if(!1!==r.posix&&":"===H){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,I.backtrack=!0,B(),d.output||1!==f.indexOf(G)||(d.output=A);continue}}}("["===H&&":"!==U()||"-"===H&&"]"===U())&&(H=`\\${H}`),"]"!==H||"["!==G.value&&"[^"!==G.value||(H=`\\${H}`),!0===r.posix&&"!"===H&&"["===G.value&&(H="^"),G.value+=H,J({value:H});continue}if(1===I.quotes&&'"'!==H){H=n.escapeRegex(H),G.value+=H,J({value:H});continue}if('"'===H){I.quotes=1===I.quotes?0:1,!0===r.keepQuotes&&z({type:"text",value:H});continue}if("("===H){V("parens"),z({type:"paren",value:H});continue}if(")"===H){if(0===I.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=D[D.length-1];if(e&&I.parens===e.parens+1){Y(D.pop());continue}z({type:"paren",value:H,output:I.parens?")":"\\)"}),X("parens");continue}if("["===H){if(!0!==r.nobracket&&K().includes("]"))V("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));H=`\\${H}`}z({type:"bracket",value:H});continue}if("]"===H){if(!0===r.nobracket||G&&"bracket"===G.type&&1===G.value.length){z({type:"text",value:H,output:`\\${H}`});continue}if(0===I.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));z({type:"text",value:H,output:`\\${H}`});continue}X("brackets");const e=G.value.slice(1);if(!0===G.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),G.value+=H,J({value:H}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(G.value);if(I.output=I.output.slice(0,-G.value.length),!0===r.literalBrackets){I.output+=t,G.value=t;continue}G.value=`(${g}${t}|${G.value})`,I.output+=G.value;continue}if("{"===H&&!0!==r.nobrace){V("braces");const e={type:"brace",value:H,output:"(",outputIndex:I.output.length,tokensIndex:I.tokens.length};k.push(e),z(e);continue}if("}"===H){const e=k[k.length-1];if(!0===r.nobrace||!e){z({type:"text",value:H,output:H});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=u(s,r),I.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=I.output.slice(0,e.outputIndex),s=I.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",I.output=r;for(const e of s)I.output+=e.output||e.value}z({type:"brace",value:H,output:t}),X("braces"),k.pop();continue}if("|"===H){D.length>0&&D[D.length-1].conditions++,z({type:"text",value:H});continue}if(","===H){let e=H;const t=k[k.length-1];t&&"braces"===j[j.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===G.type&&I.index===I.start+1){I.start=I.index+1,I.consumed="",I.output="",f.pop(),G=d;continue}z({type:"slash",value:H,output:R});continue}if("."===H){if(I.braces>0&&"dot"===G.type){"."===G.value&&(G.output=S);const e=k[k.length-1];G.type="dots",G.output+=H,G.value+=H,e.dots=!0;continue}if(I.braces+I.parens===0&&"bos"!==G.type&&"slash"!==G.type){z({type:"text",value:H,output:S});continue}z({type:"dot",value:H,output:S});continue}if("?"===H){if((!G||"("!==G.value)&&!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("qmark",H);continue}if(G&&"paren"===G.type){const e=U();let t=H;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===G.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${H}`),z({type:"text",value:H,output:t});continue}if(!0!==r.dot&&("slash"===G.type||"bos"===G.type)){z({type:"qmark",value:H,output:x});continue}z({type:"qmark",value:H,output:C});continue}if("!"===H){if(!0!==r.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Q("negate",H);continue}if(!0!==r.nonegate&&0===I.index){W();continue}}if("+"===H){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("plus",H);continue}if(G&&"("===G.value||!1===r.regex){z({type:"plus",value:H,output:b});continue}if(G&&("bracket"===G.type||"paren"===G.type||"brace"===G.type)||I.parens>0){z({type:"plus",value:H});continue}z({type:"plus",value:b});continue}if("@"===H){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){z({type:"at",extglob:!0,value:H,output:""});continue}z({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=a.exec(K());e&&(H+=e[0],I.index+=e[0].length),z({type:"text",value:H});continue}if(G&&("globstar"===G.type||!0===G.star)){G.type="star",G.star=!0,G.value+=H,G.output=N,I.backtrack=!0,I.globstar=!0,F(H);continue}let t=K();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",H);continue}if("star"===G.type){if(!0===r.noglobstar){F(H);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:H,output:""});continue}const a=I.braces>0&&("comma"===s.type||"brace"===s.type),c=D.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){z({type:"star",value:H,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[I.index+4];if(r&&"/"!==r)break;t=t.slice(3),F("/**",3)}if("bos"===s.type&&q()){G.type="globstar",G.value+=H,G.output=_(r),I.output=G.output,I.globstar=!0,F(H);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&q()){I.output=I.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=_(r)+(r.strictSlashes?")":"|$)"),G.value+=H,I.globstar=!0,I.output+=s.output+G.output,F(H);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";I.output=I.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=`${_(r)}${R}|${R}${e})`,G.value+=H,I.output+=s.output+G.output,I.globstar=!0,F(H+B()),z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){G.type="globstar",G.value+=H,G.output=`(?:^|${R}|${_(r)}${R})`,I.output=G.output,I.globstar=!0,F(H+B()),z({type:"slash",value:"/",output:""});continue}I.output=I.output.slice(0,-G.output.length),G.type="globstar",G.output=_(r),G.value+=H,I.output+=G.output,I.globstar=!0,F(H);continue}const s={type:"star",value:H,output:N};!0!==r.bash?!G||"bracket"!==G.type&&"paren"!==G.type||!0!==r.regex?(I.index!==I.start&&"slash"!==G.type&&"dot"!==G.type||("dot"===G.type?(I.output+=P,G.output+=P):!0===r.dot?(I.output+=v,G.output+=v):(I.output+=w,G.output+=w),"*"!==U()&&(I.output+=A,G.output+=A)),z(s)):(s.output=H,z(s)):(s.output=".*?","bos"!==G.type&&"slash"!==G.type||(s.output=w+s.output),z(s))}for(;I.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));I.output=n.escapeLast(I.output,"["),X("brackets")}for(;I.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));I.output=n.escapeLast(I.output,"("),X("parens")}for(;I.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));I.output=n.escapeLast(I.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==G.type&&"bracket"!==G.type||z({type:"maybe_slash",value:"",output:`${R}?`}),!0===I.backtrack){I.output="";for(const e of I.tokens)I.output+=null!=e.output?e.output:e.value,e.suffix&&(I.output+=e.suffix)}return I};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=p[e]||e;const{DOT_LITERAL:c,SLASH_LITERAL:u,ONE_CHAR:h,DOTS_SLASH:l,NO_DOT:m,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:g,START_ANCHOR:y}=s.globChars(r.windows),O=r.dot?d:m,S=r.dot?f:m,b=r.capture?"":"?:";let R=!0===r.bash?".*?":g;r.capture&&(R=`(${R})`);const A=e=>!0===e.noglobstar?R:`(${b}(?:(?!${y}${e.dot?l:c}).)*?)`,E=e=>{switch(e){case"*":return`${O}${h}${R}`;case".*":return`${c}${h}${R}`;case"*.*":return`${O}${R}${c}${h}${R}`;case"*/*":return`${O}${R}${u}${h}${S}${R}`;case"**":return O+A(r);case"**/*":return`(?:${O}${A(r)}${u})?${S}${h}${R}`;case"**/*.*":return`(?:${O}${A(r)}${u})?${S}${R}${c}${h}${R}`;case"**/.*":return`(?:${O}${A(r)}${u})?${c}${h}${R}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=E(t[1]);if(!r)return;return r+c+t[2]}}},T=n.removePrefix(e,{negated:!1,prefix:""});let P=E(T);return P&&!0!==r.strictSlashes&&(P+=`${u}?`),P},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),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 h=(r,s=!1)=>{const{isMatch:n,match:h,output:l}=a.test(r,c,t,{glob:e,posix:o}),m={glob:e,state:p,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):u(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=p),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 p=e===s,u=p&&c?c(e):e;return!1===p&&(u=c?c(e):e,p=u===s),!1!==p&&!0!==o.capture||(p=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,n):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))):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 p=a.toRegex(c,t);return!0===s&&(p.state=e),p},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},p="";return e.startsWith("./")&&(e=e.slice(2),p=c.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(o=n.fastpaths(e,t)),void 0===o?(c=n(e,t),c.prefix=p+(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:p,CHAR_FORWARD_SLASH:u,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:g,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:O}=r(379),S=e=>e===u||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,A=!0===r.parts||!0===r.scanToEnd,E=[],T=[],P=[];let v,C,x=e,$=-1,M=0,_=0,w=!1,L=!1,N=!1,I=!1,D=!1,k=!1,j=!1,H=!1,G=!1,q=0,U={value:"",depth:0,isGlob:!1};const B=()=>$>=R,K=()=>(v=C,x.charCodeAt(++$));for(;$<R;){let e;if(C=K(),C!==o){if(!0===k||C===h){for(q++;!0!==B()&&(C=K());)if(C!==o)if(C!==h){if(!0!==k&&C===c&&(C=K())===c){if(w=U.isBrace=!0,N=U.isGlob=!0,G=!0,!0===A)continue;break}if(!0!==k&&C===a){if(w=U.isBrace=!0,N=U.isGlob=!0,G=!0,!0===A)continue;break}if(C===g&&(q--,0===q)){k=!1,w=U.isBrace=!0,G=!0;break}}else q++;else j=U.backslashes=!0,K();if(!0===A)continue;break}if(C!==u){if(!0!==r.noext&&!0==(C===d||C===i||C===n||C===f||C===p)&&x.charCodeAt($+1)===l){if(N=U.isGlob=!0,I=U.isExtglob=!0,G=!0,!0===A){for(;!0!==B()&&(C=K());)if(C!==o){if(C===y){N=U.isGlob=!0,G=!0;break}}else j=U.backslashes=!0,C=K();continue}break}if(C===n){if(v===n&&(D=U.isGlobstar=!0),N=U.isGlob=!0,G=!0,!0===A)continue;break}if(C===f){if(N=U.isGlob=!0,G=!0,!0===A)continue;break}if(C===m)for(;!0!==B()&&(e=K());)if(e!==o){if(e===O){if(L=U.isBracket=!0,N=U.isGlob=!0,G=!0,!0===A)continue;break}}else j=U.backslashes=!0,K();if(!0===r.nonegate||C!==p||$!==M){if(!0!==r.noparen&&C===l){if(N=U.isGlob=!0,!0===A){for(;!0!==B()&&(C=K());)if(C!==l){if(C===y){G=!0;break}}else j=U.backslashes=!0,C=K();continue}break}if(!0===N){if(G=!0,!0===A)continue;break}}else H=U.negated=!0,M++}else{if(E.push($),T.push(U),U={value:"",depth:0,isGlob:!1},!0===G)continue;if(v===c&&$===M+1){M+=2;continue}_=$+1}}else j=U.backslashes=!0,C=K(),C===h&&(k=!0)}!0===r.noext&&(I=!1,N=!1);let F=x,J="",W="";M>0&&(J=x.slice(0,M),x=x.slice(M),_-=M),F&&!0===N&&_>0?(F=x.slice(0,_),W=x.slice(_)):!0===N?(F="",W=x):F=x,F&&""!==F&&"/"!==F&&F!==x&&S(F.charCodeAt(F.length-1))&&(F=F.slice(0,-1)),!0===r.unescape&&(W&&(W=s.removeBackslashes(W)),F&&!0===j&&(F=s.removeBackslashes(F)));const V={prefix:J,input:e,start:M,base:F,glob:W,isBrace:w,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:D,negated:H};if(!0===r.tokens&&(V.maxDepth=0,S(C)||T.push(U),V.tokens=T),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<E.length;s++){const n=t?t+1:M,i=E[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==M?(T[s].isPrefix=!0,T[s].value=J):T[s].value=o,b(T[s]),V.maxDepth+=T[s].depth),0===s&&""===o||P.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);P.push(s),r.tokens&&(T[T.length-1].value=s,b(T[T.length-1]),V.maxDepth+=T[T.length-1].depth)}V.slashes=E,V.parts=P}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(/.*\//,"")},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},598:e=>{e.exports=t},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"}')}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={exports:{}};return r[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 i={};return(()=>{n.r(i),n.d(i,{ARRAY_PROPERTIES:()=>xe,AcceptMime:()=>Ur,AdditionalProperties:()=>It,All:()=>ms,AllOf:()=>Dt,Allow:()=>jt,Any:()=>Ht,AnyOf:()=>Gt,ArrayOf:()=>vt,BOOLEAN_PROPERTIES:()=>ve,COMMON_PROPERTIES:()=>Me,Children:()=>Et,CollectionContains:()=>xt,CollectionOf:()=>Pt,Const:()=>qt,Consumes:()=>qr,ContentType:()=>Xr,Converter:()=>Sn,CustomKey:()=>Ut,CustomKeys:()=>Bt,DateFormat:()=>cr,DateTime:()=>ar,DecoratorContext:()=>Br,Default:()=>Kt,DefaultMsg:()=>Jt,Delete:()=>ys,Deprecated:()=>zr,Description:()=>Wt,Discriminator:()=>v,DiscriminatorKey:()=>Vt,DiscriminatorValue:()=>Tt,Email:()=>or,EndpointMetadata:()=>J,Enum:()=>Xt,ErrorMsg:()=>Ft,Example:()=>zt,Examples:()=>Qt,ExclusiveMaximum:()=>er,ExclusiveMinimum:()=>sr,For:()=>wr,Format:()=>ir,ForwardGroups:()=>lr,GenericOf:()=>Hr,Generics:()=>Gr,Get:()=>ds,Groups:()=>mr,HTTP_STATUS_MESSAGES:()=>Ze,Head:()=>Os,Header:()=>Qr,Hidden:()=>dr,Ignore:()=>fr,In:()=>Yr,InFile:()=>Zr,Integer:()=>gr,JSON_TYPES:()=>y,JsonClassStore:()=>_,JsonEntitiesContainer:()=>s,JsonEntityComponent:()=>a,JsonEntityFn:()=>At,JsonEntityStore:()=>o,JsonFormatTypes:()=>nr,JsonLazyRef:()=>Y,JsonMap:()=>N,JsonMedia:()=>q,JsonMethodPath:()=>B,JsonMethodStore:()=>F,JsonOperation:()=>K,JsonOperationPathsMap:()=>dt,JsonOperationRoute:()=>$s,JsonParameter:()=>j,JsonParameterStore:()=>W,JsonParameterTypes:()=>I,JsonPropertyStore:()=>X,JsonRequestBody:()=>nt,JsonResponse:()=>U,JsonSchema:()=>M,LabelledAs:()=>yr,Location:()=>es,MANY_OF_PROPERTIES:()=>Te,MapOf:()=>Ct,Max:()=>Zt,MaxItems:()=>Mt,MaxLength:()=>Or,MaxProperties:()=>_t,Maximum:()=>Yt,Min:()=>rr,MinItems:()=>wt,MinLength:()=>Sr,MinProperties:()=>Lt,Minimum:()=>tr,MultipleOf:()=>br,NUMBER_PROPERTIES:()=>Ce,Name:()=>Rr,Nullable:()=>Cr,OBJECT_PROPERTIES:()=>$e,OPERATION_HTTP_VERBS:()=>ct,OPERATION_WS_VERBS:()=>pt,OneOf:()=>vr,Operation:()=>ns,OperationId:()=>is,OperationMethods:()=>ut,OperationPath:()=>os,OperationVerbs:()=>at,Optional:()=>xr,Options:()=>bs,ParamMetadata:()=>V,Partial:()=>as,Patch:()=>Ss,Path:()=>cs,Pattern:()=>$r,Post:()=>fs,Produces:()=>ps,Property:()=>kt,PropertyMetadata:()=>z,Publish:()=>us,Put:()=>gs,ReadOnly:()=>Mr,RecordOf:()=>Lr,Redirect:()=>hs,Required:()=>Nr,RequiredGroups:()=>Ir,Returns:()=>Vr,Route:()=>ls,STRING_PROPERTIES:()=>Pe,Schema:()=>_r,Security:()=>Rs,SpecTypes:()=>Z,Status:()=>As,Subscribe:()=>Es,Summary:()=>Ts,Tags:()=>Ps,TimeFormat:()=>pr,Title:()=>Dr,TypeError:()=>kr,UniqueItems:()=>Nt,Uri:()=>ur,Url:()=>hr,VendorKeys:()=>c,View:()=>vs,WriteOnly:()=>jr,allOf:()=>Ms,alterIgnore:()=>we,alterOneOf:()=>He,alterRequiredGroups:()=>Ie,any:()=>_s,anyMapper:()=>ce,anyOf:()=>ws,array:()=>Er,boolean:()=>Ls,buildPath:()=>ht,classMapper:()=>pe,concatParameters:()=>lt,concatPath:()=>xs,createRef:()=>oe,createRefName:()=>ie,date:()=>Ns,datetime:()=>Is,defineStatusModel:()=>Fr,discriminatorMappingMapper:()=>ue,email:()=>js,enums:()=>Hs,enumsMapper:()=>he,enumsRegistry:()=>p,execMapper:()=>m,execOneOfMapper:()=>f,formatParameterType:()=>D,from:()=>Ar,generateSpec:()=>Rn,genericsMapper:()=>me,getComputedType:()=>g,getGenericsOptions:()=>Se,getInheritedStores:()=>de,getJsonEntityStore:()=>Q,getJsonPathParameters:()=>mt,getJsonSchema:()=>En,getJsonSchemaMapper:()=>l,getJsonType:()=>O,getOperationId:()=>yt,getOperationsRoutes:()=>Tn,getOperationsStores:()=>ft,getProperties:()=>vn,getPropertiesStores:()=>Pn,getSchemaFromRef:()=>se,getSpec:()=>tn,getSpecType:()=>rn,getSpecTypeFromSpec:()=>sn,getStatusConstant:()=>et,getStatusMessage:()=>tt,getStatusModel:()=>Jr,hasMapper:()=>d,inheritedClassMapper:()=>ge,inspectOperationsPaths:()=>Cs,integer:()=>Gs,isParameterType:()=>k,isRedirectionStatus:()=>L,isSuccessStatus:()=>w,itemMapper:()=>Ae,lazyRef:()=>qs,lazyRefMapper:()=>ye,map:()=>Tr,mapAliasedProperties:()=>ke,mapHeaders:()=>H,mapMapper:()=>Oe,mapOpenSpec:()=>cn,mapOpenSpec2:()=>on,mapOpenSpec3:()=>an,mapOpenSpecInfo:()=>nn,mapOperationOptions:()=>rs,matchGroups:()=>A,mergeSchema:()=>re,mergeSpec:()=>Zs,nextMapper:()=>Ee,nullableMapper:()=>_e,nullableMapperOpenApi:()=>Fe,number:()=>Us,object:()=>Bs,objectMapper:()=>Le,ofMapper:()=>Ne,oneOf:()=>Ks,operationIdFormatter:()=>gt,operationInFilesMapper:()=>Je,operationInParameterMapper:()=>We,operationInParametersMapper:()=>Ve,operationInQueryMapper:()=>ze,operationMapper:()=>rt,operationMediaMapper:()=>st,operationRequestBodyMapper:()=>it,operationResponseMapper:()=>ot,parameters:()=>Xs,pathsMapper:()=>Rt,registerJsonSchemaMapper:()=>h,removeHiddenOperation:()=>Ot,requiredMapper:()=>De,s:()=>Ws,schemaMapper:()=>Ue,schemesReducer:()=>Vs,security:()=>zs,serializeEnum:()=>E,serializeEnumValues:()=>T,set:()=>Pr,string:()=>ks,tagsReducer:()=>Qs,time:()=>Ds,toJsonMapCollection:()=>G,toJsonRegex:()=>P,toRef:()=>ae,transformInformation:()=>On,transformSecurity:()=>yn,transformToOS2:()=>bn,uri:()=>Fs,url:()=>Js,withErrorMsg:()=>$t,wrapEnumsMapper:()=>Be});var e=n(803);function t(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 r(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const s=new Map;class o{constructor(e){this.isStore=!0;const{target:t,propertyKey:r,descriptor:s,index:n,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=r?String(r):r||"",this.descriptor=s,this.index=n,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get collectionType(){return this._collectionType}set collectionType(e){this._collectionType=e}get type(){return this._type}set type(e){e?.$schema?.skip||(this._type=e),this.build()}get schema(){return this._schema}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=>o.from(e).schema.isDiscriminator));return t&&o.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 computedType(){return this.itemSchema.class}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}get path(){return this.store.get("path")}set path(e){this.store.set("path",e)}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 i=(0,e.decoratorTypeOf)(t),o=new(s.get(i))({store:n,decoratorType:i,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(),n.set("JsonEntityStore",o)}return n.get("JsonEntityStore")}static fromMethod(t,r){return this.from(t,r,(0,e.descriptorOf)(t,r))}static get(t,r,s){return o.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(":")}getBestType(){return this.itemSchema.hasDiscriminator?this.itemSchema.discriminator().base:(0,e.isClassObject)(this.type)?this.itemSchema.getTarget():(0,e.isArrowFn)(this.type)?this.type():this.type}is(e){return this.decoratorType===e}buildType(t){(0,e.isCollection)(t)?this._collectionType=t:t&&"$schema"in t&&t.$schema.skip||(this._type=t,this._type&&(0,e.isPlainObject)(this._type)&&(this._type=String))}}function a(e){return t=>{s.set(e,t)}}var c;!function(e){e.GENERIC_LABELS="genericLabels",e.GENERIC_LABEL="genericLabel",e.GENERIC_OF="genericOf",e.NULLABLE="nullable",e.FORWARD_GROUPS="forwardGroups",e.GROUPS="groups",e.GROUPS_NAME="groupsName",e.ALLOWED_GROUPS="allowedGroups"}(c||(c={}));const p=new Map,u=new Map;function h(e,t,r){return u.set(r?`${r}:${e}`:e,t)}function l(e,t){const r=u.get(`${t?.specType}:${e}`)||u.get(e);if(r)return r;throw new Error(`JsonSchema ${e} mapper doesn't exists`)}function m(e,t,r,s){return l(e,r)(...t,r,s)}function d(e){return u.has(e)}function f(e,t){return e.find((e=>u.has(`${t?.specType}:${e}`)))||e.find((e=>u.has(e)))}function g(t){return(0,e.isPromise)(t)||t===Function?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}const y=["string","number","integer","boolean","object","array","null","any"];function O(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(O):t===Set?"array":(0,e.isDate)(t)||(0,e.isBuffer)(t)?"string":"object"}var S=n(133),b=n.n(S);function R(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=b()(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 A(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),s=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&R(r,t))||!!s.length&&!R(e.filter((e=>!e.startsWith("!"))),t)}const E=t=>(0,e.isObject)(t)&&null!==t?Object.entries(t).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):t;function T(t){const r=t.reduce(((e,t)=>e.concat(E(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 P(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class v{constructor({base:t,propertyName:r,types:s,values:n}={}){this.values=new Map,this.types=new Map,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 C(e){return e instanceof M?e:Object.entries(e).reduce(((e,[t,r])=>(e[P(t)]=x(r),r instanceof M&&r.propertyKey(P(t)),e)),{})}function x(t){return(0,e.isArray)(t)?t.map(x):t&&(t.isStore||t.$isJsonDocument||t.isLazyRef)?t:t&&(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?o.from(t).schema:(0,e.isObject)(t)?M.from(t):(0,e.isPrimitiveClass)(t)||t===Date||null===t?M.from({type:t}):t}function $(t,r){const s=t.getGenericLabels();if(!s)return{};const[n,...i]=r;return n.reduce(((t,r,n)=>{const o=s[n];if(o)if(function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(r))t[o]=[M.from({type:"string",enum:Object.values(r)})];else if(i.length){const e=x(r);t[o]=[e,$(e,i)]}else t[o]=[x(r)];return t}),{})}class M extends Map{#e;#t;#r;#s;#n;#i;#o;#a;#c;#p;constructor(t={}){super(),this.$kind="schema",this.$isJsonDocument=!0,this.$hooks=new e.Hooks,this.$allow=[],this.$ignore=!1,this.isDiscriminatorKey=!1,this.isDiscriminator=!1,this.#e=new Set,this.#t=new Map,this.#r=null,this.#s=new Map,this.#i=!1,this.#a=!1,this.#c=!1,t&&this.assign(t)}get alias(){return this.#s}get isClass(){return(0,e.isClass)(this.class)&&!this.isCollection}get isCollection(){return this.#a}get isLocalSchema(){return this.#i}get isGeneric(){return this.has(c.GENERIC_LABEL)}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.#o).find((e=>o.from(e).schema.isDiscriminator));return t&&o.from(t).schema}get class(){return this.#i?this.#n?.getTarget():g(this.#o)}get collectionClass(){return this.isCollection&&this.#n?this.#n.class:this.class}get canRef(){return this.#c}get isNullable(){return!!this.get(c.NULLABLE)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!this.#r}static from(t={}){return t instanceof M?t:t&&(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?o.from(t).schema:(0,e.isPrimitiveClass)(t)||t===Date||null===t?new M({type:t}):new M(t)}has(e){return!!super.has(e)||!!super.has(`#${e}`)||this.#t.has(e)}get(e,t){return this.#t.has(e)?this.#t.get(e):super.has(e)?super.get(e):super.has(`#${e}`)?super.get(`#${e}`):t}forwardGroups(e=!0){return this.vendorKey(c.FORWARD_GROUPS,e),this}groups(e,t){return e&&(this.vendorKey(c.GROUPS,e),t&&this.$hooks.on("groups",((t,r)=>!(t||!A(e,r))||t))),this}groupsName(e){return e&&this.vendorKey(c.GROUPS_NAME,e),this}allowedGroups(e){return e&&this.vendorKey(c.ALLOWED_GROUPS,e),this}genericLabels(e){return this.vendorKey(c.GENERIC_LABELS,e),this}genericLabel(e){return this.vendorKey(c.GENERIC_LABEL,e),this}genericOf(...e){const t=$(this.#n||x(this.getTarget()),e);return this.vendorKey(c.GENERIC_OF,t),this}nullable(e){return this.isNullable||this.vendorKey(c.NULLABLE,e),this}itemSchema(t={}){return this.#n=this.#n||x(t),(0,e.isPlainObject)(t)&&this.#n.assign(t),!this.isCollection&&this.#n?.isClass&&(this.#i=!0),this.#n}getAliasOf(e){return this.#s.get(e)}addAlias(e,t){return this.#s.set(e,t),this.#s.set(t,e),this}removeAlias(e){const t=this.#s.get(e);return t&&this.#s.delete(t),this.#s.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.#c=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){return"boolean"!=typeof e&&this.$hooks.on("ignore",e),this.$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.#r=this.#r||new v({base:this.#o})}discriminatorKey(e){this.discriminator().propertyName=e,this.isDiscriminator=!0;const t=this.get("properties")[e];return t&&(t.isCollection?t.itemSchema().isDiscriminatorKey=!0:t.isDiscriminatorKey=!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 M({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",x(e)),this}contains(e){return super.set("contains",x(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#n=x(e)),this}$comment(e){return super.set("$comment",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[].concat(this.getJsonType()).includes("string")&&!this.has("minLength")&&this.minLength(1),e.forEach((e=>{switch(e){case"":this.set("minLength",void 0);break;case null:this.any(...["null"].concat(this.getJsonType(),this.$allow.map((e=>typeof e))))}})),this.$allow.push(...e),this}required(t=!0){if(!(0,e.isArray)(t)){const e=this.clone();return e.$selfRequired=t,[].concat(e.getJsonType()).includes("string")&&e.minLength(1),e}return this.#e.clear(),t.forEach((e=>this.#e.add(e))),this}addRequired(e){return this.#e.add(e),this}removeRequired(e){return this.#e.delete(e),this}isRequired(e){return this.#e.has(e)}getRequiredFields(){return[...this.#e]}properties(e){return super.set("properties",C(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",C(r)),this}patternProperties(e){return super.set("patternProperties",C(e)),this}additionalProperties(e){return super.set("additionalProperties",x(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",C(e)),this}propertyNames(e){return super.set("propertyNames",x(e)),this}enum(e,...t){if(p.has(e))return this.enum(p.get(e));if(e instanceof M)e.getName()?super.set("enum",e):super.set("enum",e.get("enum")).any(...e.get("enum").map((e=>typeof e)));else{const{values:r,types:s}=T([e,t].flat());super.set("enum",r).any(...s)}return this}definitions(e){return super.set("definitions",C(e)),this}allOf(e){return this.setManyOf("allOf",e),this}anyOf(e){return this.setManyOf("anyOf",e),this}oneOf(e){return this.isCollection?this.itemSchema().oneOf(e):this.setManyOf("oneOf",e),this}not(e){return super.set("not",x(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",P(e)),this}format(e){return super.set("format",e),this}type(t){switch(t){case"map":case Map:super.set("type",O(t)),this.target(t),this.#a=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case"array":case Array:super.set("type",O(t)),this.target(t),this.#a=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case"set":case Set:super.set("type",O(t)),this.target(t),this.#a=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":this.integer();break;case"number":case"string":case"boolean":case"object":case Object:case Date:case Boolean:case Number:case String:super.set("type",O(t)),this.target(t),this.has("properties")||super.set("properties",{});break;default:if((0,e.isClass)(t)||(0,e.isFunction)(t))super.set("type",void 0),this.target(t),this.has("properties")||super.set("properties",{});else{const e=O(t);"generic"===e?this.genericLabel(t):super.set("type",e)}}return this}any(...t){return t=t.length?t:["integer","number","string","boolean","array","object","null"],(t=(0,e.uniq)(t).map((t=>(0,e.isClass)(t)?t:{type:O(t)}))).length>1?this.oneOf(t):this.type(t[0]?.type||t[0]),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}vendorKey(e,t){return this.#t.set(e,t),this}toObject(e){return this.toJSON(e)}toJSON(e){return m("schema",[this],e)}assign(e={}){return(e instanceof M?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof M&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),this.#e=new Set(e.#e.keys()),this.#s=new Map(this.#s.entries()),this.#t=new Map(e.#t.entries()),this.#r=this.#r?new v(this.#r):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#c=e.#c,this.#o=e.#o,this.#a=e.#a,this.#i=e.#i,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}getJsonType(){return this.get("anyOf")?this.get("anyOf").map((e=>e.getJsonType())):this.get("type")||O(this.class)}getTarget(){return this.#o}getAllowedGroups(){return this.get(c.ALLOWED_GROUPS)}getAllowedRequiredValues(){return this.$allow}getGroups(){return this.get(c.GROUPS)}getGroupsName(){return this.get(c.GROUPS_NAME)}getName(){return this.get("name")||((0,e.isClass)(this.#o)?(0,e.nameOf)((0,e.classOf)(this.class)):"")}clone(){return new M(this)}getGenericLabels(){const t=this.get(c.GENERIC_LABELS);if(this.isClass&&!t){const t=(0,e.ancestorOf)(this.class);return t===Object?void 0:M.from(t).getGenericLabels()}return this.get(c.GENERIC_LABELS)}getGenericOf(){return this.get(c.GENERIC_OF)}getRefSchema(){if(!this.isLocalSchema&&this.isClass){const e=M.from(this.class);if(e!==this)return e}}propertyKey(e){return this.#p=e,this}getPropertyKey(){return this.#p}target(e){this.#o="object"===e?Object:e}isRequiredValue(e,t){if(this.isRequired(e)&&[void 0,null,""].includes(t)){const r=this.get("properties")?.[e];if(r)return!r.getAllowedRequiredValues().includes(t)}return!1}setManyOf(e,t){let r=t.filter((e=>!(e&&"type"in e&&"null"===e.type||null===e)||(this.nullable(!0),!1))).map(x);if(!(1!==r.length||t[0]instanceof M||this.isNullable)){if(!r[0].hasDiscriminator)return this.type(t[0]);const e=r[0].discriminator().children();if(!e.length)return this.type(t[0]);r=e.map(x)}super.set(e,r);const s=r[0];if(s?.isDiscriminator){const e=s.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t,mapping:r.reduce(((t,r)=>(e.types.get(r.getTarget())?.forEach((e=>{t[e]=r})),t)),{})}),this.isDiscriminator=!0,this.#r=e}}}let _=class extends o{constructor(){super(...arguments),this.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=M.from({type:this.type})}};_=t([a(e.DecoratorTypes.CLASS)],_);const w=e=>Number(e)&&200<=Number(e)&&Number(e)<300,L=e=>Number(e)&&300<=Number(e)&&Number(e)<400;class N extends Map{constructor(e={}){super(),this.$kind="map",this.$isJsonDocument=!0,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 m("map",[this],e)}}var I;function D(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function k(e){return Object.values(I).includes(D(e))}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}(I||(I={}));class j extends N{constructor(e={}){super(e),this.$kind="operationInParameter",this.has("schema")||this.set("schema",new M)}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",D(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return e?(this.set("schema",e),this):this.get("schema")}itemSchema(e){return this.schema().isCollection?(e&&this.schema().itemSchema(e),this.schema().itemSchema()):(e&&this.schema(e),this.schema())}toJSON(e){return m("operationInParameter",[this],e)}}function H(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}),{})}function G(e,t=N){return Object.entries(e).reduce(((e,[r,s])=>(e.set(r,new t(s)),e)),new N)}class q extends N{constructor(e={}){super(e),this.$kind="operationMedia",this.has("schema")||this.set("schema",new M)}schema(e){return e&&this.set("schema",e),this.get("schema")}examples(e){return e&&this.set("examples",e),this}type(t){return t&&((0,e.isArray)(t)?this.schema().oneOf(t.map((e=>({type:e})))):(0,e.isClass)(t)?(this.schema().type("object"),this.schema().itemSchema(t)):this.schema().type(t)),this}}class U extends N{constructor(e={}){super(e),this.$kind="operationResponse",this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",H(e)),this}content(e){return this.set("content",G(e,q)),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 q),this}isBinary(){return this.getContent().has("application/octet-stream")}}class B extends N{constructor(e,t){super(),this.method=e,this.path=t}summary(e){return super.set("summary",e),this}description(e){return super.set("description",e),this}}class K extends N{#u;#h;constructor(e={}){super({parameters:[],responses:new N,...e}),this.$kind="operation",this.operationPaths=new Map,this.#h=!1}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.#h=!0,this.#u=e,this}isRedirection(e){return this.#h&&e?L(e):this.#h}addResponse(t,r){if((w(t)||L(t))&&!this.#u){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 U}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}addAllowedGroupsParameter(e){const t=new j;return t.in("query").name("includes"),t.schema(M.from({type:"array",items:{type:"string",enum:[...e]}})),this.addParameter(-1,t),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){const r=new B(e,t);return this.operationPaths.set(String(e)+String(t),r),r}getAllowedOperationPath(e){return e?[...this.operationPaths.values()].filter((({method:t})=>t&&e.includes(t.toUpperCase()))):[...this.operationPaths.values()]}}let F=class extends o{constructor(t){super({store:e.Store.fromMethod(t.target,t.propertyKey),descriptor:(0,e.descriptorOf)(t.target,t.propertyKey),...t}),this.parent=o.from(this.target),this.middlewares=[],this.beforeMiddlewares=[],this.afterMiddlewares=[],this.operation=new K,this.children=new Map;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}get collectionType(){return this.schema.getTarget()}set collectionType(e){console.trace("collectionType is deprecated, use schema.collectionClass instead")}get isCollection(){return this.schema.isCollection}get schema(){if(this._schema)return this._schema;const e=this.operation.getResponses(),[,t]=[...e.entries()].find((([e,t])=>w(e)))||[];if(t){const e=t.getContent().values().next().value;e&&(this._schema=e.schema())}else this._schema=new M;return this._schema}static get(t,r,s){return s=s||(0,e.descriptorOf)((0,e.prototypeOf)(t),r),o.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.schema().getAllowedGroups();let t=s.schema().getGroups();return r&&e?.size&&(t=[...t||[],...r.filter((t=>e.has(t)))]),{type:s.schema().collectionClass,groups:t}}return{type:this.type||Object}}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(){this.parent.children.set(this.propertyName,this)}};F=t([a(e.DecoratorTypes.METHOD),r("design:paramtypes",[Object])],F);const J=F;let W=class extends o{constructor(e){super(e),this.parameter=new j,this.parent=o.fromMethod(this.target,this.propertyKey),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.getAllowedRequiredValues()}get schema(){return this.parameter.schema()}static getParams(t,r){const s=[],n=(0,e.ancestorsOf)(t).reverse().find((t=>(0,e.isMethodDescriptor)(t,r)&&o.fromMethod(t,r).children.size));return n?(o.fromMethod(n,r).children.forEach(((e,t)=>{s[+t]=e})),s):[]}static get(t,r,s){return o.from((0,e.prototypeOf)(t),r,s)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}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.parent.children.set(this.index,this),this.parent.operation.addParameter(this.index,this.parameter),this.collectionType&&this.parameter.schema().type(this.collectionType),(0,e.isClass)(this._type)?this.parameter.schema().itemSchema(this._type):this.parameter.itemSchema().type(this._type)}};W=t([a(e.DecoratorTypes.PARAM),r("design:paramtypes",[Object])],W);const V=W;let X=class extends o{constructor(){super(...arguments),this.parent=o.from(this.target)}static get(t,r){return o.from((0,e.prototypeOf)(t),r)}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),this.isCollection?(t=M.from({type:this.collectionType}),t.itemSchema(this.type)):(0,e.isClass)(this.type)?(t=M.from({type:"object"}),t.itemSchema(this.type)):t=M.from({type:this.type})),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}};X=t([a(e.DecoratorTypes.PROP)],X);const z=X;function Q(...e){return o.from(...e)}s.set(e.DecoratorTypes.CLASS,_),s.set(e.DecoratorTypes.PROP,X),s.set(e.DecoratorTypes.PARAM,W),s.set(e.DecoratorTypes.METHOD,F);class Y{constructor(e){this.getType=e,this.isLazyRef=!0}get target(){return this.getType()}get schema(){return Q(this.getType()).schema}get name(){return(0,e.nameOf)(this.getType())}}var Z,ee=n(598);function te(t,r,s){const{[t]:n,...i}=r,{[t]:o,...a}=s;let c=!1;const p=[n,i,o,a].flat().filter(Boolean).reduce(((r,s,n)=>{if((s=(0,e.cleanObject)(s)).$ref)return c=!0,r.set(s.$ref,s);if(0===Object.keys(s).length)return r;"object"===s.type&&2===Object.keys(s).length&&("writeOnly"in s||"readOnly"in s||"deprecated"in s)&&(s={...s,type:void 0});const i=function(e){return e.type||e.items&&"array"||(e.properties||e.additionalProperties)&&"object"||"$any"}(s);return"array"===i?(r.set("array_"+n,s),r):r.has(i)?"allOf"===t?(r.set(i,re(r.get(i),s)),r):(r.set(i+"_"+n,s),r):r.set(i,s)}),new Map),u=p.get("$any");p.delete("$any");const h=Array.from(p.values());return(0,e.cleanObject)(h.length>1||c&&u?{...u,[t]:h}:{...u,...h[0]})}function re(t,r){if(t.$ref&&r.$ref&&t.$ref===r.$ref)return t;if(t.allOf||r.allOf)return te("allOf",t,r);if(t.oneOf||r.oneOf){const s=te("oneOf",t,r);return"discriminator"in t||"discriminator"in r?{...s,discriminator:t.discriminator||r.discriminator,required:(0,e.uniq)([...t.required||[],...r.required||[]])}:s}if(t.anyOf||r.anyOf)return te("anyOf",t,r);if(t.$ref||r.$ref)return te("allOf",t,r);const s={...t,...r};var n,i;return(t.properties||r.properties)&&(s.properties=(n=t.properties,i=r.properties,n&&i?[...new Set(Object.keys(n||[]).concat(Object.keys(i||[])))].reduce(((e,t)=>(n?.[t]&&i?.[t]?e[t]=re(n[t],i[t]):n?.[t]?e[t]=n[t]:i?.[t]&&(e[t]=i[t]),e)),{}):n||i||{})),(0,e.isObject)(t.additionalProperties)&&(0,e.isObject)(r.additionalProperties)&&(s.additionalProperties={...t.additionalProperties,...r.additionalProperties}),(t.required||r.required)&&(s.required=(0,e.uniq)([...t.required||[],...r.required||[]])),s}function se(e,t){const{components:r}=t;if(r?.schemas&&e){const s=ne(t),n=e.replace(`${s}/`,"");return r.schemas[n]}}function ne(e){const{host:t="#/"+([Z.OPENAPI,Z.ASYNCAPI].includes(e.specType)?"components/schemas":"definitions")}=e;return t}function ie(e,t){return t.groups&&t.groups.length?(0,ee.pascalCase)(`${e} ${t.groupsName||t.groups.join(" ")}`):e}function oe(e,t,r){return re({$ref:`${ne(r)}/${e}`},{...t.isReadOnly?{readOnly:!0}:{},...t.isWriteOnly?{writeOnly:!0}:{}})}function ae(t,r,s){const n=ie(t.getName(),s);return r&&(0,e.setValue)(s,`components.schemas.${n}`,r),oe(n,t,s)}function ce(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof Y)return m("lazyRef",[e],t);if(e instanceof M&&e.get("enum")instanceof M){const r=e.get("enum");return ae(r,r.toJSON(t),t)}if(e.$kind&&e.$isJsonDocument){const r=m(f([e.$kind,"map"],t),[e],t);return e.canRef?ae(e,r,t):r}return m("object",[e],t)}function pe(t,r){const s=o.from(t.class),n=ie(s.schema.getName()||t.getName(),r);return(0,e.getValue)(r,`components.schemas.${n}`)||((0,e.setValue)(r,`components.schemas.${n}`,{}),r.components.schemas[n]=m("any",[s.schema],{...r,root:!1})),oe(n,t,r)}function ue(t,r,s){if(t.discriminator?.mapping){const r=Object.entries(t.discriminator.mapping),n={};for(const[t,i]of r)n[t]=(0,e.isString)(i)?i:ae(i,null,s).$ref;t.discriminator.mapping=n}return t}function he(e,t,r){return r.inlineEnums&&e.enum?.$isJsonDocument&&(e.enum=e.enum.toJSON().enum),e.enum&&(e.type="object"===e.type||void 0===e.type?"string":e.type),e}function le(t,r,s){if("isLazyRef"in r)return null;if(r.isGeneric){const e=r.get(c.GENERIC_LABEL),t=s.generics?.[e];if(!t)return null;const[n,i]=t,o=M.from(n),a=m("schema",[o],{...s,generics:i});return i||!o.isClass?a:ae(o,a,s)}if(r?.has("items")){const e=le(t,r.get("items"),s);if(e)return{type:"array",items:e}}if(r.has("additionalProperties")&&(0,e.isObject)(r.get("additionalProperties"))){const e=le(t,r.get("additionalProperties"),s);if(e)return{type:"object",additionalProperties:e}}return null}function me(e,t,r){if(t.genericLabels?.length&&t.has("properties")){const s=t.get("properties");let n=!1;const i=Object.entries(s||{}).reduce(((e,[t,s])=>{const i=le(t,s,r);return i&&(e[t]=i,n=!0),e}),{});return n?{allOf:[ae(t,e,r),{properties:i,type:"object"}]}:e}return e}function de(t){const r=t.isStore?t:Q(t);return r.$inherited||(r.$inherited=(0,e.ancestorsOf)(r.target).reverse().reduce(((e,t)=>e.set(t,Q(t))),new Map)),r.$inherited}function fe(e,t){if(t?.type&&t?.$ref){const{$ref:e,...r}=t;t={allOf:[{$ref:e},r]}}return t}function ge(t,{target:r,...s}){const n=Array.from(de(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,m("schema",[r.schema],s),{alter:fe})),{});return(0,e.deepMerge)(r,t,{alter:fe})}return t}function ye(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return oe(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const s=e.getType()&&m("schema",[e.schema],t);return ae(e.schema,s,t)}function Oe(e,{ignore:t=[],...r}={}){return Array.from(e.entries()).reduce(((e,[s,n])=>(t.includes(s)||(e[s]=m("item",[n],r)),e)),{})}function Se(e,t){const r=e.getGenericOf();return{generics:r||t.generics,mapper:r?"schema":"class"}}function be(e,t,r){return!e.isClass||e.isLocalSchema||r?"any":t||"class"}function Re(e,t,r,s){const n=m(be(r,e,s.root),[r],{...s,root:!1,mapper:"next"===e?s.mapper:void 0});let i=m(s.root?"any":e,[t],{...s,root:!1,generics:void 0,mapper:"next"===e?s.mapper:void 0});if((n.$ref||n.allOf)&&i.type&&1===Object.keys(i).length&&(i={}),t.canRef){const e=i.$ref.split("/").pop(),t=s.components.schemas[e];return s.components.schemas[e]=re(n,t),i}return re(n,i)}function Ae(e,t){if(e&&e instanceof M&&!e.isCollection&&e?.itemSchema?.()){const{generics:r,mapper:s}=Se(e,t);return Re("next",e,e.itemSchema(),{...t,generics:r,mapper:s})}return m("next",[e],t)}function Ee(e,t){if(e&&e instanceof M&&!e.isLocalSchema){const r=e.getRefSchema();if(r){let{generics:s,mapper:n}=Se(e,t);return n=be(e,n),Re(n,e,r,{...t,generics:s})}}return m(be(e,t.mapper),[e],{...t,root:!1,mapper:void 0})}!function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3",e.ASYNCAPI="asyncapi2"}(Z||(Z={})),h("any",ce),h("class",pe),h("discriminatorMapping",(function(e){return e.discriminator?.mapping&&delete e.discriminator.mapping,e})),h("enums",he),h("generics",me),h("inheritedClass",ge),h("lazyRef",ye),h("map",Oe),h("item",Ae),h("next",Ee),h("properties",Ee),h("items",Ee),h("additionalProperties",Ee),h("propertyNames",Ee),h("contains",Ee),h("dependencies",Ee),h("patternProperties",Ee),h("additionalItems",Ee),h("not",Ee),h("definitions",Ee);const Te=["oneOf","allOf","anyOf"],Pe=["minLength","maxLength","pattern","format"],ve=[],Ce=["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf"],xe=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains"],$e=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains","patternProperties","dependencies"],Me=["const","enum"];function _e(t,r){return r?.isNullable?(t.discriminator||(t.$ref?t=(0,e.cleanObject)({...t,$ref:void 0,oneOf:[{type:"null"},{$ref:t.$ref}]}):"array"===t.type?t={oneOf:[{type:"null"},t]}:Te.some((r=>{if(t[r])if(t[r]=t[r].filter((e=>"null"!==e.type)),1===t[r].length){const s=t[r];t=(0,e.cleanObject)({...t,...s[0],[r]:void 0,type:["null",Number.isInteger(t.multipleOf)?"integer":s[0].type]})}else t[r]=[{type:"null"}].concat(t[r]).map((e=>(Number.isInteger(e.multipleOf)&&(e.type="integer"),e))),delete t.type}))),t):t}function we(t,r){if((0,e.isBoolean)(t.$ignore)&&t.$ignore)return!0;let s=t?.$hooks?.alter("ignore",!1,[r]);return s||(!1!==r.groups?t?.$hooks?.alter("groups",!1,[r.groups]):s)}function Le(t,r){const{specType:s,operationIdFormatter:n,root:i,components:o,useAlias:a,...p}=r;return Object.entries(t).reduce(((e,[s,n])=>{if(!1!==r.withIgnoredProps&&!we(n,p)){const i={...r,parent:n,groups:t?.get?.(c.FORWARD_GROUPS)||n?.get?.(c.FORWARD_GROUPS)?r.groups:void 0};if(e[s]=m("item",[n],i),e[s]=m("nullable",[e[s],n],i),n.isGeneric&&e[s]?.type){const{type:t,...r}=e[s];e[s]=r}}return e}),(0,e.isArray)(t)?[]:{})}function Ne(e,t){return e.map((e=>m("item",[e],t)))}function Ie(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function De(t,r,s){if(s.groups&&s.groups?.includes("partial"))return t.discriminator?{...t,required:[t.discriminator.propertyName]}:t;let n=function(t,r,s){let n=t.required||[];return n=[...n,...r.getRequiredFields()],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)),Ie((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(e,r)=>{const i=s&&t.alias.get(r)||r;return n.includes(i)?e.concat(i):e}}(t,r,s),[]),t.discriminator&&n.push(t.discriminator.propertyName),n.length&&(t.required=n),t}function ke(e,t){return Object.entries(e).reduce(((e,[r,s])=>(e[r=t.get(r)||r]=s,e)),{})}h("nullable",_e),h("object",Le),h("anyOf",Ne),h("allOf",Ne),h("oneOf",Ne),h("required",De);const je={string:{properties:Pe,is:e.isString},number:{properties:Ce,is:e.isNumber},boolean:{properties:ve,is:e.isBoolean},array:{properties:xe,is:()=>!1},object:{properties:$e,is:()=>!1}};function He(e,t,r){const s=function(e){return Te.find((t=>e[t]))}(e);return s&&(e[s].forEach((t=>{!function(e,t,r){const s=je[e];s?.properties.concat(Me).forEach((e=>{void 0!==t[e]&&(Me.includes(e)?r[e]=t[e].filter(s.is):(r[e]=t[e],delete t[e]))}))}(t.type,e,t)})),Te.forEach((s=>{e[s]&&!1!==r.groups&&t.$hooks.has(s)&&(e={...e,[s]:t.$hooks.alter(s,e[s],[r.groups])})})),delete e.const,delete e.enum,e.items||e.properties||delete e.type),e}const Ge=["name","$required","$hooks","_nestedGenerics",Z.OPENAPI,Z.SWAGGER,Z.JSON],qe=[];function Ue(t,r){const{options:s,addDef:n}=function(e){let t=!1;e||(t=!0,e={components:{schemas:{}},inlineEnums:!0});const{useAlias:r=!0,components:s={schemas:{}}}=e;return{addDef:t,options:e={...e,useAlias:r,components:s}}}(r),i=function(t,r){let s=function(t,r){const{useAlias:s}=r;return[...t.keys()].filter((e=>!function(e,{specType:t=Z.JSON,customKeys:r=!1}){return Ge.includes(e)||e.startsWith("x-")||e.startsWith("#")&&(!r||t!==Z.JSON)||t!==Z.JSON&&qe.includes(e)}(e,r))).reduce(((n,i)=>{let o=t.get(i);if("type"===(i=i.replace(/^#/,"")))return n[i]=t.getJsonType(),n;if(function(t,r,s){return"examples"===t&&(0,e.isObject)(r)&&[Z.OPENAPI,Z.ASYNCAPI].includes(s.specType)}(i,o,r)&&(i="example",o=Object.values(o)[0]),o&&"object"==typeof o&&d(i)){if(o=m(i,[o],r,t),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(i,o))return n;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(i,o,s)&&(o=ke(o,t.alias))}return n[i]=o,n}),{})}(t,r);return t.isClass&&!t.isLocalSchema&&(s=m("inheritedClass",[s],{...r,root:!1,target:t.class})),t.has(r.specType)&&(s={...s,...t.get(r.specType).toJSON(r)}),(0,e.isFunction)(s.default)&&(s.default=s.default()),s=m("required",[s,t],r),s=m("nullable",[s,t],r),s=He(s,t,r),s=m("enums",[s,t],r),s=m("discriminatorMapping",[s,t],r),s=m("generics",[s,t],r),"array"!==s.type||s.items||s.contains||(s.items={}),s}(t,s);return n&&Object.keys((0,e.getValue)(s,"components.schemas",{})).length&&(i.definitions=s.components.schemas),i}function Be(e,t,r){return(e=he(e,0,r)).const&&(e.enum=[e.const],delete e.const),e}function Ke(t,r){const s={paths:m("paths",[t],r={...r,specType:Z.OPENAPI})};return s.tags=(0,e.uniqBy)(r.tags,"name"),Object.keys((0,e.getValue)(r,"components.schemas",{})).length&&(s.components={schemas:r.components.schemas}),s}function Fe(t,r,s){if(!r?.isNullable)return t;if("3.1.0"===s.specVersion)return _e(t,r);if(t.$ref)return(0,e.cleanObject)({...t,nullable:!0});function n(r){return 1===t[r]?.length?(0,e.cleanObject)({...t[r][0],[r]:void 0,type:Number.isInteger(t.multipleOf)?"integer":t[r][0]?.type}):(0,e.cleanObject)({type:t[r]?.length>1?void 0:t.type,[r]:t[r]?.map((e=>(Number.isInteger(e.multipleOf)&&(e.type="integer"),e)))})}return(0,e.cleanObject)({...t,...n("oneOf"),...n("anyOf"),nullable:!0})}function Je(t,{jsonSchema:r}){const s={type:"string",format:"binary",oneOf:void 0};return"array"===r.type?(r.items=(0,e.cleanObject)({...r.items,...s}),t.schema=r,t):(t.schema=(0,e.cleanObject)({...r,...s}),t)}function We(e,t){const r=function(e,t={}){return{...t,groups:e.schema().getGroups(),groupsName:e.schema().getGroupsName()}}(e,t),s={...r.components?.schemas||{}},{type:n,schema:i,...o}=m("map",[e],r),a=m("item",[e.schema()],r);o.required=o.required||e.get("in")===I.PATH;const c={...r,jsonSchema:a,jsonParameter:e,oldSchemas:s},p=(0,ee.camelCase)(`operationIn ${e.get("in")}`);return d(p)?m(p,[o],c):(o.schema=a,o)}function Ve(e,t){return e.flatMap((e=>m("operationInParameter",[e],t))).filter(Boolean)}function Xe(e,t){if(!t)return;let r=!1;const s=Object.entries(t).reduce(((t,[s,{value:n,description:i,...o}])=>void 0===n[e]?t:(r=!0,{...t,[s]:{...o,value:n[e],description:i}})),{});return r?s:void 0}function ze(t,{jsonSchema:r,...s}){if(r.$ref){if(!t.name)return function(t,{jsonParameter:r,...s}){const n=ie(r.schema().itemSchema().getName(),s),i=s.components?.schemas?.[n];return i&&!s.oldSchemas?.[n]&&delete s.components?.schemas?.[r.schema().itemSchema().getName()],Object.entries(i?.properties||{}).reduce(((r,[n,{description:o,...a}])=>{const c=t.style||a.$ref&&!se(a.$ref,s)?.enum?"deepObject":void 0;return r.push((0,e.cleanObject)({...t,style:c,explode:"deepObject"===c||t.explode,name:n,required:(i?.required||[]).includes(n),description:o,schema:a,examples:Xe(n,t.examples)})),r}),[])}(t,s);se(r.$ref,s)?.enum||(t.style="deepObject",t.explode=!0)}return t.schema=r,t}h("schema",Ue),h("discriminatorMapping",ue,Z.OPENAPI),h("discriminatorMapping",ue,Z.SWAGGER),h("discriminatorMapping",ue,Z.ASYNCAPI),h("enums",Be,Z.OPENAPI),h("enums",Be,Z.SWAGGER),h("enums",Be,Z.ASYNCAPI),h("generate",Ke,Z.OPENAPI),h("generate",Ke,Z.SWAGGER),h("nullable",Fe,Z.OPENAPI),h("nullable",Fe,Z.SWAGGER),h("operationInFiles",Je),h("operationInParameter",We),h("operationInParameters",Ve),h("operationInQuery",ze);var Qe=n(203),Ye=n.n(Qe);const Ze=Ye().codes.reduce(((e,t)=>{const r=String(Ye()(t));return{...e,[String(t)]:{label:r,code:(0,ee.constantCase)(r)}}}),{});function et(e){return Ze[e]?.code}function tt(e){return Ze[e]?.label}function rt(e,{tags:t=[],defaultTags:r=[],...s}={}){const{consumes:n,produces:i,...o}=m("map",[e],{...s,ignore:["parameters"]});o.security&&(o.security=[].concat(o.security)),0===e.get("responses").size&&(o.responses={200:{description:tt(200)}});const a={...s,consumes:e.get("consumes")?.length?e.get("consumes"):["application/json"]},[c,p]=function(e,t){return e.get("parameters").filter((e=>k(e.get("in")))).reduce(((e,t)=>{const[r,s]=e;return[I.BODY,I.FILES].includes(t.get("in"))?[r,[...s,t]]:[[...r,t],s]}),[[],[]])}(e);o.parameters=m("operationInParameters",[c],s),p.length&&(o.requestBody=m("operationRequestBody",[p],a));const u=o.tags?.length?o.tags:r;return u.length&&(o.tags=u.map((({name:e})=>e))),t.push(...u),o}function st(e,t){return m("map",[e],{...t,groups:[...e.schema().getGroups()||[]],groupsName:e.schema().getGroupsName()})}Ze[200].label="Success",Ze[200].code="SUCCESS",h("operation",rt),h("operationMedia",st);class nt extends N{constructor(e={}){super(e),this.$kind="operationRequestBody",this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",G(e)),this}addContent(e,t,r){const s=this.get("content"),n=new N;return n.set("schema",t),r&&n.set("examples",r),s.set(e,n),this}required(e){return this.set("required",e),this}}function it(e,{consumes:t,...r}){const{schema:s,description:n,examples:i,in:o,...a}=function(e,t){let r=new M;const s={},n=[];let i=0;const o=e.some((e=>"files"===e.get("in")));return e.forEach((e=>{const a=e.getName();[...e.entries()].filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===s[e]&&(s[e]=t)}));const c=m("operationInParameter",[e],t);if(a){const t={...c.schema||{type:c.type}};o&&c.description&&(t.description=c.description),r.addProperty(a,t),e.get("required")&&r.addRequired(a),i++}else n.push(c)})),i||1!==n.length?(r.type("object"),s.description&&o&&delete s.description,{required:!1,...s,schema:r.toJSON(t)}):n[0]}(e,r),c=new nt(a);return n&&c.description(n),t.forEach((e=>{c.addContent(e,s,i)})),m("map",[c],r)}function ot(e,t={}){const r=m("map",[e],t);return 204===e.status&&delete r.content,r.headers&&Object.entries(r.headers).forEach((([e,{type:t,...s}])=>{r.headers[e]={...s,schema:{type:t}}})),r}var at;h("operationRequestBody",it),h("operationResponse",ot),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.TRACE="TRACE",e.PUBLISH="PUBLISH",e.SUBSCRIBE="SUBSCRIBE",e.CUSTOM="CUSTOM"}(at||(at={}));const ct=[at.ALL,at.GET,at.POST,at.PUT,at.PATCH,at.HEAD,at.DELETE,at.OPTIONS,at.TRACE,at.CUSTOM],pt=[at.PUBLISH,at.SUBSCRIBE],ut=at;function ht(e){return e.split("/").filter(Boolean).join("/")}function lt(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 mt(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:p}=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}}${p}`,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)}]}class dt extends Map{constructor(){super(...arguments),this.$kind="operationPaths",this.$isJsonDocument=!0,this.getKey=(e,t)=>`${e}-${t}`}setOperationPath(e){const t=this.getKey(e.method,e.path);this.set(t,e)}}function ft(e){const t=e.isStore?e:Q(e);if(!t.$operations){const e=new dt;t.$operations=new Map,de(t).forEach((e=>{e.children.forEach((e=>{e instanceof F&&!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 gt(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?(0,ee.camelCase)(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),(0,ee.camelCase)(`${i} By ${a}`)}const c=t.get(o)+1;return t.set(o,c),`${i}_${c}`}}function yt(e,{store:t,operationIdFormatter:r}){return r(t.parent.schema.get("name")||t.parent.targetName,t.propertyName,e)}function Ot(e){return!e.store.get("hidden")}const St=[at.ALL,at.GET,at.POST,at.PUT,at.PATCH,at.HEAD,at.OPTIONS,at.DELETE,at.TRACE];function bt(e,{path:t,method:r,operation:s}){return{...e,[t]:{...e[t],[r.toLowerCase()]:s}}}function Rt(e,{paths:t,rootPath:r,...s}){const n=ht(r+Q(e).path);return s={...s,ctrlRootPath:n},[...ft(e).values()].filter(Ot).filter((e=>e.operation.getAllowedOperationPath(St).length>0)).flatMap(function(e){return t=>{const r=t.operation.getAllowedOperationPath(St);if(0===r.length)return[];const s=m("operation",[t.operation],e);return r.map((e=>({operationPath:e,operation:s,operationStore:t})))}}(s)).flatMap(function(e){return({operationPath:t,operation:r,operationStore:s})=>{const{path:n,method:i}=t;return mt(e.ctrlRootPath,n).map((({path:n,parameters:o})=>(n=n||"/",o=lt(o.map((({type:e,...t})=>({...t,schema:{type:e}}))),r),{operation:{...r,...t.toJSON(e),parameters:o,operationId:r.operationId||yt(n,{...e,store:s})},method:i,path:n})))}}(s)).reduce(bt,t)}function At(e){return(...t)=>{const r=e(Q(...t),t);"function"==typeof r&&r(...t)}}function Et(...t){return At((r=>{r.store.set("childrenControllers",t),t.forEach((t=>{e.Store.from(t).set("parentController",r.token)}))}))}function Tt(e,...t){return At((r=>{e=e||(0,ee.snakeCase)(r.targetName),r.discriminatorAncestor&&r.schema.discriminatorValue(e,...t)}))}function Pt(t,r){if(!t)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 s={};let n=!1;const i=[],a=(...a)=>{const c=o.from(...a);r&&(c.collectionType=r,c.schema.type(r)),c.type=t,c.itemSchema.type(t),c.schema.assign(s),i.length&&(c.is(e.DecoratorTypes.PARAM)?c.parameter.itemSchema().genericOf(...i):c.itemSchema.genericOf(...i)),c.isArray&&n&&(c.schema.set("contains",c.schema.get("items")),c.schema.delete("items"))};return a.MinItems=e=>(s.minItems=e,a),a.MaxItems=e=>(s.maxItems=e,a),a.MinProperties=e=>(s.minProperties=e,a),a.MaxProperties=e=>(s.maxProperties=e,a),a.Contains=()=>(n=!0,a),a.UniqueItems=(e=!0)=>(s.uniqueItems=e,a),a.Nested=(...e)=>(i.push(e),a),a}function vt(e){return Pt(e,Array)}function Ct(e){return Pt(e,Map)}function xt(e){return Pt(e).Contains()}function $t(t,r){const s={};return(...n)=>{const i=(0,e.useDecorators)(r(...n));return i.Error=r=>(s.message=r,(0,e.useDecorators)(i,s.message&&At((s=>{const n=s.parentSchema.get("#errorMessage")||{};"required"===t?s.parentSchema.customKey("errorMessage",(0,e.deepMerge)(n,{[t]:{[s.propertyName]:r}})):s.itemSchema.customKey("errorMessage",(0,e.deepMerge)(n,{[t]:r}))})))),i}}h("paths",Rt);const Mt=$t("maxItems",(e=>{if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return At((t=>{t.schema.maxItems(e)}))})),_t=$t("maxProperties",(e=>{if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return At((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))})),wt=$t("minItems",(e=>{if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return At((t=>{t.schema.minItems(e)}))})),Lt=$t("minProperties",(e=>{if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return At((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))})),Nt=$t("uniqueItems",((e=!0)=>At((t=>{t.schema.uniqueItems(e)}))));function It(e){return At(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function Dt(...e){return At((t=>{t.itemSchema.allOf(e)}))}function kt(t){return At((r=>{t&&(((0,e.isClass)(t)||(0,e.isArrowFn)(t))&&(r.type=t),r.itemSchema.type(t))}))}function jt(...t){const r=t.find((t=>(0,e.isClass)(t)));return(0,e.useDecorators)(r&&kt(r),At(((r,s)=>{r.decoratorType===e.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===e.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName),r.schema.allow(...t)})))}function Ht(...e){return At((t=>{t.itemSchema.any(...e)}))}function Gt(...e){return At((t=>{t.itemSchema.anyOf(e)}))}function qt(e){return At((t=>{t.itemSchema.const(e)}))}function Ut(e,t){return At((r=>{r.itemSchema.customKey(e,t)}))}function Bt(e){return At((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function Kt(e){return At((t=>{t.itemSchema.default(e)}))}function Ft(e){return At((t=>{const r=t.parentSchema.get("#errorMessage")||{};t.parentSchema.customKey("errorMessage",{...r,...e})}))}function Jt(t){return(0,e.useDecorators)(Ft({_:t}))}function Wt(t){return At(((r,s)=>{r.is(e.DecoratorTypes.PROP)||r.is(e.DecoratorTypes.CLASS)?r.schema.description(t):r.is(e.DecoratorTypes.PARAM)?r.parameter.description(t):r.is(e.DecoratorTypes.METHOD)&&r.operation?.description(t)}))}function Vt(){return(0,e.useDecorators)(kt(),At((e=>{e.parent.schema.discriminatorKey(String(e.propertyKey))})))}const Xt=$t("enum",(function(e,...t){return At((r=>{r.itemSchema.enum(e,...t)}))}));function zt(...e){return At((t=>{t.schema.examples(e)}))}function Qt(e){return At((t=>{t.parameter.examples(e)}))}const Yt=$t("maximum",((e,t=!1)=>At((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)})))),Zt=Yt,er=$t("exclusiveMaximum",((e,t=!0)=>Yt(e,t))),tr=$t("minimum",((e,t=!1)=>At((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)})))),rr=tr,sr=$t("exclusiveMinimum",((e,t=!0)=>tr(e,t)));var nr;!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"}(nr||(nr={}));const ir=$t("format",(e=>At((t=>{t.itemSchema.format(e)})))),or=$t("format",(()=>ir(nr.EMAIL))),ar=$t("format",(()=>ir(nr.DATE_TIME))),cr=$t("format",(()=>ir(nr.DATE))),pr=$t("format",(()=>ir(nr.TIME))),ur=$t("format",(()=>ir(nr.URI))),hr=$t("format",(()=>ir(nr.URL)));function lr(e=!0){return At((t=>{t.schema.forwardGroups(e)}))}function mr(...t){return At((r=>{if(r.is(e.DecoratorTypes.CLASS))!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{mr(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(t,r);else if(r.is(e.DecoratorTypes.PROP))r.schema.groups(t,!0);else if(r.is(e.DecoratorTypes.PARAM)){let s="";2==t.length&&(0,e.isArray)(t[1])&&(s=t[0],t=t[1]),r.parameter.schema().groups(t).groupsName(s)}}))}function dr(){return(0,e.StoreSet)("hidden",!0)}function fr(e=!0){return At((t=>{t.schema.ignore(e)}))}function gr(){return At((e=>{e.itemSchema.type("integer")}))}function yr(e,t=!1){return At((r=>{t?r.schema.label(e):r.itemSchema.label(e)}))}const Or=$t("maxLength",(e=>{if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return At((t=>{t.itemSchema.maxLength(e)}))})),Sr=$t("minLength",(e=>{if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return At((t=>{t.itemSchema.minLength(e)}))})),br=$t("multipleOf",(e=>{if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return At((t=>{t.itemSchema.multipleOf(e)}))}));function Rr(t){return At(((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 Ar(t=Object){if((0,e.isClass)(t)){const{schema:e}=Q(t);return e.properties=function(e){return Object.entries(e).forEach((([e,r])=>{Q(t.prototype,e).schema.assign(r)})),this},e}return M.from({type:t})}function Er(){return Ar(Array)}function Tr(){return Ar(Map).unknown(!0)}function Pr(){return Ar(Array).uniqueItems(!0)}function vr(...e){return At((t=>{t.schema.oneOf(e)}))}function Cr(t,...r){return r=[t,...r],t===Array?At((e=>{e.schema.assign(Er().items({}).$comment("Warning: you should not use @Nullable(Array), which leads to an incorrect schema. Use @Schema(array().items().nullable()) instead").nullable(!0))})):(0,e.useDecorators)(1===r.length&&!(t instanceof M)&&kt(r[0]),vr(null,...r))}function xr(){return At((t=>{switch(t.decoratorType){case e.DecoratorTypes.PARAM:t.required=!1;break;case e.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName)}}))}const $r=$t("pattern",(e=>At((t=>{t.itemSchema.pattern(e)}))));function Mr(e=!0){return At((t=>{t.itemSchema.readOnly(e)}))}function _r(e){return At((t=>{t.schema.assign(e)}))}function wr(e,t){return At((r=>{r.schema.set(e,t)}))}function Lr(e,...t){return _r({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}const Nr=$t("required",((e=!0,...t)=>e?jt(...t):xr()));function Ir(...e){return At((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,s)=>A(e,s)?r.filter((e=>e!==t.propertyKey)):r))}))}function Dr(e){return At((t=>{t.schema.title(e)}))}function kr(t){return At((()=>(0,e.useDecorators)(Ft({type:t}))))}function jr(e=!0){return At((t=>{t.itemSchema.writeOnly(e)}))}function Hr(...t){const r=[t],s=(...t)=>{const s=o.from(...t);s.is(e.DecoratorTypes.PARAM)?s.parameter.schema().genericOf(...r):s.schema.genericOf(...r)};return s.Nested=(...e)=>(r.push(e),s),s}function Gr(...e){return t=>{o.from(t).schema.genericLabels(e)}}function qr(...t){return At(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.consumes(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],qr(...t));break;default:throw new e.UnsupportedDecoratorType(qr,s)}}))}function Ur(...t){return(0,e.useDecorators)(qr(...t),(0,e.StoreSet)("acceptMimes",t))}class Br extends Map{constructor(e={}){super(),this.actions=[],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[(0,ee.pascalCase)(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=o.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 Kr=new Map;function Fr(e,t){Kr.set(e,t)}function Jr(e){return Kr.get(e)}class Wr extends Br{constructor({status:e,model:t}){super(),this.methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","label","groups","allowedGroups","location","binary"],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&&tt(e)&&!this.get("description")&&(this.set("description",tt(e)),this.get("model")||this.model(Jr(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...H(e)}),this}header(t,r){return void 0===r&&(0,e.isString)(t)?this.headers({[t]:{type:"string"}}):this.headers({[t]:r})}location(e,t={}){return this.get("model")||this.model(String),this.headers({Location:{...t,value:e}}),this}groups(...t){return 2===t.length&&(0,e.isArray)(t[1])?(this.set("groupsName",t[0]),this.set("groups",t[1])):this.set("groups",t),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=>{const r=t.get("generics")||[];r.push(e),t.get("schema").genericOf(...r)})),this}of(...t){const r=this.get("model");return this.checkPrimitive(r),this.addAction((()=>{const s=this.get("schema");s&&((0,e.isCollection)(r)?s.itemSchema({type:t[0]}):(this.set("generics",[t]),s.genericOf(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({label:e})}label(e){return this.schema({label:e})}binary(){return this.type(String),this.set("contentType","application/octet-stream"),this.schema({format:"binary"}),this}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)||this.hasOfTypes)&&(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=o.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{decoratorType:t}=this,r=this.entity.operation,s=this.getStatus(),n=r.ensureResponseOf(s),i=this.getContentType();let{description:o=n.get("description")}=this.toObject();o&&(o=t===e.DecoratorTypes.CLASS&&n.get("description")||o,n.description(o));const a=this.getMergedKey("headers",n.get("headers"));return a&&n.headers(a),this.mapMedia(n),i&&r.addProduce(i),this.runActions()}mapMedia(e){const t=this.getContentType(),r=this.get("allowedGroups"),{operation:s}=this.entity,n=e.getMedia(t||"*/*"),i=n.type(this.get("model")).examples(this.get("examples")).schema().groups(this.get("groups")).groupsName(this.get("groupsName")).allowedGroups(r);return this.set("schema",i),r&&s.addAllowedGroupsParameter(r),n}manyOf(t,r){const s=this.get("model");return this.hasOfTypes=!0,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 Vr(e,t){return new Wr({status:e,model:t}).build()}function Xr(e){return Vr().ContentType(e)}function zr(t=!0){return At(((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],zr(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(zr,s)}}))}function Qr(t,r){return void 0!==r&&(t={[t]:r}),void 0===r&&(0,e.isString)(t)&&(t={[t]:{type:"string"}}),Vr().Headers(t)}function Yr(t){const r=new j,s={},n=(i,a,c)=>{const p=o.from(i,a,c);switch(p.decoratorType){case e.DecoratorTypes.PARAM:p.parameter.in(t);break;case e.DecoratorTypes.METHOD:r.in(t),p.operation.addParameter(-1,r),r.schema(M.from(s));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(i,n);break;default:throw new e.UnsupportedDecoratorType(Yr,[i,a,c])}};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.toJSON?e.toJSON():e),n),n}function Zr(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)(Yr(I.FILES),Rr(a),(0,e.useMethodDecorators)(Vr(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"),qr("multipart/form-data")))(...r)}}function es(e,t){return Vr().Location(e,t)}const ts=new Set([...Object.keys(at).filter((e=>e!==at.CUSTOM)).map((e=>e.toLowerCase()))]);function rs(e){let t,r;const s=e.filter((e=>"string"==typeof e&&ts.has(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:s}}class ss extends Br{constructor(){super(...arguments),this.methods=["name","description","summary","method","id","use","useAfter","useBefore"]}beforeInit(){const e=this.get("path"),t=at[this.get("method")]||at.CUSTOM;e&&(this.operationPath=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 this.operationPath?.summary(t),void this.entity.operation.summary(t);case"description":return this.operationPath?.description(t),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 ns(...e){const t=rs(e);return new ss(t).build()}function is(t){return At(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(is,s);r.operation.operationId(t)}))}function os(t,r="/"){return At(((s,n)=>{if(s.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(os,n);s.operation.addOperationPath(t.toUpperCase(),r)}))}function as(){return mr("partial")}function cs(t){return At(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.CLASS)throw new e.UnsupportedDecoratorType(cs,s);r.path=t}))}function ps(...t){return At(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.produces(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],ps(...t));break;default:throw new e.UnsupportedDecoratorType(ps,s)}}))}function us(e){return ns(at.PUBLISH,e)}function hs(...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)(Vr(r,String).Location(s,n),At((e=>{e.operation?.setRedirection(r)})))}const ls=ns;function ms(e="/",...t){return ns(...[at.ALL,e].concat(t))}function ds(e="/",...t){return ns(...[at.GET,e].concat(t))}function fs(e="/",...t){return ns(...[at.POST,e].concat(t))}function gs(e="/",...t){return ns(...[at.PUT,e].concat(t))}function ys(e="/",...t){return ns(...[at.DELETE,e].concat(t))}function Os(e="/",...t){return ns(...[at.HEAD,e].concat(t))}function Ss(e="/",...t){return ns(...[at.PATCH,e].concat(t))}function bs(e="/",...t){return ns(...[at.OPTIONS,e].concat(t))}function Rs(t,...r){return At(((s,n)=>{switch(s.decoratorType){case e.DecoratorTypes.METHOD:Array.isArray(t)?s.operation.security(t):s.operation.addSecurityScopes(t,r);break;case e.DecoratorTypes.CLASS:Array.isArray(t)?(0,e.decorateMethodsOf)(n[0],Rs(t)):(0,e.decorateMethodsOf)(n[0],Rs(t,...r));break;default:throw new e.UnsupportedDecoratorType(Rs,n)}}))}function As(e,t){return Vr(e,t)}function Es(e){return ns(at.SUBSCRIBE,e)}function Ts(t){return At(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Ts,s);r.operation.summary(t)}))}function Ps(...t){return At(((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],Ps(...t));break;default:throw new e.UnsupportedDecoratorType(Ps,s)}}))}function vs(t,r){return(0,e.StoreSet)("view",{path:t,options:r})}function Cs(e){return[...e.operationPaths.values()].map((({method:e,path:t})=>({method:e,path:t})))}function xs(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 $s{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 xs(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 Ms(...e){return Ar().allOf(e)}function _s(...e){return Ar().any(...e)}function ws(...e){return Ar().anyOf(e)}function Ls(){return Ar(Boolean)}function Ns(){return Ar(Date).format(nr.DATE)}function Is(){return Ar(Date).format(nr.DATE_TIME)}function Ds(){return Ar(Date).format(nr.TIME)}function ks(){return Ar(String)}function js(){return ks().format(nr.EMAIL)}function Hs(e){const t=ks().enum(e);return p.set(e,t),t}function Gs(){return Ar(Number).integer()}function qs(e){try{if(e())return o.from(e()).schema}catch(e){}return new Y(e)}function Us(){return Ar(Number)}function Bs(e={}){return Ar(Object).properties(e)}function Ks(...e){return Ar().oneOf(e)}function Fs(){return ks().format(nr.URI)}function Js(){return ks().format(nr.URL)}const Ws={allOf:Ms,anyOf:ws,boolean:Ls,array:Er,map:Tr,set:Pr,date:Ns,datetime:Is,time:Ds,email:js,enums:Hs,integer:Gs,number:Us,lazyRef:qs,object:Bs,oneOf:Ks,string:ks,uri:Fs,url:Js},Vs=(0,e.mergeReducerBuilder)(((e,t)=>e.type&&e.type&&e.type===t.type&&"array"===t.type?JSON.stringify(e.items)===JSON.stringify(t.items):e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),Xs=(0,e.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),zs=(0,e.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),Qs=(0,e.mergeReducerBuilder)(((e,t)=>e.name===t.name)),Ys={security:zs,parameters:Xs,oneOf:Vs,anyOf:Vs,allOf:Vs,tags:Qs};function Zs(t,r){return(0,e.deepMerge)(t,r,{reducers:Ys,cleanUndefinedProps:!0})}const en=new Map;function tn(t,r={}){if(r={specType:Z.OPENAPI,...r,tags:[],paths:{},channels:{},components:{},operationIdFormatter:r.operationIdFormatter||gt(r.operationIdPattern),root:!1},(0,e.isArray)(t)){let e={};return r={...r,append(t){e=Zs(e,t)}},t.forEach((({token:e,...t})=>{const s=tn(e,{...r,...t});r.append(s)})),e}return function(e,t,r){en.has(e)||en.set(e,new Map);const s=en.get(e),n=JSON.stringify(t);return s.has(n)||s.set(n,r()),s.get(n)}(t,r,(()=>function(t,r){const s=Q(t),{rootPath:n="/"}=r;return r={...r,rootPath:n,defaultTags:[(0,e.cleanObject)({name:s.schema.getName(),description:s.schema.get("description")})]},m("generate",[s],r)}(t,r)))}function rn(e){return e.startsWith("3.")?Z.OPENAPI:Z.SWAGGER}function sn(e){return"openapi"in e?Z.OPENAPI:Z.SWAGGER}function nn(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 on(t,{version:r,specVersion:s,acceptMimes:n=["application/json"]}){const{paths:i,security:o,tags:a,host:c,basePath:p,schemes:u,consumes:h=[],produces:l=["application/json"],definitions:m,parameters:d,responses:f,securityDefinitions:g,externalDocs:y}=t;return{swagger:s,consumes:(0,e.uniq)([...n,...h]),produces:(0,e.uniq)([...l]),info:nn((0,e.getValue)(t,"info",{})),paths:i,host:c,basePath:p,schemes:u,definitions:m,parameters:d,responses:f,security:o,securityDefinitions:g,tags:a,externalDocs:y}}function an(t,{specVersion:r}){const{servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}=t;return{openapi:r,info:nn((0,e.getValue)(t,"info",{})),servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}}function cn(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(rn(n)){case Z.OPENAPI:t=an(t,o),r=r?an(r,o):r;break;default:case Z.SWAGGER:t=on(t,o),r=r?on(r,o):r}return t=Zs(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 pn=["get","put","post","delete","options","head","patch","trace"],un=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],hn=["type","items"],ln=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,mn={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function dn(e){if(Array.isArray(e))e.forEach(dn);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):dn(e[t])}function fn(e){return new RegExp(ln,"i").test(e)}function gn(e){const t=Object.keys(mn).map((e=>mn[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||fn(e)))}function yn(e){return Object.entries(e).reduce(((e,[t,r])=>{const s=function(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}}}(r);return s&&(e[t]=s),e}),{})}function On(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 Sn{constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?On(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,dn(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(pn.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=gn(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=gn(t)[0],delete i.content,[mn.APPLICATION_X_WWW_URLENCODED,mn.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,un),this.copySchemaProperties(t,hn),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&&fn(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=yn(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function bn(e){return new Sn(e).convert()}function Rn({tokens:t,...r}){const{version:s="1.0.0",acceptMimes:n,fileSpec:i={},specVersion:o}=r,a=cn((0,e.getValue)(r,"spec",{}),{fileSpec:i,version:s,specVersion:o,acceptMimes:n}),c=sn(a),p=Zs(a,tn(t,r));return r.sortPaths&&(p.paths=Object.fromEntries(Object.entries(p.paths).sort((([e],[t])=>e.localeCompare(t))))),c===Z.SWAGGER?bn(p):p}const An=new Map;function En(t,r={}){const s=r.specType||Z.JSON;return function(t,r){const s=An.get(t)||new Map;An.set(t,s);const n=function(t){return JSON.stringify(t,((t,r)=>r&&!(0,e.isPlainObject)(r)&&(0,e.isClass)(r)?(0,e.nameOf)(r):r))}(r);if(!s.has(n)){const i=Q(t);let o="schema";i instanceof W&&(r={...r,root:!0,groups:i.schema.getGroups()},o="item");const a=m(o,[i.schema],r);Object.keys((0,e.getValue)(r,"components.schemas",{})).length&&(a.definitions=r.components.schemas),s.set(n,a)}return s.get(n)}(t,r={endpoint:!0,groups:[],inlineEnums:s===Z.JSON,...r,specType:s,components:{schemas:{}}})}function Tn(e,t={}){const r=e.isStore?e:Q(e),s=xs(t.basePath,r.path);let n=[];return t.withChildren&&(n=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(Tn(r,{...t,basePath:s}))),n)),[...ft(e).values()].reduce(((r,n)=>{const{operation:i}=n;return i&&i.getAllowedOperationPath(t.allowedVerbs).forEach((t=>{r.push(new $s({basePath:s,token:e,endpoint:n,operationPath:t}))})),r}),n)}function Pn(e){const t=e.isStore?e:Q(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 vn(e,t={}){const r=Pn(e),s=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&we(e.itemSchema,t)||s.set(r,e)})),s}})(),i})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@tsed/core"),require("change-case")):"function"==typeof define&&define.amd?define(["@tsed/core","change-case"],t):"object"==typeof exports?exports["@tsed/schema"]=t(require("@tsed/core"),require("change-case")):e["@tsed/schema"]=t(e["@tsed/core"],e["change-case"])}(self,((e,t)=>(()=>{"use strict";var r={133:(e,t,r)=>{e.exports=r(555)},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],g=r.capture?"":"?:",y=s.globChars(r.windows),O=s.extglobChars(y),{DOT_LITERAL:S,PLUS_LITERAL:b,SLASH_LITERAL:R,ONE_CHAR:A,DOTS_SLASH:E,NO_DOT:T,NO_DOT_SLASH:P,NO_DOTS_SLASH:v,QMARK:C,QMARK_NO_DOT:x,STAR:$,START_ANCHOR:M}=y,_=e=>`(${g}(?:(?!${M}${e.dot?E:S}).)*?)`,w=r.dot?"":T,L=r.dot?C:x;let N=!0===r.bash?_(r):$;r.capture&&(N=`(${N})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const I={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,I),m=e.length;const D=[],k=[],j=[];let H,q=d;const G=()=>I.index===m-1,U=I.peek=(t=1)=>e[I.index+t],B=I.advance=()=>e[++I.index],K=()=>e.slice(I.index+1),F=(e="",t=0)=>{I.consumed+=e,I.index+=t},J=e=>{I.output+=null!=e.output?e.output:e.value,F(e.value)},W=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)B(),I.start++,e++;return e%2!=0&&(I.negated=!0,I.start++,!0)},V=e=>{I[e]++,j.push(e)},X=e=>{I[e]--,j.pop()},z=e=>{if("globstar"===q.type){const t=I.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||D.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(I.output=I.output.slice(0,-q.output.length),q.type="star",q.value="*",q.output=N,I.output+=q.output)}if(D.length&&"paren"!==e.type&&!O[e.value]&&(D[D.length-1].inner+=e.value),(e.value||e.output)&&J(e),q&&"text"===q.type&&"text"===e.type)return q.value+=e.value,void(q.output=(q.output||"")+e.value);e.prev=q,f.push(e),q=e},Q=(e,t)=>{const s={...O[t],conditions:1,inner:""};s.prev=q,s.parens=I.parens,s.output=I.output;const n=(r.capture?"(":"")+s.open;V("parens"),z({type:e,value:t,output:I.output?"":A}),z({type:"paren",extglob:!0,value:B(),output:n}),D.push(s)},Y=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let s=N;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=_(r)),(s!==N||G()||/^\)+$/.test(K()))&&(t=e.close=`)$))${s}`),"bos"===e.prev.type&&G()&&(I.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:H,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?L+(i?C.repeat(i.length):""):C.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?t?t+n+(i?N:""):N: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?(I.output=e,I):(I.output=n.wrapOutput(i,I,t),I)}for(;!G();){if(H=B(),"\0"===H)continue;if("\\"===H){const e=U();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){H+="\\",z({type:"text",value:H});continue}const t=/^\\+/.exec(K());let s=0;if(t&&t[0].length>2&&(s=t[0].length,I.index+=s,s%2!=0&&(H+="\\")),!0===r.unescape?H=B()||"":H+=B()||"",0===I.brackets){z({type:"text",value:H});continue}}if(I.brackets>0&&("]"!==H||"["===q.value||"[^"===q.value)){if(!1!==r.posix&&":"===H){const e=q.value.slice(1);if(e.includes("[")&&(q.posix=!0,e.includes(":"))){const e=q.value.lastIndexOf("["),t=q.value.slice(0,e),r=q.value.slice(e+2),s=o[r];if(s){q.value=t+s,I.backtrack=!0,B(),d.output||1!==f.indexOf(q)||(d.output=A);continue}}}("["===H&&":"!==U()||"-"===H&&"]"===U())&&(H=`\\${H}`),"]"!==H||"["!==q.value&&"[^"!==q.value||(H=`\\${H}`),!0===r.posix&&"!"===H&&"["===q.value&&(H="^"),q.value+=H,J({value:H});continue}if(1===I.quotes&&'"'!==H){H=n.escapeRegex(H),q.value+=H,J({value:H});continue}if('"'===H){I.quotes=1===I.quotes?0:1,!0===r.keepQuotes&&z({type:"text",value:H});continue}if("("===H){V("parens"),z({type:"paren",value:H});continue}if(")"===H){if(0===I.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=D[D.length-1];if(e&&I.parens===e.parens+1){Y(D.pop());continue}z({type:"paren",value:H,output:I.parens?")":"\\)"}),X("parens");continue}if("["===H){if(!0!==r.nobracket&&K().includes("]"))V("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));H=`\\${H}`}z({type:"bracket",value:H});continue}if("]"===H){if(!0===r.nobracket||q&&"bracket"===q.type&&1===q.value.length){z({type:"text",value:H,output:`\\${H}`});continue}if(0===I.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));z({type:"text",value:H,output:`\\${H}`});continue}X("brackets");const e=q.value.slice(1);if(!0===q.posix||"^"!==e[0]||e.includes("/")||(H=`/${H}`),q.value+=H,J({value:H}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(q.value);if(I.output=I.output.slice(0,-q.value.length),!0===r.literalBrackets){I.output+=t,q.value=t;continue}q.value=`(${g}${t}|${q.value})`,I.output+=q.value;continue}if("{"===H&&!0!==r.nobrace){V("braces");const e={type:"brace",value:H,output:"(",outputIndex:I.output.length,tokensIndex:I.tokens.length};k.push(e),z(e);continue}if("}"===H){const e=k[k.length-1];if(!0===r.nobrace||!e){z({type:"text",value:H,output:H});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),I.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=I.output.slice(0,e.outputIndex),s=I.tokens.slice(e.tokensIndex);e.value=e.output="\\{",H=t="\\}",I.output=r;for(const e of s)I.output+=e.output||e.value}z({type:"brace",value:H,output:t}),X("braces"),k.pop();continue}if("|"===H){D.length>0&&D[D.length-1].conditions++,z({type:"text",value:H});continue}if(","===H){let e=H;const t=k[k.length-1];t&&"braces"===j[j.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:H,output:e});continue}if("/"===H){if("dot"===q.type&&I.index===I.start+1){I.start=I.index+1,I.consumed="",I.output="",f.pop(),q=d;continue}z({type:"slash",value:H,output:R});continue}if("."===H){if(I.braces>0&&"dot"===q.type){"."===q.value&&(q.output=S);const e=k[k.length-1];q.type="dots",q.output+=H,q.value+=H,e.dots=!0;continue}if(I.braces+I.parens===0&&"bos"!==q.type&&"slash"!==q.type){z({type:"text",value:H,output:S});continue}z({type:"dot",value:H,output:S});continue}if("?"===H){if((!q||"("!==q.value)&&!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("qmark",H);continue}if(q&&"paren"===q.type){const e=U();let t=H;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===q.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${H}`),z({type:"text",value:H,output:t});continue}if(!0!==r.dot&&("slash"===q.type||"bos"===q.type)){z({type:"qmark",value:H,output:x});continue}z({type:"qmark",value:H,output:C});continue}if("!"===H){if(!0!==r.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Q("negate",H);continue}if(!0!==r.nonegate&&0===I.index){W();continue}}if("+"===H){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("plus",H);continue}if(q&&"("===q.value||!1===r.regex){z({type:"plus",value:H,output:b});continue}if(q&&("bracket"===q.type||"paren"===q.type||"brace"===q.type)||I.parens>0){z({type:"plus",value:H});continue}z({type:"plus",value:b});continue}if("@"===H){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){z({type:"at",extglob:!0,value:H,output:""});continue}z({type:"text",value:H});continue}if("*"!==H){"$"!==H&&"^"!==H||(H=`\\${H}`);const e=a.exec(K());e&&(H+=e[0],I.index+=e[0].length),z({type:"text",value:H});continue}if(q&&("globstar"===q.type||!0===q.star)){q.type="star",q.star=!0,q.value+=H,q.output=N,I.backtrack=!0,I.globstar=!0,F(H);continue}let t=K();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",H);continue}if("star"===q.type){if(!0===r.noglobstar){F(H);continue}const s=q.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:H,output:""});continue}const a=I.braces>0&&("comma"===s.type||"brace"===s.type),c=D.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){z({type:"star",value:H,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[I.index+4];if(r&&"/"!==r)break;t=t.slice(3),F("/**",3)}if("bos"===s.type&&G()){q.type="globstar",q.value+=H,q.output=_(r),I.output=q.output,I.globstar=!0,F(H);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&G()){I.output=I.output.slice(0,-(s.output+q.output).length),s.output=`(?:${s.output}`,q.type="globstar",q.output=_(r)+(r.strictSlashes?")":"|$)"),q.value+=H,I.globstar=!0,I.output+=s.output+q.output,F(H);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";I.output=I.output.slice(0,-(s.output+q.output).length),s.output=`(?:${s.output}`,q.type="globstar",q.output=`${_(r)}${R}|${R}${e})`,q.value+=H,I.output+=s.output+q.output,I.globstar=!0,F(H+B()),z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){q.type="globstar",q.value+=H,q.output=`(?:^|${R}|${_(r)}${R})`,I.output=q.output,I.globstar=!0,F(H+B()),z({type:"slash",value:"/",output:""});continue}I.output=I.output.slice(0,-q.output.length),q.type="globstar",q.output=_(r),q.value+=H,I.output+=q.output,I.globstar=!0,F(H);continue}const s={type:"star",value:H,output:N};!0!==r.bash?!q||"bracket"!==q.type&&"paren"!==q.type||!0!==r.regex?(I.index!==I.start&&"slash"!==q.type&&"dot"!==q.type||("dot"===q.type?(I.output+=P,q.output+=P):!0===r.dot?(I.output+=v,q.output+=v):(I.output+=w,q.output+=w),"*"!==U()&&(I.output+=A,q.output+=A)),z(s)):(s.output=H,z(s)):(s.output=".*?","bos"!==q.type&&"slash"!==q.type||(s.output=w+s.output),z(s))}for(;I.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));I.output=n.escapeLast(I.output,"["),X("brackets")}for(;I.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));I.output=n.escapeLast(I.output,"("),X("parens")}for(;I.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));I.output=n.escapeLast(I.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==q.type&&"bracket"!==q.type||z({type:"maybe_slash",value:"",output:`${R}?`}),!0===I.backtrack){I.output="";for(const e of I.tokens)I.output+=null!=e.output?e.output:e.value,e.suffix&&(I.output+=e.suffix)}return I};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:g,START_ANCHOR:y}=s.globChars(r.windows),O=r.dot?d:m,S=r.dot?f:m,b=r.capture?"":"?:";let R=!0===r.bash?".*?":g;r.capture&&(R=`(${R})`);const A=e=>!0===e.noglobstar?R:`(${b}(?:(?!${y}${e.dot?l:c}).)*?)`,E=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+A(r);case"**/*":return`(?:${O}${A(r)}${p})?${S}${h}${R}`;case"**/*.*":return`(?:${O}${A(r)}${p})?${S}${R}${c}${h}${R}`;case"**/.*":return`(?:${O}${A(r)}${p})?${c}${h}${R}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=E(t[1]);if(!r)return;return r+c+t[2]}}},T=n.removePrefix(e,{negated:!1,prefix:""});let P=E(T);return P&&!0!==r.strictSlashes&&(P+=`${p}?`),P},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:g,CHAR_RIGHT_PARENTHESES:y,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,A=!0===r.parts||!0===r.scanToEnd,E=[],T=[],P=[];let v,C,x=e,$=-1,M=0,_=0,w=!1,L=!1,N=!1,I=!1,D=!1,k=!1,j=!1,H=!1,q=!1,G=0,U={value:"",depth:0,isGlob:!1};const B=()=>$>=R,K=()=>(v=C,x.charCodeAt(++$));for(;$<R;){let e;if(C=K(),C!==o){if(!0===k||C===h){for(G++;!0!==B()&&(C=K());)if(C!==o)if(C!==h){if(!0!==k&&C===c&&(C=K())===c){if(w=U.isBrace=!0,N=U.isGlob=!0,q=!0,!0===A)continue;break}if(!0!==k&&C===a){if(w=U.isBrace=!0,N=U.isGlob=!0,q=!0,!0===A)continue;break}if(C===g&&(G--,0===G)){k=!1,w=U.isBrace=!0,q=!0;break}}else G++;else j=U.backslashes=!0,K();if(!0===A)continue;break}if(C!==p){if(!0!==r.noext&&!0==(C===d||C===i||C===n||C===f||C===u)&&x.charCodeAt($+1)===l){if(N=U.isGlob=!0,I=U.isExtglob=!0,q=!0,!0===A){for(;!0!==B()&&(C=K());)if(C!==o){if(C===y){N=U.isGlob=!0,q=!0;break}}else j=U.backslashes=!0,C=K();continue}break}if(C===n){if(v===n&&(D=U.isGlobstar=!0),N=U.isGlob=!0,q=!0,!0===A)continue;break}if(C===f){if(N=U.isGlob=!0,q=!0,!0===A)continue;break}if(C===m)for(;!0!==B()&&(e=K());)if(e!==o){if(e===O){if(L=U.isBracket=!0,N=U.isGlob=!0,q=!0,!0===A)continue;break}}else j=U.backslashes=!0,K();if(!0===r.nonegate||C!==u||$!==M){if(!0!==r.noparen&&C===l){if(N=U.isGlob=!0,!0===A){for(;!0!==B()&&(C=K());)if(C!==l){if(C===y){q=!0;break}}else j=U.backslashes=!0,C=K();continue}break}if(!0===N){if(q=!0,!0===A)continue;break}}else H=U.negated=!0,M++}else{if(E.push($),T.push(U),U={value:"",depth:0,isGlob:!1},!0===q)continue;if(v===c&&$===M+1){M+=2;continue}_=$+1}}else j=U.backslashes=!0,C=K(),C===h&&(k=!0)}!0===r.noext&&(I=!1,N=!1);let F=x,J="",W="";M>0&&(J=x.slice(0,M),x=x.slice(M),_-=M),F&&!0===N&&_>0?(F=x.slice(0,_),W=x.slice(_)):!0===N?(F="",W=x):F=x,F&&""!==F&&"/"!==F&&F!==x&&S(F.charCodeAt(F.length-1))&&(F=F.slice(0,-1)),!0===r.unescape&&(W&&(W=s.removeBackslashes(W)),F&&!0===j&&(F=s.removeBackslashes(F)));const V={prefix:J,input:e,start:M,base:F,glob:W,isBrace:w,isBracket:L,isGlob:N,isExtglob:I,isGlobstar:D,negated:H};if(!0===r.tokens&&(V.maxDepth=0,S(C)||T.push(U),V.tokens=T),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<E.length;s++){const n=t?t+1:M,i=E[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==M?(T[s].isPrefix=!0,T[s].value=J):T[s].value=o,b(T[s]),V.maxDepth+=T[s].depth),0===s&&""===o||P.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);P.push(s),r.tokens&&(T[T.length-1].value=s,b(T[T.length-1]),V.maxDepth+=T[T.length-1].depth)}V.slashes=E,V.parts=P}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(/.*\//,"")},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},598:e=>{e.exports=t},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"}')}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={exports:{}};return r[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 i={};return(()=>{n.r(i),n.d(i,{ARRAY_PROPERTIES:()=>xe,AcceptMime:()=>Ur,AdditionalProperties:()=>It,All:()=>ms,AllOf:()=>Dt,Allow:()=>jt,Any:()=>Ht,AnyOf:()=>qt,ArrayOf:()=>vt,BOOLEAN_PROPERTIES:()=>ve,COMMON_PROPERTIES:()=>Me,Children:()=>Et,CollectionContains:()=>xt,CollectionOf:()=>Pt,Const:()=>Gt,Consumes:()=>Gr,ContentType:()=>Xr,Converter:()=>Sn,CustomKey:()=>Ut,CustomKeys:()=>Bt,DateFormat:()=>cr,DateTime:()=>ar,DecoratorContext:()=>Br,Default:()=>Kt,DefaultMsg:()=>Jt,Delete:()=>ys,Deprecated:()=>zr,Description:()=>Wt,Discriminator:()=>v,DiscriminatorKey:()=>Vt,DiscriminatorValue:()=>Tt,Email:()=>or,EndpointMetadata:()=>J,Enum:()=>Xt,ErrorMsg:()=>Ft,Example:()=>zt,Examples:()=>Qt,ExclusiveMaximum:()=>er,ExclusiveMinimum:()=>sr,For:()=>wr,Format:()=>ir,ForwardGroups:()=>lr,GenericOf:()=>Hr,Generics:()=>qr,Get:()=>ds,Groups:()=>mr,HTTP_STATUS_MESSAGES:()=>Ze,Head:()=>Os,Header:()=>Qr,Hidden:()=>dr,Ignore:()=>fr,In:()=>Yr,InFile:()=>Zr,Integer:()=>gr,JSON_TYPES:()=>y,JsonClassStore:()=>_,JsonEntitiesContainer:()=>s,JsonEntityComponent:()=>a,JsonEntityFn:()=>At,JsonEntityStore:()=>o,JsonFormatTypes:()=>nr,JsonLazyRef:()=>Y,JsonMap:()=>N,JsonMedia:()=>G,JsonMethodPath:()=>B,JsonMethodStore:()=>F,JsonOperation:()=>K,JsonOperationPathsMap:()=>dt,JsonOperationRoute:()=>$s,JsonParameter:()=>j,JsonParameterStore:()=>W,JsonParameterTypes:()=>I,JsonPropertyStore:()=>X,JsonRequestBody:()=>nt,JsonResponse:()=>U,JsonSchema:()=>M,LabelledAs:()=>yr,Location:()=>es,MANY_OF_PROPERTIES:()=>Te,MapOf:()=>Ct,Max:()=>Zt,MaxItems:()=>Mt,MaxLength:()=>Or,MaxProperties:()=>_t,Maximum:()=>Yt,Min:()=>rr,MinItems:()=>wt,MinLength:()=>Sr,MinProperties:()=>Lt,Minimum:()=>tr,MultipleOf:()=>br,NUMBER_PROPERTIES:()=>Ce,Name:()=>Rr,Nullable:()=>Cr,OBJECT_PROPERTIES:()=>$e,OPERATION_HTTP_VERBS:()=>ct,OPERATION_WS_VERBS:()=>ut,OneOf:()=>vr,Operation:()=>ns,OperationId:()=>is,OperationMethods:()=>pt,OperationPath:()=>os,OperationVerbs:()=>at,Optional:()=>xr,Options:()=>bs,ParamMetadata:()=>V,Partial:()=>as,Patch:()=>Ss,Path:()=>cs,Pattern:()=>$r,Post:()=>fs,Produces:()=>us,Property:()=>kt,PropertyMetadata:()=>z,Publish:()=>ps,Put:()=>gs,ReadOnly:()=>Mr,RecordOf:()=>Lr,Redirect:()=>hs,Required:()=>Nr,RequiredGroups:()=>Ir,Returns:()=>Vr,Route:()=>ls,STRING_PROPERTIES:()=>Pe,Schema:()=>_r,Security:()=>Rs,SpecTypes:()=>Z,Status:()=>As,Subscribe:()=>Es,Summary:()=>Ts,Tags:()=>Ps,TimeFormat:()=>ur,Title:()=>Dr,TypeError:()=>kr,UniqueItems:()=>Nt,Uri:()=>pr,Url:()=>hr,VendorKeys:()=>c,View:()=>vs,WriteOnly:()=>jr,allOf:()=>Ms,alterIgnore:()=>we,alterOneOf:()=>He,alterRequiredGroups:()=>Ie,any:()=>_s,anyMapper:()=>ce,anyOf:()=>ws,array:()=>Er,boolean:()=>Ls,buildPath:()=>ht,classMapper:()=>ue,concatParameters:()=>lt,concatPath:()=>xs,createRef:()=>oe,createRefName:()=>ie,date:()=>Ns,datetime:()=>Is,defineStatusModel:()=>Fr,discriminatorMappingMapper:()=>pe,email:()=>js,enums:()=>Hs,enumsMapper:()=>he,enumsRegistry:()=>u,execMapper:()=>m,execOneOfMapper:()=>f,formatParameterType:()=>D,from:()=>Ar,generateSpec:()=>Rn,genericsMapper:()=>me,getComputedType:()=>g,getGenericsOptions:()=>Se,getInheritedStores:()=>de,getJsonEntityStore:()=>Q,getJsonPathParameters:()=>mt,getJsonSchema:()=>En,getJsonSchemaMapper:()=>l,getJsonType:()=>O,getOperationId:()=>yt,getOperationsRoutes:()=>Tn,getOperationsStores:()=>ft,getProperties:()=>vn,getPropertiesStores:()=>Pn,getSchemaFromRef:()=>se,getSpec:()=>tn,getSpecType:()=>rn,getSpecTypeFromSpec:()=>sn,getStatusConstant:()=>et,getStatusMessage:()=>tt,getStatusModel:()=>Jr,hasMapper:()=>d,inheritedClassMapper:()=>ge,inspectOperationsPaths:()=>Cs,integer:()=>qs,isParameterType:()=>k,isRedirectionStatus:()=>L,isSuccessStatus:()=>w,itemMapper:()=>Ae,lazyRef:()=>Gs,lazyRefMapper:()=>ye,map:()=>Tr,mapAliasedProperties:()=>ke,mapHeaders:()=>H,mapMapper:()=>Oe,mapOpenSpec:()=>cn,mapOpenSpec2:()=>on,mapOpenSpec3:()=>an,mapOpenSpecInfo:()=>nn,mapOperationOptions:()=>rs,matchGroups:()=>A,mergeSchema:()=>re,mergeSpec:()=>Zs,nextMapper:()=>Ee,nullableMapper:()=>_e,nullableMapperOpenApi:()=>Fe,number:()=>Us,object:()=>Bs,objectMapper:()=>Le,ofMapper:()=>Ne,oneOf:()=>Ks,operationIdFormatter:()=>gt,operationInFilesMapper:()=>Je,operationInParameterMapper:()=>We,operationInParametersMapper:()=>Ve,operationInQueryMapper:()=>ze,operationMapper:()=>rt,operationMediaMapper:()=>st,operationRequestBodyMapper:()=>it,operationResponseMapper:()=>ot,parameters:()=>Xs,pathsMapper:()=>Rt,registerJsonSchemaMapper:()=>h,removeHiddenOperation:()=>Ot,requiredMapper:()=>De,s:()=>Ws,schemaMapper:()=>Ue,schemesReducer:()=>Vs,security:()=>zs,serializeEnum:()=>E,serializeEnumValues:()=>T,set:()=>Pr,string:()=>ks,tagsReducer:()=>Qs,time:()=>Ds,toJsonMapCollection:()=>q,toJsonRegex:()=>P,toRef:()=>ae,transformInformation:()=>On,transformSecurity:()=>yn,transformToOS2:()=>bn,uri:()=>Fs,url:()=>Js,withErrorMsg:()=>$t,wrapEnumsMapper:()=>Be});var e=n(803);function t(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 r(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const s=new Map;class o{constructor(e){this.isStore=!0;const{target:t,propertyKey:r,descriptor:s,index:n,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=r?String(r):r||"",this.descriptor=s,this.index=n,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get collectionType(){return this._collectionType}set collectionType(e){this._collectionType=e}get type(){return this._type}set type(e){e?.$schema?.skip||(this._type=e),this.build()}get schema(){return this._schema}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=>o.from(e).schema.isDiscriminator));return t&&o.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 computedType(){return this.itemSchema.class}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}get path(){return this.store.get("path")}set path(e){this.store.set("path",e)}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 i=(0,e.decoratorTypeOf)(t),o=new(s.get(i))({store:n,decoratorType:i,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(),n.set("JsonEntityStore",o)}return n.get("JsonEntityStore")}static fromMethod(t,r){return this.from(t,r,(0,e.descriptorOf)(t,r))}static get(t,r,s){return o.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(":")}getBestType(){return this.itemSchema.hasDiscriminator?this.itemSchema.discriminator().base:(0,e.isClassObject)(this.type)?this.itemSchema.getTarget():(0,e.isArrowFn)(this.type)?this.type():this.type}is(e){return this.decoratorType===e}buildType(t){(0,e.isCollection)(t)?this._collectionType=t:t&&"$schema"in t&&t.$schema.skip||(this._type=t,this._type&&(0,e.isPlainObject)(this._type)&&(this._type=String))}}function a(e){return t=>{s.set(e,t)}}var c;!function(e){e.GENERIC_LABELS="genericLabels",e.GENERIC_LABEL="genericLabel",e.GENERIC_OF="genericOf",e.NULLABLE="nullable",e.FORWARD_GROUPS="forwardGroups",e.GROUPS="groups",e.GROUPS_NAME="groupsName",e.ALLOWED_GROUPS="allowedGroups"}(c||(c={}));const u=new Map,p=new Map;function h(e,t,r){return p.set(r?`${r}:${e}`:e,t)}function l(e,t){const r=p.get(`${t?.specType}:${e}`)||p.get(e);if(r)return r;throw new Error(`JsonSchema ${e} mapper doesn't exists`)}function m(e,t,r,s){return l(e,r)(...t,r,s)}function d(e){return p.has(e)}function f(e,t){return e.find((e=>p.has(`${t?.specType}:${e}`)))||e.find((e=>p.has(e)))}function g(t){return(0,e.isPromise)(t)||t===Function?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}const y=["string","number","integer","boolean","object","array","null","any"];function O(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(O):t===Set?"array":(0,e.isDate)(t)||(0,e.isBuffer)(t)?"string":"object"}var S=n(133),b=n.n(S);function R(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=b()(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 A(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),s=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&R(r,t))||!!s.length&&!R(e.filter((e=>!e.startsWith("!"))),t)}const E=t=>(0,e.isObject)(t)&&null!==t?Object.entries(t).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):t;function T(t){const r=t.reduce(((e,t)=>e.concat(E(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 P(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class v{constructor({base:t,propertyName:r,types:s,values:n}={}){this.values=new Map,this.types=new Map,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 C(e){return e instanceof M?e:Object.entries(e).reduce(((e,[t,r])=>(e[P(t)]=x(r),r instanceof M&&r.propertyKey(P(t)),e)),{})}function x(t){return(0,e.isArray)(t)?t.map(x):t&&(t.isStore||t.$isJsonDocument||t.isLazyRef)?t:t&&(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?o.from(t).schema:(0,e.isObject)(t)?M.from(t):(0,e.isPrimitiveClass)(t)||t===Date||null===t?M.from({type:t}):t}function $(t,r){const s=t.getGenericLabels();if(!s)return{};const[n,...i]=r;return n.reduce(((t,r,n)=>{const o=s[n];if(o)if(function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(r))t[o]=[M.from({type:"string",enum:Object.values(r)})];else if(i.length){const e=x(r);t[o]=[e,$(e,i)]}else t[o]=[x(r)];return t}),{})}class M extends Map{#e;#t;#r;#s;#n;#i;#o;#a;#c;#u;constructor(t={}){super(),this.$kind="schema",this.$isJsonDocument=!0,this.$hooks=new e.Hooks,this.$allow=[],this.$ignore=!1,this.isDiscriminatorKey=!1,this.isDiscriminator=!1,this.#e=new Set,this.#t=new Map,this.#r=null,this.#s=new Map,this.#i=!1,this.#a=!1,this.#c=!1,t&&this.assign(t)}get alias(){return this.#s}get isClass(){return(0,e.isClass)(this.class)&&!this.isCollection}get isCollection(){return this.#a}get isLocalSchema(){return this.#i}get isGeneric(){return this.has(c.GENERIC_LABEL)}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.#o).find((e=>o.from(e).schema.isDiscriminator));return t&&o.from(t).schema}get class(){return this.#i?this.#n?.getTarget():g(this.#o)}get collectionClass(){return this.isCollection&&this.#n?this.#n.class:this.class}get canRef(){return this.#c}get isNullable(){return!!this.get(c.NULLABLE)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!this.#r}static from(t={}){return t instanceof M?t:t&&(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?o.from(t).schema:(0,e.isPrimitiveClass)(t)||t===Date||null===t?new M({type:t}):new M(t)}has(e){return!!super.has(e)||!!super.has(`#${e}`)||this.#t.has(e)}get(e,t){return this.#t.has(e)?this.#t.get(e):super.has(e)?super.get(e):super.has(`#${e}`)?super.get(`#${e}`):t}forwardGroups(e=!0){return this.vendorKey(c.FORWARD_GROUPS,e),this}groups(e,t){return e&&(this.vendorKey(c.GROUPS,e),t&&this.$hooks.on("groups",((t,r)=>!(t||!A(e,r))||t))),this}groupsName(e){return e&&this.vendorKey(c.GROUPS_NAME,e),this}allowedGroups(e){return e&&this.vendorKey(c.ALLOWED_GROUPS,e),this}genericLabels(e){return this.vendorKey(c.GENERIC_LABELS,e),this}genericLabel(e){return this.vendorKey(c.GENERIC_LABEL,e),this}genericOf(...e){const t=$(this.#n||x(this.getTarget()),e);return this.vendorKey(c.GENERIC_OF,t),this}nullable(e){return this.isNullable||this.vendorKey(c.NULLABLE,e),this}itemSchema(t={}){return this.#n=this.#n||x(t),(0,e.isPlainObject)(t)&&this.#n.assign(t),!this.isCollection&&this.#n?.isClass&&(this.#i=!0),this.#n}getAliasOf(e){return this.#s.get(e)}addAlias(e,t){return this.#s.set(e,t),this.#s.set(t,e),this}removeAlias(e){const t=this.#s.get(e);return t&&this.#s.delete(t),this.#s.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.#c=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){return"boolean"!=typeof e&&this.$hooks.on("ignore",e),this.$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.#r=this.#r||new v({base:this.#o})}discriminatorKey(e){this.discriminator().propertyName=e,this.isDiscriminator=!0;const t=this.get("properties")[e];return t&&(t.isCollection?t.itemSchema().isDiscriminatorKey=!0:t.isDiscriminatorKey=!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 M({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",x(e)),this}contains(e){return super.set("contains",x(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#n=x(e)),this}$comment(e){return super.set("$comment",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[].concat(this.getJsonType()).includes("string")&&!this.has("minLength")&&this.minLength(1),e.forEach((e=>{switch(e){case"":this.set("minLength",void 0);break;case null:this.nullable(!0)}})),this.$allow.push(...e),this}required(t=!0){if(!(0,e.isArray)(t)){const e=this.clone();return e.$selfRequired=t,[].concat(e.getJsonType()).includes("string")&&e.minLength(1),e}return this.#e.clear(),t.forEach((e=>this.#e.add(e))),this}addRequired(e){return this.#e.add(e),this}removeRequired(e){return this.#e.delete(e),this}isRequired(e){return this.#e.has(e)}getRequiredFields(){return[...this.#e]}properties(e){return super.set("properties",C(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",C(r)),this}patternProperties(e){return super.set("patternProperties",C(e)),this}additionalProperties(e){return super.set("additionalProperties",x(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",C(e)),this}propertyNames(e){return super.set("propertyNames",x(e)),this}enum(e,...t){if(u.has(e))return this.enum(u.get(e));if(e instanceof M)e.getName()?super.set("enum",e):super.set("enum",e.get("enum")).any(...e.get("enum").map((e=>typeof e)));else{const{values:r,types:s}=T([e,t].flat());super.set("enum",r).any(...s)}return this}definitions(e){return super.set("definitions",C(e)),this}allOf(e){return this.setManyOf("allOf",e),this}anyOf(e){return this.setManyOf("anyOf",e),this}oneOf(e){return this.isCollection?this.itemSchema().oneOf(e):this.setManyOf("oneOf",e),this}not(e){return super.set("not",x(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",P(e)),this}format(e){return super.set("format",e),this}type(t){switch(t){case"map":case Map:super.set("type",O(t)),this.target(t),this.#a=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case"array":case Array:super.set("type",O(t)),this.target(t),this.#a=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case"set":case Set:super.set("type",O(t)),this.target(t),this.#a=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":this.integer();break;case"number":case"string":case"boolean":case"object":case Object:case Date:case Boolean:case Number:case String:super.set("type",O(t)),this.target(t),this.has("properties")||super.set("properties",{});break;default:if((0,e.isClass)(t)||(0,e.isFunction)(t))super.set("type",void 0),this.target(t),this.has("properties")||super.set("properties",{});else{const e=O(t);"generic"===e?this.genericLabel(t):super.set("type",e)}}return this}any(...t){return t=t.length?t:["integer","number","string","boolean","array","object","null"],(t=(0,e.uniq)(t).map((t=>(0,e.isClass)(t)?t:{type:O(t)}))).length>1?this.oneOf(t):this.type(t[0]?.type||t[0]),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}vendorKey(e,t){return this.#t.set(e,t),this}toObject(e){return this.toJSON(e)}toJSON(e){return m("schema",[this],e)}assign(e={}){return(e instanceof M?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof M&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),this.#e=new Set(e.#e.keys()),this.#s=new Map(this.#s.entries()),this.#t=new Map(e.#t.entries()),this.#r=this.#r?new v(this.#r):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#c=e.#c,this.#o=e.#o,this.#a=e.#a,this.#i=e.#i,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}getJsonType(){return this.get("anyOf")?this.get("anyOf").map((e=>e.getJsonType())):this.get("type")||O(this.class)}getTarget(){return this.#o}getAllowedGroups(){return this.get(c.ALLOWED_GROUPS)}getAllowedRequiredValues(){return this.$allow}getGroups(){return this.get(c.GROUPS)}getGroupsName(){return this.get(c.GROUPS_NAME)}getName(){return this.get("name")||((0,e.isClass)(this.#o)?(0,e.nameOf)((0,e.classOf)(this.class)):"")}clone(){return new M(this)}getGenericLabels(){const t=this.get(c.GENERIC_LABELS);if(this.isClass&&!t){const t=(0,e.ancestorOf)(this.class);return t===Object?void 0:M.from(t).getGenericLabels()}return this.get(c.GENERIC_LABELS)}getGenericOf(){return this.get(c.GENERIC_OF)}getRefSchema(){if(!this.isLocalSchema&&this.isClass){const e=M.from(this.class);if(e!==this)return e}}propertyKey(e){return this.#u=e,this}getPropertyKey(){return this.#u}target(e){this.#o="object"===e?Object:e}isRequiredValue(e,t){if(this.isRequired(e)&&[void 0,null,""].includes(t)){const r=this.get("properties")?.[e];if(r)return!r.getAllowedRequiredValues().includes(t)}return!1}setManyOf(e,t){let r=t.filter((e=>!(e&&"type"in e&&"null"===e.type||null===e)||(this.nullable(!0),!1))).map(x);if(!(1!==r.length||t[0]instanceof M||this.isNullable)){if(!r[0].hasDiscriminator)return this.type(t[0]);const e=r[0].discriminator().children();if(!e.length)return this.type(t[0]);r=e.map(x)}super.set(e,r),console.trace(this.get(e));const s=r[0];if(s?.isDiscriminator){const e=s.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t,mapping:r.reduce(((t,r)=>(e.types.get(r.getTarget())?.forEach((e=>{t[e]=r})),t)),{})}),this.isDiscriminator=!0,this.#r=e}}}let _=class extends o{constructor(){super(...arguments),this.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=M.from({type:this.type})}};_=t([a(e.DecoratorTypes.CLASS)],_);const w=e=>Number(e)&&200<=Number(e)&&Number(e)<300,L=e=>Number(e)&&300<=Number(e)&&Number(e)<400;class N extends Map{constructor(e={}){super(),this.$kind="map",this.$isJsonDocument=!0,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 m("map",[this],e)}}var I;function D(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function k(e){return Object.values(I).includes(D(e))}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}(I||(I={}));class j extends N{constructor(e={}){super(e),this.$kind="operationInParameter",this.has("schema")||this.set("schema",new M)}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",D(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return e?(this.set("schema",e),this):this.get("schema")}itemSchema(e){return this.schema().isCollection?(e&&this.schema().itemSchema(e),this.schema().itemSchema()):(e&&this.schema(e),this.schema())}toJSON(e){return m("operationInParameter",[this],e)}}function H(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}),{})}function q(e,t=N){return Object.entries(e).reduce(((e,[r,s])=>(e.set(r,new t(s)),e)),new N)}class G extends N{constructor(e={}){super(e),this.$kind="operationMedia",this.has("schema")||this.set("schema",new M)}schema(e){return e&&this.set("schema",e),this.get("schema")}examples(e){return e&&this.set("examples",e),this}type(t){return t&&((0,e.isArray)(t)?this.schema().oneOf(t.map((e=>({type:e})))):(0,e.isClass)(t)?(this.schema().type("object"),this.schema().itemSchema(t)):this.schema().type(t)),this}}class U extends N{constructor(e={}){super(e),this.$kind="operationResponse",this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",H(e)),this}content(e){return this.set("content",q(e,G)),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 G),this}isBinary(){return this.getContent().has("application/octet-stream")}}class B extends N{constructor(e,t){super(),this.method=e,this.path=t}summary(e){return super.set("summary",e),this}description(e){return super.set("description",e),this}}class K extends N{#p;#h;constructor(e={}){super({parameters:[],responses:new N,...e}),this.$kind="operation",this.operationPaths=new Map,this.#h=!1}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?L(e):this.#h}addResponse(t,r){if((w(t)||L(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 U}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}addAllowedGroupsParameter(e){const t=new j;return t.in("query").name("includes"),t.schema(M.from({type:"array",items:{type:"string",enum:[...e]}})),this.addParameter(-1,t),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){const r=new B(e,t);return this.operationPaths.set(String(e)+String(t),r),r}getAllowedOperationPath(e){return e?[...this.operationPaths.values()].filter((({method:t})=>t&&e.includes(t.toUpperCase()))):[...this.operationPaths.values()]}}let F=class extends o{constructor(t){super({store:e.Store.fromMethod(t.target,t.propertyKey),descriptor:(0,e.descriptorOf)(t.target,t.propertyKey),...t}),this.parent=o.from(this.target),this.middlewares=[],this.beforeMiddlewares=[],this.afterMiddlewares=[],this.operation=new K,this.children=new Map;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}get collectionType(){return this.schema.getTarget()}set collectionType(e){console.trace("collectionType is deprecated, use schema.collectionClass instead")}get isCollection(){return this.schema.isCollection}get schema(){if(this._schema)return this._schema;const e=this.operation.getResponses(),[,t]=[...e.entries()].find((([e,t])=>w(e)))||[];if(t){const e=t.getContent().values().next().value;e&&(this._schema=e.schema())}else this._schema=new M;return this._schema}static get(t,r,s){return s=s||(0,e.descriptorOf)((0,e.prototypeOf)(t),r),o.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.schema().getAllowedGroups();let t=s.schema().getGroups();return r&&e?.size&&(t=[...t||[],...r.filter((t=>e.has(t)))]),{type:s.schema().collectionClass,groups:t}}return{type:this.type||Object}}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(){this.parent.children.set(this.propertyName,this)}};F=t([a(e.DecoratorTypes.METHOD),r("design:paramtypes",[Object])],F);const J=F;let W=class extends o{constructor(e){super(e),this.parameter=new j,this.parent=o.fromMethod(this.target,this.propertyKey),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.getAllowedRequiredValues()}get schema(){return this.parameter.schema()}static getParams(t,r){const s=[],n=(0,e.ancestorsOf)(t).reverse().find((t=>(0,e.isMethodDescriptor)(t,r)&&o.fromMethod(t,r).children.size));return n?(o.fromMethod(n,r).children.forEach(((e,t)=>{s[+t]=e})),s):[]}static get(t,r,s){return o.from((0,e.prototypeOf)(t),r,s)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}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.parent.children.set(this.index,this),this.parent.operation.addParameter(this.index,this.parameter),this.collectionType&&this.parameter.schema().type(this.collectionType),(0,e.isClass)(this._type)?this.parameter.schema().itemSchema(this._type):this.parameter.itemSchema().type(this._type)}};W=t([a(e.DecoratorTypes.PARAM),r("design:paramtypes",[Object])],W);const V=W;let X=class extends o{constructor(){super(...arguments),this.parent=o.from(this.target)}static get(t,r){return o.from((0,e.prototypeOf)(t),r)}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),this.isCollection?(t=M.from({type:this.collectionType}),t.itemSchema(this.type)):(0,e.isClass)(this.type)?(t=M.from({type:"object"}),t.itemSchema(this.type)):t=M.from({type:this.type})),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}};X=t([a(e.DecoratorTypes.PROP)],X);const z=X;function Q(...e){return o.from(...e)}s.set(e.DecoratorTypes.CLASS,_),s.set(e.DecoratorTypes.PROP,X),s.set(e.DecoratorTypes.PARAM,W),s.set(e.DecoratorTypes.METHOD,F);class Y{constructor(e){this.getType=e,this.isLazyRef=!0}get target(){return this.getType()}get schema(){return Q(this.getType()).schema}get name(){return(0,e.nameOf)(this.getType())}}var Z,ee=n(598);function te(t,r,s){const{[t]:n,...i}=r,{[t]:o,...a}=s;let c=!1;const u=[n,i,o,a].flat().filter(Boolean).reduce(((r,s,n)=>{if((s=(0,e.cleanObject)(s)).$ref)return c=!0,r.set(s.$ref,s);if(0===Object.keys(s).length)return r;"object"===s.type&&2===Object.keys(s).length&&("writeOnly"in s||"readOnly"in s||"deprecated"in s)&&(s={...s,type:void 0});const i=function(e){return e.type||e.items&&"array"||(e.properties||e.additionalProperties)&&"object"||"$any"}(s);return"array"===i?(r.set("array_"+n,s),r):r.has(i)?"allOf"===t?(r.set(i,re(r.get(i),s)),r):(r.set(i+"_"+n,s),r):r.set(i,s)}),new Map),p=u.get("$any");u.delete("$any");const h=Array.from(u.values());return(0,e.cleanObject)(h.length>1||c&&p?{...p,[t]:h}:{...p,...h[0]})}function re(t,r){if(t.$ref&&r.$ref&&t.$ref===r.$ref)return t;if(t.allOf||r.allOf)return te("allOf",t,r);if(t.oneOf||r.oneOf){const s=te("oneOf",t,r);return"discriminator"in t||"discriminator"in r?{...s,discriminator:t.discriminator||r.discriminator,required:(0,e.uniq)([...t.required||[],...r.required||[]])}:s}if(t.anyOf||r.anyOf)return te("anyOf",t,r);if(t.$ref||r.$ref)return te("allOf",t,r);const s={...t,...r};var n,i;return(t.properties||r.properties)&&(s.properties=(n=t.properties,i=r.properties,n&&i?[...new Set(Object.keys(n||[]).concat(Object.keys(i||[])))].reduce(((e,t)=>(n?.[t]&&i?.[t]?e[t]=re(n[t],i[t]):n?.[t]?e[t]=n[t]:i?.[t]&&(e[t]=i[t]),e)),{}):n||i||{})),(0,e.isObject)(t.additionalProperties)&&(0,e.isObject)(r.additionalProperties)&&(s.additionalProperties={...t.additionalProperties,...r.additionalProperties}),(t.required||r.required)&&(s.required=(0,e.uniq)([...t.required||[],...r.required||[]])),s}function se(e,t){const{components:r}=t;if(r?.schemas&&e){const s=ne(t),n=e.replace(`${s}/`,"");return r.schemas[n]}}function ne(e){const{host:t="#/"+([Z.OPENAPI,Z.ASYNCAPI].includes(e.specType)?"components/schemas":"definitions")}=e;return t}function ie(e,t){return t.groups&&t.groups.length?(0,ee.pascalCase)(`${e} ${t.groupsName||t.groups.join(" ")}`):e}function oe(e,t,r){return re({$ref:`${ne(r)}/${e}`},{...t.isReadOnly?{readOnly:!0}:{},...t.isWriteOnly?{writeOnly:!0}:{}})}function ae(t,r,s){const n=ie(t.getName(),s);return r&&(0,e.setValue)(s,`components.schemas.${n}`,r),oe(n,t,s)}function ce(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof Y)return m("lazyRef",[e],t);if(e instanceof M&&e.get("enum")instanceof M){const r=e.get("enum");return ae(r,r.toJSON(t),t)}if(e.$kind&&e.$isJsonDocument){const r=m(f([e.$kind,"map"],t),[e],t);return e.canRef?ae(e,r,t):r}return m("object",[e],t)}function ue(t,r){const s=o.from(t.class),n=ie(s.schema.getName()||t.getName(),r);return(0,e.getValue)(r,`components.schemas.${n}`)||((0,e.setValue)(r,`components.schemas.${n}`,{}),r.components.schemas[n]=m("any",[s.schema],{...r,root:!1})),oe(n,t,r)}function pe(t,r,s){if(t.discriminator?.mapping){const r=Object.entries(t.discriminator.mapping),n={};for(const[t,i]of r)n[t]=(0,e.isString)(i)?i:ae(i,null,s).$ref;t.discriminator.mapping=n}return t}function he(e,t,r){return r.inlineEnums&&e.enum?.$isJsonDocument&&(e.enum=e.enum.toJSON().enum),e.enum&&(e.type="object"===e.type||void 0===e.type?"string":e.type),e}function le(t,r,s){if("isLazyRef"in r)return null;if(r.isGeneric){const e=r.get(c.GENERIC_LABEL),t=s.generics?.[e];if(!t)return null;const[n,i]=t,o=M.from(n),a=m("schema",[o],{...s,generics:i});return i||!o.isClass?a:ae(o,a,s)}if(r?.has("items")){const e=le(t,r.get("items"),s);if(e)return{type:"array",items:e}}if(r.has("additionalProperties")&&(0,e.isObject)(r.get("additionalProperties"))){const e=le(t,r.get("additionalProperties"),s);if(e)return{type:"object",additionalProperties:e}}return null}function me(e,t,r){if(t.genericLabels?.length&&t.has("properties")){const s=t.get("properties");let n=!1;const i=Object.entries(s||{}).reduce(((e,[t,s])=>{const i=le(t,s,r);return i&&(e[t]=i,n=!0),e}),{});return n?{allOf:[ae(t,e,r),{properties:i,type:"object"}]}:e}return e}function de(t){const r=t.isStore?t:Q(t);return r.$inherited||(r.$inherited=(0,e.ancestorsOf)(r.target).reverse().reduce(((e,t)=>e.set(t,Q(t))),new Map)),r.$inherited}function fe(e,t){if(t?.type&&t?.$ref){const{$ref:e,...r}=t;t={allOf:[{$ref:e},r]}}return t}function ge(t,{target:r,...s}){const n=Array.from(de(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,m("schema",[r.schema],s),{alter:fe})),{});return(0,e.deepMerge)(r,t,{alter:fe})}return t}function ye(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return oe(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const s=e.getType()&&m("schema",[e.schema],t);return ae(e.schema,s,t)}function Oe(e,{ignore:t=[],...r}={}){return Array.from(e.entries()).reduce(((e,[s,n])=>(t.includes(s)||(e[s]=m("item",[n],r)),e)),{})}function Se(e,t){const r=e.getGenericOf();return{generics:r||t.generics,mapper:r?"schema":"class"}}function be(e,t,r){return!e.isClass||e.isLocalSchema||r?"any":t||"class"}function Re(e,t,r,s){const n=m(be(r,e,s.root),[r],{...s,root:!1,mapper:"next"===e?s.mapper:void 0});let i=m(s.root?"any":e,[t],{...s,root:!1,generics:void 0,mapper:"next"===e?s.mapper:void 0});if((n.$ref||n.allOf)&&i.type&&1===Object.keys(i).length&&(i={}),t.canRef){const e=i.$ref.split("/").pop(),t=s.components.schemas[e];return s.components.schemas[e]=re(n,t),i}return re(n,i)}function Ae(e,t){if(e&&e instanceof M&&!e.isCollection&&e?.itemSchema?.()){const{generics:r,mapper:s}=Se(e,t);return Re("next",e,e.itemSchema(),{...t,generics:r,mapper:s})}return m("next",[e],t)}function Ee(e,t){if(e&&e instanceof M&&!e.isLocalSchema){const r=e.getRefSchema();if(r){let{generics:s,mapper:n}=Se(e,t);return n=be(e,n),Re(n,e,r,{...t,generics:s})}}return m(be(e,t.mapper),[e],{...t,root:!1,mapper:void 0})}!function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3",e.ASYNCAPI="asyncapi2"}(Z||(Z={})),h("any",ce),h("class",ue),h("discriminatorMapping",(function(e){return e.discriminator?.mapping&&delete e.discriminator.mapping,e})),h("enums",he),h("generics",me),h("inheritedClass",ge),h("lazyRef",ye),h("map",Oe),h("item",Ae),h("next",Ee),h("properties",Ee),h("items",Ee),h("additionalProperties",Ee),h("propertyNames",Ee),h("contains",Ee),h("dependencies",Ee),h("patternProperties",Ee),h("additionalItems",Ee),h("not",Ee),h("definitions",Ee);const Te=["oneOf","allOf","anyOf"],Pe=["minLength","maxLength","pattern","format"],ve=[],Ce=["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf"],xe=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains"],$e=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains","patternProperties","dependencies"],Me=["const","enum"];function _e(t,r){return!r?.isNullable||t.discriminator?t:t.$ref?(0,e.cleanObject)({...t,$ref:void 0,oneOf:[{type:"null"},{$ref:t.$ref}]}):"array"===t.type?{oneOf:[{type:"null"},t]}:t.oneOf||t.anyOf||t.allOf?(Te.some((r=>{if(t[r])if(t[r]=t[r].filter((e=>"null"!==e.type)),1===t[r].length){const s=t[r];t=(0,e.cleanObject)({...t,...s[0],[r]:void 0,type:["null",Number.isInteger(t.multipleOf)?"integer":s[0].type]})}else t[r]=[{type:"null"}].concat(t[r]).map((e=>(Number.isInteger(e.multipleOf)&&(e.type="integer"),e))),delete t.type})),t):(t.type&&(t.type=(0,e.uniq)([].concat("null",t.type))),t)}function we(t,r){if((0,e.isBoolean)(t.$ignore)&&t.$ignore)return!0;let s=t?.$hooks?.alter("ignore",!1,[r]);return s||(!1!==r.groups?t?.$hooks?.alter("groups",!1,[r.groups]):s)}function Le(t,r){const{specType:s,operationIdFormatter:n,root:i,components:o,useAlias:a,...u}=r;return Object.entries(t).reduce(((e,[s,n])=>{if(!1!==r.withIgnoredProps&&!we(n,u)){const i={...r,parent:n,groups:t?.get?.(c.FORWARD_GROUPS)||n?.get?.(c.FORWARD_GROUPS)?r.groups:void 0};if(e[s]=m("item",[n],i),e[s]=m("nullable",[e[s],n],i),n.isGeneric&&e[s]?.type){const{type:t,...r}=e[s];e[s]=r}}return e}),(0,e.isArray)(t)?[]:{})}function Ne(e,t){return e.map((e=>m("item",[e],t)))}function Ie(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function De(t,r,s){if(s.groups&&s.groups?.includes("partial"))return t.discriminator?{...t,required:[t.discriminator.propertyName]}:t;let n=function(t,r,s){let n=t.required||[];return n=[...n,...r.getRequiredFields()],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)),Ie((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(e,r)=>{const i=s&&t.alias.get(r)||r;return n.includes(i)?e.concat(i):e}}(t,r,s),[]),t.discriminator&&n.push(t.discriminator.propertyName),n.length&&(t.required=n),t}function ke(e,t){return Object.entries(e).reduce(((e,[r,s])=>(e[r=t.get(r)||r]=s,e)),{})}h("nullable",_e),h("object",Le),h("anyOf",Ne),h("allOf",Ne),h("oneOf",Ne),h("required",De);const je={string:{properties:Pe,is:e.isString},number:{properties:Ce,is:e.isNumber},boolean:{properties:ve,is:e.isBoolean},array:{properties:xe,is:()=>!1},object:{properties:$e,is:()=>!1}};function He(e,t,r){const s=function(e){return Te.find((t=>e[t]))}(e);return s&&(e[s].forEach((t=>{!function(e,t,r){const s=je[e];s?.properties.concat(Me).forEach((e=>{void 0!==t[e]&&(Me.includes(e)?r[e]=t[e].filter(s.is):(r[e]=t[e],delete t[e]))}))}(t.type,e,t)})),Te.forEach((s=>{e[s]&&!1!==r.groups&&t.$hooks.has(s)&&(e={...e,[s]:t.$hooks.alter(s,e[s],[r.groups])})})),delete e.const,delete e.enum,e.items||e.properties||delete e.type),e}const qe=["name","$required","$hooks","_nestedGenerics",Z.OPENAPI,Z.SWAGGER,Z.JSON],Ge=[];function Ue(t,r){const{options:s,addDef:n}=function(e){let t=!1;e||(t=!0,e={components:{schemas:{}},inlineEnums:!0});const{useAlias:r=!0,components:s={schemas:{}}}=e;return{addDef:t,options:e={...e,useAlias:r,components:s}}}(r),i=function(t,r){let s=function(t,r){const{useAlias:s}=r;return[...t.keys()].filter((e=>!function(e,{specType:t=Z.JSON,customKeys:r=!1}){return qe.includes(e)||e.startsWith("x-")||e.startsWith("#")&&(!r||t!==Z.JSON)||t!==Z.JSON&&Ge.includes(e)}(e,r))).reduce(((n,i)=>{let o=t.get(i);if("type"===(i=i.replace(/^#/,"")))return n[i]=t.getJsonType(),n;if(function(t,r,s){return"examples"===t&&(0,e.isObject)(r)&&[Z.OPENAPI,Z.ASYNCAPI].includes(s.specType)}(i,o,r)&&(i="example",o=Object.values(o)[0]),o&&"object"==typeof o&&d(i)){if(o=m(i,[o],r,t),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(i,o))return n;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(i,o,s)&&(o=ke(o,t.alias))}return n[i]=o,n}),{})}(t,r);return t.isClass&&!t.isLocalSchema&&(s=m("inheritedClass",[s],{...r,root:!1,target:t.class})),t.has(r.specType)&&(s={...s,...t.get(r.specType).toJSON(r)}),(0,e.isFunction)(s.default)&&(s.default=s.default()),s=m("required",[s,t],r),s=m("nullable",[s,t],r),s=He(s,t,r),s=m("enums",[s,t],r),s=m("discriminatorMapping",[s,t],r),s=m("generics",[s,t],r),"array"!==s.type||s.items||s.contains||(s.items={}),s}(t,s);return n&&Object.keys((0,e.getValue)(s,"components.schemas",{})).length&&(i.definitions=s.components.schemas),i}function Be(e,t,r){return(e=he(e,0,r)).const&&(e.enum=[e.const],delete e.const),e}function Ke(t,r){const s={paths:m("paths",[t],r={...r,specType:Z.OPENAPI})};return s.tags=(0,e.uniqBy)(r.tags,"name"),Object.keys((0,e.getValue)(r,"components.schemas",{})).length&&(s.components={schemas:r.components.schemas}),s}function Fe(t,r,s){if(!r?.isNullable)return t;if("3.1.0"===s.specVersion)return _e(t,r);if(t.$ref)return(0,e.cleanObject)({...t,nullable:!0});function n(r){return 1===t[r]?.length?(0,e.cleanObject)({...t[r][0],[r]:void 0,type:Number.isInteger(t.multipleOf)?"integer":t[r][0]?.type}):(0,e.cleanObject)({type:t[r]?.length>1?void 0:t.type,[r]:t[r]?.map((e=>(Number.isInteger(e.multipleOf)&&(e.type="integer"),e)))})}return(0,e.cleanObject)({...t,...n("oneOf"),...n("anyOf"),nullable:!0})}function Je(t,{jsonSchema:r}){const s={type:"string",format:"binary",oneOf:void 0};return"array"===r.type?(r.items=(0,e.cleanObject)({...r.items,...s}),t.schema=r,t):(t.schema=(0,e.cleanObject)({...r,...s}),t)}function We(e,t){const r=function(e,t={}){return{...t,groups:e.schema().getGroups(),groupsName:e.schema().getGroupsName()}}(e,t),s={...r.components?.schemas||{}},{type:n,schema:i,...o}=m("map",[e],r),a=m("item",[e.schema()],r);o.required=o.required||e.get("in")===I.PATH;const c={...r,jsonSchema:a,jsonParameter:e,oldSchemas:s},u=(0,ee.camelCase)(`operationIn ${e.get("in")}`);return d(u)?m(u,[o],c):(o.schema=a,o)}function Ve(e,t){return e.flatMap((e=>m("operationInParameter",[e],t))).filter(Boolean)}function Xe(e,t){if(!t)return;let r=!1;const s=Object.entries(t).reduce(((t,[s,{value:n,description:i,...o}])=>void 0===n[e]?t:(r=!0,{...t,[s]:{...o,value:n[e],description:i}})),{});return r?s:void 0}function ze(t,{jsonSchema:r,...s}){if(r.$ref){if(!t.name)return function(t,{jsonParameter:r,...s}){const n=ie(r.schema().itemSchema().getName(),s),i=s.components?.schemas?.[n];return i&&!s.oldSchemas?.[n]&&delete s.components?.schemas?.[r.schema().itemSchema().getName()],Object.entries(i?.properties||{}).reduce(((r,[n,{description:o,...a}])=>{const c=t.style||a.$ref&&!se(a.$ref,s)?.enum?"deepObject":void 0;return r.push((0,e.cleanObject)({...t,style:c,explode:"deepObject"===c||t.explode,name:n,required:(i?.required||[]).includes(n),description:o,schema:a,examples:Xe(n,t.examples)})),r}),[])}(t,s);se(r.$ref,s)?.enum||(t.style="deepObject",t.explode=!0)}return t.schema=r,t}h("schema",Ue),h("discriminatorMapping",pe,Z.OPENAPI),h("discriminatorMapping",pe,Z.SWAGGER),h("discriminatorMapping",pe,Z.ASYNCAPI),h("enums",Be,Z.OPENAPI),h("enums",Be,Z.SWAGGER),h("enums",Be,Z.ASYNCAPI),h("generate",Ke,Z.OPENAPI),h("generate",Ke,Z.SWAGGER),h("nullable",Fe,Z.OPENAPI),h("nullable",Fe,Z.SWAGGER),h("operationInFiles",Je),h("operationInParameter",We),h("operationInParameters",Ve),h("operationInQuery",ze);var Qe=n(203),Ye=n.n(Qe);const Ze=Ye().codes.reduce(((e,t)=>{const r=String(Ye()(t));return{...e,[String(t)]:{label:r,code:(0,ee.constantCase)(r)}}}),{});function et(e){return Ze[e]?.code}function tt(e){return Ze[e]?.label}function rt(e,{tags:t=[],defaultTags:r=[],...s}={}){const{consumes:n,produces:i,...o}=m("map",[e],{...s,ignore:["parameters"]});o.security&&(o.security=[].concat(o.security)),0===e.get("responses").size&&(o.responses={200:{description:tt(200)}});const a={...s,consumes:e.get("consumes")?.length?e.get("consumes"):["application/json"]},[c,u]=function(e,t){return e.get("parameters").filter((e=>k(e.get("in")))).reduce(((e,t)=>{const[r,s]=e;return[I.BODY,I.FILES].includes(t.get("in"))?[r,[...s,t]]:[[...r,t],s]}),[[],[]])}(e);o.parameters=m("operationInParameters",[c],s),u.length&&(o.requestBody=m("operationRequestBody",[u],a));const p=o.tags?.length?o.tags:r;return p.length&&(o.tags=p.map((({name:e})=>e))),t.push(...p),o}function st(e,t){return m("map",[e],{...t,groups:[...e.schema().getGroups()||[]],groupsName:e.schema().getGroupsName()})}Ze[200].label="Success",Ze[200].code="SUCCESS",h("operation",rt),h("operationMedia",st);class nt extends N{constructor(e={}){super(e),this.$kind="operationRequestBody",this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",q(e)),this}addContent(e,t,r){const s=this.get("content"),n=new N;return n.set("schema",t),r&&n.set("examples",r),s.set(e,n),this}required(e){return this.set("required",e),this}}function it(e,{consumes:t,...r}){const{schema:s,description:n,examples:i,in:o,...a}=function(e,t){let r=new M;const s={},n=[];let i=0;const o=e.some((e=>"files"===e.get("in")));return e.forEach((e=>{const a=e.getName();[...e.entries()].filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===s[e]&&(s[e]=t)}));const c=m("operationInParameter",[e],t);if(a){const t={...c.schema||{type:c.type}};o&&c.description&&(t.description=c.description),r.addProperty(a,t),e.get("required")&&r.addRequired(a),i++}else n.push(c)})),i||1!==n.length?(r.type("object"),s.description&&o&&delete s.description,{required:!1,...s,schema:r.toJSON(t)}):n[0]}(e,r),c=new nt(a);return n&&c.description(n),t.forEach((e=>{c.addContent(e,s,i)})),m("map",[c],r)}function ot(e,t={}){const r=m("map",[e],t);return 204===e.status&&delete r.content,r.headers&&Object.entries(r.headers).forEach((([e,{type:t,...s}])=>{r.headers[e]={...s,schema:{type:t}}})),r}var at;h("operationRequestBody",it),h("operationResponse",ot),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.TRACE="TRACE",e.PUBLISH="PUBLISH",e.SUBSCRIBE="SUBSCRIBE",e.CUSTOM="CUSTOM"}(at||(at={}));const ct=[at.ALL,at.GET,at.POST,at.PUT,at.PATCH,at.HEAD,at.DELETE,at.OPTIONS,at.TRACE,at.CUSTOM],ut=[at.PUBLISH,at.SUBSCRIBE],pt=at;function ht(e){return e.split("/").filter(Boolean).join("/")}function lt(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 mt(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)}]}class dt extends Map{constructor(){super(...arguments),this.$kind="operationPaths",this.$isJsonDocument=!0,this.getKey=(e,t)=>`${e}-${t}`}setOperationPath(e){const t=this.getKey(e.method,e.path);this.set(t,e)}}function ft(e){const t=e.isStore?e:Q(e);if(!t.$operations){const e=new dt;t.$operations=new Map,de(t).forEach((e=>{e.children.forEach((e=>{e instanceof F&&!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 gt(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?(0,ee.camelCase)(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),(0,ee.camelCase)(`${i} By ${a}`)}const c=t.get(o)+1;return t.set(o,c),`${i}_${c}`}}function yt(e,{store:t,operationIdFormatter:r}){return r(t.parent.schema.get("name")||t.parent.targetName,t.propertyName,e)}function Ot(e){return!e.store.get("hidden")}const St=[at.ALL,at.GET,at.POST,at.PUT,at.PATCH,at.HEAD,at.OPTIONS,at.DELETE,at.TRACE];function bt(e,{path:t,method:r,operation:s}){return{...e,[t]:{...e[t],[r.toLowerCase()]:s}}}function Rt(e,{paths:t,rootPath:r,...s}){const n=ht(r+Q(e).path);return s={...s,ctrlRootPath:n},[...ft(e).values()].filter(Ot).filter((e=>e.operation.getAllowedOperationPath(St).length>0)).flatMap(function(e){return t=>{const r=t.operation.getAllowedOperationPath(St);if(0===r.length)return[];const s=m("operation",[t.operation],e);return r.map((e=>({operationPath:e,operation:s,operationStore:t})))}}(s)).flatMap(function(e){return({operationPath:t,operation:r,operationStore:s})=>{const{path:n,method:i}=t;return mt(e.ctrlRootPath,n).map((({path:n,parameters:o})=>(n=n||"/",o=lt(o.map((({type:e,...t})=>({...t,schema:{type:e}}))),r),{operation:{...r,...t.toJSON(e),parameters:o,operationId:r.operationId||yt(n,{...e,store:s})},method:i,path:n})))}}(s)).reduce(bt,t)}function At(e){return(...t)=>{const r=e(Q(...t),t);"function"==typeof r&&r(...t)}}function Et(...t){return At((r=>{r.store.set("childrenControllers",t),t.forEach((t=>{e.Store.from(t).set("parentController",r.token)}))}))}function Tt(e,...t){return At((r=>{e=e||(0,ee.snakeCase)(r.targetName),r.discriminatorAncestor&&r.schema.discriminatorValue(e,...t)}))}function Pt(t,r){if(!t)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 s={};let n=!1;const i=[],a=(...a)=>{const c=o.from(...a);r&&(c.collectionType=r,c.schema.type(r)),c.type=t,c.itemSchema.type(t),c.schema.assign(s),i.length&&(c.is(e.DecoratorTypes.PARAM)?c.parameter.itemSchema().genericOf(...i):c.itemSchema.genericOf(...i)),c.isArray&&n&&(c.schema.set("contains",c.schema.get("items")),c.schema.delete("items"))};return a.MinItems=e=>(s.minItems=e,a),a.MaxItems=e=>(s.maxItems=e,a),a.MinProperties=e=>(s.minProperties=e,a),a.MaxProperties=e=>(s.maxProperties=e,a),a.Contains=()=>(n=!0,a),a.UniqueItems=(e=!0)=>(s.uniqueItems=e,a),a.Nested=(...e)=>(i.push(e),a),a}function vt(e){return Pt(e,Array)}function Ct(e){return Pt(e,Map)}function xt(e){return Pt(e).Contains()}function $t(t,r){const s={};return(...n)=>{const i=(0,e.useDecorators)(r(...n));return i.Error=r=>(s.message=r,(0,e.useDecorators)(i,s.message&&At((s=>{const n=s.parentSchema.get("#errorMessage")||{};"required"===t?s.parentSchema.customKey("errorMessage",(0,e.deepMerge)(n,{[t]:{[s.propertyName]:r}})):s.itemSchema.customKey("errorMessage",(0,e.deepMerge)(n,{[t]:r}))})))),i}}h("paths",Rt);const Mt=$t("maxItems",(e=>{if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return At((t=>{t.schema.maxItems(e)}))})),_t=$t("maxProperties",(e=>{if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return At((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))})),wt=$t("minItems",(e=>{if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return At((t=>{t.schema.minItems(e)}))})),Lt=$t("minProperties",(e=>{if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return At((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))})),Nt=$t("uniqueItems",((e=!0)=>At((t=>{t.schema.uniqueItems(e)}))));function It(e){return At(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function Dt(...e){return At((t=>{t.itemSchema.allOf(e)}))}function kt(t){return At((r=>{t&&(((0,e.isClass)(t)||(0,e.isArrowFn)(t))&&(r.type=t),r.itemSchema.type(t))}))}function jt(...t){const r=t.find((t=>(0,e.isClass)(t)));return(0,e.useDecorators)(r&&kt(r),At(((r,s)=>{r.decoratorType===e.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===e.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName),r.schema.allow(...t)})))}function Ht(...e){return At((t=>{t.itemSchema.any(...e)}))}function qt(...e){return At((t=>{t.itemSchema.anyOf(e)}))}function Gt(e){return At((t=>{t.itemSchema.const(e)}))}function Ut(e,t){return At((r=>{r.itemSchema.customKey(e,t)}))}function Bt(e){return At((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function Kt(e){return At((t=>{t.itemSchema.default(e)}))}function Ft(e){return At((t=>{const r=t.parentSchema.get("#errorMessage")||{};t.parentSchema.customKey("errorMessage",{...r,...e})}))}function Jt(t){return(0,e.useDecorators)(Ft({_:t}))}function Wt(t){return At(((r,s)=>{r.is(e.DecoratorTypes.PROP)||r.is(e.DecoratorTypes.CLASS)?r.schema.description(t):r.is(e.DecoratorTypes.PARAM)?r.parameter.description(t):r.is(e.DecoratorTypes.METHOD)&&r.operation?.description(t)}))}function Vt(){return(0,e.useDecorators)(kt(),At((e=>{e.parent.schema.discriminatorKey(String(e.propertyKey))})))}const Xt=$t("enum",(function(e,...t){return At((r=>{r.itemSchema.enum(e,...t)}))}));function zt(...e){return At((t=>{t.schema.examples(e)}))}function Qt(e){return At((t=>{t.parameter.examples(e)}))}const Yt=$t("maximum",((e,t=!1)=>At((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)})))),Zt=Yt,er=$t("exclusiveMaximum",((e,t=!0)=>Yt(e,t))),tr=$t("minimum",((e,t=!1)=>At((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)})))),rr=tr,sr=$t("exclusiveMinimum",((e,t=!0)=>tr(e,t)));var nr;!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"}(nr||(nr={}));const ir=$t("format",(e=>At((t=>{t.itemSchema.format(e)})))),or=$t("format",(()=>ir(nr.EMAIL))),ar=$t("format",(()=>ir(nr.DATE_TIME))),cr=$t("format",(()=>ir(nr.DATE))),ur=$t("format",(()=>ir(nr.TIME))),pr=$t("format",(()=>ir(nr.URI))),hr=$t("format",(()=>ir(nr.URL)));function lr(e=!0){return At((t=>{t.schema.forwardGroups(e)}))}function mr(...t){return At((r=>{if(r.is(e.DecoratorTypes.CLASS))!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{mr(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(t,r);else if(r.is(e.DecoratorTypes.PROP))r.schema.groups(t,!0);else if(r.is(e.DecoratorTypes.PARAM)){let s="";2==t.length&&(0,e.isArray)(t[1])&&(s=t[0],t=t[1]),r.parameter.schema().groups(t).groupsName(s)}}))}function dr(){return(0,e.StoreSet)("hidden",!0)}function fr(e=!0){return At((t=>{t.schema.ignore(e)}))}function gr(){return At((e=>{e.itemSchema.type("integer")}))}function yr(e,t=!1){return At((r=>{t?r.schema.label(e):r.itemSchema.label(e)}))}const Or=$t("maxLength",(e=>{if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return At((t=>{t.itemSchema.maxLength(e)}))})),Sr=$t("minLength",(e=>{if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return At((t=>{t.itemSchema.minLength(e)}))})),br=$t("multipleOf",(e=>{if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return At((t=>{t.itemSchema.multipleOf(e)}))}));function Rr(t){return At(((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 Ar(t=Object){if((0,e.isClass)(t)){const{schema:e}=Q(t);return e.properties=function(e){return Object.entries(e).forEach((([e,r])=>{Q(t.prototype,e).schema.assign(r)})),this},e}return M.from({type:t})}function Er(){return Ar(Array)}function Tr(){return Ar(Map).unknown(!0)}function Pr(){return Ar(Array).uniqueItems(!0)}function vr(...e){return At((t=>{t.schema.oneOf(e)}))}function Cr(t,...r){return r=[t,...r],t===Array?At((e=>{e.schema.assign(Er().items({}).$comment("Warning: you should not use @Nullable(Array), which leads to an incorrect schema. Use @Schema(array().items().nullable()) instead").nullable(!0))})):(0,e.useDecorators)(1===r.length&&!(t instanceof M)&&kt(r[0]),vr(null,...r))}function xr(){return At((t=>{switch(t.decoratorType){case e.DecoratorTypes.PARAM:t.required=!1;break;case e.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName)}}))}const $r=$t("pattern",(e=>At((t=>{t.itemSchema.pattern(e)}))));function Mr(e=!0){return At((t=>{t.itemSchema.readOnly(e)}))}function _r(e){return At((t=>{t.schema.assign(e)}))}function wr(e,t){return At((r=>{r.schema.set(e,t)}))}function Lr(e,...t){return _r({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}const Nr=$t("required",((e=!0,...t)=>e?jt(...t):xr()));function Ir(...e){return At((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,s)=>A(e,s)?r.filter((e=>e!==t.propertyKey)):r))}))}function Dr(e){return At((t=>{t.schema.title(e)}))}function kr(t){return At((()=>(0,e.useDecorators)(Ft({type:t}))))}function jr(e=!0){return At((t=>{t.itemSchema.writeOnly(e)}))}function Hr(...t){const r=[t],s=(...t)=>{const s=o.from(...t);s.is(e.DecoratorTypes.PARAM)?s.parameter.schema().genericOf(...r):s.schema.genericOf(...r)};return s.Nested=(...e)=>(r.push(e),s),s}function qr(...e){return t=>{o.from(t).schema.genericLabels(e)}}function Gr(...t){return At(((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)}}))}function Ur(...t){return(0,e.useDecorators)(Gr(...t),(0,e.StoreSet)("acceptMimes",t))}class Br extends Map{constructor(e={}){super(),this.actions=[],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[(0,ee.pascalCase)(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=o.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 Kr=new Map;function Fr(e,t){Kr.set(e,t)}function Jr(e){return Kr.get(e)}class Wr extends Br{constructor({status:e,model:t}){super(),this.methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","label","groups","allowedGroups","location","binary"],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&&tt(e)&&!this.get("description")&&(this.set("description",tt(e)),this.get("model")||this.model(Jr(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...H(e)}),this}header(t,r){return void 0===r&&(0,e.isString)(t)?this.headers({[t]:{type:"string"}}):this.headers({[t]:r})}location(e,t={}){return this.get("model")||this.model(String),this.headers({Location:{...t,value:e}}),this}groups(...t){return 2===t.length&&(0,e.isArray)(t[1])?(this.set("groupsName",t[0]),this.set("groups",t[1])):this.set("groups",t),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=>{const r=t.get("generics")||[];r.push(e),t.get("schema").genericOf(...r)})),this}of(...t){const r=this.get("model");return this.checkPrimitive(r),this.addAction((()=>{const s=this.get("schema");s&&((0,e.isCollection)(r)?s.itemSchema({type:t[0]}):(this.set("generics",[t]),s.genericOf(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({label:e})}label(e){return this.schema({label:e})}binary(){return this.type(String),this.set("contentType","application/octet-stream"),this.schema({format:"binary"}),this}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)||this.hasOfTypes)&&(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=o.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{decoratorType:t}=this,r=this.entity.operation,s=this.getStatus(),n=r.ensureResponseOf(s),i=this.getContentType();let{description:o=n.get("description")}=this.toObject();o&&(o=t===e.DecoratorTypes.CLASS&&n.get("description")||o,n.description(o));const a=this.getMergedKey("headers",n.get("headers"));return a&&n.headers(a),this.mapMedia(n),i&&r.addProduce(i),this.runActions()}mapMedia(e){const t=this.getContentType(),r=this.get("allowedGroups"),{operation:s}=this.entity,n=e.getMedia(t||"*/*"),i=n.type(this.get("model")).examples(this.get("examples")).schema().groups(this.get("groups")).groupsName(this.get("groupsName")).allowedGroups(r);return this.set("schema",i),r&&s.addAllowedGroupsParameter(r),n}manyOf(t,r){const s=this.get("model");return this.hasOfTypes=!0,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 Vr(e,t){return new Wr({status:e,model:t}).build()}function Xr(e){return Vr().ContentType(e)}function zr(t=!0){return At(((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],zr(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(zr,s)}}))}function Qr(t,r){return void 0!==r&&(t={[t]:r}),void 0===r&&(0,e.isString)(t)&&(t={[t]:{type:"string"}}),Vr().Headers(t)}function Yr(t){const r=new j,s={},n=(i,a,c)=>{const u=o.from(i,a,c);switch(u.decoratorType){case e.DecoratorTypes.PARAM:u.parameter.in(t);break;case e.DecoratorTypes.METHOD:r.in(t),u.operation.addParameter(-1,r),r.schema(M.from(s));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(i,n);break;default:throw new e.UnsupportedDecoratorType(Yr,[i,a,c])}};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.toJSON?e.toJSON():e),n),n}function Zr(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)(Yr(I.FILES),Rr(a),(0,e.useMethodDecorators)(Vr(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 es(e,t){return Vr().Location(e,t)}const ts=new Set([...Object.keys(at).filter((e=>e!==at.CUSTOM)).map((e=>e.toLowerCase()))]);function rs(e){let t,r;const s=e.filter((e=>"string"==typeof e&&ts.has(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:s}}class ss extends Br{constructor(){super(...arguments),this.methods=["name","description","summary","method","id","use","useAfter","useBefore"]}beforeInit(){const e=this.get("path"),t=at[this.get("method")]||at.CUSTOM;e&&(this.operationPath=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 this.operationPath?.summary(t),void this.entity.operation.summary(t);case"description":return this.operationPath?.description(t),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 ns(...e){const t=rs(e);return new ss(t).build()}function is(t){return At(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(is,s);r.operation.operationId(t)}))}function os(t,r="/"){return At(((s,n)=>{if(s.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(os,n);s.operation.addOperationPath(t.toUpperCase(),r)}))}function as(){return mr("partial")}function cs(t){return At(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.CLASS)throw new e.UnsupportedDecoratorType(cs,s);r.path=t}))}function us(...t){return At(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.produces(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],us(...t));break;default:throw new e.UnsupportedDecoratorType(us,s)}}))}function ps(e){return ns(at.PUBLISH,e)}function hs(...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)(Vr(r,String).Location(s,n),At((e=>{e.operation?.setRedirection(r)})))}const ls=ns;function ms(e="/",...t){return ns(...[at.ALL,e].concat(t))}function ds(e="/",...t){return ns(...[at.GET,e].concat(t))}function fs(e="/",...t){return ns(...[at.POST,e].concat(t))}function gs(e="/",...t){return ns(...[at.PUT,e].concat(t))}function ys(e="/",...t){return ns(...[at.DELETE,e].concat(t))}function Os(e="/",...t){return ns(...[at.HEAD,e].concat(t))}function Ss(e="/",...t){return ns(...[at.PATCH,e].concat(t))}function bs(e="/",...t){return ns(...[at.OPTIONS,e].concat(t))}function Rs(t,...r){return At(((s,n)=>{switch(s.decoratorType){case e.DecoratorTypes.METHOD:Array.isArray(t)?s.operation.security(t):s.operation.addSecurityScopes(t,r);break;case e.DecoratorTypes.CLASS:Array.isArray(t)?(0,e.decorateMethodsOf)(n[0],Rs(t)):(0,e.decorateMethodsOf)(n[0],Rs(t,...r));break;default:throw new e.UnsupportedDecoratorType(Rs,n)}}))}function As(e,t){return Vr(e,t)}function Es(e){return ns(at.SUBSCRIBE,e)}function Ts(t){return At(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Ts,s);r.operation.summary(t)}))}function Ps(...t){return At(((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],Ps(...t));break;default:throw new e.UnsupportedDecoratorType(Ps,s)}}))}function vs(t,r){return(0,e.StoreSet)("view",{path:t,options:r})}function Cs(e){return[...e.operationPaths.values()].map((({method:e,path:t})=>({method:e,path:t})))}function xs(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 $s{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 xs(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 Ms(...e){return Ar().allOf(e)}function _s(...e){return Ar().any(...e)}function ws(...e){return Ar().anyOf(e)}function Ls(){return Ar(Boolean)}function Ns(){return Ar(Date).format(nr.DATE)}function Is(){return Ar(Date).format(nr.DATE_TIME)}function Ds(){return Ar(Date).format(nr.TIME)}function ks(){return Ar(String)}function js(){return ks().format(nr.EMAIL)}function Hs(e){const t=ks().enum(e);return u.set(e,t),t}function qs(){return Ar(Number).integer()}function Gs(e){try{if(e())return o.from(e()).schema}catch(e){}return new Y(e)}function Us(){return Ar(Number)}function Bs(e={}){return Ar(Object).properties(e)}function Ks(...e){return Ar().oneOf(e)}function Fs(){return ks().format(nr.URI)}function Js(){return ks().format(nr.URL)}const Ws={allOf:Ms,anyOf:ws,boolean:Ls,array:Er,map:Tr,set:Pr,date:Ns,datetime:Is,time:Ds,email:js,enums:Hs,integer:qs,number:Us,lazyRef:Gs,object:Bs,oneOf:Ks,string:ks,uri:Fs,url:Js},Vs=(0,e.mergeReducerBuilder)(((e,t)=>e.type&&e.type&&e.type===t.type&&"array"===t.type?JSON.stringify(e.items)===JSON.stringify(t.items):e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),Xs=(0,e.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),zs=(0,e.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),Qs=(0,e.mergeReducerBuilder)(((e,t)=>e.name===t.name)),Ys={security:zs,parameters:Xs,oneOf:Vs,anyOf:Vs,allOf:Vs,tags:Qs};function Zs(t,r){return(0,e.deepMerge)(t,r,{reducers:Ys,cleanUndefinedProps:!0})}const en=new Map;function tn(t,r={}){if(r={specType:Z.OPENAPI,...r,tags:[],paths:{},channels:{},components:{},operationIdFormatter:r.operationIdFormatter||gt(r.operationIdPattern),root:!1},(0,e.isArray)(t)){let e={};return r={...r,append(t){e=Zs(e,t)}},t.forEach((({token:e,...t})=>{const s=tn(e,{...r,...t});r.append(s)})),e}return function(e,t,r){en.has(e)||en.set(e,new Map);const s=en.get(e),n=JSON.stringify(t);return s.has(n)||s.set(n,r()),s.get(n)}(t,r,(()=>function(t,r){const s=Q(t),{rootPath:n="/"}=r;return r={...r,rootPath:n,defaultTags:[(0,e.cleanObject)({name:s.schema.getName(),description:s.schema.get("description")})]},m("generate",[s],r)}(t,r)))}function rn(e){return e.startsWith("3.")?Z.OPENAPI:Z.SWAGGER}function sn(e){return"openapi"in e?Z.OPENAPI:Z.SWAGGER}function nn(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 on(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:g,externalDocs:y}=t;return{swagger:s,consumes:(0,e.uniq)([...n,...h]),produces:(0,e.uniq)([...l]),info:nn((0,e.getValue)(t,"info",{})),paths:i,host:c,basePath:u,schemes:p,definitions:m,parameters:d,responses:f,security:o,securityDefinitions:g,tags:a,externalDocs:y}}function an(t,{specVersion:r}){const{servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}=t;return{openapi:r,info:nn((0,e.getValue)(t,"info",{})),servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}}function cn(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(rn(n)){case Z.OPENAPI:t=an(t,o),r=r?an(r,o):r;break;default:case Z.SWAGGER:t=on(t,o),r=r?on(r,o):r}return t=Zs(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 un=["get","put","post","delete","options","head","patch","trace"],pn=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],hn=["type","items"],ln=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,mn={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function dn(e){if(Array.isArray(e))e.forEach(dn);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):dn(e[t])}function fn(e){return new RegExp(ln,"i").test(e)}function gn(e){const t=Object.keys(mn).map((e=>mn[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||fn(e)))}function yn(e){return Object.entries(e).reduce(((e,[t,r])=>{const s=function(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}}}(r);return s&&(e[t]=s),e}),{})}function On(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 Sn{constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?On(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,dn(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(un.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=gn(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=gn(t)[0],delete i.content,[mn.APPLICATION_X_WWW_URLENCODED,mn.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,pn),this.copySchemaProperties(t,hn),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&&fn(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=yn(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function bn(e){return new Sn(e).convert()}function Rn({tokens:t,...r}){const{version:s="1.0.0",acceptMimes:n,fileSpec:i={},specVersion:o}=r,a=cn((0,e.getValue)(r,"spec",{}),{fileSpec:i,version:s,specVersion:o,acceptMimes:n}),c=sn(a),u=Zs(a,tn(t,r));return r.sortPaths&&(u.paths=Object.fromEntries(Object.entries(u.paths).sort((([e],[t])=>e.localeCompare(t))))),c===Z.SWAGGER?bn(u):u}const An=new Map;function En(t,r={}){const s=r.specType||Z.JSON;return function(t,r){const s=An.get(t)||new Map;An.set(t,s);const n=function(t){return JSON.stringify(t,((t,r)=>r&&!(0,e.isPlainObject)(r)&&(0,e.isClass)(r)?(0,e.nameOf)(r):r))}(r);if(!s.has(n)){const i=Q(t);let o="schema";i instanceof W&&(r={...r,root:!0,groups:i.schema.getGroups()},o="item");const a=m(o,[i.schema],r);Object.keys((0,e.getValue)(r,"components.schemas",{})).length&&(a.definitions=r.components.schemas),s.set(n,a)}return s.get(n)}(t,r={endpoint:!0,groups:[],inlineEnums:s===Z.JSON,...r,specType:s,components:{schemas:{}}})}function Tn(e,t={}){const r=e.isStore?e:Q(e),s=xs(t.basePath,r.path);let n=[];return t.withChildren&&(n=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(Tn(r,{...t,basePath:s}))),n)),[...ft(e).values()].reduce(((r,n)=>{const{operation:i}=n;return i&&i.getAllowedOperationPath(t.allowedVerbs).forEach((t=>{r.push(new $s({basePath:s,token:e,endpoint:n,operationPath:t}))})),r}),n)}function Pn(e){const t=e.isStore?e:Q(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 vn(e,t={}){const r=Pn(e),s=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&we(e.itemSchema,t)||s.set(r,e)})),s}})(),i})()));
|
|
3
3
|
//# sourceMappingURL=schema.umd.min.js.map
|