@sybelblue/prairielearn-navigator 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -0
- package/dist/index.js +1 -1
- package/dist/shared.js +1 -0
- package/package.json +6 -3
- package/dist/cli.cjs +0 -8
- package/dist/core/config.d.ts +0 -94
- package/dist/core/course.d.ts +0 -7
- package/dist/core/courseFiles.d.ts +0 -14
- package/dist/core/diagnostic.d.ts +0 -38
- package/dist/core/html.d.ts +0 -20
- package/dist/core/json.d.ts +0 -32
- package/dist/core/plVersion.d.ts +0 -23
- package/dist/core/questionDirs.d.ts +0 -13
- package/dist/core/questionPaths.d.ts +0 -10
- package/dist/core/referenceIndex.d.ts +0 -71
- package/dist/core/references/bases.d.ts +0 -13
- package/dist/core/references/extract.d.ts +0 -34
- package/dist/core/references/specs.d.ts +0 -272
- package/dist/core/rules/impls.d.ts +0 -18
- package/dist/core/rules/registry.d.ts +0 -32
- package/dist/core/rules/run.d.ts +0 -27
- package/dist/core/rules/types.d.ts +0 -35
- package/dist/core/schemas.d.ts +0 -51
- package/dist/library.d.ts +0 -1
package/dist/shared.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{homedir as e}from"node:os";export const __webpack_esm_id__=804;export const __webpack_esm_ids__=[804];export const __webpack_esm_modules__={5157(e,t,n){const r=n(6675),o=n(280);function s(e,t,n=!1){return!t||null!==t.windows&&void 0!==t.windows||(t={...t,windows:o.isWindows()}),r(e,t,n)}Object.assign(s,r),e.exports=s},3940(e){const t="\\\\/",n=`[^${t}]`,r="\\.",o="\\/",s="[^/]",i=`(?:${o}|$)`,a=`(?:^|${o})`,u=`${r}{1,2}${i}`,c={DOT_LITERAL:r,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:o,ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:u,NO_DOT:`(?!${r})`,NO_DOTS:`(?!${a}${u})`,NO_DOT_SLASH:`(?!${r}{0,1}${i})`,NO_DOTS_SLASH:`(?!${u})`,QMARK_NO_DOT:`[^.${o}]`,STAR:`${s}*?`,START_ANCHOR:a,SEP:"/"},l={...c,SLASH_LITERAL:`[${t}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${t}])${r}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"};e.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,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:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},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?l:c}},1154(e,t,n){const r=n(3940),o=n(280),{MAX_LENGTH:s,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:u,REPLACEMENTS:c}=r,l=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(t){return e.map(e=>o.escapeRegex(e)).join("..")}return n},f=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=e=>{const t=[];let n=0,r=0,o=0,s="",i=!1;for(const a of e)if(!0!==i)if("\\"!==a)if('"'!==a){if(0===o)if("["===a)n++;else if("]"===a&&n>0)n--;else if(0===n)if("("===a)r++;else if(")"===a&&r>0)r--;else if("|"===a&&0===r){t.push(s),s="";continue}s+=a}else o=1===o?0:1,s+=a;else s+=a,i=!0;else s+=a,i=!1;return t.push(s),t},d=e=>{let t=e.trim(),n=!0;for(;!0===n;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if((e=>{let t=!1;for(const n of e)if(!0!==t)if("\\"!==n){if(/[?*+@!()[\]{}]/.test(n))return!1}else t=!0;else t=!1;return!0})(t))return t.replace(/\\(.)/g,"$1")},h=(e,t=!0)=>{if("+"!==e[0]&&"*"!==e[0]||"("!==e[1])return;let n=0,r=0,o=0,s=!1;for(let i=1;i<e.length;i++){const a=e[i];if(!0!==s)if("\\"!==a)if('"'!==a){if(1!==o)if("["!==a){if("]"===a&&n>0)n--;else if(!(n>0))if("("!==a){if(")"===a&&(r--,0===r)){if(!0===t&&i!==e.length-1)return;return{type:e[0],body:e.slice(2,i),end:i}}}else r++}else n++}else o=1===o?0:1;else s=!0;else s=!1}},m=e=>{let t=0;const n=[];for(;t<e.length;){const r=h(e.slice(t),!1);if(!r||"*"!==r.type)return;const o=p(r.body).map(e=>e.trim());if(1!==o.length)return;const s=d(o[0]);if(!s||1!==s.length)return;n.push(s),t+=r.end+1}if(!(n.length<1))return n},g=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=c[e]||e;const n={...t},h="number"==typeof n.maxLength?Math.min(s,n.maxLength):s;let v=e.length;if(v>h)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${h}`);const _={type:"bos",value:"",output:n.prepend||""},b=[_],k=n.capture?"":"?:",w=r.globChars(n.windows),x=r.extglobChars(w),{DOT_LITERAL:$,PLUS_LITERAL:O,SLASH_LITERAL:A,ONE_CHAR:E,DOTS_SLASH:S,NO_DOT:z,NO_DOT_SLASH:C,NO_DOTS_SLASH:T,QMARK:R,QMARK_NO_DOT:I,STAR:P,START_ANCHOR:N}=w,j=e=>`(${k}(?:(?!${N}${e.dot?S:$}).)*?)`,F=n.dot?"":z,L=n.dot?R:I;let Z=!0===n.bash?j(n):P;n.capture&&(Z=`(${Z})`),"boolean"==typeof n.noext&&(n.noextglob=n.noext);const D={input:e,index:-1,start:0,dot:!0===n.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};e=o.removePrefix(e,D),v=e.length;const H=[],U=[],M=[];let B,q=_;const J=()=>D.index===v-1,K=D.peek=(t=1)=>e[D.index+t],G=D.advance=()=>e[++D.index]||"",V=()=>e.slice(D.index+1),W=(e="",t=0)=>{D.consumed+=e,D.index+=t},X=e=>{D.output+=null!=e.output?e.output:e.value,W(e.value)},Q=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)G(),D.start++,e++;return e%2!=0&&(D.negated=!0,D.start++,!0)},Y=e=>{D[e]++,M.push(e)},ee=e=>{D[e]--,M.pop()},te=e=>{if("globstar"===q.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||H.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(D.output=D.output.slice(0,-q.output.length),q.type="star",q.value="*",q.output=Z,D.output+=q.output)}if(H.length&&"paren"!==e.type&&(H[H.length-1].inner+=e.value),(e.value||e.output)&&X(e),q&&"text"===q.type&&"text"===e.type)return q.output=(q.output||q.value)+e.value,void(q.value+=e.value);e.prev=q,b.push(e),q=e},ne=(e,t)=>{const r={...x[t],conditions:1,inner:""};r.prev=q,r.parens=D.parens,r.output=D.output,r.startIndex=D.index,r.tokensIndex=b.length;const o=(n.capture?"(":"")+r.open;Y("parens"),te({type:e,value:t,output:D.output?"":E}),te({type:"paren",extglob:!0,value:G(),output:o}),H.push(r)},re=s=>{const i=e.slice(s.startIndex,D.index+1),a=((e,t)=>{if(!1===t.maxExtglobRecursion)return{risky:!1};const n="number"==typeof t.maxExtglobRecursion?t.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,s=p(e).map(e=>e.trim());if(s.length>1&&(s.some(e=>""===e)||s.some(e=>/^[*?]+$/.test(e))||(e=>{const t=e.map(d).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){const r=t[e],o=t[n],s=r[0];if(s&&r===s.repeat(r.length)&&o===s.repeat(o.length)&&(r===o||r.startsWith(o)||o.startsWith(r)))return!0}return!1})(s)))return{risky:!0};const i=[];let a=!1,u=!0;for(const e of s){const t=m(e);if(t){a=!0,i.push(...t);continue}const r=d(e);if(r&&1===r.length)i.push(r);else if(u=!1,g(e)>n)return{risky:!0}}return a?u?{risky:!0,safeOutput:(c=[...new Set(i)],`${1===c.length?o.escapeRegex(c[0]):`[${c.map(e=>o.escapeRegex(e)).join("")}]`}*`)}:{risky:!0}:{risky:!1};var c})(e.slice(s.startIndex+2,D.index),n);if(("plus"===s.type||"star"===s.type)&&a.risky){const e=a.safeOutput?(s.output?"":E)+(n.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=b[s.tokensIndex];t.type="text",t.value=i,t.output=e||o.escapeRegex(i);for(let e=s.tokensIndex+1;e<b.length;e++)b[e].value="",b[e].output="",delete b[e].suffix;return D.output=s.output+t.output,D.backtrack=!0,te({type:"paren",extglob:!0,value:B,output:""}),void ee("parens")}let u,c=s.close+(n.capture?")":"");if("negate"===s.type){let e=Z;if(s.inner&&s.inner.length>1&&s.inner.includes("/")&&(e=j(n)),(e!==Z||J()||/^\)+$/.test(V()))&&(c=s.close=`)$))${e}`),s.inner.includes("*")&&(u=V())&&/^\.[^\\/.]+$/.test(u)){const n=y(u,{...t,fastpaths:!1}).output;c=s.close=`)${n})${e})`}"bos"===s.prev.type&&(D.negatedExtglob=!0)}te({type:"paren",extglob:!0,value:B,output:c}),ee("parens")};if(!1!==n.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,s=e.replace(u,(e,t,n,o,s,i)=>"\\"===o?(r=!0,e):"?"===o?t?t+o+(s?R.repeat(s.length):""):0===i?L+(s?R.repeat(s.length):""):R.repeat(n.length):"."===o?$.repeat(n.length):"*"===o?t?t+o+(s?Z:""):Z:t?e:`\\${e}`);return!0===r&&(s=!0===n.unescape?s.replace(/\\/g,""):s.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),s===e&&!0===n.contains?(D.output=e,D):(D.output=o.wrapOutput(s,D,t),D)}for(;!J();){if(B=G(),"\0"===B)continue;if("\\"===B){const e=K();if("/"===e&&!0!==n.bash)continue;if("."===e||";"===e)continue;if(!e){B+="\\",te({type:"text",value:B});continue}const t=/^\\+/.exec(V());let r=0;if(t&&t[0].length>2&&(r=t[0].length,D.index+=r,r%2!=0&&(B+="\\")),!0===n.unescape?B=G():B+=G(),0===D.brackets){te({type:"text",value:B});continue}}if(D.brackets>0&&("]"!==B||"["===q.value||"[^"===q.value)){if(!1!==n.posix&&":"===B){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),n=q.value.slice(e+2),r=i[n];if(r){q.value=t+r,D.backtrack=!0,G(),_.output||1!==b.indexOf(q)||(_.output=E);continue}}}("["===B&&":"!==K()||"-"===B&&"]"===K())&&(B=`\\${B}`),"]"!==B||"["!==q.value&&"[^"!==q.value||(B=`\\${B}`),!0===n.posix&&"!"===B&&"["===q.value&&(B="^"),q.value+=B,X({value:B});continue}if(1===D.quotes&&'"'!==B){B=o.escapeRegex(B),q.value+=B,X({value:B});continue}if('"'===B){D.quotes=1===D.quotes?0:1,!0===n.keepQuotes&&te({type:"text",value:B});continue}if("("===B){Y("parens"),te({type:"paren",value:B});continue}if(")"===B){if(0===D.parens&&!0===n.strictBrackets)throw new SyntaxError(f("opening","("));const e=H[H.length-1];if(e&&D.parens===e.parens+1){re(H.pop());continue}te({type:"paren",value:B,output:D.parens?")":"\\)"}),ee("parens");continue}if("["===B){if(!0!==n.nobracket&&V().includes("]"))Y("brackets");else{if(!0!==n.nobracket&&!0===n.strictBrackets)throw new SyntaxError(f("closing","]"));B=`\\${B}`}te({type:"bracket",value:B});continue}if("]"===B){if(!0===n.nobracket||q&&"bracket"===q.type&&1===q.value.length){te({type:"text",value:B,output:`\\${B}`});continue}if(0===D.brackets){if(!0===n.strictBrackets)throw new SyntaxError(f("opening","["));te({type:"text",value:B,output:`\\${B}`});continue}ee("brackets");const e=q.value.slice(1);if(!0===q.posix||"^"!==e[0]||e.includes("/")||(B=`/${B}`),q.value+=B,X({value:B}),!1===n.literalBrackets||o.hasRegexChars(e))continue;const t=o.escapeRegex(q.value);if(D.output=D.output.slice(0,-q.value.length),!0===n.literalBrackets){D.output+=t,q.value=t;continue}q.value=`(${k}${t}|${q.value})`,D.output+=q.value;continue}if("{"===B&&!0!==n.nobrace){Y("braces");const e={type:"brace",value:B,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};U.push(e),te(e);continue}if("}"===B){const e=U[U.length-1];if(!0===n.nobrace||!e){te({type:"text",value:B,output:B});continue}let t=")";if(!0===e.dots){const e=b.slice(),r=[];for(let t=e.length-1;t>=0&&(b.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=l(r,n),D.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",B=t="\\}",D.output=n;for(const e of r)D.output+=e.output||e.value}te({type:"brace",value:B,output:t}),ee("braces"),U.pop();continue}if("|"===B){H.length>0&&H[H.length-1].conditions++,te({type:"text",value:B});continue}if(","===B){let e=B;const t=U[U.length-1];t&&"braces"===M[M.length-1]&&(t.comma=!0,e="|"),te({type:"comma",value:B,output:e});continue}if("/"===B){if("dot"===q.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",b.pop(),q=_;continue}te({type:"slash",value:B,output:A});continue}if("."===B){if(D.braces>0&&"dot"===q.type){"."===q.value&&(q.output=$);const e=U[U.length-1];q.type="dots",q.output+=B,q.value+=B,e.dots=!0;continue}if(D.braces+D.parens===0&&"bos"!==q.type&&"slash"!==q.type){te({type:"text",value:B,output:$});continue}te({type:"dot",value:B,output:$});continue}if("?"===B){if((!q||"("!==q.value)&&!0!==n.noextglob&&"("===K()&&"?"!==K(2)){ne("qmark",B);continue}if(q&&"paren"===q.type){const e=K();let t=B;("("===q.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(V()))&&(t=`\\${B}`),te({type:"text",value:B,output:t});continue}if(!0!==n.dot&&("slash"===q.type||"bos"===q.type)){te({type:"qmark",value:B,output:I});continue}te({type:"qmark",value:B,output:R});continue}if("!"===B){if(!0!==n.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){ne("negate",B);continue}if(!0!==n.nonegate&&0===D.index){Q();continue}}if("+"===B){if(!0!==n.noextglob&&"("===K()&&"?"!==K(2)){ne("plus",B);continue}if(q&&"("===q.value||!1===n.regex){te({type:"plus",value:B,output:O});continue}if(q&&("bracket"===q.type||"paren"===q.type||"brace"===q.type)||D.parens>0){te({type:"plus",value:B});continue}te({type:"plus",value:O});continue}if("@"===B){if(!0!==n.noextglob&&"("===K()&&"?"!==K(2)){te({type:"at",extglob:!0,value:B,output:""});continue}te({type:"text",value:B});continue}if("*"!==B){"$"!==B&&"^"!==B||(B=`\\${B}`);const e=a.exec(V());e&&(B+=e[0],D.index+=e[0].length),te({type:"text",value:B});continue}if(q&&("globstar"===q.type||!0===q.star)){q.type="star",q.star=!0,q.value+=B,q.output=Z,D.backtrack=!0,D.globstar=!0,W(B);continue}let t=V();if(!0!==n.noextglob&&/^\([^?]/.test(t)){ne("star",B);continue}if("star"===q.type){if(!0===n.noglobstar){W(B);continue}const r=q.prev,o=r.prev,s="slash"===r.type||"bos"===r.type,i=o&&("star"===o.type||"globstar"===o.type);if(!0===n.bash&&(!s||t[0]&&"/"!==t[0])){te({type:"star",value:B,output:""});continue}const a=D.braces>0&&("comma"===r.type||"brace"===r.type),u=H.length&&("pipe"===r.type||"paren"===r.type);if(!s&&"paren"!==r.type&&!a&&!u){te({type:"star",value:B,output:""});continue}for(;"/**"===t.slice(0,3);){const n=e[D.index+4];if(n&&"/"!==n)break;t=t.slice(3),W("/**",3)}const c=J()||D.parens>0&&t===")".repeat(D.parens)&&!H.some(e=>"negate"===e.type);if("bos"===r.type&&J()){q.type="globstar",q.value+=B,q.output=j(n),D.output=q.output,D.globstar=!0,W(B);continue}if("slash"===r.type&&"bos"!==r.prev.type&&!i&&c){D.output=D.output.slice(0,-(r.output+q.output).length),r.output=`(?:${r.output}`,q.type="globstar",q.output=j(n)+(n.strictSlashes?")":"|$)"),q.value+=B,D.globstar=!0,D.output+=r.output+q.output,W(B);continue}if("slash"===r.type&&"bos"!==r.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";D.output=D.output.slice(0,-(r.output+q.output).length),r.output=`(?:${r.output}`,q.type="globstar",q.output=`${j(n)}${A}|${A}${e})`,q.value+=B,D.output+=r.output+q.output,D.globstar=!0,W(B+G()),te({type:"slash",value:"/",output:""});continue}if("bos"===r.type&&"/"===t[0]){q.type="globstar",q.value+=B,q.output=`(?:^|${A}|${j(n)}${A})`,D.output=q.output,D.globstar=!0,W(B+G()),te({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-q.output.length),q.type="globstar",q.output=j(n),q.value+=B,D.output+=q.output,D.globstar=!0,W(B);continue}const r={type:"star",value:B,output:Z};!0!==n.bash?!q||"bracket"!==q.type&&"paren"!==q.type||!0!==n.regex?(D.index!==D.start&&"slash"!==q.type&&"dot"!==q.type||("dot"===q.type?(D.output+=C,q.output+=C):!0===n.dot?(D.output+=T,q.output+=T):(D.output+=F,q.output+=F),"*"!==K()&&(D.output+=E,q.output+=E)),te(r)):(r.output=B,te(r)):(r.output=".*?","bos"!==q.type&&"slash"!==q.type||(r.output=F+r.output),te(r))}for(;D.brackets>0;){if(!0===n.strictBrackets)throw new SyntaxError(f("closing","]"));D.output=o.escapeLast(D.output,"["),ee("brackets")}for(;D.parens>0;){if(!0===n.strictBrackets)throw new SyntaxError(f("closing",")"));D.output=o.escapeLast(D.output,"("),ee("parens")}for(;D.braces>0;){if(!0===n.strictBrackets)throw new SyntaxError(f("closing","}"));D.output=o.escapeLast(D.output,"{"),ee("braces")}if(!0===n.strictSlashes||"star"!==q.type&&"bracket"!==q.type||te({type:"maybe_slash",value:"",output:`${A}?`}),!0===D.backtrack){D.output="";for(const e of D.tokens)D.output+=null!=e.output?e.output:e.value,e.suffix&&(D.output+=e.suffix)}return D};y.fastpaths=(e,t)=>{const n={...t},i="number"==typeof n.maxLength?Math.min(s,n.maxLength):s,a=e.length;if(a>i)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${i}`);e=c[e]||e;const{DOT_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:d,NO_DOTS:h,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:y}=r.globChars(n.windows),v=n.dot?h:d,_=n.dot?m:d,b=n.capture?"":"?:";let k=!0===n.bash?".*?":g;n.capture&&(k=`(${k})`);const w=e=>!0===e.noglobstar?k:`(${b}(?:(?!${y}${e.dot?p:u}).)*?)`,x=e=>{switch(e){case"*":return`${v}${f}${k}`;case".*":return`${u}${f}${k}`;case"*.*":return`${v}${k}${u}${f}${k}`;case"*/*":return`${v}${k}${l}${f}${_}${k}`;case"**":return v+w(n);case"**/*":return`(?:${v}${w(n)}${l})?${_}${f}${k}`;case"**/*.*":return`(?:${v}${w(n)}${l})?${_}${k}${u}${f}${k}`;case"**/.*":return`(?:${v}${w(n)}${l})?${u}${f}${k}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=x(t[1]);if(!n)return;return n+u+t[2]}}},$=o.removePrefix(e,{negated:!1,prefix:""});let O=x($);return O&&!0!==n.strictSlashes&&(O+=`${l}?`),O},e.exports=y},6675(e,t,n){const r=n(2608),o=n(1154),s=n(280),i=n(3940),a=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>a(e,t,n)),o=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return o}const r=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=t||{},i=s.windows,u=r?a.compileRe(e,t):a.makeRe(e,t,!1,!0),c=u.state;delete u.state;let l=()=>!1;if(s.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=a(s.ignore,e,n)}const f=(n,r=!1)=>{const{isMatch:o,match:f,output:p}=a.test(n,u,t,{glob:e,posix:i}),d={glob:e,state:c,regex:u,posix:i,input:n,output:p,match:f,isMatch:o};return"function"==typeof s.onResult&&s.onResult(d),!1===o?(d.isMatch=!1,!!r&&d):l(n)?("function"==typeof s.onIgnore&&s.onIgnore(d),d.isMatch=!1,!!r&&d):("function"==typeof s.onMatch&&s.onMatch(d),!r||d)};return n&&(f.state=c),f};a.test=(e,t,n,{glob:r,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const i=n||{},u=i.format||(o?s.toPosixSlashes:null);let c=e===r,l=c&&u?u(e):e;return!1===c&&(l=u?u(e):e,c=l===r),!1!==c&&!0!==i.capture||(c=!0===i.matchBase||!0===i.basename?a.matchBase(e,t,n,o):t.exec(l)),{isMatch:Boolean(c),match:c,output:l}},a.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:a.makeRe(t,n)).test(s.basename(e,{windows:r})),a.isMatch=(e,t,n)=>a(t,n)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):o(e,{...t,fastpaths:!1}),a.scan=(e,t)=>r(e,t),a.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const o=t||{},s=o.contains?"":"^",i=o.contains?"":"$";let u=`${s}(?:${e.output})${i}`;e&&!0===e.negated&&(u=`^(?!${u}).*$`);const c=a.toRegex(u,t);return!0===r&&(c.state=e),c},a.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(s.output=o.fastpaths(e,t)),s.output||(s=o(e,t)),a.compileRe(s,t,n,r)},a.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=i,e.exports=a},2608(e,t,n){const r=n(280),{CHAR_ASTERISK:o,CHAR_AT:s,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:a,CHAR_DOT:u,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:d,CHAR_PLUS:h,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:v}=n(3940),_=e=>e===l||e===i,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const n=t||{},k=e.length-1,w=!0===n.parts||!0===n.tokens||!0===n.scanToEnd,x=[],$=[],O=[];let A,E,S=e,z=-1,C=0,T=0,R=!1,I=!1,P=!1,N=!1,j=!1,F=!1,L=!1,Z=!1,D=!1,H=!1,U=0,M={value:"",depth:0,isGlob:!1};const B=()=>z>=k,q=()=>S.charCodeAt(z+1),J=()=>(A=E,S.charCodeAt(++z));for(;z<k;){let e;if(E=J(),E!==i){if(!0===F||E===f){for(U++;!0!==B()&&(E=J());)if(E!==i)if(E!==f){if(!0!==F&&E===u&&(E=J())===u){if(R=M.isBrace=!0,P=M.isGlob=!0,H=!0,!0===w)continue;break}if(!0!==F&&E===a){if(R=M.isBrace=!0,P=M.isGlob=!0,H=!0,!0===w)continue;break}if(E===g&&(U--,0===U)){F=!1,R=M.isBrace=!0,H=!0;break}}else U++;else L=M.backslashes=!0,J();if(!0===w)continue;break}if(E!==l){if(!0!==n.noext&&!0==(E===h||E===s||E===o||E===m||E===c)&&q()===p){if(P=M.isGlob=!0,N=M.isExtglob=!0,H=!0,E===c&&z===C&&(D=!0),!0===w){let e=0;for(;!0!==B()&&(E=J());)if(E!==i)if(E!==p){if(E===y&&0===--e){H=!0;break}}else e++;else L=M.backslashes=!0,J();continue}break}if(E===o){if(A===o&&(j=M.isGlobstar=!0),P=M.isGlob=!0,H=!0,!0===w)continue;break}if(E===m){if(P=M.isGlob=!0,H=!0,!0===w)continue;break}if(E===d){for(;!0!==B()&&(e=J());)if(e!==i){if(e===v){I=M.isBracket=!0,P=M.isGlob=!0,H=!0;break}}else L=M.backslashes=!0,J();if(!0===w)continue;break}if(!0===n.nonegate||E!==c||z!==C){if(!0!==n.noparen&&E===p){if(P=M.isGlob=!0,!0===w){let e=1;for(;!0!==B()&&(E=J());)if(E!==i)if(E!==p){if(E===y&&0===--e){H=!0;break}}else e++;else L=M.backslashes=!0,J();continue}break}if(!0===P){if(H=!0,!0===w)continue;break}}else Z=M.negated=!0,C++}else{if(x.push(z),$.push(M),M={value:"",depth:0,isGlob:!1},!0===H)continue;if(A===u&&z===C+1){C+=2;continue}T=z+1}}else L=M.backslashes=!0,E=J(),E===f&&(F=!0)}!0===n.noext&&(N=!1,P=!1);let K=S,G="",V="";C>0&&(G=S.slice(0,C),S=S.slice(C),T-=C),K&&!0===P&&T>0?(K=S.slice(0,T),V=S.slice(T)):!0===P?(K="",V=S):K=S,K&&""!==K&&"/"!==K&&K!==S&&_(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),!0===n.unescape&&(V&&(V=r.removeBackslashes(V)),K&&!0===L&&(K=r.removeBackslashes(K)));const W={prefix:G,input:e,start:C,base:K,glob:V,isBrace:R,isBracket:I,isGlob:P,isExtglob:N,isGlobstar:j,negated:Z,negatedExtglob:D};if(!0===n.tokens&&(W.maxDepth=0,_(E)||$.push(M),W.tokens=$),!0===n.parts||!0===n.tokens){let t;for(let r=0;r<x.length;r++){const o=void 0!==t?t+1:C,s=x[r],i=e.slice(o,s);n.tokens&&(0===r&&0!==C?($[r].isPrefix=!0,$[r].value=G):$[r].value=i,b($[r]),W.maxDepth+=$[r].depth),s>=C&&(O.push(i),t=s)}const r=void 0!==t?t+1:C,o=e.slice(r);O.push(o),n.tokens&&t&&t+1<e.length&&($[$.length-1].value=o,b($[$.length-1]),W.maxDepth+=$[$.length-1].depth),W.slashes=x,W.parts=O}return W}},280(e,t,n){const{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:i}=n(3940);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>s.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(i,"\\$1"),t.toPosixSlashes=e=>e.replace(r,"/"),t.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){const e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return!("undefined"==typeof process||!process.platform)&&"win32"===process.platform},t.removeBackslashes=e=>e.replace(o,e=>"\\"===e?"":e),t.escapeLast=(e,n,r)=>{const o=e.lastIndexOf(n,r);return-1===o?e:"\\"===e[o-1]?t.escapeLast(e,n,o-1):`${e.slice(0,o)}\\${e.slice(o)}`},t.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},t.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r},t.basename=(e,{windows:t}={})=>{const n=e.split(t?/[\\/]/:"/"),r=n[n.length-1];return""===r?n[n.length-2]:r}},5316(t,n,r){r.d(n,{RF:()=>As,Z9:()=>Ss});var o=r(9627),s=r(5663);function i(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function a(e,t="|"){return e.map(e=>z(e)).join(t)}function u(e,t){return"bigint"==typeof t?t.toString():t}class c{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function l(e){return new c(e)}function f(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function p(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function d(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function h(e){return d(e._zod.def)??e._zod.def.shape}function m(e,t,n){Object.defineProperty(e,t,{get(){const e=n();return p(this,t,e),e},enumerable:!0,configurable:!0})}function g(e,t,n){t in e?p(e,t,n):e[t]=n}function y(e,t,n,r){const o=h(t);for(const s of n){const n=Object.getOwnPropertyDescriptor(o,s);n.enumerable&&(n.get?m(e,s,()=>{const e=t._zod.def.shape[s];return r?r(e,s):e}):g(e,s,r?r(n.value,s):n.value))}}function v(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function _(e){return JSON.stringify(e)}const b="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function k(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const w=l(()=>{if(ue.jitless)return!1;if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function x(e){if(!1===k(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==k(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function $(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const O=new Set(["string","number","symbol"]);function A(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function S(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function z(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}const C=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),T={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function R(e,t){const n=h(e),r=[];for(const e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw new Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function I(e,t){const n={};return y(n,e,Reflect.ownKeys(h(e))),function(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?m(e,n,()=>t[n]):g(e,n,r.value))}}(n,t),n}function P(e,t,n,r="partial"){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const s=n?new Set(R(t,n)):void 0,i={};return y(i,t,Reflect.ownKeys(h(t)),e&&((t,n)=>s&&!s.has(n)?t:new e({type:"optional",innerType:t}))),E(t,v(t._zod.def,{shape:i,checks:[]}))}function N(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function j(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!1===e.issues[n]?.continue)return!0;return!1}function F(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function L(e){return"string"==typeof e?e:e?.message}function Z(e){const t=[];for(const n of e??[]){const e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;const r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function D(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function H(e,t,n){var r;const o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:L(e.inst?._zod.def?.error?.(e))??L(s?.(e))??L(t?.error?.(e))??L(n.customError?.(e))??L(n.localeError?.(e))??"Invalid input",a={};for(const t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}const U=/[\uD800-\uDBFF]/;function M(e){const t=e.length;if(!U.test(e))return t;let n=t;for(let r=0;r<t-1;r++)55296==(64512&e.charCodeAt(r))&&56320==(64512&e.charCodeAt(r+1))&&(n--,r++);return n}function B(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function q(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function J(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function K(e,t,n){return J(e,t,n,!1)}function G(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return J(this,n,r(this))},set(e){J(this,n,e)}})}return t}function V(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return null==this?n:J(this,t,n.bind(this))},set(e){J(this,t,e)}})}let W,X=!1;const Q={configurable:!0,get(){X=!0}};function Y(e,t,n){const r=Object.getPrototypeOf(e._zod);t in r&&W!==e._zod?W=void 0:(W=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Q);const e=X;X=!1;try{const r=n(this);return X?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),X=X||e,r}catch(n){throw delete this[t],X=X||e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function ee(e){const t=()=>e;return t["~constantCatch"]=!0,t}var te;const ne=Object.freeze({status:"aborted"}),re={value:void 0,enumerable:!1};let oe="captureStackTrace"in Error?Error:null;function se(e,t,n,r){function o(e){this.def=e,this.constr=l,this.traits=new Set}o.prototype={};const s=n,i=s&&new WeakSet;function a(n,r){if(n._zod){if(n._zod.traits.has(e))return}else{re.value=new o(r);try{Object.defineProperty(n,"_zod",re)}finally{re.value=void 0}}if(n._zod.traits.add(e),t(n,r),i){const e=Object.getPrototypeOf(n),t=n._zod.constr.prototype;let r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);const o=r??e;i.has(o)||(i.add(o),function(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):V(e,n,r.value)}}(o,s))}const a=l.prototype;for(const e in a)Object.prototype.hasOwnProperty.call(a,e)&&(e in n||(n[e]=a[e].bind(n)))}const u=r?.Parent??Object;class c extends u{}function l(e){const t=r?.Parent?function(e){const t=oe;if(t){const n=t.stackTraceLimit;if("number"==typeof n){try{t.stackTraceLimit=0}catch{return oe=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}(c):this;a(t,e);const n=t._zod.deferred;if(n){for(const e of n)e();t._zod.deferred=void 0}const o=globalThis.__zod_globalConfig?.postProcessor;return o&&o(t),t}return Object.defineProperty(c,"name",{value:e}),Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ae extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(te=globalThis).__zod_globalConfig??(te.__zod_globalConfig={});const ue=globalThis.__zod_globalConfig;function ce(e){return e&&Object.assign(ue,e),ue}class le extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const fe="~memo",pe=[];function de(e){return null!==e&&"object"==typeof e}function he(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const me=new WeakMap;function ge(e,t,n){const r=me.get(e);if(void 0!==r)return r?2:0;if(t.has(e))return 2;t.add(e);let o=0;const s=e=>{if(2!==o&&e?._zod){const r=ge(e,t,n);r>o&&(o=r)}},i=e=>{e>o&&(o=e)},a=e._zod.def;switch(a.type){case"object":{const e=d(a);i(e?(e=>{let r=0;for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s.enumerable)continue;const i=s.get?1:s.value?._zod?ge(s.value,t,n):0;i>r&&(r=i)}return r})(e):1),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(const e of a.items)s(e);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(const e of a.options)s(e);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{const r=a._cachedInner??(n?e._zod.innerType:void 0);i(r?ge(r,t,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const e in a){const t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;const n=t.value;if(n&&"object"==typeof n)if(n._zod)s(n);else if(Array.isArray(n))for(const e of n)s(e)}}return t.delete(e),function(e,t){return 1!==t&&me.set(e,2===t),t}(e,o)}let ye;const ve=[],_e={alloc(e,t,n){const r=ye;if(!r)return n;ye=void 0;const o={value:n,issues:null};return r.set(t.value,o),ve.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const t=e._zod.parse,n=(e,n)=>{if("backward"!==n.direction&&function(e,t){const n=e[fe]?.backEdges;return void 0!==n&&de(t)&&n.has(t)}(n,e.value))throw new le;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,o,s=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const t=e._zod.parse,i=(a,u)=>{if(void 0===n){const r=ge(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===i&&(e._zod.run=t),t(a,u);2===r||s?n=!0:s=!0}const c=a.value;if(!de(c))return t(a,u);let l,f=u[fe];f||(f={buckets:new WeakMap,backEdges:void 0},u[fe]=f),r===u?l=o:(l=function(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}(f,e),r=u,o=l);const p=l.get(c);if(p)return a.value=p.value,p.issues?p.issues.length&&a.issues.push(...he(p.issues)):(a.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(p.value)),a;ye=l;const d=ve.length,h=t(a,u);ye=void 0;const m=ve.length>d?ve.pop():void 0;return h instanceof Promise?h.then(e=>(m&&(m.issues=e.issues.length?he(e.issues):pe),e)):(m&&(m.issues=h.issues.length?he(h.issues):pe),h)};e._zod.parse=i,e._zod.run===t&&(e._zod.run=i)})}},be=/^[cC][0-9a-z]{6,}$/,ke=/^[0-9a-z]+$/,we=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,xe=/^[0-9a-vA-V]{20}$/,$e=/^[A-Za-z0-9]{27}$/,Oe=/^[a-zA-Z0-9_-]{21}$/,Ae=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ee=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Se=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ze=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Te=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Re=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ie=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Pe=/^https?$/,Ne=/^\+[1-9]\d{6,14}$/,je="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Fe(e){return new RegExp(`^${e}$`)}const Le=Fe(je);function Ze(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const De=/^[\s\S]{0,}$/,He=/^-?\d+$/,Ue=/^-?\d+(?:\.\d+)?$/,Me=/^[^A-Z]*$/,Be=/^[^a-z]*$/,qe=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Je=e=>{const t=e.value;return!(null==t||void 0===t.length)},Ke={number:"number",bigint:"bigint",object:"date"},Ge=se("$ZodCheckLessThan",(e,t)=>{qe.init(e,t);const n=Ke[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Ke[typeof r.value]??n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ve=se("$ZodCheckGreaterThan",(e,t)=>{qe.init(e,t);const n=Ke[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Ke[typeof r.value]??n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),We=se("$ZodCheckMultipleOf",(e,t)=>{qe.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):0===function(e,t){const n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Xe=se("$ZodCheckNumberFormat",(e,t)=>{qe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=C[t.format];e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a))return void i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Qe=se("$ZodCheckMaxLength",(e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=Je),e._zod.check=n=>{const r=n.value,o=r.length;if(("string"==typeof r&&o>t.maximum?M(r):o)<=t.maximum)return;const s=B(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ye=se("$ZodCheckMinLength",(e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=Je),e._zod.check=n=>{const r=n.value,o=r.length;if(("string"==typeof r&&o>=t.minimum&&o<2*t.minimum?M(r):o)>=t.minimum)return;const s=B(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),et=se("$ZodCheckLengthEquals",(e,t)=>{var n;qe.init(e,t),(n=e._zod.def).when??(n.when=Je),e._zod.check=n=>{const r=n.value,o=r.length,s="string"==typeof r&&o>=t.length&&o<=2*t.length?M(r):o;if(s===t.length)return;const i=B(r),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),tt=se("$ZodCheckStringFormat",(e,t)=>{var n,r;qe.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),nt=se("$ZodCheckRegex",(e,t)=>{tt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rt=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Me),tt.init(e,t)}),ot=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Be),tt.init(e,t)}),st=se("$ZodCheckIncludes",(e,t)=>{qe.init(e,t);const n=A(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),it=se("$ZodCheckStartsWith",(e,t)=>{qe.init(e,t);const n=new RegExp(`^${A(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),at=se("$ZodCheckEndsWith",(e,t)=>{qe.init(e,t);const n=new RegExp(`.*${A(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ut=se("$ZodCheckOverwrite",(e,t)=>{qe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class ct{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {\n${t.join("\n")}\n};`)(...Object.values(this.closed))}}const lt={major:4,minor:6,patch:7},ft=se("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lt;const r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(const t of o)for(const n of t._zod.onattach)n(e);if(0===o.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(t,n,r)=>{if(t.memo)return t;let o,s=N(t);for(const i of n){if(i._zod.def.when){if(j(t))continue;if(!i._zod.def.when(t))continue}else if(s)continue;const n=t.issues.length,a=i._zod.check(t);if(a instanceof Promise&&!1===r?.async)throw new ie;if(o||a instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await a,t.issues.length!==n&&(D(t.issues,n,e),s||(s=N(t,n)))});else{if(t.issues.length===n)continue;D(t.issues,n,e),s||(s=N(t,n))}}return o?o.then(()=>t):t},n=(n,r,s)=>{if(N(n))return n.aborted=!0,n;const i=t(r,o,s);if(i instanceof Promise){if(!1===s.async)throw new ie;return i.then(t=>e._zod.parse(t,s))}return e._zod.parse(i,s)};e._zod.run=(r,s)=>{if(s.skipChecks)return e._zod.parse(r,s);if("backward"===s.direction){const t=e._zod.parse({value:r.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,s)):n(t,r,s)}const i=e._zod.parse(r,s);if(i instanceof Promise){if(!1===s.async)throw new ie;return i.then(e=>t(e,o,s))}return t(i,o,s)}}},{get"~standard"(){return K(this,"~standard",dt(this))},set"~standard"(e){J(this,"~standard",e)}}),pt=(e,t)=>e.issues.length?{issues:e.issues.map(e=>H(e,t,ce()))}:{value:e.value};function dt(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return pt(r,n)}catch(e){}return async function(e,t){const n={async:!0};return pt(await e._zod.run({value:t,issues:[]},n),n)}(e,t)},vendor:"zod",version:1}}const ht=se("$ZodString",(e,t)=>{ft.init(e,t),e._zod.pattern=t.pattern??De,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),mt=se("$ZodStringFormat",(e,t)=>{tt.init(e,t),ht.init(e,t)}),gt=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ee),mt.init(e,t)}),yt=se("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Se(e))}else t.pattern??(t.pattern=Se());mt.init(e,t)}),vt=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ze),mt.init(e,t)});function _t(e){try{return"undefined"!=typeof URL&&"function"==typeof URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}}const bt=/[\t\n\r]/g;function kt(e){return e.replace(bt,"")}const wt=se("$ZodURL",(e,t)=>{mt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=function(e,t){return"normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===Pe.source&&!/^https?:\/\//i.test(e))return 1;try{if("undefined"!=typeof URL){const t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(e,t):_t(e)||2}(r,t);return 1===o?void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort}):2===o?void n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort}):!0===o?void(n.value=kt(r)):(t.hostname&&!function(e,t){return t.lastIndex=0,t.test(e.hostname)}(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!function(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),void(n.value=t.normalize?o.href:kt(r)))}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),xt=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),mt.init(e,t)}),$t=se("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);var n;t.pattern??(t.pattern=void 0===t.length?Oe:(n=t.length,new RegExp(`^[a-zA-Z0-9_-]{${n}}$`))),mt.init(e,t)}),Ot=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=be),mt.init(e,t)}),At=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ke),mt.init(e,t)}),Et=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=we),mt.init(e,t)}),St=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xe),mt.init(e,t)}),zt=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$e),mt.init(e,t)}),Ct=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Ze({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Ze({precision:e.precision})}`:n;return new RegExp(`^${je}T(?:${r})$`)}(t)),mt.init(e,t)}),Tt=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Le),mt.init(e,t)}),Rt=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Ze(t)}$`)),mt.init(e,t)}),It=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ae),mt.init(e,t)}),Pt=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ce),mt.init(e,t)}),Nt=/^[0-9a-fA-F:.]+$/;function jt(e){return!!Nt.test(e)&&_t(`http://[${e}]`)}const Ft=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Te),mt.init(e,t),e._zod.check=n=>{jt(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),Lt=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Re),mt.init(e,t)}),Zt=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ie),mt.init(e,t),e._zod.check=n=>{(function(e){const t=e.split("/");if(2!==t.length)return!1;const[n,r]=t;if(!r)return!1;const o=Number(r);return`${o}`===r&&!(o<0||o>128)&&jt(n)})(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Dt(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ht=/^[0-9a-zA-Z+/]*={0,2}$/,Ut=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ht),mt.init(e,t),e._zod.check=n=>{Dt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Mt=/^[A-Za-z0-9_-]*$/,Bt=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Mt),mt.init(e,t),e._zod.check=n=>{(function(e){if(!Mt.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Dt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),qt=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ne),mt.init(e,t)}),Jt=se("$ZodJWT",(e,t)=>{mt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Kt=se("$ZodNumber",(e,t)=>{ft.init(e,t),e._zod.pattern=Ue,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Gt=se("$ZodNumberFormat",(e,t)=>{Xe.init(e,t),Kt.init(e,t)}),Vt=se("$ZodUnknown",(e,t)=>{ft.init(e,t),e._zod.parse=e=>e}),Wt=se("$ZodNever",(e,t)=>{ft.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});const Xt=e=>Array.isArray(e)?e.length:-1;function Qt(e,t,n){e.issues.length&&t.issues.push(...F(n,e.issues)),t.value[n]=e.value}const Yt=se("$ZodArray",(e,t)=>{ft.init(e,t);const n=ue.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),o):Array(s.length);const i=[],a=o?.abortEarly;for(let e=0;e<s.length;e++){const n=s[e],u=t.element._zod.run({value:n,issues:[]},o);if(u instanceof Promise)i.push(u.then(t=>Qt(t,r,e)));else if(Qt(u,r,e),a&&0!==u.issues.length&&N(u))break}return i.length?Promise.all(i).then(()=>r):r},function(e,t){const n=Z(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(e=>e[0])),o=e._zod.parse;e._zod.parse=(n,s)=>{const i=t(n.value);if(i>r&&!s?.skipChecks&&"backward"!==s?.direction)for(const[t,r]of Z(e._zod.def.checks))if(i>t&&r._zod.def.when(n)){const t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,D(n.issues,t,e),n}return o(n,s)}}(e,Xt)});function en(e,t,n,r,o,s){const i=n in r,a="optional"===s;if(i||!a||"optional"!==o){if(e.issues.length){if(void 0!==o&&a&&!i)return;t.issues.push(...F(n,e.issues))}i||void 0!==o?void 0===e.value?(i||"defaulted"===o&&!a)&&(t.value[n]=void 0):t.value[n]=e.value:e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]})}}const tn=[];function nn(e){const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:tn,o=r.length?[...t,...r]:t;for(const t of o)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(t)}": expected a Zod schema`);const s=(i=e.shape,Object.keys(i).filter(e=>void 0!==i[e]._zod.optin&&"optional"===i[e]._zod.optout));var i;return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function rn(e,t,n,r,o,s,i){const a=[],u=o.keySet,c=o.catchall._zod,l=c.def.type,f=c.optin,p=c.optout;let d=0;for(const o in t){if(i&&n.issues.length!==d){if(N(n,d))break;d=n.issues.length}if(u.has(o))continue;if("__proto__"===o){"never"===l&&a.push(o);continue}if("never"===l){a.push(o);continue}const s=c.run({value:t[o],issues:[]},r);s instanceof Promise?e.push(s.then(e=>en(e,n,o,t,f,p))):en(s,n,o,t,f,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const on=se("$ZodObject",(e,t)=>{ft.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){const e=()=>{const n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}const o=l(()=>nn(t));Y(e,"propValues",e=>{const t=e.def.shape,n={};for(const e in t){const r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||p(n,e,new Set);for(const t of r.values)n[e].add(t);void 0!==r.optin&&n[e].add(void 0)}}return n});const s=k,i=t.catchall;let a;const u=ue.memoizer;u?.attach(e),e._zod.parse=(t,n)=>{a??(a=o.value);const r=t.value;if(!s(r))return t.issues.push({expected:"object",code:"invalid_type",input:r,inst:e}),t;t.value=u?u.alloc(e,t,{},n):{};const c=[],l=a.shape,f=n?.abortEarly;let p=t.issues.length;for(const e of a.allKeys){if(f&&t.issues.length!==p){if(N(t,p))break;p=t.issues.length}if("__proto__"===e)continue;const o=l[e],s=o._zod.optin,i=o._zod.optout,a=o._zod.run({value:r[e],issues:[]},n);a instanceof Promise?c.push(a.then(n=>en(n,t,e,r,s,i))):en(a,t,e,r,s,i)}return i?rn(c,r,t,n,o.value,e,!0===f):c.length?Promise.all(c).then(()=>t):t}}),sn=se("$ZodObjectJIT",(e,t)=>{on.init(e,t);const n=e._zod.parse,r=l(()=>nn(t)),o=ue.memoizer;let s;const i=k,a=!ue.jitless,u=a&&w.value,c=t.catchall;let f;e._zod.parse=(l,p)=>{f??(f=r.value);const d=l.value;return i(d)?a&&u&&!1===p?.async&&!0!==p.jitless?(s||(s=(t=>{const n=r.value,s=n.symbolKeys,i=new ct(["payload","ctx"],{shape:t,inst:e,memo:o,syms:s}),a=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,u=(e,t)=>`\n let ${e}_ab = false;\n for (let i = 0; i < ${e}.issues.length; i++) {\n const iss = ${e}.issues[i];\n iss.path = iss.path ? [${t}, ...iss.path] : [${t}];\n payload.issues.push(iss);\n if (iss.continue !== true) ${e}_ab = true;\n }\n if (${e}_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }`;i.write("const input = payload.value;");const c=Object.create(null);let l=0;for(const e of n.allKeys)c[e]="key_"+l++;i.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const e of n.allKeys){if("__proto__"===e)continue;const n=c[e],r="symbol"==typeof e?`syms[${s.indexOf(e)}]`:_(e),o=`${r} in input`,l=t[e],f=l?._zod?.optin,p=void 0!==f,d="optional"===l?._zod?.optout;if(i.write(`const ${n} = ${a(r)};`),p&&d){const e="optional"===f?`${n}_present`:`${n}.value !== undefined || ${n}_present`;i.write(`\n const ${n}_present = ${o};\n if (!${n}.issues.length || ${n}_present) {\n if (${n}.issues.length) {${u(n,r)}\n }\n\n if (${e}) {\n newResult[${r}] = ${n}.value;\n }\n }\n\n `)}else p?(i.write(`\n if (${n}.issues.length) {${u(n,r)}\n }\n `),"defaulted"===f?i.write(`newResult[${r}] = ${n}.value;`):i.write(`\n if (${n}.value !== undefined || ${o}) {\n newResult[${r}] = ${n}.value;\n }\n `)):i.write(`\n const ${n}_present = ${o};\n if (${n}.issues.length) {${u(n,r)}\n }\n if (!${n}_present && !${n}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${r}]\n });\n if (ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (${n}_present) {\n newResult[${r}] = ${n}.value;\n }\n\n `)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),l=s(l,p),c?rn([],d,l,p,f,e,!0===p?.abortEarly):l):n(l,p):(l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l)}});function an(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!N(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>H(e,r,ce())))}),t)}const un=se("$ZodUnion",(e,t)=>{ft.init(e,t),Y(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),Y(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Y(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Y(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){const t=e.def.options.map(e=>e._zod.pattern);return new RegExp(`^(${t.map(e=>f(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},o);if(t instanceof Promise)i.push(t),s=!0;else{if(0===t.issues.length)return t;i.push(t)}}return s?Promise.all(i).then(t=>an(t,r,e,o)):an(i,r,e,o)}}),cn=se("$ZodIntersection",(e,t)=>{ft.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),s=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([t,n])=>fn(e,t,n)):fn(e,o,s)}});function ln(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(x(e)&&x(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const n of r){if("__proto__"===n)continue;const r=ln(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=ln(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fn(e,t,n){const r=new Map;let o;const s=new Map,i=(e,t)=>{let n;if("unrecognized_keys"!==e.code||e.path?.length){if("invalid_key"!==e.code||"record"!==e.origin||1!==e.path?.length)return!1;{const t=String(e.path[0]);s.has(t)||s.set(t,e),n=[t]}}else o??(o=e),n=e.keys;for(const e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(const n of t.issues)i(n,"l")||e.issues.push(n);for(const t of n.issues)i(t,"r")||e.issues.push(t);const a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length){const t=o?a.filter(e=>o.keys.includes(e)):[];t.length&&e.issues.push({...o,keys:t});for(const n of a)!t.includes(n)&&s.has(n)&&e.issues.push(s.get(n))}const u=ln(t.value,n.value);if(!u.valid){if(N(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}const pn=se("$ZodRecord",(e,t)=>{ft.init(e,t);const n=ue.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{const s=r.value;if(!x(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const i=[],a=t.keyType._zod.values;if(a&&!t.partial){r.value=n?n.alloc(e,r,{},o):{};const u=new Set;for(const n of a)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){if(u.add("number"==typeof n?n.toString():n),"__proto__"===n)continue;const a=t.keyType._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>H(e,o,ce())),input:n,path:[n],inst:e});continue}const c=a.value;if("__proto__"===c)continue;const l=t.valueType._zod.run({value:s[n],issues:[]},o);l instanceof Promise?i.push(l.then(e=>{e.issues.length&&r.issues.push(...F(n,e.issues)),r.value[c]=e.value})):(l.issues.length&&r.issues.push(...F(n,l.issues)),r.value[c]=l.value)}let c;for(const e in s)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;r.value[e]=s[e]}else c=c??[],c.push(e);c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}else{let u;r.value=n?n.alloc(e,r,{},o):{};for(const n of Reflect.ownKeys(s)){if("__proto__"===n)continue;if(!Object.prototype.propertyIsEnumerable.call(s,n))continue;let c=t.keyType._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof n&&Ue.test(n)&&c.issues.length){const e=t.keyType._zod.run({value:Number(n),issues:[]},o);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(c=e)}if(c.issues.length){"loose"===t.mode?r.value[n]=s[n]:a?(u=u??[],u.push(n)):r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(e=>H(e,o,ce())),input:n,path:[n],inst:e});continue}const l=c.value;if("__proto__"===l)continue;const f=t.valueType._zod.run({value:s[n],issues:[]},o);f instanceof Promise?i.push(f.then(e=>{e.issues.length&&r.issues.push(...F(n,e.issues)),r.value[l]=e.value})):(f.issues.length&&r.issues.push(...F(n,f.issues)),r.value[l]=f.value)}u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}return i.length?Promise.all(i).then(()=>r):r}}),dn=se("$ZodEnum",(e,t)=>{ft.init(e,t);const n=i(t.entries),r=new Set(n);e._zod.values=r,Y(e,"pattern",e=>{const t=i(e.def.entries).filter(e=>O.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>A(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,o)=>{const s=t.value;return r.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),hn=se("$ZodTransform",(e,t)=>{ft.init(e,t),e._zod.optin="optional",ue.memoizer?.guard(e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ae(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new ie;return n.value=o,n}});function mn(e,t){return e.value=t.issues.length?void 0:t.value,e}const gn=se("$ZodOptional",(e,t)=>{ft.init(e,t),Y(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",Y(e,"values",e=>{const t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Y(e,"pattern",e=>{const t=e.def.innerType._zod.pattern;return t?new RegExp(`^(${f(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;const r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>mn(e,t)):mn(e,r)}return t.innerType._zod.run(e,n)}}),yn=se("$ZodExactOptional",(e,t)=>{gn.init(e,t),Y(e,"values",e=>e.def.innerType._zod.values),Y(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),vn=se("$ZodNullable",(e,t)=>{ft.init(e,t),Y(e,"optin",e=>e.def.innerType._zod.optin),Y(e,"optout",e=>e.def.innerType._zod.optout),Y(e,"pattern",e=>{const t=e.def.innerType._zod.pattern;return t?new RegExp(`^(${f(t.source)}|null)$`):void 0}),Y(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),_n=se("$ZodDefault",(e,t)=>{ft.init(e,t),e._zod.optin="defaulted",Y(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>bn(e,t)):bn(r,t)}});function bn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const kn=se("$ZodPrefault",(e,t)=>{ft.init(e,t),e._zod.optin="defaulted",Y(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),wn=se("$ZodNonOptional",(e,t)=>{ft.init(e,t),Y(e,"values",e=>{const t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>xn(t,e)):xn(o,e)}});function xn(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function $n(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>H(e,r,ce()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const On=se("$ZodCatch",(e,t)=>{ft.init(e,t),Y(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),Y(e,"optout",e=>e.def.innerType._zod.optout),Y(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>$n(e,r,t,n)):$n(e,r,t,n)}}),An=se("$ZodPipe",(e,t)=>{ft.init(e,t),Y(e,"values",e=>e.def.in._zod.values),Y(e,"optin",e=>e.def.in._zod.optin),Y(e,"optout",e=>e.def.out._zod.optout),Y(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>En(e,t.in,n)):En(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>En(e,t.out,n)):En(r,t.out,n)}});function En(e,t,n){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Sn=se("$ZodReadonly",(e,t)=>{ft.init(e,t),Y(e,"propValues",e=>e.def.innerType._zod.propValues),Y(e,"values",e=>e.def.innerType._zod.values),Y(e,"optin",e=>e.def.innerType?._zod?.optin),Y(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(zn):zn(r)}});function zn(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Cn=se("$ZodCustom",(e,t)=>{qe.init(e,t),ft.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Tn(t,n,r,e));Tn(o,n,r,e)}});function Tn(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(q(e))}}var Rn;(Rn=globalThis).__zod_globalRegistry??(Rn.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const In=globalThis.__zod_globalRegistry;function Pn(e){return e.checks&&(e.checks=[...e.checks]),e}function Nn(e,t){return new Ge({check:"less_than",...S(t),value:e,inclusive:!1})}function jn(e,t){return new Ge({check:"less_than",...S(t),value:e,inclusive:!0})}function Fn(e,t){return new Ve({check:"greater_than",...S(t),value:e,inclusive:!1})}function Ln(e,t){return new Ve({check:"greater_than",...S(t),value:e,inclusive:!0})}function Zn(e,t){return new We({check:"multiple_of",...S(t),value:e})}function Dn(e,t){return new Qe({check:"max_length",...S(t),maximum:e})}function Hn(e,t){return new Ye({check:"min_length",...S(t),minimum:e})}function Un(e,t){return new et({check:"length_equals",...S(t),length:e})}function Mn(e){return new ut({check:"overwrite",tx:e})}function Bn(e,...t){for(const n of t)for(const t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&p(e,t,n[t]);return e}function qn(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??In,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Jn(e,t,n,r,o){const s="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if("any"===s)return!1;if(void 0===s||"throw"===s)throw new Error(o);return Object.assign(n,s),!0}function Kn(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,r);else{const n=i.schema,s=t.processors[o.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);s(e,t,n,r)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),Kn(s,t,r),t.seen.get(s).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Bn(i.schema,u),"input"===t.io&&rr(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Gn(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Vn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:s}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${o("__shared")}#/${r}/${Gn(s)}`}}const o=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:"#"};const s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:o+Gn(s)}})(t);r.def={...r.schema},s&&(r.defId=s);const i=r.schema;for(const e in i)delete i[e];i.$ref=o};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){o(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}const s=e.metadataRegistry.get(n[0])?.id;(s||r.cycle||r.count>1&&"ref"===e.reused)&&o(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Wn(e){const t=e.anyOf;if(!Array.isArray(t)||0===t.length||void 0!==e.type)return;const n=[];for(const e of t){if(!e||"object"!=typeof e)return;Wn(e);const t=Object.keys(e);if(1!==t.length||"type"!==t[0])return;const r=e.type;for(const e of Array.isArray(r)?r:[r]){if("string"!=typeof e)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=1===n.length?n[0]:n}const Xn=new Set(["type","properties","required","additionalProperties"]),Qn=["oneOf","anyOf"];function Yn(e){const t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function er(e){const t=[];for(const n of e){if("object"!=typeof n||"object"!==n.type)return null;for(const e in n)if(!Xn.has(e))return null;t.push(n)}const n={},r=new Set;for(const e of t){for(const r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;const e=[];for(const n of t){const t=n.properties?.[r]??Yn(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}p(n,r,1===e.length?e[0]:er(e)??{allOf:e})}for(const t of e.required??[])r.add(t)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(e=>!1===e.additionalProperties))o.additionalProperties=!1;else{const e=[];for(const n of t){const t=Yn(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?o.additionalProperties=e[0]:e.length>1&&(o.additionalProperties={allOf:e})}return o}function tr(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const t of Xn)if(t in e)return;const n=t.filter(e=>Qn.some(t=>Array.isArray(e[t])));let r=null;if(n.length){const e=n[0],o=Qn.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;const s=t.filter(t=>t!==e),i=e[o].map(e=>er([...s,e]));if(i.some(e=>!e))return;r={[o]:i}}else r=er(t);r&&(delete e.allOf,Bn(e,r))}function nr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,s={...o},i=n.ref;if(n.ref=null,i){r(i);const n=e.seen.get(i),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Bn(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Bn(o,s),t._zod.parent===i)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in s||delete o[e]);if(a.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==i){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(const t of e.seen.entries())Wn(t[1].def??t[1].schema);for(const t of e.deferred)t();if(e.intersections.length){const t=new Map;for(const n of e.seen.values())for(const e of[n.schema,n.def]){const n=e?.allOf;if(!Array.isArray(n))continue;const r=t.get(n);r?r.push(e):t.set(n,[e])}for(const n of e.intersections)for(const e of t.get(n)??[])tr(e)}}const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Bn(o,n.defId?n.schema:n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;void 0!==s&&o.id===s&&delete o.id;const i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,p(i,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?o.$defs=i:o.definitions=i);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:or(t,"input",e.processors),output:or(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function rr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return rr(r.element,n);if("set"===r.type)return rr(r.valueType,n);if("lazy"===r.type)return rr(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type||"catch"===r.type)return rr(r.innerType,n);if("intersection"===r.type)return rr(r.left,n)||rr(r.right,n);if("record"===r.type||"map"===r.type)return rr(r.keyType,n)||rr(r.valueType,n);if("pipe"===r.type)return!!e._zod.traits.has("$ZodCodec")||rr(r.in,n)||rr(r.out,n);if("object"===r.type){for(const e in r.shape)if(rr(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(rr(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(rr(e,n))return!0;return!(!r.rest||!rr(r.rest,n))}return!1}const or=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=qn({...o??{},target:s,io:t,processors:n});return Kn(e,i),Vn(i,e),nr(i,e)},sr=(e,t,n)=>{(void 0===e[t]||n>e[t])&&(e[t]=n)},ir=(e,t,n)=>{(void 0===e[t]||n<e[t])&&(e[t]=n)},ar=(e,t)=>{sr(e,"minimum",t),ir(e,"maximum",t)},ur=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},cr=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},lr=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},fr=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},pr=(e,t)=>sr(e,"minimum",t.minimum),dr=(e,t)=>ir(e,"maximum",t.maximum),hr=e=>(t,n)=>{fr(t,n.format);const[r,o]=e[n.format];sr(t,"minimum",r),ir(t,"maximum",o)},mr={greater_than:(e,t)=>sr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ir(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>ur(e,t.value),number_format:hr(C),bigint_format:hr(T),min_length:pr,max_length:dr,length_equals:(e,t)=>ar(e,t.length),min_size:pr,max_size:dr,size_equals:(e,t)=>ar(e,t.size),string_format:(e,t)=>{fr(e,t.format),t.pattern&&cr(e,t.pattern),"base64"!==t.format&&"base64url"!==t.format||(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>lr(e,t.mime)};function gr(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const e of r)mr[e._zod.def.check]?.(t,e._zod.def);const o=e._zod.bag;void 0!==o.minimum&&sr(t,"minimum",o.minimum),void 0!==o.exclusiveMinimum&&sr(t,"exclusiveMinimum",o.exclusiveMinimum),void 0!==o.maximum&&ir(t,"maximum",o.maximum),void 0!==o.exclusiveMaximum&&ir(t,"exclusiveMaximum",o.exclusiveMaximum),void 0!==o.multipleOf&&ur(t,o.multipleOf),void 0!==o.format&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&lr(t,o.mime);for(const e of o.patterns??[])cr(t,e);return t}const yr={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vr=new Map([[Ht,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[Mt,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),_r=e=>vr.get(e)??e;function br(e){const t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?br(t.out):"catch"===t.type?br(t.innerType):e._zod.optin}function kr(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const r=e.get(t)?.def;if(!r)return t;const o=kr(e,r,n);return o===r?t:o}for(const r of["anyOf","oneOf"]){const o=t[r];if(!Array.isArray(o))continue;const s=o.map(t=>kr(e,t,n));s.some((e,t)=>e!==o[t])&&(t={...t,[r]:s})}const r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(e=>"number"===e||"integer"===e),s=t.enum??(void 0!==t.const?[t.const]:void 0);if(!o&&!s?.some(e=>"number"==typeof e))return t;const{minimum:i,maximum:a,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:l,format:f,id:p,...d}=t;return d.enum?d.enum=d.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof d.const&&(d.const=String(d.const)),o?(d.type="string",s||(d.pattern=(r.includes("number")?Ue:He).source),d):d}const wr=new WeakMap,xr=Symbol();function $r(e,t,n,r,o){let s=!1;const i=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(s=!0,null));return s?(Jn(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),xr):JSON.parse(i)}const Or=(e,t,n,r)=>{const o=e._zod.def;Kn(o.innerType,t,r),t.seen.get(e).ref=o.innerType},Ar=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return e=>{switch(e.code){case"invalid_type":return`Invalid input: expected ${o(e.expected)}, received ${o(function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}(e.input),e.input)}`;case"invalid_value":return 1===e.values.length?`Invalid input: expected ${z(e.values[0])}`:`Invalid option: expected one of ${a(e.values,"|")}`;case"too_big":{const n=e.exact?"exactly ":e.inclusive?"<=":"<",r=t(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${n}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${n}${e.maximum.toString()}`}case"too_small":{const n=e.exact?"exactly ":e.inclusive?">=":">",r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case"invalid_format":{const t=e;return"starts_with"===t.format?`Invalid string: must start with "${t.prefix}"`:"ends_with"===t.format?`Invalid string: must end with "${t.suffix}"`:"includes"===t.format?`Invalid string: must include "${t.includes}"`:"regex"===t.format?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${a(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(" | ")}`:!1===e.inclusive?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`;default:return"Invalid input"}}},Er={get:function(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,u,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},Sr={value:void 0,enumerable:!1},zr=new WeakSet([Object.prototype,Error.prototype]),Cr=(e,t)=>{e.name="$ZodError",Sr.value=t,Object.defineProperty(e,"issues",Sr),Sr.value=void 0,Object.defineProperty(e,"message",Er);const n=Object.getPrototypeOf(e);zr.has(n)||(zr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Tr=se("$ZodError",Cr);function Rr(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||("__proto__"===t?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Ir(e,t){return{callee:t?.callee??e,Err:t?.Err}}se("$ZodError",Cr,void 0,{Parent:Error});const Pr=e=>{const t=(n,r,o,s)=>{const i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new ie;if(a.issues.length){const n=new(s?.Err??e)(a.issues.map(e=>H(e,i,ce())));throw b(n,s?.callee??t),n}return a.value};return t},Nr=e=>{const t=async(n,r,o,s)=>{const i=o?{...o,async:!0}:{async:!0};let a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const n=new(s?.Err??e)(a.issues.map(e=>H(e,i,ce())));throw b(n,s?.callee??t),n}return a.value};return t},jr=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new ie;return s.issues.length?Fr(e,s.issues,o):{success:!0,data:s.value}};function Fr(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>H(e,n,ce()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Lr=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Fr(e,s.issues,o):{success:!0,data:s.value}},Zr=Symbol.for("zod.compile.invalid"),Dr=Symbol.for("zod.compile.fallback"),Hr=e=>{const t=Pr(e),n=(e,r,o,s)=>{const i=o?{...o,direction:"backward"}:{direction:"backward"};return t(e,r,i,Ir(n,s))};return n},Ur=e=>{const t=Pr(e),n=(e,r,o,s)=>t(e,r,o,Ir(n,s));return n},Mr=e=>{const t=Nr(e),n=async(e,r,o,s)=>{const i=o?{...o,direction:"backward"}:{direction:"backward"};return await t(e,r,i,Ir(n,s))};return n},Br=e=>{const t=Nr(e),n=async(e,r,o,s)=>await t(e,r,o,Ir(n,s));return n},qr=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return jr(e)(t,n,o)},Jr=e=>(t,n,r)=>jr(e)(t,n,r),Kr=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Lr(e)(t,n,o)},Gr=e=>async(t,n,r)=>Lr(e)(t,n,r),Vr=new WeakSet([Object.prototype,Error.prototype]);function Wr(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const Xr=(e,t)=>{Tr.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Vr.has(n)||(Vr.add(n),Wr(n,"format",e=>t=>function(e,t=e=>e.message){const n={_errors:[]},r=(e,o=[])=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e},[...o,...s.path]));else if("invalid_key"===s.code)r({issues:s.issues},[...o,...s.path]);else if("invalid_element"===s.code)r({issues:s.issues},[...o,...s.path]);else{const e=[...o,...s.path];if(0===e.length)n._errors.push(t(s));else{let r=n,o=0;for(;o<e.length;){const n=e[o],i=o===e.length-1;if("_errors"===n){i&&r._errors.push(t(s)),o++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const a=r[n];i&&a._errors.push(t(s)),r=a,o++}}}};return r(e),n}(e,t)),Wr(n,"flatten",e=>t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?Rr(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)),Wr(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,u,2)}),Wr(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,u,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},Qr=se("ZodError",Xr,void 0,{Parent:Error}),Yr=Pr(Qr),eo=Nr(Qr),to=jr(Qr),no=Lr(Qr),ro=Hr(Qr),oo=Ur(Qr),so=Mr(Qr),io=Br(Qr),ao=qr(Qr),uo=Jr(Qr),co=Kr(Qr),lo=Gr(Qr);function fo(){ue.memoizer||ce({memoizer:_e})}const po=se("ZodType",(e,t)=>(ue.localeError||ce({localeError:Ar()}),ft.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(v(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return E(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...S(n)})}(gs,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return function(e,t){const n=function(e,t){const n=new qe({check:"custom",...S(t)});return n._zod.check=e,n}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(q(e,t.value,n._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=t.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),t.issues.push(q(r))}},e(t.value,t)),t);return n}(e,t)}(e,t))},overwrite(e){return this.check(Mn(e))},optional(){return ss(this)},exactOptional(){return new is({type:"optional",innerType:this})},nullable(){return us(this)},nullish(){return ss(us(this))},nonoptional(e){return function(e,t){return new fs({type:"nonoptional",innerType:e,...S(t)})}(this,e)},array(){return Go(this)},or(e){return Qo([this,e])},and(e){return new Yo({type:"intersection",left:this,right:e})},transform(e){return hs(this,new rs({type:"transform",transform:e}))},default(e){return t=e,new cs({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():$(t)}});var t},prefault(e){return t=e,new ls({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():$(t)}});var t},catch(e){return new ps({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:ee(t)});var t},pipe(e){return hs(this,e)},readonly(){return new ms({type:"readonly",innerType:this})},describe(e){const t=this.clone();return In.add(t,{description:e}),t},meta(...e){if(0===e.length)return In.get(this);const t=this.clone();return In.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return K(this,"~standard",{...dt(this),jsonSchema:{input:or(this,"input"),output:or(this,"output")}})},set"~standard"(e){J(this,"~standard",e)},parse:function e(t,n){return Yr(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await eo(this,t,n,{callee:e})},safeParse(e,t){return to(this,e,t)},async safeParseAsync(e,t){return no(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){J(this,"spa",e)},validate(e,t){return((e,t,n)=>{const r=e._zod.bag.validator;if(void 0!==r){if(r(t)!==Zr)return!0;if(!0===r.definite&&void 0===n)return!1}return function(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let s;if(o?(r[Dr]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new ie;return 0===s.issues.length}(e,t,n)})(this,e,t)},validateAsync(e,t){return(async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),0===o.issues.length})(this,e,t)},encode:function e(t,n){return ro(this,t,n,{callee:e})},decode:function e(t,n){return oo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await so(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await io(this,t,n,{callee:e})},safeEncode(e,t){return ao(this,e,t)},safeDecode(e,t){return uo(this,e,t)},async safeEncodeAsync(e,t){return co(this,e,t)},async safeDecodeAsync(e,t){return lo(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{const r=qn({...n,processors:t});return Kn(e,r),Vn(r,e),nr(r,e)})(this,{})(e)},get description(){return In.get(this)?.description},get _def(){return this._zod.def}}),ho=se("_ZodString",(e,t)=>{ht.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:s,format:i,patterns:a,contentEncoding:u,laxFormat:c}=gr(e);if("number"==typeof o&&(r.minLength=o),"number"==typeof s&&(r.maxLength=s),i&&(r.format=yr[i]??i,""===r.format&&delete r.format,("time"===i||c)&&delete r.format),u&&(r.contentEncoding=u),a&&a.size>0){const e=[...a].map(_r);1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n)},G({format:e=>gr(e).format??null,minLength:e=>gr(e).minimum??null,maxLength:e=>gr(e).maximum??null},{regex(...e){return this.check(function(e,t){return new nt({check:"string_format",format:"regex",...S(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new st({check:"string_format",format:"includes",...S(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new it({check:"string_format",format:"starts_with",...S(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new at({check:"string_format",format:"ends_with",...S(t),suffix:e})}(...e))},min(...e){return this.check(Hn(...e))},max(...e){return this.check(Dn(...e))},length(...e){return this.check(Un(...e))},nonempty(...e){return this.check(Hn(1,...e))},lowercase(e){return this.check(function(e){return new rt({check:"string_format",format:"lowercase",...S(e)})}(e))},uppercase(e){return this.check(function(e){return new ot({check:"string_format",format:"uppercase",...S(e)})}(e))},trim(){return this.check(Mn(e=>e.trim()))},normalize(...e){return this.check(function(e){return Mn(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(Mn(e=>e.toLowerCase()))},toUpperCase(){return this.check(Mn(e=>e.toUpperCase()))},slugify(){return this.check(Mn(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})),mo=se("ZodString",(e,t)=>{ht.init(e,t),ho.init(e,t)},{email(e){return this.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...S(t)})}(wo,e))},url(e){return this.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...S(t)})}(Oo,e))},jwt(e){return this.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...S(t)})}(Do,e))},emoji(e){return this.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...S(t)})}(Ao,e))},guid(e){return this.check(function(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...S(t)})}(xo,e))},uuid(e){return this.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...S(t)})}($o,e))},uuidv4(e){return this.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(t)})}($o,e))},uuidv6(e){return this.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(t)})}($o,e))},uuidv7(e){return this.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(t)})}($o,e))},nanoid(e){return this.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(t)})}(Eo,e))},cuid(e){return this.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...S(t)})}(So,e))},cuid2(e){return this.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(t)})}(zo,e))},ulid(e){return this.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...S(t)})}(Co,e))},base64(e){return this.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...S(t)})}(Fo,e))},base64url(e){return this.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...S(t)})}(Lo,e))},xid(e){return this.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...S(t)})}(To,e))},ksuid(e){return this.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(t)})}(Ro,e))},ipv4(e){return this.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(t)})}(Io,e))},ipv6(e){return this.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(t)})}(Po,e))},cidrv4(e){return this.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(t)})}(No,e))},cidrv6(e){return this.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(t)})}(jo,e))},e164(e){return this.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...S(t)})}(Zo,e))},datetime(e){return this.check(function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(t)})}(vo,e))},date(e){return this.check(function(e,t){return new e({type:"string",format:"date",check:"string_format",...S(t)})}(_o,e))},time(e){return this.check(function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...S(t)})}(bo,e))},duration(e){return this.check(function(e,t){return new e({type:"string",format:"duration",check:"string_format",...S(t)})}(ko,e))}});function go(e){return function(e,t){return new e(Pn({type:"string",...S(t)}))}(mo,e)}const yo=se("ZodStringFormat",(e,t)=>{mt.init(e,t),ho.init(e,t)}),vo=se("ZodISODateTime",(e,t)=>{Ct.init(e,t),yo.init(e,t)}),_o=se("ZodISODate",(e,t)=>{Tt.init(e,t),yo.init(e,t)}),bo=se("ZodISOTime",(e,t)=>{Rt.init(e,t),yo.init(e,t)}),ko=se("ZodISODuration",(e,t)=>{It.init(e,t),yo.init(e,t)}),wo=se("ZodEmail",(e,t)=>{vt.init(e,t),yo.init(e,t)}),xo=se("ZodGUID",(e,t)=>{gt.init(e,t),yo.init(e,t)}),$o=se("ZodUUID",(e,t)=>{yt.init(e,t),yo.init(e,t)}),Oo=se("ZodURL",(e,t)=>{wt.init(e,t),yo.init(e,t)}),Ao=se("ZodEmoji",(e,t)=>{xt.init(e,t),yo.init(e,t)}),Eo=se("ZodNanoID",(e,t)=>{$t.init(e,t),yo.init(e,t)}),So=se("ZodCUID",(e,t)=>{Ot.init(e,t),yo.init(e,t)}),zo=se("ZodCUID2",(e,t)=>{At.init(e,t),yo.init(e,t)}),Co=se("ZodULID",(e,t)=>{Et.init(e,t),yo.init(e,t)}),To=se("ZodXID",(e,t)=>{St.init(e,t),yo.init(e,t)}),Ro=se("ZodKSUID",(e,t)=>{zt.init(e,t),yo.init(e,t)}),Io=se("ZodIPv4",(e,t)=>{Pt.init(e,t),yo.init(e,t)}),Po=se("ZodIPv6",(e,t)=>{Ft.init(e,t),yo.init(e,t)}),No=se("ZodCIDRv4",(e,t)=>{Lt.init(e,t),yo.init(e,t)}),jo=se("ZodCIDRv6",(e,t)=>{Zt.init(e,t),yo.init(e,t)}),Fo=se("ZodBase64",(e,t)=>{Ut.init(e,t),yo.init(e,t)}),Lo=se("ZodBase64URL",(e,t)=>{Bt.init(e,t),yo.init(e,t)}),Zo=se("ZodE164",(e,t)=>{qt.init(e,t),yo.init(e,t)}),Do=se("ZodJWT",(e,t)=>{Jt.init(e,t),yo.init(e,t)}),Ho=se("ZodNumber",(e,t)=>{Kt.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c,isInt:l}=gr(e);o.type=l?"integer":"number";const f="number"==typeof c&&c>=(s??Number.NEGATIVE_INFINITY),p="number"==typeof u&&u<=(i??Number.POSITIVE_INFINITY),d="draft-04"===t.target||"openapi-3.0"===t.target;if(f?d?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c:"number"==typeof s&&(o.minimum=s),p?d?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:"number"==typeof i&&(o.maximum=i),a){const n=new Set;for(const s of a)Number.isFinite(s)&&0!==s?n.add(Math.abs(s)):Jn(e,t,o,r,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`);const[s,...i]=n;void 0!==s&&(o.multipleOf=s),i.length&&(o.allOf=[...o.allOf??[],...i.map(e=>({multipleOf:e}))])}})(e,t,n,r),e.isFinite=!0},G({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=gr(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=gr(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=gr(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>gr(e).format??null},{gt(e,t){return this.check(Fn(e,t))},gte(e,t){return this.check(Ln(e,t))},min(e,t){return this.check(Ln(e,t))},lt(e,t){return this.check(Nn(e,t))},lte(e,t){return this.check(jn(e,t))},max(e,t){return this.check(jn(e,t))},int(e){return this.check(Mo(e))},safe(e){return this.check(Mo(e))},positive(e){return this.check(Fn(0,e))},nonnegative(e){return this.check(Ln(0,e))},negative(e){return this.check(Nn(0,e))},nonpositive(e){return this.check(jn(0,e))},multipleOf(e,t){return this.check(Zn(e,t))},step(e,t){return this.check(Zn(e,t))},finite(){return this}}));const Uo=se("ZodNumberFormat",(e,t)=>{Gt.init(e,t),Ho.init(e,t)});function Mo(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...S(t)})}(Uo,e)}const Bo=se("ZodUnknown",(e,t)=>{Vt.init(e,t),po.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function qo(){return new Bo({type:"unknown"})}const Jo=se("ZodNever",(e,t)=>{Wt.init(e,t),po.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});const Ko=se("ZodArray",(e,t)=>{fo(),Yt.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=gr(e);"number"==typeof i&&(o.minItems=i),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=Kn(s.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Hn(e,t))},nonempty(e){return this.check(Hn(1,e))},max(e,t){return this.check(Dn(e,t))},length(e,t){return this.check(Un(e,t))},unwrap(){return this.element}});function Go(e,t){return function(e,t,n){return new e({type:"array",element:t,...S(n)})}(Ko,e,t)}const Vo=se("ZodObject",(e,t)=>{fo(),sn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Jn(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const e in i)p(o.properties,e,Kn(i[e],t,{...r,path:[...r.path,"properties",e]}));const a=[];for(const e of Object.keys(i)){const n=s.shape[e];("input"===t.io?void 0===br(n):void 0===n._zod.optout)&&a.push(e)}a.length>0&&(o.required=a),"never"===s.catchall?._zod.def.type?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Kn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),function(e,t,n,r){const o=function(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return ns(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(v(this._zod.def,{catchall:e}))},passthrough(){return this.clone(v(this._zod.def,{catchall:qo()}))},loose(){return this.clone(v(this._zod.def,{catchall:qo()}))},strict(){return this.clone(v(this._zod.def,{catchall:function(e,t){return new e({type:"never",...S(t)})}(Jo,e)}));var e},strip(){return this.clone(v(this._zod.def,{catchall:void 0}))},extend(e){return function(e,t){if(!x(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=h(e);for(const e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,v(e._zod.def,{shape:I(e,t)}))}(this,e)},safeExtend(e){return function(e,t){if(!x(t))throw new Error("Invalid input to safeExtend: expected a plain object");return E(e,v(e._zod.def,{shape:I(e,t)}))}(this,e)},merge(e){return function(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};return y(n,e,Reflect.ownKeys(h(e))),y(n,t,Reflect.ownKeys(h(t))),E(e,v(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}(this,e)},pick(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o={};return y(o,e,R(e,t)),E(e,v(n,{shape:o,checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=new Set(R(e,t)),s={};return y(s,e,Reflect.ownKeys(h(e)).filter(e=>!o.has(e))),E(e,v(n,{shape:s,checks:[]}))}(this,e)},partial(...e){return P(os,this,e[0])},exactPartial(...e){return P(is,this,e[0],"exactPartial")},required(...e){return function(e,t,n){const r=n?new Set(R(t,n)):void 0,o={};return y(o,t,Reflect.ownKeys(h(t)),(t,n)=>r&&!r.has(n)?t:new e({type:"nonoptional",innerType:t})),E(t,v(t._zod.def,{shape:o}))}(fs,this,e[0])}});function Wo(e,t){const n={type:"object",shape:e??{},...S(t)};return new Vo(n)}const Xo=se("ZodUnion",(e,t)=>{un.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=!1===o.inclusive,i=o.options.map((e,n)=>Kn(e,t,{...r,path:[...r.path,s?"oneOf":"anyOf",n]}));s?n.oneOf=i:n.anyOf=i})(e,t,n,r),e.options=t.options});function Qo(e,t){return new Xo({type:"union",options:e,...S(t)})}const Yo=se("ZodIntersection",(e,t)=>{cn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=Kn(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=Kn(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=u,t.intersections.push(u)})(e,t,n,r)}),es=se("ZodRecord",(e,t)=>{fo(),pn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const i=s.keyType,a=gr(i).patterns;if("loose"===s.mode&&a&&a.size>0){const e=Kn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const t of a)p(o.patternProperties,_r(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){o.propertyNames=Kn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]});let n=wr.get(t);n||(n=[],wr.set(t,n),t.deferred.push(()=>function(e){const t=new Map;for(const n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);const n=new Map;for(const r of wr.get(e)??[]){const o=e.seen.get(r),s=(o?.def??o?.schema)?.propertyNames;if(!s||!0===s||n.has(s))continue;const i=kr(t,s,new Set);i!==s&&n.set(s,i)}if(n.size)for(const t of e.seen.values())for(const e of[t.schema,t.def]){const t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}(t))),n.push(e)}o.additionalProperties=Kn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const u=i._zod.values,c="input"===t.io&&void 0!==br(s.valueType);if(u&&!s.partial&&!c){const e=[...u].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(o.required=e.map(String))}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});const ts=se("ZodEnum",(e,t)=>{dn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=i(e._zod.def.entries);0!==r.length?(r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r):n.not={}})(e,0,n),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new ts({...t,checks:[],...S(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new ts({...t,checks:[],...S(r),entries:o})}});function ns(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ts({type:"enum",entries:n,...S(t)})}const rs=se("ZodTransform",(e,t)=>{fo(),hn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{Jn(e,t,n,r,"Transforms cannot be represented in JSON Schema")})(e,t,n,r),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ae(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(q(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),"input"in t||(t.input=n.value),t.inst??(t.inst=e),n.issues.push(q(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}});const os=se("ZodOptional",(e,t)=>{gn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Or(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function ss(e){return new os({type:"optional",innerType:e})}const is=se("ZodExactOptional",(e,t)=>{yn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Or(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),as=se("ZodNullable",(e,t)=>{vn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=Kn(o.innerType,t,r),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function us(e){return new as({type:"nullable",innerType:e})}const cs=se("ZodDefault",(e,t)=>{_n.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kn(o.innerType,t,r),t.seen.get(e).ref=o.innerType;const s=$r(o.defaultValue,e,t,n,r);s!==xr&&(n.default=s)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ls=se("ZodPrefault",(e,t)=>{kn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;if(Kn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"!==t.io)return;const s=$r(o.defaultValue,e,t,n,r);s!==xr&&(n._prefault=s)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),fs=se("ZodNonOptional",(e,t)=>{wn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kn(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),ps=se("ZodCatch",(e,t)=>{On.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let s;Kn(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{s=o.catchValue(void 0)}catch{return void Jn(e,t,n,r,"Dynamic catch values are not supported in JSON Schema")}n.default=s})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ds=se("ZodPipe",(e,t)=>{An.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i="input"===t.io?s?o.out:o.in:o.out;Kn(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function hs(e,t){return new ds({type:"pipe",in:e,out:t})}const ms=se("ZodReadonly",(e,t)=>{Sn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kn(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),gs=se("ZodCustom",(e,t)=>{Cn.init(e,t),po.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{Jn(e,t,n,r,"Custom types cannot be represented in JSON Schema")})(e,t,n,r)});var ys=r(8141),vs=r(9889),_s=r(4269),bs=r(4402);const ks=ns(["off","info","warning","error"]),ws=ns(["ignored","info","warning","error"]),xs={file:go().min(1),rule:go().refine(bs.KX,"unknown rule")},$s=Qo([Wo({...xs,identifier:go().min(1)}).strict(),Wo({...xs,message:go().min(1),occurrence:function(e,t){return new e(Pn({type:"number",checks:[],...S(t)}))}(Ho,Os).int().positive()}).strict()]);var Os;function As(e,t){return e.excludes.some(({base:e,glob:n})=>{const r=s.relative(e,t);return!r.startsWith("..")&&!s.isAbsolute(r)&&(0,ys.kt)(r.split(s.sep).join("/"),n)})}function Es(){const t=process.env.XDG_CACHE_HOME||s.join(e(),".cache");return s.join(t,"prairielearn-navigator","schemas")}function Ss(e,t={}){const n={plVersion:"latest",schemaCacheDir:Es(),rules:{},ignoredDiagnostics:[],excludes:[],...t.defaults},r=[],i=t.configPath??(e?s.join(e,".pl-navigator.jsonc"):void 0);let a;if(i&&o.existsSync(i)){a=s.resolve(i);const e=(0,vs.ye)(o.readFileSync(a,"utf-8"));for(const t of e.errors)r.push({file:a,startOffset:t.offset,endOffset:t.offset+t.length,message:`invalid JSON: ${t.message}`,severity:"error"});Rs(n,e.value,s.dirname(a),(t,n,o="error")=>r.push({file:a,...(0,vs.be)(e,n,{key:"warning"===o}),message:t,severity:o}))}else t.configPath&&r.push({startOffset:0,endOffset:0,message:`config file not found: ${t.configPath}`,severity:"error"});return t.overrides&&Rs(n,t.overrides,t.overridesBaseDir??process.cwd(),(e,t,n="error")=>r.push({startOffset:0,endOffset:0,message:e,severity:n})),{config:n,file:a,problems:r}}function zs(e,t,n){return(r,o,s)=>{const i=e.safeParse(o,t?{error:()=>t}:void 0);i.success?n(i.data,s):s.report(i.error.issues[0].message,[r])}}const Cs=Object.fromEntries(Object.entries({unusedQuestions:"unused-question",unusedTags:"unused-tag",unusedAssessmentSets:"unused-assessment-set",missingQuestionInfo:"question-info-missing"}).map(([e,t])=>[e,zs(ws,`${e} must be "ignored", "info", "warning", or "error"`,(e,{config:n})=>{n.rules={...n.rules,[t]:"ignored"===e?"off":e}})])),Ts={plVersion:zs(qo().transform((e,t)=>{const n=(0,_s.rx)(e);return n?(t.addIssue({code:"custom",message:n}),ne):e}),void 0,(e,{config:t})=>{t.plVersion=e}),schemaCacheDir:zs(go().min(1),"schemaCacheDir must be a non-empty string",(t,{config:n,baseDir:r})=>{var o;n.schemaCacheDir=s.resolve(r,"~"===(o=t)||o.startsWith("~/")?s.join(e(),o.slice(1)):o)}),excludes:zs(Go(go().min(1)),"excludes must be an array of glob patterns",(e,{config:t,baseDir:n})=>{t.excludes=[...t.excludes,...e.map(e=>({base:n,glob:e.replace(/^\.\//,"")}))]}),ignoredDiagnostics:zs(Go($s),"ignoredDiagnostics must be an array of diagnostic suppressions",(e,{config:t,baseDir:n})=>{t.ignoredDiagnostics=[...t.ignoredDiagnostics,...e.map(e=>({...e,file:s.resolve(n,e.file),rule:e.rule}))]}),rules:zs(function(e,t,n){return t&&t._zod?new es({type:"record",keyType:e,valueType:t,...S(n)}):new es({type:"record",keyType:go(),valueType:e,...S(t)})}(go(),qo()),'rules must be an object of rule id to "off" | "info" | "warning" | "error"',(e,{config:t,report:n})=>{for(const[r,o]of Object.entries(e)){const e=ks.safeParse(o);(0,bs.KX)(r)?e.success?t.rules={...t.rules,[r]:e.data}:n(`rule "${r}" must be "off", "info", "warning", or "error"`,["rules",r]):n(`unknown rule "${r}"`,["rules",r],"warning")}}),...Cs};function Rs(e,t,n,r){if(void 0!==t)if("object"!=typeof t||null===t||Array.isArray(t))r("config must be an object",[]);else for(const[o,s]of Object.entries(t))void 0!==s&&"$schema"!==o&&(Object.hasOwn(Ts,o)?Ts[o](o,s,{config:e,baseDir:n,report:r}):r(`unknown config key "${o}"`,[o],"warning"))}Object.keys(Ts)},8141(e,t,n){n.d(t,{bo:()=>u,kt:()=>a});var r=n(5663),o=n(5157),s=n.n(o);const i=new Map;function a(e,t){let n=i.get(t);return n||(n=s()(t,{dot:!0}),i.set(t,n)),n(e)}function u(e,t){return r.relative(e,t).split(r.sep).join("/")}n.d(t,["l$",0,{course:"infoCourse.json",courseInstance:"courseInstances/**/infoCourseInstance.json",assessment:"courseInstances/**/assessments/**/infoAssessment.json",question:"questions/**/info.json",element:"elements/*/info.json",elementExtension:"elementExtensions/*/*/info.json"},"mU",0,"questions/**/question.html"])},1656(e,t,n){n.d(t,{b:()=>o});const r=/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function o(e,t){const n=function(e){return e.replace(/<!--[\s\S]*?(?:-->|$)/g,e=>e.replace(/[^\n]/g," "))}(e),r=n.toLowerCase(),o=`<${t.toLowerCase()}`,a=[];for(let e=r.indexOf(o);-1!==e;e=r.indexOf(o,e+1)){const t=e+o.length;if(!/[\s/>]/.test(n[t]??""))continue;const r=s(n,t);if(-1===r)break;a.push({startOffset:e,endOffset:r+1,attributes:i(n.slice(t,r),t)}),e=r}return a}function s(e,t){let n;for(let r=t;r<e.length;r++){const t=e[r];if(n)t===n&&(n=void 0);else if('"'===t||"'"===t)n=t;else if(">"===t)return r}return-1}function i(e,t){const n=new Map;for(const o of e.matchAll(r)){const e=o[1].toLowerCase();if(n.has(e))continue;const r=o[2]??o[3]??o[4]??"",s=void 0!==o[2]||void 0!==o[3],i=t+o.index+o[0].length-(s?1:0);n.set(e,{value:r,startOffset:i-r.length,endOffset:i})}return n}},9889(e,t,n){function r(e){return 32===e||9===e}function o(e){return 10===e||13===e}function s(e){return e>=48&&e<=57}var i;n.d(t,{ye:()=>v,pX:()=>b,ox:()=>w,be:()=>k,Zu:()=>_}),function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"}(i||(i={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const a=200;var u,c,l;function f(e,t,n=u.DEFAULT){const i=function(e,t=!1){const n=e.length;let i=0,a="",u=0,c=16,l=0,f=0,p=0,d=0,h=0;function m(t,n){let r=0,o=0;for(;r<t||!n;){let t=e.charCodeAt(i);if(t>=48&&t<=57)o=16*o+t-48;else if(t>=65&&t<=70)o=16*o+t-65+10;else{if(!(t>=97&&t<=102))break;o=16*o+t-97+10}i++,r++}return r<t&&(o=-1),o}function g(){if(a="",h=0,u=i,f=l,d=p,i>=n)return u=n,c=17;let t=e.charCodeAt(i);if(r(t)){do{i++,a+=String.fromCharCode(t),t=e.charCodeAt(i)}while(r(t));return c=15}if(o(t))return i++,a+=String.fromCharCode(t),13===t&&10===e.charCodeAt(i)&&(i++,a+="\n"),l++,p=i,c=14;switch(t){case 123:return i++,c=1;case 125:return i++,c=2;case 91:return i++,c=3;case 93:return i++,c=4;case 58:return i++,c=6;case 44:return i++,c=5;case 34:return i++,a=function(){let t="",r=i;for(;;){if(i>=n){t+=e.substring(r,i),h=2;break}const s=e.charCodeAt(i);if(34===s){t+=e.substring(r,i),i++;break}if(92!==s){if(s>=0&&s<=31){if(o(s)){t+=e.substring(r,i),h=2;break}h=6}i++}else{if(t+=e.substring(r,i),i++,i>=n){h=2;break}switch(e.charCodeAt(i++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const e=m(4,!0);e>=0?t+=String.fromCharCode(e):h=4;break;default:h=5}r=i}}return t}(),c=10;case 47:const r=i-1;if(47===e.charCodeAt(i+1)){for(i+=2;i<n&&!o(e.charCodeAt(i));)i++;return a=e.substring(r,i),c=12}if(42===e.charCodeAt(i+1)){i+=2;const t=n-1;let s=!1;for(;i<t;){const t=e.charCodeAt(i);if(42===t&&47===e.charCodeAt(i+1)){i+=2,s=!0;break}i++,o(t)&&(13===t&&10===e.charCodeAt(i)&&i++,l++,p=i)}return s||(i++,h=1),a=e.substring(r,i),c=13}return a+=String.fromCharCode(t),i++,c=16;case 45:if(a+=String.fromCharCode(t),i++,i===n||!s(e.charCodeAt(i)))return c=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return a+=function(){let t=i;if(48===e.charCodeAt(i))i++;else for(i++;i<e.length&&s(e.charCodeAt(i));)i++;if(i<e.length&&46===e.charCodeAt(i)){if(i++,!(i<e.length&&s(e.charCodeAt(i))))return h=3,e.substring(t,i);for(i++;i<e.length&&s(e.charCodeAt(i));)i++}let n=i;if(i<e.length&&(69===e.charCodeAt(i)||101===e.charCodeAt(i)))if(i++,(i<e.length&&43===e.charCodeAt(i)||45===e.charCodeAt(i))&&i++,i<e.length&&s(e.charCodeAt(i))){for(i++;i<e.length&&s(e.charCodeAt(i));)i++;n=i}else h=3;return e.substring(t,n)}(),c=11;default:for(;i<n&&y(t);)i++,t=e.charCodeAt(i);if(u!==i){switch(a=e.substring(u,i),a){case"true":return c=8;case"false":return c=9;case"null":return c=7}return c=16}return a+=String.fromCharCode(t),i++,c=16}}function y(e){if(r(e)||o(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}return{setPosition:function(e){i=e,a="",u=0,c=16,h=0},getPosition:()=>i,scan:t?function(){let e;do{e=g()}while(e>=12&&e<=15);return e}:g,getToken:()=>c,getTokenValue:()=>a,getTokenOffset:()=>u,getTokenLength:()=>i-u,getTokenStartLine:()=>f,getTokenStartCharacter:()=>u-d,getTokenError:()=>h}}(e,!1),a=[];let c=0;function l(e){return e?t=>0===c&&e(t,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter()):()=>!0}function f(e){return e?t=>0===c&&e(t,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter(),()=>a.slice()):()=>!0}function p(e){return e?()=>{c>0?c++:!1===e(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter(),()=>a.slice())&&(c=1)}:()=>!0}function d(e){return e?()=>{c>0&&c--,0===c&&e(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:()=>!0}const h=p(t.onObjectBegin),m=f(t.onObjectProperty),g=d(t.onObjectEnd),y=p(t.onArrayBegin),v=d(t.onArrayEnd),_=f(t.onLiteralValue),b=l(t.onSeparator),k=(x=t.onComment)?()=>0===c&&x(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter()):()=>!0,w=l(t.onError);var x;const $=n&&n.disallowComments,O=n&&n.allowTrailingComma;function A(){for(;;){const e=i.scan();switch(i.getTokenError()){case 4:E(14);break;case 5:E(15);break;case 3:E(13);break;case 1:$||E(11);break;case 2:E(12);break;case 6:E(16)}switch(e){case 12:case 13:$?E(10):k();break;case 16:E(1);break;case 15:case 14:break;default:return e}}}function E(e,t=[],n=[]){if(w(e),t.length+n.length>0){let e=i.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){A();break}if(-1!==n.indexOf(e))break;e=A()}}}function S(e){const t=i.getTokenValue();return e?_(t):(m(t),a.push(t)),A(),!0}function z(){return 10!==i.getToken()?(E(3,[],[2,5]),!1):(S(!1),6===i.getToken()?(b(":"),A(),C()||E(4,[],[2,5])):E(5,[],[2,5]),a.pop(),!0)}function C(){switch(i.getToken()){case 3:return function(){y(),A();let e=!0,t=!1;for(;4!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){if(t||E(4,[],[]),b(","),A(),4===i.getToken()&&O)break}else t&&E(6,[],[]);e?(a.push(0),e=!1):a[a.length-1]++,C()||E(4,[],[4,5]),t=!0}return v(),e||a.pop(),4!==i.getToken()?E(8,[4],[]):A(),!0}();case 1:return function(){h(),A();let e=!1;for(;2!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){if(e||E(4,[],[]),b(","),A(),2===i.getToken()&&O)break}else e&&E(6,[],[]);z()||E(4,[],[2,5]),e=!0}return g(),2!==i.getToken()?E(7,[2],[]):A(),!0}();case 10:return S(!0);default:return function(){switch(i.getToken()){case 11:const e=i.getTokenValue();let t=Number(e);isNaN(t)&&(E(2),t=0),_(t);break;case 7:_(null);break;case 8:_(!0);break;case 9:_(!1);break;default:return!1}return A(),!0}()}}return A(),17===i.getToken()?!!n.allowEmptyContent||(E(4,[],[]),!1):C()?(17!==i.getToken()&&E(9,[],[]),!0):(E(4,[],[]),!1)}function p(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":return e?Array.isArray(e)?"array":"object":"null";default:return"null"}}new Array(a).fill(0).map((e,t)=>"\n"+" ".repeat(t)),new Array(a).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(a).fill(0).map((e,t)=>"\r\n"+" ".repeat(t)),new Array(a).fill(0).map((e,t)=>"\n"+"\t".repeat(t)),new Array(a).fill(0).map((e,t)=>"\r"+"\t".repeat(t)),new Array(a).fill(0).map((e,t)=>"\r\n"+"\t".repeat(t)),function(e){e.DEFAULT={allowTrailingComma:!1}}(u||(u={})),function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(c||(c={})),function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}(l||(l={}));const d=function(e,t=[],n=u.DEFAULT){let r=null,o=[];const s=[];function i(e){Array.isArray(o)?o.push(e):null!==r&&(o[r]=e)}return f(e,{onObjectBegin:()=>{const e={};i(e),s.push(o),o=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{o=s.pop()},onArrayBegin:()=>{const e=[];i(e),s.push(o),o=e,r=null},onArrayEnd:()=>{o=s.pop()},onLiteralValue:i,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),o[0]},h=function(e,t=[],n=u.DEFAULT){let r={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(e){"property"===r.type&&(r.length=e-r.offset,r=r.parent)}function s(e){return r.children.push(e),e}f(e,{onObjectBegin:e=>{r=s({type:"object",offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=s({type:"property",offset:t,length:-1,parent:r,children:[]}),r.children.push({type:"string",value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{o(e+t),r.length=e+t-r.offset,r=r.parent,o(e+t)},onArrayBegin:(e,t)=>{r=s({type:"array",offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,o(e+t)},onLiteralValue:(e,t,n)=>{s({type:p(e),offset:t,length:n,parent:r,value:e}),o(t+n)},onSeparator:(e,t,n)=>{"property"===r.type&&(":"===e?r.colonOffset=t:","===e&&o(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);const i=r.children[0];return i&&delete i.parent,i},m=function(e,t){if(!e)return;let n=e;for(let e of t)if("string"==typeof e){if("object"!==n.type||!Array.isArray(n.children))return;let t=!1;for(const r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&2===r.children.length){n=r.children[1],t=!0;break}if(!t)return}else{const t=e;if("array"!==n.type||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n};var g;function y(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function v(e){const t=[],n={allowTrailingComma:!0,disallowComments:!1},r=h(e,t,n);return{value:r?d(e,[],n):void 0,tree:r,errors:t.map(e=>({offset:e.offset,length:e.length,message:y(e.error)}))}}function _(e){const t=[];return h(e,t,{allowTrailingComma:!1,disallowComments:!0}),t.map(e=>({offset:e.offset,length:e.length,message:y(e.error)}))}function b(e){const t=v(e);return 0===t.errors.length?t.value:void 0}function k(e,t,n={}){if(e.tree)for(let r=t.length;r>=0;r--){let o=m(e.tree,t.slice(0,r));if(o&&n.key&&r===t.length&&"property"===o.parent?.type&&(o=o.parent.children?.[0]??o),o)return{startOffset:o.offset,endOffset:o.offset+o.length}}return{startOffset:0,endOffset:0}}function w(e){return""===e?[]:e.slice(1).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")).map(e=>/^\d+$/.test(e)?Number(e):e)}!function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"}(g||(g={}))},1493(e,t,n){n.d(t,{S:()=>s});var r=n(9627),o=n(5663);function s(e){const t=o.join(e.courseId,"questions",e.localId),n=o.join(t,"info.json"),s=o.join(t,"question.html"),i=o.join(t,"server.py");return{dir:t,infoJson:n,questionHtml:s,serverPy:i,strict(){const e={};return r.existsSync(t)&&(e.dir=t),r.existsSync(n)&&(e.infoJson=n),r.existsSync(s)&&(e.questionHtml=s),r.existsSync(i)&&(e.serverPy=i),e}}}},6590(e,t,n){n.d(t,{P:()=>o,n:()=>s});var r=n(5663);function o(e,t){switch(e){case"fileDir":return t.fileDir;case"clientFilesQuestion":return r.join(t.fileDir,"clientFilesQuestion");case"clientFilesCourse":return r.join(t.courseRoot,"clientFilesCourse");case"serverFilesCourse":return r.join(t.courseRoot,"serverFilesCourse");case"courseExtensions":return r.join(t.courseRoot,"elementExtensions");case"questions":return r.join(t.courseRoot,"questions")}}function s(e,t,n=!1){const o=r.resolve(e,t),s=r.relative(e,o);return""===s?n?o:null:s.startsWith("..")||r.isAbsolute(s)?null:o}},2940(e,t,n){var r=n(8141);const o=(e,t)=>({source:"json",json:{json:e,base:t}}),s=e=>({source:"html",html:e}),i=/^clientFilesCourse(Styles|Scripts)$/,a=[r.l$.element,r.l$.elementExtension],u={default:".",named:{serverFilesCourse:"serverFilesCourse",clientFilesCourse:"clientFilesCourse"},relative:!0},c={default:"clientFilesQuestion",named:{clientFilesQuestion:"clientFilesQuestion",clientFilesCourse:"clientFilesCourse"}},l=[{id:"question.dependencies.clientFilesCourse",range:"*",files:r.l$.question,rule:"client-files-course-exist",target:"file",...o(["dependencies",i,"*"],"clientFilesCourse")},{id:"question.dependencies.clientFilesQuestion",range:"*",files:r.l$.question,rule:"client-files-question-exist",target:"file",...o(["dependencies",/^clientFilesQuestion(Styles|Scripts)$/,"*"],"clientFilesQuestion")},{id:"question.clientFiles",range:"*",files:r.l$.question,rule:"client-files-question-exist",target:"file",severity:"warning",...o(["clientFiles","*"],"fileDir")},{id:"question.externalGradingOptions.serverFilesCourse",range:"*",files:r.l$.question,rule:"server-files-course-exist",target:"fileOrDir",...o(["externalGradingOptions","serverFilesCourse","*"],"serverFilesCourse")},{id:"question.template",range:"*",files:r.l$.question,rule:"question-exists",target:"question",...o(["template"],"questions")},...a.flatMap(e=>[{id:`${e}.controller`,range:"*",files:e,rule:"element-files-exist",target:"file",...o(["controller"],"fileDir")},{id:`${e}.dependencies.element`,range:"*",files:e,rule:"element-files-exist",target:"file",...o(["dependencies",/^(element|extension)(Styles|Scripts)$/,"*"],"fileDir")},{id:`${e}.dynamicDependencies.element`,range:"*",files:e,rule:"element-files-exist",target:"file",...o(["dynamicDependencies",/^(element|extension)Scripts$/,"*"],"fileDir")},{id:`${e}.dependencies.clientFilesCourse`,range:"*",files:e,rule:"client-files-course-exist",target:"file",...o(["dependencies",i,"*"],"clientFilesCourse")},{id:`${e}.dynamicDependencies.clientFilesCourse`,range:"*",files:e,rule:"client-files-course-exist",target:"file",...o(["dynamicDependencies","clientFilesCourseScripts","*"],"clientFilesCourse")}]),{id:"assessment.question",range:"*",files:r.l$.assessment,rule:"question-exists",target:"question",...o(["zones","*","questions","*","id"],"questions")},{id:"assessment.alternative",range:"*",files:r.l$.assessment,rule:"question-exists",target:"question",...o(["zones","*","questions","*","alternatives","*","id"],"questions")},{id:"pl-figure",range:"*",files:r.mU,rule:"pl-figure-file-exist",target:"file",...s({tag:"pl-figure",attr:"file-name",directory:c,staticOnly:!0})},{id:"pl-file-download",range:"*",files:r.mU,rule:"pl-file-download-file-exist",target:"file",...s({tag:"pl-file-download",attr:"file-name",directory:c,staticOnly:!0})},{id:"pl-code",range:"*",files:r.mU,rule:"pl-code-file-exist",target:"fileOrDir",...s({tag:"pl-code",attr:"source-file-name",directory:u})},{id:"pl-file-editor",range:"*",files:r.mU,rule:"pl-file-editor-file-exist",target:"file",...s({tag:"pl-file-editor",attr:"source-file-name",directory:u})},{id:"pl-graph",range:"*",files:r.mU,rule:"pl-graph-file-exist",target:"file",...s({tag:"pl-graph",attr:"source-file-name",directory:u})},{id:"pl-rich-text-editor",range:"*",files:r.mU,rule:"pl-rich-text-editor-file-exist",target:"file",...s({tag:"pl-rich-text-editor",attr:"source-file-name",directory:u})},{id:"pl-excalidraw",range:"*",files:r.mU,rule:"pl-excalidraw-file-exist",target:"file",...s({tag:"pl-excalidraw",attr:"source-file-name",directory:{default:".",named:{".":"fileDir",clientFilesQuestion:"clientFilesQuestion",clientFilesCourse:"clientFilesCourse",serverFilesCourse:"serverFilesCourse"}}})},{id:"pl-xss-safe",range:"*",files:r.mU,rule:"pl-xss-safe-file-exist",target:"fileOrDir",...s({tag:"pl-xss-safe",attr:"source-file-name",base:"fileDir"})},{id:"pl-template",range:"*",files:r.mU,rule:"pl-template-file-exist",target:"file",...s({tag:"pl-template",attr:"file-name",directory:{default:"serverFilesCourse",named:{question:"fileDir",clientFilesQuestion:"clientFilesQuestion",clientFilesCourse:"clientFilesCourse",serverFilesCourse:"serverFilesCourse",courseExtensions:"courseExtensions"}}})}];n.d(t,["c",0,l])},1922(e,t,n){n.d(t,{Et:()=>u,k2:()=>p});var r=n(9627),o=n(5663),s=n(9889),i=n(1493),a=n(6897);function u(e){return async({doc:t,schemas:n,plVersion:r})=>{if(t.errors.length>0||void 0===t.value)return[];const o=await n.get(e,r);if(!o||o.validate(t.value))return[];const i=new Set,a=[];for(const e of o.validate.errors??[]){let n,r=(0,s.ox)(e.instancePath),u=`${e.instancePath||"root"} ${e.message}`,c="error";if("additionalProperties"===e.keyword){const t=String(e.params.additionalProperty);r=[...r,t],u=`unknown property "${t}"`,c="warning"}else"enum"===e.keyword?u+=`: ${e.params.allowedValues.map(e=>JSON.stringify(e)).join(", ")}`:"required"===e.keyword?n={kind:"schema-required-property",path:r,property:String(e.params.missingProperty)}:"pattern"===e.keyword&&(n={kind:"schema-pattern",path:r,pattern:String(e.params.pattern)});const l=`${r.join("/")}\0${u}`;if(i.has(l))continue;i.add(l);let f=(0,s.be)(t,r);"required"===e.keyword&&(f={startOffset:f.startOffset,endOffset:f.startOffset+1}),a.push({...f,message:`${u} (PL schema ${o.label})`,severity:c,metadata:n})}return a}}function c(e,t){const{relPath:n,plDate:r,courseRoot:s,filePath:i}=e;return(0,a.IO)(e,n,r,{courseRoot:s,fileDir:o.dirname(i)},t)}function l(e,t){const n=r.statSync(e,{throwIfNoEntry:!1});return"file"===t?!!n?.isFile():!!n}function f(e,t){const n=(0,i.S)({courseId:t,localId:e.value}),o=n.strict();if(!o.dir)return{message:`missing question: expected question directory ${n.dir}`,related:[{path:n.infoJson,message:"Expected location of info.json"}]};if(!o.infoJson)return{message:"incomplete question: missing required JSON file",related:[{path:n.infoJson,message:"Expected location of info.json"}]};if(!o.questionHtml){const e=(0,s.pX)(r.readFileSync(o.infoJson,"utf8"));if("string"!=typeof e?.options?.text)return{message:"incomplete question: missing required html file",related:[{path:n.questionHtml,message:"Expected location of question.html"}]}}}function p(e){return t=>{const n=[];for(const r of c(t,t=>t.rule===e)){const e={startOffset:r.startOffset,endOffset:r.endOffset},s=r.spec.severity??"error";if(null===r.target)n.push({...e,message:r.problem??`invalid path "${r.value}"`,severity:"error"});else if("question"===r.spec.target){const o=f(r,t.courseRoot);o&&n.push({...e,...o,severity:s})}else l(r.target,r.spec.target)||n.push({...e,message:`${"file"===r.spec.target?"file":"file or directory"} not found: ${o.relative(t.courseRoot,r.target)}`,severity:s,related:[{path:r.target,message:"Expected location of file"}]})}return n}}function d(e,t){return({references:n,doc:r})=>{const o=r.value?.[e];if(!n||r.errors.length>0||!Array.isArray(o))return[];const i=n.namesUsed(e);return o.flatMap((n,o)=>"string"!=typeof n?.name||i.has(n.name)?[]:[{...(0,s.be)(r,[e,o,"name"]),message:t(n.name),severity:"warning",identifier:n.name}])}}const h=d("tags",e=>`tag "${e}" is not used by any question`),m=d("assessmentSets",e=>`assessment set "${e}" is not used by any assessment`);n.d(t,["Ex",0,e=>{const t=new Map;for(const n of c(e,e=>"question"===e.target))t.set(n.value,[...t.get(n.value)??[],n]);return[...t.values()].filter(e=>e.length>1).flatMap(e=>e.map(t=>({startOffset:t.startOffset,endOffset:t.endOffset,message:`Duplicate question ID: "${t.value}" appears ${e.length} times`,severity:"warning"})))},"Gx",0,h,"WS",0,({text:e})=>{const t=new Set,n=[];for(const r of(0,s.Zu)(e)){if(t.has(r.offset))continue;t.add(r.offset);const o=/,\s*$/.exec(e.slice(0,r.offset)),s=o&&"InvalidCommentToken"!==r.message?{startOffset:o.index,endOffset:o.index+1}:{startOffset:r.offset,endOffset:r.offset+Math.max(1,r.length)};n.push({...s,message:"InvalidCommentToken"===r.message?"comments are not allowed: PrairieLearn reads course JSON with JSON.parse":o?"trailing commas are not allowed: PrairieLearn reads course JSON with JSON.parse":`invalid JSON: ${r.message}`,severity:"error"})}return n},"f0",0,({references:e,filePath:t,courseRoot:n,doc:r})=>{if(!e||r.errors.length>0)return[];const i=o.dirname(t);if(e.usesOf(i).some(e=>"question"===e.ref.spec.target&&e.ref.target===i))return[];const a=o.relative(o.join(n,"questions"),i).split(o.sep).join("/");return[{...(0,s.be)(r,["title"]),message:`question "${a}" is not used by any assessment`,severity:"info",identifier:a}]},"qQ",0,m])}};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sybelblue/prairielearn-navigator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Check PrairieLearn courses for missing, incomplete, and duplicate questions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,10 +16,13 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"prairielearn-navigator": "dist/cli.
|
|
19
|
+
"prairielearn-navigator": "dist/cli.js"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
|
-
"dist"
|
|
22
|
+
"dist/cli.js",
|
|
23
|
+
"dist/index.js",
|
|
24
|
+
"dist/shared.js",
|
|
25
|
+
"dist/core/questionFileResolver.d.ts"
|
|
23
26
|
],
|
|
24
27
|
"engines": {
|
|
25
28
|
"node": ">=22"
|