@oss-autopilot/core 3.40.0 → 3.40.1

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.
@@ -60,7 +60,7 @@ ${c}`:c:"",d=Function,p=`return (input) => {
60
60
  ${c}
61
61
  }`,m;try{m=new d(...i,p)(...a)}catch(f){throw new Se(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(m.code=u),m.definite=n.definite,m}function ue(e,t){for(let[n,s]of e.constants)if(s===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function Fs(e,t){return e.definite=!1,ue(e,t)}function te(e){return`v${e.varCounter++}`}function kG(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return Mt;let n=r;return n.issues.length===0?n.value:Mt}function Tt(e,t,r,n,s=!0){let o=e.content.length,i=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Ve(e,t,r,n,s)}catch(u){if(!(u instanceof Se)||!u.islandable)throw u;if(e.content.length=o,t.constants.size>i){let d=Array.from(t.constants.keys()).slice(i);for(let p of d)t.constants.delete(p)}return t.constantCounter=a,t.varCounter=c,CG(e,t,r,n)}}function CG(e,t,r,n){t.definite=!1;let s=ue(t,r),o=ue(t,kG),i=te(t);return e.write(`const ${i} = ${o}(${s}, ${n});`),e.write(`if (${i} === INVALID) return INVALID;`),i}function EG(e,t,r,n){let s=r._zod.def.checks;if(!s||s.length===0)return n;let o=n;for(let i of s){let a=i._zod.def;if(a.when&&!PG.has(a.check))throw new Se('check with a custom "when" condition');switch(a.check){case"greater_than":AG(e,t,a,o);break;case"less_than":TG(e,t,a,o);break;case"multiple_of":$G(e,t,a,o);break;case"number_format":bP(e,a,o);break;case"min_length":{let c=Bn(a.minimum,"min_length"),u=Tb(e,t,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case"max_length":{let c=Bn(a.maximum,"max_length"),u=Tb(e,t,o,`${o}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case"length_equals":{let c=Bn(a.length,"length_equals"),u=Tb(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${Bn(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${Bn(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${Bn(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=wP(e,t,a,o);break;case"custom":o=MG(e,t,i,o);break;case"bigint_format":OG(e,a,o);break;case"mime_type":IG(e,t,a,o);break;case"property":DG(e,t,a,o);break;case"properties":xG(e,t,a,o);break;case"overwrite":{let c=te(t);LG(e,t,i,o,c),o=c;break}default:throw new Se(`check type ${a.check}`)}}return o}function Tb(e,t,r,n){let s=ue(t,Os),o=te(t);return e.write(`const ${o} = typeof ${r} === "string" && ${n} ? ${s}(${r}) : ${r}.length;`),o}function Bn(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Se(`${t} bound of type ${typeof e}`);return`${e}`}function yP(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Se("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Se("comparison check with Invalid Date bound");return ue(e,t)}throw new Se(`comparison check bound of type ${typeof t}`)}function AG(e,t,r,n){let s=r.inclusive?"<":"<=";e.write(`if (${n} ${s} ${yP(t,r.value)}) return INVALID;`)}function TG(e,t,r,n){let s=r.inclusive?">":">=";e.write(`if (${n} ${s} ${yP(t,r.value)}) return INVALID;`)}function $G(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new Se("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`)}else{let s=ue(t,oc);e.write(`if (${s}(${n}, ${Bn(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function bP(e,t,r){let n=t.format;switch(n){case"safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new Se(`number format ${n}`)}}function OG(e,t,r){let n=t.format;if(n)switch(n){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new Se(`bigint format ${n}`)}}function IG(e,t,r,n){let s=r.mime;if(s&&s.length>0){let o=ue(t,new Set(s));e.write(`if (!${o}.has(${n}.type)) return INVALID;`)}}function xG(e,t,r,n){if(r.when)throw new Se('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let s=r.shape;for(let o of Reflect.ownKeys(s)){let i=typeof o=="symbol"?ue(t,o):Dt(o),a=te(t);e.write(`const ${a} = ${n}[${i}];`),Tt(e,t,s[o],a,!1)}}function DG(e,t,r,n){let s=`${n}[${JSON.stringify(r.property)}]`;Ve(e,t,r.schema,s)}function LG(e,t,r,n,s){let o=r._zod.def.tx;if(!o)throw new Se("overwrite check without a transform function");if(Ns(o))throw new Pr("z.compile: async overwrite transforms are not supported");let i=ue(t,o);e.write(`const ${s} = ${i}(${n});`)}function $b(){throw new Zt}function xb(e){this.issues.push(e)}function MG(e,t,r,n){let s=r._zod.def;if(s.fn){if(Ns(s.fn))throw new Pr("z.compile: async .refine() predicates are not supported");let o=Fs(t,s.fn),i=ue(t,$b),a=te(t);return e.write(`const ${a} = ${o}(${n});`),e.write(`if (${a} instanceof Promise) ${i}();`),e.write(`if (!${a}) return INVALID;`),n}if(r._zod.check){if(Ns(r._zod.check))throw new Pr("z.compile: async .superRefine() / check functions are not supported");let o=r._zod.check,a=Fs(t,u=>{let d={value:u,issues:[],addIssue:xb};return o(d)instanceof Promise&&$b(),d.issues.length===0?d.value:Mt}),c=te(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new Se("custom check without a predicate or check function")}function wP(e,t,r,n,s=!0){let o=r.format;if(o==="base64"){let u=ue(t,Cc);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(o==="base64url"){let u=ue(t,gd);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(o==="jwt"){let u=ue(t,bd),d=ue(t,r.alg??null);return e.write(`if (!${u}(${n}, ${d})) return INVALID;`),n}if(o==="ipv6"){let u=ue(t,kc);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(o==="cidrv6"){let u=ue(t,md);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(o==="credit_card"){let u=ue(t,hd);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(o==="iban"){let u=ue(t,yd);return e.write(`if (!${u}(${n})) return INVALID;`),n}let i=r;if(o==="url"||o==="httpurl"||i.normalize||i.hostname!==void 0||i.protocol!==void 0){let u=ue(t,ld),d=ue(t,r),p=te(t),m=te(t);if(e.write(`const ${p} = ${n}.trim();`),e.write(`const ${m} = ${u}(${p}, ${d});`),e.write(`if (typeof ${m} === "number") return INVALID;`),i.hostname!==void 0){let h=ue(t,dd);e.write(`if (!${h}(${m}, ${d}.hostname)) return INVALID;`)}if(i.protocol!==void 0){let h=ue(t,pd);e.write(`if (!${h}(${m}, ${d}.protocol)) return INVALID;`)}if(!s)return null;let f=te(t),g=i.normalize?`${m}.href`:`${ue(t,vc)}(${p})`;return e.write(`const ${f} = ${g};`),f}let a=r.fn;if(a){if(Ns(a))throw new Se(`async string format ${o}`);let u=ue(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(FG.has(o)&&r.pattern){let u=ue(t,r.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${n})) return INVALID;`),n}let c=r.format;switch(c){case"regex":throw new Se("regex format without a pattern");case"lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${n}.includes(${Dt(r.includes)})) return INVALID;`);break;case"starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${Dt(u)}) return INVALID;`);break}case"ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${Dt(u)}) return INVALID;`);break}default:throw new Se(`string format ${c}`)}return n}function Ve(e,t,r,n,s=!0){let o=r._zod.def,i=o.type;if(o.coerce)throw new Se(`coercion (z.coerce.${i}())`);let a=s||!!o.checks?.length,c;switch(i){case"string":c=NG(e,t,r,n,a);break;case"number":c=GG(e,r,n);break;case"boolean":c=UG(e,n);break;case"bigint":c=jG(e,r,n);break;case"symbol":c=zG(e,n);break;case"undefined":c=BG(e,n);break;case"null":c=HG(e,n);break;case"any":case"unknown":c=n;break;case"never":e.write("return INVALID;"),c=n;break;case"void":c=WG(e,n);break;case"nan":c=VG(e,n);break;case"date":c=qG(e,n);break;case"object":c=ZG(e,t,r,n,a);break;case"optional":c=KG(e,t,r,n,a);break;case"nullable":c=QG(e,t,r,n,a);break;case"array":c=XG(e,t,r,n,a);break;case"literal":c=eU(e,t,r,n);break;case"enum":c=tU(e,t,r,n);break;case"readonly":{let u=fP(e,t,r,n),d=te(t);e.write(`const ${d} = Object.freeze(${u});`),c=d;break}case"success":fP(e,t,r,n),c="true";break;case"default":case"prefault":c=rU(e,t,r,n);break;case"nonoptional":c=nU(e,t,r,n);break;case"tuple":c=sU(e,t,r,n);break;case"union":c=oU(e,t,r,n);break;case"intersection":c=cU(e,t,r,n);break;case"record":c=uU(e,t,r,n);break;case"map":c=dU(e,t,r,n);break;case"set":c=pU(e,t,r,n);break;case"file":c=mU(e,n);break;case"template_literal":c=fU(e,t,r,n);break;case"lazy":c=gU(e,t,r,n);break;case"pipe":c=hU(e,t,r,n);break;case"custom":c=yU(e,t,r,n);break;case"transform":c=RU(e,t,r,n);break;case"catch":c=wU(e,t,r,n);break;default:throw new Se(`schema type ${i}`)}return c===null?null:EG(e,t,r,c)}function NG(e,t,r,n,s=!0){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.def;return o.format===void 0?n:wP(e,t,o,n,s)}function GG(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&bP(e,{format:n.format},r),r}function UG(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function jG(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function zG(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function BG(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function HG(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function WG(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function VG(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function qG(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function ZG(e,t,r,n,s=!0){let o=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let i=o.shape,a=Object.keys(i),c=Object.getOwnPropertySymbols(i),u=c.length?[...a,...c]:a,d=y=>typeof y=="symbol"?ue(t,y):Dt(y),p=y=>typeof y=="symbol"?`[${d(y)}]`:Dt(y),m=i;if(a.includes("__proto__"))throw new Se('object shape key "__proto__"');let f=new Map;for(let y of u){let S=m[y],k=d(y),R=te(t);if(e.write(`const ${R} = ${n}[${k}];`),S._zod.optin!==void 0){let P=te(t);e.write(`let ${P} = (() => {`),e.indented(C=>{let E=Tt(C,t,S,R);C.write(`return ${E};`)}),e.write("})();"),S._zod.optout==="optional"?(e.write(`if (${P} === INVALID) {`),e.indented(C=>{C.write(`if (${k} in ${n}) return INVALID;`),C.write(`${P} = undefined;`)}),e.write("}")):e.write(`if (${P} === INVALID) return INVALID;`),f.set(y,P)}else{YG(S)&&e.write(`if (!(${k} in ${n})) return INVALID;`);let P=Tt(e,t,S,R,s);P!==null&&f.set(y,P)}}let g=o.catchall,h="none";if(g){let y=g._zod.def.type;if(y==="never"){let S=a.map(k=>`k !== ${Dt(k)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(k=>{k.write(`if (${S}) return INVALID;`)}),e.write("}")}else(y==="unknown"||y==="any")&&!g._zod.def.checks?.length?h="passthrough":h="schema"}let b=te(t),w=u.some(y=>mP(m[y])||Ob(m[y]));if(!s){if(h==="schema"){let y=a.length>0?ue(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(S=>{S.write('if (k === "__proto__") continue;'),y&&S.write(`if (${y}.has(k)) continue;`);let k=te(t);S.write(`const ${k} = ${n}[k];`),Tt(S,t,g,k,!1)}),e.write("}")}return null}if(w){e.write(`const ${b} = {};`);for(let y of u){let S=d(y),k=f.get(y);Ob(m[y])?e.write(`if (${S} in ${n}) ${b}[${S}] = ${k};`):mP(m[y])?e.write(`if (${k} !== undefined || ${S} in ${n}) ${b}[${S}] = ${k};`):e.write(`${b}[${S}] = ${k};`)}}else{let y=u.map(S=>`${p(S)}: ${f.get(S)}`).join(", ");e.write(`const ${b} = { ${y} };`)}if(h!=="none"){let y=a.length>0?ue(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(S=>{if(S.write('if (k === "__proto__") continue;'),y&&S.write(`if (${y}.has(k)) continue;`),h==="passthrough")S.write(`${b}[k] = ${n}[k];`);else{let k=te(t);S.write(`const ${k} = ${n}[k];`);let R=Tt(S,t,g,k);S.write(`${b}[k] = ${R};`)}}),e.write("}")}return b}function KG(e,t,r,n,s=!0){let o=r._zod.def;if(JG(r))return Ve(e,t,o.innerType,n,s);if(o.innerType._zod.optin==="defaulted"){let a=te(t),c=te(t);return e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(d=>{let p=Ve(d,t,o.innerType,n);d.write(`return ${p};`)}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(u=>{let d=Ve(u,t,o.innerType,n);u.write(`${a} = ${d};`)}),e.write("}"),a}let i=s?te(t):null;return i&&e.write(`let ${i};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let c=Ve(a,t,o.innerType,n,s);i&&c!==null&&a.write(`${i} = ${c};`)}),e.write("}"),i}function JG(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function YG(e){return e._zod.optin===void 0&&Ms(e)}function Ms(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Ms(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Ms(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Ms):!0;case"intersection":return!t.left||!t.right?!0:Ms(t.left)&&Ms(t.right);case"pipe":return t.in?Ms(t.in):!0;default:return!0}}function Ob(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function mP(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&di(e)}function di(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?di(t.innerType):!0;case"union":return t.options?t.options.some(di):!0;case"intersection":return!t.left||!t.right||di(t.left)||di(t.right);case"pipe":return t.out?di(t.out):!0;default:return!0}}function QG(e,t,r,n,s=!0){let o=r._zod.def,i=s?te(t):null;return i&&e.write(`let ${i} = null;`),e.write(`if (${n} !== null) {`),e.indented(a=>{let c=Ve(a,t,o.innerType,n,s);i&&c!==null&&a.write(`${i} = ${c};`)}),e.write("}"),i}function Db(e,t,r){for(let[n,s]of ti(t._zod.def.checks))e.write(`if (${r} > ${Bn(n,s._zod.def.check)}) return INVALID;`)}function XG(e,t,r,n,s=!0){let o=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),Db(e,r,`${n}.length`);let i=s?te(t):null,a=te(t),c=te(t);return i&&e.write(`const ${i} = new Array(${n}.length);`),e.write(`for (let ${a} = 0; ${a} < ${n}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${n}[${a}];`);let d=Tt(u,t,o.element,c,s);i&&d!==null&&u.write(`${i}[${a}] = ${d};`)}),e.write("}"),i}function eU(e,t,r,n){let o=r._zod.def.values;if(o.length!==1){let a=ue(t,new Set(o));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}let i=o[0];if(typeof i=="number"&&Number.isNaN(i)){let a=ue(t,new Set(o));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof i=="string")e.write(`if (${n} !== ${Dt(i)}) return INVALID;`);else if(typeof i=="number"||typeof i=="boolean")e.write(`if (${n} !== ${i}) return INVALID;`);else if(i===null)e.write(`if (${n} !== null) return INVALID;`);else if(i===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof i=="bigint")e.write(`if (${n} !== ${i}n) return INVALID;`);else throw new Se(`literal type ${typeof i}`);return n}function tU(e,t,r,n){let s=r._zod.values;if(!s)throw new Se("enum schema without enumerated values");let o=ue(t,s);return e.write(`if (!${o}.has(${n})) return INVALID;`),n}function fP(e,t,r,n){let s=r._zod.def;return Ve(e,t,s.innerType,n)}function rU(e,t,r,n){let s=r._zod.def,i=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!i)return Ve(e,t,s.innerType,n);let c=ue(t,i),u=te(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),Ve(e,t,s.innerType,u)}let a=te(t);if(i){let c=ue(t,i),u=ue(t,ic);e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(d=>{d.write(`${a} = ${u}(${c}());`)}),e.write("} else {"),e.indented(d=>{let p=Ve(d,t,s.innerType,n);d.write(`${a} = ${p} === undefined ? ${u}(${c}()) : ${p};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${n} !== undefined) {`),e.indented(c=>{let u=Ve(c,t,s.innerType,n);c.write(`${a} = ${u};`)}),e.write("}");return a}function nU(e,t,r,n){let s=r._zod.def,o=Ve(e,t,s.innerType,n),i=te(t);return e.write(`const ${i} = ${o};`),e.write(`if (${i} === undefined) return INVALID;`),i}function sU(e,t,r,n){let s=r._zod.def,o=s.items,i=s.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let a=gP(o,"optin"),c=gP(o,"optout");i?e.write(`if (${n}.length < ${a}) return INVALID;`):e.write(`if (${n}.length < ${a} || ${n}.length > ${o.length}) return INVALID;`);let u=te(t);e.write(`const ${u} = [];`);for(let d=0;d<o.length;d++){let p=o[d];if(d>=c)e.write(`if (${u}.length === ${d}) {`),e.indented(m=>{m.write(`if (${d} < ${n}.length) {`),m.indented(f=>{let g=te(t);f.write(`const ${g} = ${n}[${d}];`);let h=Tt(f,t,p,g);f.write(`${u}[${d}] = ${h};`)}),m.write("} else {"),m.indented(f=>{if(Ob(p)){f.write(`${u}.length = ${d};`);return}let g=te(t),h=te(t);f.write(`const ${g} = undefined;`),f.write(`const ${h} = (() => {`),f.indented(b=>{let w=Tt(b,t,p,g);b.write(`return ${w};`)}),f.write("})();"),f.write(`if (${h} === INVALID || ${h} === undefined) ${u}.length = ${d};`),f.write(`else ${u}[${d}] = ${h};`)}),m.write("}")}),e.write("}");else{let m=te(t);e.write(`const ${m} = ${n}[${d}];`);let f=Tt(e,t,p,m);e.write(`${u}[${d}] = ${f};`)}}if(i){let d=te(t),p=te(t);e.write(`for (let ${d} = ${o.length}; ${d} < ${n}.length; ${d}++) {`),e.indented(m=>{m.write(`const ${p} = ${n}[${d}];`);let f=Tt(m,t,i,p);m.write(`${u}[${d}] = ${f};`)}),e.write("}")}return u}function gP(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function oU(e,t,r,n){let s=r._zod.def,o=s.options;if(s.discriminator)return iU(e,t,s,n);if(s.inclusive===!1)throw new Se("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),n;if(o.length===1)return Ve(e,t,o[0],n);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(d=>d._zod.def.values)),u=ue(t,c);return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let a=te(t);e.write(`let ${a};`);for(let c=0;c<o.length;c++){let u=o[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(d=>{let p=Ve(d,t,u,n);d.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function iU(e,t,r,n){if(r.unionFallback)throw new Se("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let s=te(t),o=te(t);e.write(`const ${s} = ${n}?.[${Dt(r.discriminator)}];`),e.write(`let ${o};`);let i=!0,a=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new Se("discriminated union option without static discriminator values");for(let m of u){if(a.has(m))throw new Se(`duplicate discriminator value ${String(m)}`);a.add(m)}let d=Array.from(u,m=>aU(t,s,m)),p=i?"if":"else if";e.write(`${p} (${d.join(" || ")}) {`),e.indented(m=>{let f=Ve(m,t,c,n);m.write(`${o} = ${f};`)}),e.write("}"),i=!1}return e.write("else { return INVALID; }"),o}function aU(e,t,r){if(typeof r=="string")return`${t} === ${Dt(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return`${t} === ${r}`;if(r===null)return`${t} === null`;if(r===void 0)return`${t} === undefined`;if(typeof r=="bigint")return`${t} === ${r}n`;if(typeof r=="symbol"){let n=ue(e,r);return`${t} === ${n}`}throw new Se(`literal discriminator value ${String(r)}`)}function cU(e,t,r,n){let s=r._zod.def;t.definite=!1;let o=Tt(e,t,s.left,n),i=Tt(e,t,s.right,n),a=ue(t,ci),c=te(t);return e.write(`const ${c} = ${a}(${o}, ${i});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function uU(e,t,r,n){let s=r._zod.def,o=ue(t,br);e.write(`if (!${o}(${n})) return INVALID;`);let i=te(t),a=te(t),c=te(t);e.write(`const ${i} = {};`);let u=s,d=u.partial?void 0:s.keyType._zod.values;if(d){let f=[];for(let h of d){if(!(typeof h=="string"||typeof h=="number"||typeof h=="symbol"))throw new Se(`record key value ${String(h)}`);let b=typeof h=="number"?h.toString():h;if(b==="__proto__")throw new Se('record key "__proto__"');f.push(b);let w=ue(t,h),y=Ve(e,t,s.keyType,w),S=te(t);e.write(`const ${S} = ${n}[${lU(t,b)}];`);let k=Tt(e,t,s.valueType,S);e.write(`${i}[${y}] = ${k};`)}let g=ue(t,new Set(f));return e.write(`for (const ${a} in ${n}) {`),e.indented(h=>{h.write(`if (${g}.has(${a})) continue;`),u.mode==="loose"?h.write(`if (${a} !== "__proto__") ${i}[${a}] = ${n}[${a}];`):h.write("return INVALID;")}),e.write("}"),i}let p=s.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let f=s.mode==="loose",g=Dd(s.keyType);g.definite===!1&&(t.definite=!1);let h=ue(t,g),b=ue(t,pn),w=te(t);return hP(e,t,n,a,y=>{y.write(`let ${w} = ${h}(${a});`),y.write(`if (${w} === INVALID && typeof ${a} === "string" && ${b}.test(${a})) ${w} = ${h}(Number(${a}));`),f?y.write(`if (${w} === INVALID) { ${i}[${a}] = ${n}[${a}]; continue; }`):y.write(`if (${w} === INVALID) return INVALID;`),y.write(`if (${w} === "__proto__") continue;`);let S=te(t);y.write(`const ${S} = ${n}[${a}];`);let k=Tt(y,t,s.valueType,S);y.write(`${i}[${w}] = ${k};`)}),i}return hP(e,t,n,a,f=>{f.write(`const ${c} = ${n}[${a}];`);let g=Tt(f,t,s.valueType,c);f.write(`${i}[${a}] = ${g};`)},"return INVALID;"),i}function hP(e,t,r,n,s,o){let i=ue(t,Object.prototype.propertyIsEnumerable),a=te(t),c=te(t),u=te(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${c} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(d=>{d.write(`const ${n} = ${c}[${u}];`),d.write(`if (${n} === "__proto__" || !${i}.call(${r}, ${n})) continue;`),s(d)}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(d=>{d.write(`const ${n} = ${a}[${u}];`),d.write(`if (!${i}.call(${r}, ${n})) continue;`),o?d.write(o):s(d)}),e.write("}")}function lU(e,t){return typeof t=="string"?Dt(t):ue(e,t)}function dU(e,t,r,n){let s=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),Db(e,r,`${n}.size`);let o=te(t),i=te(t),a=te(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${i}, ${a}] of ${n}) {`),e.indented(c=>{let u=Ve(c,t,s.keyType,i),d=Ve(c,t,s.valueType,a);c.write(`${o}.set(${u}, ${d});`)}),e.write("}"),o}function pU(e,t,r,n){let s=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),Db(e,r,`${n}.size`);let o=te(t),i=te(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${i} of ${n}) {`),e.indented(a=>{let c=Ve(a,t,s.valueType,i);a.write(`${o}.add(${c});`)}),e.write("}"),o}function mU(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function fU(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let s=r._zod.pattern;if(s){let o=ue(t,s);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${n})) return INVALID;`)}return n}function gU(e,t,r,n){let s=r._zod.def,o=Fs(t,s.getter),i=ue(t,{parser:null});e.write(`if (!${i}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${i}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=te(t);return e.write(`const ${a} = ${i}.parser(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function hU(e,t,r,n){let s=r._zod.def,o=Ve(e,t,s.in,n);if(s.transform){if(Ns(s.transform))throw new Pr("z.compile: async transforms in pipes are not supported");let i=s.transform,c=Fs(t,d=>{let p={value:d,issues:[],addIssue:xb},m=i(d,p);return m instanceof Promise?Mt:p.issues.length===0?m:Mt}),u=te(t);return e.write(`const ${u} = ${c}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),Ve(e,t,s.out,u)}else return Ve(e,t,s.out,o)}function Ns(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function yU(e,t,r,n){let s=r._zod.def;if(s.fn){if(Ns(s.fn))throw new Pr("z.compile: async custom predicates are not supported");let o=Fs(t,s.fn),i=ue(t,$b),a=te(t);e.write(`const ${a} = ${o}(${n});`),e.write(`if (${a} instanceof Promise) ${i}();`),e.write(`if (!${a}) return INVALID;`)}else throw new Se("custom schema without a predicate function");return n}function bU(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return Mt;let s=n;return s.issues.length===0?s.value:t()}function wU(e,t,r,n){let s=r._zod.def;if(!s.catchValue[Gl])throw new Se("catch with a callback (only a constant catch value compiles)",!1);let o=te(t);e.write(`let ${o} = (() => {`),e.indented(u=>{let d=Tt(u,t,s.innerType,n);u.write(`return ${d};`)}),e.write("})();");let i=ue(t,s.innerType),a=Fs(t,s.catchValue),c=ue(t,bU);return e.write(`if (${o} === INVALID) {`),e.indented(u=>{u.write(`${o} = ${c}(${i}, ${a}, ${n});`),u.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function RU(e,t,r,n){let s=r._zod.def;if(s.transform){if(Ns(s.transform))throw new Pr("z.compile: async transforms are not supported");let o=s.transform,a=Fs(t,u=>{let d={value:u,issues:[],addIssue:xb},p=o(u,d);return p instanceof Promise?Mt:d.issues.length===0?p:Mt}),c=te(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}var Mt,pP,Pr,Se,PG,FG,RP=A(()=>{jn();sd();kb();xs();ui();rt();Mt=Symbol.for("zod.compile.invalid"),pP=Symbol.for("zod.compile.fallback"),Pr=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Se=class extends Error{constructor(t,r=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};PG=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);FG=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function Ld(e){return e.checks&&(e.checks=[...e.checks]),e}function Lb(e,t){return new e(Ld({type:"string",...U(t)}))}function Mb(e,t){return new e(Ld({type:"string",coerce:!0,...U(t)}))}function Md(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...U(t)})}function Fd(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...U(t)})}function Nd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...U(t)})}function Gd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(t)})}function Ud(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(t)})}function jd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(t)})}function Mc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...U(t)})}function zd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...U(t)})}function Bd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(t)})}function Hd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...U(t)})}function Wd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(t)})}function Vd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...U(t)})}function qd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...U(t)})}function Zd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(t)})}function Kd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(t)})}function Jd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(t)})}function Fb(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...U(t)})}function Yd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(t)})}function Qd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(t)})}function Xd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...U(t)})}function ep(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...U(t)})}function tp(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...U(t)})}function Nb(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...U(t)})}function Gb(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...U(t)})}function rp(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...U(t)})}function Fc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(t)})}function Nc(e,t){return new e({type:"string",format:"date",check:"string_format",...U(t)})}function Gc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...U(t)})}function Uc(e,t){return new e({type:"string",format:"duration",check:"string_format",...U(t)})}function jb(e,t){return new e(Ld({type:"number",checks:[],...U(t)}))}function zb(e,t){return new e(Ld({type:"number",coerce:!0,checks:[],...U(t)}))}function Bb(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...U(t)})}function Hb(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...U(t)})}function Wb(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...U(t)})}function Vb(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...U(t)})}function qb(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...U(t)})}function Zb(e,t){return new e({type:"boolean",...U(t)})}function Kb(e,t){return new e({type:"boolean",coerce:!0,...U(t)})}function Jb(e,t){return new e({type:"bigint",...U(t)})}function Yb(e,t){return new e({type:"bigint",coerce:!0,...U(t)})}function Qb(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...U(t)})}function Xb(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...U(t)})}function ew(e,t){return new e({type:"symbol",...U(t)})}function tw(e,t){return new e({type:"undefined",...U(t)})}function rw(e,t){return new e({type:"null",...U(t)})}function nw(e){return new e({type:"any"})}function sw(e){return new e({type:"unknown"})}function ow(e,t){return new e({type:"never",...U(t)})}function iw(e,t){return new e({type:"void",...U(t)})}function aw(e,t){return new e({type:"date",...U(t)})}function cw(e,t){return new e({type:"date",coerce:!0,...U(t)})}function uw(e,t){return new e({type:"nan",...U(t)})}function Ur(e,t){return new td({check:"less_than",...U(t),value:e,inclusive:!1})}function or(e,t){return new td({check:"less_than",...U(t),value:e,inclusive:!0})}function jr(e,t){return new rd({check:"greater_than",...U(t),value:e,inclusive:!1})}function ir(e,t){return new rd({check:"greater_than",...U(t),value:e,inclusive:!0})}function np(e){return jr(0,e)}function sp(e){return Ur(0,e)}function op(e){return or(0,e)}function ip(e){return ir(0,e)}function Hn(e,t){return new jh({check:"multiple_of",...U(t),value:e})}function Wn(e,t){return new Hh({check:"max_size",...U(t),maximum:e})}function zr(e,t){return new Wh({check:"min_size",...U(t),minimum:e})}function Gs(e,t){return new Vh({check:"size_equals",...U(t),size:e})}function Us(e,t){return new qh({check:"max_length",...U(t),maximum:e})}function mn(e,t){return new Zh({check:"min_length",...U(t),minimum:e})}function js(e,t){return new Kh({check:"length_equals",...U(t),length:e})}function pi(e,t){return new Jh({check:"string_format",format:"regex",...U(t),pattern:e})}function mi(e){return new Yh({check:"string_format",format:"lowercase",...U(e)})}function fi(e){return new Qh({check:"string_format",format:"uppercase",...U(e)})}function gi(e,t){return new Xh({check:"string_format",format:"includes",...U(t),includes:e})}function hi(e,t){return new ey({check:"string_format",format:"starts_with",...U(t),prefix:e})}function yi(e,t){return new ty({check:"string_format",format:"ends_with",...U(t),suffix:e})}function ap(e,t,r){return new ry({check:"property",property:e,schema:t,...U(r)})}function bi(e,t){return new ny({check:"properties",shape:e,...U(t)})}function wi(e,t){return new sy({check:"mime_type",mime:e,...U(t)})}function Er(e){return new oy({check:"overwrite",tx:e})}function Ri(e){return Er(t=>t.normalize(e))}function Si(){return Er(e=>e.trim())}function _i(){return Er(e=>e.toLowerCase())}function vi(){return Er(e=>e.toUpperCase())}function ki(){return Er(e=>Ug(e))}function lw(e,t,r){return new e({type:"array",element:t,...U(r)})}function SU(e,t,r){return new e({type:"union",options:t,...U(r)})}function _U(e,t,r){return new e({type:"union",options:t,inclusive:!1,...U(r)})}function vU(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...U(n)})}function kU(e,t,r){return new e({type:"intersection",left:t,right:r})}function CU(e,t,r,n){let s=r instanceof pe,o=s?n:r,i=s?r:null;return new e({type:"tuple",items:t,rest:i,...U(o)})}function PU(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...U(n)})}function EU(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...U(n)})}function AU(e,t,r){return new e({type:"set",valueType:t,...U(r)})}function TU(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(s=>[s,s])):t;return new e({type:"enum",entries:n,...U(r)})}function $U(e,t,r){return new e({type:"enum",entries:t,...U(r)})}function OU(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...U(r)})}function dw(e,t){return new e({type:"file",...U(t)})}function IU(e,t){return new e({type:"transform",transform:t})}function xU(e,t){return new e({type:"optional",innerType:t})}function DU(e,t){return new e({type:"nullable",innerType:t})}function LU(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ic(r)}})}function MU(e,t,r){return new e({type:"nonoptional",innerType:t,...U(r)})}function FU(e,t){return new e({type:"success",innerType:t})}function NU(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:qg(r)})}function GU(e,t,r){return new e({type:"pipe",in:t,out:r})}function UU(e,t){return new e({type:"readonly",innerType:t})}function jU(e,t,r){return new e({type:"template_literal",parts:t,...U(r)})}function zU(e,t){return new e({type:"lazy",getter:t})}function BU(e,t){return new e({type:"promise",innerType:t})}function pw(e,t,r){let n=U(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function mw(e,t,r){return new e({type:"custom",check:"custom",fn:t,...U(r)})}function fw(e,t){let r=SP(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(ri(s,n.value,r._zod.def));else{let o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),n.issues.push(ri(o))}},e(n.value,n)),t);return r}function SP(e,t){let r=new Fe({check:"custom",...U(t)});return r._zod.check=e,r}function gw(e){let t=new Fe({check:"describe"});return t._zod.onattach=[r=>{let n=_t.get(r)??{};_t.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function hw(e){let t=new Fe({check:"meta"});return t._zod.onattach=[r=>{let n=_t.get(r)??{};_t.add(r,{...n,...e})}],t._zod.check=()=>{},t}function yw(e,t){let r=U(t),n=r.truthy??["true","1","yes","on","y","enabled"],s=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(f=>typeof f=="string"?f.toLowerCase():f),s=s.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(n),i=new Set(s),a=e.Codec??Tc,c=e.Boolean??Ec,u=e.String??Ls,d=new u({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),m=new a({type:"pipe",in:d,out:p,transform:((f,g)=>{let h=f;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:i.has(h)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...i],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?n[0]||"true":s[0]||"false"),error:r.error});return m._zod.bag.truthy=n,m._zod.bag.falsy=s,m._zod.bag.case=r.case??"insensitive",m}function zs(e,t,r,n={}){let s=U(n),o={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...s};return r instanceof RegExp&&(o.pattern=r),new e(o)}var Ub,_P=A(()=>{nd();Lc();ui();rt();Ub={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function jc(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&St(e,n,r[n]);return e}function Vn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??_t,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 ut(e,t,r,n,s){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:s}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(s);return Object.assign(r,o),!0}function xe(e,t,r={path:[],schemaPath:[]}){var n;let s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{let m=i.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,m,d)}let p=e._zod.parent;p&&(i.ref||(i.ref=p),xe(p,t,d),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&jc(i.schema,c),t.io==="input"&&Ft(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function vP(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function qn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}let s=i=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(i[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let f=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=f,{defId:f,ref:`${m("__shared")}#/${a}/${vP(f)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+vP(d)}},o=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=s(i);a.def={...a.schema},u&&(a.defId=u);let d=a.schema;for(let p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
62
62
 
63
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){o(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}a.count>1&&e.reused==="ref"&&o(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function PP(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;PP(n);let s=Object.keys(n);if(s.length!==1||s[0]!=="type")return;let o=n.type;for(let i of Array.isArray(o)?o:[o]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}function CP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function bw(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!EP.has(i))return null;t.push(o)}let r={},n=new Set;for(let o of t){for(let i in o.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let d=u.properties?.[i]??CP(u);d!=null&&(a.some(p=>JSON.stringify(p)===JSON.stringify(d))||a.push(d))}let c=a.length===1?a[0]:bw(a)??{allOf:a};St(r,i,c)}for(let i of o.required??[])n.add(i)}let s={type:"object",properties:r};if(n.size&&(s.required=[...n]),t.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{let o=[];for(let i of t){let a=CP(i);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function HU(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let s of EP)if(s in e)return;let r=t.filter(s=>kP.some(o=>Array.isArray(s[o]))),n=null;if(!r.length)n=bw(t);else{let s=r[0],o=kP.find(c=>Array.isArray(s[c]));if(Object.keys(s).length!==1)return;let i=t.filter(c=>c!==s),a=s[o].map(c=>bw([...i,c]));if(a.some(c=>!c))return;n={[o]:a}}n&&(delete e.allOf,jc(e,n))}function Zn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,d={...u},p=c.ref;if(c.ref=null,p){n(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):jc(u,g),jc(u,d),a._zod.parent===p)for(let b in u)b==="$ref"||b==="allOf"||b in d||delete u[b];if(g.$ref&&f.def)for(let b in u)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(u[b])===JSON.stringify(f.def[b])&&delete u[b]}let m=a._zod.parent;if(m&&m!==p){n(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())PP(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let p=a.get(d);p?p.push(u):a.set(d,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])HU(u)}}let s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(a)}jc(s,r.defId?r.schema:r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&s.id===o&&delete s.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,St(i,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{let a=JSON.parse(JSON.stringify(s));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ci(t,"input",e.processors),output:Ci(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ft(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ft(n.element,r);if(n.type==="set")return Ft(n.valueType,r);if(n.type==="lazy")return Ft(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Ft(n.innerType,r);if(n.type==="intersection")return Ft(n.left,r)||Ft(n.right,r);if(n.type==="record"||n.type==="map")return Ft(n.keyType,r)||Ft(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ft(n.in,r)||Ft(n.out,r);if(n.type==="object"){for(let s in n.shape)if(Ft(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(let s of n.options)if(Ft(s,r))return!0;return!1}if(n.type==="tuple"){for(let s of n.items)if(Ft(s,r))return!0;return!!(n.rest&&Ft(n.rest,r))}return!1}var EP,kP,ww,Ci,zc=A(()=>{Lc();rt();EP=new Set(["type","properties","required","additionalProperties"]),kP=["oneOf","anyOf"];ww=(e,t={})=>r=>{let n=Vn({...r,processors:t});return xe(e,n),qn(n,e),Zn(n,e)},Ci=(e,t,r={})=>n=>{let{libraryOptions:s,target:o}=n??{},i=Vn({...s??{},target:o,io:t,processors:r});return xe(e,i),qn(i,e),Zn(i,e)}});function lt(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let o of n)WU[o._zod.def.check]?.(t,o._zod.def);let s=e._zod.bag;s.minimum!==void 0&&Pi(t,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&Pi(t,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&Ei(t,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&Ei(t,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&IP(t,s.multipleOf),s.format!==void 0&&(t.format??(t.format=s.format),s.format.includes("int")&&(t.isInt=!0)),s.mime&&DP(t,s.mime);for(let o of s.patterns??[])xP(t,o);return t}function Bc(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bc(t.out):t.type==="catch"?Bc(t.innerType):e._zod.optin}function Rw(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let g=e.get(t)?.def;if(!g)return t;let h=Rw(e,g,r);return h===g?t:h}for(let g of["anyOf","oneOf"]){let h=t[g];if(!Array.isArray(h))continue;let b=h.map(w=>Rw(e,w,r));b.some((w,y)=>w!==h[y])&&(t={...t,[g]:b})}let n=Array.isArray(t.type)?t.type:[t.type],s=!n.includes("string")&&n.some(g=>g==="number"||g==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!s&&!o?.some(g=>typeof g=="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:d,format:p,id:m,...f}=t;return f.enum?f.enum=f.enum.map(g=>typeof g=="number"?String(g):g):typeof f.const=="number"&&(f.const=String(f.const)),s&&(f.type="string",o||(f.pattern=(n.includes("number")?pn:wc).source)),f}function ZU(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of Sw.get(e)??[]){let s=e.seen.get(n),o=(s?.def??s?.schema)?.propertyNames;if(!o||o===!0||r.has(o))continue;let i=Rw(t,o,new Set);i!==o&&r.set(o,i)}if(r.size)for(let n of e.seen.values())for(let s of[n.schema,n.def]){let o=s&&r.get(s.propertyNames);o&&(s.propertyNames=o)}}function FP(e,t,r,n,s){let o=!1,i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(ut(t,r,n,s,"BigInt defaults cannot be represented in JSON Schema"),Qw):JSON.parse(i)}function dp(e,t){if("_idmap"in e){let n=e,s=Vn({...t,processors:cp}),o={};for(let c of n._idmap.entries()){let[u,d]=c;xe(d,s)}let i={},a={registry:n,uri:t?.uri,defs:o};s.external=a;for(let c of n._idmap.entries()){let[u,d]=c;qn(s,d),St(i,u,Zn(s,d))}if(Object.keys(o).length>0){let c=s.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:o}}return{schemas:i}}let r=Vn({...t,processors:cp});return xe(e,r),qn(r,e),Zn(r,e)}var Pi,Ei,AP,IP,xP,DP,LP,TP,$P,OP,WU,VU,qU,MP,_w,vw,kw,Cw,Pw,Ew,Aw,Tw,$w,Ow,Iw,xw,Dw,Lw,Mw,Fw,Nw,Gw,Uw,jw,zw,Bw,Hw,Ww,Vw,up,qw,Zw,Sw,Kw,Jw,Yw,Qw,Xw,eR,tR,rR,nR,sR,lp,oR,cp,Hc=A(()=>{xs();ui();zc();rt();Pi=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Ei=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},AP=(e,t)=>{Pi(e,"minimum",t),Ei(e,"maximum",t)},IP=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},xP=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},DP=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},LP=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},TP=(e,t)=>Pi(e,"minimum",t.minimum),$P=(e,t)=>Ei(e,"maximum",t.maximum),OP=e=>(t,r)=>{LP(t,r.format);let[n,s]=e[r.format];Pi(t,"minimum",n),Ei(t,"maximum",s)},WU={greater_than:(e,t)=>Pi(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Ei(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>IP(e,t.value),number_format:OP(cc),bigint_format:OP(uc),min_length:TP,max_length:$P,length_equals:(e,t)=>AP(e,t.length),min_size:TP,max_size:$P,size_equals:(e,t)=>AP(e,t.size),string_format:(e,t)=>{LP(e,t.format),t.pattern&&xP(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>DP(e,t.mime)};VU={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qU=new Map([[fd,Sh],[Pc,_h]]),MP=e=>qU.get(e)??e,_w=(e,t,r,n)=>{let s=r;s.type="string";let{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:d}=lt(e);if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=VU[a]??a,s.format===""&&delete s.format,(a==="time"||d)&&delete s.format),u&&(s.contentEncoding=u),c&&c.size>0){let p=[...c].map(MP);p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},vw=(e,t,r,n)=>{let s=r,{minimum:o,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:d}=lt(e);s.type=d?"integer":"number";let p=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(p?f?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u:typeof o=="number"&&(s.minimum=o),m?f?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof i=="number"&&(s.maximum=i),a){let g=new Set;for(let w of a)Number.isFinite(w)&&w!==0?g.add(Math.abs(w)):ut(e,t,s,n,`A multipleOf divisor of ${w} cannot be represented in JSON Schema`);let[h,...b]=g;h!==void 0&&(s.multipleOf=h),b.length&&(s.allOf=[...s.allOf??[],...b.map(w=>({multipleOf:w}))])}},kw=(e,t,r,n)=>{r.type="boolean"},Cw=(e,t,r,n)=>{ut(e,t,r,n,"BigInt cannot be represented in JSON Schema")},Pw=(e,t,r,n)=>{ut(e,t,r,n,"Symbols cannot be represented in JSON Schema")},Ew=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Aw=(e,t,r,n)=>{ut(e,t,r,n,"Undefined cannot be represented in JSON Schema")},Tw=(e,t,r,n)=>{ut(e,t,r,n,"Void cannot be represented in JSON Schema")},$w=(e,t,r,n)=>{r.not={}},Ow=(e,t,r,n)=>{},Iw=(e,t,r,n)=>{},xw=(e,t,r,n)=>{ut(e,t,r,n,"Date cannot be represented in JSON Schema")},Dw=(e,t,r,n)=>{let s=e._zod.def,o=Yo(s.entries);if(o.length===0){r.not={};return}o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},Lw=(e,t,r,n)=>{let s=e._zod.def;if(s.values.length===0){r.not={};return}let o=[];for(let i of s.values)if(i===void 0){if(ut(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(ut(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){let i=o[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),o.every(i=>typeof i=="boolean")&&(r.type="boolean"),o.every(i=>i===null)&&(r.type="null"),r.enum=o},Mw=(e,t,r,n)=>{ut(e,t,r,n,"NaN cannot be represented in JSON Schema")},Fw=(e,t,r,n)=>{let s=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=o.source},Nw=(e,t,r,n)=>{let s=r;s.type="string",s.format="binary",s.contentEncoding="binary";let{minimum:o,maximum:i,mime:a}=lt(e);o!==void 0&&(s.minLength=o),i!==void 0&&(s.maxLength=i),a&&(a.length===0?s.not={}:a.length===1?s.contentMediaType=a[0]:s.anyOf=a.map(c=>({contentMediaType:c})))},Gw=(e,t,r,n)=>{r.type="boolean"},Uw=(e,t,r,n)=>{ut(e,t,r,n,"Custom types cannot be represented in JSON Schema")},jw=(e,t,r,n)=>{ut(e,t,r,n,"Function types cannot be represented in JSON Schema")},zw=(e,t,r,n)=>{ut(e,t,r,n,"Transforms cannot be represented in JSON Schema")},Bw=(e,t,r,n)=>{ut(e,t,r,n,"Map cannot be represented in JSON Schema")},Hw=(e,t,r,n)=>{ut(e,t,r,n,"Set cannot be represented in JSON Schema")},Ww=(e,t,r,n)=>{let s=r,o=e._zod.def,{minimum:i,maximum:a}=lt(e);typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=xe(o.element,t,{...n,path:[...n.path,"items"]})};Vw=(e,t,r,n)=>{let s=r,o=e._zod.def,i=o.shape;if(Object.getOwnPropertySymbols(i).length&&ut(e,t,s,n,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(let u in i)St(s.properties,u,xe(i[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let d=o.shape[u];(t.io==="input"?Bc(d)===void 0:d._zod.optout===void 0)&&c.push(u)}c.length>0&&(s.required=c),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=xe(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},up=(e,t,r,n)=>{let s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>xe(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},qw=(e,t,r,n)=>{let s=e._zod.def,o=xe(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=xe(s.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)},Zw=(e,t,r,n)=>{let s=r,o=e._zod.def;s.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((h,b)=>xe(h,t,{...n,path:[...n.path,i,b]})),u=o.rest?xe(o.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,d=o.items.length;for(;d>0;){let h=o.items[d-1];if(!(t.io==="input"?Bc(h)!==void 0:h._zod.optout==="optional"))break;d--}let p=o.items.length,m=!o.rest;t.target==="draft-2020-12"?(s.prefixItems=c,m?s.items=!1:u&&(s.items=u),d>0&&(s.minItems=d),m&&(s.maxItems=p)):t.target==="openapi-3.0"?(s.items={anyOf:c},u&&s.items.anyOf.push(u),d>0&&(s.minItems=d),m&&(s.maxItems=p)):(s.items=c,m?s.additionalItems=!1:u&&(s.additionalItems=u),d>0&&(s.minItems=d),m&&(s.maxItems=p));let{minimum:f,maximum:g}=lt(e);typeof f=="number"&&(s.minItems=f),typeof g=="number"&&(s.maxItems=g)};Sw=new WeakMap;Kw=(e,t,r,n)=>{let s=r,o=e._zod.def;s.type="object";let i=o.keyType,a=lt(i).patterns;if(o.mode==="loose"&&a&&a.size>0){let d=xe(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(let p of a)St(s.patternProperties,MP(p).source,d)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){s.propertyNames=xe(o.keyType,t,{...n,path:[...n.path,"propertyNames"]});let d=Sw.get(t);d||(d=[],Sw.set(t,d),t.deferred.push(()=>ZU(t))),d.push(e)}s.additionalProperties=xe(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&Bc(o.valueType)!==void 0;if(c&&!o.partial&&!u){let d=[...c].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d.map(String))}},Jw=(e,t,r,n)=>{let s=e._zod.def,o=xe(s.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Yw=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType},Qw=Symbol();Xw=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType;let i=FP(s.defaultValue,e,t,r,n);i!==Qw&&(r.default=i)},eR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);if(o.ref=s.innerType,t.io!=="input")return;let i=FP(s.defaultValue,e,t,r,n);i!==Qw&&(r._prefault=i)},tR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{ut(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},rR=(e,t,r,n)=>{let s=e._zod.def,o=s.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?s.out:s.in:s.out;xe(i,t,n);let a=t.seen.get(e);a.ref=i},nR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType,r.readOnly=!0},sR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType},lp=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType},oR=(e,t,r,n)=>{let s=e._zod.innerType;xe(s,t,n);let o=t.seen.get(e);o.ref=s},cp={string:_w,number:vw,boolean:kw,bigint:Cw,symbol:Pw,null:Ew,undefined:Aw,void:Tw,never:$w,any:Ow,unknown:Iw,date:xw,enum:Dw,literal:Lw,nan:Mw,template_literal:Fw,file:Nw,success:Gw,custom:Uw,function:jw,transform:zw,map:Bw,set:Hw,array:Ww,object:Vw,union:up,intersection:qw,tuple:Zw,record:Kw,nullable:Jw,nonoptional:Yw,default:Xw,prefault:eR,catch:tR,pipe:rR,readonly:nR,promise:sR,optional:lp,lazy:oR}});var pp,NP=A(()=>{Hc();zc();pp=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Vn({processors:cp,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return xe(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,qn(this.ctx,t);let n=Zn(this.ctx,t),{"~standard":s,...o}=n;return o}}});var GP={};var UP=A(()=>{});var fn={};re(fn,{$ZodAny:()=>By,$ZodArray:()=>Ky,$ZodAsyncError:()=>Zt,$ZodBase64:()=>Oy,$ZodBase64URL:()=>Iy,$ZodBigInt:()=>Rd,$ZodBigIntFormat:()=>Gy,$ZodBoolean:()=>Ec,$ZodCIDRv4:()=>Ty,$ZodCIDRv6:()=>$y,$ZodCUID:()=>yy,$ZodCUID2:()=>by,$ZodCatch:()=>fb,$ZodCheck:()=>Fe,$ZodCheckBigIntFormat:()=>Bh,$ZodCheckEndsWith:()=>ty,$ZodCheckGreaterThan:()=>rd,$ZodCheckIncludes:()=>Xh,$ZodCheckLengthEquals:()=>Kh,$ZodCheckLessThan:()=>td,$ZodCheckLowerCase:()=>Yh,$ZodCheckMaxLength:()=>qh,$ZodCheckMaxSize:()=>Hh,$ZodCheckMimeType:()=>sy,$ZodCheckMinLength:()=>Zh,$ZodCheckMinSize:()=>Wh,$ZodCheckMultipleOf:()=>jh,$ZodCheckNumberFormat:()=>zh,$ZodCheckOverwrite:()=>oy,$ZodCheckProperties:()=>ny,$ZodCheckProperty:()=>ry,$ZodCheckRegex:()=>Jh,$ZodCheckSizeEquals:()=>Vh,$ZodCheckStartsWith:()=>ey,$ZodCheckStringFormat:()=>ai,$ZodCheckUpperCase:()=>Qh,$ZodCodec:()=>Tc,$ZodCreditCard:()=>Dy,$ZodCustom:()=>Sb,$ZodCustomStringFormat:()=>Fy,$ZodCyclicError:()=>Ed,$ZodDate:()=>qy,$ZodDefault:()=>lb,$ZodDiscriminatedUnion:()=>Xy,$ZodE164:()=>xy,$ZodEmail:()=>dy,$ZodEmoji:()=>gy,$ZodEncodeError:()=>zn,$ZodEnum:()=>sb,$ZodError:()=>Xg,$ZodExactOptional:()=>cb,$ZodFile:()=>ib,$ZodFunction:()=>wb,$ZodGUID:()=>uy,$ZodIBAN:()=>Ly,$ZodIPv4:()=>Py,$ZodIPv6:()=>Ey,$ZodISODate:()=>vy,$ZodISODateTime:()=>_y,$ZodISODuration:()=>Cy,$ZodISOTime:()=>ky,$ZodIntersection:()=>eb,$ZodJWT:()=>My,$ZodKSUID:()=>Sy,$ZodLazy:()=>$c,$ZodLiteral:()=>ob,$ZodMAC:()=>Ay,$ZodMap:()=>rb,$ZodNaN:()=>gb,$ZodNanoID:()=>hy,$ZodNever:()=>Wy,$ZodNonOptional:()=>pb,$ZodNull:()=>zy,$ZodNullable:()=>ub,$ZodNumber:()=>wd,$ZodNumberFormat:()=>Ny,$ZodObject:()=>oP,$ZodObjectJIT:()=>Jy,$ZodOptional:()=>_d,$ZodPipe:()=>vd,$ZodPrefault:()=>db,$ZodPreprocess:()=>hb,$ZodPromise:()=>Rb,$ZodReadonly:()=>yb,$ZodRealError:()=>Kt,$ZodRecord:()=>tb,$ZodRegistry:()=>Od,$ZodSet:()=>nb,$ZodString:()=>Ls,$ZodStringFormat:()=>Ie,$ZodSuccess:()=>mb,$ZodSymbol:()=>Uy,$ZodTemplateLiteral:()=>bb,$ZodTransform:()=>ab,$ZodTuple:()=>Sd,$ZodType:()=>pe,$ZodULID:()=>wy,$ZodURL:()=>fy,$ZodUUID:()=>ly,$ZodUndefined:()=>jy,$ZodUnion:()=>Ac,$ZodUnknown:()=>Hy,$ZodVoid:()=>Vy,$ZodXID:()=>Ry,$ZodXor:()=>Yy,$brand:()=>Jg,$constructor:()=>$,$input:()=>Ab,$output:()=>Eb,Doc:()=>Ds,INVALID:()=>Mt,JSONSchema:()=>GP,JSONSchemaGenerator:()=>pp,NEVER:()=>Kg,TimePrecision:()=>Ub,URL_BAD_FORMAT:()=>py,URL_UNPARSEABLE:()=>_c,ZodCompileAsyncError:()=>Pr,ZodCompileUnsupportedError:()=>Se,_any:()=>nw,_array:()=>lw,_base64:()=>Xd,_base64url:()=>ep,_bigint:()=>Jb,_boolean:()=>Zb,_catch:()=>NU,_check:()=>SP,_cidrv4:()=>Yd,_cidrv6:()=>Qd,_coercedBigint:()=>Yb,_coercedBoolean:()=>Kb,_coercedDate:()=>cw,_coercedNumber:()=>zb,_coercedString:()=>Mb,_creditCard:()=>Nb,_cuid:()=>Hd,_cuid2:()=>Wd,_custom:()=>pw,_date:()=>aw,_decode:()=>Hl,_decodeAsync:()=>Vl,_default:()=>LU,_discriminatedUnion:()=>vU,_e164:()=>tp,_email:()=>Md,_emoji:()=>zd,_encode:()=>Bl,_encodeAsync:()=>Wl,_endsWith:()=>yi,_enum:()=>TU,_file:()=>dw,_float32:()=>Hb,_float64:()=>Wb,_gt:()=>jr,_gte:()=>ir,_guid:()=>Fd,_iban:()=>Gb,_includes:()=>gi,_int:()=>Bb,_int32:()=>Vb,_int64:()=>Qb,_intersection:()=>kU,_ipv4:()=>Kd,_ipv6:()=>Jd,_isoDate:()=>Nc,_isoDateTime:()=>Fc,_isoDuration:()=>Uc,_isoTime:()=>Gc,_jwt:()=>rp,_ksuid:()=>Zd,_lazy:()=>zU,_length:()=>js,_literal:()=>OU,_lowercase:()=>mi,_lt:()=>Ur,_lte:()=>or,_mac:()=>Fb,_map:()=>EU,_max:()=>or,_maxLength:()=>Us,_maxSize:()=>Wn,_mime:()=>wi,_min:()=>ir,_minLength:()=>mn,_minSize:()=>zr,_multipleOf:()=>Hn,_nan:()=>uw,_nanoid:()=>Bd,_nativeEnum:()=>$U,_negative:()=>sp,_never:()=>ow,_nonnegative:()=>ip,_nonoptional:()=>MU,_nonpositive:()=>op,_normalize:()=>Ri,_null:()=>rw,_nullable:()=>DU,_number:()=>jb,_optional:()=>xU,_overwrite:()=>Er,_parse:()=>ni,_parseAsync:()=>si,_pipe:()=>GU,_positive:()=>np,_promise:()=>BU,_properties:()=>bi,_property:()=>ap,_readonly:()=>UU,_record:()=>PU,_refine:()=>mw,_regex:()=>pi,_safeDecode:()=>Zl,_safeDecodeAsync:()=>Jl,_safeEncode:()=>ql,_safeEncodeAsync:()=>Kl,_safeParse:()=>oi,_safeParseAsync:()=>ii,_set:()=>AU,_size:()=>Gs,_slugify:()=>ki,_startsWith:()=>hi,_string:()=>Lb,_stringFormat:()=>zs,_stringbool:()=>yw,_success:()=>FU,_superRefine:()=>fw,_symbol:()=>ew,_templateLiteral:()=>jU,_toLowerCase:()=>_i,_toUpperCase:()=>vi,_transform:()=>IU,_trim:()=>Si,_tuple:()=>CU,_uint32:()=>qb,_uint64:()=>Xb,_ulid:()=>Vd,_undefined:()=>tw,_union:()=>SU,_unknown:()=>sw,_uppercase:()=>fi,_url:()=>Mc,_uuid:()=>Nd,_uuidv4:()=>Gd,_uuidv6:()=>Ud,_uuidv7:()=>jd,_void:()=>iw,_xid:()=>qd,_xor:()=>_U,base64Charset:()=>fd,base64urlCharset:()=>Pc,canParseURL:()=>my,clone:()=>Oe,compile:()=>Ib,compileFn:()=>Dd,config:()=>Ye,createStandardJSONSchemaMethod:()=>Ci,createToJSONSchemaMethod:()=>ww,decode:()=>AN,decodeAsync:()=>$N,describe:()=>gw,encode:()=>EN,encodeAsync:()=>TN,extractDefs:()=>qn,finalize:()=>Zn,flattenError:()=>fc,formatError:()=>gc,getDiscriminatedOption:()=>Qy,globalConfig:()=>ht,globalRegistry:()=>_t,handleUnrepresentable:()=>ut,initializeContext:()=>Vn,isBackEdge:()=>Td,isRecursiveSchema:()=>Ad,isValidBase64:()=>Cc,isValidBase64URL:()=>gd,isValidCIDRv6:()=>md,isValidCreditCard:()=>hd,isValidIBAN:()=>yd,isValidIPv6:()=>kc,isValidJWT:()=>bd,locales:()=>Dc,memoizer:()=>xc,mergeValues:()=>ci,meta:()=>hw,parse:()=>jl,parseAsync:()=>zl,parseURLObject:()=>rP,prettifyError:()=>th,process:()=>xe,processSchema:()=>xe,regexes:()=>Rr,registry:()=>Id,safeDecode:()=>IN,safeDecodeAsync:()=>DN,safeEncode:()=>ON,safeEncodeAsync:()=>xN,safeParse:()=>_N,safeParseAsync:()=>vN,standardProps:()=>ud,stripTabAndNewline:()=>vc,toDotPath:()=>LC,toJSONSchema:()=>dp,toZod:()=>sc,treeifyError:()=>eh,urlHostnameOk:()=>dd,urlProtocolOk:()=>pd,util:()=>V,validate:()=>hc,validateAsync:()=>yc,validateURL:()=>ld,version:()=>iy,withParser:()=>xd});var ar=A(()=>{jn();nh();rh();ui();kb();nd();ay();rt();rt();xs();Pb();Lc();sd();RP();_P();zc();Hc();NP();UP()});var mp={};re(mp,{endsWith:()=>yi,gt:()=>jr,gte:()=>ir,includes:()=>gi,length:()=>js,lowercase:()=>mi,lt:()=>Ur,lte:()=>or,maxLength:()=>Us,maxSize:()=>Wn,mime:()=>wi,minLength:()=>mn,minSize:()=>zr,multipleOf:()=>Hn,negative:()=>sp,nonnegative:()=>ip,nonpositive:()=>op,normalize:()=>Ri,overwrite:()=>Er,positive:()=>np,properties:()=>bi,property:()=>ap,regex:()=>pi,size:()=>Gs,slugify:()=>ki,startsWith:()=>hi,toLowerCase:()=>_i,toUpperCase:()=>vi,trim:()=>Si,uppercase:()=>fi});var fp=A(()=>{ar()});function gp(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var jP,zP,JU,Jt,iR=A(()=>{ar();ar();rt();jP=new WeakSet([Object.prototype,Error.prototype]);zP=(e,t)=>{Xg.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);jP.has(r)||(jP.add(r),gp(r,"format",n=>s=>gc(n,s)),gp(r,"flatten",n=>s=>fc(n,s)),gp(r,"addIssue",n=>s=>{n.issues.push(s),n.message=JSON.stringify(n.issues,Qo,2)}),gp(r,"addIssues",n=>s=>{n.issues.push(...s),n.message=JSON.stringify(n.issues,Qo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},JU=$("ZodError",zP),Jt=$("ZodError",zP,void 0,{Parent:Error})});var aR,cR,uR,lR,dR,pR,mR,fR,gR,hR,yR,bR,wR=A(()=>{ar();iR();ar();aR=ni(Jt),cR=si(Jt),uR=oi(Jt),lR=ii(Jt),dR=Bl(Jt),pR=Hl(Jt),mR=Wl(Jt),fR=Vl(Jt),gR=ql(Jt),hR=Zl(Jt),yR=Kl(Jt),bR=Jl(Jt)});var Li={};re(Li,{ZodAny:()=>TR,ZodArray:()=>xR,ZodBase64:()=>Ip,ZodBase64URL:()=>xp,ZodBigInt:()=>xi,ZodBigIntFormat:()=>Mp,ZodBoolean:()=>Ii,ZodCIDRv4:()=>$p,ZodCIDRv6:()=>Op,ZodCUID:()=>vp,ZodCUID2:()=>kp,ZodCatch:()=>eS,ZodCodec:()=>eu,ZodCreditCard:()=>SR,ZodCustom:()=>tu,ZodCustomStringFormat:()=>Vs,ZodDate:()=>Zc,ZodDefault:()=>ZR,ZodDiscriminatedUnion:()=>LR,ZodE164:()=>Dp,ZodEmail:()=>wp,ZodEmoji:()=>Sp,ZodEnum:()=>Ti,ZodExactOptional:()=>Up,ZodFile:()=>HR,ZodFunction:()=>lS,ZodGUID:()=>Rp,ZodIBAN:()=>_R,ZodIPv4:()=>Ap,ZodIPv6:()=>Tp,ZodISODate:()=>Jn,ZodISODateTime:()=>Kn,ZodISODuration:()=>Qn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>mS,ZodIntersection:()=>MR,ZodJWT:()=>Lp,ZodKSUID:()=>Ep,ZodLazy:()=>aS,ZodLiteral:()=>BR,ZodMAC:()=>RR,ZodMap:()=>jR,ZodNaN:()=>rS,ZodNanoID:()=>_p,ZodNever:()=>OR,ZodNonOptional:()=>jp,ZodNull:()=>ER,ZodNullable:()=>qR,ZodNumber:()=>Oi,ZodNumberFormat:()=>qs,ZodObject:()=>Jc,ZodOptional:()=>Qc,ZodPipe:()=>Xc,ZodPrefault:()=>JR,ZodPreprocess:()=>nS,ZodPromise:()=>uS,ZodReadonly:()=>sS,ZodRecord:()=>Ai,ZodSet:()=>zR,ZodString:()=>$i,ZodStringFormat:()=>Le,ZodSuccess:()=>XR,ZodSymbol:()=>CR,ZodTemplateLiteral:()=>iS,ZodTransform:()=>WR,ZodTuple:()=>NR,ZodType:()=>ge,ZodULID:()=>Cp,ZodURL:()=>qc,ZodUUID:()=>Br,ZodUndefined:()=>PR,ZodUnion:()=>Yc,ZodUnknown:()=>$R,ZodVoid:()=>IR,ZodXID:()=>Pp,ZodXor:()=>DR,_ZodString:()=>bp,_default:()=>KR,_function:()=>QE,any:()=>TE,array:()=>Kc,base64:()=>uE,base64url:()=>lE,bigint:()=>kE,boolean:()=>kR,catch:()=>tS,check:()=>XE,cidrv4:()=>aE,cidrv6:()=>cE,codec:()=>ZE,creditCard:()=>pE,cuid:()=>XP,cuid2:()=>eE,currencyCode:()=>bE,custom:()=>eA,date:()=>OE,describe:()=>tA,discriminatedUnion:()=>FE,e164:()=>dE,email:()=>BP,emoji:()=>YP,enum:()=>Np,exactOptional:()=>VR,file:()=>HE,float32:()=>RE,float64:()=>SE,function:()=>QE,guid:()=>HP,hash:()=>wE,hex:()=>yE,hostname:()=>hE,httpUrl:()=>JP,iban:()=>mE,instanceof:()=>nA,int:()=>hp,int32:()=>_E,int64:()=>CE,intersection:()=>FR,invertCodec:()=>KE,ipv4:()=>sE,ipv6:()=>iE,json:()=>oA,jwt:()=>fE,keyof:()=>IE,ksuid:()=>nE,lazy:()=>cS,literal:()=>BE,looseObject:()=>LE,looseRecord:()=>GE,mac:()=>oE,map:()=>UE,meta:()=>rA,nan:()=>qE,nanoid:()=>QP,nativeEnum:()=>zE,never:()=>Fp,nonoptional:()=>QR,null:()=>AR,nullable:()=>Vc,nullish:()=>WE,number:()=>vR,object:()=>xE,optional:()=>Hs,partialRecord:()=>NE,pipe:()=>yp,prefault:()=>YR,preprocess:()=>iA,promise:()=>YE,readonly:()=>oS,record:()=>UR,refine:()=>dS,set:()=>jE,strictObject:()=>DE,string:()=>Wc,stringFormat:()=>gE,stringbool:()=>sA,success:()=>VE,superRefine:()=>pS,symbol:()=>EE,templateLiteral:()=>JE,transform:()=>Gp,tuple:()=>GR,uint32:()=>vE,uint64:()=>PE,ulid:()=>tE,undefined:()=>AE,union:()=>Di,unknown:()=>Bs,url:()=>KP,uuid:()=>WP,uuidv4:()=>VP,uuidv6:()=>qP,uuidv7:()=>ZP,void:()=>$E,xid:()=>rE,xor:()=>ME});function QU(){ht.localeError||Ye($d())}function Ws(){ht.memoizer||Ye({memoizer:xc()})}function Wc(e){return Lb($i,e)}function BP(e){return Md(wp,e)}function HP(e){return Fd(Rp,e)}function WP(e){return Nd(Br,e)}function VP(e){return Gd(Br,e)}function qP(e){return Ud(Br,e)}function ZP(e){return jd(Br,e)}function KP(e){return Mc(qc,e)}function JP(e){return Mc(qc,{protocol:bc,hostname:kh,...V.normalizeParams(e)})}function YP(e){return zd(Sp,e)}function QP(e){return Bd(_p,e)}function XP(e){return Hd(vp,e)}function eE(e){return Wd(kp,e)}function tE(e){return Vd(Cp,e)}function rE(e){return qd(Pp,e)}function nE(e){return Zd(Ep,e)}function sE(e){return Kd(Ap,e)}function oE(e){return Fb(RR,e)}function iE(e){return Jd(Tp,e)}function aE(e){return Yd($p,e)}function cE(e){return Qd(Op,e)}function uE(e){return Xd(Ip,e)}function lE(e){return ep(xp,e)}function dE(e){return tp(Dp,e)}function pE(e){return Nb(SR,e)}function mE(e){return Gb(_R,e)}function fE(e){return rp(Lp,e)}function gE(e,t,r={}){return zs(Vs,e,t,r)}function hE(e){return zs(Vs,"hostname",vh,e)}function yE(e){return zs(Vs,"hex",Nh,e)}function bE(e){return zs(Vs,"currency_code",Ph,e)}function wE(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,s=Rr[n];if(!s)throw new Error(`Unrecognized hash format: ${n}`);return zs(Vs,n,s,t)}function vR(e){return jb(Oi,e)}function hp(e){return Bb(qs,e)}function RE(e){return Hb(qs,e)}function SE(e){return Wb(qs,e)}function _E(e){return Vb(qs,e)}function vE(e){return qb(qs,e)}function kR(e){return Zb(Ii,e)}function kE(e){return Jb(xi,e)}function CE(e){return Qb(Mp,e)}function PE(e){return Xb(Mp,e)}function EE(e){return ew(CR,e)}function AE(e){return tw(PR,e)}function AR(e){return rw(ER,e)}function TE(){return nw(TR)}function Bs(){return sw($R)}function Fp(e){return ow(OR,e)}function $E(e){return iw(IR,e)}function OE(e){return aw(Zc,e)}function Kc(e,t){return lw(xR,e,t)}function IE(e){let t=e._zod.def.shape;return Np(Object.keys(t))}function xE(e,t){let r={type:"object",shape:e??{},...V.normalizeParams(t)};return new Jc(r)}function DE(e,t){return new Jc({type:"object",shape:e,catchall:Fp(),...V.normalizeParams(t)})}function LE(e,t){return new Jc({type:"object",shape:e,catchall:Bs(),...V.normalizeParams(t)})}function Di(e,t){return new Yc({type:"union",options:e,...V.normalizeParams(t)})}function ME(e,t){return new DR({type:"union",options:e,inclusive:!1,...V.normalizeParams(t)})}function FE(e,t,r){return new LR({type:"union",options:t,discriminator:e,...V.normalizeParams(r)})}function FR(e,t){return new MR({type:"intersection",left:e,right:t})}function GR(e,t,r){let n=t instanceof pe,s=n?r:t,o=n?t:null;return new NR({type:"tuple",items:e,rest:o,...V.normalizeParams(s)})}function UR(e,t,r){return!t||!t._zod?new Ai({type:"record",keyType:Wc(),valueType:e,...V.normalizeParams(t)}):new Ai({type:"record",keyType:e,valueType:t,...V.normalizeParams(r)})}function NE(e,t,r){return new Ai({type:"record",keyType:e,valueType:t,...V.normalizeParams(r),partial:!0})}function GE(e,t,r){return new Ai({type:"record",keyType:e,valueType:t,mode:"loose",...V.normalizeParams(r)})}function UE(e,t,r){return new jR({type:"map",keyType:e,valueType:t,...V.normalizeParams(r)})}function jE(e,t){return new zR({type:"set",valueType:e,...V.normalizeParams(t)})}function Np(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ti({type:"enum",entries:r,...V.normalizeParams(t)})}function zE(e,t){return new Ti({type:"enum",entries:e,...V.normalizeParams(t)})}function BE(e,t){return new BR({type:"literal",values:Array.isArray(e)?e:[e],...V.normalizeParams(t)})}function HE(e){return dw(HR,e)}function Gp(e){return new WR({type:"transform",transform:e})}function Hs(e){return new Qc({type:"optional",innerType:e})}function VR(e){return new Up({type:"optional",innerType:e})}function Vc(e){return new qR({type:"nullable",innerType:e})}function WE(e){return Hs(Vc(e))}function KR(e,t){return new ZR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V.shallowClone(t)}})}function YR(e,t){return new JR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():V.shallowClone(t)}})}function QR(e,t){return new jp({type:"nonoptional",innerType:e,...V.normalizeParams(t)})}function VE(e){return new XR({type:"success",innerType:e})}function tS(e,t){return new eS({type:"catch",innerType:e,catchValue:typeof t=="function"?t:V.constantCatch(t)})}function qE(e){return uw(rS,e)}function yp(e,t){return new Xc({type:"pipe",in:e,out:t})}function ZE(e,t,r){return new eu({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function KE(e){let t=e._zod.def;return new eu({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function oS(e){return new sS({type:"readonly",innerType:e})}function JE(e,t){return new iS({type:"template_literal",parts:e,...V.normalizeParams(t)})}function cS(e){return new aS({type:"lazy",getter:e})}function YE(e){return new uS({type:"promise",innerType:e})}function QE(e){return new lS({type:"function",input:Array.isArray(e?.input)?GR(e?.input):e?.input??Kc(Bs()),output:e?.output??Bs()})}function XE(e){let t=new Fe({check:"custom"});return t._zod.check=e,t}function eA(e,t){return pw(tu,e??(()=>!0),t)}function dS(e,t={}){return mw(tu,e,t)}function pS(e,t){return fw(e,t)}function nA(e,t={}){let r=new mS({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...V.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function oA(e){let t=cS(()=>Di([Wc(e),vR(),kR(),AR(),Kc(t),UR(Wc(),t)]));return t}function iA(e,t){return new nS({type:"pipe",in:Gp(e),out:t})}var ge,bp,$i,Le,Kn,Jn,Yn,Qn,wp,Rp,Br,qc,Sp,_p,vp,kp,Cp,Pp,Ep,Ap,RR,Tp,$p,Op,Ip,xp,Dp,SR,_R,Lp,Vs,Oi,qs,Ii,xi,Mp,CR,PR,ER,TR,$R,OR,IR,Zc,xR,Jc,Yc,DR,LR,MR,NR,Ai,jR,zR,Ti,BR,HR,WR,Qc,Up,qR,ZR,JR,jp,XR,eS,rS,Xc,eu,nS,sS,iS,aS,uS,lS,tu,tA,rA,mS,sA,Xn=A(()=>{ar();ar();Hc();xs();zc();Cb();fp();wR();ge=$("ZodType",(e,t)=>(QU(),pe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(V.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Oe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dS(e,t))},superRefine(e,t){return this.check(pS(e,t))},overwrite(e){return this.check(Er(e))},optional(){return Hs(this)},exactOptional(){return VR(this)},nullable(){return Vc(this)},nullish(){return Hs(Vc(this))},nonoptional(e){return QR(this,e)},array(){return Kc(this)},or(e){return Di([this,e])},and(e){return FR(this,e)},transform(e){return yp(this,Gp(e))},default(e){return KR(this,e)},prefault(e){return YR(this,e)},catch(e){return tS(this,e)},pipe(e){return yp(this,e)},readonly(){return oS(this)},describe(e){let t=this.clone();return _t.add(t,{description:e}),t},meta(...e){if(e.length===0)return _t.get(this);let t=this.clone();return _t.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return V.hide(this,"~standard",{...ud(this),jsonSchema:{input:Ci(this,"input"),output:Ci(this,"output")}})},set"~standard"(e){V.own(this,"~standard",e)},parse:function e(t,r){return aR(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await cR(this,t,r,{callee:e})},safeParse(e,t){return uR(this,e,t)},async safeParseAsync(e,t){return lR(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){V.own(this,"spa",e)},validate(e,t){return hc(this,e,t)},validateAsync(e,t){return yc(this,e,t)},encode:function e(t,r){return dR(this,t,r,{callee:e})},decode:function e(t,r){return pR(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await mR(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await fR(this,t,r,{callee:e})},safeEncode(e,t){return gR(this,e,t)},safeDecode(e,t){return hR(this,e,t)},async safeEncodeAsync(e,t){return yR(this,e,t)},async safeDecodeAsync(e,t){return bR(this,e,t)},toJSONSchema(e){return ww(this,{})(e)},get description(){return _t.get(this)?.description},get _def(){return this._zod.def}}),bp=$("_ZodString",(e,t)=>{Ls.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_w(e,r,n,s)},V.derived({format:e=>lt(e).format??null,minLength:e=>lt(e).minimum??null,maxLength:e=>lt(e).maximum??null},{regex(...e){return this.check(pi(...e))},includes(...e){return this.check(gi(...e))},startsWith(...e){return this.check(hi(...e))},endsWith(...e){return this.check(yi(...e))},min(...e){return this.check(mn(...e))},max(...e){return this.check(Us(...e))},length(...e){return this.check(js(...e))},nonempty(...e){return this.check(mn(1,...e))},lowercase(e){return this.check(mi(e))},uppercase(e){return this.check(fi(e))},trim(){return this.check(Si())},normalize(...e){return this.check(Ri(...e))},toLowerCase(){return this.check(_i())},toUpperCase(){return this.check(vi())},slugify(){return this.check(ki())}})),$i=$("ZodString",(e,t)=>{Ls.init(e,t),bp.init(e,t)},{email(e){return this.check(Md(wp,e))},url(e){return this.check(Mc(qc,e))},jwt(e){return this.check(rp(Lp,e))},emoji(e){return this.check(zd(Sp,e))},guid(e){return this.check(Fd(Rp,e))},uuid(e){return this.check(Nd(Br,e))},uuidv4(e){return this.check(Gd(Br,e))},uuidv6(e){return this.check(Ud(Br,e))},uuidv7(e){return this.check(jd(Br,e))},nanoid(e){return this.check(Bd(_p,e))},cuid(e){return this.check(Hd(vp,e))},cuid2(e){return this.check(Wd(kp,e))},ulid(e){return this.check(Vd(Cp,e))},base64(e){return this.check(Xd(Ip,e))},base64url(e){return this.check(ep(xp,e))},xid(e){return this.check(qd(Pp,e))},ksuid(e){return this.check(Zd(Ep,e))},ipv4(e){return this.check(Kd(Ap,e))},ipv6(e){return this.check(Jd(Tp,e))},cidrv4(e){return this.check(Yd($p,e))},cidrv6(e){return this.check(Qd(Op,e))},e164(e){return this.check(tp(Dp,e))},datetime(e){return this.check(Fc(Kn,e))},date(e){return this.check(Nc(Jn,e))},time(e){return this.check(Gc(Yn,e))},duration(e){return this.check(Uc(Qn,e))}});Le=$("ZodStringFormat",(e,t)=>{Ie.init(e,t),bp.init(e,t)}),Kn=$("ZodISODateTime",(e,t)=>{_y.init(e,t),Le.init(e,t)}),Jn=$("ZodISODate",(e,t)=>{vy.init(e,t),Le.init(e,t)}),Yn=$("ZodISOTime",(e,t)=>{ky.init(e,t),Le.init(e,t)}),Qn=$("ZodISODuration",(e,t)=>{Cy.init(e,t),Le.init(e,t)}),wp=$("ZodEmail",(e,t)=>{dy.init(e,t),Le.init(e,t)});Rp=$("ZodGUID",(e,t)=>{uy.init(e,t),Le.init(e,t)});Br=$("ZodUUID",(e,t)=>{ly.init(e,t),Le.init(e,t)});qc=$("ZodURL",(e,t)=>{fy.init(e,t),Le.init(e,t)});Sp=$("ZodEmoji",(e,t)=>{gy.init(e,t),Le.init(e,t)});_p=$("ZodNanoID",(e,t)=>{hy.init(e,t),Le.init(e,t)});vp=$("ZodCUID",(e,t)=>{yy.init(e,t),Le.init(e,t)});kp=$("ZodCUID2",(e,t)=>{by.init(e,t),Le.init(e,t)});Cp=$("ZodULID",(e,t)=>{wy.init(e,t),Le.init(e,t)});Pp=$("ZodXID",(e,t)=>{Ry.init(e,t),Le.init(e,t)});Ep=$("ZodKSUID",(e,t)=>{Sy.init(e,t),Le.init(e,t)});Ap=$("ZodIPv4",(e,t)=>{Py.init(e,t),Le.init(e,t)});RR=$("ZodMAC",(e,t)=>{Ay.init(e,t),Le.init(e,t)});Tp=$("ZodIPv6",(e,t)=>{Ey.init(e,t),Le.init(e,t)});$p=$("ZodCIDRv4",(e,t)=>{Ty.init(e,t),Le.init(e,t)});Op=$("ZodCIDRv6",(e,t)=>{$y.init(e,t),Le.init(e,t)});Ip=$("ZodBase64",(e,t)=>{Oy.init(e,t),Le.init(e,t)});xp=$("ZodBase64URL",(e,t)=>{Iy.init(e,t),Le.init(e,t)});Dp=$("ZodE164",(e,t)=>{xy.init(e,t),Le.init(e,t)});SR=$("ZodCreditCard",(e,t)=>{Dy.init(e,t),Le.init(e,t)});_R=$("ZodIBAN",(e,t)=>{Ly.init(e,t),Le.init(e,t)});Lp=$("ZodJWT",(e,t)=>{My.init(e,t),Le.init(e,t)});Vs=$("ZodCustomStringFormat",(e,t)=>{Fy.init(e,t),Le.init(e,t)});Oi=$("ZodNumber",(e,t)=>{wd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vw(e,r,n,s),e.isFinite=!0},V.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=lt(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=lt(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=lt(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>lt(e).format??null},{gt(e,t){return this.check(jr(e,t))},gte(e,t){return this.check(ir(e,t))},min(e,t){return this.check(ir(e,t))},lt(e,t){return this.check(Ur(e,t))},lte(e,t){return this.check(or(e,t))},max(e,t){return this.check(or(e,t))},int(e){return this.check(hp(e))},safe(e){return this.check(hp(e))},positive(e){return this.check(jr(0,e))},nonnegative(e){return this.check(ir(0,e))},negative(e){return this.check(Ur(0,e))},nonpositive(e){return this.check(or(0,e))},multipleOf(e,t){return this.check(Hn(e,t))},step(e,t){return this.check(Hn(e,t))},finite(){return this}}));qs=$("ZodNumberFormat",(e,t)=>{Ny.init(e,t),Oi.init(e,t)});Ii=$("ZodBoolean",(e,t)=>{Ec.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>kw(e,r,n,s)});xi=$("ZodBigInt",(e,t)=>{Rd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Cw(e,r,n,s)},V.derived({minValue:e=>lt(e).minimum??null,maxValue:e=>lt(e).maximum??null,format:e=>lt(e).format??null},{gte(e,t){return this.check(ir(e,t))},min(e,t){return this.check(ir(e,t))},gt(e,t){return this.check(jr(e,t))},lt(e,t){return this.check(Ur(e,t))},lte(e,t){return this.check(or(e,t))},max(e,t){return this.check(or(e,t))},positive(e){return this.check(jr(BigInt(0),e))},negative(e){return this.check(Ur(BigInt(0),e))},nonpositive(e){return this.check(or(BigInt(0),e))},nonnegative(e){return this.check(ir(BigInt(0),e))},multipleOf(e,t){return this.check(Hn(e,t))}}));Mp=$("ZodBigIntFormat",(e,t)=>{Gy.init(e,t),xi.init(e,t)});CR=$("ZodSymbol",(e,t)=>{Uy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Pw(e,r,n,s)});PR=$("ZodUndefined",(e,t)=>{jy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Aw(e,r,n,s)});ER=$("ZodNull",(e,t)=>{zy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ew(e,r,n,s)});TR=$("ZodAny",(e,t)=>{By.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ow(e,r,n,s)});$R=$("ZodUnknown",(e,t)=>{Hy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Iw(e,r,n,s)});OR=$("ZodNever",(e,t)=>{Wy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>$w(e,r,n,s)});IR=$("ZodVoid",(e,t)=>{Vy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Tw(e,r,n,s)});Zc=$("ZodDate",(e,t)=>{qy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>xw(e,r,n,s),e.min=(r,n)=>e.check(ir(r,n)),e.max=(r,n)=>e.check(or(r,n))},V.derived({minDate:e=>{let{minimum:t}=lt(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=lt(e);return t?new Date(t):null}},{}));xR=$("ZodArray",(e,t)=>{Ws(),Ky.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ww(e,r,n,s),e.element=t.element},{min(e,t){return this.check(mn(e,t))},nonempty(e){return this.check(mn(1,e))},max(e,t){return this.check(Us(e,t))},length(e,t){return this.check(js(e,t))},unwrap(){return this.element}});Jc=$("ZodObject",(e,t)=>{Ws(),Jy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Vw(e,r,n,s),V.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Np(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(V.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(V.mergeDefs(this._zod.def,{catchall:Bs()}))},loose(){return this.clone(V.mergeDefs(this._zod.def,{catchall:Bs()}))},strict(){return this.clone(V.mergeDefs(this._zod.def,{catchall:Fp()}))},strip(){return this.clone(V.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return V.extend(this,e)},safeExtend(e){return V.safeExtend(this,e)},merge(e){return V.merge(this,e)},pick(e){return V.pick(this,e)},omit(e){return V.omit(this,e)},partial(...e){return V.partial(Qc,this,e[0])},exactPartial(...e){return V.partial(Up,this,e[0],"exactPartial")},required(...e){return V.required(jp,this,e[0])}});Yc=$("ZodUnion",(e,t)=>{Ac.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>up(e,r,n,s),e.options=t.options});DR=$("ZodXor",(e,t)=>{Yc.init(e,t),Yy.init(e,t),e._zod.processJSONSchema=(r,n,s)=>up(e,r,n,s),e.options=t.options});LR=$("ZodDiscriminatedUnion",(e,t)=>{Yc.init(e,t),Xy.init(e,t)});MR=$("ZodIntersection",(e,t)=>{eb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>qw(e,r,n,s)});NR=$("ZodTuple",(e,t)=>{Ws(),Sd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Zw(e,r,n,s)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Qc({type:"optional",innerType:t}))})}});Ai=$("ZodRecord",(e,t)=>{Ws(),tb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Kw(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});jR=$("ZodMap",(e,t)=>{Ws(),rb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Bw(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(zr(...r)),e.nonempty=r=>e.check(zr(1,r)),e.max=(...r)=>e.check(Wn(...r)),e.size=(...r)=>e.check(Gs(...r))});zR=$("ZodSet",(e,t)=>{Ws(),nb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Hw(e,r,n,s),e.min=(...r)=>e.check(zr(...r)),e.nonempty=r=>e.check(zr(1,r)),e.max=(...r)=>e.check(Wn(...r)),e.size=(...r)=>e.check(Gs(...r))});Ti=$("ZodEnum",(e,t)=>{sb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,s,o)=>Dw(e,n,s,o),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{let o={};for(let i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Ti({...t,checks:[],...V.normalizeParams(s),entries:o})},e.exclude=(n,s)=>{let o={...t.entries};for(let i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new Ti({...t,checks:[],...V.normalizeParams(s),entries:o})}});BR=$("ZodLiteral",(e,t)=>{ob.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Lw(e,r,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});HR=$("ZodFile",(e,t)=>{ib.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Nw(e,r,n,s),e.min=(r,n)=>e.check(zr(r,n)),e.max=(r,n)=>e.check(Wn(r,n)),e.mime=(r,n)=>e.check(wi(Array.isArray(r)?r:[r],n))});WR=$("ZodTransform",(e,t)=>{Ws(),ab.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>zw(e,r,n,s),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zn(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(V.issue(o,r.value,t));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=e),r.issues.push(V.issue(i))}};let s=t.transform(r.value,r);return s instanceof Promise?s.then(o=>(r.value=o,r)):(r.value=s,r)}});Qc=$("ZodOptional",(e,t)=>{_d.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lp(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});Up=$("ZodExactOptional",(e,t)=>{cb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lp(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});qR=$("ZodNullable",(e,t)=>{ub.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Jw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});ZR=$("ZodDefault",(e,t)=>{lb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Xw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});JR=$("ZodPrefault",(e,t)=>{db.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>eR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});jp=$("ZodNonOptional",(e,t)=>{pb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Yw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});XR=$("ZodSuccess",(e,t)=>{mb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Gw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});eS=$("ZodCatch",(e,t)=>{fb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>tR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});rS=$("ZodNaN",(e,t)=>{gb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Mw(e,r,n,s)});Xc=$("ZodPipe",(e,t)=>{vd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>rR(e,r,n,s),e.in=t.in,e.out=t.out});eu=$("ZodCodec",(e,t)=>{Xc.init(e,t),Tc.init(e,t)});nS=$("ZodPreprocess",(e,t)=>{Xc.init(e,t),hb.init(e,t)}),sS=$("ZodReadonly",(e,t)=>{yb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>nR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});iS=$("ZodTemplateLiteral",(e,t)=>{bb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Fw(e,r,n,s)});aS=$("ZodLazy",(e,t)=>{$c.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>oR(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});uS=$("ZodPromise",(e,t)=>{Rb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});lS=$("ZodFunction",(e,t)=>{wb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>jw(e,r,n,s)});tu=$("ZodCustom",(e,t)=>{Sb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Uw(e,r,n,s)});tA=gw,rA=hw,mS=$("ZodInstanceOf",(e,t)=>{tu.init(e,t)},{properties(e,t){return this.check(bi(e,t))}});sA=(...e)=>yw({Codec:eu,Boolean:Ii,String:$i},...e)});function ej(e){Ye({customError:e})}function tj(){return Ye().customError}var XU,fS,aA=A(()=>{ar();XU={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};fS||(fS={})});var ru={};re(ru,{ZodISODate:()=>Jn,ZodISODateTime:()=>Kn,ZodISODuration:()=>Qn,ZodISOTime:()=>Yn,date:()=>nj,datetime:()=>rj,duration:()=>oj,time:()=>sj});function rj(e){return Fc(Kn,e)}function nj(e){return Nc(Jn,e)}function sj(e){return Gc(Yn,e)}function oj(e){return Uc(Qn,e)}var zp=A(()=>{ar();Xn();Xn()});function aj(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function cA(e,t){return e.map((r,n)=>n<t?r:r.optional())}function cj(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function uj(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let s=r[1]===void 0?void 0:cj(r[1]);if(!s||!t.defs[s])throw new Error(`Reference not found: ${e}`);return t.defs[s]}throw new Error(`Reference not found: ${e}`)}function lj(e,t){return W.transform(n=>n).check(n=>{let s=n.value;if(typeof s!="object"||s===null||Array.isArray(s))return;let o=Object.getOwnPropertyNames(s);if(t.minProperties!==void 0&&o.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:s,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:s,inst:e,continue:!0}),t.keySchema)for(let i of o){let a=t.keySchema.safeParse(i);a.success||n.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:i,path:[i],continue:!0})}}).pipe(e)}function gS(e,t){if(e===null)return"z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return`${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let i of e){let a=gS(i,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let n=Object.keys(e).sort(),s=[];for(let o of n){let i=gS(e[o],t);if(i===null)return null;s.push(`${o.length}:${o}=${i}`)}return`o${s.length}:{${s.join(",")}}`}finally{t.delete(e)}}function nu(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(nu):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>dj.has(t)?nu(r):!pj.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some(nu))}function uA(e){return e===1?"element":"elements"}function mj(e,t){return W.transform(n=>n).check(n=>{let s=n.value;if(Array.isArray(s)){if(t.uniqueItems===!0){let o=new Map;for(let i=0;i<s.length;i++){let a=gS(s[i],new Set);if(a===null)continue;let c=o.get(a);if(c===void 0){o.set(a,i);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${i} duplicates the one at index ${c}`,input:s,path:[i],continue:!0})}}if(t.containsSchema){let o=t.minContains??1,i=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of s)if(t.containsSchema.safeParse(c).success&&++a>=i)break;a<o&&n.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${uA(o)}; found ${a}`,input:s,continue:!0}),t.maxContains!==void 0&&a>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${uA(t.maxContains)}`,input:s,continue:!0})}}}).pipe(e)}function lA(e,t){if(e!==!1)return e===void 0||e===!0?W.any():Nt(e,t)}function dA(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return W.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let s=e.$ref;if(t.refs.has(s))return t.refs.get(s);if(t.processing.has(s))return W.lazy(()=>{if(!t.refs.has(s))throw new Error(`Circular reference not resolved: ${s}`);return t.refs.get(s)});t.processing.add(s);let o=uj(s,t),i=Nt(o,t);return t.refs.set(s,i),t.processing.delete(s),i}if(e.enum!==void 0){let s=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&s.length===1&&s[0]===null)return W.null();if(s.length===0)return W.never();if(s.length===1)return W.literal(s[0]);if(s.every(i=>typeof i=="string"))return W.enum(s);let o=s.map(i=>W.literal(i));return o.length<2?o[0]:W.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return W.literal(e.const);let r=e.type;if(Array.isArray(r)){let s=r.map(o=>{let i={...e,type:o};return dA(i,t)});return s.length===0?W.never():s.length===1?s[0]:W.union(s)}if(!r)return W.any();let n;switch(r){case"string":{let s=W.string();if(e.format){let o=e.format;o==="email"?s=s.check(W.email()):o==="uri"||o==="uri-reference"?s=s.check(W.url()):o==="uuid"||o==="guid"?s=s.check(W.uuid()):o==="date-time"?s=s.check(W.iso.datetime({offset:!0})):o==="date"?s=s.check(W.iso.date()):o==="time"?s=s.check(W.regex(fj)):o==="duration"?s=s.check(W.iso.duration()):o==="hostname"?s=s.check(W.hostname()):o==="ipv4"?s=s.check(W.ipv4()):o==="ipv6"?s=s.check(W.ipv6()):o==="mac"?s=s.check(W.mac()):o==="cidr"?s=s.check(W.cidrv4()):o==="cidr-v6"?s=s.check(W.cidrv6()):o==="base64"?s=s.check(W.base64()):o==="base64url"?s=s.check(W.base64url()):o==="e164"?s=s.check(W.e164()):o==="credit_card"?s=s.check(W.creditCard()):o==="iban"?s=s.check(W.iban()):o==="jwt"?s=s.check(W.jwt()):o==="emoji"?s=s.check(W.emoji()):o==="nanoid"?s=s.check(W.nanoid()):o==="cuid"?s=s.check(W.cuid()):o==="cuid2"?s=s.check(W.cuid2()):o==="ulid"?s=s.check(W.ulid()):o==="xid"?s=s.check(W.xid()):o==="ksuid"&&(s=s.check(W.ksuid()))}typeof e.minLength=="number"&&(s=s.min(e.minLength)),typeof e.maxLength=="number"&&(s=s.max(e.maxLength)),e.pattern&&(s=s.regex(new RegExp(e.pattern))),n=s;break}case"number":case"integer":{let s=r==="integer"?W.number().int():W.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(s=s.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(s=s.max(e.maximum)),typeof e.exclusiveMinimum=="number"?s=s.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(s=s.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?s=s.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(s=s.lt(e.maximum)),typeof e.multipleOf=="number"&&(s=s.multipleOf(e.multipleOf)),n=s;break}case"boolean":{n=W.boolean();break}case"null":{n=W.null();break}case"object":{let s={},o=e.properties||{},i=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?Nt(e.additionalProperties,t):void 0;for(let[p,m]of Object.entries(o)){let f=Nt(m,t);St(s,p,i.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),f=[];for(let h of m){let b=Nt(p[h],t),w=W.string().regex(new RegExp(h));f.push(W.looseRecord(w,b))}let g=[];if(Object.keys(s).length>0&&g.push(W.object(s).passthrough()),g.push(...f),g.length===0)n=W.object({}).passthrough();else if(g.length===1)n=g[0];else{let h=W.intersection(g[0],g[1]);for(let b=2;b<g.length;b++)h=W.intersection(h,g[b]);n=h}if(e.additionalProperties===!1){let h=Object.keys(s),b=m.map(y=>new RegExp(y)),w=n;n=n.check(y=>{if(!br(y.value))return;let S=[];for(let k of Object.keys(y.value))h.includes(k)||b.some(R=>R.test(k))||S.push(k);S.length&&y.issues.push({code:"unrecognized_keys",keys:S,input:y.value,inst:w})})}}else{let p=W.object(s);e.additionalProperties===!1?n=p.strict():a?n=p.catchall(a):n=p.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||d!==void 0){let p;if(c){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=Nt(m,t)}n=lj(n,{keySchema:p,minProperties:u,maxProperties:d})}break}case"array":{let s=e.prefixItems,o=e.items;if(s&&Array.isArray(s)){let i=typeof e.minItems=="number"?e.minItems:0,a=s.map(p=>Nt(p,t)),c=cA(a,i),u=Array.isArray(o)?void 0:lA(o,t),d=W.tuple(c);n=u?d.rest(u):d,typeof e.minItems=="number"&&(n=n.check(W.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(W.maxLength(e.maxItems)))}else if(Array.isArray(o)){let i=typeof e.minItems=="number"?e.minItems:0,a=o.map(p=>Nt(p,t)),c=cA(a,i),u=lA(e.additionalItems,t),d=W.tuple(c);n=u?d.rest(u):d,typeof e.minItems=="number"&&(n=n.check(W.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(W.maxLength(e.maxItems)))}else if(o!==void 0){let i=Nt(o,t),a=W.array(i);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a}else n=W.array(W.any());(e.uniqueItems===!0||e.contains!==void 0)&&(n=mj(n,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Nt(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Nt(e,t){if(typeof e=="boolean")return e?W.any():W.never();let r=dA(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>Nt(u,t)),c=W.union(a);r=n?W.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>Nt(u,t)),c=W.xor(a);r=n?W.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:W.any();else{let a=n?r:Nt(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=W.intersection(a,Nt(e.allOf[u],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=W.nullable(r)),e.readOnly===!0&&(r=W.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let s={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in e&&(s[a]=e[a]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let a of i)a in e&&(s[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!nu(e.propertyNames)&&(s.propertyNames=e.propertyNames);for(let a of["minProperties","maxProperties"])e[a]!==void 0&&(s[a]=e[a])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!nu(e.contains)&&(s.contains=e.contains);for(let a of["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(s[a]=e[a])}for(let a of Object.keys(e))ij.has(a)||St(s,a,e[a]);return Object.keys(s).length>0&&t.registry.add(r,s),e.description&&(r=r.describe(e.description)),r}function pA(e,t){if(typeof e=="boolean")return e?W.any():W.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=aj(r,t?.defaultTarget),s=r.$defs||r.definitions||{},o={version:n,defs:s,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??_t};return Nt(r,o)}var W,ij,dj,pj,fj,mA=A(()=>{Lc();rt();fp();zp();Xn();W={...Li,...mp,iso:ru},ij=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);dj=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),pj=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);fj=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function su(e,t){let r=typeof t=="function"?t:(i,a)=>{let c=t[i._zod.def.type];return c?c(i,a):i},n=new Map;function s(i){let a=n.get(i);if(a===fA)return new $c({type:"lazy",getter:()=>n.get(i)});if(a!==void 0)return a;n.set(i,fA);let c=o(i),u=r(c,c!==i);return n.set(i,u),u}function o(i){let a=i._zod.def,c=a.type;switch(c){case"object":{let u=a.shape,d=Object.keys(u),p=!1,m={};for(let g of d){let h=s(u[g]);h!==u[g]&&(p=!0),m[g]=h}let f=a.catchall;return a.catchall&&(f=s(a.catchall),f!==a.catchall&&(p=!0)),p?Oe(i,{...a,shape:m,catchall:f}):i}case"array":{let u=s(a.element);return u===a.element?i:Oe(i,{...a,element:u})}case"tuple":{let u=a.items,d=!1,p=[];for(let f of u){let g=s(f);g!==f&&(d=!0),p.push(g)}let m=a.rest;return a.rest&&(m=s(a.rest),m!==a.rest&&(d=!0)),d?Oe(i,{...a,items:p,rest:m}):i}case"record":case"map":{let u=s(a.keyType),d=s(a.valueType);return u===a.keyType&&d===a.valueType?i:Oe(i,{...a,keyType:u,valueType:d})}case"set":{let u=s(a.valueType);return u===a.valueType?i:Oe(i,{...a,valueType:u})}case"union":{let u=a.options,d=!1,p=[];for(let m of u){let f=s(m);f!==m&&(d=!0),p.push(f)}return d?Oe(i,{...a,options:p}):i}case"intersection":{let u=s(a.left),d=s(a.right);return u===a.left&&d===a.right?i:Oe(i,{...a,left:u,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=s(a.innerType);return u===a.innerType?i:Oe(i,{...a,innerType:u})}case"pipe":{let u=s(a.in),d=s(a.out);return u===a.in&&d===a.out?i:Oe(i,{...a,in:u,out:d})}case"function":{let u=s(a.input),d=s(a.output);return u===a.input&&d===a.output?i:Oe(i,{...a,input:u,output:d})}case"lazy":{let u=a.getter,{_cachedInner:d,...p}=a;return Oe(i,{...p,getter:()=>s(u())})}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":return i;default:return i}}return s(e)}var fA,hS=A(()=>{ui();rt();fA=Symbol("z.visit/resolving")});function gA(e){return su(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:Di(r.options)}})}var hA=A(()=>{hS();Xn()});function gj(e,t){if(!t?.length)return e;let r=e._zod.def;return Oe(e,Cr(r,{checks:[...r.checks??[],...t]}),{parent:!0})}function yA(e){return gj(e.out,e.checks)}function hj(e){return e.in._zod.traits.has("$ZodTransform")?yA(e):e.in}function bA(e){return su(e,{pipe:t=>hj(t._zod.def),default:(t,r)=>r?Hs(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function wA(e){return su(e,{pipe:t=>yA(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var RA=A(()=>{rt();hS();Xn()});var yS={};re(yS,{bigint:()=>Rj,boolean:()=>wj,date:()=>Sj,number:()=>bj,string:()=>yj});function yj(e){return Mb($i,e)}function bj(e){return zb(Oi,e)}function wj(e){return Kb(Ii,e)}function Rj(e){return Yb(xi,e)}function Sj(e){return cw(Zc,e)}var SA=A(()=>{ar();Xn()});var l={};re(l,{$brand:()=>Jg,$input:()=>Ab,$output:()=>Eb,INVALID:()=>Mt,NEVER:()=>Kg,TimePrecision:()=>Ub,ZodAny:()=>TR,ZodArray:()=>xR,ZodBase64:()=>Ip,ZodBase64URL:()=>xp,ZodBigInt:()=>xi,ZodBigIntFormat:()=>Mp,ZodBoolean:()=>Ii,ZodCIDRv4:()=>$p,ZodCIDRv6:()=>Op,ZodCUID:()=>vp,ZodCUID2:()=>kp,ZodCatch:()=>eS,ZodCodec:()=>eu,ZodCompileAsyncError:()=>Pr,ZodCompileUnsupportedError:()=>Se,ZodCreditCard:()=>SR,ZodCustom:()=>tu,ZodCustomStringFormat:()=>Vs,ZodDate:()=>Zc,ZodDefault:()=>ZR,ZodDiscriminatedUnion:()=>LR,ZodE164:()=>Dp,ZodEmail:()=>wp,ZodEmoji:()=>Sp,ZodEnum:()=>Ti,ZodError:()=>JU,ZodExactOptional:()=>Up,ZodFile:()=>HR,ZodFirstPartyTypeKind:()=>fS,ZodFunction:()=>lS,ZodGUID:()=>Rp,ZodIBAN:()=>_R,ZodIPv4:()=>Ap,ZodIPv6:()=>Tp,ZodISODate:()=>Jn,ZodISODateTime:()=>Kn,ZodISODuration:()=>Qn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>mS,ZodIntersection:()=>MR,ZodIssueCode:()=>XU,ZodJWT:()=>Lp,ZodKSUID:()=>Ep,ZodLazy:()=>aS,ZodLiteral:()=>BR,ZodMAC:()=>RR,ZodMap:()=>jR,ZodNaN:()=>rS,ZodNanoID:()=>_p,ZodNever:()=>OR,ZodNonOptional:()=>jp,ZodNull:()=>ER,ZodNullable:()=>qR,ZodNumber:()=>Oi,ZodNumberFormat:()=>qs,ZodObject:()=>Jc,ZodOptional:()=>Qc,ZodPipe:()=>Xc,ZodPrefault:()=>JR,ZodPreprocess:()=>nS,ZodPromise:()=>uS,ZodReadonly:()=>sS,ZodRealError:()=>Jt,ZodRecord:()=>Ai,ZodSet:()=>zR,ZodString:()=>$i,ZodStringFormat:()=>Le,ZodSuccess:()=>XR,ZodSymbol:()=>CR,ZodTemplateLiteral:()=>iS,ZodTransform:()=>WR,ZodTuple:()=>NR,ZodType:()=>ge,ZodULID:()=>Cp,ZodURL:()=>qc,ZodUUID:()=>Br,ZodUndefined:()=>PR,ZodUnion:()=>Yc,ZodUnknown:()=>$R,ZodVoid:()=>IR,ZodXID:()=>Pp,ZodXor:()=>DR,_ZodString:()=>bp,_default:()=>KR,_function:()=>QE,any:()=>TE,array:()=>Kc,base64:()=>uE,base64url:()=>lE,bigint:()=>kE,boolean:()=>kR,catch:()=>tS,check:()=>XE,cidrv4:()=>aE,cidrv6:()=>cE,clone:()=>Oe,codec:()=>ZE,coerce:()=>yS,compile:()=>Ib,config:()=>Ye,core:()=>fn,creditCard:()=>pE,cuid:()=>XP,cuid2:()=>eE,currencyCode:()=>bE,custom:()=>eA,date:()=>OE,decode:()=>pR,decodeAsync:()=>fR,deepPartial:()=>gA,describe:()=>tA,discriminatedUnion:()=>FE,e164:()=>dE,email:()=>BP,emoji:()=>YP,encode:()=>dR,encodeAsync:()=>mR,endsWith:()=>yi,enum:()=>Np,exactOptional:()=>VR,file:()=>HE,flattenError:()=>fc,float32:()=>RE,float64:()=>SE,formatError:()=>gc,fromJSONSchema:()=>pA,function:()=>QE,getDiscriminatedOption:()=>Qy,getErrorMap:()=>tj,globalRegistry:()=>_t,gt:()=>jr,gte:()=>ir,guid:()=>HP,hash:()=>wE,hex:()=>yE,hostname:()=>hE,httpUrl:()=>JP,iban:()=>mE,includes:()=>gi,input:()=>bA,instanceof:()=>nA,int:()=>hp,int32:()=>_E,int64:()=>CE,intersection:()=>FR,invertCodec:()=>KE,ipv4:()=>sE,ipv6:()=>iE,iso:()=>ru,json:()=>oA,jwt:()=>fE,keyof:()=>IE,ksuid:()=>nE,lazy:()=>cS,length:()=>js,literal:()=>BE,locales:()=>Dc,looseObject:()=>LE,looseRecord:()=>GE,lowercase:()=>mi,lt:()=>Ur,lte:()=>or,mac:()=>oE,map:()=>UE,maxLength:()=>Us,maxSize:()=>Wn,memoizer:()=>xc,meta:()=>rA,mime:()=>wi,minLength:()=>mn,minSize:()=>zr,multipleOf:()=>Hn,nan:()=>qE,nanoid:()=>QP,nativeEnum:()=>zE,negative:()=>sp,never:()=>Fp,nonnegative:()=>ip,nonoptional:()=>QR,nonpositive:()=>op,normalize:()=>Ri,null:()=>AR,nullable:()=>Vc,nullish:()=>WE,number:()=>vR,object:()=>xE,optional:()=>Hs,output:()=>wA,overwrite:()=>Er,parse:()=>aR,parseAsync:()=>cR,partialRecord:()=>NE,pipe:()=>yp,positive:()=>np,prefault:()=>YR,preprocess:()=>iA,prettifyError:()=>th,promise:()=>YE,properties:()=>bi,property:()=>ap,readonly:()=>oS,record:()=>UR,refine:()=>dS,regex:()=>pi,regexes:()=>Rr,registry:()=>Id,safeDecode:()=>hR,safeDecodeAsync:()=>bR,safeEncode:()=>gR,safeEncodeAsync:()=>yR,safeParse:()=>uR,safeParseAsync:()=>lR,set:()=>jE,setErrorMap:()=>ej,size:()=>Gs,slugify:()=>ki,startsWith:()=>hi,strictObject:()=>DE,string:()=>Wc,stringFormat:()=>gE,stringbool:()=>sA,success:()=>VE,superRefine:()=>pS,symbol:()=>EE,templateLiteral:()=>JE,toJSONSchema:()=>dp,toLowerCase:()=>_i,toUpperCase:()=>vi,toZod:()=>sc,transform:()=>Gp,treeifyError:()=>eh,trim:()=>Si,tuple:()=>GR,uint32:()=>vE,uint64:()=>PE,ulid:()=>tE,undefined:()=>AE,union:()=>Di,unknown:()=>Bs,uppercase:()=>fi,url:()=>KP,util:()=>V,uuid:()=>WP,uuidv4:()=>VP,uuidv6:()=>qP,uuidv7:()=>ZP,validate:()=>hc,validateAsync:()=>yc,void:()=>$E,withParser:()=>xd,xid:()=>rE,xor:()=>ME});var bS=A(()=>{ar();Xn();fp();iR();wR();aA();ar();Hc();mA();hA();RA();Pb();zp();zp();SA()});var ou=A(()=>{bS();bS()});function kA({author:e,comments:t}){let r=t.filter(n=>!n.isBot&&n.author===e).map(n=>n.body);return r.some(n=>Cj.some(s=>s.test(n)))?"superseded":r.some(n=>Pj.test(n))?"no-traction":t.some(n=>!n.isBot&&n.author!==e)?"after-feedback":"no-response"}function CA({author:e,closer:t,closerIsBot:r,comments:n}){let s=n.filter(o=>!o.isBot&&o.author!==e).map(o=>o.body);return s.some(o=>_j.test(o))?"ai-policy":s.some(o=>vj.test(o))?"superseded":r||s.some(o=>kj.test(o))?"stale":t?t===e?"self-closed":"rejected":"unknown"}var _A,vA,_j,vj,kj,Cj,Pj,wS=A(()=>{"use strict";_A=["ai-policy","superseded","stale","self-closed","rejected","unknown"],vA=["superseded","no-traction","after-feedback","no-response"],_j=/\b(?:AI|LLM)[- ](?:generated|written|authored|slop|polic(?:y|ies))|(?:generated|written) (?:by|with) (?:an? )?(?:AI|LLM|ChatGPT|Copilot)\b|vibe[- ]?cod|machine[- ]generated/i,vj=/clos(?:e|ing) (?:this )?as (?:a )?duplicate|duplicate of #\d+|superseded by|already (?:been )?(?:fixed|merged|addressed|resolved|implemented)|fixed (?:in|by|via) #\d+|in favou?r of #\d+/i,kj=/marked as stale|clos(?:e|ing) (?:this )?(?:as|due to) (?:stale|inactiv)|no activity (?:for|in)/i,Cj=[/already (?:been )?(?:fixed|merged|addressed|resolved|implemented|landed|applied|several)/i,/cover(?:s|ed) (?:this|everything|the same)|same (?:one-line )?fix|(?:landed|fixed|ships?) the same/i,/has (?:landed|shipped)|is in and|(?:fixed|addressed|resolved|landed|applied) (?:upstream|elsewhere)/i,/upstream (?:upgrade|commit|fix)|supersed|in favou?r of|replaced by|duplicate/i,/no longer (?:needed|relevant|reproduc|applies)/i],Pj=/traction|(?:been )?quiet|unmaintained|actively (?:reviewing|maintained)|not maintained|no (?:response|activity)|keep the queue tidy|sitting in (?:your|the) queue|stale/i});function Mi(e){return l.custom(t=>typeof t=="string")}function Hj(e){let t=e?.openPRs;return!Array.isArray(t)||t.length===0?e:{...e,needsAddressingPRs:t.filter(r=>r?.status==="needs_addressing"),waitingOnMaintainerPRs:t.filter(r=>r?.status==="waiting_on_maintainer")}}function TA(e,t){let r=e!==null&&typeof e=="object"?e.workClaims:void 0;return Array.isArray(r)?Math.max(0,r.length-t.workClaims.length):0}function Hp(e){if(!e||typeof e!="object")return[];let t=new Set(Object.keys(Gt.shape));return Object.keys(e).filter(r=>!t.has(r))}var Ej,SS,_S,vS,kS,Aj,Tj,EA,AA,$j,Oj,Ij,xj,Dj,Lj,Mj,Fj,PA,Nj,Bp,Gj,Uj,jj,zj,Bj,RS,Wj,Vj,qj,Zj,Kj,CS,PS,Zs,Jj,Gt,Wp,gn=A(()=>{"use strict";ou();wS();Ej=l.enum(["candidate","claimed","in_progress","pr_submitted"]),SS=l.enum(["needs_addressing","waiting_on_maintainer"]),_S=l.enum(["nonprofit","devtools","infrastructure","web-frameworks","data-ml","education"]),vS=l.enum(["beginner","intermediate","advanced"]),kS=l.enum(["inline","sourcetree","vscode","custom"]),Aj=l.object({hasActiveMaintainers:l.boolean(),isResponsive:l.boolean(),hasHostileComments:l.boolean()}),Tj=l.object({repo:l.string(),score:l.number(),mergedPRCount:l.number(),closedWithoutMergeCount:l.number(),avgResponseDays:l.number().nullable(),lastMergedAt:l.string().optional(),lastEvaluatedAt:l.string(),signals:Aj,stargazersCount:l.number().optional(),language:l.string().nullable().optional()}).passthrough(),EA=l.object({issueUrl:l.string(),grade:l.number(),recommendation:l.string(),stargazersCount:l.number().optional(),source:Mi(["vet","vet-list","list"]),capturedAt:l.string().optional(),labels:l.array(l.string()).optional(),issueAuthorAssociation:Mi(["OWNER","MEMBER","COLLABORATOR","CONTRIBUTOR","FIRST_TIMER","FIRST_TIME_CONTRIBUTOR","MANNEQUIN","NONE"]).optional(),issueAuthorIsBot:l.boolean().optional(),competingPRs:l.number().optional(),mentioningPRs:l.number().optional(),firstInRepo:l.boolean().optional(),commentCount:l.number().optional()}).passthrough(),AA={issueUrl:l.string().optional(),pick:EA.optional(),lastReviewDecision:l.string().optional(),lastCiStatus:l.string().optional(),backfilledAt:l.string().optional(),responseRule:l.number().int().optional()},$j=l.object({url:l.string(),title:l.string(),mergedAt:l.string(),openedAt:l.string().optional(),firstMaintainerResponseAt:l.string().optional(),commentsFetchedAt:l.string().datetime().optional(),learningsExtractedAt:l.string().datetime().optional(),...AA}).passthrough(),Oj=l.object({url:l.string(),title:l.string(),closedAt:l.string(),openedAt:l.string().optional(),firstMaintainerResponseAt:l.string().optional(),commentsFetchedAt:l.string().datetime().optional(),learningsExtractedAt:l.string().datetime().optional(),...AA,closeReason:Mi(_A).optional(),selfCloseReason:Mi(vA).optional()}).passthrough(),Ij=l.object({url:l.string(),repo:l.string(),analyzedAt:l.string()}),xj=l.object({tier:l.enum(["light_check_in","direct_check_in","final_check_in"]),timestamp:l.string().datetime(),draftPath:l.string().optional()}),Dj=l.object({workflowName:l.enum(["draft-first","work-through-issues","pre-commit-review"]),currentStep:l.string(),branchName:l.string().optional(),issueContext:l.object({title:l.string(),url:l.string()}).optional(),completedSteps:l.array(l.string()).default([]),stepData:l.record(l.string(),l.unknown()).default({}),lastUpdatedAt:l.string().datetime()}),Lj=l.object({branchNamingConvention:l.string().optional(),commitMessageFormat:l.string().optional(),prTitleFormat:l.string().optional(),requiredChecks:l.array(l.string()).optional(),testFramework:l.string().optional(),testCoverageRequired:l.boolean().optional(),testFileNaming:l.string().optional(),linter:l.string().optional(),formatter:l.string().optional(),styleGuideUrl:l.string().optional(),issueClaimProcess:l.string().optional(),reviewProcess:l.string().optional(),claRequired:l.boolean().optional(),rawContent:l.string().optional()}),Mj=l.object({passedAllChecks:l.boolean(),checks:l.object({noExistingPR:l.boolean(),notClaimed:l.boolean(),projectActive:l.boolean(),clearRequirements:l.boolean(),contributionGuidelinesFound:l.boolean()}),contributionGuidelines:Lj.optional(),notes:l.array(l.string())}),Fj=l.object({id:l.number(),url:l.string(),repo:l.string(),number:l.number(),title:l.string(),status:Ej,labels:l.array(l.string()),createdAt:l.string(),updatedAt:l.string(),vetted:l.boolean(),vettingResult:Mj.optional()}),PA=l.object({number:l.number(),url:l.string(),title:l.string(),repo:l.string(),daysSinceActivity:l.number(),status:SS}),Nj=l.object({status:SS,setAt:l.string(),lastActivityAt:l.string()}),Bp=l.object({setupComplete:l.boolean().default(!1),setupCompletedAt:l.string().optional(),persistence:l.enum(["local","gist"]).default("local"),maxActivePRs:l.number().default(10),maxOpenPRsPerRepo:l.number().int().min(0).default(0),maxOpenPRsColdRepo:l.number().int().min(0).default(1),maxConcurrentImplementations:l.number().int().min(0).default(2),dormantThresholdDays:l.number().default(30),approachingDormantDays:l.number().default(25),maxIssueAgeDays:l.number().default(90),skipBroadWhenSufficientResults:l.number().min(0).default(8),languages:l.array(l.string()).default(["typescript","javascript"]),labels:l.array(l.string()).default(["good first issue","help wanted"]),scope:l.array(vS).optional(),excludeRepos:l.array(l.string()).default([]),excludeOrgs:l.array(l.string()).optional(),untrackedOrgs:l.array(l.string()).default([]),avoidRepos:l.array(l.string()).default([]),boostIssueTypes:l.array(l.string()).default([]),trustedProjects:l.array(l.string()).default([]),githubUsername:l.string().default(""),minRepoScoreThreshold:l.number().default(4),starredRepos:l.array(l.string()).default([]),starredReposLastFetched:l.string().optional(),squashByDefault:l.union([l.boolean(),l.literal("ask")]).default(!0),localRepoScanPaths:l.array(l.string()).optional(),minStars:l.number().default(50),includeDocIssues:l.boolean().default(!0),aiPolicyBlocklist:l.array(l.string()).default(["matplotlib/matplotlib"]),shelvedPRUrls:l.array(l.string()).default([]),dismissedIssues:l.record(l.string(),l.string()).default({}),dismissedPRHeads:l.record(l.string(),l.string()).default({}),statusOverrides:l.record(l.string(),Nj).optional(),issueListPath:l.string().optional(),skippedIssuesPath:l.string().optional(),projectCategories:l.array(_S).default([]),preferredOrgs:l.array(l.string()).default([]),diffTool:kS.default("inline"),diffToolCustomCommand:l.string().optional(),autoExtractLearnings:l.boolean().default(!0),autoFormatBeforePush:l.boolean().default(!1),trustOwnRepoWrites:l.boolean().default(!1),healthCheckFreshnessMinutes:l.number().int().positive().default(30),reviewMaxPasses:l.number().int().positive().optional(),slmTriageModel:l.string().default(""),slmTriageHost:l.string().default("")}).passthrough().transform(({snoozedPRs:e,...t})=>t),Gj=l.object({repos:l.record(l.string(),l.object({path:l.string(),exists:l.boolean(),currentBranch:l.string().nullable()})),scanPaths:l.array(l.string()),cachedAt:l.string()}),Uj=l.object({url:l.string(),repo:l.string(),number:l.number(),title:l.string(),closedAt:l.string(),closedBy:l.string().optional(),openedAt:l.string().optional(),issueUrl:l.string().optional()}),jj=l.object({url:l.string(),repo:l.string(),number:l.number(),title:l.string(),mergedAt:l.string(),openedAt:l.string().optional(),issueUrl:l.string().optional()}),zj=l.object({totalActivePRs:l.number(),totalNeedingAttention:l.number(),totalMergedAllTime:l.number(),mergeRate:l.number()}),Bj=l.object({url:l.string(),repo:l.string(),number:l.number(),status:SS}).passthrough(),RS=l.array(Bj);Wj=l.object({generatedAt:l.string(),openPRs:RS,needsAddressingPRs:RS,waitingOnMaintainerPRs:RS,recentlyClosedPRs:l.array(Uj),recentlyMergedPRs:l.array(jj),shelvedPRs:l.array(PA),autoUnshelvedPRs:l.array(PA),summary:zj}),Vj=l.preprocess(Hj,Wj),qj=l.object({url:l.string(),lastSeenAt:l.string()}),Zj=l.object({url:l.string(),branch:l.string(),worktree:l.string().optional(),note:l.string().optional(),recordedAt:l.string(),pushedRef:l.string().optional(),pushedAt:l.string().optional(),compareUrl:l.string().optional(),pushProblem:l.string().optional()}).passthrough(),Kj=l.object({url:l.string(),attemptedAt:l.string(),outcome:l.enum(["prepared","blocked"]),note:l.string().optional()}).passthrough(),CS=l.object({runAt:l.string(),reportPath:l.string(),prepareCount:l.number().int().nonnegative(),judgmentCount:l.number().int().nonnegative(),prepared:l.array(Zj).default([]),implementUrl:l.string().optional(),implementAttempts:l.array(Kj).optional()}).passthrough(),PS=l.object({languageOffset:l.number().int().nonnegative().default(0),phase0Offset:l.number().int().nonnegative().default(0),starredOffset:l.number().int().nonnegative().default(0),maintainedOffset:l.number().int().nonnegative().default(0),strategyOffset:l.number().int().nonnegative().default(0),lastRotatedAt:l.string().optional()}).passthrough(),Zs=l.object({kind:Mi(["implementation","pr"]),url:l.string(),session:l.string(),startedAt:l.string(),expiresAt:l.string(),status:Mi(["running","finished"]),branch:l.string().optional(),worktree:l.string().optional(),host:l.string().optional(),machineId:l.string().optional(),runId:l.string().optional(),finishedAt:l.string().optional()}).loose(),Jj=l.array(l.unknown()).default([]).transform(e=>e.flatMap(t=>{let r=Zs.safeParse(t);return r.success?[r.data]:[]}));Gt=l.object({version:l.literal(4),gistId:l.string().optional(),repoScores:l.record(l.string(),Tj).default({}),config:Bp.default(()=>Bp.parse({})),lastRunAt:l.string().default(()=>new Date().toISOString()),lastDigestAt:l.string().optional(),lastStrategyAt:l.string().optional(),lastDigest:Vj.optional(),monthlyMergedCounts:l.record(l.string(),l.number()).optional(),monthlyClosedCounts:l.record(l.string(),l.number()).optional(),monthlyOpenedCounts:l.record(l.string(),l.number()).optional(),localRepoCache:Gj.optional(),mergedPRs:l.array($j).optional(),closedPRs:l.array(Oj).optional(),analyzedIssueConversations:l.array(Ij).optional(),activeIssues:l.array(Fj).default([]),prFollowUpHistory:l.record(l.string(),l.array(xj)).optional(),workflowState:Dj.optional(),searchSeen:l.array(qj).default([]),pickSnapshots:l.array(EA).default([]),lastOvernight:CS.optional(),searchRotation:PS.optional(),workClaims:Jj}).passthrough();Wp="was written by a different oss-autopilot release (usually a newer one); this version keeps those fields but cannot use them. If you are not on the latest release, update with `claude plugin update oss-autopilot@oss-autopilot` and restart Claude Code."});function ES(e,t){return Yj.test(e)&&Qj.test(t)}function q(e){if(!e.startsWith("https://github.com/"))return null;let t=e.match(/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/);if(t){let n=t[1],s=t[2];return ES(n,s)?{owner:n,repo:s,number:parseInt(t[3],10),type:"pull"}:null}let r=e.match(/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)/);if(r){let n=r[1],s=r[2];return ES(n,s)?{owner:n,repo:s,number:parseInt(r[3],10),type:"issues"}:null}return null}function We(e){let t=q(e);return t?`${t.owner.toLowerCase()}/${t.repo.toLowerCase()}#${t.number}`:null}function Hr(e){if(!e.startsWith("https://github.com/"))return null;let t=e.match(/github\.com\/([^/]+)\/([^/]+)/);if(!t)return null;let r=t[1],n=t[2];return ES(r,n)?{owner:r,repo:n}:null}function Ks(e){let[t,r]=e.split("/",2);if(!t||!r)throw new Error(`Invalid repo format: expected "owner/repo", got "${e}"`);return{owner:t,repo:r}}function Sr(e,t){return e.toLowerCase()===t.toLowerCase()}function Fi(e,t=[]){let r=e.toLowerCase();return t.some(n=>n.toLowerCase()===r)}var Yj,Qj,nt=A(()=>{"use strict";Yj=/^[\w-]+$/,Qj=/^[\w.-]+$/});function Yt(e){return We(e)??e.trim().toLowerCase()}function AS(e,t=Date.now()){let r=Date.parse(e.expiresAt);return Number.isFinite(r)&&r>t}function cr(e,t=Date.now()){return e.filter(r=>AS(r,t))}function Js(e,t,r=Date.now()){let n=Yt(t);return cr(e,r).find(s=>Yt(s.url)===n)}function qp(e,t,r,n=Date.now()){let s=Js(e,t,n);if(!(s===void 0||s.session===r))return s}function Zp(e,t){let r=new Date(Date.parse(t)+au*36e5),n=Date.parse(e.expiresAt),s=Number.isFinite(n)&&n>r.getTime()?e.expiresAt:r.toISOString();return{...e,status:"finished",finishedAt:t,expiresAt:s}}function Kp(e,t=Date.now()){return cr(e,t).filter(r=>r.kind==="implementation"&&r.status==="finished")}function xA(e,t=Date.now()){return cr(e,t).filter(r=>r.kind==="implementation"&&r.status==="running")}function Ni(e){return IA.default.resolve(e.trim())}function Xj(e,t){return e===void 0||t===void 0||e===t}function $A(e){try{return OA.realpathSync(e)}catch{return e}}function ez(e,t,r){if(!e.worktree)return!1;let n=Ni(e.worktree);return e.machineId!==void 0&&r.machineId!==void 0?e.machineId!==r.machineId?!1:$A(n)===$A(t):Xj(e.host,r.host)&&n===t}function Jp(e,t,r,n=Date.now()){let s=Yt(t.url),o=cr(e,n).filter(a=>a.kind==="implementation"&&Yt(a.url)!==s);if(t.worktree!==void 0){let a=Ni(t.worktree),c=o.filter(u=>ez(u,a,t));if(c.length>0){let u=c[0];return{reason:"worktree",blocking:c,message:`Checkout ${a} already hosts an implementation of ${u.url} (session ${u.session}, ${u.status}). Use a separate worktree, or finish or release that claim first.`}}}let i=o.filter(a=>a.status==="running");if(r>0&&i.length>=r){let a=i.map(c=>`${c.url} (session ${c.session})`).join(", ");return{reason:"cap",blocking:i,message:`Implementation cap reached: ${i.length} of ${r} running (${a}). Collect or release one, or raise it with \`setup --set maxConcurrentImplementations=N\`.`}}return null}function TS(e,t=Date.now()){let r=Date.parse(e.startedAt),n=Number.isFinite(r)?Math.max(0,Math.floor((t-r)/6e4)):0;return n<60?`${n} min`:n<1440?`${Math.floor(n/60)} h`:`${Math.floor(n/1440)} d`}function cu(e,t=Date.now()){return`${e.kind} claimed in session ${e.session} (${TS(e,t)}, ${e.status})`}function Gi(e,t,r=Date.now()){let n=Js(e,t,r);return!n||n.kind!=="implementation"?null:{recommendation:"skip",reasonsToSkip:[`Already being implemented: ${cu(n,r)}`],workClaim:n}}var OA,IA,Vp,iu,au,$S=A(()=>{"use strict";OA=B(require("node:fs"),1),IA=B(require("node:path"),1);nt();Vp={implementation:24,pr:12},iu=168,au=168});function rz(e){let t=e.lastDigest,r=[...t?.openPRs??[],...t?.shelvedPRs??[],...e.activeIssues].map(i=>i.repo),s=[...(e.mergedPRs??[]).map(i=>i.url),...(e.closedPRs??[]).map(i=>i.url),...e.config.shelvedPRUrls??[]].flatMap(i=>{let a=q(i);return a?[`${a.owner}/${a.repo}`]:[]}),o=new Set(r);for(let i of s)o.add(i);return o}function nz(e,t=Date.now()){let r=t-uu*DA,n=e.searchSeen.filter(c=>Date.parse(c.lastSeenAt)>=r),s=t-tz*DA,o=rz(e),i=Object.fromEntries(Object.entries(e.repoScores).filter(([c,u])=>{let d=u.mergedPRCount>0||u.closedWithoutMergeCount>0,p=Date.parse(u.lastEvaluatedAt),m=Number.isNaN(p)||p>=s;return d||o.has(c)||m})),a=e.lastDigest&&{...e.lastDigest,needsAddressingPRs:[],waitingOnMaintainerPRs:[]};return{...e,searchSeen:n,repoScores:i,lastDigest:a}}function Ar(e){return JSON.stringify(nz(e))}var DA,OS,uu,tz,Ui=A(()=>{"use strict";nt();DA=1440*60*1e3,OS=7,uu=OS+1,tz=14});function sz(){try{return Yp.userInfo().homedir}catch{return null}}function Qp(){let e=Yp.homedir(),t=process.env.VITEST?sz():null;if(t!==null&&yt.resolve(e)===yt.resolve(t))throw new Error(`Refusing to use the real home directory (${e}) under vitest`);return yt.join(e,".oss-autopilot")}function ur(){let e=Qp();return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function jt(){return yt.join(ur(),"state.json")}function LA(){return yt.join(process.cwd(),"data","state.json")}function MA(){return yt.join(process.cwd(),"data","backups")}function Ys(){let e=yt.join(ur(),"backups");return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function Xp(){let e=yt.join(ur(),"cache");return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function ji(){let e=yt.join(ur(),"reports");return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function Qs(){return yt.join(ur(),"gist-id")}function FA(){return yt.join(ur(),"machine-id")}function es(){return yt.join(ur(),"state-cache.json")}function em(){return Ut.existsSync(yt.join(Qp(),"state.json"))}function Wr(){return"3.40.0"}var Ut,yt,Yp,Vr=A(()=>{"use strict";Ut=B(require("node:fs"),1),yt=B(require("node:path"),1),Yp=B(require("node:os"),1)});function rm(){tm=!0}function NA(){return tm}function O(e,t,...r){if(!tm)return;let n=new Date().toISOString();console.error(`[${n}] [DEBUG] [${e}] ${t}`,...r)}function GA(e,t,...r){let n=new Date().toISOString();console.error(`[${n}] [INFO] [${e}] ${t}`,...r)}function v(e,t,...r){let n=new Date().toISOString();console.error(`[${n}] [WARN] [${e}] ${t}`,...r)}async function nm(e,t,r){if(!tm)return r();let n=performance.now();try{let s=await r(),o=(performance.now()-n).toFixed(0);return O(e,`${t} completed in ${o}ms`),s}catch(s){let o=(performance.now()-n).toFixed(0);throw O(e,`${t} failed after ${o}ms`),s}}var tm,ce=A(()=>{"use strict";tm=!1});function du(e){if(process.env[sm]!==void 0)throw new Te(`Refusing to ${e} during an unattended run (${sm} is set). Run it yourself in an interactive session.`)}function I(e){return e instanceof Error?e.message:String(e)}function Ue(e){if(e&&typeof e=="object"&&"status"in e){let t=e.status;return typeof t=="number"&&Number.isFinite(t)?t:void 0}}function hn(e){let t=Ue(e);return t===void 0?void 0:`HTTP ${t}`}function Xt(e){let t=hn(e);return t?`${t}: ${I(e)}`:I(e)}function zt(e){let t=Ue(e);return t===429?!0:t===403?I(e).toLowerCase().includes("rate limit"):!1}function UA(e){if(Ue(e)!==422)return!1;let t=e?.response?.data,r=t&&typeof t=="object"?t.errors:void 0;return Array.isArray(r)?r.some(n=>{if(!n||typeof n!="object")return!1;let s=n;return s.resource!=="Search"||s.code!=="invalid"?!1:typeof s.message=="string"?IS.test(s.message):IS.test(I(e))}):IS.test(I(e))}function de(e){let t=Ue(e);if(t===401||t===429)return!0;if(t===403){let r=I(e).toLowerCase();return r.includes("rate limit")||r.includes("abuse detection")}return!1}function im(e){if(!e||typeof e!="object")return!1;let t=Ue(e);if(typeof t=="number"&&t>=500&&t<600)return!0;let r=e.code;if(typeof r=="string"&&(r==="ECONNRESET"||r==="ETIMEDOUT"||r==="ENETUNREACH"||r==="ENOTFOUND"||r==="ECONNREFUSED"||r==="EAI_AGAIN"))return!0;let n=e.name;return typeof n=="string"&&(n==="AbortError"||n==="TimeoutError")}function jA(e){return t=>{if(de(t))throw t;return v(e.module,`Failed to ${e.label}: ${I(t)}`),e.fallback}}function am(e){if(e instanceof Te)return"CONFIGURATION";if(e instanceof j)return"VALIDATION";if(e instanceof Tr||e instanceof Qt)return"CONCURRENCY";let t=Ue(e);if(t===401)return"AUTH_REQUIRED";if(t===403){let n=I(e).toLowerCase();return n.includes("rate limit")||n.includes("abuse detection")?"RATE_LIMITED":"AUTH_REQUIRED"}if(t===404)return"NOT_FOUND";if(t===429)return"RATE_LIMITED";let r=I(e).toLowerCase();return r.includes("enotfound")||r.includes("econnrefused")||r.includes("econnreset")||r.includes("etimedout")||r.includes("fetch failed")?"NETWORK":r.includes("state")&&(r.includes("corrupt")||r.includes("invalid"))?"STATE_CORRUPTED":"UNKNOWN"}var _r,Te,sm,j,zi,lu,Tr,Qt,om,$r,IS,ee=A(()=>{"use strict";ce();_r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="OssAutopilotError"}code},Te=class extends _r{constructor(t){super(t,"CONFIGURATION_ERROR"),this.name="ConfigurationError"}},sm="OSS_AUTOPILOT_UNATTENDED";j=class extends _r{constructor(t){super(t,"VALIDATION_ERROR"),this.name="ValidationError"}},zi=class extends Te{constructor(t){super(t??'Your GitHub token does not have Gist permissions. Run `gh auth refresh -s gist` to add the required scope, or create a token with the "gist" scope.'),this.name="GistPermissionError"}},lu=class extends Te{constructor(r,n,s){let o=s instanceof Error?s.message:String(s),i=n?`
63
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){o(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}a.count>1&&e.reused==="ref"&&o(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function PP(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;PP(n);let s=Object.keys(n);if(s.length!==1||s[0]!=="type")return;let o=n.type;for(let i of Array.isArray(o)?o:[o]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}function CP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function bw(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!EP.has(i))return null;t.push(o)}let r={},n=new Set;for(let o of t){for(let i in o.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let d=u.properties?.[i]??CP(u);d!=null&&(a.some(p=>JSON.stringify(p)===JSON.stringify(d))||a.push(d))}let c=a.length===1?a[0]:bw(a)??{allOf:a};St(r,i,c)}for(let i of o.required??[])n.add(i)}let s={type:"object",properties:r};if(n.size&&(s.required=[...n]),t.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{let o=[];for(let i of t){let a=CP(i);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function HU(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let s of EP)if(s in e)return;let r=t.filter(s=>kP.some(o=>Array.isArray(s[o]))),n=null;if(!r.length)n=bw(t);else{let s=r[0],o=kP.find(c=>Array.isArray(s[c]));if(Object.keys(s).length!==1)return;let i=t.filter(c=>c!==s),a=s[o].map(c=>bw([...i,c]));if(a.some(c=>!c))return;n={[o]:a}}n&&(delete e.allOf,jc(e,n))}function Zn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,d={...u},p=c.ref;if(c.ref=null,p){n(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):jc(u,g),jc(u,d),a._zod.parent===p)for(let b in u)b==="$ref"||b==="allOf"||b in d||delete u[b];if(g.$ref&&f.def)for(let b in u)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(u[b])===JSON.stringify(f.def[b])&&delete u[b]}let m=a._zod.parent;if(m&&m!==p){n(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())PP(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let p=a.get(d);p?p.push(u):a.set(d,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])HU(u)}}let s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(a)}jc(s,r.defId?r.schema:r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&s.id===o&&delete s.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,St(i,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{let a=JSON.parse(JSON.stringify(s));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ci(t,"input",e.processors),output:Ci(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ft(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ft(n.element,r);if(n.type==="set")return Ft(n.valueType,r);if(n.type==="lazy")return Ft(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Ft(n.innerType,r);if(n.type==="intersection")return Ft(n.left,r)||Ft(n.right,r);if(n.type==="record"||n.type==="map")return Ft(n.keyType,r)||Ft(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ft(n.in,r)||Ft(n.out,r);if(n.type==="object"){for(let s in n.shape)if(Ft(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(let s of n.options)if(Ft(s,r))return!0;return!1}if(n.type==="tuple"){for(let s of n.items)if(Ft(s,r))return!0;return!!(n.rest&&Ft(n.rest,r))}return!1}var EP,kP,ww,Ci,zc=A(()=>{Lc();rt();EP=new Set(["type","properties","required","additionalProperties"]),kP=["oneOf","anyOf"];ww=(e,t={})=>r=>{let n=Vn({...r,processors:t});return xe(e,n),qn(n,e),Zn(n,e)},Ci=(e,t,r={})=>n=>{let{libraryOptions:s,target:o}=n??{},i=Vn({...s??{},target:o,io:t,processors:r});return xe(e,i),qn(i,e),Zn(i,e)}});function lt(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let o of n)WU[o._zod.def.check]?.(t,o._zod.def);let s=e._zod.bag;s.minimum!==void 0&&Pi(t,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&Pi(t,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&Ei(t,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&Ei(t,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&IP(t,s.multipleOf),s.format!==void 0&&(t.format??(t.format=s.format),s.format.includes("int")&&(t.isInt=!0)),s.mime&&DP(t,s.mime);for(let o of s.patterns??[])xP(t,o);return t}function Bc(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bc(t.out):t.type==="catch"?Bc(t.innerType):e._zod.optin}function Rw(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let g=e.get(t)?.def;if(!g)return t;let h=Rw(e,g,r);return h===g?t:h}for(let g of["anyOf","oneOf"]){let h=t[g];if(!Array.isArray(h))continue;let b=h.map(w=>Rw(e,w,r));b.some((w,y)=>w!==h[y])&&(t={...t,[g]:b})}let n=Array.isArray(t.type)?t.type:[t.type],s=!n.includes("string")&&n.some(g=>g==="number"||g==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!s&&!o?.some(g=>typeof g=="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:d,format:p,id:m,...f}=t;return f.enum?f.enum=f.enum.map(g=>typeof g=="number"?String(g):g):typeof f.const=="number"&&(f.const=String(f.const)),s&&(f.type="string",o||(f.pattern=(n.includes("number")?pn:wc).source)),f}function ZU(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of Sw.get(e)??[]){let s=e.seen.get(n),o=(s?.def??s?.schema)?.propertyNames;if(!o||o===!0||r.has(o))continue;let i=Rw(t,o,new Set);i!==o&&r.set(o,i)}if(r.size)for(let n of e.seen.values())for(let s of[n.schema,n.def]){let o=s&&r.get(s.propertyNames);o&&(s.propertyNames=o)}}function FP(e,t,r,n,s){let o=!1,i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(ut(t,r,n,s,"BigInt defaults cannot be represented in JSON Schema"),Qw):JSON.parse(i)}function dp(e,t){if("_idmap"in e){let n=e,s=Vn({...t,processors:cp}),o={};for(let c of n._idmap.entries()){let[u,d]=c;xe(d,s)}let i={},a={registry:n,uri:t?.uri,defs:o};s.external=a;for(let c of n._idmap.entries()){let[u,d]=c;qn(s,d),St(i,u,Zn(s,d))}if(Object.keys(o).length>0){let c=s.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:o}}return{schemas:i}}let r=Vn({...t,processors:cp});return xe(e,r),qn(r,e),Zn(r,e)}var Pi,Ei,AP,IP,xP,DP,LP,TP,$P,OP,WU,VU,qU,MP,_w,vw,kw,Cw,Pw,Ew,Aw,Tw,$w,Ow,Iw,xw,Dw,Lw,Mw,Fw,Nw,Gw,Uw,jw,zw,Bw,Hw,Ww,Vw,up,qw,Zw,Sw,Kw,Jw,Yw,Qw,Xw,eR,tR,rR,nR,sR,lp,oR,cp,Hc=A(()=>{xs();ui();zc();rt();Pi=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Ei=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},AP=(e,t)=>{Pi(e,"minimum",t),Ei(e,"maximum",t)},IP=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},xP=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},DP=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},LP=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},TP=(e,t)=>Pi(e,"minimum",t.minimum),$P=(e,t)=>Ei(e,"maximum",t.maximum),OP=e=>(t,r)=>{LP(t,r.format);let[n,s]=e[r.format];Pi(t,"minimum",n),Ei(t,"maximum",s)},WU={greater_than:(e,t)=>Pi(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Ei(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>IP(e,t.value),number_format:OP(cc),bigint_format:OP(uc),min_length:TP,max_length:$P,length_equals:(e,t)=>AP(e,t.length),min_size:TP,max_size:$P,size_equals:(e,t)=>AP(e,t.size),string_format:(e,t)=>{LP(e,t.format),t.pattern&&xP(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>DP(e,t.mime)};VU={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qU=new Map([[fd,Sh],[Pc,_h]]),MP=e=>qU.get(e)??e,_w=(e,t,r,n)=>{let s=r;s.type="string";let{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:d}=lt(e);if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=VU[a]??a,s.format===""&&delete s.format,(a==="time"||d)&&delete s.format),u&&(s.contentEncoding=u),c&&c.size>0){let p=[...c].map(MP);p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},vw=(e,t,r,n)=>{let s=r,{minimum:o,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:d}=lt(e);s.type=d?"integer":"number";let p=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(p?f?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u:typeof o=="number"&&(s.minimum=o),m?f?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof i=="number"&&(s.maximum=i),a){let g=new Set;for(let w of a)Number.isFinite(w)&&w!==0?g.add(Math.abs(w)):ut(e,t,s,n,`A multipleOf divisor of ${w} cannot be represented in JSON Schema`);let[h,...b]=g;h!==void 0&&(s.multipleOf=h),b.length&&(s.allOf=[...s.allOf??[],...b.map(w=>({multipleOf:w}))])}},kw=(e,t,r,n)=>{r.type="boolean"},Cw=(e,t,r,n)=>{ut(e,t,r,n,"BigInt cannot be represented in JSON Schema")},Pw=(e,t,r,n)=>{ut(e,t,r,n,"Symbols cannot be represented in JSON Schema")},Ew=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Aw=(e,t,r,n)=>{ut(e,t,r,n,"Undefined cannot be represented in JSON Schema")},Tw=(e,t,r,n)=>{ut(e,t,r,n,"Void cannot be represented in JSON Schema")},$w=(e,t,r,n)=>{r.not={}},Ow=(e,t,r,n)=>{},Iw=(e,t,r,n)=>{},xw=(e,t,r,n)=>{ut(e,t,r,n,"Date cannot be represented in JSON Schema")},Dw=(e,t,r,n)=>{let s=e._zod.def,o=Yo(s.entries);if(o.length===0){r.not={};return}o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},Lw=(e,t,r,n)=>{let s=e._zod.def;if(s.values.length===0){r.not={};return}let o=[];for(let i of s.values)if(i===void 0){if(ut(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(ut(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){let i=o[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),o.every(i=>typeof i=="boolean")&&(r.type="boolean"),o.every(i=>i===null)&&(r.type="null"),r.enum=o},Mw=(e,t,r,n)=>{ut(e,t,r,n,"NaN cannot be represented in JSON Schema")},Fw=(e,t,r,n)=>{let s=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=o.source},Nw=(e,t,r,n)=>{let s=r;s.type="string",s.format="binary",s.contentEncoding="binary";let{minimum:o,maximum:i,mime:a}=lt(e);o!==void 0&&(s.minLength=o),i!==void 0&&(s.maxLength=i),a&&(a.length===0?s.not={}:a.length===1?s.contentMediaType=a[0]:s.anyOf=a.map(c=>({contentMediaType:c})))},Gw=(e,t,r,n)=>{r.type="boolean"},Uw=(e,t,r,n)=>{ut(e,t,r,n,"Custom types cannot be represented in JSON Schema")},jw=(e,t,r,n)=>{ut(e,t,r,n,"Function types cannot be represented in JSON Schema")},zw=(e,t,r,n)=>{ut(e,t,r,n,"Transforms cannot be represented in JSON Schema")},Bw=(e,t,r,n)=>{ut(e,t,r,n,"Map cannot be represented in JSON Schema")},Hw=(e,t,r,n)=>{ut(e,t,r,n,"Set cannot be represented in JSON Schema")},Ww=(e,t,r,n)=>{let s=r,o=e._zod.def,{minimum:i,maximum:a}=lt(e);typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=xe(o.element,t,{...n,path:[...n.path,"items"]})};Vw=(e,t,r,n)=>{let s=r,o=e._zod.def,i=o.shape;if(Object.getOwnPropertySymbols(i).length&&ut(e,t,s,n,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(let u in i)St(s.properties,u,xe(i[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let d=o.shape[u];(t.io==="input"?Bc(d)===void 0:d._zod.optout===void 0)&&c.push(u)}c.length>0&&(s.required=c),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=xe(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},up=(e,t,r,n)=>{let s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>xe(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},qw=(e,t,r,n)=>{let s=e._zod.def,o=xe(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=xe(s.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)},Zw=(e,t,r,n)=>{let s=r,o=e._zod.def;s.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((h,b)=>xe(h,t,{...n,path:[...n.path,i,b]})),u=o.rest?xe(o.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,d=o.items.length;for(;d>0;){let h=o.items[d-1];if(!(t.io==="input"?Bc(h)!==void 0:h._zod.optout==="optional"))break;d--}let p=o.items.length,m=!o.rest;t.target==="draft-2020-12"?(s.prefixItems=c,m?s.items=!1:u&&(s.items=u),d>0&&(s.minItems=d),m&&(s.maxItems=p)):t.target==="openapi-3.0"?(s.items={anyOf:c},u&&s.items.anyOf.push(u),d>0&&(s.minItems=d),m&&(s.maxItems=p)):(s.items=c,m?s.additionalItems=!1:u&&(s.additionalItems=u),d>0&&(s.minItems=d),m&&(s.maxItems=p));let{minimum:f,maximum:g}=lt(e);typeof f=="number"&&(s.minItems=f),typeof g=="number"&&(s.maxItems=g)};Sw=new WeakMap;Kw=(e,t,r,n)=>{let s=r,o=e._zod.def;s.type="object";let i=o.keyType,a=lt(i).patterns;if(o.mode==="loose"&&a&&a.size>0){let d=xe(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(let p of a)St(s.patternProperties,MP(p).source,d)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){s.propertyNames=xe(o.keyType,t,{...n,path:[...n.path,"propertyNames"]});let d=Sw.get(t);d||(d=[],Sw.set(t,d),t.deferred.push(()=>ZU(t))),d.push(e)}s.additionalProperties=xe(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&Bc(o.valueType)!==void 0;if(c&&!o.partial&&!u){let d=[...c].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d.map(String))}},Jw=(e,t,r,n)=>{let s=e._zod.def,o=xe(s.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Yw=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType},Qw=Symbol();Xw=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType;let i=FP(s.defaultValue,e,t,r,n);i!==Qw&&(r.default=i)},eR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);if(o.ref=s.innerType,t.io!=="input")return;let i=FP(s.defaultValue,e,t,r,n);i!==Qw&&(r._prefault=i)},tR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{ut(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},rR=(e,t,r,n)=>{let s=e._zod.def,o=s.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?s.out:s.in:s.out;xe(i,t,n);let a=t.seen.get(e);a.ref=i},nR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType,r.readOnly=!0},sR=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType},lp=(e,t,r,n)=>{let s=e._zod.def;xe(s.innerType,t,n);let o=t.seen.get(e);o.ref=s.innerType},oR=(e,t,r,n)=>{let s=e._zod.innerType;xe(s,t,n);let o=t.seen.get(e);o.ref=s},cp={string:_w,number:vw,boolean:kw,bigint:Cw,symbol:Pw,null:Ew,undefined:Aw,void:Tw,never:$w,any:Ow,unknown:Iw,date:xw,enum:Dw,literal:Lw,nan:Mw,template_literal:Fw,file:Nw,success:Gw,custom:Uw,function:jw,transform:zw,map:Bw,set:Hw,array:Ww,object:Vw,union:up,intersection:qw,tuple:Zw,record:Kw,nullable:Jw,nonoptional:Yw,default:Xw,prefault:eR,catch:tR,pipe:rR,readonly:nR,promise:sR,optional:lp,lazy:oR}});var pp,NP=A(()=>{Hc();zc();pp=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Vn({processors:cp,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return xe(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,qn(this.ctx,t);let n=Zn(this.ctx,t),{"~standard":s,...o}=n;return o}}});var GP={};var UP=A(()=>{});var fn={};re(fn,{$ZodAny:()=>By,$ZodArray:()=>Ky,$ZodAsyncError:()=>Zt,$ZodBase64:()=>Oy,$ZodBase64URL:()=>Iy,$ZodBigInt:()=>Rd,$ZodBigIntFormat:()=>Gy,$ZodBoolean:()=>Ec,$ZodCIDRv4:()=>Ty,$ZodCIDRv6:()=>$y,$ZodCUID:()=>yy,$ZodCUID2:()=>by,$ZodCatch:()=>fb,$ZodCheck:()=>Fe,$ZodCheckBigIntFormat:()=>Bh,$ZodCheckEndsWith:()=>ty,$ZodCheckGreaterThan:()=>rd,$ZodCheckIncludes:()=>Xh,$ZodCheckLengthEquals:()=>Kh,$ZodCheckLessThan:()=>td,$ZodCheckLowerCase:()=>Yh,$ZodCheckMaxLength:()=>qh,$ZodCheckMaxSize:()=>Hh,$ZodCheckMimeType:()=>sy,$ZodCheckMinLength:()=>Zh,$ZodCheckMinSize:()=>Wh,$ZodCheckMultipleOf:()=>jh,$ZodCheckNumberFormat:()=>zh,$ZodCheckOverwrite:()=>oy,$ZodCheckProperties:()=>ny,$ZodCheckProperty:()=>ry,$ZodCheckRegex:()=>Jh,$ZodCheckSizeEquals:()=>Vh,$ZodCheckStartsWith:()=>ey,$ZodCheckStringFormat:()=>ai,$ZodCheckUpperCase:()=>Qh,$ZodCodec:()=>Tc,$ZodCreditCard:()=>Dy,$ZodCustom:()=>Sb,$ZodCustomStringFormat:()=>Fy,$ZodCyclicError:()=>Ed,$ZodDate:()=>qy,$ZodDefault:()=>lb,$ZodDiscriminatedUnion:()=>Xy,$ZodE164:()=>xy,$ZodEmail:()=>dy,$ZodEmoji:()=>gy,$ZodEncodeError:()=>zn,$ZodEnum:()=>sb,$ZodError:()=>Xg,$ZodExactOptional:()=>cb,$ZodFile:()=>ib,$ZodFunction:()=>wb,$ZodGUID:()=>uy,$ZodIBAN:()=>Ly,$ZodIPv4:()=>Py,$ZodIPv6:()=>Ey,$ZodISODate:()=>vy,$ZodISODateTime:()=>_y,$ZodISODuration:()=>Cy,$ZodISOTime:()=>ky,$ZodIntersection:()=>eb,$ZodJWT:()=>My,$ZodKSUID:()=>Sy,$ZodLazy:()=>$c,$ZodLiteral:()=>ob,$ZodMAC:()=>Ay,$ZodMap:()=>rb,$ZodNaN:()=>gb,$ZodNanoID:()=>hy,$ZodNever:()=>Wy,$ZodNonOptional:()=>pb,$ZodNull:()=>zy,$ZodNullable:()=>ub,$ZodNumber:()=>wd,$ZodNumberFormat:()=>Ny,$ZodObject:()=>oP,$ZodObjectJIT:()=>Jy,$ZodOptional:()=>_d,$ZodPipe:()=>vd,$ZodPrefault:()=>db,$ZodPreprocess:()=>hb,$ZodPromise:()=>Rb,$ZodReadonly:()=>yb,$ZodRealError:()=>Kt,$ZodRecord:()=>tb,$ZodRegistry:()=>Od,$ZodSet:()=>nb,$ZodString:()=>Ls,$ZodStringFormat:()=>Ie,$ZodSuccess:()=>mb,$ZodSymbol:()=>Uy,$ZodTemplateLiteral:()=>bb,$ZodTransform:()=>ab,$ZodTuple:()=>Sd,$ZodType:()=>pe,$ZodULID:()=>wy,$ZodURL:()=>fy,$ZodUUID:()=>ly,$ZodUndefined:()=>jy,$ZodUnion:()=>Ac,$ZodUnknown:()=>Hy,$ZodVoid:()=>Vy,$ZodXID:()=>Ry,$ZodXor:()=>Yy,$brand:()=>Jg,$constructor:()=>$,$input:()=>Ab,$output:()=>Eb,Doc:()=>Ds,INVALID:()=>Mt,JSONSchema:()=>GP,JSONSchemaGenerator:()=>pp,NEVER:()=>Kg,TimePrecision:()=>Ub,URL_BAD_FORMAT:()=>py,URL_UNPARSEABLE:()=>_c,ZodCompileAsyncError:()=>Pr,ZodCompileUnsupportedError:()=>Se,_any:()=>nw,_array:()=>lw,_base64:()=>Xd,_base64url:()=>ep,_bigint:()=>Jb,_boolean:()=>Zb,_catch:()=>NU,_check:()=>SP,_cidrv4:()=>Yd,_cidrv6:()=>Qd,_coercedBigint:()=>Yb,_coercedBoolean:()=>Kb,_coercedDate:()=>cw,_coercedNumber:()=>zb,_coercedString:()=>Mb,_creditCard:()=>Nb,_cuid:()=>Hd,_cuid2:()=>Wd,_custom:()=>pw,_date:()=>aw,_decode:()=>Hl,_decodeAsync:()=>Vl,_default:()=>LU,_discriminatedUnion:()=>vU,_e164:()=>tp,_email:()=>Md,_emoji:()=>zd,_encode:()=>Bl,_encodeAsync:()=>Wl,_endsWith:()=>yi,_enum:()=>TU,_file:()=>dw,_float32:()=>Hb,_float64:()=>Wb,_gt:()=>jr,_gte:()=>ir,_guid:()=>Fd,_iban:()=>Gb,_includes:()=>gi,_int:()=>Bb,_int32:()=>Vb,_int64:()=>Qb,_intersection:()=>kU,_ipv4:()=>Kd,_ipv6:()=>Jd,_isoDate:()=>Nc,_isoDateTime:()=>Fc,_isoDuration:()=>Uc,_isoTime:()=>Gc,_jwt:()=>rp,_ksuid:()=>Zd,_lazy:()=>zU,_length:()=>js,_literal:()=>OU,_lowercase:()=>mi,_lt:()=>Ur,_lte:()=>or,_mac:()=>Fb,_map:()=>EU,_max:()=>or,_maxLength:()=>Us,_maxSize:()=>Wn,_mime:()=>wi,_min:()=>ir,_minLength:()=>mn,_minSize:()=>zr,_multipleOf:()=>Hn,_nan:()=>uw,_nanoid:()=>Bd,_nativeEnum:()=>$U,_negative:()=>sp,_never:()=>ow,_nonnegative:()=>ip,_nonoptional:()=>MU,_nonpositive:()=>op,_normalize:()=>Ri,_null:()=>rw,_nullable:()=>DU,_number:()=>jb,_optional:()=>xU,_overwrite:()=>Er,_parse:()=>ni,_parseAsync:()=>si,_pipe:()=>GU,_positive:()=>np,_promise:()=>BU,_properties:()=>bi,_property:()=>ap,_readonly:()=>UU,_record:()=>PU,_refine:()=>mw,_regex:()=>pi,_safeDecode:()=>Zl,_safeDecodeAsync:()=>Jl,_safeEncode:()=>ql,_safeEncodeAsync:()=>Kl,_safeParse:()=>oi,_safeParseAsync:()=>ii,_set:()=>AU,_size:()=>Gs,_slugify:()=>ki,_startsWith:()=>hi,_string:()=>Lb,_stringFormat:()=>zs,_stringbool:()=>yw,_success:()=>FU,_superRefine:()=>fw,_symbol:()=>ew,_templateLiteral:()=>jU,_toLowerCase:()=>_i,_toUpperCase:()=>vi,_transform:()=>IU,_trim:()=>Si,_tuple:()=>CU,_uint32:()=>qb,_uint64:()=>Xb,_ulid:()=>Vd,_undefined:()=>tw,_union:()=>SU,_unknown:()=>sw,_uppercase:()=>fi,_url:()=>Mc,_uuid:()=>Nd,_uuidv4:()=>Gd,_uuidv6:()=>Ud,_uuidv7:()=>jd,_void:()=>iw,_xid:()=>qd,_xor:()=>_U,base64Charset:()=>fd,base64urlCharset:()=>Pc,canParseURL:()=>my,clone:()=>Oe,compile:()=>Ib,compileFn:()=>Dd,config:()=>Ye,createStandardJSONSchemaMethod:()=>Ci,createToJSONSchemaMethod:()=>ww,decode:()=>AN,decodeAsync:()=>$N,describe:()=>gw,encode:()=>EN,encodeAsync:()=>TN,extractDefs:()=>qn,finalize:()=>Zn,flattenError:()=>fc,formatError:()=>gc,getDiscriminatedOption:()=>Qy,globalConfig:()=>ht,globalRegistry:()=>_t,handleUnrepresentable:()=>ut,initializeContext:()=>Vn,isBackEdge:()=>Td,isRecursiveSchema:()=>Ad,isValidBase64:()=>Cc,isValidBase64URL:()=>gd,isValidCIDRv6:()=>md,isValidCreditCard:()=>hd,isValidIBAN:()=>yd,isValidIPv6:()=>kc,isValidJWT:()=>bd,locales:()=>Dc,memoizer:()=>xc,mergeValues:()=>ci,meta:()=>hw,parse:()=>jl,parseAsync:()=>zl,parseURLObject:()=>rP,prettifyError:()=>th,process:()=>xe,processSchema:()=>xe,regexes:()=>Rr,registry:()=>Id,safeDecode:()=>IN,safeDecodeAsync:()=>DN,safeEncode:()=>ON,safeEncodeAsync:()=>xN,safeParse:()=>_N,safeParseAsync:()=>vN,standardProps:()=>ud,stripTabAndNewline:()=>vc,toDotPath:()=>LC,toJSONSchema:()=>dp,toZod:()=>sc,treeifyError:()=>eh,urlHostnameOk:()=>dd,urlProtocolOk:()=>pd,util:()=>V,validate:()=>hc,validateAsync:()=>yc,validateURL:()=>ld,version:()=>iy,withParser:()=>xd});var ar=A(()=>{jn();nh();rh();ui();kb();nd();ay();rt();rt();xs();Pb();Lc();sd();RP();_P();zc();Hc();NP();UP()});var mp={};re(mp,{endsWith:()=>yi,gt:()=>jr,gte:()=>ir,includes:()=>gi,length:()=>js,lowercase:()=>mi,lt:()=>Ur,lte:()=>or,maxLength:()=>Us,maxSize:()=>Wn,mime:()=>wi,minLength:()=>mn,minSize:()=>zr,multipleOf:()=>Hn,negative:()=>sp,nonnegative:()=>ip,nonpositive:()=>op,normalize:()=>Ri,overwrite:()=>Er,positive:()=>np,properties:()=>bi,property:()=>ap,regex:()=>pi,size:()=>Gs,slugify:()=>ki,startsWith:()=>hi,toLowerCase:()=>_i,toUpperCase:()=>vi,trim:()=>Si,uppercase:()=>fi});var fp=A(()=>{ar()});function gp(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var jP,zP,JU,Jt,iR=A(()=>{ar();ar();rt();jP=new WeakSet([Object.prototype,Error.prototype]);zP=(e,t)=>{Xg.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);jP.has(r)||(jP.add(r),gp(r,"format",n=>s=>gc(n,s)),gp(r,"flatten",n=>s=>fc(n,s)),gp(r,"addIssue",n=>s=>{n.issues.push(s),n.message=JSON.stringify(n.issues,Qo,2)}),gp(r,"addIssues",n=>s=>{n.issues.push(...s),n.message=JSON.stringify(n.issues,Qo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},JU=$("ZodError",zP),Jt=$("ZodError",zP,void 0,{Parent:Error})});var aR,cR,uR,lR,dR,pR,mR,fR,gR,hR,yR,bR,wR=A(()=>{ar();iR();ar();aR=ni(Jt),cR=si(Jt),uR=oi(Jt),lR=ii(Jt),dR=Bl(Jt),pR=Hl(Jt),mR=Wl(Jt),fR=Vl(Jt),gR=ql(Jt),hR=Zl(Jt),yR=Kl(Jt),bR=Jl(Jt)});var Li={};re(Li,{ZodAny:()=>TR,ZodArray:()=>xR,ZodBase64:()=>Ip,ZodBase64URL:()=>xp,ZodBigInt:()=>xi,ZodBigIntFormat:()=>Mp,ZodBoolean:()=>Ii,ZodCIDRv4:()=>$p,ZodCIDRv6:()=>Op,ZodCUID:()=>vp,ZodCUID2:()=>kp,ZodCatch:()=>eS,ZodCodec:()=>eu,ZodCreditCard:()=>SR,ZodCustom:()=>tu,ZodCustomStringFormat:()=>Vs,ZodDate:()=>Zc,ZodDefault:()=>ZR,ZodDiscriminatedUnion:()=>LR,ZodE164:()=>Dp,ZodEmail:()=>wp,ZodEmoji:()=>Sp,ZodEnum:()=>Ti,ZodExactOptional:()=>Up,ZodFile:()=>HR,ZodFunction:()=>lS,ZodGUID:()=>Rp,ZodIBAN:()=>_R,ZodIPv4:()=>Ap,ZodIPv6:()=>Tp,ZodISODate:()=>Jn,ZodISODateTime:()=>Kn,ZodISODuration:()=>Qn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>mS,ZodIntersection:()=>MR,ZodJWT:()=>Lp,ZodKSUID:()=>Ep,ZodLazy:()=>aS,ZodLiteral:()=>BR,ZodMAC:()=>RR,ZodMap:()=>jR,ZodNaN:()=>rS,ZodNanoID:()=>_p,ZodNever:()=>OR,ZodNonOptional:()=>jp,ZodNull:()=>ER,ZodNullable:()=>qR,ZodNumber:()=>Oi,ZodNumberFormat:()=>qs,ZodObject:()=>Jc,ZodOptional:()=>Qc,ZodPipe:()=>Xc,ZodPrefault:()=>JR,ZodPreprocess:()=>nS,ZodPromise:()=>uS,ZodReadonly:()=>sS,ZodRecord:()=>Ai,ZodSet:()=>zR,ZodString:()=>$i,ZodStringFormat:()=>Le,ZodSuccess:()=>XR,ZodSymbol:()=>CR,ZodTemplateLiteral:()=>iS,ZodTransform:()=>WR,ZodTuple:()=>NR,ZodType:()=>ge,ZodULID:()=>Cp,ZodURL:()=>qc,ZodUUID:()=>Br,ZodUndefined:()=>PR,ZodUnion:()=>Yc,ZodUnknown:()=>$R,ZodVoid:()=>IR,ZodXID:()=>Pp,ZodXor:()=>DR,_ZodString:()=>bp,_default:()=>KR,_function:()=>QE,any:()=>TE,array:()=>Kc,base64:()=>uE,base64url:()=>lE,bigint:()=>kE,boolean:()=>kR,catch:()=>tS,check:()=>XE,cidrv4:()=>aE,cidrv6:()=>cE,codec:()=>ZE,creditCard:()=>pE,cuid:()=>XP,cuid2:()=>eE,currencyCode:()=>bE,custom:()=>eA,date:()=>OE,describe:()=>tA,discriminatedUnion:()=>FE,e164:()=>dE,email:()=>BP,emoji:()=>YP,enum:()=>Np,exactOptional:()=>VR,file:()=>HE,float32:()=>RE,float64:()=>SE,function:()=>QE,guid:()=>HP,hash:()=>wE,hex:()=>yE,hostname:()=>hE,httpUrl:()=>JP,iban:()=>mE,instanceof:()=>nA,int:()=>hp,int32:()=>_E,int64:()=>CE,intersection:()=>FR,invertCodec:()=>KE,ipv4:()=>sE,ipv6:()=>iE,json:()=>oA,jwt:()=>fE,keyof:()=>IE,ksuid:()=>nE,lazy:()=>cS,literal:()=>BE,looseObject:()=>LE,looseRecord:()=>GE,mac:()=>oE,map:()=>UE,meta:()=>rA,nan:()=>qE,nanoid:()=>QP,nativeEnum:()=>zE,never:()=>Fp,nonoptional:()=>QR,null:()=>AR,nullable:()=>Vc,nullish:()=>WE,number:()=>vR,object:()=>xE,optional:()=>Hs,partialRecord:()=>NE,pipe:()=>yp,prefault:()=>YR,preprocess:()=>iA,promise:()=>YE,readonly:()=>oS,record:()=>UR,refine:()=>dS,set:()=>jE,strictObject:()=>DE,string:()=>Wc,stringFormat:()=>gE,stringbool:()=>sA,success:()=>VE,superRefine:()=>pS,symbol:()=>EE,templateLiteral:()=>JE,transform:()=>Gp,tuple:()=>GR,uint32:()=>vE,uint64:()=>PE,ulid:()=>tE,undefined:()=>AE,union:()=>Di,unknown:()=>Bs,url:()=>KP,uuid:()=>WP,uuidv4:()=>VP,uuidv6:()=>qP,uuidv7:()=>ZP,void:()=>$E,xid:()=>rE,xor:()=>ME});function QU(){ht.localeError||Ye($d())}function Ws(){ht.memoizer||Ye({memoizer:xc()})}function Wc(e){return Lb($i,e)}function BP(e){return Md(wp,e)}function HP(e){return Fd(Rp,e)}function WP(e){return Nd(Br,e)}function VP(e){return Gd(Br,e)}function qP(e){return Ud(Br,e)}function ZP(e){return jd(Br,e)}function KP(e){return Mc(qc,e)}function JP(e){return Mc(qc,{protocol:bc,hostname:kh,...V.normalizeParams(e)})}function YP(e){return zd(Sp,e)}function QP(e){return Bd(_p,e)}function XP(e){return Hd(vp,e)}function eE(e){return Wd(kp,e)}function tE(e){return Vd(Cp,e)}function rE(e){return qd(Pp,e)}function nE(e){return Zd(Ep,e)}function sE(e){return Kd(Ap,e)}function oE(e){return Fb(RR,e)}function iE(e){return Jd(Tp,e)}function aE(e){return Yd($p,e)}function cE(e){return Qd(Op,e)}function uE(e){return Xd(Ip,e)}function lE(e){return ep(xp,e)}function dE(e){return tp(Dp,e)}function pE(e){return Nb(SR,e)}function mE(e){return Gb(_R,e)}function fE(e){return rp(Lp,e)}function gE(e,t,r={}){return zs(Vs,e,t,r)}function hE(e){return zs(Vs,"hostname",vh,e)}function yE(e){return zs(Vs,"hex",Nh,e)}function bE(e){return zs(Vs,"currency_code",Ph,e)}function wE(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,s=Rr[n];if(!s)throw new Error(`Unrecognized hash format: ${n}`);return zs(Vs,n,s,t)}function vR(e){return jb(Oi,e)}function hp(e){return Bb(qs,e)}function RE(e){return Hb(qs,e)}function SE(e){return Wb(qs,e)}function _E(e){return Vb(qs,e)}function vE(e){return qb(qs,e)}function kR(e){return Zb(Ii,e)}function kE(e){return Jb(xi,e)}function CE(e){return Qb(Mp,e)}function PE(e){return Xb(Mp,e)}function EE(e){return ew(CR,e)}function AE(e){return tw(PR,e)}function AR(e){return rw(ER,e)}function TE(){return nw(TR)}function Bs(){return sw($R)}function Fp(e){return ow(OR,e)}function $E(e){return iw(IR,e)}function OE(e){return aw(Zc,e)}function Kc(e,t){return lw(xR,e,t)}function IE(e){let t=e._zod.def.shape;return Np(Object.keys(t))}function xE(e,t){let r={type:"object",shape:e??{},...V.normalizeParams(t)};return new Jc(r)}function DE(e,t){return new Jc({type:"object",shape:e,catchall:Fp(),...V.normalizeParams(t)})}function LE(e,t){return new Jc({type:"object",shape:e,catchall:Bs(),...V.normalizeParams(t)})}function Di(e,t){return new Yc({type:"union",options:e,...V.normalizeParams(t)})}function ME(e,t){return new DR({type:"union",options:e,inclusive:!1,...V.normalizeParams(t)})}function FE(e,t,r){return new LR({type:"union",options:t,discriminator:e,...V.normalizeParams(r)})}function FR(e,t){return new MR({type:"intersection",left:e,right:t})}function GR(e,t,r){let n=t instanceof pe,s=n?r:t,o=n?t:null;return new NR({type:"tuple",items:e,rest:o,...V.normalizeParams(s)})}function UR(e,t,r){return!t||!t._zod?new Ai({type:"record",keyType:Wc(),valueType:e,...V.normalizeParams(t)}):new Ai({type:"record",keyType:e,valueType:t,...V.normalizeParams(r)})}function NE(e,t,r){return new Ai({type:"record",keyType:e,valueType:t,...V.normalizeParams(r),partial:!0})}function GE(e,t,r){return new Ai({type:"record",keyType:e,valueType:t,mode:"loose",...V.normalizeParams(r)})}function UE(e,t,r){return new jR({type:"map",keyType:e,valueType:t,...V.normalizeParams(r)})}function jE(e,t){return new zR({type:"set",valueType:e,...V.normalizeParams(t)})}function Np(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ti({type:"enum",entries:r,...V.normalizeParams(t)})}function zE(e,t){return new Ti({type:"enum",entries:e,...V.normalizeParams(t)})}function BE(e,t){return new BR({type:"literal",values:Array.isArray(e)?e:[e],...V.normalizeParams(t)})}function HE(e){return dw(HR,e)}function Gp(e){return new WR({type:"transform",transform:e})}function Hs(e){return new Qc({type:"optional",innerType:e})}function VR(e){return new Up({type:"optional",innerType:e})}function Vc(e){return new qR({type:"nullable",innerType:e})}function WE(e){return Hs(Vc(e))}function KR(e,t){return new ZR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V.shallowClone(t)}})}function YR(e,t){return new JR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():V.shallowClone(t)}})}function QR(e,t){return new jp({type:"nonoptional",innerType:e,...V.normalizeParams(t)})}function VE(e){return new XR({type:"success",innerType:e})}function tS(e,t){return new eS({type:"catch",innerType:e,catchValue:typeof t=="function"?t:V.constantCatch(t)})}function qE(e){return uw(rS,e)}function yp(e,t){return new Xc({type:"pipe",in:e,out:t})}function ZE(e,t,r){return new eu({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function KE(e){let t=e._zod.def;return new eu({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function oS(e){return new sS({type:"readonly",innerType:e})}function JE(e,t){return new iS({type:"template_literal",parts:e,...V.normalizeParams(t)})}function cS(e){return new aS({type:"lazy",getter:e})}function YE(e){return new uS({type:"promise",innerType:e})}function QE(e){return new lS({type:"function",input:Array.isArray(e?.input)?GR(e?.input):e?.input??Kc(Bs()),output:e?.output??Bs()})}function XE(e){let t=new Fe({check:"custom"});return t._zod.check=e,t}function eA(e,t){return pw(tu,e??(()=>!0),t)}function dS(e,t={}){return mw(tu,e,t)}function pS(e,t){return fw(e,t)}function nA(e,t={}){let r=new mS({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...V.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function oA(e){let t=cS(()=>Di([Wc(e),vR(),kR(),AR(),Kc(t),UR(Wc(),t)]));return t}function iA(e,t){return new nS({type:"pipe",in:Gp(e),out:t})}var ge,bp,$i,Le,Kn,Jn,Yn,Qn,wp,Rp,Br,qc,Sp,_p,vp,kp,Cp,Pp,Ep,Ap,RR,Tp,$p,Op,Ip,xp,Dp,SR,_R,Lp,Vs,Oi,qs,Ii,xi,Mp,CR,PR,ER,TR,$R,OR,IR,Zc,xR,Jc,Yc,DR,LR,MR,NR,Ai,jR,zR,Ti,BR,HR,WR,Qc,Up,qR,ZR,JR,jp,XR,eS,rS,Xc,eu,nS,sS,iS,aS,uS,lS,tu,tA,rA,mS,sA,Xn=A(()=>{ar();ar();Hc();xs();zc();Cb();fp();wR();ge=$("ZodType",(e,t)=>(QU(),pe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(V.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Oe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dS(e,t))},superRefine(e,t){return this.check(pS(e,t))},overwrite(e){return this.check(Er(e))},optional(){return Hs(this)},exactOptional(){return VR(this)},nullable(){return Vc(this)},nullish(){return Hs(Vc(this))},nonoptional(e){return QR(this,e)},array(){return Kc(this)},or(e){return Di([this,e])},and(e){return FR(this,e)},transform(e){return yp(this,Gp(e))},default(e){return KR(this,e)},prefault(e){return YR(this,e)},catch(e){return tS(this,e)},pipe(e){return yp(this,e)},readonly(){return oS(this)},describe(e){let t=this.clone();return _t.add(t,{description:e}),t},meta(...e){if(e.length===0)return _t.get(this);let t=this.clone();return _t.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return V.hide(this,"~standard",{...ud(this),jsonSchema:{input:Ci(this,"input"),output:Ci(this,"output")}})},set"~standard"(e){V.own(this,"~standard",e)},parse:function e(t,r){return aR(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await cR(this,t,r,{callee:e})},safeParse(e,t){return uR(this,e,t)},async safeParseAsync(e,t){return lR(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){V.own(this,"spa",e)},validate(e,t){return hc(this,e,t)},validateAsync(e,t){return yc(this,e,t)},encode:function e(t,r){return dR(this,t,r,{callee:e})},decode:function e(t,r){return pR(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await mR(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await fR(this,t,r,{callee:e})},safeEncode(e,t){return gR(this,e,t)},safeDecode(e,t){return hR(this,e,t)},async safeEncodeAsync(e,t){return yR(this,e,t)},async safeDecodeAsync(e,t){return bR(this,e,t)},toJSONSchema(e){return ww(this,{})(e)},get description(){return _t.get(this)?.description},get _def(){return this._zod.def}}),bp=$("_ZodString",(e,t)=>{Ls.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_w(e,r,n,s)},V.derived({format:e=>lt(e).format??null,minLength:e=>lt(e).minimum??null,maxLength:e=>lt(e).maximum??null},{regex(...e){return this.check(pi(...e))},includes(...e){return this.check(gi(...e))},startsWith(...e){return this.check(hi(...e))},endsWith(...e){return this.check(yi(...e))},min(...e){return this.check(mn(...e))},max(...e){return this.check(Us(...e))},length(...e){return this.check(js(...e))},nonempty(...e){return this.check(mn(1,...e))},lowercase(e){return this.check(mi(e))},uppercase(e){return this.check(fi(e))},trim(){return this.check(Si())},normalize(...e){return this.check(Ri(...e))},toLowerCase(){return this.check(_i())},toUpperCase(){return this.check(vi())},slugify(){return this.check(ki())}})),$i=$("ZodString",(e,t)=>{Ls.init(e,t),bp.init(e,t)},{email(e){return this.check(Md(wp,e))},url(e){return this.check(Mc(qc,e))},jwt(e){return this.check(rp(Lp,e))},emoji(e){return this.check(zd(Sp,e))},guid(e){return this.check(Fd(Rp,e))},uuid(e){return this.check(Nd(Br,e))},uuidv4(e){return this.check(Gd(Br,e))},uuidv6(e){return this.check(Ud(Br,e))},uuidv7(e){return this.check(jd(Br,e))},nanoid(e){return this.check(Bd(_p,e))},cuid(e){return this.check(Hd(vp,e))},cuid2(e){return this.check(Wd(kp,e))},ulid(e){return this.check(Vd(Cp,e))},base64(e){return this.check(Xd(Ip,e))},base64url(e){return this.check(ep(xp,e))},xid(e){return this.check(qd(Pp,e))},ksuid(e){return this.check(Zd(Ep,e))},ipv4(e){return this.check(Kd(Ap,e))},ipv6(e){return this.check(Jd(Tp,e))},cidrv4(e){return this.check(Yd($p,e))},cidrv6(e){return this.check(Qd(Op,e))},e164(e){return this.check(tp(Dp,e))},datetime(e){return this.check(Fc(Kn,e))},date(e){return this.check(Nc(Jn,e))},time(e){return this.check(Gc(Yn,e))},duration(e){return this.check(Uc(Qn,e))}});Le=$("ZodStringFormat",(e,t)=>{Ie.init(e,t),bp.init(e,t)}),Kn=$("ZodISODateTime",(e,t)=>{_y.init(e,t),Le.init(e,t)}),Jn=$("ZodISODate",(e,t)=>{vy.init(e,t),Le.init(e,t)}),Yn=$("ZodISOTime",(e,t)=>{ky.init(e,t),Le.init(e,t)}),Qn=$("ZodISODuration",(e,t)=>{Cy.init(e,t),Le.init(e,t)}),wp=$("ZodEmail",(e,t)=>{dy.init(e,t),Le.init(e,t)});Rp=$("ZodGUID",(e,t)=>{uy.init(e,t),Le.init(e,t)});Br=$("ZodUUID",(e,t)=>{ly.init(e,t),Le.init(e,t)});qc=$("ZodURL",(e,t)=>{fy.init(e,t),Le.init(e,t)});Sp=$("ZodEmoji",(e,t)=>{gy.init(e,t),Le.init(e,t)});_p=$("ZodNanoID",(e,t)=>{hy.init(e,t),Le.init(e,t)});vp=$("ZodCUID",(e,t)=>{yy.init(e,t),Le.init(e,t)});kp=$("ZodCUID2",(e,t)=>{by.init(e,t),Le.init(e,t)});Cp=$("ZodULID",(e,t)=>{wy.init(e,t),Le.init(e,t)});Pp=$("ZodXID",(e,t)=>{Ry.init(e,t),Le.init(e,t)});Ep=$("ZodKSUID",(e,t)=>{Sy.init(e,t),Le.init(e,t)});Ap=$("ZodIPv4",(e,t)=>{Py.init(e,t),Le.init(e,t)});RR=$("ZodMAC",(e,t)=>{Ay.init(e,t),Le.init(e,t)});Tp=$("ZodIPv6",(e,t)=>{Ey.init(e,t),Le.init(e,t)});$p=$("ZodCIDRv4",(e,t)=>{Ty.init(e,t),Le.init(e,t)});Op=$("ZodCIDRv6",(e,t)=>{$y.init(e,t),Le.init(e,t)});Ip=$("ZodBase64",(e,t)=>{Oy.init(e,t),Le.init(e,t)});xp=$("ZodBase64URL",(e,t)=>{Iy.init(e,t),Le.init(e,t)});Dp=$("ZodE164",(e,t)=>{xy.init(e,t),Le.init(e,t)});SR=$("ZodCreditCard",(e,t)=>{Dy.init(e,t),Le.init(e,t)});_R=$("ZodIBAN",(e,t)=>{Ly.init(e,t),Le.init(e,t)});Lp=$("ZodJWT",(e,t)=>{My.init(e,t),Le.init(e,t)});Vs=$("ZodCustomStringFormat",(e,t)=>{Fy.init(e,t),Le.init(e,t)});Oi=$("ZodNumber",(e,t)=>{wd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vw(e,r,n,s),e.isFinite=!0},V.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=lt(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=lt(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=lt(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>lt(e).format??null},{gt(e,t){return this.check(jr(e,t))},gte(e,t){return this.check(ir(e,t))},min(e,t){return this.check(ir(e,t))},lt(e,t){return this.check(Ur(e,t))},lte(e,t){return this.check(or(e,t))},max(e,t){return this.check(or(e,t))},int(e){return this.check(hp(e))},safe(e){return this.check(hp(e))},positive(e){return this.check(jr(0,e))},nonnegative(e){return this.check(ir(0,e))},negative(e){return this.check(Ur(0,e))},nonpositive(e){return this.check(or(0,e))},multipleOf(e,t){return this.check(Hn(e,t))},step(e,t){return this.check(Hn(e,t))},finite(){return this}}));qs=$("ZodNumberFormat",(e,t)=>{Ny.init(e,t),Oi.init(e,t)});Ii=$("ZodBoolean",(e,t)=>{Ec.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>kw(e,r,n,s)});xi=$("ZodBigInt",(e,t)=>{Rd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Cw(e,r,n,s)},V.derived({minValue:e=>lt(e).minimum??null,maxValue:e=>lt(e).maximum??null,format:e=>lt(e).format??null},{gte(e,t){return this.check(ir(e,t))},min(e,t){return this.check(ir(e,t))},gt(e,t){return this.check(jr(e,t))},lt(e,t){return this.check(Ur(e,t))},lte(e,t){return this.check(or(e,t))},max(e,t){return this.check(or(e,t))},positive(e){return this.check(jr(BigInt(0),e))},negative(e){return this.check(Ur(BigInt(0),e))},nonpositive(e){return this.check(or(BigInt(0),e))},nonnegative(e){return this.check(ir(BigInt(0),e))},multipleOf(e,t){return this.check(Hn(e,t))}}));Mp=$("ZodBigIntFormat",(e,t)=>{Gy.init(e,t),xi.init(e,t)});CR=$("ZodSymbol",(e,t)=>{Uy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Pw(e,r,n,s)});PR=$("ZodUndefined",(e,t)=>{jy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Aw(e,r,n,s)});ER=$("ZodNull",(e,t)=>{zy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ew(e,r,n,s)});TR=$("ZodAny",(e,t)=>{By.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ow(e,r,n,s)});$R=$("ZodUnknown",(e,t)=>{Hy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Iw(e,r,n,s)});OR=$("ZodNever",(e,t)=>{Wy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>$w(e,r,n,s)});IR=$("ZodVoid",(e,t)=>{Vy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Tw(e,r,n,s)});Zc=$("ZodDate",(e,t)=>{qy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>xw(e,r,n,s),e.min=(r,n)=>e.check(ir(r,n)),e.max=(r,n)=>e.check(or(r,n))},V.derived({minDate:e=>{let{minimum:t}=lt(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=lt(e);return t?new Date(t):null}},{}));xR=$("ZodArray",(e,t)=>{Ws(),Ky.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ww(e,r,n,s),e.element=t.element},{min(e,t){return this.check(mn(e,t))},nonempty(e){return this.check(mn(1,e))},max(e,t){return this.check(Us(e,t))},length(e,t){return this.check(js(e,t))},unwrap(){return this.element}});Jc=$("ZodObject",(e,t)=>{Ws(),Jy.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Vw(e,r,n,s),V.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Np(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(V.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(V.mergeDefs(this._zod.def,{catchall:Bs()}))},loose(){return this.clone(V.mergeDefs(this._zod.def,{catchall:Bs()}))},strict(){return this.clone(V.mergeDefs(this._zod.def,{catchall:Fp()}))},strip(){return this.clone(V.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return V.extend(this,e)},safeExtend(e){return V.safeExtend(this,e)},merge(e){return V.merge(this,e)},pick(e){return V.pick(this,e)},omit(e){return V.omit(this,e)},partial(...e){return V.partial(Qc,this,e[0])},exactPartial(...e){return V.partial(Up,this,e[0],"exactPartial")},required(...e){return V.required(jp,this,e[0])}});Yc=$("ZodUnion",(e,t)=>{Ac.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>up(e,r,n,s),e.options=t.options});DR=$("ZodXor",(e,t)=>{Yc.init(e,t),Yy.init(e,t),e._zod.processJSONSchema=(r,n,s)=>up(e,r,n,s),e.options=t.options});LR=$("ZodDiscriminatedUnion",(e,t)=>{Yc.init(e,t),Xy.init(e,t)});MR=$("ZodIntersection",(e,t)=>{eb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>qw(e,r,n,s)});NR=$("ZodTuple",(e,t)=>{Ws(),Sd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Zw(e,r,n,s)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Qc({type:"optional",innerType:t}))})}});Ai=$("ZodRecord",(e,t)=>{Ws(),tb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Kw(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});jR=$("ZodMap",(e,t)=>{Ws(),rb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Bw(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(zr(...r)),e.nonempty=r=>e.check(zr(1,r)),e.max=(...r)=>e.check(Wn(...r)),e.size=(...r)=>e.check(Gs(...r))});zR=$("ZodSet",(e,t)=>{Ws(),nb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Hw(e,r,n,s),e.min=(...r)=>e.check(zr(...r)),e.nonempty=r=>e.check(zr(1,r)),e.max=(...r)=>e.check(Wn(...r)),e.size=(...r)=>e.check(Gs(...r))});Ti=$("ZodEnum",(e,t)=>{sb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,s,o)=>Dw(e,n,s,o),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{let o={};for(let i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Ti({...t,checks:[],...V.normalizeParams(s),entries:o})},e.exclude=(n,s)=>{let o={...t.entries};for(let i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new Ti({...t,checks:[],...V.normalizeParams(s),entries:o})}});BR=$("ZodLiteral",(e,t)=>{ob.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Lw(e,r,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});HR=$("ZodFile",(e,t)=>{ib.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Nw(e,r,n,s),e.min=(r,n)=>e.check(zr(r,n)),e.max=(r,n)=>e.check(Wn(r,n)),e.mime=(r,n)=>e.check(wi(Array.isArray(r)?r:[r],n))});WR=$("ZodTransform",(e,t)=>{Ws(),ab.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>zw(e,r,n,s),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zn(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(V.issue(o,r.value,t));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=e),r.issues.push(V.issue(i))}};let s=t.transform(r.value,r);return s instanceof Promise?s.then(o=>(r.value=o,r)):(r.value=s,r)}});Qc=$("ZodOptional",(e,t)=>{_d.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lp(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});Up=$("ZodExactOptional",(e,t)=>{cb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lp(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});qR=$("ZodNullable",(e,t)=>{ub.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Jw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});ZR=$("ZodDefault",(e,t)=>{lb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Xw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});JR=$("ZodPrefault",(e,t)=>{db.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>eR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});jp=$("ZodNonOptional",(e,t)=>{pb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Yw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});XR=$("ZodSuccess",(e,t)=>{mb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Gw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});eS=$("ZodCatch",(e,t)=>{fb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>tR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});rS=$("ZodNaN",(e,t)=>{gb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Mw(e,r,n,s)});Xc=$("ZodPipe",(e,t)=>{vd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>rR(e,r,n,s),e.in=t.in,e.out=t.out});eu=$("ZodCodec",(e,t)=>{Xc.init(e,t),Tc.init(e,t)});nS=$("ZodPreprocess",(e,t)=>{Xc.init(e,t),hb.init(e,t)}),sS=$("ZodReadonly",(e,t)=>{yb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>nR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});iS=$("ZodTemplateLiteral",(e,t)=>{bb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Fw(e,r,n,s)});aS=$("ZodLazy",(e,t)=>{$c.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>oR(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});uS=$("ZodPromise",(e,t)=>{Rb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});lS=$("ZodFunction",(e,t)=>{wb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>jw(e,r,n,s)});tu=$("ZodCustom",(e,t)=>{Sb.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Uw(e,r,n,s)});tA=gw,rA=hw,mS=$("ZodInstanceOf",(e,t)=>{tu.init(e,t)},{properties(e,t){return this.check(bi(e,t))}});sA=(...e)=>yw({Codec:eu,Boolean:Ii,String:$i},...e)});function ej(e){Ye({customError:e})}function tj(){return Ye().customError}var XU,fS,aA=A(()=>{ar();XU={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};fS||(fS={})});var ru={};re(ru,{ZodISODate:()=>Jn,ZodISODateTime:()=>Kn,ZodISODuration:()=>Qn,ZodISOTime:()=>Yn,date:()=>nj,datetime:()=>rj,duration:()=>oj,time:()=>sj});function rj(e){return Fc(Kn,e)}function nj(e){return Nc(Jn,e)}function sj(e){return Gc(Yn,e)}function oj(e){return Uc(Qn,e)}var zp=A(()=>{ar();Xn();Xn()});function aj(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function cA(e,t){return e.map((r,n)=>n<t?r:r.optional())}function cj(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function uj(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let s=r[1]===void 0?void 0:cj(r[1]);if(!s||!t.defs[s])throw new Error(`Reference not found: ${e}`);return t.defs[s]}throw new Error(`Reference not found: ${e}`)}function lj(e,t){return W.transform(n=>n).check(n=>{let s=n.value;if(typeof s!="object"||s===null||Array.isArray(s))return;let o=Object.getOwnPropertyNames(s);if(t.minProperties!==void 0&&o.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:s,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:s,inst:e,continue:!0}),t.keySchema)for(let i of o){let a=t.keySchema.safeParse(i);a.success||n.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:i,path:[i],continue:!0})}}).pipe(e)}function gS(e,t){if(e===null)return"z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return`${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let i of e){let a=gS(i,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let n=Object.keys(e).sort(),s=[];for(let o of n){let i=gS(e[o],t);if(i===null)return null;s.push(`${o.length}:${o}=${i}`)}return`o${s.length}:{${s.join(",")}}`}finally{t.delete(e)}}function nu(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(nu):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>dj.has(t)?nu(r):!pj.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some(nu))}function uA(e){return e===1?"element":"elements"}function mj(e,t){return W.transform(n=>n).check(n=>{let s=n.value;if(Array.isArray(s)){if(t.uniqueItems===!0){let o=new Map;for(let i=0;i<s.length;i++){let a=gS(s[i],new Set);if(a===null)continue;let c=o.get(a);if(c===void 0){o.set(a,i);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${i} duplicates the one at index ${c}`,input:s,path:[i],continue:!0})}}if(t.containsSchema){let o=t.minContains??1,i=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of s)if(t.containsSchema.safeParse(c).success&&++a>=i)break;a<o&&n.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${uA(o)}; found ${a}`,input:s,continue:!0}),t.maxContains!==void 0&&a>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${uA(t.maxContains)}`,input:s,continue:!0})}}}).pipe(e)}function lA(e,t){if(e!==!1)return e===void 0||e===!0?W.any():Nt(e,t)}function dA(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return W.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let s=e.$ref;if(t.refs.has(s))return t.refs.get(s);if(t.processing.has(s))return W.lazy(()=>{if(!t.refs.has(s))throw new Error(`Circular reference not resolved: ${s}`);return t.refs.get(s)});t.processing.add(s);let o=uj(s,t),i=Nt(o,t);return t.refs.set(s,i),t.processing.delete(s),i}if(e.enum!==void 0){let s=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&s.length===1&&s[0]===null)return W.null();if(s.length===0)return W.never();if(s.length===1)return W.literal(s[0]);if(s.every(i=>typeof i=="string"))return W.enum(s);let o=s.map(i=>W.literal(i));return o.length<2?o[0]:W.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return W.literal(e.const);let r=e.type;if(Array.isArray(r)){let s=r.map(o=>{let i={...e,type:o};return dA(i,t)});return s.length===0?W.never():s.length===1?s[0]:W.union(s)}if(!r)return W.any();let n;switch(r){case"string":{let s=W.string();if(e.format){let o=e.format;o==="email"?s=s.check(W.email()):o==="uri"||o==="uri-reference"?s=s.check(W.url()):o==="uuid"||o==="guid"?s=s.check(W.uuid()):o==="date-time"?s=s.check(W.iso.datetime({offset:!0})):o==="date"?s=s.check(W.iso.date()):o==="time"?s=s.check(W.regex(fj)):o==="duration"?s=s.check(W.iso.duration()):o==="hostname"?s=s.check(W.hostname()):o==="ipv4"?s=s.check(W.ipv4()):o==="ipv6"?s=s.check(W.ipv6()):o==="mac"?s=s.check(W.mac()):o==="cidr"?s=s.check(W.cidrv4()):o==="cidr-v6"?s=s.check(W.cidrv6()):o==="base64"?s=s.check(W.base64()):o==="base64url"?s=s.check(W.base64url()):o==="e164"?s=s.check(W.e164()):o==="credit_card"?s=s.check(W.creditCard()):o==="iban"?s=s.check(W.iban()):o==="jwt"?s=s.check(W.jwt()):o==="emoji"?s=s.check(W.emoji()):o==="nanoid"?s=s.check(W.nanoid()):o==="cuid"?s=s.check(W.cuid()):o==="cuid2"?s=s.check(W.cuid2()):o==="ulid"?s=s.check(W.ulid()):o==="xid"?s=s.check(W.xid()):o==="ksuid"&&(s=s.check(W.ksuid()))}typeof e.minLength=="number"&&(s=s.min(e.minLength)),typeof e.maxLength=="number"&&(s=s.max(e.maxLength)),e.pattern&&(s=s.regex(new RegExp(e.pattern))),n=s;break}case"number":case"integer":{let s=r==="integer"?W.number().int():W.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(s=s.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(s=s.max(e.maximum)),typeof e.exclusiveMinimum=="number"?s=s.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(s=s.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?s=s.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(s=s.lt(e.maximum)),typeof e.multipleOf=="number"&&(s=s.multipleOf(e.multipleOf)),n=s;break}case"boolean":{n=W.boolean();break}case"null":{n=W.null();break}case"object":{let s={},o=e.properties||{},i=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?Nt(e.additionalProperties,t):void 0;for(let[p,m]of Object.entries(o)){let f=Nt(m,t);St(s,p,i.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),f=[];for(let h of m){let b=Nt(p[h],t),w=W.string().regex(new RegExp(h));f.push(W.looseRecord(w,b))}let g=[];if(Object.keys(s).length>0&&g.push(W.object(s).passthrough()),g.push(...f),g.length===0)n=W.object({}).passthrough();else if(g.length===1)n=g[0];else{let h=W.intersection(g[0],g[1]);for(let b=2;b<g.length;b++)h=W.intersection(h,g[b]);n=h}if(e.additionalProperties===!1){let h=Object.keys(s),b=m.map(y=>new RegExp(y)),w=n;n=n.check(y=>{if(!br(y.value))return;let S=[];for(let k of Object.keys(y.value))h.includes(k)||b.some(R=>R.test(k))||S.push(k);S.length&&y.issues.push({code:"unrecognized_keys",keys:S,input:y.value,inst:w})})}}else{let p=W.object(s);e.additionalProperties===!1?n=p.strict():a?n=p.catchall(a):n=p.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||d!==void 0){let p;if(c){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=Nt(m,t)}n=lj(n,{keySchema:p,minProperties:u,maxProperties:d})}break}case"array":{let s=e.prefixItems,o=e.items;if(s&&Array.isArray(s)){let i=typeof e.minItems=="number"?e.minItems:0,a=s.map(p=>Nt(p,t)),c=cA(a,i),u=Array.isArray(o)?void 0:lA(o,t),d=W.tuple(c);n=u?d.rest(u):d,typeof e.minItems=="number"&&(n=n.check(W.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(W.maxLength(e.maxItems)))}else if(Array.isArray(o)){let i=typeof e.minItems=="number"?e.minItems:0,a=o.map(p=>Nt(p,t)),c=cA(a,i),u=lA(e.additionalItems,t),d=W.tuple(c);n=u?d.rest(u):d,typeof e.minItems=="number"&&(n=n.check(W.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(W.maxLength(e.maxItems)))}else if(o!==void 0){let i=Nt(o,t),a=W.array(i);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a}else n=W.array(W.any());(e.uniqueItems===!0||e.contains!==void 0)&&(n=mj(n,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Nt(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Nt(e,t){if(typeof e=="boolean")return e?W.any():W.never();let r=dA(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>Nt(u,t)),c=W.union(a);r=n?W.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>Nt(u,t)),c=W.xor(a);r=n?W.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:W.any();else{let a=n?r:Nt(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=W.intersection(a,Nt(e.allOf[u],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=W.nullable(r)),e.readOnly===!0&&(r=W.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let s={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in e&&(s[a]=e[a]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let a of i)a in e&&(s[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!nu(e.propertyNames)&&(s.propertyNames=e.propertyNames);for(let a of["minProperties","maxProperties"])e[a]!==void 0&&(s[a]=e[a])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!nu(e.contains)&&(s.contains=e.contains);for(let a of["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(s[a]=e[a])}for(let a of Object.keys(e))ij.has(a)||St(s,a,e[a]);return Object.keys(s).length>0&&t.registry.add(r,s),e.description&&(r=r.describe(e.description)),r}function pA(e,t){if(typeof e=="boolean")return e?W.any():W.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=aj(r,t?.defaultTarget),s=r.$defs||r.definitions||{},o={version:n,defs:s,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??_t};return Nt(r,o)}var W,ij,dj,pj,fj,mA=A(()=>{Lc();rt();fp();zp();Xn();W={...Li,...mp,iso:ru},ij=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);dj=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),pj=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);fj=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function su(e,t){let r=typeof t=="function"?t:(i,a)=>{let c=t[i._zod.def.type];return c?c(i,a):i},n=new Map;function s(i){let a=n.get(i);if(a===fA)return new $c({type:"lazy",getter:()=>n.get(i)});if(a!==void 0)return a;n.set(i,fA);let c=o(i),u=r(c,c!==i);return n.set(i,u),u}function o(i){let a=i._zod.def,c=a.type;switch(c){case"object":{let u=a.shape,d=Object.keys(u),p=!1,m={};for(let g of d){let h=s(u[g]);h!==u[g]&&(p=!0),m[g]=h}let f=a.catchall;return a.catchall&&(f=s(a.catchall),f!==a.catchall&&(p=!0)),p?Oe(i,{...a,shape:m,catchall:f}):i}case"array":{let u=s(a.element);return u===a.element?i:Oe(i,{...a,element:u})}case"tuple":{let u=a.items,d=!1,p=[];for(let f of u){let g=s(f);g!==f&&(d=!0),p.push(g)}let m=a.rest;return a.rest&&(m=s(a.rest),m!==a.rest&&(d=!0)),d?Oe(i,{...a,items:p,rest:m}):i}case"record":case"map":{let u=s(a.keyType),d=s(a.valueType);return u===a.keyType&&d===a.valueType?i:Oe(i,{...a,keyType:u,valueType:d})}case"set":{let u=s(a.valueType);return u===a.valueType?i:Oe(i,{...a,valueType:u})}case"union":{let u=a.options,d=!1,p=[];for(let m of u){let f=s(m);f!==m&&(d=!0),p.push(f)}return d?Oe(i,{...a,options:p}):i}case"intersection":{let u=s(a.left),d=s(a.right);return u===a.left&&d===a.right?i:Oe(i,{...a,left:u,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=s(a.innerType);return u===a.innerType?i:Oe(i,{...a,innerType:u})}case"pipe":{let u=s(a.in),d=s(a.out);return u===a.in&&d===a.out?i:Oe(i,{...a,in:u,out:d})}case"function":{let u=s(a.input),d=s(a.output);return u===a.input&&d===a.output?i:Oe(i,{...a,input:u,output:d})}case"lazy":{let u=a.getter,{_cachedInner:d,...p}=a;return Oe(i,{...p,getter:()=>s(u())})}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":return i;default:return i}}return s(e)}var fA,hS=A(()=>{ui();rt();fA=Symbol("z.visit/resolving")});function gA(e){return su(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:Di(r.options)}})}var hA=A(()=>{hS();Xn()});function gj(e,t){if(!t?.length)return e;let r=e._zod.def;return Oe(e,Cr(r,{checks:[...r.checks??[],...t]}),{parent:!0})}function yA(e){return gj(e.out,e.checks)}function hj(e){return e.in._zod.traits.has("$ZodTransform")?yA(e):e.in}function bA(e){return su(e,{pipe:t=>hj(t._zod.def),default:(t,r)=>r?Hs(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function wA(e){return su(e,{pipe:t=>yA(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var RA=A(()=>{rt();hS();Xn()});var yS={};re(yS,{bigint:()=>Rj,boolean:()=>wj,date:()=>Sj,number:()=>bj,string:()=>yj});function yj(e){return Mb($i,e)}function bj(e){return zb(Oi,e)}function wj(e){return Kb(Ii,e)}function Rj(e){return Yb(xi,e)}function Sj(e){return cw(Zc,e)}var SA=A(()=>{ar();Xn()});var l={};re(l,{$brand:()=>Jg,$input:()=>Ab,$output:()=>Eb,INVALID:()=>Mt,NEVER:()=>Kg,TimePrecision:()=>Ub,ZodAny:()=>TR,ZodArray:()=>xR,ZodBase64:()=>Ip,ZodBase64URL:()=>xp,ZodBigInt:()=>xi,ZodBigIntFormat:()=>Mp,ZodBoolean:()=>Ii,ZodCIDRv4:()=>$p,ZodCIDRv6:()=>Op,ZodCUID:()=>vp,ZodCUID2:()=>kp,ZodCatch:()=>eS,ZodCodec:()=>eu,ZodCompileAsyncError:()=>Pr,ZodCompileUnsupportedError:()=>Se,ZodCreditCard:()=>SR,ZodCustom:()=>tu,ZodCustomStringFormat:()=>Vs,ZodDate:()=>Zc,ZodDefault:()=>ZR,ZodDiscriminatedUnion:()=>LR,ZodE164:()=>Dp,ZodEmail:()=>wp,ZodEmoji:()=>Sp,ZodEnum:()=>Ti,ZodError:()=>JU,ZodExactOptional:()=>Up,ZodFile:()=>HR,ZodFirstPartyTypeKind:()=>fS,ZodFunction:()=>lS,ZodGUID:()=>Rp,ZodIBAN:()=>_R,ZodIPv4:()=>Ap,ZodIPv6:()=>Tp,ZodISODate:()=>Jn,ZodISODateTime:()=>Kn,ZodISODuration:()=>Qn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>mS,ZodIntersection:()=>MR,ZodIssueCode:()=>XU,ZodJWT:()=>Lp,ZodKSUID:()=>Ep,ZodLazy:()=>aS,ZodLiteral:()=>BR,ZodMAC:()=>RR,ZodMap:()=>jR,ZodNaN:()=>rS,ZodNanoID:()=>_p,ZodNever:()=>OR,ZodNonOptional:()=>jp,ZodNull:()=>ER,ZodNullable:()=>qR,ZodNumber:()=>Oi,ZodNumberFormat:()=>qs,ZodObject:()=>Jc,ZodOptional:()=>Qc,ZodPipe:()=>Xc,ZodPrefault:()=>JR,ZodPreprocess:()=>nS,ZodPromise:()=>uS,ZodReadonly:()=>sS,ZodRealError:()=>Jt,ZodRecord:()=>Ai,ZodSet:()=>zR,ZodString:()=>$i,ZodStringFormat:()=>Le,ZodSuccess:()=>XR,ZodSymbol:()=>CR,ZodTemplateLiteral:()=>iS,ZodTransform:()=>WR,ZodTuple:()=>NR,ZodType:()=>ge,ZodULID:()=>Cp,ZodURL:()=>qc,ZodUUID:()=>Br,ZodUndefined:()=>PR,ZodUnion:()=>Yc,ZodUnknown:()=>$R,ZodVoid:()=>IR,ZodXID:()=>Pp,ZodXor:()=>DR,_ZodString:()=>bp,_default:()=>KR,_function:()=>QE,any:()=>TE,array:()=>Kc,base64:()=>uE,base64url:()=>lE,bigint:()=>kE,boolean:()=>kR,catch:()=>tS,check:()=>XE,cidrv4:()=>aE,cidrv6:()=>cE,clone:()=>Oe,codec:()=>ZE,coerce:()=>yS,compile:()=>Ib,config:()=>Ye,core:()=>fn,creditCard:()=>pE,cuid:()=>XP,cuid2:()=>eE,currencyCode:()=>bE,custom:()=>eA,date:()=>OE,decode:()=>pR,decodeAsync:()=>fR,deepPartial:()=>gA,describe:()=>tA,discriminatedUnion:()=>FE,e164:()=>dE,email:()=>BP,emoji:()=>YP,encode:()=>dR,encodeAsync:()=>mR,endsWith:()=>yi,enum:()=>Np,exactOptional:()=>VR,file:()=>HE,flattenError:()=>fc,float32:()=>RE,float64:()=>SE,formatError:()=>gc,fromJSONSchema:()=>pA,function:()=>QE,getDiscriminatedOption:()=>Qy,getErrorMap:()=>tj,globalRegistry:()=>_t,gt:()=>jr,gte:()=>ir,guid:()=>HP,hash:()=>wE,hex:()=>yE,hostname:()=>hE,httpUrl:()=>JP,iban:()=>mE,includes:()=>gi,input:()=>bA,instanceof:()=>nA,int:()=>hp,int32:()=>_E,int64:()=>CE,intersection:()=>FR,invertCodec:()=>KE,ipv4:()=>sE,ipv6:()=>iE,iso:()=>ru,json:()=>oA,jwt:()=>fE,keyof:()=>IE,ksuid:()=>nE,lazy:()=>cS,length:()=>js,literal:()=>BE,locales:()=>Dc,looseObject:()=>LE,looseRecord:()=>GE,lowercase:()=>mi,lt:()=>Ur,lte:()=>or,mac:()=>oE,map:()=>UE,maxLength:()=>Us,maxSize:()=>Wn,memoizer:()=>xc,meta:()=>rA,mime:()=>wi,minLength:()=>mn,minSize:()=>zr,multipleOf:()=>Hn,nan:()=>qE,nanoid:()=>QP,nativeEnum:()=>zE,negative:()=>sp,never:()=>Fp,nonnegative:()=>ip,nonoptional:()=>QR,nonpositive:()=>op,normalize:()=>Ri,null:()=>AR,nullable:()=>Vc,nullish:()=>WE,number:()=>vR,object:()=>xE,optional:()=>Hs,output:()=>wA,overwrite:()=>Er,parse:()=>aR,parseAsync:()=>cR,partialRecord:()=>NE,pipe:()=>yp,positive:()=>np,prefault:()=>YR,preprocess:()=>iA,prettifyError:()=>th,promise:()=>YE,properties:()=>bi,property:()=>ap,readonly:()=>oS,record:()=>UR,refine:()=>dS,regex:()=>pi,regexes:()=>Rr,registry:()=>Id,safeDecode:()=>hR,safeDecodeAsync:()=>bR,safeEncode:()=>gR,safeEncodeAsync:()=>yR,safeParse:()=>uR,safeParseAsync:()=>lR,set:()=>jE,setErrorMap:()=>ej,size:()=>Gs,slugify:()=>ki,startsWith:()=>hi,strictObject:()=>DE,string:()=>Wc,stringFormat:()=>gE,stringbool:()=>sA,success:()=>VE,superRefine:()=>pS,symbol:()=>EE,templateLiteral:()=>JE,toJSONSchema:()=>dp,toLowerCase:()=>_i,toUpperCase:()=>vi,toZod:()=>sc,transform:()=>Gp,treeifyError:()=>eh,trim:()=>Si,tuple:()=>GR,uint32:()=>vE,uint64:()=>PE,ulid:()=>tE,undefined:()=>AE,union:()=>Di,unknown:()=>Bs,uppercase:()=>fi,url:()=>KP,util:()=>V,uuid:()=>WP,uuidv4:()=>VP,uuidv6:()=>qP,uuidv7:()=>ZP,validate:()=>hc,validateAsync:()=>yc,void:()=>$E,withParser:()=>xd,xid:()=>rE,xor:()=>ME});var bS=A(()=>{ar();Xn();fp();iR();wR();aA();ar();Hc();mA();hA();RA();Pb();zp();zp();SA()});var ou=A(()=>{bS();bS()});function kA({author:e,comments:t}){let r=t.filter(n=>!n.isBot&&n.author===e).map(n=>n.body);return r.some(n=>Cj.some(s=>s.test(n)))?"superseded":r.some(n=>Pj.test(n))?"no-traction":t.some(n=>!n.isBot&&n.author!==e)?"after-feedback":"no-response"}function CA({author:e,closer:t,closerIsBot:r,comments:n}){let s=n.filter(o=>!o.isBot&&o.author!==e).map(o=>o.body);return s.some(o=>_j.test(o))?"ai-policy":s.some(o=>vj.test(o))?"superseded":r||s.some(o=>kj.test(o))?"stale":t?t===e?"self-closed":"rejected":"unknown"}var _A,vA,_j,vj,kj,Cj,Pj,wS=A(()=>{"use strict";_A=["ai-policy","superseded","stale","self-closed","rejected","unknown"],vA=["superseded","no-traction","after-feedback","no-response"],_j=/\b(?:AI|LLM)[- ](?:generated|written|authored|slop|polic(?:y|ies))|(?:generated|written) (?:by|with) (?:an? )?(?:AI|LLM|ChatGPT|Copilot)\b|vibe[- ]?cod|machine[- ]generated/i,vj=/clos(?:e|ing) (?:this )?as (?:a )?duplicate|duplicate of #\d+|superseded by|already (?:been )?(?:fixed|merged|addressed|resolved|implemented)|fixed (?:in|by|via) #\d+|in favou?r of #\d+/i,kj=/marked as stale|clos(?:e|ing) (?:this )?(?:as|due to) (?:stale|inactiv)|no activity (?:for|in)/i,Cj=[/already (?:been )?(?:fixed|merged|addressed|resolved|implemented|landed|applied|several)/i,/cover(?:s|ed) (?:this|everything|the same)|same (?:one-line )?fix|(?:landed|fixed|ships?) the same/i,/has (?:landed|shipped)|is in and|(?:fixed|addressed|resolved|landed|applied) (?:upstream|elsewhere)/i,/upstream (?:upgrade|commit|fix)|supersed|in favou?r of|replaced by|duplicate/i,/no longer (?:needed|relevant|reproduc|applies)/i],Pj=/traction|(?:been )?quiet|unmaintained|actively (?:reviewing|maintained)|not maintained|no (?:response|activity)|keep the queue tidy|sitting in (?:your|the) queue|stale/i});function Mi(e){return l.custom(t=>typeof t=="string")}function Hj(e){let t=e?.openPRs;return!Array.isArray(t)||t.length===0?e:{...e,needsAddressingPRs:t.filter(r=>r?.status==="needs_addressing"),waitingOnMaintainerPRs:t.filter(r=>r?.status==="waiting_on_maintainer")}}function TA(e,t){let r=e!==null&&typeof e=="object"?e.workClaims:void 0;return Array.isArray(r)?Math.max(0,r.length-t.workClaims.length):0}function Hp(e){if(!e||typeof e!="object")return[];let t=new Set(Object.keys(Gt.shape));return Object.keys(e).filter(r=>!t.has(r))}var Ej,SS,_S,vS,kS,Aj,Tj,EA,AA,$j,Oj,Ij,xj,Dj,Lj,Mj,Fj,PA,Nj,Bp,Gj,Uj,jj,zj,Bj,RS,Wj,Vj,qj,Zj,Kj,CS,PS,Zs,Jj,Gt,Wp,gn=A(()=>{"use strict";ou();wS();Ej=l.enum(["candidate","claimed","in_progress","pr_submitted"]),SS=l.enum(["needs_addressing","waiting_on_maintainer"]),_S=l.enum(["nonprofit","devtools","infrastructure","web-frameworks","data-ml","education"]),vS=l.enum(["beginner","intermediate","advanced"]),kS=l.enum(["inline","sourcetree","vscode","custom"]),Aj=l.object({hasActiveMaintainers:l.boolean(),isResponsive:l.boolean(),hasHostileComments:l.boolean()}),Tj=l.object({repo:l.string(),score:l.number(),mergedPRCount:l.number(),closedWithoutMergeCount:l.number(),avgResponseDays:l.number().nullable(),lastMergedAt:l.string().optional(),lastEvaluatedAt:l.string(),signals:Aj,stargazersCount:l.number().optional(),language:l.string().nullable().optional()}).passthrough(),EA=l.object({issueUrl:l.string(),grade:l.number(),recommendation:l.string(),stargazersCount:l.number().optional(),source:Mi(["vet","vet-list","list"]),capturedAt:l.string().optional(),labels:l.array(l.string()).optional(),issueAuthorAssociation:Mi(["OWNER","MEMBER","COLLABORATOR","CONTRIBUTOR","FIRST_TIMER","FIRST_TIME_CONTRIBUTOR","MANNEQUIN","NONE"]).optional(),issueAuthorIsBot:l.boolean().optional(),competingPRs:l.number().optional(),mentioningPRs:l.number().optional(),firstInRepo:l.boolean().optional(),commentCount:l.number().optional()}).passthrough(),AA={issueUrl:l.string().optional(),pick:EA.optional(),lastReviewDecision:l.string().optional(),lastCiStatus:l.string().optional(),backfilledAt:l.string().optional(),responseRule:l.number().int().optional()},$j=l.object({url:l.string(),title:l.string(),mergedAt:l.string(),openedAt:l.string().optional(),firstMaintainerResponseAt:l.string().optional(),commentsFetchedAt:l.string().datetime().optional(),learningsExtractedAt:l.string().datetime().optional(),...AA}).passthrough(),Oj=l.object({url:l.string(),title:l.string(),closedAt:l.string(),openedAt:l.string().optional(),firstMaintainerResponseAt:l.string().optional(),commentsFetchedAt:l.string().datetime().optional(),learningsExtractedAt:l.string().datetime().optional(),...AA,closeReason:Mi(_A).optional(),selfCloseReason:Mi(vA).optional()}).passthrough(),Ij=l.object({url:l.string(),repo:l.string(),analyzedAt:l.string()}),xj=l.object({tier:l.enum(["light_check_in","direct_check_in","final_check_in"]),timestamp:l.string().datetime(),draftPath:l.string().optional()}),Dj=l.object({workflowName:l.enum(["draft-first","work-through-issues","pre-commit-review"]),currentStep:l.string(),branchName:l.string().optional(),issueContext:l.object({title:l.string(),url:l.string()}).optional(),completedSteps:l.array(l.string()).default([]),stepData:l.record(l.string(),l.unknown()).default({}),lastUpdatedAt:l.string().datetime()}),Lj=l.object({branchNamingConvention:l.string().optional(),commitMessageFormat:l.string().optional(),prTitleFormat:l.string().optional(),requiredChecks:l.array(l.string()).optional(),testFramework:l.string().optional(),testCoverageRequired:l.boolean().optional(),testFileNaming:l.string().optional(),linter:l.string().optional(),formatter:l.string().optional(),styleGuideUrl:l.string().optional(),issueClaimProcess:l.string().optional(),reviewProcess:l.string().optional(),claRequired:l.boolean().optional(),rawContent:l.string().optional()}),Mj=l.object({passedAllChecks:l.boolean(),checks:l.object({noExistingPR:l.boolean(),notClaimed:l.boolean(),projectActive:l.boolean(),clearRequirements:l.boolean(),contributionGuidelinesFound:l.boolean()}),contributionGuidelines:Lj.optional(),notes:l.array(l.string())}),Fj=l.object({id:l.number(),url:l.string(),repo:l.string(),number:l.number(),title:l.string(),status:Ej,labels:l.array(l.string()),createdAt:l.string(),updatedAt:l.string(),vetted:l.boolean(),vettingResult:Mj.optional()}),PA=l.object({number:l.number(),url:l.string(),title:l.string(),repo:l.string(),daysSinceActivity:l.number(),status:SS}),Nj=l.object({status:SS,setAt:l.string(),lastActivityAt:l.string()}),Bp=l.object({setupComplete:l.boolean().default(!1),setupCompletedAt:l.string().optional(),persistence:l.enum(["local","gist"]).default("local"),maxActivePRs:l.number().default(10),maxOpenPRsPerRepo:l.number().int().min(0).default(0),maxOpenPRsColdRepo:l.number().int().min(0).default(1),maxConcurrentImplementations:l.number().int().min(0).default(2),dormantThresholdDays:l.number().default(30),approachingDormantDays:l.number().default(25),maxIssueAgeDays:l.number().default(90),skipBroadWhenSufficientResults:l.number().min(0).default(8),languages:l.array(l.string()).default(["typescript","javascript"]),labels:l.array(l.string()).default(["good first issue","help wanted"]),scope:l.array(vS).optional(),excludeRepos:l.array(l.string()).default([]),excludeOrgs:l.array(l.string()).optional(),untrackedOrgs:l.array(l.string()).default([]),avoidRepos:l.array(l.string()).default([]),boostIssueTypes:l.array(l.string()).default([]),trustedProjects:l.array(l.string()).default([]),githubUsername:l.string().default(""),minRepoScoreThreshold:l.number().default(4),starredRepos:l.array(l.string()).default([]),starredReposLastFetched:l.string().optional(),squashByDefault:l.union([l.boolean(),l.literal("ask")]).default(!0),localRepoScanPaths:l.array(l.string()).optional(),minStars:l.number().default(50),includeDocIssues:l.boolean().default(!0),aiPolicyBlocklist:l.array(l.string()).default(["matplotlib/matplotlib"]),shelvedPRUrls:l.array(l.string()).default([]),dismissedIssues:l.record(l.string(),l.string()).default({}),dismissedPRHeads:l.record(l.string(),l.string()).default({}),statusOverrides:l.record(l.string(),Nj).optional(),issueListPath:l.string().optional(),skippedIssuesPath:l.string().optional(),projectCategories:l.array(_S).default([]),preferredOrgs:l.array(l.string()).default([]),diffTool:kS.default("inline"),diffToolCustomCommand:l.string().optional(),autoExtractLearnings:l.boolean().default(!0),autoFormatBeforePush:l.boolean().default(!1),trustOwnRepoWrites:l.boolean().default(!1),healthCheckFreshnessMinutes:l.number().int().positive().default(30),reviewMaxPasses:l.number().int().positive().optional(),slmTriageModel:l.string().default(""),slmTriageHost:l.string().default("")}).passthrough().transform(({snoozedPRs:e,...t})=>t),Gj=l.object({repos:l.record(l.string(),l.object({path:l.string(),exists:l.boolean(),currentBranch:l.string().nullable()})),scanPaths:l.array(l.string()),cachedAt:l.string()}),Uj=l.object({url:l.string(),repo:l.string(),number:l.number(),title:l.string(),closedAt:l.string(),closedBy:l.string().optional(),openedAt:l.string().optional(),issueUrl:l.string().optional()}),jj=l.object({url:l.string(),repo:l.string(),number:l.number(),title:l.string(),mergedAt:l.string(),openedAt:l.string().optional(),issueUrl:l.string().optional()}),zj=l.object({totalActivePRs:l.number(),totalNeedingAttention:l.number(),totalMergedAllTime:l.number(),mergeRate:l.number()}),Bj=l.object({url:l.string(),repo:l.string(),number:l.number(),status:SS}).passthrough(),RS=l.array(Bj);Wj=l.object({generatedAt:l.string(),openPRs:RS,needsAddressingPRs:RS,waitingOnMaintainerPRs:RS,recentlyClosedPRs:l.array(Uj),recentlyMergedPRs:l.array(jj),shelvedPRs:l.array(PA),autoUnshelvedPRs:l.array(PA),summary:zj}),Vj=l.preprocess(Hj,Wj),qj=l.object({url:l.string(),lastSeenAt:l.string()}),Zj=l.object({url:l.string(),branch:l.string(),worktree:l.string().optional(),note:l.string().optional(),recordedAt:l.string(),pushedRef:l.string().optional(),pushedAt:l.string().optional(),compareUrl:l.string().optional(),pushProblem:l.string().optional()}).passthrough(),Kj=l.object({url:l.string(),attemptedAt:l.string(),outcome:l.enum(["prepared","blocked"]),note:l.string().optional()}).passthrough(),CS=l.object({runAt:l.string(),reportPath:l.string(),prepareCount:l.number().int().nonnegative(),judgmentCount:l.number().int().nonnegative(),prepared:l.array(Zj).default([]),implementUrl:l.string().optional(),implementAttempts:l.array(Kj).optional()}).passthrough(),PS=l.object({languageOffset:l.number().int().nonnegative().default(0),phase0Offset:l.number().int().nonnegative().default(0),starredOffset:l.number().int().nonnegative().default(0),maintainedOffset:l.number().int().nonnegative().default(0),strategyOffset:l.number().int().nonnegative().default(0),lastRotatedAt:l.string().optional()}).passthrough(),Zs=l.object({kind:Mi(["implementation","pr"]),url:l.string(),session:l.string(),startedAt:l.string(),expiresAt:l.string(),status:Mi(["running","finished"]),branch:l.string().optional(),worktree:l.string().optional(),host:l.string().optional(),machineId:l.string().optional(),runId:l.string().optional(),finishedAt:l.string().optional()}).loose(),Jj=l.array(l.unknown()).default([]).transform(e=>e.flatMap(t=>{let r=Zs.safeParse(t);return r.success?[r.data]:[]}));Gt=l.object({version:l.literal(4),gistId:l.string().optional(),repoScores:l.record(l.string(),Tj).default({}),config:Bp.default(()=>Bp.parse({})),lastRunAt:l.string().default(()=>new Date().toISOString()),lastDigestAt:l.string().optional(),lastStrategyAt:l.string().optional(),lastDigest:Vj.optional(),monthlyMergedCounts:l.record(l.string(),l.number()).optional(),monthlyClosedCounts:l.record(l.string(),l.number()).optional(),monthlyOpenedCounts:l.record(l.string(),l.number()).optional(),localRepoCache:Gj.optional(),mergedPRs:l.array($j).optional(),closedPRs:l.array(Oj).optional(),analyzedIssueConversations:l.array(Ij).optional(),activeIssues:l.array(Fj).default([]),prFollowUpHistory:l.record(l.string(),l.array(xj)).optional(),workflowState:Dj.optional(),searchSeen:l.array(qj).default([]),pickSnapshots:l.array(EA).default([]),lastOvernight:CS.optional(),searchRotation:PS.optional(),workClaims:Jj}).passthrough();Wp="was written by a different oss-autopilot release (usually a newer one); this version keeps those fields but cannot use them. If you are not on the latest release, update with `claude plugin update oss-autopilot@oss-autopilot` and restart Claude Code."});function ES(e,t){return Yj.test(e)&&Qj.test(t)}function q(e){if(!e.startsWith("https://github.com/"))return null;let t=e.match(/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/);if(t){let n=t[1],s=t[2];return ES(n,s)?{owner:n,repo:s,number:parseInt(t[3],10),type:"pull"}:null}let r=e.match(/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)/);if(r){let n=r[1],s=r[2];return ES(n,s)?{owner:n,repo:s,number:parseInt(r[3],10),type:"issues"}:null}return null}function We(e){let t=q(e);return t?`${t.owner.toLowerCase()}/${t.repo.toLowerCase()}#${t.number}`:null}function Hr(e){if(!e.startsWith("https://github.com/"))return null;let t=e.match(/github\.com\/([^/]+)\/([^/]+)/);if(!t)return null;let r=t[1],n=t[2];return ES(r,n)?{owner:r,repo:n}:null}function Ks(e){let[t,r]=e.split("/",2);if(!t||!r)throw new Error(`Invalid repo format: expected "owner/repo", got "${e}"`);return{owner:t,repo:r}}function Sr(e,t){return e.toLowerCase()===t.toLowerCase()}function Fi(e,t=[]){let r=e.toLowerCase();return t.some(n=>n.toLowerCase()===r)}var Yj,Qj,nt=A(()=>{"use strict";Yj=/^[\w-]+$/,Qj=/^[\w.-]+$/});function Yt(e){return We(e)??e.trim().toLowerCase()}function AS(e,t=Date.now()){let r=Date.parse(e.expiresAt);return Number.isFinite(r)&&r>t}function cr(e,t=Date.now()){return e.filter(r=>AS(r,t))}function Js(e,t,r=Date.now()){let n=Yt(t);return cr(e,r).find(s=>Yt(s.url)===n)}function qp(e,t,r,n=Date.now()){let s=Js(e,t,n);if(!(s===void 0||s.session===r))return s}function Zp(e,t){let r=new Date(Date.parse(t)+au*36e5),n=Date.parse(e.expiresAt),s=Number.isFinite(n)&&n>r.getTime()?e.expiresAt:r.toISOString();return{...e,status:"finished",finishedAt:t,expiresAt:s}}function Kp(e,t=Date.now()){return cr(e,t).filter(r=>r.kind==="implementation"&&r.status==="finished")}function xA(e,t=Date.now()){return cr(e,t).filter(r=>r.kind==="implementation"&&r.status==="running")}function Ni(e){return IA.default.resolve(e.trim())}function Xj(e,t){return e===void 0||t===void 0||e===t}function $A(e){try{return OA.realpathSync(e)}catch{return e}}function ez(e,t,r){if(!e.worktree)return!1;let n=Ni(e.worktree);return e.machineId!==void 0&&r.machineId!==void 0?e.machineId!==r.machineId?!1:$A(n)===$A(t):Xj(e.host,r.host)&&n===t}function Jp(e,t,r,n=Date.now()){let s=Yt(t.url),o=cr(e,n).filter(a=>a.kind==="implementation"&&Yt(a.url)!==s);if(t.worktree!==void 0){let a=Ni(t.worktree),c=o.filter(u=>ez(u,a,t));if(c.length>0){let u=c[0];return{reason:"worktree",blocking:c,message:`Checkout ${a} already hosts an implementation of ${u.url} (session ${u.session}, ${u.status}). Use a separate worktree, or finish or release that claim first.`}}}let i=o.filter(a=>a.status==="running");if(r>0&&i.length>=r){let a=i.map(c=>`${c.url} (session ${c.session})`).join(", ");return{reason:"cap",blocking:i,message:`Implementation cap reached: ${i.length} of ${r} running (${a}). Collect or release one, or raise it with \`setup --set maxConcurrentImplementations=N\`.`}}return null}function TS(e,t=Date.now()){let r=Date.parse(e.startedAt),n=Number.isFinite(r)?Math.max(0,Math.floor((t-r)/6e4)):0;return n<60?`${n} min`:n<1440?`${Math.floor(n/60)} h`:`${Math.floor(n/1440)} d`}function cu(e,t=Date.now()){return`${e.kind} claimed in session ${e.session} (${TS(e,t)}, ${e.status})`}function Gi(e,t,r=Date.now()){let n=Js(e,t,r);return!n||n.kind!=="implementation"?null:{recommendation:"skip",reasonsToSkip:[`Already being implemented: ${cu(n,r)}`],workClaim:n}}var OA,IA,Vp,iu,au,$S=A(()=>{"use strict";OA=B(require("node:fs"),1),IA=B(require("node:path"),1);nt();Vp={implementation:24,pr:12},iu=168,au=168});function rz(e){let t=e.lastDigest,r=[...t?.openPRs??[],...t?.shelvedPRs??[],...e.activeIssues].map(i=>i.repo),s=[...(e.mergedPRs??[]).map(i=>i.url),...(e.closedPRs??[]).map(i=>i.url),...e.config.shelvedPRUrls??[]].flatMap(i=>{let a=q(i);return a?[`${a.owner}/${a.repo}`]:[]}),o=new Set(r);for(let i of s)o.add(i);return o}function nz(e,t=Date.now()){let r=t-uu*DA,n=e.searchSeen.filter(c=>Date.parse(c.lastSeenAt)>=r),s=t-tz*DA,o=rz(e),i=Object.fromEntries(Object.entries(e.repoScores).filter(([c,u])=>{let d=u.mergedPRCount>0||u.closedWithoutMergeCount>0,p=Date.parse(u.lastEvaluatedAt),m=Number.isNaN(p)||p>=s;return d||o.has(c)||m})),a=e.lastDigest&&{...e.lastDigest,needsAddressingPRs:[],waitingOnMaintainerPRs:[]};return{...e,searchSeen:n,repoScores:i,lastDigest:a}}function Ar(e){return JSON.stringify(nz(e))}var DA,OS,uu,tz,Ui=A(()=>{"use strict";nt();DA=1440*60*1e3,OS=7,uu=OS+1,tz=14});function sz(){try{return Yp.userInfo().homedir}catch{return null}}function Qp(){let e=Yp.homedir(),t=process.env.VITEST?sz():null;if(t!==null&&yt.resolve(e)===yt.resolve(t))throw new Error(`Refusing to use the real home directory (${e}) under vitest`);return yt.join(e,".oss-autopilot")}function ur(){let e=Qp();return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function jt(){return yt.join(ur(),"state.json")}function LA(){return yt.join(process.cwd(),"data","state.json")}function MA(){return yt.join(process.cwd(),"data","backups")}function Ys(){let e=yt.join(ur(),"backups");return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function Xp(){let e=yt.join(ur(),"cache");return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function ji(){let e=yt.join(ur(),"reports");return Ut.existsSync(e)||Ut.mkdirSync(e,{recursive:!0,mode:448}),e}function Qs(){return yt.join(ur(),"gist-id")}function FA(){return yt.join(ur(),"machine-id")}function es(){return yt.join(ur(),"state-cache.json")}function em(){return Ut.existsSync(yt.join(Qp(),"state.json"))}function Wr(){return"3.40.1"}var Ut,yt,Yp,Vr=A(()=>{"use strict";Ut=B(require("node:fs"),1),yt=B(require("node:path"),1),Yp=B(require("node:os"),1)});function rm(){tm=!0}function NA(){return tm}function O(e,t,...r){if(!tm)return;let n=new Date().toISOString();console.error(`[${n}] [DEBUG] [${e}] ${t}`,...r)}function GA(e,t,...r){let n=new Date().toISOString();console.error(`[${n}] [INFO] [${e}] ${t}`,...r)}function v(e,t,...r){let n=new Date().toISOString();console.error(`[${n}] [WARN] [${e}] ${t}`,...r)}async function nm(e,t,r){if(!tm)return r();let n=performance.now();try{let s=await r(),o=(performance.now()-n).toFixed(0);return O(e,`${t} completed in ${o}ms`),s}catch(s){let o=(performance.now()-n).toFixed(0);throw O(e,`${t} failed after ${o}ms`),s}}var tm,ce=A(()=>{"use strict";tm=!1});function du(e){if(process.env[sm]!==void 0)throw new Te(`Refusing to ${e} during an unattended run (${sm} is set). Run it yourself in an interactive session.`)}function I(e){return e instanceof Error?e.message:String(e)}function Ue(e){if(e&&typeof e=="object"&&"status"in e){let t=e.status;return typeof t=="number"&&Number.isFinite(t)?t:void 0}}function hn(e){let t=Ue(e);return t===void 0?void 0:`HTTP ${t}`}function Xt(e){let t=hn(e);return t?`${t}: ${I(e)}`:I(e)}function zt(e){let t=Ue(e);return t===429?!0:t===403?I(e).toLowerCase().includes("rate limit"):!1}function UA(e){if(Ue(e)!==422)return!1;let t=e?.response?.data,r=t&&typeof t=="object"?t.errors:void 0;return Array.isArray(r)?r.some(n=>{if(!n||typeof n!="object")return!1;let s=n;return s.resource!=="Search"||s.code!=="invalid"?!1:typeof s.message=="string"?IS.test(s.message):IS.test(I(e))}):IS.test(I(e))}function de(e){let t=Ue(e);if(t===401||t===429)return!0;if(t===403){let r=I(e).toLowerCase();return r.includes("rate limit")||r.includes("abuse detection")}return!1}function im(e){if(!e||typeof e!="object")return!1;let t=Ue(e);if(typeof t=="number"&&t>=500&&t<600)return!0;let r=e.code;if(typeof r=="string"&&(r==="ECONNRESET"||r==="ETIMEDOUT"||r==="ENETUNREACH"||r==="ENOTFOUND"||r==="ECONNREFUSED"||r==="EAI_AGAIN"))return!0;let n=e.name;return typeof n=="string"&&(n==="AbortError"||n==="TimeoutError")}function jA(e){return t=>{if(de(t))throw t;return v(e.module,`Failed to ${e.label}: ${I(t)}`),e.fallback}}function am(e){if(e instanceof Te)return"CONFIGURATION";if(e instanceof j)return"VALIDATION";if(e instanceof Tr||e instanceof Qt)return"CONCURRENCY";let t=Ue(e);if(t===401)return"AUTH_REQUIRED";if(t===403){let n=I(e).toLowerCase();return n.includes("rate limit")||n.includes("abuse detection")?"RATE_LIMITED":"AUTH_REQUIRED"}if(t===404)return"NOT_FOUND";if(t===429)return"RATE_LIMITED";let r=I(e).toLowerCase();return r.includes("enotfound")||r.includes("econnrefused")||r.includes("econnreset")||r.includes("etimedout")||r.includes("fetch failed")?"NETWORK":r.includes("state")&&(r.includes("corrupt")||r.includes("invalid"))?"STATE_CORRUPTED":"UNKNOWN"}var _r,Te,sm,j,zi,lu,Tr,Qt,om,$r,IS,ee=A(()=>{"use strict";ce();_r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="OssAutopilotError"}code},Te=class extends _r{constructor(t){super(t,"CONFIGURATION_ERROR"),this.name="ConfigurationError"}},sm="OSS_AUTOPILOT_UNATTENDED";j=class extends _r{constructor(t){super(t,"VALIDATION_ERROR"),this.name="ValidationError"}},zi=class extends Te{constructor(t){super(t??'Your GitHub token does not have Gist permissions. Run `gh auth refresh -s gist` to add the required scope, or create a token with the "gist" scope.'),this.name="GistPermissionError"}},lu=class extends Te{constructor(r,n,s){let o=s instanceof Error?s.message:String(s),i=n?`
64
64
  Corrupt content preserved at: ${n}
65
65
  Inspect or restore manually, then re-run. Falling back to a fresh state would overwrite your Gist.`:`
66
66
  Could not preserve the rejected content; do not push without inspecting the Gist manually.`;super(`Gist ${r} state.json is corrupt or fails schema validation: ${o}${i}`);this.gistId=r;this.rejectedPath=n;this.cause=s;this.name="GistCorruptError"}gistId;rejectedPath;cause},Tr=class extends _r{constructor(r,n){super("Another oss-autopilot process wrote state.json concurrently. Re-run the command to retry \u2014 the last write wins and no data was lost from the other process.","CONCURRENCY_ERROR");this.expectedMtimeMs=r;this.actualMtimeMs=n;this.name="ConcurrencyError"}expectedMtimeMs;actualMtimeMs},Qt=class extends _r{constructor(r,n){super("Another machine pushed to the state Gist while this push was in flight, and the merge attempt also collided. Your local mutations are still in memory, but `state --sync` cannot merge them: re-run the command that made the change.","CONCURRENCY_ERROR");this.expectedEtag=r;this.remoteEtag=n;this.name="GistConcurrencyError"}expectedEtag;remoteEtag},om="trim the large state fields in the Gist (repoScores and searchSeen are usually the biggest), or run state-unlink to fall back to local state",$r=class extends Te{constructor(t){super(t),this.name="GistFileSizeError"}};IS=/users.*do not exist|cannot be searched/i});function iz(e){try{let t=JSON.parse(ie.readFileSync(e,"utf8"));return Date.now()-t.timestamp>oz}catch(t){return O(ne,"Lock file unreadable or invalid JSON, treating as stale",t),!0}}function HA(e){let t=JSON.stringify({pid:process.pid,timestamp:Date.now()});try{ie.writeFileSync(e,t,{flag:"wx"});return}catch(r){O(ne,"Lock file already exists, checking staleness",r)}if(!iz(e))throw new Error("State file is locked by another process");try{ie.unlinkSync(e)}catch(r){O(ne,"Stale lock already removed by another process",r)}try{ie.writeFileSync(e,t,{flag:"wx"})}catch(r){throw O(ne,"Lock re-acquire failed (race condition)",r),new Error("State file is locked by another process",{cause:r})}}function WA(e){try{JSON.parse(ie.readFileSync(e,"utf8")).pid===process.pid&&ie.unlinkSync(e)}catch(t){O(ne,"Lock file already removed or unreadable during release",t)}}function Or(e,t,r){let n=`${e}.${process.pid}.tmp`;ie.writeFileSync(n,t,{mode:r??384}),ie.renameSync(n,e),r!==void 0&&ie.chmodSync(e,r)}function Hi(e){O(ne,"Migrating state from v1 to v2 (fresh GitHub fetching)...");let t=e.mergedPRs||[],r=e.closedPRs||[],n={...e.repoScores||{}};for(let o of[...t,...r])n[o.repo]||(n[o.repo]={repo:o.repo,score:5,mergedPRCount:0,closedWithoutMergeCount:0,avgResponseDays:null,lastEvaluatedAt:new Date().toISOString(),signals:{hasActiveMaintainers:!0,isResponsive:!1,hasHostileComments:!1}});let s={version:2,activeIssues:e.activeIssues||[],repoScores:n,config:e.config,lastRunAt:new Date().toISOString()};return O(ne,`Migration complete. Preserved ${Object.keys(n).length} repo scores.`),s}function Wi(e){O(ne,"Migrating state from v2 to v3 (drop dead fields, add learnings tracking)..."),delete e.events,delete e.dailyActivityCounts;let t=e.config;return t&&(delete t.showHealthCheck,delete t.scoreThreshold),e.version=3,O(ne,"v2 to v3 migration complete."),e}function Vi(e){return O(ne,"Migrating state from v3 to v4 (add commentsFetchedAt to stored PR records)..."),e.version=4,O(ne,"v3 to v4 migration complete (no data transformation required)."),e}function bn(){return Gt.parse({version:4})}function az(){let e=jt(),t=LA(),r=MA();if(ie.existsSync(e)||!ie.existsSync(t))return!1;O(ne,"Migrating state from ./data/ to ~/.oss-autopilot/...");try{if(ur(),ie.copyFileSync(t,e),O(ne,`Migrated state file to ${e}`),ie.existsSync(r)){let s=Ys(),o=ie.readdirSync(r).filter(i=>i.startsWith("state-")&&i.endsWith(".json"));for(let i of o){let a=yn.join(r,i),c=yn.join(s,i);ie.copyFileSync(a,c)}O(ne,`Migrated ${o.length} backup files`)}if(ie.unlinkSync(t),O(ne,"Removed legacy state file"),ie.existsSync(r)){let s=ie.readdirSync(r);for(let o of s)ie.unlinkSync(yn.join(r,o));ie.rmdirSync(r)}let n=yn.dirname(t);return ie.existsSync(n)&&ie.readdirSync(n).length===0&&(ie.rmdirSync(n),O(ne,"Removed empty legacy data directory")),O(ne,"Migration complete!"),!0}catch(n){if(v(ne,`Failed to migrate state: ${I(n)}`),ie.existsSync(e)&&ie.existsSync(t))try{ie.unlinkSync(e),O(ne,"Cleaned up partial migration - removed incomplete new state file")}catch(s){v(ne,"Could not clean up partial migration file"),O(ne,"Partial migration cleanup failed",s)}return v(ne,"To resolve this issue:"),v(ne," 1. Ensure you have write permissions to ~/.oss-autopilot/"),v(ne," 2. Check available disk space"),v(ne," 3. Manually copy ./data/state.json to ~/.oss-autopilot/state.json"),v(ne," 4. Or delete ./data/state.json to start fresh"),!1}}function zA(){let e=Ys();if(!ie.existsSync(e))return null;let t=ie.readdirSync(e).filter(r=>r.startsWith("state-")&&r.endsWith(".json")).sort().reverse();for(let r of t){let n=yn.join(e,r);try{let s=ie.readFileSync(n,"utf8"),o=JSON.parse(s);if(typeof o=="object"&&o!==null){let c=o;c.version===1&&(o=Hi(c)),o.version===2&&(o=Wi(o)),o.version===3&&(o=Vi(o))}let i=Gt.safeParse(o);if(i.success){let c=i.data;O(ne,`Successfully restored state from backup: ${r}`);let u=Object.keys(c.repoScores).length;O(ne,`Restored state v${c.version}: ${u} repo scores`);let d=jt();return Or(d,Ar(c),384),O(ne,"Restored backup written to main state file"),c}let a=i.error.issues.map(c=>`${c.path.join(".")}: ${c.message}`).join("; ");v(ne,`Backup ${r} failed schema validation: ${a}`),O(ne,`Backup ${r} full validation errors:`,i.error.issues)}catch(s){let o=s instanceof Error?s.message:String(s);v(ne,`Backup ${r} is corrupted (${o}), trying next...`),O(ne,`Backup ${r} parse failed`,s)}}return null}function BA(e){try{let t=e+".rejected-"+Date.now();return ie.copyFileSync(e,t),v(ne,`Previous state preserved at: ${t}`),t}catch(t){return v(ne,`Could not preserve rejected state file: ${I(t)}`),null}}function Xs(e,t,r){let n=TA(e,t);n>0&&v(ne,`${r} has ${n} unreadable work claim(s); they were dropped`)}function cm(){az();let e=jt();try{if(ie.existsSync(e)){let t=Bi(e),r=ie.readFileSync(e,"utf8"),n=JSON.parse(r),s=!1;if(typeof n=="object"&&n!==null){let u=n;u.version===1&&(n=Hi(u),s=!0),n.version===2&&(n=Wi(n),s=!0),n.version===3&&(n=Vi(n),s=!0)}let o=Hp(n);o.length>0&&v(ne,`State file (fields: ${o.join(", ")}) ${Wp}`);let i=Gt.safeParse(n);if(!i.success){let u=i.error.issues.map(f=>`${f.path.join(".")}: ${f.message}`).join("; ");v(ne,`Invalid state file structure: ${u}`),v(ne,"Attempting to restore from backup..."),O(ne,"Full validation errors:",i.error.issues);let d=BA(e),p=`Invalid state file structure: ${u}`,m=zA();if(m){let f=Bi(e);return{state:m,mtimeMs:f,recovery:{source:"backup",rejectedPath:d,reason:p}}}return v(ne,"No valid backup found, starting fresh"),{state:bn(),mtimeMs:0,recovery:{source:"fresh",rejectedPath:d,reason:p}}}s&&(Or(e,Ar(i.data),384),t=Bi(e),O(ne,"Migrated and validated state saved"));let a=i.data;Xs(n,a,"State file");let c=Object.keys(a.repoScores).length;return O(ne,`Loaded state v${a.version}: ${c} repo scores tracked`),{state:a,mtimeMs:t}}}catch(t){let r=t?.code;if(r==="EACCES"||r==="EPERM")throw new Error(`Permission denied reading state file (${r}): ${I(t)}. This is an environment problem, not state corruption. Check the ownership and permissions of ~/.oss-autopilot/state.json (e.g. run \`ls -l ~/.oss-autopilot/state.json\` and fix with chown/chmod), then retry.`,{cause:t});v(ne,"Error loading state:",t),v(ne,"Attempting to restore from backup...");let n=ie.existsSync(e)?BA(e):null,s=`Error loading state: ${I(t)}`,o=zA();if(o){let i=Bi(e);return{state:o,mtimeMs:i,recovery:{source:"backup",rejectedPath:n,reason:s}}}return v(ne,"No valid backup found, starting fresh"),{state:bn(),mtimeMs:0,recovery:{source:"fresh",rejectedPath:n,reason:s}}}return O(ne,"No existing state found, initializing..."),{state:bn(),mtimeMs:0}}function Bi(e){try{return ie.statSync(e).mtimeMs}catch(t){return O(ne,`Could not read state file mtime (reload detection will always trigger): ${I(t)}`),0}}function cz(){let e=Ys();try{let t=ie.readdirSync(e).filter(r=>r.startsWith("state-")).sort().reverse();for(let r of t.slice(10))try{ie.unlinkSync(yn.join(e,r))}catch(n){v(ne,`Could not delete old backup ${r}:`,I(n))}}catch(t){v(ne,"Could not clean up backups:",I(t))}}function VA(e,t=null){let r=jt(),n=r+".lock",s=Ys();HA(n);try{if(t!==null&&t>0&&ie.existsSync(r)){let i=Bi(r);if(i!==t)throw new Tr(t,i)}try{if(ie.existsSync(r)){let i=new Date().toISOString().replaceAll(/[.:]/g,"-"),a=Math.random().toString(36).slice(2,8).padEnd(6,"0"),c=yn.join(s,`state-${i}-${a}.json`);ie.copyFileSync(r,c),ie.chmodSync(c,384),cz()}}catch(i){v(ne,`Could not create backup before save: ${I(i)}`)}Or(r,Ar(e),384);let o=Bi(r);return O(ne,"State saved successfully"),o}finally{WA(n)}}function qA(e){try{let t=jt();if(ie.statSync(t).mtimeMs===e)return null;let n=cm();if(n.recovery)try{n.mtimeMs=ie.statSync(t).mtimeMs}catch(s){O(ne,"Could not re-read mtime after reload (will retry next cycle)",s)}return n}catch(t){return v(ne,`Failed to reload state from disk: ${I(t)}`),null}}var ie,yn,ne,oz,pu=A(()=>{"use strict";ie=B(require("node:fs"),1),yn=B(require("node:path"),1);gn();Ui();Vr();ee();ce();ne="state",oz=3e4});function qr(e,t){return e===void 0||e<t}var xS,uz,um,eo,to,lz,ts=A(()=>{"use strict";gn();xS=Bp.parse({}),uz=Gt.parse({version:4}),um=_S.options,eo=vS.options,to=kS.options,lz={beginner:["good first issue","help wanted","easy","up-for-grabs","first-timers-only","beginner"],intermediate:["enhancement","feature","feature-request","contributions welcome"],advanced:["proposal","RFC","accepted","design"]}});function Sz(e){return{repo:e,score:YA,mergedPRCount:0,closedWithoutMergeCount:0,avgResponseDays:null,lastEvaluatedAt:new Date().toISOString(),signals:{hasActiveMaintainers:!0,isResponsive:!1,hasHostileComments:!1}}}function _z(e){let t=YA;if(e.mergedPRCount>0){let r=Math.min(Math.round(Math.log2(e.mergedPRCount+1)*dz),pz);t+=r}if(t-=Math.min(e.closedWithoutMergeCount,mz),e.lastMergedAt){let r=new Date(e.lastMergedAt);isNaN(r.getTime())?v(qi,`Invalid lastMergedAt date for ${e.repo}: "${e.lastMergedAt}". Skipping recency bonus.`):Math.floor((Date.now()-r.getTime())/864e5)<=fz&&(t+=gz)}return e.signals.isResponsive&&(t+=hz),e.signals.hasHostileComments&&(t-=yz),Math.max(bz,Math.min(wz,t))}function QA(e,t){return e.repoScores[t]}function ZA(e){return JSON.stringify([e.mergedPRCount,e.closedWithoutMergeCount,e.avgResponseDays??null,e.lastMergedAt??null,e.signals.hasActiveMaintainers,e.signals.isResponsive,e.signals.hasHostileComments])}function DS(e,t,r){let n=!e.repoScores[t];n&&(e.repoScores[t]=Sz(t));let s=e.repoScores[t],o=ZA(s);r.mergedPRCount!==void 0&&(s.mergedPRCount=r.mergedPRCount),r.closedWithoutMergeCount!==void 0&&(s.closedWithoutMergeCount=r.closedWithoutMergeCount),r.avgResponseDays!==void 0&&(s.avgResponseDays=r.avgResponseDays),r.lastMergedAt!==void 0&&(s.lastMergedAt=r.lastMergedAt),r.stargazersCount!==void 0&&(s.stargazersCount=r.stargazersCount),r.language!==void 0&&(s.language=r.language),r.signals&&(s.signals={...s.signals,...r.signals}),s.score=_z(s),(n||ZA(s)!==o)&&(s.lastEvaluatedAt=new Date().toISOString()),O(qi,`Updated repo score for ${t}: ${s.score}/10`)}function XA(e){return Object.values(e.repoScores).filter(t=>t.mergedPRCount>0).sort((t,r)=>r.mergedPRCount-t.mergedPRCount).map(t=>t.repo)}function eT(e){return Object.values(e.repoScores).filter(t=>t.mergedPRCount===0&&t.closedWithoutMergeCount===0).sort((t,r)=>r.score-t.score).map(t=>t.repo)}function tT(e,t){let r=t??e.config.minRepoScoreThreshold;return Object.values(e.repoScores).filter(n=>n.score>=r).sort((n,s)=>s.score-n.score).map(n=>n.repo)}function rT(e,t){let r=t??e.config.minRepoScoreThreshold,n=Date.now();return Object.values(e.repoScores).filter(s=>{if(s.score>r)return!1;let o=n-new Date(s.lastEvaluatedAt).getTime();return Number.isFinite(o)?o<=Rz:(v(qi,`Invalid lastEvaluatedAt for repo ${s.repo}: "${s.lastEvaluatedAt}", treating as stale`),!1)}).sort((s,o)=>s.score-o.score).map(s=>s.repo)}function KA(e){let t=new Map;for(let r of e){let n=q(r.url);if(!n){v(qi,`Skipping PR with unparseable URL during reconciliation: "${r.url}"`);continue}let s=`${n.owner}/${n.repo}`;t.set(s,(t.get(s)??0)+1)}return t}function nT(e,t,r){let n=JA(e,KA(t),"mergedPRCount"),s=JA(e,KA(r),"closedWithoutMergeCount");return n||s}function JA(e,t,r){let n=!1;for(let[s,o]of t){let i=e.repoScores[s]?.[r]??0;o>i&&(O(qi,`Reconciling ${s} ${r}: ${i} \u2192 ${o}`),DS(e,s,{[r]:o}),n=!0)}return n}function sT(e,t){let r=new Set(t.map(o=>o.url)),n=new Map;for(let o of t){let i=q(o.url);!i||!o.title||n.set(`${i.number}\0${o.title}`,`${i.owner}/${i.repo}`)}let s=new Map;for(let o of e){let i=r.has(o.url)||!o.title?null:q(o.url);if(!i)continue;let a=`${i.owner}/${i.repo}`,c=n.get(`${i.number}\0${o.title}`);c&&c!==a&&s.set(a,c)}return s}function oT(e,t,r){let n=`https://github.com/${t}/`,s=`https://github.com/${r}/`,o=a=>{if(!a?.some(d=>d.url.startsWith(n)))return a;let c=new Set;return a.map(d=>{if(!d.url.startsWith(n))return d;let p=s+d.url.slice(n.length);return c.add(p),{...d,url:p}}).filter((d,p)=>!c.has(d.url)||a[p].url.startsWith(n))};e.mergedPRs=o(e.mergedPRs),e.closedPRs=o(e.closedPRs);let i=e.repoScores[t];i&&(Object.hasOwn(e.repoScores,r)||(e.repoScores[r]={...i,repo:r}),delete e.repoScores[t]),O(qi,`Renamed transferred repo ${t} \u2192 ${r}`)}function iT(e){let t=0,r=0,n=0;for(let i of Object.values(e.repoScores))qr(i.stargazersCount,e.config.minStars??50)||(n++,t+=i.mergedPRCount,r+=i.closedWithoutMergeCount);let s=t+r,o=s>0?t/s*100:0;return{mergedPRs:t,closedPRs:r,activeIssues:0,trustedProjects:e.config.trustedProjects.length,mergeRate:o.toFixed(1)+"%",totalTracked:n,needsResponse:0}}var qi,YA,dz,pz,mz,fz,gz,hz,yz,bz,wz,Rz,LS=A(()=>{"use strict";ts();ce();nt();qi="scoring",YA=5,dz=2,pz=5,mz=3,fz=90,gz=1,hz=1,yz=2,bz=1,wz=10,Rz=720*60*60*1e3});function aT(e){return e?e.etag??e.ETag??null:null}function MS(e,t){try{let r=`${es()}.rejected-${Date.now()}`;return Zr.writeFileSync(r,e,{encoding:"utf8",mode:384}),r}catch(r){return v(Pe,`Could not preserve rejected Gist content for ${t}: ${r instanceof Error?r.message:String(r)}`),null}}var Zr,Pe,FS,wn,kz,cT,Cz,Pz,uT,Zi,NS=A(()=>{"use strict";Zr=B(require("node:fs"),1);gn();Ui();pu();Vr();ce();ee();Pe="gist-store";FS="oss-autopilot-state",wn="state.json",kz=900*1024,cT=10*1024*1024,Cz="gist.githubusercontent.com",Pz=100*1024,uT=new Map,Zi=class e{gistId=null;cachedFiles=new Map;dirtyFiles=new Set;baselineFiles=new Map;lastFetchedEtag=null;octokit;lastRefreshAt=0;static REFRESH_THROTTLE_MS=3e4;lastRefreshError=null;constructor(t){this.octokit=t}async bootstrap(){try{await this.checkGistScope();let t=this.readLocalGistId();if(t){O(Pe,`Found local Gist ID: ${t}`);try{this.gistId=t;let o=await this.fetchAndCache(t);return{gistId:t,state:o,created:!1}}catch(o){if(o instanceof Te||zt(o))throw o;v(Pe,`Failed to fetch Gist ${t}, will search/create`,o)}}let r=await this.searchForGist();if(r){O(Pe,`Found Gist via search: ${r}`),this.gistId=r,this.writeLocalGistId(r);let o=await this.fetchAndCache(r);return{gistId:r,state:o,created:!1}}O(Pe,"No existing Gist found, creating new one");let{id:n,state:s}=await this.createGist();return this.writeLocalGistId(n),{gistId:n,state:s,created:!0}}catch(t){if(t instanceof Te||zt(t))throw t;this.gistId=null,this.lastFetchedEtag=null,v(Pe,"All Gist API paths failed, entering degraded mode",t);let r=es(),n=null;try{if(Zr.existsSync(r)){n=Zr.readFileSync(r,"utf8");let s=JSON.parse(n);if(typeof s=="object"&&s!==null){let i=s;i.version===1&&(s=Hi(i)),s.version===2&&(s=Wi(s)),s.version===3&&(s=Vi(s))}let o=Gt.parse(s);return Xs(s,o,"Local state cache"),O(Pe,"Loaded state from local cache in degraded mode"),{gistId:"",state:o,created:!1,degraded:!0}}}catch(s){if(n){let o=MS(n,"local-cache");v(Pe,`Local state cache failed to parse in degraded mode: ${s instanceof Error?s.message:String(s)}. Corrupt cache preserved at: ${o??"(could not preserve)"}`)}else v(Pe,`Failed to read local cache in degraded mode: ${s instanceof Error?s.message:String(s)}`)}return O(Pe,"No local cache found, returning fresh state in degraded mode"),{gistId:"",state:bn(),created:!1,degraded:!0}}}async bootstrapWithMigration(t){try{await this.checkGistScope();let r=this.readLocalGistId();if(r){O(Pe,`bootstrapWithMigration: found local Gist ID: ${r}`);try{this.gistId=r;let i=await this.fetchAndCache(r);return{gistId:r,state:i,created:!1,migrated:!1}}catch(i){if(i instanceof Te||zt(i))throw i;v(Pe,`bootstrapWithMigration: failed to fetch Gist ${r}, will search/create`,i)}}let n=await this.searchForGist();if(n){O(Pe,`bootstrapWithMigration: found Gist via search: ${n}`),this.gistId=n,this.writeLocalGistId(n);let i=await this.fetchAndCache(n);return{gistId:n,state:i,created:!1,migrated:!1}}O(Pe,"bootstrapWithMigration: no existing Gist found, creating one seeded with local state");let{id:s,state:o}=await this.createGistFromState(t);return this.writeLocalGistId(s),{gistId:s,state:o,created:!0,migrated:!0}}catch(r){if(r instanceof Te||zt(r))throw r;this.gistId=null,this.lastFetchedEtag=null,v(Pe,"bootstrapWithMigration: all Gist API paths failed, entering degraded mode",r);let n=es(),s=null;try{if(Zr.existsSync(n)){s=Zr.readFileSync(n,"utf8");let o=JSON.parse(s);if(typeof o=="object"&&o!==null){let a=o;a.version===1&&(o=Hi(a)),o.version===2&&(o=Wi(o)),o.version===3&&(o=Vi(o))}let i=Gt.parse(o);return Xs(o,i,"Local state cache"),O(Pe,"bootstrapWithMigration: loaded state from local cache in degraded mode"),{gistId:"",state:i,created:!1,degraded:!0,migrated:!1}}}catch(o){if(s){let i=MS(s,"local-cache");v(Pe,`bootstrapWithMigration: local cache failed to parse: ${o instanceof Error?o.message:String(o)}. Corrupt cache preserved at: ${i??"(could not preserve)"}`)}else v(Pe,`bootstrapWithMigration: failed to read local cache: ${o instanceof Error?o.message:String(o)}`)}return O(Pe,"bootstrapWithMigration: no local cache found, returning existing state in degraded mode"),{gistId:"",state:t,created:!1,degraded:!0,migrated:!1}}}getGistId(){return this.gistId}markDirty(t){this.dirtyFiles.add(t)}getDocument(t){return this.cachedFiles.get(t)??null}setDocument(t,r){this.cachedFiles.set(t,r),this.markDirty(t)}listDocuments(t){let r=[];for(let n of this.cachedFiles.keys())n.startsWith(t)&&r.push(n);return r}setState(t){this.cachedFiles.set(wn,t),this.markDirty(wn)}async push(){if(this.dirtyFiles.size===0)return!0;if(this.gistId===null)throw new Error("GistStateStore: cannot push before bootstrap \u2014 gistId is null");this.checkPushSize();let t=()=>{let o={};for(let i of this.dirtyFiles){let a=this.cachedFiles.get(i);a!==void 0&&(o[i]={content:a})}return o},r=async()=>{try{let o={gist_id:this.gistId,files:t()},i=await this.octokit.gists.update(o),a=aT(i.headers);return a&&(this.lastFetchedEtag=a),{ok:!0}}catch(o){return{ok:!1,status:o.status,err:o}}};if(this.dirtyFiles.has(wn)){let o={};for(let f of this.dirtyFiles){let g=this.cachedFiles.get(f);g!==void 0&&(o[f]=g)}let i=new Map(this.cachedFiles),a=new Map(this.baselineFiles),c=this.lastFetchedEtag,u=a.get(wn),d=()=>{for(let[f,g]of Object.entries(o))this.cachedFiles.set(f,g)},p=()=>{this.cachedFiles.clear();for(let[f,g]of i)this.cachedFiles.set(f,g);this.baselineFiles=a,this.lastFetchedEtag=c,d()};try{await this.fetchAndCache(this.gistId)}catch(f){throw v(Pe,`Pre-write re-read failed: ${I(f)}`),p(),f instanceof lu||f instanceof $r||zt(f)?f:new Qt(c,null)}let m=this.cachedFiles.get(wn);if(u!==m){v(Pe,"state.json changed remotely since our last fetch; surfacing GistConcurrencyError instead of clobbering (#1235, #1510)");let f=this.lastFetchedEtag;throw p(),new Qt(c,f)}d()}let n=await r();if(!n.ok&&(O(Pe,`push failed on first attempt, retrying: ${n.err}`),n=await r(),!n.ok))return v(Pe,`push failed after retry, giving up: ${n.err}`),!1;if(this.dirtyFiles.clear(),this.baselineFiles=new Map(this.cachedFiles),this.cachedFiles.get(wn))try{let o=this.parseStateFromCache();this.writeLocalStateCache(o)}catch(o){O(Pe,`push succeeded but local cache write failed: ${o}`)}return!0}async refreshFromGist(t={}){if(!this.gistId)return{status:"no-gist"};let r=Date.now(),n=r-this.lastRefreshAt;if(n<e.REFRESH_THROTTLE_MS&&!t.force)return{status:"throttled",sinceLastMs:n};this.lastRefreshAt=r;try{return await this.fetchAndCache(this.gistId),this.lastRefreshError=null,{status:"refreshed"}}catch(s){let o=s instanceof Error?s:new Error(String(s));return v(Pe,`refreshFromGist failed: ${o.message}`),this.lastRefreshError=o,{status:"error",error:o}}}checkPushSize(){for(let t of this.dirtyFiles){let r=this.cachedFiles.get(t);if(r===void 0)continue;let n=Buffer.byteLength(r,"utf8");if(n>cT)throw new $r(`Refusing to push Gist file ${t}: ${n} bytes exceeds the ${cT}-byte limit the Gist API can serve back. The local change is kept in memory but was not synced.`);if(n>kz){let s=Math.floor(n/Pz);(uT.get(t)??-1)<s&&(uT.set(t,s),v(Pe,`Gist file ${t} is ${n} bytes, near or past the 1 MB the Gist API returns inline. Reads fall back to raw_url, which works up to 10 MB; to stay well under that, trim large state fields (repoScores and searchSeen are usually the biggest).`))}}}async checkGistScope(){try{await this.octokit.gists.list({per_page:1,page:1})}catch(t){if(zt(t))throw t;let r=t.status;throw r===401||r===403?new zi:t}}async fetchAndCache(t){let r=await this.octokit.gists.get({gist_id:t});this.gistId=t;let n=new Map;for(let[o,i]of Object.entries(r.data.files)){if(!i)continue;let a=i.truncated?await this.fetchRawContent(o,i.raw_url):i.content;a!=null&&n.set(o,a)}this.lastFetchedEtag=aT(r.headers),this.cachedFiles.clear();for(let[o,i]of n)this.cachedFiles.set(o,i);this.baselineFiles=new Map(this.cachedFiles);let s=this.parseStateFromCache();return this.writeLocalStateCache(s),s}async fetchRawContent(t,r){let n=a=>new $r(`Gist file ${t} is larger than the 1 MB the Gist API returns inline and its full content could not be read from raw_url (${a}). Local state was left unchanged.`);if(!this.octokit.request)throw n("no HTTP client available");if(!r)throw n("the API returned no raw_url");let s=URL.canParse(r)?new URL(r):void 0;if((s?.protocol==="https:"?s.hostname:"")!==Cz)throw n("unexpected raw_url host");let i;try{({data:i}=await this.octokit.request({method:"GET",url:r}))}catch(a){throw zt(a)||im(a)?a:n(I(a))}if(typeof i!="string")throw n("response body was not text");return i}parseStateFromCache(){let t=this.cachedFiles.get(wn);if(!t)return O(Pe,"No state.json found in Gist, using fresh state"),bn();try{let r=JSON.parse(t);if(typeof r=="object"&&r!==null){let o=r;o.version===1&&(r=Hi(o)),r.version===2&&(r=Wi(r)),r.version===3&&(r=Vi(r))}let n=Hp(r);n.length>0&&v(Pe,`Gist state (fields: ${n.join(", ")}) ${Wp}`);let s=Gt.parse(r);return Xs(r,s,"Gist state"),s}catch(r){let n=MS(t,this.gistId??"unknown");throw v(Pe,`Gist state.json failed to parse \u2014 refusing to overwrite with fresh state. Corrupt content preserved at: ${n??"(could not preserve)"}`),new lu(this.gistId??"unknown",n,r)}}async searchForGist(){try{for(let r=1;r<=10;r++){let{data:n}=await this.octokit.gists.list({per_page:100,page:r});if(n.length===0)break;let s=n.find(o=>o.description===FS);if(s)return s.id}}catch(t){if(zt(t))throw t;v(Pe,"Failed to search Gists by description",t)}return null}async createGist(){let t=bn(),r=Ar(t),{data:n}=await this.octokit.gists.create({description:FS,public:!1,files:{[wn]:{content:r}}});this.gistId=n.id,this.cachedFiles.clear();for(let[s,o]of Object.entries(n.files))o&&o.content!=null&&this.cachedFiles.set(s,o.content);return this.baselineFiles=new Map(this.cachedFiles),this.writeLocalStateCache(t),{id:n.id,state:t}}async createGistFromState(t){let r=Ar(t),{data:n}=await this.octokit.gists.create({description:FS,public:!1,files:{[wn]:{content:r}}});this.gistId=n.id,this.cachedFiles.clear();for(let[s,o]of Object.entries(n.files))o&&o.content!=null&&this.cachedFiles.set(s,o.content);return this.baselineFiles=new Map(this.cachedFiles),this.writeLocalStateCache(t),{id:n.id,state:t}}readLocalGistId(){try{let t=Qs();if(Zr.existsSync(t))return Zr.readFileSync(t,"utf8").trim()||null}catch(t){O(Pe,"Could not read local Gist ID file",t)}return null}writeLocalGistId(t){try{let r=Qs();Or(r,t,384),O(Pe,`Wrote Gist ID to ${r}`)}catch(r){v(Pe,`Failed to write local Gist ID file: ${r}`)}}writeLocalStateCache(t){try{let r=es();Or(r,Ar(t),384),O(Pe,`Wrote state cache to ${r}`)}catch(r){v(Pe,`Failed to write local state cache: ${r}`)}}}});function fu(e){if(!e.includes("/"))throw new _r(`Invalid repo identifier "${e}". Expected "owner/repo" format.`,"INVALID_REPO_ID");let[t,r]=e.split("/",2);return`${Ki}${t}--${r}${GS}`}function US(e){if(!e.startsWith(Ki)||!e.endsWith(GS))return null;let t=e.slice(Ki.length,e.length-GS.length),r=t.indexOf("--");if(r===-1)return null;let n=t.slice(0,r),s=t.slice(r+2);return!n||!s?null:`${n}/${s}`}function lT(e,t){if(!e)return null;let r=e.getDocument(fu(t));return r===null||r===""?null:r}function dT(e,t,r){if(!e)throw new rs;let n=Buffer.byteLength(r,"utf8");if(n>lm)throw new mu(n);e.setDocument(fu(t),r)}function pT(e,t){if(!e)throw new rs;e.setDocument(fu(t),"")}function mT(e){if(!e)return[];let t=e.listDocuments(Ki),r=[];for(let n of t){let s=US(n);if(!s)continue;let o=e.getDocument(n);o===null||o===""||r.push(s)}return r.sort()}var Ki,lm,GS,rs,mu,jS=A(()=>{"use strict";ee();Ki="guidelines--",lm=8192,GS=".md";rs=class extends _r{constructor(t){super(t??"Per-repo guidelines require Gist persistence. Run `oss-autopilot setup` to enable Gist sync, then retry.","GUIDELINES_NOT_AVAILABLE"),this.name="GuidelinesNotAvailableError"}},mu=class extends _r{constructor(t,r=lm){super(`Guidelines content is ${t} bytes, exceeding the ${r}-byte cap. Trim or split across categories.`,"GUIDELINES_TOO_LARGE"),this.name="GuidelinesTooLargeError"}}});function Ji(e,t={}){return`Gist persistence is configured but ${typeof e=="string"?Az[e]:e.reason}; writes are LOCAL-ONLY and may be overwritten by the next successful Gist sync.${t.retryHint?` ${t.retryHint}`:""}`}var Az,zS=A(()=>{"use strict";Az={"no-token":"no GitHub token was available","state-unreadable":"the state file could not be read","init-fallback":"initialization hit a transient network failure","configured-but-local":"this process is running local-only (Gist init has not succeeded)","bootstrap-degraded":"the Gist bootstrap fell back to the local cache (reads may be stale and pushes are failing)"}});function ns(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}var gu=A(()=>{});function dm(e,t,r,n){if(typeof r!="function")throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(t)?t.reverse().reduce((s,o)=>dm.bind(null,e,o,s,n),r)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((s,o)=>o.hook.bind(null,s,n),r)():r(n))}var fT=A(()=>{});function gT(e,t,r,n){let s=n;e.registry[r]||(e.registry[r]=[]),t==="before"&&(n=(o,i)=>Promise.resolve().then(s.bind(null,i)).then(o.bind(null,i))),t==="after"&&(n=(o,i)=>{let a;return Promise.resolve().then(o.bind(null,i)).then(c=>(a=c,s(a,i))).then(()=>a)}),t==="error"&&(n=(o,i)=>Promise.resolve().then(o.bind(null,i)).catch(a=>s(a,i))),e.registry[r].push({hook:n,orig:s})}var hT=A(()=>{});function yT(e,t,r){if(!e.registry[t])return;let n=e.registry[t].map(s=>s.orig).indexOf(r);n!==-1&&e.registry[t].splice(n,1)}var bT=A(()=>{});function ST(e,t,r){let n=RT(yT,null).apply(null,r?[t,r]:[t]);e.api={remove:n},e.remove=n,["before","error","after","wrap"].forEach(s=>{let o=r?[t,s,r]:[t,s];e[s]=e.api[s]=RT(gT,null).apply(null,o)})}function Tz(){let e=Symbol("Singular"),t={registry:{}},r=dm.bind(null,t,e);return ST(r,t,e),r}function $z(){let e={registry:{}},t=dm.bind(null,e);return ST(t,e),t}var wT,RT,_T,vT=A(()=>{fT();hT();bT();wT=Function.bind,RT=wT.bind(wT);_T={Singular:Tz,Collection:$z}});function Dz(e){return e?Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}):{}}function Lz(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}function PT(e,t){let r=Object.assign({},e);return Object.keys(t).forEach(n=>{Lz(t[n])?n in e?r[n]=PT(e[n],t[n]):Object.assign(r,{[n]:t[n]}):Object.assign(r,{[n]:t[n]})}),r}function kT(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function HS(e,t,r){if(typeof t=="string"){let[s,o]=t.split(" ");r=Object.assign(o?{method:s,url:o}:{url:s},r)}else r=Object.assign({},t);r.headers=Dz(r.headers),kT(r),kT(r.headers);let n=PT(e||{},r);return r.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(n.mediaType.previews=e.mediaType.previews.filter(s=>!n.mediaType.previews.includes(s)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(s=>s.replace(/-preview/,""))),n}function Mz(e,t){let r=/\?/.test(e)?"&":"?",n=Object.keys(t);return n.length===0?e:e+r+n.map(s=>s==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${s}=${encodeURIComponent(t[s])}`).join("&")}function Nz(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function Gz(e){let t=e.match(Fz);return t?t.map(Nz).reduce((r,n)=>r.concat(n),[]):[]}function CT(e,t){let r={__proto__:null};for(let n of Object.keys(e))t.indexOf(n)===-1&&(r[n]=e[n]);return r}function ET(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function Qi(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function hu(e,t,r){return t=e==="+"||e==="#"?ET(t):Qi(t),r?Qi(r)+"="+t:t}function Yi(e){return e!=null}function BS(e){return e===";"||e==="&"||e==="?"}function Uz(e,t,r,n){var s=e[r],o=[];if(Yi(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||typeof s=="boolean")s=s.toString(),n&&n!=="*"&&(s=s.substring(0,parseInt(n,10))),o.push(hu(t,s,BS(t)?r:""));else if(n==="*")Array.isArray(s)?s.filter(Yi).forEach(function(i){o.push(hu(t,i,BS(t)?r:""))}):Object.keys(s).forEach(function(i){Yi(s[i])&&o.push(hu(t,s[i],i))});else{let i=[];Array.isArray(s)?s.filter(Yi).forEach(function(a){i.push(hu(t,a))}):Object.keys(s).forEach(function(a){Yi(s[a])&&(i.push(Qi(a)),i.push(hu(t,s[a].toString())))}),BS(t)?o.push(Qi(r)+"="+i.join(",")):i.length!==0&&o.push(i.join(","))}else t===";"?Yi(s)&&o.push(Qi(r)):s===""&&(t==="&"||t==="?")?o.push(Qi(r)+"="):s===""&&o.push("");return o}function jz(e){return{expand:zz.bind(null,e)}}function zz(e,t){var r=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,s,o){if(s){let a="",c=[];if(r.indexOf(s.charAt(0))!==-1&&(a=s.charAt(0),s=s.substr(1)),s.split(/,/g).forEach(function(u){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(u);c.push(Uz(t,a,d[1],d[2]||d[3]))}),a&&a!=="+"){var i=",";return a==="?"?i="&":a!=="#"&&(i=a),(c.length!==0?a:"")+c.join(i)}else return c.join(",")}else return ET(o)}),e==="/"?e:e.replace(/\/$/,"")}function AT(e){let t=e.method.toUpperCase(),r=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},e.headers),s,o=CT(e,["method","baseUrl","url","headers","request","mediaType"]),i=Gz(r);r=jz(r).expand(o),/^http/.test(r)||(r=e.baseUrl+r);let a=Object.keys(e).filter(d=>i.includes(d)).concat("baseUrl"),c=CT(o,a);if(!/application\/octet-stream/i.test(n.accept)&&(e.mediaType.format&&(n.accept=n.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&e.mediaType.previews?.length)){let d=n.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];n.accept=d.concat(e.mediaType.previews).map(p=>{let m=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${p}-preview${m}`}).join(",")}return["GET","HEAD"].includes(t)?r=Mz(r,c):"data"in c?s=c.data:Object.keys(c).length&&(s=c),!n["content-type"]&&typeof s<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof s>"u"&&(s=""),Object.assign({method:t,url:r,headers:n},typeof s<"u"?{body:s}:null,e.request?{request:e.request}:null)}function Bz(e,t,r){return AT(HS(e,t,r))}function TT(e,t){let r=HS(e,t),n=Bz.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:TT.bind(null,r),merge:HS.bind(null,r),parse:AT})}var Oz,Iz,xz,Fz,$T,OT=A(()=>{gu();Oz="0.0.0-development",Iz=`octokit-endpoint.js/${Oz} ${ns()}`,xz={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Iz},mediaType:{format:""}};Fz=/\{[^{}}]+\}/g;$T=TT(null,xz)});var LT=bC((U5,yu)=>{"use strict";var fm=function(){};fm.prototype=Object.create(null);var pm=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,mm=/\\([\v\u0020-\u00ff])/gu,IT=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,ro={type:"",parameters:new fm};Object.freeze(ro.parameters);Object.freeze(ro);function xT(e){if(typeof e!="string")throw new TypeError("argument header is required and must be a string");let t=e.indexOf(";"),r=t!==-1?e.slice(0,t).trim():e.trim();if(IT.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new fm};if(t===-1)return n;let s,o,i;for(pm.lastIndex=t;o=pm.exec(e);){if(o.index!==t)throw new TypeError("invalid parameter format");t+=o[0].length,s=o[1].toLowerCase(),i=o[2],i[0]==='"'&&(i=i.slice(1,i.length-1),mm.test(i)&&(i=i.replace(mm,"$1"))),n.parameters[s]=i}if(t!==e.length)throw new TypeError("invalid parameter format");return n}function DT(e){if(typeof e!="string")return ro;let t=e.indexOf(";"),r=t!==-1?e.slice(0,t).trim():e.trim();if(IT.test(r)===!1)return ro;let n={type:r.toLowerCase(),parameters:new fm};if(t===-1)return n;let s,o,i;for(pm.lastIndex=t;o=pm.exec(e);){if(o.index!==t)return ro;t+=o[0].length,s=o[1].toLowerCase(),i=o[2],i[0]==='"'&&(i=i.slice(1,i.length-1),mm.test(i)&&(i=i.replace(mm,"$1"))),n.parameters[s]=i}return t!==e.length?ro:n}yu.exports.default={parse:xT,safeParse:DT};yu.exports.parse=xT;yu.exports.safeParse=DT;yu.exports.defaultContentType=ro});var Hz,NT,WS,MT,Wz,Vz,qz,GT,Zz,Kz,Jz,UT,FT,Yz,Qz,jT,zT=A(()=>{Hz=/^-?\d+$/,NT=/^-?\d+n+$/,WS=JSON.stringify,MT=JSON.parse,Wz=/^-?\d+n$/,Vz=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,qz=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,GT=(e,t,r)=>"rawJSON"in JSON?WS(e,(i,a)=>typeof a=="bigint"?JSON.rawJSON(a.toString()):typeof t=="function"?t(i,a):(Array.isArray(t)&&t.includes(i),a),r):e?WS(e,(i,a)=>typeof a=="string"&&!!a.match(NT)||typeof a=="bigint"?a.toString()+"n":typeof t=="function"?t(i,a):(Array.isArray(t)&&t.includes(i),a),r).replace(Vz,"$1$2$3").replace(qz,"$1$2$3"):WS(e,t,r),Zz=()=>JSON.parse("1",(e,t,r)=>!!r&&r.source==="1"),Kz=(e,t,r,n)=>typeof t=="string"&&t.match(Wz)?BigInt(t.slice(0,-1)):typeof t=="string"&&t.match(NT)?t.slice(0,-1):typeof n!="function"?t:n(e,t,r),Jz=(e,t)=>JSON.parse(e,(r,n,s)=>{let o=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER),i=s&&Hz.test(s.source);return o&&i?BigInt(s.source):typeof t!="function"?n:t(r,n,s)}),UT=Number.MAX_SAFE_INTEGER.toString(),FT=UT.length,Yz=/"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g,Qz=/^"-?\d+n+"$/,jT=(e,t)=>{if(!e)return MT(e,t);if(Zz())return Jz(e,t);let r=e.replace(Yz,(n,s,o,i)=>{let a=n[0]==='"';if(a&&!!n.match(Qz))return n.substring(0,n.length-1)+'n"';let u=o||i,d=s&&(s.length<FT||s.length===FT&&s<=UT);return a||u||d?n:'"'+n+'n"'});return MT(r,(n,s,o)=>Kz(n,s,o,t))}});var Rn,VS=A(()=>{Rn=class extends Error{name;status;request;response;constructor(t,r,n){super(t,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let s=Object.assign({},n.request);n.request.headers.authorization&&(s.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),s.url=s.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=s}}});function t1(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}async function HT(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=e.request?.log||console,n=e.request?.parseSuccessResponseBody!==!1,s=t1(e.body)||Array.isArray(e.body)?GT(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([p,m])=>[p,String(m)])),i;try{i=await t(e.url,{method:e.method,body:s,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(p){let m="Unknown Error";if(p instanceof Error){if(p.name==="AbortError")throw p.status=500,p;m=p.message,p.name==="TypeError"&&"cause"in p&&(p.cause instanceof Error?m=p.cause.message:typeof p.cause=="string"&&(m=p.cause))}let f=new Rn(m,500,{request:e});throw f.cause=p,f}let a=i.status,c=i.url,u={};for(let[p,m]of i.headers)u[p]=m;let d={url:c,status:a,headers:u,data:""};if("deprecation"in u){let p=u.link&&u.link.match(/<([^<>]+)>; rel="deprecation"/),m=p&&p.pop();r.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${u.sunset}${m?`. See ${m}`:""}`)}if(a===204||a===205)return d;if(e.method==="HEAD"){if(a<400)return d;throw new Rn(i.statusText,a,{response:d,request:e})}if(a===304)throw d.data=await qS(i),new Rn("Not modified",a,{response:d,request:e});if(a>=400)throw d.data=await qS(i),new Rn(n1(d.data),a,{response:d,request:e});return d.data=n?await qS(i):i.body,d}async function qS(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(BT);let r=(0,WT.safeParse)(t);if(r1(r)){let n="";try{return n=await e.text(),jT(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?e.text().catch(BT):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function r1(e){return e.type==="application/json"||e.type==="application/scim+json"}function n1(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){let t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(r=>JSON.stringify(r)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function ZS(e,t){let r=e.defaults(t);return Object.assign(function(s,o){let i=r.merge(s,o);if(!i.request||!i.request.hook)return HT(r.parse(i));let a=(c,u)=>HT(r.parse(r.merge(c,u)));return Object.assign(a,{endpoint:r,defaults:ZS.bind(null,r)}),i.request.hook(a,i)},{endpoint:r,defaults:ZS.bind(null,r)})}var WT,Xz,e1,BT,bu,KS=A(()=>{OT();gu();WT=B(LT(),1);zT();VS();Xz="10.0.8",e1={headers:{"user-agent":`octokit-request.js/${Xz} ${ns()}`}};BT=()=>"";bu=ZS($T,e1);});function o1(e){return`Request failed due to following response errors:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.40.0",
3
+ "version": "3.40.1",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {