@sazabi/cli 1.0.0-dev.gab3436f → 1.0.0-dev.gfc8478e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,7 +102,7 @@ ${Bg("OPTIONS")}`,e+=`
|
|
|
102
102
|
|
|
103
103
|
`)}y.write("payload.value = newResult;"),y.write("return payload;");let $=y.compile();return(J,m)=>$(E,J,m)},Q,o=Oo,e=!lC.jitless,h=e&&du.value,C=t.catchall,c;A._zod.parse=(E,y)=>{c??(c=i.value);let a=E.value;if(!o(a))return E.issues.push({expected:"object",code:"invalid_type",input:a,inst:A}),E;if(e&&h&&y?.async===!1&&y.jitless!==!0){if(!Q)Q=n(t.shape);if(E=Q(E,y),!C)return E;return o2([],a,E,y,c,A)}return g(E,y)}});WC=k("$ZodUnion",(A,t)=>{lA.init(A,t),fA(A._zod,"optin",()=>t.options.some((n)=>n._zod.optin==="optional")?"optional":void 0),fA(A._zod,"optout",()=>t.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),fA(A._zod,"values",()=>{if(t.options.every((n)=>n._zod.values))return new Set(t.options.flatMap((n)=>Array.from(n._zod.values)));return}),fA(A._zod,"pattern",()=>{if(t.options.every((n)=>n._zod.pattern)){let n=t.options.map((Q)=>Q._zod.pattern);return new RegExp(`^(${n.map((Q)=>kC(Q.source)).join("|")})$`)}return});let g=t.options.length===1,i=t.options[0]._zod.run;A._zod.parse=(n,Q)=>{if(g)return i(n,Q);let o=!1,e=[];for(let B of t.options){let h=B._zod.run({value:n.value,issues:[]},Q);if(h instanceof Promise)e.push(h),o=!0;else{if(h.issues.length===0)return h;e.push(h)}}if(!o)return _1(e,n,A,Q);return Promise.all(e).then((B)=>{return _1(B,n,A,Q)})}});VF=k("$ZodXor",(A,t)=>{WC.init(A,t),t.inclusive=!1;let g=t.options.length===1,i=t.options[0]._zod.run;A._zod.parse=(n,Q)=>{if(g)return i(n,Q);let o=!1,e=[];for(let B of t.options){let h=B._zod.run({value:n.value,issues:[]},Q);if(h instanceof Promise)e.push(h),o=!0;else e.push(h)}if(!o)return m1(e,n,A,Q);return Promise.all(e).then((B)=>{return m1(B,n,A,Q)})}}),XF=k("$ZodDiscriminatedUnion",(A,t)=>{t.inclusive=!1,WC.init(A,t);let g=A._zod.parse;fA(A._zod,"propValues",()=>{let n={};for(let Q of t.options){let o=Q._zod.propValues;if(!o||Object.keys(o).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(Q)}"`);for(let[e,B]of Object.entries(o)){if(!n[e])n[e]=new Set;for(let h of B)n[e].add(h)}}return n});let i=Ee(()=>{let n=t.options,Q=new Map;for(let o of n){let e=o._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let B of e){if(Q.has(B))throw Error(`Duplicate discriminator value "${String(B)}"`);Q.set(B,o)}}return Q});A._zod.parse=(n,Q)=>{let o=n.value;if(!Oo(o))return n.issues.push({code:"invalid_type",expected:"object",input:o,inst:A}),n;let e=i.value.get(o?.[t.discriminator]);if(e)return e._zod.run(n,Q);if(t.unionFallback)return g(n,Q);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:A}),n}}),HF=k("$ZodIntersection",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value,Q=t.left._zod.run({value:n,issues:[]},i),o=t.right._zod.run({value:n,issues:[]},i);if(Q instanceof Promise||o instanceof Promise)return Promise.all([Q,o]).then(([B,h])=>{return x1(g,B,h)});return x1(g,Q,o)}});VD=k("$ZodTuple",(A,t)=>{lA.init(A,t);let g=t.items;A._zod.parse=(i,n)=>{let Q=i.value;if(!Array.isArray(Q))return i.issues.push({input:Q,inst:A,expected:"tuple",code:"invalid_type"}),i;i.value=[];let o=[],e=[...g].reverse().findIndex((C)=>C._zod.optin!=="optional"),B=e===-1?0:g.length-e;if(!t.rest){let C=Q.length>g.length,c=Q.length<B-1;if(C||c)return i.issues.push({...C?{code:"too_big",maximum:g.length,inclusive:!0}:{code:"too_small",minimum:g.length},input:Q,inst:A,origin:"array"}),i}let h=-1;for(let C of g){if(h++,h>=Q.length){if(h>=B)continue}let c=C._zod.run({value:Q[h],issues:[]},n);if(c instanceof Promise)o.push(c.then((E)=>fD(E,i,h)));else fD(c,i,h)}if(t.rest){let C=Q.slice(g.length);for(let c of C){h++;let E=t.rest._zod.run({value:c,issues:[]},n);if(E instanceof Promise)o.push(E.then((y)=>fD(y,i,h)));else fD(E,i,h)}}if(o.length)return Promise.all(o).then(()=>i);return i}});KF=k("$ZodRecord",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(!kQ(n))return g.issues.push({expected:"record",code:"invalid_type",input:n,inst:A}),g;let Q=[],o=t.keyType._zod.values;if(o){g.value={};let e=new Set;for(let h of o)if(typeof h==="string"||typeof h==="number"||typeof h==="symbol"){e.add(typeof h==="number"?h.toString():h);let C=t.valueType._zod.run({value:n[h],issues:[]},i);if(C instanceof Promise)Q.push(C.then((c)=>{if(c.issues.length)g.issues.push(...tn(h,c.issues));g.value[h]=c.value}));else{if(C.issues.length)g.issues.push(...tn(h,C.issues));g.value[h]=C.value}}let B;for(let h in n)if(!e.has(h))B=B??[],B.push(h);if(B&&B.length>0)g.issues.push({code:"unrecognized_keys",input:n,inst:A,keys:B})}else{g.value={};for(let e of Reflect.ownKeys(n)){if(e==="__proto__")continue;let B=t.keyType._zod.run({value:e,issues:[]},i);if(B instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof e==="string"&&zC.test(e)&&B.issues.length){let c=t.keyType._zod.run({value:Number(e),issues:[]},i);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(c.issues.length===0)B=c}if(B.issues.length){if(t.mode==="loose")g.value[e]=n[e];else g.issues.push({code:"invalid_key",origin:"record",issues:B.issues.map((c)=>Pg(c,i,$t())),input:e,path:[e],inst:A});continue}let C=t.valueType._zod.run({value:n[e],issues:[]},i);if(C instanceof Promise)Q.push(C.then((c)=>{if(c.issues.length)g.issues.push(...tn(e,c.issues));g.value[B.value]=c.value}));else{if(C.issues.length)g.issues.push(...tn(e,C.issues));g.value[B.value]=C.value}}}if(Q.length)return Promise.all(Q).then(()=>g);return g}}),jF=k("$ZodMap",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(!(n instanceof Map))return g.issues.push({expected:"map",code:"invalid_type",input:n,inst:A}),g;let Q=[];g.value=new Map;for(let[o,e]of n){let B=t.keyType._zod.run({value:o,issues:[]},i),h=t.valueType._zod.run({value:e,issues:[]},i);if(B instanceof Promise||h instanceof Promise)Q.push(Promise.all([B,h]).then(([C,c])=>{q1(C,c,g,o,n,A,i)}));else q1(B,h,g,o,n,A,i)}if(Q.length)return Promise.all(Q).then(()=>g);return g}});_F=k("$ZodSet",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(!(n instanceof Set))return g.issues.push({input:n,inst:A,expected:"set",code:"invalid_type"}),g;let Q=[];g.value=new Set;for(let o of n){let e=t.valueType._zod.run({value:o,issues:[]},i);if(e instanceof Promise)Q.push(e.then((B)=>d1(B,g)));else d1(e,g)}if(Q.length)return Promise.all(Q).then(()=>g);return g}});mF=k("$ZodEnum",(A,t)=>{lA.init(A,t);let g=$C(t.entries),i=new Set(g);A._zod.values=i,A._zod.pattern=new RegExp(`^(${g.filter((n)=>GC.has(typeof n)).map((n)=>typeof n==="string"?Nn(n):n.toString()).join("|")})$`),A._zod.parse=(n,Q)=>{let o=n.value;if(i.has(o))return n;return n.issues.push({code:"invalid_value",values:g,input:o,inst:A}),n}}),xF=k("$ZodLiteral",(A,t)=>{if(lA.init(A,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let g=new Set(t.values);A._zod.values=g,A._zod.pattern=new RegExp(`^(${t.values.map((i)=>typeof i==="string"?Nn(i):i?Nn(i.toString()):String(i)).join("|")})$`),A._zod.parse=(i,n)=>{let Q=i.value;if(g.has(Q))return i;return i.issues.push({code:"invalid_value",values:t.values,input:Q,inst:A}),i}}),qF=k("$ZodFile",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{let n=g.value;if(n instanceof File)return g;return g.issues.push({expected:"file",code:"invalid_type",input:n,inst:A}),g}}),dF=k("$ZodTransform",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new zo(A.constructor.name);let n=t.transform(g.value,g);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then((o)=>{return g.value=o,g});if(n instanceof Promise)throw new Ci;return g.value=n,g}});XD=k("$ZodOptional",(A,t)=>{lA.init(A,t),A._zod.optin="optional",A._zod.optout="optional",fA(A._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0}),fA(A._zod,"pattern",()=>{let g=t.innerType._zod.pattern;return g?new RegExp(`^(${kC(g.source)})?$`):void 0}),A._zod.parse=(g,i)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((Q)=>s1(Q,g.value));return s1(n,g.value)}if(g.value===void 0)return g;return t.innerType._zod.run(g,i)}}),sF=k("$ZodExactOptional",(A,t)=>{XD.init(A,t),fA(A._zod,"values",()=>t.innerType._zod.values),fA(A._zod,"pattern",()=>t.innerType._zod.pattern),A._zod.parse=(g,i)=>{return t.innerType._zod.run(g,i)}}),pF=k("$ZodNullable",(A,t)=>{lA.init(A,t),fA(A._zod,"optin",()=>t.innerType._zod.optin),fA(A._zod,"optout",()=>t.innerType._zod.optout),fA(A._zod,"pattern",()=>{let g=t.innerType._zod.pattern;return g?new RegExp(`^(${kC(g.source)}|null)$`):void 0}),fA(A._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0}),A._zod.parse=(g,i)=>{if(g.value===null)return g;return t.innerType._zod.run(g,i)}}),AL=k("$ZodDefault",(A,t)=>{lA.init(A,t),A._zod.optin="optional",fA(A._zod,"values",()=>t.innerType._zod.values),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);if(g.value===void 0)return g.value=t.defaultValue,g;let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((Q)=>p1(Q,t));return p1(n,t)}});tL=k("$ZodPrefault",(A,t)=>{lA.init(A,t),A._zod.optin="optional",fA(A._zod,"values",()=>t.innerType._zod.values),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);if(g.value===void 0)g.value=t.defaultValue;return t.innerType._zod.run(g,i)}}),gL=k("$ZodNonOptional",(A,t)=>{lA.init(A,t),fA(A._zod,"values",()=>{let g=t.innerType._zod.values;return g?new Set([...g].filter((i)=>i!==void 0)):void 0}),A._zod.parse=(g,i)=>{let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((Q)=>A2(Q,A));return A2(n,A)}});nL=k("$ZodSuccess",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new zo("ZodSuccess");let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((Q)=>{return g.value=Q.issues.length===0,g});return g.value=n.issues.length===0,g}}),iL=k("$ZodCatch",(A,t)=>{lA.init(A,t),fA(A._zod,"optin",()=>t.innerType._zod.optin),fA(A._zod,"optout",()=>t.innerType._zod.optout),fA(A._zod,"values",()=>t.innerType._zod.values),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then((Q)=>{if(g.value=Q.value,Q.issues.length)g.value=t.catchValue({...g,error:{issues:Q.issues.map((o)=>Pg(o,i,$t()))},input:g.value}),g.issues=[];return g});if(g.value=n.value,n.issues.length)g.value=t.catchValue({...g,error:{issues:n.issues.map((Q)=>Pg(Q,i,$t()))},input:g.value}),g.issues=[];return g}}),QL=k("$ZodNaN",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{if(typeof g.value!=="number"||!Number.isNaN(g.value))return g.issues.push({input:g.value,inst:A,expected:"nan",code:"invalid_type"}),g;return g}}),oL=k("$ZodPipe",(A,t)=>{lA.init(A,t),fA(A._zod,"values",()=>t.in._zod.values),fA(A._zod,"optin",()=>t.in._zod.optin),fA(A._zod,"optout",()=>t.out._zod.optout),fA(A._zod,"propValues",()=>t.in._zod.propValues),A._zod.parse=(g,i)=>{if(i.direction==="backward"){let Q=t.out._zod.run(g,i);if(Q instanceof Promise)return Q.then((o)=>PD(o,t.in,i));return PD(Q,t.in,i)}let n=t.in._zod.run(g,i);if(n instanceof Promise)return n.then((Q)=>PD(Q,t.out,i));return PD(n,t.out,i)}});VC=k("$ZodCodec",(A,t)=>{lA.init(A,t),fA(A._zod,"values",()=>t.in._zod.values),fA(A._zod,"optin",()=>t.in._zod.optin),fA(A._zod,"optout",()=>t.out._zod.optout),fA(A._zod,"propValues",()=>t.in._zod.propValues),A._zod.parse=(g,i)=>{if((i.direction||"forward")==="forward"){let Q=t.in._zod.run(g,i);if(Q instanceof Promise)return Q.then((o)=>zD(o,t,i));return zD(Q,t,i)}else{let Q=t.out._zod.run(g,i);if(Q instanceof Promise)return Q.then((o)=>zD(o,t,i));return zD(Q,t,i)}}});IL=k("$ZodReadonly",(A,t)=>{lA.init(A,t),fA(A._zod,"propValues",()=>t.innerType._zod.propValues),fA(A._zod,"values",()=>t.innerType._zod.values),fA(A._zod,"optin",()=>t.innerType?._zod?.optin),fA(A._zod,"optout",()=>t.innerType?._zod?.optout),A._zod.parse=(g,i)=>{if(i.direction==="backward")return t.innerType._zod.run(g,i);let n=t.innerType._zod.run(g,i);if(n instanceof Promise)return n.then(t2);return t2(n)}});eL=k("$ZodTemplateLiteral",(A,t)=>{lA.init(A,t);let g=[];for(let i of t.parts)if(typeof i==="object"&&i!==null){if(!i._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${i._zod.traits}`);let Q=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;g.push(n.slice(Q,o))}else if(i===null||pu.has(typeof i))g.push(Nn(`${i}`));else throw Error(`Invalid template literal part: ${i}`);A._zod.pattern=new RegExp(`^${g.join("")}$`),A._zod.parse=(i,n)=>{if(typeof i.value!=="string")return i.issues.push({input:i.value,inst:A,expected:"string",code:"invalid_type"}),i;if(A._zod.pattern.lastIndex=0,!A._zod.pattern.test(i.value))return i.issues.push({input:i.value,inst:A,code:"invalid_format",format:t.format??"template_literal",pattern:A._zod.pattern.source}),i;return i}}),BL=k("$ZodFunction",(A,t)=>{return lA.init(A,t),A._def=t,A._zod.def=t,A.implement=(g)=>{if(typeof g!=="function")throw Error("implement() must be called with a function");return function(...i){let n=A._def.input?bD(A._def.input,i):i,Q=Reflect.apply(g,this,n);if(A._def.output)return bD(A._def.output,Q);return Q}},A.implementAsync=(g)=>{if(typeof g!=="function")throw Error("implementAsync() must be called with a function");return async function(...i){let n=A._def.input?await ND(A._def.input,i):i,Q=await Reflect.apply(g,this,n);if(A._def.output)return await ND(A._def.output,Q);return Q}},A._zod.parse=(g,i)=>{if(typeof g.value!=="function")return g.issues.push({code:"invalid_type",expected:"function",input:g.value,inst:A}),g;if(A._def.output&&A._def.output._zod.def.type==="promise")g.value=A.implementAsync(g.value);else g.value=A.implement(g.value);return g},A.input=(...g)=>{let i=A.constructor;if(Array.isArray(g[0]))return new i({type:"function",input:new VD({type:"tuple",items:g[0],rest:g[1]}),output:A._def.output});return new i({type:"function",input:g[0],output:A._def.output})},A.output=(g)=>{return new A.constructor({type:"function",input:A._def.input,output:g})},A}),hL=k("$ZodPromise",(A,t)=>{lA.init(A,t),A._zod.parse=(g,i)=>{return Promise.resolve(g.value).then((n)=>t.innerType._zod.run({value:n,issues:[]},i))}}),CL=k("$ZodLazy",(A,t)=>{lA.init(A,t),fA(A._zod,"innerType",()=>t.getter()),fA(A._zod,"pattern",()=>A._zod.innerType?._zod?.pattern),fA(A._zod,"propValues",()=>A._zod.innerType?._zod?.propValues),fA(A._zod,"optin",()=>A._zod.innerType?._zod?.optin??void 0),fA(A._zod,"optout",()=>A._zod.innerType?._zod?.optout??void 0),A._zod.parse=(g,i)=>{return A._zod.innerType._zod.run(g,i)}}),cL=k("$ZodCustom",(A,t)=>{ht.init(A,t),lA.init(A,t),A._zod.parse=(g,i)=>{return g},A._zod.check=(g)=>{let i=g.value,n=t.fn(i);if(n instanceof Promise)return n.then((Q)=>g2(Q,g,i,A));g2(n,g,i,A);return}})});function yL(){return{localeError:qNA()}}var qNA=()=>{let A={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return A[n]??null}let g={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${e}`;return`مدخلات غير مقبولة: يفترض إدخال ${Q}، ولكن تم إدخال ${e}`}case"invalid_value":if(n.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${_(n.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${Q} ${n.maximum.toString()} ${o.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${Q} ${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${Q} ${n.minimum.toString()} ${o.unit}`;return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${Q} ${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`;if(Q.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${Q.suffix}"`;if(Q.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${Q.includes}"`;if(Q.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${Q.pattern}`;return`${g[Q.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${T(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};var e2=D(()=>{cA()});function DL(){return{localeError:dNA()}}var dNA=()=>{let A={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return A[n]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${e}`;return`Yanlış dəyər: gözlənilən ${Q}, daxil olan ${e}`}case"invalid_value":if(n.values.length===1)return`Yanlış dəyər: gözlənilən ${_(n.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${Q}${n.maximum.toString()} ${o.unit??"element"}`;return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Çox kiçik: gözlənilən ${n.origin} ${Q}${n.minimum.toString()} ${o.unit}`;return`Çox kiçik: gözlənilən ${n.origin} ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Yanlış mətn: "${Q.prefix}" ilə başlamalıdır`;if(Q.format==="ends_with")return`Yanlış mətn: "${Q.suffix}" ilə bitməlidir`;if(Q.format==="includes")return`Yanlış mətn: "${Q.includes}" daxil olmalıdır`;if(Q.format==="regex")return`Yanlış mətn: ${Q.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${g[Q.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var B2=D(()=>{cA()});function h2(A,t,g,i){let n=Math.abs(A),Q=n%10,o=n%100;if(o>=11&&o<=19)return i;if(Q===1)return t;if(Q>=2&&Q<=4)return g;return i}function aL(){return{localeError:sNA()}}var sNA=()=>{let A={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return A[n]??null}let g={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},i={nan:"NaN",number:"лік",array:"масіў"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Няправільны ўвод: чакаўся instanceof ${n.expected}, атрымана ${e}`;return`Няправільны ўвод: чакаўся ${Q}, атрымана ${e}`}case"invalid_value":if(n.values.length===1)return`Няправільны ўвод: чакалася ${_(n.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o){let e=Number(n.maximum),B=h2(e,o.unit.one,o.unit.few,o.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${o.verb} ${Q}${n.maximum.toString()} ${B}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o){let e=Number(n.minimum),B=h2(e,o.unit.one,o.unit.few,o.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${o.verb} ${Q}${n.minimum.toString()} ${B}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${Q.prefix}"`;if(Q.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${Q.suffix}"`;if(Q.format==="includes")return`Няправільны радок: павінен змяшчаць "${Q.includes}"`;if(Q.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${Q.pattern}`;return`Няправільны ${g[Q.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${T(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};var C2=D(()=>{cA()});function wL(){return{localeError:pNA()}}var pNA=()=>{let A={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(n){return A[n]??null}let g={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},i={nan:"NaN",number:"число",array:"масив"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Невалиден вход: очакван instanceof ${n.expected}, получен ${e}`;return`Невалиден вход: очакван ${Q}, получен ${e}`}case"invalid_value":if(n.values.length===1)return`Невалиден вход: очакван ${_(n.values[0])}`;return`Невалидна опция: очаквано едно от ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${Q}${n.maximum.toString()} ${o.unit??"елемента"}`;return`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Твърде малко: очаква се ${n.origin} да съдържа ${Q}${n.minimum.toString()} ${o.unit}`;return`Твърде малко: очаква се ${n.origin} да бъде ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Невалиден низ: трябва да започва с "${Q.prefix}"`;if(Q.format==="ends_with")return`Невалиден низ: трябва да завършва с "${Q.suffix}"`;if(Q.format==="includes")return`Невалиден низ: трябва да включва "${Q.includes}"`;if(Q.format==="regex")return`Невалиден низ: трябва да съвпада с ${Q.pattern}`;let o="Невалиден";if(Q.format==="emoji")o="Невалидно";if(Q.format==="datetime")o="Невалидно";if(Q.format==="date")o="Невалидна";if(Q.format==="time")o="Невалидно";if(Q.format==="duration")o="Невалидна";return`${o} ${g[Q.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};var c2=D(()=>{cA()});function rL(){return{localeError:AuA()}}var AuA=()=>{let A={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return A[n]??null}let g={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${e}`;return`Tipus invàlid: s'esperava ${Q}, s'ha rebut ${e}`}case"invalid_value":if(n.values.length===1)return`Valor invàlid: s'esperava ${_(n.values[0])}`;return`Opció invàlida: s'esperava una de ${T(n.values," o ")}`;case"too_big":{let Q=n.inclusive?"com a màxim":"menys de",o=t(n.origin);if(o)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${Q} ${n.maximum.toString()} ${o.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${Q} ${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?"com a mínim":"més de",o=t(n.origin);if(o)return`Massa petit: s'esperava que ${n.origin} contingués ${Q} ${n.minimum.toString()} ${o.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${Q} ${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Format invàlid: ha de començar amb "${Q.prefix}"`;if(Q.format==="ends_with")return`Format invàlid: ha d'acabar amb "${Q.suffix}"`;if(Q.format==="includes")return`Format invàlid: ha d'incloure "${Q.includes}"`;if(Q.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${Q.pattern}`;return`Format invàlid per a ${g[Q.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};var E2=D(()=>{cA()});function bL(){return{localeError:tuA()}}var tuA=()=>{let A={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return A[n]??null}let g={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${e}`;return`Neplatný vstup: očekáváno ${Q}, obdrženo ${e}`}case"invalid_value":if(n.values.length===1)return`Neplatný vstup: očekáváno ${_(n.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${Q}${n.maximum.toString()} ${o.unit??"prvků"}`;return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${Q}${n.minimum.toString()} ${o.unit??"prvků"}`;return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Neplatný řetězec: musí začínat na "${Q.prefix}"`;if(Q.format==="ends_with")return`Neplatný řetězec: musí končit na "${Q.suffix}"`;if(Q.format==="includes")return`Neplatný řetězec: musí obsahovat "${Q.includes}"`;if(Q.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${Q.pattern}`;return`Neplatný formát ${g[Q.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${T(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};var y2=D(()=>{cA()});function NL(){return{localeError:guA()}}var guA=()=>{let A={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return A[n]??null}let g={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Ugyldigt input: forventede instanceof ${n.expected}, fik ${e}`;return`Ugyldigt input: forventede ${Q}, fik ${e}`}case"invalid_value":if(n.values.length===1)return`Ugyldig værdi: forventede ${_(n.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin),e=i[n.origin]??n.origin;if(o)return`For stor: forventede ${e??"value"} ${o.verb} ${Q} ${n.maximum.toString()} ${o.unit??"elementer"}`;return`For stor: forventede ${e??"value"} havde ${Q} ${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin),e=i[n.origin]??n.origin;if(o)return`For lille: forventede ${e} ${o.verb} ${Q} ${n.minimum.toString()} ${o.unit}`;return`For lille: forventede ${e} havde ${Q} ${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Ugyldig streng: skal starte med "${Q.prefix}"`;if(Q.format==="ends_with")return`Ugyldig streng: skal ende med "${Q.suffix}"`;if(Q.format==="includes")return`Ugyldig streng: skal indeholde "${Q.includes}"`;if(Q.format==="regex")return`Ugyldig streng: skal matche mønsteret ${Q.pattern}`;return`Ugyldig ${g[Q.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};var D2=D(()=>{cA()});function uL(){return{localeError:nuA()}}var nuA=()=>{let A={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return A[n]??null}let g={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${e}`;return`Ungültige Eingabe: erwartet ${Q}, erhalten ${e}`}case"invalid_value":if(n.values.length===1)return`Ungültige Eingabe: erwartet ${_(n.values[0])}`;return`Ungültige Option: erwartet eine von ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${Q}${n.maximum.toString()} ${o.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${Q}${n.maximum.toString()} ist`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Zu klein: erwartet, dass ${n.origin} ${Q}${n.minimum.toString()} ${o.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${Q}${n.minimum.toString()} ist`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Ungültiger String: muss mit "${Q.prefix}" beginnen`;if(Q.format==="ends_with")return`Ungültiger String: muss mit "${Q.suffix}" enden`;if(Q.format==="includes")return`Ungültiger String: muss "${Q.includes}" enthalten`;if(Q.format==="regex")return`Ungültiger String: muss dem Muster ${Q.pattern} entsprechen`;return`Ungültig: ${g[Q.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};var a2=D(()=>{cA()});function XC(){return{localeError:iuA()}}var iuA=()=>{let A={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return A[n]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;return`Invalid input: expected ${Q}, received ${e}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${_(n.values[0])}`;return`Invalid option: expected one of ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Too big: expected ${n.origin??"value"} to have ${Q}${n.maximum.toString()} ${o.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Too small: expected ${n.origin} to have ${Q}${n.minimum.toString()} ${o.unit}`;return`Too small: expected ${n.origin} to be ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Invalid string: must start with "${Q.prefix}"`;if(Q.format==="ends_with")return`Invalid string: must end with "${Q.suffix}"`;if(Q.format==="includes")return`Invalid string: must include "${Q.includes}"`;if(Q.format==="regex")return`Invalid string: must match pattern ${Q.pattern}`;return`Invalid ${g[Q.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};var UL=D(()=>{cA()});function FL(){return{localeError:QuA()}}var QuA=()=>{let A={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return A[n]??null}let g={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${e}`;return`Nevalida enigo: atendiĝis ${Q}, riceviĝis ${e}`}case"invalid_value":if(n.values.length===1)return`Nevalida enigo: atendiĝis ${_(n.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${Q}${n.maximum.toString()} ${o.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Tro malgranda: atendiĝis ke ${n.origin} havu ${Q}${n.minimum.toString()} ${o.unit}`;return`Tro malgranda: atendiĝis ke ${n.origin} estu ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${Q.prefix}"`;if(Q.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${Q.suffix}"`;if(Q.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${Q.includes}"`;if(Q.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${Q.pattern}`;return`Nevalida ${g[Q.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};var w2=D(()=>{cA()});function LL(){return{localeError:ouA()}}var ouA=()=>{let A={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return A[n]??null}let g={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${e}`;return`Entrada inválida: se esperaba ${Q}, recibido ${e}`}case"invalid_value":if(n.values.length===1)return`Entrada inválida: se esperaba ${_(n.values[0])}`;return`Opción inválida: se esperaba una de ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin),e=i[n.origin]??n.origin;if(o)return`Demasiado grande: se esperaba que ${e??"valor"} tuviera ${Q}${n.maximum.toString()} ${o.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${e??"valor"} fuera ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin),e=i[n.origin]??n.origin;if(o)return`Demasiado pequeño: se esperaba que ${e} tuviera ${Q}${n.minimum.toString()} ${o.unit}`;return`Demasiado pequeño: se esperaba que ${e} fuera ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Cadena inválida: debe comenzar con "${Q.prefix}"`;if(Q.format==="ends_with")return`Cadena inválida: debe terminar en "${Q.suffix}"`;if(Q.format==="includes")return`Cadena inválida: debe incluir "${Q.includes}"`;if(Q.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${Q.pattern}`;return`Inválido ${g[Q.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${i[n.origin]??n.origin}`;default:return"Entrada inválida"}}};var r2=D(()=>{cA()});function SL(){return{localeError:IuA()}}var IuA=()=>{let A={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return A[n]??null}let g={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},i={nan:"NaN",number:"عدد",array:"آرایه"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`ورودی نامعتبر: میبایست instanceof ${n.expected} میبود، ${e} دریافت شد`;return`ورودی نامعتبر: میبایست ${Q} میبود، ${e} دریافت شد`}case"invalid_value":if(n.values.length===1)return`ورودی نامعتبر: میبایست ${_(n.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${T(n.values,"|")} میبود`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${Q}${n.maximum.toString()} ${o.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${Q}${n.maximum.toString()} باشد`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`خیلی کوچک: ${n.origin} باید ${Q}${n.minimum.toString()} ${o.unit} باشد`;return`خیلی کوچک: ${n.origin} باید ${Q}${n.minimum.toString()} باشد`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`رشته نامعتبر: باید با "${Q.prefix}" شروع شود`;if(Q.format==="ends_with")return`رشته نامعتبر: باید با "${Q.suffix}" تمام شود`;if(Q.format==="includes")return`رشته نامعتبر: باید شامل "${Q.includes}" باشد`;if(Q.format==="regex")return`رشته نامعتبر: باید با الگوی ${Q.pattern} مطابقت داشته باشد`;return`${g[Q.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${T(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};var b2=D(()=>{cA()});function lL(){return{localeError:euA()}}var euA=()=>{let A={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return A[n]??null}let g={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${e}`;return`Virheellinen tyyppi: odotettiin ${Q}, oli ${e}`}case"invalid_value":if(n.values.length===1)return`Virheellinen syöte: täytyy olla ${_(n.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Liian suuri: ${o.subject} täytyy olla ${Q}${n.maximum.toString()} ${o.unit}`.trim();return`Liian suuri: arvon täytyy olla ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Liian pieni: ${o.subject} täytyy olla ${Q}${n.minimum.toString()} ${o.unit}`.trim();return`Liian pieni: arvon täytyy olla ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${Q.prefix}"`;if(Q.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${Q.suffix}"`;if(Q.format==="includes")return`Virheellinen syöte: täytyy sisältää "${Q.includes}"`;if(Q.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${Q.pattern}`;return`Virheellinen ${g[Q.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${T(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};var N2=D(()=>{cA()});function ML(){return{localeError:BuA()}}var BuA=()=>{let A={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return A[n]??null}let g={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN",number:"nombre",array:"tableau"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Entrée invalide : instanceof ${n.expected} attendu, ${e} reçu`;return`Entrée invalide : ${Q} attendu, ${e} reçu`}case"invalid_value":if(n.values.length===1)return`Entrée invalide : ${_(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${T(n.values,"|")} attendue`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Trop grand : ${n.origin??"valeur"} doit ${o.verb} ${Q}${n.maximum.toString()} ${o.unit??"élément(s)"}`;return`Trop grand : ${n.origin??"valeur"} doit être ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Trop petit : ${n.origin} doit ${o.verb} ${Q}${n.minimum.toString()} ${o.unit}`;return`Trop petit : ${n.origin} doit être ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Chaîne invalide : doit commencer par "${Q.prefix}"`;if(Q.format==="ends_with")return`Chaîne invalide : doit se terminer par "${Q.suffix}"`;if(Q.format==="includes")return`Chaîne invalide : doit inclure "${Q.includes}"`;if(Q.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${Q.pattern}`;return`${g[Q.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};var u2=D(()=>{cA()});function YL(){return{localeError:huA()}}var huA=()=>{let A={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return A[n]??null}let g={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Entrée invalide : attendu instanceof ${n.expected}, reçu ${e}`;return`Entrée invalide : attendu ${Q}, reçu ${e}`}case"invalid_value":if(n.values.length===1)return`Entrée invalide : attendu ${_(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"≤":"<",o=t(n.origin);if(o)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${Q}${n.maximum.toString()} ${o.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?"≥":">",o=t(n.origin);if(o)return`Trop petit : attendu que ${n.origin} ait ${Q}${n.minimum.toString()} ${o.unit}`;return`Trop petit : attendu que ${n.origin} soit ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Chaîne invalide : doit commencer par "${Q.prefix}"`;if(Q.format==="ends_with")return`Chaîne invalide : doit se terminer par "${Q.suffix}"`;if(Q.format==="includes")return`Chaîne invalide : doit inclure "${Q.includes}"`;if(Q.format==="regex")return`Chaîne invalide : doit correspondre au motif ${Q.pattern}`;return`${g[Q.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};var U2=D(()=>{cA()});function $L(){return{localeError:CuA()}}var CuA=()=>{let A={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},g=(h)=>h?A[h]:void 0,i=(h)=>{let C=g(h);if(C)return C.label;return h??A.unknown.label},n=(h)=>`ה${i(h)}`,Q=(h)=>{return(g(h)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},o=(h)=>{if(!h)return null;return t[h]??null},e={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},B={nan:"NaN"};return(h)=>{switch(h.code){case"invalid_type":{let C=h.expected,c=B[C??""]??i(C),E=x(h.input),y=B[E]??A[E]?.label??E;if(/^[A-Z]/.test(h.expected))return`קלט לא תקין: צריך להיות instanceof ${h.expected}, התקבל ${y}`;return`קלט לא תקין: צריך להיות ${c}, התקבל ${y}`}case"invalid_value":{if(h.values.length===1)return`ערך לא תקין: הערך חייב להיות ${_(h.values[0])}`;let C=h.values.map((y)=>_(y));if(h.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${C[0]} או ${C[1]}`;let c=C[C.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${C.slice(0,-1).join(", ")} או ${c}`}case"too_big":{let C=o(h.origin),c=n(h.origin??"value");if(h.origin==="string")return`${C?.longLabel??"ארוך"} מדי: ${c} צריכה להכיל ${h.maximum.toString()} ${C?.unit??""} ${h.inclusive?"או פחות":"לכל היותר"}`.trim();if(h.origin==="number"){let a=h.inclusive?`קטן או שווה ל-${h.maximum}`:`קטן מ-${h.maximum}`;return`גדול מדי: ${c} צריך להיות ${a}`}if(h.origin==="array"||h.origin==="set"){let a=h.origin==="set"?"צריכה":"צריך",w=h.inclusive?`${h.maximum} ${C?.unit??""} או פחות`:`פחות מ-${h.maximum} ${C?.unit??""}`;return`גדול מדי: ${c} ${a} להכיל ${w}`.trim()}let E=h.inclusive?"<=":"<",y=Q(h.origin??"value");if(C?.unit)return`${C.longLabel} מדי: ${c} ${y} ${E}${h.maximum.toString()} ${C.unit}`;return`${C?.longLabel??"גדול"} מדי: ${c} ${y} ${E}${h.maximum.toString()}`}case"too_small":{let C=o(h.origin),c=n(h.origin??"value");if(h.origin==="string")return`${C?.shortLabel??"קצר"} מדי: ${c} צריכה להכיל ${h.minimum.toString()} ${C?.unit??""} ${h.inclusive?"או יותר":"לפחות"}`.trim();if(h.origin==="number"){let a=h.inclusive?`גדול או שווה ל-${h.minimum}`:`גדול מ-${h.minimum}`;return`קטן מדי: ${c} צריך להיות ${a}`}if(h.origin==="array"||h.origin==="set"){let a=h.origin==="set"?"צריכה":"צריך";if(h.minimum===1&&h.inclusive){let u=h.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${c} ${a} להכיל ${u}`}let w=h.inclusive?`${h.minimum} ${C?.unit??""} או יותר`:`יותר מ-${h.minimum} ${C?.unit??""}`;return`קטן מדי: ${c} ${a} להכיל ${w}`.trim()}let E=h.inclusive?">=":">",y=Q(h.origin??"value");if(C?.unit)return`${C.shortLabel} מדי: ${c} ${y} ${E}${h.minimum.toString()} ${C.unit}`;return`${C?.shortLabel??"קטן"} מדי: ${c} ${y} ${E}${h.minimum.toString()}`}case"invalid_format":{let C=h;if(C.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${C.prefix}"`;if(C.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${C.suffix}"`;if(C.format==="includes")return`המחרוזת חייבת לכלול "${C.includes}"`;if(C.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${C.pattern}`;let c=e[C.format],E=c?.label??C.format,a=(c?.gender??"m")==="f"?"תקינה":"תקין";return`${E} לא ${a}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${h.divisor}`;case"unrecognized_keys":return`מפתח${h.keys.length>1?"ות":""} לא מזוה${h.keys.length>1?"ים":"ה"}: ${T(h.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(h.origin??"array")}`;default:return"קלט לא תקין"}}};var F2=D(()=>{cA()});function kL(){return{localeError:cuA()}}var cuA=()=>{let A={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return A[n]??null}let g={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"szám",array:"tömb"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${e}`;return`Érvénytelen bemenet: a várt érték ${Q}, a kapott érték ${e}`}case"invalid_value":if(n.values.length===1)return`Érvénytelen bemenet: a várt érték ${_(n.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${Q}${n.maximum.toString()} ${o.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${Q}${n.minimum.toString()} ${o.unit}`;return`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Érvénytelen string: "${Q.prefix}" értékkel kell kezdődnie`;if(Q.format==="ends_with")return`Érvénytelen string: "${Q.suffix}" értékkel kell végződnie`;if(Q.format==="includes")return`Érvénytelen string: "${Q.includes}" értéket kell tartalmaznia`;if(Q.format==="regex")return`Érvénytelen string: ${Q.pattern} mintának kell megfelelnie`;return`Érvénytelen ${g[Q.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};var L2=D(()=>{cA()});function S2(A,t,g){return Math.abs(A)===1?t:g}function Ne(A){if(!A)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],g=A[A.length-1];return A+(t.includes(g)?"ն":"ը")}function GL(){return{localeError:EuA()}}var EuA=()=>{let A={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(n){return A[n]??null}let g={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},i={nan:"NaN",number:"թիվ",array:"զանգված"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${n.expected}, ստացվել է ${e}`;return`Սխալ մուտքագրում․ սպասվում էր ${Q}, ստացվել է ${e}`}case"invalid_value":if(n.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${_(n.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o){let e=Number(n.maximum),B=S2(e,o.unit.one,o.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ne(n.origin??"արժեք")} կունենա ${Q}${n.maximum.toString()} ${B}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ne(n.origin??"արժեք")} լինի ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o){let e=Number(n.minimum),B=S2(e,o.unit.one,o.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ne(n.origin)} կունենա ${Q}${n.minimum.toString()} ${B}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ne(n.origin)} լինի ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${Q.prefix}"-ով`;if(Q.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${Q.suffix}"-ով`;if(Q.format==="includes")return`Սխալ տող․ պետք է պարունակի "${Q.includes}"`;if(Q.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${Q.pattern} ձևաչափին`;return`Սխալ ${g[Q.format]??n.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${n.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${n.keys.length>1?"ներ":""}. ${T(n.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Ne(n.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Ne(n.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};var l2=D(()=>{cA()});function JL(){return{localeError:yuA()}}var yuA=()=>{let A={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return A[n]??null}let g={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${e}`;return`Input tidak valid: diharapkan ${Q}, diterima ${e}`}case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${_(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${Q}${n.maximum.toString()} ${o.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${Q}${n.minimum.toString()} ${o.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`String tidak valid: harus dimulai dengan "${Q.prefix}"`;if(Q.format==="ends_with")return`String tidak valid: harus berakhir dengan "${Q.suffix}"`;if(Q.format==="includes")return`String tidak valid: harus menyertakan "${Q.includes}"`;if(Q.format==="regex")return`String tidak valid: harus sesuai pola ${Q.pattern}`;return`${g[Q.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};var M2=D(()=>{cA()});function TL(){return{localeError:DuA()}}var DuA=()=>{let A={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(n){return A[n]??null}let g={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"númer",array:"fylki"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Rangt gildi: Þú slóst inn ${e} þar sem á að vera instanceof ${n.expected}`;return`Rangt gildi: Þú slóst inn ${e} þar sem á að vera ${Q}`}case"invalid_value":if(n.values.length===1)return`Rangt gildi: gert ráð fyrir ${_(n.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${Q}${n.maximum.toString()} ${o.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${Q}${n.minimum.toString()} ${o.unit}`;return`Of lítið: gert er ráð fyrir að ${n.origin} sé ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Ógildur strengur: verður að byrja á "${Q.prefix}"`;if(Q.format==="ends_with")return`Ógildur strengur: verður að enda á "${Q.suffix}"`;if(Q.format==="includes")return`Ógildur strengur: verður að innihalda "${Q.includes}"`;if(Q.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${Q.pattern}`;return`Rangt ${g[Q.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${T(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};var Y2=D(()=>{cA()});function RL(){return{localeError:auA()}}var auA=()=>{let A={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return A[n]??null}let g={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Input non valido: atteso instanceof ${n.expected}, ricevuto ${e}`;return`Input non valido: atteso ${Q}, ricevuto ${e}`}case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${_(n.values[0])}`;return`Opzione non valida: atteso uno tra ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Troppo grande: ${n.origin??"valore"} deve avere ${Q}${n.maximum.toString()} ${o.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Troppo piccolo: ${n.origin} deve avere ${Q}${n.minimum.toString()} ${o.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Stringa non valida: deve iniziare con "${Q.prefix}"`;if(Q.format==="ends_with")return`Stringa non valida: deve terminare con "${Q.suffix}"`;if(Q.format==="includes")return`Stringa non valida: deve includere "${Q.includes}"`;if(Q.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${Q.pattern}`;return`Invalid ${g[Q.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${T(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};var $2=D(()=>{cA()});function fL(){return{localeError:wuA()}}var wuA=()=>{let A={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return A[n]??null}let g={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},i={nan:"NaN",number:"数値",array:"配列"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`無効な入力: instanceof ${n.expected}が期待されましたが、${e}が入力されました`;return`無効な入力: ${Q}が期待されましたが、${e}が入力されました`}case"invalid_value":if(n.values.length===1)return`無効な入力: ${_(n.values[0])}が期待されました`;return`無効な選択: ${T(n.values,"、")}のいずれかである必要があります`;case"too_big":{let Q=n.inclusive?"以下である":"より小さい",o=t(n.origin);if(o)return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o.unit??"要素"}${Q}必要があります`;return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${Q}必要があります`}case"too_small":{let Q=n.inclusive?"以上である":"より大きい",o=t(n.origin);if(o)return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o.unit}${Q}必要があります`;return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${Q}必要があります`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`無効な文字列: "${Q.prefix}"で始まる必要があります`;if(Q.format==="ends_with")return`無効な文字列: "${Q.suffix}"で終わる必要があります`;if(Q.format==="includes")return`無効な文字列: "${Q.includes}"を含む必要があります`;if(Q.format==="regex")return`無効な文字列: パターン${Q.pattern}に一致する必要があります`;return`無効な${g[Q.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${T(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};var k2=D(()=>{cA()});function PL(){return{localeError:ruA()}}var ruA=()=>{let A={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(n){return A[n]??null}let g={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},i={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${e}`;return`არასწორი შეყვანა: მოსალოდნელი ${Q}, მიღებული ${e}`}case"invalid_value":if(n.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${_(n.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${T(n.values,"|")}-დან`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${o.verb} ${Q}${n.maximum.toString()} ${o.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${o.verb} ${Q}${n.minimum.toString()} ${o.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${Q.prefix}"-ით`;if(Q.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${Q.suffix}"-ით`;if(Q.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${Q.includes}"-ს`;if(Q.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${Q.pattern}`;return`არასწორი ${g[Q.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${T(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};var G2=D(()=>{cA()});function HC(){return{localeError:buA()}}var buA=()=>{let A={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return A[n]??null}let g={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},i={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${e}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Q} ប៉ុន្តែទទួលបាន ${e}`}case"invalid_value":if(n.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${_(n.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${Q} ${n.maximum.toString()} ${o.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${Q} ${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`តូចពេក៖ ត្រូវការ ${n.origin} ${Q} ${n.minimum.toString()} ${o.unit}`;return`តូចពេក៖ ត្រូវការ ${n.origin} ${Q} ${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${Q.prefix}"`;if(Q.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${Q.suffix}"`;if(Q.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${Q.includes}"`;if(Q.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${Q.pattern}`;return`មិនត្រឹមត្រូវ៖ ${g[Q.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${T(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var zL=D(()=>{cA()});function OL(){return HC()}var J2=D(()=>{zL()});function vL(){return{localeError:NuA()}}var NuA=()=>{let A={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return A[n]??null}let g={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${e}입니다`;return`잘못된 입력: 예상 타입은 ${Q}, 받은 타입은 ${e}입니다`}case"invalid_value":if(n.values.length===1)return`잘못된 입력: 값은 ${_(n.values[0])} 이어야 합니다`;return`잘못된 옵션: ${T(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let Q=n.inclusive?"이하":"미만",o=Q==="미만"?"이어야 합니다":"여야 합니다",e=t(n.origin),B=e?.unit??"요소";if(e)return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${B} ${Q}${o}`;return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${Q}${o}`}case"too_small":{let Q=n.inclusive?"이상":"초과",o=Q==="이상"?"이어야 합니다":"여야 합니다",e=t(n.origin),B=e?.unit??"요소";if(e)return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${B} ${Q}${o}`;return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${Q}${o}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`잘못된 문자열: "${Q.prefix}"(으)로 시작해야 합니다`;if(Q.format==="ends_with")return`잘못된 문자열: "${Q.suffix}"(으)로 끝나야 합니다`;if(Q.format==="includes")return`잘못된 문자열: "${Q.includes}"을(를) 포함해야 합니다`;if(Q.format==="regex")return`잘못된 문자열: 정규식 ${Q.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${g[Q.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${T(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};var T2=D(()=>{cA()});function R2(A){let t=Math.abs(A),g=t%10,i=t%100;if(i>=11&&i<=19||g===0)return"many";if(g===1)return"one";return"few"}function ZL(){return{localeError:uuA()}}var KC=(A)=>{return A.charAt(0).toUpperCase()+A.slice(1)},uuA=()=>{let A={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(n,Q,o,e){let B=A[n]??null;if(B===null)return B;return{unit:B.unit[Q],verb:B.verb[e][o?"inclusive":"notInclusive"]}}let g={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},i={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Gautas tipas ${e}, o tikėtasi - instanceof ${n.expected}`;return`Gautas tipas ${e}, o tikėtasi - ${Q}`}case"invalid_value":if(n.values.length===1)return`Privalo būti ${_(n.values[0])}`;return`Privalo būti vienas iš ${T(n.values,"|")} pasirinkimų`;case"too_big":{let Q=i[n.origin]??n.origin,o=t(n.origin,R2(Number(n.maximum)),n.inclusive??!1,"smaller");if(o?.verb)return`${KC(Q??n.origin??"reikšmė")} ${o.verb} ${n.maximum.toString()} ${o.unit??"elementų"}`;let e=n.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${KC(Q??n.origin??"reikšmė")} turi būti ${e} ${n.maximum.toString()} ${o?.unit}`}case"too_small":{let Q=i[n.origin]??n.origin,o=t(n.origin,R2(Number(n.minimum)),n.inclusive??!1,"bigger");if(o?.verb)return`${KC(Q??n.origin??"reikšmė")} ${o.verb} ${n.minimum.toString()} ${o.unit??"elementų"}`;let e=n.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${KC(Q??n.origin??"reikšmė")} turi būti ${e} ${n.minimum.toString()} ${o?.unit}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Eilutė privalo prasidėti "${Q.prefix}"`;if(Q.format==="ends_with")return`Eilutė privalo pasibaigti "${Q.suffix}"`;if(Q.format==="includes")return`Eilutė privalo įtraukti "${Q.includes}"`;if(Q.format==="regex")return`Eilutė privalo atitikti ${Q.pattern}`;return`Neteisingas ${g[Q.format]??n.format}`}case"not_multiple_of":return`Skaičius privalo būti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${T(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let Q=i[n.origin]??n.origin;return`${KC(Q??n.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var f2=D(()=>{cA()});function WL(){return{localeError:UuA()}}var UuA=()=>{let A={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return A[n]??null}let g={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},i={nan:"NaN",number:"број",array:"низа"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Грешен внес: се очекува instanceof ${n.expected}, примено ${e}`;return`Грешен внес: се очекува ${Q}, примено ${e}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${_(n.values[0])}`;return`Грешана опција: се очекува една ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${Q}${n.maximum.toString()} ${o.unit??"елементи"}`;return`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Премногу мал: се очекува ${n.origin} да има ${Q}${n.minimum.toString()} ${o.unit}`;return`Премногу мал: се очекува ${n.origin} да биде ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Неважечка низа: мора да започнува со "${Q.prefix}"`;if(Q.format==="ends_with")return`Неважечка низа: мора да завршува со "${Q.suffix}"`;if(Q.format==="includes")return`Неважечка низа: мора да вклучува "${Q.includes}"`;if(Q.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${Q.pattern}`;return`Invalid ${g[Q.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${T(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};var P2=D(()=>{cA()});function VL(){return{localeError:FuA()}}var FuA=()=>{let A={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return A[n]??null}let g={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${e}`;return`Input tidak sah: dijangka ${Q}, diterima ${e}`}case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${_(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${o.verb} ${Q}${n.maximum.toString()} ${o.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Terlalu kecil: dijangka ${n.origin} ${o.verb} ${Q}${n.minimum.toString()} ${o.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`String tidak sah: mesti bermula dengan "${Q.prefix}"`;if(Q.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${Q.suffix}"`;if(Q.format==="includes")return`String tidak sah: mesti mengandungi "${Q.includes}"`;if(Q.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${Q.pattern}`;return`${g[Q.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};var z2=D(()=>{cA()});function XL(){return{localeError:LuA()}}var LuA=()=>{let A={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return A[n]??null}let g={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${e}`;return`Ongeldige invoer: verwacht ${Q}, ontving ${e}`}case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${_(n.values[0])}`;return`Ongeldige optie: verwacht één van ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin),e=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";if(o)return`Te ${e}: verwacht dat ${n.origin??"waarde"} ${Q}${n.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`;return`Te ${e}: verwacht dat ${n.origin??"waarde"} ${Q}${n.maximum.toString()} is`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin),e=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";if(o)return`Te ${e}: verwacht dat ${n.origin} ${Q}${n.minimum.toString()} ${o.unit} ${o.verb}`;return`Te ${e}: verwacht dat ${n.origin} ${Q}${n.minimum.toString()} is`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Ongeldige tekst: moet met "${Q.prefix}" beginnen`;if(Q.format==="ends_with")return`Ongeldige tekst: moet op "${Q.suffix}" eindigen`;if(Q.format==="includes")return`Ongeldige tekst: moet "${Q.includes}" bevatten`;if(Q.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${Q.pattern}`;return`Ongeldig: ${g[Q.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};var O2=D(()=>{cA()});function HL(){return{localeError:SuA()}}var SuA=()=>{let A={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return A[n]??null}let g={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Ugyldig input: forventet instanceof ${n.expected}, fikk ${e}`;return`Ugyldig input: forventet ${Q}, fikk ${e}`}case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${_(n.values[0])}`;return`Ugyldig valg: forventet en av ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`For stor(t): forventet ${n.origin??"value"} til å ha ${Q}${n.maximum.toString()} ${o.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til å ha ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`For lite(n): forventet ${n.origin} til å ha ${Q}${n.minimum.toString()} ${o.unit}`;return`For lite(n): forventet ${n.origin} til å ha ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Ugyldig streng: må starte med "${Q.prefix}"`;if(Q.format==="ends_with")return`Ugyldig streng: må ende med "${Q.suffix}"`;if(Q.format==="includes")return`Ugyldig streng: må inneholde "${Q.includes}"`;if(Q.format==="regex")return`Ugyldig streng: må matche mønsteret ${Q.pattern}`;return`Ugyldig ${g[Q.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};var v2=D(()=>{cA()});function KL(){return{localeError:luA()}}var luA=()=>{let A={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return A[n]??null}let g={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Fâsit giren: umulan instanceof ${n.expected}, alınan ${e}`;return`Fâsit giren: umulan ${Q}, alınan ${e}`}case"invalid_value":if(n.values.length===1)return`Fâsit giren: umulan ${_(n.values[0])}`;return`Fâsit tercih: mûteberler ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Fazla büyük: ${n.origin??"value"}, ${Q}${n.maximum.toString()} ${o.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${n.origin??"value"}, ${Q}${n.maximum.toString()} olmalıydı.`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Fazla küçük: ${n.origin}, ${Q}${n.minimum.toString()} ${o.unit} sahip olmalıydı.`;return`Fazla küçük: ${n.origin}, ${Q}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Fâsit metin: "${Q.prefix}" ile başlamalı.`;if(Q.format==="ends_with")return`Fâsit metin: "${Q.suffix}" ile bitmeli.`;if(Q.format==="includes")return`Fâsit metin: "${Q.includes}" ihtivâ etmeli.`;if(Q.format==="regex")return`Fâsit metin: ${Q.pattern} nakşına uymalı.`;return`Fâsit ${g[Q.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var Z2=D(()=>{cA()});function jL(){return{localeError:MuA()}}var MuA=()=>{let A={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return A[n]??null}let g={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},i={nan:"NaN",number:"عدد",array:"ارې"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${e} ترلاسه شو`;return`ناسم ورودي: باید ${Q} وای, مګر ${e} ترلاسه شو`}case"invalid_value":if(n.values.length===1)return`ناسم ورودي: باید ${_(n.values[0])} وای`;return`ناسم انتخاب: باید یو له ${T(n.values,"|")} څخه وای`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`ډیر لوی: ${n.origin??"ارزښت"} باید ${Q}${n.maximum.toString()} ${o.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${n.origin??"ارزښت"} باید ${Q}${n.maximum.toString()} وي`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`ډیر کوچنی: ${n.origin} باید ${Q}${n.minimum.toString()} ${o.unit} ولري`;return`ډیر کوچنی: ${n.origin} باید ${Q}${n.minimum.toString()} وي`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`ناسم متن: باید د "${Q.prefix}" سره پیل شي`;if(Q.format==="ends_with")return`ناسم متن: باید د "${Q.suffix}" سره پای ته ورسيږي`;if(Q.format==="includes")return`ناسم متن: باید "${Q.includes}" ولري`;if(Q.format==="regex")return`ناسم متن: باید د ${Q.pattern} سره مطابقت ولري`;return`${g[Q.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${T(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};var W2=D(()=>{cA()});function _L(){return{localeError:YuA()}}var YuA=()=>{let A={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return A[n]??null}let g={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},i={nan:"NaN",number:"liczba",array:"tablica"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${e}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${Q}, otrzymano ${e}`}case"invalid_value":if(n.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${_(n.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${Q}${n.maximum.toString()} ${o.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${Q}${n.minimum.toString()} ${o.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${Q.prefix}"`;if(Q.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${Q.suffix}"`;if(Q.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${Q.includes}"`;if(Q.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${Q.pattern}`;return`Nieprawidłow(y/a/e) ${g[Q.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var V2=D(()=>{cA()});function mL(){return{localeError:$uA()}}var $uA=()=>{let A={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return A[n]??null}let g={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"número",null:"nulo"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Tipo inválido: esperado instanceof ${n.expected}, recebido ${e}`;return`Tipo inválido: esperado ${Q}, recebido ${e}`}case"invalid_value":if(n.values.length===1)return`Entrada inválida: esperado ${_(n.values[0])}`;return`Opção inválida: esperada uma das ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${Q}${n.maximum.toString()} ${o.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Muito pequeno: esperado que ${n.origin} tivesse ${Q}${n.minimum.toString()} ${o.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Texto inválido: deve começar com "${Q.prefix}"`;if(Q.format==="ends_with")return`Texto inválido: deve terminar com "${Q.suffix}"`;if(Q.format==="includes")return`Texto inválido: deve incluir "${Q.includes}"`;if(Q.format==="regex")return`Texto inválido: deve corresponder ao padrão ${Q.pattern}`;return`${g[Q.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};var X2=D(()=>{cA()});function H2(A,t,g,i){let n=Math.abs(A),Q=n%10,o=n%100;if(o>=11&&o<=19)return i;if(Q===1)return t;if(Q>=2&&Q<=4)return g;return i}function xL(){return{localeError:kuA()}}var kuA=()=>{let A={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return A[n]??null}let g={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},i={nan:"NaN",number:"число",array:"массив"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Неверный ввод: ожидалось instanceof ${n.expected}, получено ${e}`;return`Неверный ввод: ожидалось ${Q}, получено ${e}`}case"invalid_value":if(n.values.length===1)return`Неверный ввод: ожидалось ${_(n.values[0])}`;return`Неверный вариант: ожидалось одно из ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o){let e=Number(n.maximum),B=H2(e,o.unit.one,o.unit.few,o.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${Q}${n.maximum.toString()} ${B}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o){let e=Number(n.minimum),B=H2(e,o.unit.one,o.unit.few,o.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${Q}${n.minimum.toString()} ${B}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Неверная строка: должна начинаться с "${Q.prefix}"`;if(Q.format==="ends_with")return`Неверная строка: должна заканчиваться на "${Q.suffix}"`;if(Q.format==="includes")return`Неверная строка: должна содержать "${Q.includes}"`;if(Q.format==="regex")return`Неверная строка: должна соответствовать шаблону ${Q.pattern}`;return`Неверный ${g[Q.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};var K2=D(()=>{cA()});function qL(){return{localeError:GuA()}}var GuA=()=>{let A={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return A[n]??null}let g={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"število",array:"tabela"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${e}`;return`Neveljaven vnos: pričakovano ${Q}, prejeto ${e}`}case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pričakovano ${_(n.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${Q}${n.maximum.toString()} ${o.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Premajhno: pričakovano, da bo ${n.origin} imelo ${Q}${n.minimum.toString()} ${o.unit}`;return`Premajhno: pričakovano, da bo ${n.origin} ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Neveljaven niz: mora se začeti z "${Q.prefix}"`;if(Q.format==="ends_with")return`Neveljaven niz: mora se končati z "${Q.suffix}"`;if(Q.format==="includes")return`Neveljaven niz: mora vsebovati "${Q.includes}"`;if(Q.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${Q.pattern}`;return`Neveljaven ${g[Q.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};var j2=D(()=>{cA()});function dL(){return{localeError:JuA()}}var JuA=()=>{let A={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return A[n]??null}let g={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${e}`;return`Ogiltig inmatning: förväntat ${Q}, fick ${e}`}case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: förväntat ${_(n.values[0])}`;return`Ogiltigt val: förväntade en av ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`För stor(t): förväntade ${n.origin??"värdet"} att ha ${Q}${n.maximum.toString()} ${o.unit??"element"}`;return`För stor(t): förväntat ${n.origin??"värdet"} att ha ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${Q}${n.minimum.toString()} ${o.unit}`;return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Ogiltig sträng: måste börja med "${Q.prefix}"`;if(Q.format==="ends_with")return`Ogiltig sträng: måste sluta med "${Q.suffix}"`;if(Q.format==="includes")return`Ogiltig sträng: måste innehålla "${Q.includes}"`;if(Q.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${Q.pattern}"`;return`Ogiltig(t) ${g[Q.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};var _2=D(()=>{cA()});function sL(){return{localeError:TuA()}}var TuA=()=>{let A={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return A[n]??null}let g={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${e}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Q}, பெறப்பட்டது ${e}`}case"invalid_value":if(n.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${_(n.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${T(n.values,"|")} இல் ஒன்று`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${Q}${n.maximum.toString()} ${o.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${Q}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${Q}${n.minimum.toString()} ${o.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${Q}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`தவறான சரம்: "${Q.prefix}" இல் தொடங்க வேண்டும்`;if(Q.format==="ends_with")return`தவறான சரம்: "${Q.suffix}" இல் முடிவடைய வேண்டும்`;if(Q.format==="includes")return`தவறான சரம்: "${Q.includes}" ஐ உள்ளடக்க வேண்டும்`;if(Q.format==="regex")return`தவறான சரம்: ${Q.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${g[Q.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var m2=D(()=>{cA()});function pL(){return{localeError:RuA()}}var RuA=()=>{let A={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return A[n]??null}let g={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},i={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${e}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${Q} แต่ได้รับ ${e}`}case"invalid_value":if(n.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${_(n.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"ไม่เกิน":"น้อยกว่า",o=t(n.origin);if(o)return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${Q} ${n.maximum.toString()} ${o.unit??"รายการ"}`;return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${Q} ${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?"อย่างน้อย":"มากกว่า",o=t(n.origin);if(o)return`น้อยกว่ากำหนด: ${n.origin} ควรมี${Q} ${n.minimum.toString()} ${o.unit}`;return`น้อยกว่ากำหนด: ${n.origin} ควรมี${Q} ${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${Q.prefix}"`;if(Q.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${Q.suffix}"`;if(Q.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${Q.includes}" อยู่ในข้อความ`;if(Q.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${Q.pattern}`;return`รูปแบบไม่ถูกต้อง: ${g[Q.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${T(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var x2=D(()=>{cA()});function AS(){return{localeError:fuA()}}var fuA=()=>{let A={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(n){return A[n]??null}let g={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${e}`;return`Geçersiz değer: beklenen ${Q}, alınan ${e}`}case"invalid_value":if(n.values.length===1)return`Geçersiz değer: beklenen ${_(n.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Çok büyük: beklenen ${n.origin??"değer"} ${Q}${n.maximum.toString()} ${o.unit??"öğe"}`;return`Çok büyük: beklenen ${n.origin??"değer"} ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Çok küçük: beklenen ${n.origin} ${Q}${n.minimum.toString()} ${o.unit}`;return`Çok küçük: beklenen ${n.origin} ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Geçersiz metin: "${Q.prefix}" ile başlamalı`;if(Q.format==="ends_with")return`Geçersiz metin: "${Q.suffix}" ile bitmeli`;if(Q.format==="includes")return`Geçersiz metin: "${Q.includes}" içermeli`;if(Q.format==="regex")return`Geçersiz metin: ${Q.pattern} desenine uymalı`;return`Geçersiz ${g[Q.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var q2=D(()=>{cA()});function jC(){return{localeError:PuA()}}var PuA=()=>{let A={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return A[n]??null}let g={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},i={nan:"NaN",number:"число",array:"масив"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${e}`;return`Неправильні вхідні дані: очікується ${Q}, отримано ${e}`}case"invalid_value":if(n.values.length===1)return`Неправильні вхідні дані: очікується ${_(n.values[0])}`;return`Неправильна опція: очікується одне з ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Занадто велике: очікується, що ${n.origin??"значення"} ${o.verb} ${Q}${n.maximum.toString()} ${o.unit??"елементів"}`;return`Занадто велике: очікується, що ${n.origin??"значення"} буде ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Занадто мале: очікується, що ${n.origin} ${o.verb} ${Q}${n.minimum.toString()} ${o.unit}`;return`Занадто мале: очікується, що ${n.origin} буде ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Неправильний рядок: повинен починатися з "${Q.prefix}"`;if(Q.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${Q.suffix}"`;if(Q.format==="includes")return`Неправильний рядок: повинен містити "${Q.includes}"`;if(Q.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${Q.pattern}`;return`Неправильний ${g[Q.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};var tS=D(()=>{cA()});function gS(){return jC()}var d2=D(()=>{tS()});function nS(){return{localeError:zuA()}}var zuA=()=>{let A={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return A[n]??null}let g={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},i={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${e} موصول ہوا`;return`غلط ان پٹ: ${Q} متوقع تھا، ${e} موصول ہوا`}case"invalid_value":if(n.values.length===1)return`غلط ان پٹ: ${_(n.values[0])} متوقع تھا`;return`غلط آپشن: ${T(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`بہت بڑا: ${n.origin??"ویلیو"} کے ${Q}${n.maximum.toString()} ${o.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${n.origin??"ویلیو"} کا ${Q}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`بہت چھوٹا: ${n.origin} کے ${Q}${n.minimum.toString()} ${o.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${n.origin} کا ${Q}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`غلط سٹرنگ: "${Q.prefix}" سے شروع ہونا چاہیے`;if(Q.format==="ends_with")return`غلط سٹرنگ: "${Q.suffix}" پر ختم ہونا چاہیے`;if(Q.format==="includes")return`غلط سٹرنگ: "${Q.includes}" شامل ہونا چاہیے`;if(Q.format==="regex")return`غلط سٹرنگ: پیٹرن ${Q.pattern} سے میچ ہونا چاہیے`;return`غلط ${g[Q.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${T(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var s2=D(()=>{cA()});function iS(){return{localeError:OuA()}}var OuA=()=>{let A={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(n){return A[n]??null}let g={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${e}`;return`Noto‘g‘ri kirish: kutilgan ${Q}, qabul qilingan ${e}`}case"invalid_value":if(n.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${_(n.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Juda katta: kutilgan ${n.origin??"qiymat"} ${Q}${n.maximum.toString()} ${o.unit} ${o.verb}`;return`Juda katta: kutilgan ${n.origin??"qiymat"} ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Juda kichik: kutilgan ${n.origin} ${Q}${n.minimum.toString()} ${o.unit} ${o.verb}`;return`Juda kichik: kutilgan ${n.origin} ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Noto‘g‘ri satr: "${Q.prefix}" bilan boshlanishi kerak`;if(Q.format==="ends_with")return`Noto‘g‘ri satr: "${Q.suffix}" bilan tugashi kerak`;if(Q.format==="includes")return`Noto‘g‘ri satr: "${Q.includes}" ni o‘z ichiga olishi kerak`;if(Q.format==="regex")return`Noto‘g‘ri satr: ${Q.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${g[Q.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};var p2=D(()=>{cA()});function QS(){return{localeError:vuA()}}var vuA=()=>{let A={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return A[n]??null}let g={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},i={nan:"NaN",number:"số",array:"mảng"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${e}`;return`Đầu vào không hợp lệ: mong đợi ${Q}, nhận được ${e}`}case"invalid_value":if(n.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${_(n.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o.verb} ${Q}${n.maximum.toString()} ${o.unit??"phần tử"}`;return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Quá nhỏ: mong đợi ${n.origin} ${o.verb} ${Q}${n.minimum.toString()} ${o.unit}`;return`Quá nhỏ: mong đợi ${n.origin} ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${Q.prefix}"`;if(Q.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${Q.suffix}"`;if(Q.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${Q.includes}"`;if(Q.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${Q.pattern}`;return`${g[Q.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${T(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};var A4=D(()=>{cA()});function oS(){return{localeError:ZuA()}}var ZuA=()=>{let A={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return A[n]??null}let g={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},i={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`无效输入:期望 instanceof ${n.expected},实际接收 ${e}`;return`无效输入:期望 ${Q},实际接收 ${e}`}case"invalid_value":if(n.values.length===1)return`无效输入:期望 ${_(n.values[0])}`;return`无效选项:期望以下之一 ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`数值过大:期望 ${n.origin??"值"} ${Q}${n.maximum.toString()} ${o.unit??"个元素"}`;return`数值过大:期望 ${n.origin??"值"} ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`数值过小:期望 ${n.origin} ${Q}${n.minimum.toString()} ${o.unit}`;return`数值过小:期望 ${n.origin} ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`无效字符串:必须以 "${Q.prefix}" 开头`;if(Q.format==="ends_with")return`无效字符串:必须以 "${Q.suffix}" 结尾`;if(Q.format==="includes")return`无效字符串:必须包含 "${Q.includes}"`;if(Q.format==="regex")return`无效字符串:必须满足正则表达式 ${Q.pattern}`;return`无效${g[Q.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};var t4=D(()=>{cA()});function IS(){return{localeError:WuA()}}var WuA=()=>{let A={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return A[n]??null}let g={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},i={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${e}`;return`無效的輸入值:預期為 ${Q},但收到 ${e}`}case"invalid_value":if(n.values.length===1)return`無效的輸入值:預期為 ${_(n.values[0])}`;return`無效的選項:預期為以下其中之一 ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`數值過大:預期 ${n.origin??"值"} 應為 ${Q}${n.maximum.toString()} ${o.unit??"個元素"}`;return`數值過大:預期 ${n.origin??"值"} 應為 ${Q}${n.maximum.toString()}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`數值過小:預期 ${n.origin} 應為 ${Q}${n.minimum.toString()} ${o.unit}`;return`數值過小:預期 ${n.origin} 應為 ${Q}${n.minimum.toString()}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`無效的字串:必須以 "${Q.prefix}" 開頭`;if(Q.format==="ends_with")return`無效的字串:必須以 "${Q.suffix}" 結尾`;if(Q.format==="includes")return`無效的字串:必須包含 "${Q.includes}"`;if(Q.format==="regex")return`無效的字串:必須符合格式 ${Q.pattern}`;return`無效的 ${g[Q.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${T(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};var g4=D(()=>{cA()});function eS(){return{localeError:VuA()}}var VuA=()=>{let A={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(n){return A[n]??null}let g={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},i={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(n)=>{switch(n.code){case"invalid_type":{let Q=i[n.expected]??n.expected,o=x(n.input),e=i[o]??o;if(/^[A-Z]/.test(n.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${e}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${Q}, àmọ̀ a rí ${e}`}case"invalid_value":if(n.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${_(n.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${T(n.values,"|")}`;case"too_big":{let Q=n.inclusive?"<=":"<",o=t(n.origin);if(o)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${o.verb} ${Q}${n.maximum} ${o.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${Q}${n.maximum}`}case"too_small":{let Q=n.inclusive?">=":">",o=t(n.origin);if(o)return`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${o.verb} ${Q}${n.minimum} ${o.unit}`;return`Kéré ju: a ní láti jẹ́ ${Q}${n.minimum}`}case"invalid_format":{let Q=n;if(Q.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${Q.prefix}"`;if(Q.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${Q.suffix}"`;if(Q.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${Q.includes}"`;if(Q.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${Q.pattern}`;return`Aṣìṣe: ${g[Q.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${T(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var n4=D(()=>{cA()});var _C={};ei(_C,{zhTW:()=>IS,zhCN:()=>oS,yo:()=>eS,vi:()=>QS,uz:()=>iS,ur:()=>nS,uk:()=>jC,ua:()=>gS,tr:()=>AS,th:()=>pL,ta:()=>sL,sv:()=>dL,sl:()=>qL,ru:()=>xL,pt:()=>mL,ps:()=>jL,pl:()=>_L,ota:()=>KL,no:()=>HL,nl:()=>XL,ms:()=>VL,mk:()=>WL,lt:()=>ZL,ko:()=>vL,km:()=>HC,kh:()=>OL,ka:()=>PL,ja:()=>fL,it:()=>RL,is:()=>TL,id:()=>JL,hy:()=>GL,hu:()=>kL,he:()=>$L,frCA:()=>YL,fr:()=>ML,fi:()=>lL,fa:()=>SL,es:()=>LL,eo:()=>FL,en:()=>XC,de:()=>uL,da:()=>NL,cs:()=>bL,ca:()=>rL,bg:()=>wL,be:()=>aL,az:()=>DL,ar:()=>yL});var BS=D(()=>{e2();B2();C2();c2();E2();y2();D2();a2();UL();w2();r2();b2();N2();u2();U2();F2();L2();l2();M2();Y2();$2();k2();G2();J2();zL();T2();f2();P2();z2();O2();v2();Z2();W2();V2();X2();K2();j2();_2();m2();x2();q2();d2();tS();s2();p2();A4();t4();g4();n4()});class cS{constructor(){this._map=new WeakMap,this._idmap=new Map}add(A,...t){let g=t[0];if(this._map.set(A,g),g&&typeof g==="object"&&"id"in g)this._idmap.set(g.id,A);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(A){let t=this._map.get(A);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(A),this}get(A){let t=A._zod.parent;if(t){let g={...this.get(t)??{}};delete g.id;let i={...g,...this._map.get(A)};return Object.keys(i).length?i:void 0}return this._map.get(A)}has(A){return this._map.has(A)}}function HD(){return new cS}var i4,hS,CS,st;var mC=D(()=>{hS=Symbol("ZodOutput"),CS=Symbol("ZodInput");(i4=globalThis).__zod_globalRegistry??(i4.__zod_globalRegistry=HD());st=globalThis.__zod_globalRegistry});function ES(A,t){return new A({type:"string",...s(t)})}function yS(A,t){return new A({type:"string",coerce:!0,...s(t)})}function KD(A,t){return new A({type:"string",format:"email",check:"string_format",abort:!1,...s(t)})}function xC(A,t){return new A({type:"string",format:"guid",check:"string_format",abort:!1,...s(t)})}function jD(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,...s(t)})}function _D(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...s(t)})}function mD(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...s(t)})}function xD(A,t){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...s(t)})}function qC(A,t){return new A({type:"string",format:"url",check:"string_format",abort:!1,...s(t)})}function qD(A,t){return new A({type:"string",format:"emoji",check:"string_format",abort:!1,...s(t)})}function dD(A,t){return new A({type:"string",format:"nanoid",check:"string_format",abort:!1,...s(t)})}function sD(A,t){return new A({type:"string",format:"cuid",check:"string_format",abort:!1,...s(t)})}function pD(A,t){return new A({type:"string",format:"cuid2",check:"string_format",abort:!1,...s(t)})}function Aa(A,t){return new A({type:"string",format:"ulid",check:"string_format",abort:!1,...s(t)})}function ta(A,t){return new A({type:"string",format:"xid",check:"string_format",abort:!1,...s(t)})}function ga(A,t){return new A({type:"string",format:"ksuid",check:"string_format",abort:!1,...s(t)})}function na(A,t){return new A({type:"string",format:"ipv4",check:"string_format",abort:!1,...s(t)})}function ia(A,t){return new A({type:"string",format:"ipv6",check:"string_format",abort:!1,...s(t)})}function DS(A,t){return new A({type:"string",format:"mac",check:"string_format",abort:!1,...s(t)})}function Qa(A,t){return new A({type:"string",format:"cidrv4",check:"string_format",abort:!1,...s(t)})}function oa(A,t){return new A({type:"string",format:"cidrv6",check:"string_format",abort:!1,...s(t)})}function Ia(A,t){return new A({type:"string",format:"base64",check:"string_format",abort:!1,...s(t)})}function ea(A,t){return new A({type:"string",format:"base64url",check:"string_format",abort:!1,...s(t)})}function Ba(A,t){return new A({type:"string",format:"e164",check:"string_format",abort:!1,...s(t)})}function ha(A,t){return new A({type:"string",format:"jwt",check:"string_format",abort:!1,...s(t)})}function wS(A,t){return new A({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...s(t)})}function rS(A,t){return new A({type:"string",format:"date",check:"string_format",...s(t)})}function bS(A,t){return new A({type:"string",format:"time",check:"string_format",precision:null,...s(t)})}function NS(A,t){return new A({type:"string",format:"duration",check:"string_format",...s(t)})}function uS(A,t){return new A({type:"number",checks:[],...s(t)})}function US(A,t){return new A({type:"number",coerce:!0,checks:[],...s(t)})}function FS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"safeint",...s(t)})}function LS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"float32",...s(t)})}function SS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"float64",...s(t)})}function lS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"int32",...s(t)})}function MS(A,t){return new A({type:"number",check:"number_format",abort:!1,format:"uint32",...s(t)})}function YS(A,t){return new A({type:"boolean",...s(t)})}function $S(A,t){return new A({type:"boolean",coerce:!0,...s(t)})}function kS(A,t){return new A({type:"bigint",...s(t)})}function GS(A,t){return new A({type:"bigint",coerce:!0,...s(t)})}function JS(A,t){return new A({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...s(t)})}function TS(A,t){return new A({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...s(t)})}function RS(A,t){return new A({type:"symbol",...s(t)})}function fS(A,t){return new A({type:"undefined",...s(t)})}function PS(A,t){return new A({type:"null",...s(t)})}function zS(A){return new A({type:"any"})}function OS(A){return new A({type:"unknown"})}function vS(A,t){return new A({type:"never",...s(t)})}function ZS(A,t){return new A({type:"void",...s(t)})}function WS(A,t){return new A({type:"date",...s(t)})}function VS(A,t){return new A({type:"date",coerce:!0,...s(t)})}function XS(A,t){return new A({type:"nan",...s(t)})}function ci(A,t){return new GD({check:"less_than",...s(t),value:A,inclusive:!1})}function gn(A,t){return new GD({check:"less_than",...s(t),value:A,inclusive:!0})}function Ei(A,t){return new JD({check:"greater_than",...s(t),value:A,inclusive:!1})}function Fg(A,t){return new JD({check:"greater_than",...s(t),value:A,inclusive:!0})}function Ca(A){return Ei(0,A)}function ca(A){return ci(0,A)}function Ea(A){return gn(0,A)}function ya(A){return Fg(0,A)}function JQ(A,t){return new zU({check:"multiple_of",...s(t),value:A})}function TQ(A,t){return new ZU({check:"max_size",...s(t),maximum:A})}function yi(A,t){return new WU({check:"min_size",...s(t),minimum:A})}function Wo(A,t){return new VU({check:"size_equals",...s(t),size:A})}function Vo(A,t){return new XU({check:"max_length",...s(t),maximum:A})}function qi(A,t){return new HU({check:"min_length",...s(t),minimum:A})}function Xo(A,t){return new KU({check:"length_equals",...s(t),length:A})}function ue(A,t){return new jU({check:"string_format",format:"regex",...s(t),pattern:A})}function Ue(A){return new _U({check:"string_format",format:"lowercase",...s(A)})}function Fe(A){return new mU({check:"string_format",format:"uppercase",...s(A)})}function Le(A,t){return new xU({check:"string_format",format:"includes",...s(t),includes:A})}function Se(A,t){return new qU({check:"string_format",format:"starts_with",...s(t),prefix:A})}function le(A,t){return new dU({check:"string_format",format:"ends_with",...s(t),suffix:A})}function Da(A,t,g){return new sU({check:"property",property:A,schema:t,...s(g)})}function Me(A,t){return new pU({check:"mime_type",mime:A,...s(t)})}function Xn(A){return new AF({check:"overwrite",tx:A})}function Ye(A){return Xn((t)=>t.normalize(A))}function $e(){return Xn((A)=>A.trim())}function ke(){return Xn((A)=>A.toLowerCase())}function Ge(){return Xn((A)=>A.toUpperCase())}function Je(){return Xn((A)=>qu(A))}function HS(A,t,g){return new A({type:"array",element:t,...s(g)})}function HuA(A,t,g){return new A({type:"union",options:t,...s(g)})}function KuA(A,t,g){return new A({type:"union",options:t,inclusive:!1,...s(g)})}function juA(A,t,g,i){return new A({type:"union",options:g,discriminator:t,...s(i)})}function _uA(A,t,g){return new A({type:"intersection",left:t,right:g})}function muA(A,t,g,i){let n=g instanceof lA;return new A({type:"tuple",items:t,rest:n?g:null,...s(n?i:g)})}function xuA(A,t,g,i){return new A({type:"record",keyType:t,valueType:g,...s(i)})}function quA(A,t,g,i){return new A({type:"map",keyType:t,valueType:g,...s(i)})}function duA(A,t,g){return new A({type:"set",valueType:t,...s(g)})}function suA(A,t,g){let i=Array.isArray(t)?Object.fromEntries(t.map((n)=>[n,n])):t;return new A({type:"enum",entries:i,...s(g)})}function puA(A,t,g){return new A({type:"enum",entries:t,...s(g)})}function AUA(A,t,g){return new A({type:"literal",values:Array.isArray(t)?t:[t],...s(g)})}function KS(A,t){return new A({type:"file",...s(t)})}function tUA(A,t){return new A({type:"transform",transform:t})}function gUA(A,t){return new A({type:"optional",innerType:t})}function nUA(A,t){return new A({type:"nullable",innerType:t})}function iUA(A,t,g){return new A({type:"default",innerType:t,get defaultValue(){return typeof g==="function"?g():su(g)}})}function QUA(A,t,g){return new A({type:"nonoptional",innerType:t,...s(g)})}function oUA(A,t){return new A({type:"success",innerType:t})}function IUA(A,t,g){return new A({type:"catch",innerType:t,catchValue:typeof g==="function"?g:()=>g})}function eUA(A,t,g){return new A({type:"pipe",in:t,out:g})}function BUA(A,t){return new A({type:"readonly",innerType:t})}function hUA(A,t,g){return new A({type:"template_literal",parts:t,...s(g)})}function CUA(A,t){return new A({type:"lazy",getter:t})}function cUA(A,t){return new A({type:"promise",innerType:t})}function jS(A,t,g){let i=s(g);return i.abort??(i.abort=!0),new A({type:"custom",check:"custom",fn:t,...i})}function _S(A,t,g){return new A({type:"custom",check:"custom",fn:t,...s(g)})}function mS(A){let t=Q4((g)=>{return g.addIssue=(i)=>{if(typeof i==="string")g.issues.push(ye(i,g.value,t._zod.def));else{let n=i;if(n.fatal)n.continue=!1;n.code??(n.code="custom"),n.input??(n.input=g.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),g.issues.push(ye(n))}},A(g.value,g)});return t}function Q4(A,t){let g=new ht({check:"custom",...s(t)});return g._zod.check=A,g}function xS(A){let t=new ht({check:"describe"});return t._zod.onattach=[(g)=>{let i=st.get(g)??{};st.add(g,{...i,description:A})}],t._zod.check=()=>{},t}function qS(A){let t=new ht({check:"meta"});return t._zod.onattach=[(g)=>{let i=st.get(g)??{};st.add(g,{...i,...A})}],t._zod.check=()=>{},t}function dS(A,t){let g=s(t),i=g.truthy??["true","1","yes","on","y","enabled"],n=g.falsy??["false","0","no","off","n","disabled"];if(g.case!=="sensitive")i=i.map((y)=>typeof y==="string"?y.toLowerCase():y),n=n.map((y)=>typeof y==="string"?y.toLowerCase():y);let Q=new Set(i),o=new Set(n),e=A.Codec??VC,B=A.Boolean??ZC,C=new(A.String??Zo)({type:"string",error:g.error}),c=new B({type:"boolean",error:g.error}),E=new e({type:"pipe",in:C,out:c,transform:(y,a)=>{let w=y;if(g.case!=="sensitive")w=w.toLowerCase();if(Q.has(w))return!0;else if(o.has(w))return!1;else return a.issues.push({code:"invalid_value",expected:"stringbool",values:[...Q,...o],input:a.value,inst:E,continue:!1}),{}},reverseTransform:(y,a)=>{if(y===!0)return i[0]||"true";else return n[0]||"false"},error:g.error});return E}function Te(A,t,g,i={}){let n=s(i),Q={...s(i),check:"string_format",type:"string",format:t,fn:typeof g==="function"?g:(e)=>g.test(e),...n};if(g instanceof RegExp)Q.pattern=g;return new A(Q)}var aS;var o4=D(()=>{TD();mC();EL();cA();aS={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function RQ(A){let t=A?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:A.processors??{},metadataRegistry:A?.metadata??st,target:t,unrepresentable:A?.unrepresentable??"throw",override:A?.override??(()=>{}),io:A?.io??"output",counter:0,seen:new Map,cycles:A?.cycles??"ref",reused:A?.reused??"inline",external:A?.external??void 0}}function dA(A,t,g={path:[],schemaPath:[]}){var i;let n=A._zod.def,Q=t.seen.get(A);if(Q){if(Q.count++,g.schemaPath.includes(A))Q.cycle=g.path;return Q.schema}let o={schema:{},count:1,cycle:void 0,path:g.path};t.seen.set(A,o);let e=A._zod.toJSONSchema?.();if(e)o.schema=e;else{let C={...g,schemaPath:[...g.schemaPath,A],path:g.path};if(A._zod.processJSONSchema)A._zod.processJSONSchema(t,o.schema,C);else{let E=o.schema,y=t.processors[n.type];if(!y)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(A,t,E,C)}let c=A._zod.parent;if(c){if(!o.ref)o.ref=c;dA(c,t,C),t.seen.get(c).isParent=!0}}let B=t.metadataRegistry.get(A);if(B)Object.assign(o.schema,B);if(t.io==="input"&&Lg(A))delete o.schema.examples,delete o.schema.default;if(t.io==="input"&&o.schema._prefault)(i=o.schema).default??(i.default=o.schema._prefault);return delete o.schema._prefault,t.seen.get(A).schema}function fQ(A,t){let g=A.seen.get(t);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let o of A.seen.entries()){let e=A.metadataRegistry.get(o[0])?.id;if(e){let B=i.get(e);if(B&&B!==o[0])throw Error(`Duplicate schema id "${e}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(e,o[0])}}let n=(o)=>{let e=A.target==="draft-2020-12"?"$defs":"definitions";if(A.external){let c=A.external.registry.get(o[0])?.id,E=A.external.uri??((a)=>a);if(c)return{ref:E(c)};let y=o[1].defId??o[1].schema.id??`schema${A.counter++}`;return o[1].defId=y,{defId:y,ref:`${E("__shared")}#/${e}/${y}`}}if(o[1]===g)return{ref:"#"};let h=`${"#"}/${e}/`,C=o[1].schema.id??`__schema${A.counter++}`;return{defId:C,ref:h+C}},Q=(o)=>{if(o[1].schema.$ref)return;let e=o[1],{ref:B,defId:h}=n(o);if(e.def={...e.schema},h)e.defId=h;let C=e.schema;for(let c in C)delete C[c];C.$ref=B};if(A.cycles==="throw")for(let o of A.seen.entries()){let e=o[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
104
104
|
|
|
105
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of A.seen.entries()){let e=o[1];if(t===o[0]){Q(o);continue}if(A.external){let h=A.external.registry.get(o[0])?.id;if(t!==o[0]&&h){Q(o);continue}}if(A.metadataRegistry.get(o[0])?.id){Q(o);continue}if(e.cycle){Q(o);continue}if(e.count>1){if(A.reused==="ref"){Q(o);continue}}}}function PQ(A,t){let g=A.seen.get(t);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let i=(o)=>{let e=A.seen.get(o);if(e.ref===null)return;let B=e.def??e.schema,h={...B},C=e.ref;if(e.ref=null,C){i(C);let E=A.seen.get(C),y=E.schema;if(y.$ref&&(A.target==="draft-07"||A.target==="draft-04"||A.target==="openapi-3.0"))B.allOf=B.allOf??[],B.allOf.push(y);else Object.assign(B,y);if(Object.assign(B,h),o._zod.parent===C)for(let w in B){if(w==="$ref"||w==="allOf")continue;if(!(w in h))delete B[w]}if(y.$ref&&E.def)for(let w in B){if(w==="$ref"||w==="allOf")continue;if(w in E.def&&JSON.stringify(B[w])===JSON.stringify(E.def[w]))delete B[w]}}let c=o._zod.parent;if(c&&c!==C){i(c);let E=A.seen.get(c);if(E?.schema.$ref){if(B.$ref=E.schema.$ref,E.def)for(let y in B){if(y==="$ref"||y==="allOf")continue;if(y in E.def&&JSON.stringify(B[y])===JSON.stringify(E.def[y]))delete B[y]}}}A.override({zodSchema:o,jsonSchema:B,path:e.path??[]})};for(let o of[...A.seen.entries()].reverse())i(o[0]);let n={};if(A.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(A.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(A.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(A.target==="openapi-3.0");if(A.external?.uri){let o=A.external.registry.get(t)?.id;if(!o)throw Error("Schema is missing an `id` property");n.$id=A.external.uri(o)}Object.assign(n,g.def??g.schema);let Q=A.external?.defs??{};for(let o of A.seen.entries()){let e=o[1];if(e.def&&e.defId)Q[e.defId]=e.def}if(A.external);else if(Object.keys(Q).length>0)if(A.target==="draft-2020-12")n.$defs=Q;else n.definitions=Q;try{let o=JSON.parse(JSON.stringify(n));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Re(t,"input",A.processors),output:Re(t,"output",A.processors)}},enumerable:!1,writable:!1}),o}catch(o){throw Error("Error converting schema to JSON.")}}function Lg(A,t){let g=t??{seen:new Set};if(g.seen.has(A))return!1;g.seen.add(A);let i=A._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Lg(i.element,g);if(i.type==="set")return Lg(i.valueType,g);if(i.type==="lazy")return Lg(i.getter(),g);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Lg(i.innerType,g);if(i.type==="intersection")return Lg(i.left,g)||Lg(i.right,g);if(i.type==="record"||i.type==="map")return Lg(i.keyType,g)||Lg(i.valueType,g);if(i.type==="pipe")return Lg(i.in,g)||Lg(i.out,g);if(i.type==="object"){for(let n in i.shape)if(Lg(i.shape[n],g))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(Lg(n,g))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(Lg(n,g))return!0;if(i.rest&&Lg(i.rest,g))return!0;return!1}return!1}var sS=(A,t={})=>(g)=>{let i=RQ({...g,processors:t});return dA(A,i),fQ(i,A),PQ(i,A)},Re=(A,t,g={})=>(i)=>{let{libraryOptions:n,target:Q}=i??{},o=RQ({...n??{},target:Q,io:t,processors:g});return dA(A,o),fQ(o,A),PQ(o,A)};var dC=D(()=>{mC()});function ba(A,t){if("_idmap"in A){let i=A,n=RQ({...t,processors:aa}),Q={};for(let B of i._idmap.entries()){let[h,C]=B;dA(C,n)}let o={},e={registry:i,uri:t?.uri,defs:Q};n.external=e;for(let B of i._idmap.entries()){let[h,C]=B;fQ(n,C),o[h]=PQ(n,C)}if(Object.keys(Q).length>0){let B=n.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[B]:Q}}return{schemas:o}}let g=RQ({...t,processors:aa});return dA(A,g),fQ(g,A),PQ(g,A)}var EUA,pS=(A,t,g,i)=>{let n=g;n.type="string";let{minimum:Q,maximum:o,format:e,patterns:B,contentEncoding:h}=A._zod.bag;if(typeof Q==="number")n.minLength=Q;if(typeof o==="number")n.maxLength=o;if(e){if(n.format=EUA[e]??e,n.format==="")delete n.format;if(e==="time")delete n.format}if(h)n.contentEncoding=h;if(B&&B.size>0){let C=[...B];if(C.length===1)n.pattern=C[0].source;else if(C.length>1)n.allOf=[...C.map((c)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))]}},Al=(A,t,g,i)=>{let n=g,{minimum:Q,maximum:o,format:e,multipleOf:B,exclusiveMaximum:h,exclusiveMinimum:C}=A._zod.bag;if(typeof e==="string"&&e.includes("int"))n.type="integer";else n.type="number";if(typeof C==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.minimum=C,n.exclusiveMinimum=!0;else n.exclusiveMinimum=C;if(typeof Q==="number"){if(n.minimum=Q,typeof C==="number"&&t.target!=="draft-04")if(C>=Q)delete n.minimum;else delete n.exclusiveMinimum}if(typeof h==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.maximum=h,n.exclusiveMaximum=!0;else n.exclusiveMaximum=h;if(typeof o==="number"){if(n.maximum=o,typeof h==="number"&&t.target!=="draft-04")if(h<=o)delete n.maximum;else delete n.exclusiveMaximum}if(typeof B==="number")n.multipleOf=B},tl=(A,t,g,i)=>{g.type="boolean"},gl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},nl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},il=(A,t,g,i)=>{if(t.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},Ql=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},ol=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Il=(A,t,g,i)=>{g.not={}},el=(A,t,g,i)=>{},Bl=(A,t,g,i)=>{},hl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Cl=(A,t,g,i)=>{let n=A._zod.def,Q=$C(n.entries);if(Q.every((o)=>typeof o==="number"))g.type="number";if(Q.every((o)=>typeof o==="string"))g.type="string";g.enum=Q},cl=(A,t,g,i)=>{let n=A._zod.def,Q=[];for(let o of n.values)if(o===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else Q.push(Number(o));else Q.push(o);if(Q.length===0);else if(Q.length===1){let o=Q[0];if(g.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0")g.enum=[o];else g.const=o}else{if(Q.every((o)=>typeof o==="number"))g.type="number";if(Q.every((o)=>typeof o==="string"))g.type="string";if(Q.every((o)=>typeof o==="boolean"))g.type="boolean";if(Q.every((o)=>o===null))g.type="null";g.enum=Q}},El=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},yl=(A,t,g,i)=>{let n=g,Q=A._zod.pattern;if(!Q)throw Error("Pattern not found in template literal");n.type="string",n.pattern=Q.source},Dl=(A,t,g,i)=>{let n=g,Q={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:e,mime:B}=A._zod.bag;if(o!==void 0)Q.minLength=o;if(e!==void 0)Q.maxLength=e;if(B)if(B.length===1)Q.contentMediaType=B[0],Object.assign(n,Q);else Object.assign(n,Q),n.anyOf=B.map((h)=>({contentMediaType:h}));else Object.assign(n,Q)},al=(A,t,g,i)=>{g.type="boolean"},wl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},rl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},bl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},Nl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},ul=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Ul=(A,t,g,i)=>{let n=g,Q=A._zod.def,{minimum:o,maximum:e}=A._zod.bag;if(typeof o==="number")n.minItems=o;if(typeof e==="number")n.maxItems=e;n.type="array",n.items=dA(Q.element,t,{...i,path:[...i.path,"items"]})},Fl=(A,t,g,i)=>{let n=g,Q=A._zod.def;n.type="object",n.properties={};let o=Q.shape;for(let h in o)n.properties[h]=dA(o[h],t,{...i,path:[...i.path,"properties",h]});let e=new Set(Object.keys(o)),B=new Set([...e].filter((h)=>{let C=Q.shape[h]._zod;if(t.io==="input")return C.optin===void 0;else return C.optout===void 0}));if(B.size>0)n.required=Array.from(B);if(Q.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!Q.catchall){if(t.io==="output")n.additionalProperties=!1}else if(Q.catchall)n.additionalProperties=dA(Q.catchall,t,{...i,path:[...i.path,"additionalProperties"]})},wa=(A,t,g,i)=>{let n=A._zod.def,Q=n.inclusive===!1,o=n.options.map((e,B)=>dA(e,t,{...i,path:[...i.path,Q?"oneOf":"anyOf",B]}));if(Q)g.oneOf=o;else g.anyOf=o},Ll=(A,t,g,i)=>{let n=A._zod.def,Q=dA(n.left,t,{...i,path:[...i.path,"allOf",0]}),o=dA(n.right,t,{...i,path:[...i.path,"allOf",1]}),e=(h)=>("allOf"in h)&&Object.keys(h).length===1,B=[...e(Q)?Q.allOf:[Q],...e(o)?o.allOf:[o]];g.allOf=B},Sl=(A,t,g,i)=>{let n=g,Q=A._zod.def;n.type="array";let o=t.target==="draft-2020-12"?"prefixItems":"items",e=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",B=Q.items.map((E,y)=>dA(E,t,{...i,path:[...i.path,o,y]})),h=Q.rest?dA(Q.rest,t,{...i,path:[...i.path,e,...t.target==="openapi-3.0"?[Q.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=B,h)n.items=h}else if(t.target==="openapi-3.0"){if(n.items={anyOf:B},h)n.items.anyOf.push(h);if(n.minItems=B.length,!h)n.maxItems=B.length}else if(n.items=B,h)n.additionalItems=h;let{minimum:C,maximum:c}=A._zod.bag;if(typeof C==="number")n.minItems=C;if(typeof c==="number")n.maxItems=c},ll=(A,t,g,i)=>{let n=g,Q=A._zod.def;n.type="object";let o=Q.keyType,B=o._zod.bag?.patterns;if(Q.mode==="loose"&&B&&B.size>0){let C=dA(Q.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let c of B)n.patternProperties[c.source]=C}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=dA(Q.keyType,t,{...i,path:[...i.path,"propertyNames"]});n.additionalProperties=dA(Q.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let h=o._zod.values;if(h){let C=[...h].filter((c)=>typeof c==="string"||typeof c==="number");if(C.length>0)n.required=C}},Ml=(A,t,g,i)=>{let n=A._zod.def,Q=dA(n.innerType,t,i),o=t.seen.get(A);if(t.target==="openapi-3.0")o.ref=n.innerType,g.nullable=!0;else g.anyOf=[Q,{type:"null"}]},Yl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType},$l=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType,g.default=JSON.parse(JSON.stringify(n.defaultValue))},kl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);if(Q.ref=n.innerType,t.io==="input")g._prefault=JSON.parse(JSON.stringify(n.defaultValue))},Gl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType;let o;try{o=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=o},Jl=(A,t,g,i)=>{let n=A._zod.def,Q=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;dA(Q,t,i);let o=t.seen.get(A);o.ref=Q},Tl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType,g.readOnly=!0},Rl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType},ra=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType},fl=(A,t,g,i)=>{let n=A._zod.innerType;dA(n,t,i);let Q=t.seen.get(A);Q.ref=n},aa;var sC=D(()=>{dC();cA();EUA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aa={string:pS,number:Al,boolean:tl,bigint:gl,symbol:nl,null:il,undefined:Ql,void:ol,never:Il,any:el,unknown:Bl,date:hl,enum:Cl,literal:cl,nan:El,template_literal:yl,file:Dl,success:al,custom:wl,function:rl,transform:bl,map:Nl,set:ul,array:Ul,object:Fl,union:wa,intersection:Ll,tuple:Sl,record:ll,nullable:Ml,nonoptional:Yl,default:$l,prefault:kl,catch:Gl,pipe:Jl,readonly:Tl,promise:Rl,optional:ra,lazy:fl}});class Pl{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(A){this.ctx.counter=A}get seen(){return this.ctx.seen}constructor(A){let t=A?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=RQ({processors:aa,target:t,...A?.metadata&&{metadata:A.metadata},...A?.unrepresentable&&{unrepresentable:A.unrepresentable},...A?.override&&{override:A.override},...A?.io&&{io:A.io}})}process(A,t={path:[],schemaPath:[]}){return dA(A,this.ctx,t)}emit(A,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}fQ(this.ctx,A);let g=PQ(this.ctx,A),{"~standard":i,...n}=g;return n}}var I4=D(()=>{sC();dC()});var e4={};var B4=()=>{};var di={};ei(di,{version:()=>tF,util:()=>q,treeifyError:()=>nU,toJSONSchema:()=>ba,toDotPath:()=>v1,safeParseAsync:()=>IU,safeParse:()=>oU,safeEncodeAsync:()=>NNA,safeEncode:()=>rNA,safeDecodeAsync:()=>uNA,safeDecode:()=>bNA,registry:()=>HD,regexes:()=>un,process:()=>dA,prettifyError:()=>iU,parseAsync:()=>ND,parse:()=>bD,meta:()=>qS,locales:()=>_C,isValidJWT:()=>i2,isValidBase64URL:()=>n2,isValidBase64:()=>LF,initializeContext:()=>RQ,globalRegistry:()=>st,globalConfig:()=>lC,formatError:()=>PC,flattenError:()=>fC,finalize:()=>PQ,extractDefs:()=>fQ,encodeAsync:()=>aNA,encode:()=>yNA,describe:()=>xS,decodeAsync:()=>wNA,decode:()=>DNA,createToJSONSchemaMethod:()=>sS,createStandardJSONSchemaMethod:()=>Re,config:()=>$t,clone:()=>Ug,_xor:()=>KuA,_xid:()=>ta,_void:()=>ZS,_uuidv7:()=>xD,_uuidv6:()=>mD,_uuidv4:()=>_D,_uuid:()=>jD,_url:()=>qC,_uppercase:()=>Fe,_unknown:()=>OS,_union:()=>HuA,_undefined:()=>fS,_ulid:()=>Aa,_uint64:()=>TS,_uint32:()=>MS,_tuple:()=>muA,_trim:()=>$e,_transform:()=>tUA,_toUpperCase:()=>Ge,_toLowerCase:()=>ke,_templateLiteral:()=>hUA,_symbol:()=>RS,_superRefine:()=>mS,_success:()=>oUA,_stringbool:()=>dS,_stringFormat:()=>Te,_string:()=>ES,_startsWith:()=>Se,_slugify:()=>Je,_size:()=>Wo,_set:()=>duA,_safeParseAsync:()=>re,_safeParse:()=>we,_safeEncodeAsync:()=>MD,_safeEncode:()=>SD,_safeDecodeAsync:()=>YD,_safeDecode:()=>lD,_regex:()=>ue,_refine:()=>_S,_record:()=>xuA,_readonly:()=>BUA,_property:()=>Da,_promise:()=>cUA,_positive:()=>Ca,_pipe:()=>eUA,_parseAsync:()=>ae,_parse:()=>De,_overwrite:()=>Xn,_optional:()=>gUA,_number:()=>uS,_nullable:()=>nUA,_null:()=>PS,_normalize:()=>Ye,_nonpositive:()=>Ea,_nonoptional:()=>QUA,_nonnegative:()=>ya,_never:()=>vS,_negative:()=>ca,_nativeEnum:()=>puA,_nanoid:()=>dD,_nan:()=>XS,_multipleOf:()=>JQ,_minSize:()=>yi,_minLength:()=>qi,_min:()=>Fg,_mime:()=>Me,_maxSize:()=>TQ,_maxLength:()=>Vo,_max:()=>gn,_map:()=>quA,_mac:()=>DS,_lte:()=>gn,_lt:()=>ci,_lowercase:()=>Ue,_literal:()=>AUA,_length:()=>Xo,_lazy:()=>CUA,_ksuid:()=>ga,_jwt:()=>ha,_isoTime:()=>bS,_isoDuration:()=>NS,_isoDateTime:()=>wS,_isoDate:()=>rS,_ipv6:()=>ia,_ipv4:()=>na,_intersection:()=>_uA,_int64:()=>JS,_int32:()=>lS,_int:()=>FS,_includes:()=>Le,_guid:()=>xC,_gte:()=>Fg,_gt:()=>Ei,_float64:()=>SS,_float32:()=>LS,_file:()=>KS,_enum:()=>suA,_endsWith:()=>le,_encodeAsync:()=>FD,_encode:()=>uD,_emoji:()=>qD,_email:()=>KD,_e164:()=>Ba,_discriminatedUnion:()=>juA,_default:()=>iUA,_decodeAsync:()=>LD,_decode:()=>UD,_date:()=>WS,_custom:()=>jS,_cuid2:()=>pD,_cuid:()=>sD,_coercedString:()=>yS,_coercedNumber:()=>US,_coercedDate:()=>VS,_coercedBoolean:()=>$S,_coercedBigint:()=>GS,_cidrv6:()=>oa,_cidrv4:()=>Qa,_check:()=>Q4,_catch:()=>IUA,_boolean:()=>YS,_bigint:()=>kS,_base64url:()=>ea,_base64:()=>Ia,_array:()=>HS,_any:()=>zS,TimePrecision:()=>aS,NEVER:()=>MC,JSONSchemaGenerator:()=>Pl,JSONSchema:()=>e4,Doc:()=>RD,$output:()=>hS,$input:()=>CS,$constructor:()=>k,$brand:()=>_u,$ZodXor:()=>VF,$ZodXID:()=>EF,$ZodVoid:()=>OF,$ZodUnknown:()=>PF,$ZodUnion:()=>WC,$ZodUndefined:()=>TF,$ZodUUID:()=>QF,$ZodURL:()=>IF,$ZodULID:()=>cF,$ZodType:()=>lA,$ZodTuple:()=>VD,$ZodTransform:()=>dF,$ZodTemplateLiteral:()=>eL,$ZodSymbol:()=>JF,$ZodSuccess:()=>nL,$ZodStringFormat:()=>ot,$ZodString:()=>Zo,$ZodSet:()=>_F,$ZodRegistry:()=>cS,$ZodRecord:()=>KF,$ZodRealError:()=>zg,$ZodReadonly:()=>IL,$ZodPromise:()=>hL,$ZodPrefault:()=>tL,$ZodPipe:()=>oL,$ZodOptional:()=>XD,$ZodObjectJIT:()=>WF,$ZodObject:()=>I2,$ZodNumberFormat:()=>kF,$ZodNumber:()=>ZD,$ZodNullable:()=>pF,$ZodNull:()=>RF,$ZodNonOptional:()=>gL,$ZodNever:()=>zF,$ZodNanoID:()=>BF,$ZodNaN:()=>QL,$ZodMap:()=>jF,$ZodMAC:()=>uF,$ZodLiteral:()=>xF,$ZodLazy:()=>CL,$ZodKSUID:()=>yF,$ZodJWT:()=>YF,$ZodIntersection:()=>HF,$ZodISOTime:()=>wF,$ZodISODuration:()=>rF,$ZodISODateTime:()=>DF,$ZodISODate:()=>aF,$ZodIPv6:()=>NF,$ZodIPv4:()=>bF,$ZodGUID:()=>iF,$ZodFunction:()=>BL,$ZodFile:()=>qF,$ZodExactOptional:()=>sF,$ZodError:()=>RC,$ZodEnum:()=>mF,$ZodEncodeError:()=>zo,$ZodEmoji:()=>eF,$ZodEmail:()=>oF,$ZodE164:()=>MF,$ZodDiscriminatedUnion:()=>XF,$ZodDefault:()=>AL,$ZodDate:()=>vF,$ZodCustomStringFormat:()=>$F,$ZodCustom:()=>cL,$ZodCodec:()=>VC,$ZodCheckUpperCase:()=>mU,$ZodCheckStringFormat:()=>be,$ZodCheckStartsWith:()=>qU,$ZodCheckSizeEquals:()=>VU,$ZodCheckRegex:()=>jU,$ZodCheckProperty:()=>sU,$ZodCheckOverwrite:()=>AF,$ZodCheckNumberFormat:()=>OU,$ZodCheckMultipleOf:()=>zU,$ZodCheckMinSize:()=>WU,$ZodCheckMinLength:()=>HU,$ZodCheckMimeType:()=>pU,$ZodCheckMaxSize:()=>ZU,$ZodCheckMaxLength:()=>XU,$ZodCheckLowerCase:()=>_U,$ZodCheckLessThan:()=>GD,$ZodCheckLengthEquals:()=>KU,$ZodCheckIncludes:()=>xU,$ZodCheckGreaterThan:()=>JD,$ZodCheckEndsWith:()=>dU,$ZodCheckBigIntFormat:()=>vU,$ZodCheck:()=>ht,$ZodCatch:()=>iL,$ZodCUID2:()=>CF,$ZodCUID:()=>hF,$ZodCIDRv6:()=>FF,$ZodCIDRv4:()=>UF,$ZodBoolean:()=>ZC,$ZodBigIntFormat:()=>GF,$ZodBigInt:()=>WD,$ZodBase64URL:()=>lF,$ZodBase64:()=>SF,$ZodAsyncError:()=>Ci,$ZodArray:()=>ZF,$ZodAny:()=>fF});var nn=D(()=>{cA();kD();BS();sC();I4();B4();Ce();eU();QU();EL();TD();gF();mC();o4();dC()});var Na={};ei(Na,{uppercase:()=>Fe,trim:()=>$e,toUpperCase:()=>Ge,toLowerCase:()=>ke,startsWith:()=>Se,slugify:()=>Je,size:()=>Wo,regex:()=>ue,property:()=>Da,positive:()=>Ca,overwrite:()=>Xn,normalize:()=>Ye,nonpositive:()=>Ea,nonnegative:()=>ya,negative:()=>ca,multipleOf:()=>JQ,minSize:()=>yi,minLength:()=>qi,mime:()=>Me,maxSize:()=>TQ,maxLength:()=>Vo,lte:()=>gn,lt:()=>ci,lowercase:()=>Ue,length:()=>Xo,includes:()=>Le,gte:()=>Fg,gt:()=>Ei,endsWith:()=>le});var ua=D(()=>{nn()});var zQ={};ei(zQ,{time:()=>vl,duration:()=>Zl,datetime:()=>zl,date:()=>Ol,ZodISOTime:()=>La,ZodISODuration:()=>Sa,ZodISODateTime:()=>Ua,ZodISODate:()=>Fa});function zl(A){return wS(Ua,A)}function Ol(A){return rS(Fa,A)}function vl(A){return bS(La,A)}function Zl(A){return NS(Sa,A)}var Ua,Fa,La,Sa;var pC=D(()=>{nn();tc();Ua=k("ZodISODateTime",(A,t)=>{DF.init(A,t),It.init(A,t)});Fa=k("ZodISODate",(A,t)=>{aF.init(A,t),It.init(A,t)});La=k("ZodISOTime",(A,t)=>{wF.init(A,t),It.init(A,t)});Sa=k("ZodISODuration",(A,t)=>{rF.init(A,t),It.init(A,t)})});var h4=(A,t)=>{RC.init(A,t),A.name="ZodError",Object.defineProperties(A,{format:{value:(g)=>PC(A,g)},flatten:{value:(g)=>fC(A,g)},addIssue:{value:(g)=>{A.issues.push(g),A.message=JSON.stringify(A.issues,ce,2)}},addIssues:{value:(g)=>{A.issues.push(...g),A.message=JSON.stringify(A.issues,ce,2)}},isEmpty:{get(){return A.issues.length===0}}})},DUA,Og;var Wl=D(()=>{nn();nn();cA();DUA=k("ZodError",h4),Og=k("ZodError",h4,{Parent:Error})});var Vl,Xl,Hl,Kl,jl,_l,ml,xl,ql,dl,sl,pl;var AM=D(()=>{nn();Wl();Vl=De(Og),Xl=ae(Og),Hl=we(Og),Kl=re(Og),jl=uD(Og),_l=UD(Og),ml=FD(Og),xl=LD(Og),ql=SD(Og),dl=lD(Og),sl=MD(Og),pl=YD(Og)});var Ac={};ei(Ac,{xor:()=>d4,xid:()=>F4,void:()=>_4,uuidv7:()=>a4,uuidv6:()=>D4,uuidv4:()=>y4,uuid:()=>E4,url:()=>$a,unknown:()=>et,union:()=>Bt,undefined:()=>j4,ulid:()=>U4,uint64:()=>H4,uint32:()=>W4,tuple:()=>yM,transform:()=>ma,templateLiteral:()=>eZ,symbol:()=>K4,superRefine:()=>ZM,success:()=>QZ,stringbool:()=>DZ,stringFormat:()=>R4,string:()=>l,strictObject:()=>q4,set:()=>tZ,refine:()=>vM,record:()=>At,readonly:()=>TM,promise:()=>BZ,preprocess:()=>Ec,prefault:()=>lM,pipe:()=>ic,partialRecord:()=>s4,optional:()=>Ct,object:()=>gA,number:()=>vA,nullish:()=>iZ,nullable:()=>nc,null:()=>oc,nonoptional:()=>MM,never:()=>_a,nativeEnum:()=>gZ,nanoid:()=>b4,nan:()=>oZ,meta:()=>EZ,map:()=>AZ,mac:()=>l4,looseRecord:()=>p4,looseObject:()=>kt,literal:()=>BA,lazy:()=>PM,ksuid:()=>L4,keyof:()=>x4,jwt:()=>T4,json:()=>aZ,ipv6:()=>M4,ipv4:()=>S4,intersection:()=>We,int64:()=>X4,int32:()=>Z4,int:()=>la,instanceof:()=>yZ,httpUrl:()=>w4,hostname:()=>f4,hex:()=>P4,hash:()=>z4,guid:()=>c4,function:()=>hZ,float64:()=>v4,float32:()=>O4,file:()=>nZ,exactOptional:()=>uM,enum:()=>pt,emoji:()=>r4,email:()=>C4,e164:()=>J4,discriminatedUnion:()=>hc,describe:()=>cZ,date:()=>m4,custom:()=>pa,cuid2:()=>u4,cuid:()=>N4,codec:()=>IZ,cidrv6:()=>$4,cidrv4:()=>Y4,check:()=>CZ,catch:()=>kM,boolean:()=>sA,bigint:()=>V4,base64url:()=>G4,base64:()=>k4,array:()=>AA,any:()=>ja,_function:()=>hZ,_default:()=>LM,_ZodString:()=>Ma,ZodXor:()=>hM,ZodXID:()=>fa,ZodVoid:()=>eM,ZodUnknown:()=>oM,ZodUnion:()=>Bc,ZodUndefined:()=>nM,ZodUUID:()=>Di,ZodURL:()=>Qc,ZodULID:()=>Ra,ZodType:()=>JA,ZodTuple:()=>EM,ZodTransform:()=>bM,ZodTemplateLiteral:()=>RM,ZodSymbol:()=>gM,ZodSuccess:()=>YM,ZodStringFormat:()=>It,ZodString:()=>Pe,ZodSet:()=>aM,ZodRecord:()=>Cc,ZodReadonly:()=>JM,ZodPromise:()=>zM,ZodPrefault:()=>SM,ZodPipe:()=>da,ZodOptional:()=>xa,ZodObject:()=>ec,ZodNumberFormat:()=>Ho,ZodNumber:()=>Oe,ZodNullable:()=>UM,ZodNull:()=>iM,ZodNonOptional:()=>qa,ZodNever:()=>IM,ZodNanoID:()=>Ga,ZodNaN:()=>GM,ZodMap:()=>DM,ZodMAC:()=>tM,ZodLiteral:()=>wM,ZodLazy:()=>fM,ZodKSUID:()=>Pa,ZodJWT:()=>Ha,ZodIntersection:()=>cM,ZodIPv6:()=>Oa,ZodIPv4:()=>za,ZodGUID:()=>gc,ZodFunction:()=>OM,ZodFile:()=>rM,ZodExactOptional:()=>NM,ZodEnum:()=>fe,ZodEmoji:()=>ka,ZodEmail:()=>Ya,ZodE164:()=>Xa,ZodDiscriminatedUnion:()=>CM,ZodDefault:()=>FM,ZodDate:()=>Ic,ZodCustomStringFormat:()=>ze,ZodCustom:()=>cc,ZodCodec:()=>sa,ZodCatch:()=>$M,ZodCUID2:()=>Ta,ZodCUID:()=>Ja,ZodCIDRv6:()=>Za,ZodCIDRv4:()=>va,ZodBoolean:()=>ve,ZodBigIntFormat:()=>Ka,ZodBigInt:()=>Ze,ZodBase64URL:()=>Va,ZodBase64:()=>Wa,ZodArray:()=>BM,ZodAny:()=>QM});function l(A){return ES(Pe,A)}function C4(A){return KD(Ya,A)}function c4(A){return xC(gc,A)}function E4(A){return jD(Di,A)}function y4(A){return _D(Di,A)}function D4(A){return mD(Di,A)}function a4(A){return xD(Di,A)}function $a(A){return qC(Qc,A)}function w4(A){return qC(Qc,{protocol:/^https?$/,hostname:un.domain,...q.normalizeParams(A)})}function r4(A){return qD(ka,A)}function b4(A){return dD(Ga,A)}function N4(A){return sD(Ja,A)}function u4(A){return pD(Ta,A)}function U4(A){return Aa(Ra,A)}function F4(A){return ta(fa,A)}function L4(A){return ga(Pa,A)}function S4(A){return na(za,A)}function l4(A){return DS(tM,A)}function M4(A){return ia(Oa,A)}function Y4(A){return Qa(va,A)}function $4(A){return oa(Za,A)}function k4(A){return Ia(Wa,A)}function G4(A){return ea(Va,A)}function J4(A){return Ba(Xa,A)}function T4(A){return ha(Ha,A)}function R4(A,t,g={}){return Te(ze,A,t,g)}function f4(A){return Te(ze,"hostname",un.hostname,A)}function P4(A){return Te(ze,"hex",un.hex,A)}function z4(A,t){let g=t?.enc??"hex",i=`${A}_${g}`,n=un[i];if(!n)throw Error(`Unrecognized hash format: ${i}`);return Te(ze,i,n,t)}function vA(A){return uS(Oe,A)}function la(A){return FS(Ho,A)}function O4(A){return LS(Ho,A)}function v4(A){return SS(Ho,A)}function Z4(A){return lS(Ho,A)}function W4(A){return MS(Ho,A)}function sA(A){return YS(ve,A)}function V4(A){return kS(Ze,A)}function X4(A){return JS(Ka,A)}function H4(A){return TS(Ka,A)}function K4(A){return RS(gM,A)}function j4(A){return fS(nM,A)}function oc(A){return PS(iM,A)}function ja(){return zS(QM)}function et(){return OS(oM)}function _a(A){return vS(IM,A)}function _4(A){return ZS(eM,A)}function m4(A){return WS(Ic,A)}function AA(A,t){return HS(BM,A,t)}function x4(A){let t=A._zod.def.shape;return pt(Object.keys(t))}function gA(A,t){let g={type:"object",shape:A??{},...q.normalizeParams(t)};return new ec(g)}function q4(A,t){return new ec({type:"object",shape:A,catchall:_a(),...q.normalizeParams(t)})}function kt(A,t){return new ec({type:"object",shape:A,catchall:et(),...q.normalizeParams(t)})}function Bt(A,t){return new Bc({type:"union",options:A,...q.normalizeParams(t)})}function d4(A,t){return new hM({type:"union",options:A,inclusive:!1,...q.normalizeParams(t)})}function hc(A,t,g){return new CM({type:"union",options:t,discriminator:A,...q.normalizeParams(g)})}function We(A,t){return new cM({type:"intersection",left:A,right:t})}function yM(A,t,g){let i=t instanceof lA,n=i?g:t;return new EM({type:"tuple",items:A,rest:i?t:null,...q.normalizeParams(n)})}function At(A,t,g){return new Cc({type:"record",keyType:A,valueType:t,...q.normalizeParams(g)})}function s4(A,t,g){let i=Ug(A);return i._zod.values=void 0,new Cc({type:"record",keyType:i,valueType:t,...q.normalizeParams(g)})}function p4(A,t,g){return new Cc({type:"record",keyType:A,valueType:t,mode:"loose",...q.normalizeParams(g)})}function AZ(A,t,g){return new DM({type:"map",keyType:A,valueType:t,...q.normalizeParams(g)})}function tZ(A,t){return new aM({type:"set",valueType:A,...q.normalizeParams(t)})}function pt(A,t){let g=Array.isArray(A)?Object.fromEntries(A.map((i)=>[i,i])):A;return new fe({type:"enum",entries:g,...q.normalizeParams(t)})}function gZ(A,t){return new fe({type:"enum",entries:A,...q.normalizeParams(t)})}function BA(A,t){return new wM({type:"literal",values:Array.isArray(A)?A:[A],...q.normalizeParams(t)})}function nZ(A){return KS(rM,A)}function ma(A){return new bM({type:"transform",transform:A})}function Ct(A){return new xa({type:"optional",innerType:A})}function uM(A){return new NM({type:"optional",innerType:A})}function nc(A){return new UM({type:"nullable",innerType:A})}function iZ(A){return Ct(nc(A))}function LM(A,t){return new FM({type:"default",innerType:A,get defaultValue(){return typeof t==="function"?t():q.shallowClone(t)}})}function lM(A,t){return new SM({type:"prefault",innerType:A,get defaultValue(){return typeof t==="function"?t():q.shallowClone(t)}})}function MM(A,t){return new qa({type:"nonoptional",innerType:A,...q.normalizeParams(t)})}function QZ(A){return new YM({type:"success",innerType:A})}function kM(A,t){return new $M({type:"catch",innerType:A,catchValue:typeof t==="function"?t:()=>t})}function oZ(A){return XS(GM,A)}function ic(A,t){return new da({type:"pipe",in:A,out:t})}function IZ(A,t,g){return new sa({type:"pipe",in:A,out:t,transform:g.decode,reverseTransform:g.encode})}function TM(A){return new JM({type:"readonly",innerType:A})}function eZ(A,t){return new RM({type:"template_literal",parts:A,...q.normalizeParams(t)})}function PM(A){return new fM({type:"lazy",getter:A})}function BZ(A){return new zM({type:"promise",innerType:A})}function hZ(A){return new OM({type:"function",input:Array.isArray(A?.input)?yM(A?.input):A?.input??AA(et()),output:A?.output??et()})}function CZ(A){let t=new ht({check:"custom"});return t._zod.check=A,t}function pa(A,t){return jS(cc,A??(()=>!0),t)}function vM(A,t={}){return _S(cc,A,t)}function ZM(A){return mS(A)}function yZ(A,t={}){let g=new cc({type:"custom",check:"custom",fn:(i)=>i instanceof A,abort:!0,...q.normalizeParams(t)});return g._zod.bag.Class=A,g._zod.check=(i)=>{if(!(i.value instanceof A))i.issues.push({code:"invalid_type",expected:A.name,input:i.value,inst:g,path:[...g._zod.def.path??[]]})},g}function aZ(A){let t=PM(()=>{return Bt([l(A),vA(),sA(),oc(),AA(t),At(l(),t)])});return t}function Ec(A,t){return ic(ma(A),t)}var JA,Ma,Pe,It,Ya,gc,Di,Qc,ka,Ga,Ja,Ta,Ra,fa,Pa,za,tM,Oa,va,Za,Wa,Va,Xa,Ha,ze,Oe,Ho,ve,Ze,Ka,gM,nM,iM,QM,oM,IM,eM,Ic,BM,ec,Bc,hM,CM,cM,EM,Cc,DM,aM,fe,wM,rM,bM,xa,NM,UM,FM,SM,qa,YM,$M,GM,da,sa,JM,RM,fM,zM,OM,cc,cZ,EZ,DZ=(...A)=>dS({Codec:sa,Boolean:ve,String:Pe},...A);var tc=D(()=>{nn();nn();sC();dC();ua();pC();AM();JA=k("ZodType",(A,t)=>{return lA.init(A,t),Object.assign(A["~standard"],{jsonSchema:{input:Re(A,"input"),output:Re(A,"output")}}),A.toJSONSchema=sS(A,{}),A.def=t,A.type=t.type,Object.defineProperty(A,"_def",{value:t}),A.check=(...g)=>{return A.clone(q.mergeDefs(t,{checks:[...t.checks??[],...g.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},A.with=A.check,A.clone=(g,i)=>Ug(A,g,i),A.brand=()=>A,A.register=(g,i)=>{return g.add(A,i),A},A.parse=(g,i)=>Vl(A,g,i,{callee:A.parse}),A.safeParse=(g,i)=>Hl(A,g,i),A.parseAsync=async(g,i)=>Xl(A,g,i,{callee:A.parseAsync}),A.safeParseAsync=async(g,i)=>Kl(A,g,i),A.spa=A.safeParseAsync,A.encode=(g,i)=>jl(A,g,i),A.decode=(g,i)=>_l(A,g,i),A.encodeAsync=async(g,i)=>ml(A,g,i),A.decodeAsync=async(g,i)=>xl(A,g,i),A.safeEncode=(g,i)=>ql(A,g,i),A.safeDecode=(g,i)=>dl(A,g,i),A.safeEncodeAsync=async(g,i)=>sl(A,g,i),A.safeDecodeAsync=async(g,i)=>pl(A,g,i),A.refine=(g,i)=>A.check(vM(g,i)),A.superRefine=(g)=>A.check(ZM(g)),A.overwrite=(g)=>A.check(Xn(g)),A.optional=()=>Ct(A),A.exactOptional=()=>uM(A),A.nullable=()=>nc(A),A.nullish=()=>Ct(nc(A)),A.nonoptional=(g)=>MM(A,g),A.array=()=>AA(A),A.or=(g)=>Bt([A,g]),A.and=(g)=>We(A,g),A.transform=(g)=>ic(A,ma(g)),A.default=(g)=>LM(A,g),A.prefault=(g)=>lM(A,g),A.catch=(g)=>kM(A,g),A.pipe=(g)=>ic(A,g),A.readonly=()=>TM(A),A.describe=(g)=>{let i=A.clone();return st.add(i,{description:g}),i},Object.defineProperty(A,"description",{get(){return st.get(A)?.description},configurable:!0}),A.meta=(...g)=>{if(g.length===0)return st.get(A);let i=A.clone();return st.add(i,g[0]),i},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A.apply=(g)=>g(A),A}),Ma=k("_ZodString",(A,t)=>{Zo.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>pS(A,i,n,Q);let g=A._zod.bag;A.format=g.format??null,A.minLength=g.minimum??null,A.maxLength=g.maximum??null,A.regex=(...i)=>A.check(ue(...i)),A.includes=(...i)=>A.check(Le(...i)),A.startsWith=(...i)=>A.check(Se(...i)),A.endsWith=(...i)=>A.check(le(...i)),A.min=(...i)=>A.check(qi(...i)),A.max=(...i)=>A.check(Vo(...i)),A.length=(...i)=>A.check(Xo(...i)),A.nonempty=(...i)=>A.check(qi(1,...i)),A.lowercase=(i)=>A.check(Ue(i)),A.uppercase=(i)=>A.check(Fe(i)),A.trim=()=>A.check($e()),A.normalize=(...i)=>A.check(Ye(...i)),A.toLowerCase=()=>A.check(ke()),A.toUpperCase=()=>A.check(Ge()),A.slugify=()=>A.check(Je())}),Pe=k("ZodString",(A,t)=>{Zo.init(A,t),Ma.init(A,t),A.email=(g)=>A.check(KD(Ya,g)),A.url=(g)=>A.check(qC(Qc,g)),A.jwt=(g)=>A.check(ha(Ha,g)),A.emoji=(g)=>A.check(qD(ka,g)),A.guid=(g)=>A.check(xC(gc,g)),A.uuid=(g)=>A.check(jD(Di,g)),A.uuidv4=(g)=>A.check(_D(Di,g)),A.uuidv6=(g)=>A.check(mD(Di,g)),A.uuidv7=(g)=>A.check(xD(Di,g)),A.nanoid=(g)=>A.check(dD(Ga,g)),A.guid=(g)=>A.check(xC(gc,g)),A.cuid=(g)=>A.check(sD(Ja,g)),A.cuid2=(g)=>A.check(pD(Ta,g)),A.ulid=(g)=>A.check(Aa(Ra,g)),A.base64=(g)=>A.check(Ia(Wa,g)),A.base64url=(g)=>A.check(ea(Va,g)),A.xid=(g)=>A.check(ta(fa,g)),A.ksuid=(g)=>A.check(ga(Pa,g)),A.ipv4=(g)=>A.check(na(za,g)),A.ipv6=(g)=>A.check(ia(Oa,g)),A.cidrv4=(g)=>A.check(Qa(va,g)),A.cidrv6=(g)=>A.check(oa(Za,g)),A.e164=(g)=>A.check(Ba(Xa,g)),A.datetime=(g)=>A.check(zl(g)),A.date=(g)=>A.check(Ol(g)),A.time=(g)=>A.check(vl(g)),A.duration=(g)=>A.check(Zl(g))});It=k("ZodStringFormat",(A,t)=>{ot.init(A,t),Ma.init(A,t)}),Ya=k("ZodEmail",(A,t)=>{oF.init(A,t),It.init(A,t)});gc=k("ZodGUID",(A,t)=>{iF.init(A,t),It.init(A,t)});Di=k("ZodUUID",(A,t)=>{QF.init(A,t),It.init(A,t)});Qc=k("ZodURL",(A,t)=>{IF.init(A,t),It.init(A,t)});ka=k("ZodEmoji",(A,t)=>{eF.init(A,t),It.init(A,t)});Ga=k("ZodNanoID",(A,t)=>{BF.init(A,t),It.init(A,t)});Ja=k("ZodCUID",(A,t)=>{hF.init(A,t),It.init(A,t)});Ta=k("ZodCUID2",(A,t)=>{CF.init(A,t),It.init(A,t)});Ra=k("ZodULID",(A,t)=>{cF.init(A,t),It.init(A,t)});fa=k("ZodXID",(A,t)=>{EF.init(A,t),It.init(A,t)});Pa=k("ZodKSUID",(A,t)=>{yF.init(A,t),It.init(A,t)});za=k("ZodIPv4",(A,t)=>{bF.init(A,t),It.init(A,t)});tM=k("ZodMAC",(A,t)=>{uF.init(A,t),It.init(A,t)});Oa=k("ZodIPv6",(A,t)=>{NF.init(A,t),It.init(A,t)});va=k("ZodCIDRv4",(A,t)=>{UF.init(A,t),It.init(A,t)});Za=k("ZodCIDRv6",(A,t)=>{FF.init(A,t),It.init(A,t)});Wa=k("ZodBase64",(A,t)=>{SF.init(A,t),It.init(A,t)});Va=k("ZodBase64URL",(A,t)=>{lF.init(A,t),It.init(A,t)});Xa=k("ZodE164",(A,t)=>{MF.init(A,t),It.init(A,t)});Ha=k("ZodJWT",(A,t)=>{YF.init(A,t),It.init(A,t)});ze=k("ZodCustomStringFormat",(A,t)=>{$F.init(A,t),It.init(A,t)});Oe=k("ZodNumber",(A,t)=>{ZD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>Al(A,i,n,Q),A.gt=(i,n)=>A.check(Ei(i,n)),A.gte=(i,n)=>A.check(Fg(i,n)),A.min=(i,n)=>A.check(Fg(i,n)),A.lt=(i,n)=>A.check(ci(i,n)),A.lte=(i,n)=>A.check(gn(i,n)),A.max=(i,n)=>A.check(gn(i,n)),A.int=(i)=>A.check(la(i)),A.safe=(i)=>A.check(la(i)),A.positive=(i)=>A.check(Ei(0,i)),A.nonnegative=(i)=>A.check(Fg(0,i)),A.negative=(i)=>A.check(ci(0,i)),A.nonpositive=(i)=>A.check(gn(0,i)),A.multipleOf=(i,n)=>A.check(JQ(i,n)),A.step=(i,n)=>A.check(JQ(i,n)),A.finite=()=>A;let g=A._zod.bag;A.minValue=Math.max(g.minimum??Number.NEGATIVE_INFINITY,g.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min(g.maximum??Number.POSITIVE_INFINITY,g.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=(g.format??"").includes("int")||Number.isSafeInteger(g.multipleOf??0.5),A.isFinite=!0,A.format=g.format??null});Ho=k("ZodNumberFormat",(A,t)=>{kF.init(A,t),Oe.init(A,t)});ve=k("ZodBoolean",(A,t)=>{ZC.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>tl(A,g,i,n)});Ze=k("ZodBigInt",(A,t)=>{WD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>gl(A,i,n,Q),A.gte=(i,n)=>A.check(Fg(i,n)),A.min=(i,n)=>A.check(Fg(i,n)),A.gt=(i,n)=>A.check(Ei(i,n)),A.gte=(i,n)=>A.check(Fg(i,n)),A.min=(i,n)=>A.check(Fg(i,n)),A.lt=(i,n)=>A.check(ci(i,n)),A.lte=(i,n)=>A.check(gn(i,n)),A.max=(i,n)=>A.check(gn(i,n)),A.positive=(i)=>A.check(Ei(BigInt(0),i)),A.negative=(i)=>A.check(ci(BigInt(0),i)),A.nonpositive=(i)=>A.check(gn(BigInt(0),i)),A.nonnegative=(i)=>A.check(Fg(BigInt(0),i)),A.multipleOf=(i,n)=>A.check(JQ(i,n));let g=A._zod.bag;A.minValue=g.minimum??null,A.maxValue=g.maximum??null,A.format=g.format??null});Ka=k("ZodBigIntFormat",(A,t)=>{GF.init(A,t),Ze.init(A,t)});gM=k("ZodSymbol",(A,t)=>{JF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>nl(A,g,i,n)});nM=k("ZodUndefined",(A,t)=>{TF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ql(A,g,i,n)});iM=k("ZodNull",(A,t)=>{RF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>il(A,g,i,n)});QM=k("ZodAny",(A,t)=>{fF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>el(A,g,i,n)});oM=k("ZodUnknown",(A,t)=>{PF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Bl(A,g,i,n)});IM=k("ZodNever",(A,t)=>{zF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Il(A,g,i,n)});eM=k("ZodVoid",(A,t)=>{OF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ol(A,g,i,n)});Ic=k("ZodDate",(A,t)=>{vF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>hl(A,i,n,Q),A.min=(i,n)=>A.check(Fg(i,n)),A.max=(i,n)=>A.check(gn(i,n));let g=A._zod.bag;A.minDate=g.minimum?new Date(g.minimum):null,A.maxDate=g.maximum?new Date(g.maximum):null});BM=k("ZodArray",(A,t)=>{ZF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ul(A,g,i,n),A.element=t.element,A.min=(g,i)=>A.check(qi(g,i)),A.nonempty=(g)=>A.check(qi(1,g)),A.max=(g,i)=>A.check(Vo(g,i)),A.length=(g,i)=>A.check(Xo(g,i)),A.unwrap=()=>A.element});ec=k("ZodObject",(A,t)=>{WF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Fl(A,g,i,n),q.defineLazy(A,"shape",()=>{return t.shape}),A.keyof=()=>pt(Object.keys(A._zod.def.shape)),A.catchall=(g)=>A.clone({...A._zod.def,catchall:g}),A.passthrough=()=>A.clone({...A._zod.def,catchall:et()}),A.loose=()=>A.clone({...A._zod.def,catchall:et()}),A.strict=()=>A.clone({...A._zod.def,catchall:_a()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=(g)=>{return q.extend(A,g)},A.safeExtend=(g)=>{return q.safeExtend(A,g)},A.merge=(g)=>q.merge(A,g),A.pick=(g)=>q.pick(A,g),A.omit=(g)=>q.omit(A,g),A.partial=(...g)=>q.partial(xa,A,g[0]),A.required=(...g)=>q.required(qa,A,g[0])});Bc=k("ZodUnion",(A,t)=>{WC.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wa(A,g,i,n),A.options=t.options});hM=k("ZodXor",(A,t)=>{Bc.init(A,t),VF.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wa(A,g,i,n),A.options=t.options});CM=k("ZodDiscriminatedUnion",(A,t)=>{Bc.init(A,t),XF.init(A,t)});cM=k("ZodIntersection",(A,t)=>{HF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ll(A,g,i,n)});EM=k("ZodTuple",(A,t)=>{VD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Sl(A,g,i,n),A.rest=(g)=>A.clone({...A._zod.def,rest:g})});Cc=k("ZodRecord",(A,t)=>{KF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ll(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType});DM=k("ZodMap",(A,t)=>{jF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Nl(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType,A.min=(...g)=>A.check(yi(...g)),A.nonempty=(g)=>A.check(yi(1,g)),A.max=(...g)=>A.check(TQ(...g)),A.size=(...g)=>A.check(Wo(...g))});aM=k("ZodSet",(A,t)=>{_F.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ul(A,g,i,n),A.min=(...g)=>A.check(yi(...g)),A.nonempty=(g)=>A.check(yi(1,g)),A.max=(...g)=>A.check(TQ(...g)),A.size=(...g)=>A.check(Wo(...g))});fe=k("ZodEnum",(A,t)=>{mF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>Cl(A,i,n,Q),A.enum=t.entries,A.options=Object.values(t.entries);let g=new Set(Object.keys(t.entries));A.extract=(i,n)=>{let Q={};for(let o of i)if(g.has(o))Q[o]=t.entries[o];else throw Error(`Key ${o} not found in enum`);return new fe({...t,checks:[],...q.normalizeParams(n),entries:Q})},A.exclude=(i,n)=>{let Q={...t.entries};for(let o of i)if(g.has(o))delete Q[o];else throw Error(`Key ${o} not found in enum`);return new fe({...t,checks:[],...q.normalizeParams(n),entries:Q})}});wM=k("ZodLiteral",(A,t)=>{xF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>cl(A,g,i,n),A.values=new Set(t.values),Object.defineProperty(A,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});rM=k("ZodFile",(A,t)=>{qF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Dl(A,g,i,n),A.min=(g,i)=>A.check(yi(g,i)),A.max=(g,i)=>A.check(TQ(g,i)),A.mime=(g,i)=>A.check(Me(Array.isArray(g)?g:[g],i))});bM=k("ZodTransform",(A,t)=>{dF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>bl(A,g,i,n),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new zo(A.constructor.name);g.addIssue=(Q)=>{if(typeof Q==="string")g.issues.push(q.issue(Q,g.value,t));else{let o=Q;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=g.value),o.inst??(o.inst=A),g.issues.push(q.issue(o))}};let n=t.transform(g.value,g);if(n instanceof Promise)return n.then((Q)=>{return g.value=Q,g});return g.value=n,g}});xa=k("ZodOptional",(A,t)=>{XD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ra(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});NM=k("ZodExactOptional",(A,t)=>{sF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ra(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});UM=k("ZodNullable",(A,t)=>{pF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ml(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});FM=k("ZodDefault",(A,t)=>{AL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>$l(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});SM=k("ZodPrefault",(A,t)=>{tL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>kl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});qa=k("ZodNonOptional",(A,t)=>{gL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Yl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});YM=k("ZodSuccess",(A,t)=>{nL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>al(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});$M=k("ZodCatch",(A,t)=>{iL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Gl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});GM=k("ZodNaN",(A,t)=>{QL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>El(A,g,i,n)});da=k("ZodPipe",(A,t)=>{oL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Jl(A,g,i,n),A.in=t.in,A.out=t.out});sa=k("ZodCodec",(A,t)=>{da.init(A,t),VC.init(A,t)});JM=k("ZodReadonly",(A,t)=>{IL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Tl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});RM=k("ZodTemplateLiteral",(A,t)=>{eL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>yl(A,g,i,n)});fM=k("ZodLazy",(A,t)=>{CL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>fl(A,g,i,n),A.unwrap=()=>A._zod.def.getter()});zM=k("ZodPromise",(A,t)=>{hL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Rl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});OM=k("ZodFunction",(A,t)=>{BL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>rl(A,g,i,n)});cc=k("ZodCustom",(A,t)=>{cL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wl(A,g,i,n)});cZ=xS,EZ=qS});function wUA(A){$t({customError:A})}function rUA(){return $t().customError}var VM,WM;var wZ=D(()=>{nn();VM={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"};(function(A){})(WM||(WM={}))});function NUA(A,t){let g=A.$schema;if(g==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(g==="http://json-schema.org/draft-07/schema#")return"draft-7";if(g==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function uUA(A,t){if(!A.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let g=A.slice(1).split("/").filter(Boolean);if(g.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===i){let n=g[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${A}`);return t.defs[n]}throw Error(`Reference not found: ${A}`)}function rZ(A,t){if(A.not!==void 0){if(typeof A.not==="object"&&Object.keys(A.not).length===0)return QA.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(A.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(A.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(A.if!==void 0||A.then!==void 0||A.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(A.dependentSchemas!==void 0||A.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(A.$ref){let n=A.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return QA.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let Q=uUA(n,t),o=cg(Q,t);return t.refs.set(n,o),t.processing.delete(n),o}if(A.enum!==void 0){let n=A.enum;if(t.version==="openapi-3.0"&&A.nullable===!0&&n.length===1&&n[0]===null)return QA.null();if(n.length===0)return QA.never();if(n.length===1)return QA.literal(n[0]);if(n.every((o)=>typeof o==="string"))return QA.enum(n);let Q=n.map((o)=>QA.literal(o));if(Q.length<2)return Q[0];return QA.union([Q[0],Q[1],...Q.slice(2)])}if(A.const!==void 0)return QA.literal(A.const);let g=A.type;if(Array.isArray(g)){let n=g.map((Q)=>{let o={...A,type:Q};return rZ(o,t)});if(n.length===0)return QA.never();if(n.length===1)return n[0];return QA.union(n)}if(!g)return QA.any();let i;switch(g){case"string":{let n=QA.string();if(A.format){let Q=A.format;if(Q==="email")n=n.check(QA.email());else if(Q==="uri"||Q==="uri-reference")n=n.check(QA.url());else if(Q==="uuid"||Q==="guid")n=n.check(QA.uuid());else if(Q==="date-time")n=n.check(QA.iso.datetime());else if(Q==="date")n=n.check(QA.iso.date());else if(Q==="time")n=n.check(QA.iso.time());else if(Q==="duration")n=n.check(QA.iso.duration());else if(Q==="ipv4")n=n.check(QA.ipv4());else if(Q==="ipv6")n=n.check(QA.ipv6());else if(Q==="mac")n=n.check(QA.mac());else if(Q==="cidr")n=n.check(QA.cidrv4());else if(Q==="cidr-v6")n=n.check(QA.cidrv6());else if(Q==="base64")n=n.check(QA.base64());else if(Q==="base64url")n=n.check(QA.base64url());else if(Q==="e164")n=n.check(QA.e164());else if(Q==="jwt")n=n.check(QA.jwt());else if(Q==="emoji")n=n.check(QA.emoji());else if(Q==="nanoid")n=n.check(QA.nanoid());else if(Q==="cuid")n=n.check(QA.cuid());else if(Q==="cuid2")n=n.check(QA.cuid2());else if(Q==="ulid")n=n.check(QA.ulid());else if(Q==="xid")n=n.check(QA.xid());else if(Q==="ksuid")n=n.check(QA.ksuid())}if(typeof A.minLength==="number")n=n.min(A.minLength);if(typeof A.maxLength==="number")n=n.max(A.maxLength);if(A.pattern)n=n.regex(new RegExp(A.pattern));i=n;break}case"number":case"integer":{let n=g==="integer"?QA.number().int():QA.number();if(typeof A.minimum==="number")n=n.min(A.minimum);if(typeof A.maximum==="number")n=n.max(A.maximum);if(typeof A.exclusiveMinimum==="number")n=n.gt(A.exclusiveMinimum);else if(A.exclusiveMinimum===!0&&typeof A.minimum==="number")n=n.gt(A.minimum);if(typeof A.exclusiveMaximum==="number")n=n.lt(A.exclusiveMaximum);else if(A.exclusiveMaximum===!0&&typeof A.maximum==="number")n=n.lt(A.maximum);if(typeof A.multipleOf==="number")n=n.multipleOf(A.multipleOf);i=n;break}case"boolean":{i=QA.boolean();break}case"null":{i=QA.null();break}case"object":{let n={},Q=A.properties||{},o=new Set(A.required||[]);for(let[B,h]of Object.entries(Q)){let C=cg(h,t);n[B]=o.has(B)?C:C.optional()}if(A.propertyNames){let B=cg(A.propertyNames,t),h=A.additionalProperties&&typeof A.additionalProperties==="object"?cg(A.additionalProperties,t):QA.any();if(Object.keys(n).length===0){i=QA.record(B,h);break}let C=QA.object(n).passthrough(),c=QA.looseRecord(B,h);i=QA.intersection(C,c);break}if(A.patternProperties){let B=A.patternProperties,h=Object.keys(B),C=[];for(let E of h){let y=cg(B[E],t),a=QA.string().regex(new RegExp(E));C.push(QA.looseRecord(a,y))}let c=[];if(Object.keys(n).length>0)c.push(QA.object(n).passthrough());if(c.push(...C),c.length===0)i=QA.object({}).passthrough();else if(c.length===1)i=c[0];else{let E=QA.intersection(c[0],c[1]);for(let y=2;y<c.length;y++)E=QA.intersection(E,c[y]);i=E}break}let e=QA.object(n);if(A.additionalProperties===!1)i=e.strict();else if(typeof A.additionalProperties==="object")i=e.catchall(cg(A.additionalProperties,t));else i=e.passthrough();break}case"array":{let{prefixItems:n,items:Q}=A;if(n&&Array.isArray(n)){let o=n.map((B)=>cg(B,t)),e=Q&&typeof Q==="object"&&!Array.isArray(Q)?cg(Q,t):void 0;if(e)i=QA.tuple(o).rest(e);else i=QA.tuple(o);if(typeof A.minItems==="number")i=i.check(QA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(QA.maxLength(A.maxItems))}else if(Array.isArray(Q)){let o=Q.map((B)=>cg(B,t)),e=A.additionalItems&&typeof A.additionalItems==="object"?cg(A.additionalItems,t):void 0;if(e)i=QA.tuple(o).rest(e);else i=QA.tuple(o);if(typeof A.minItems==="number")i=i.check(QA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(QA.maxLength(A.maxItems))}else if(Q!==void 0){let o=cg(Q,t),e=QA.array(o);if(typeof A.minItems==="number")e=e.min(A.minItems);if(typeof A.maxItems==="number")e=e.max(A.maxItems);i=e}else i=QA.array(QA.any());break}default:throw Error(`Unsupported type: ${g}`)}if(A.description)i=i.describe(A.description);if(A.default!==void 0)i=i.default(A.default);return i}function cg(A,t){if(typeof A==="boolean")return A?QA.any():QA.never();let g=rZ(A,t),i=A.type||A.enum!==void 0||A.const!==void 0;if(A.anyOf&&Array.isArray(A.anyOf)){let e=A.anyOf.map((h)=>cg(h,t)),B=QA.union(e);g=i?QA.intersection(g,B):B}if(A.oneOf&&Array.isArray(A.oneOf)){let e=A.oneOf.map((h)=>cg(h,t)),B=QA.xor(e);g=i?QA.intersection(g,B):B}if(A.allOf&&Array.isArray(A.allOf))if(A.allOf.length===0)g=i?g:QA.any();else{let e=i?g:cg(A.allOf[0],t),B=i?0:1;for(let h=B;h<A.allOf.length;h++)e=QA.intersection(e,cg(A.allOf[h],t));g=e}if(A.nullable===!0&&t.version==="openapi-3.0")g=QA.nullable(g);if(A.readOnly===!0)g=QA.readonly(g);let n={},Q=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let e of Q)if(e in A)n[e]=A[e];let o=["contentEncoding","contentMediaType","contentSchema"];for(let e of o)if(e in A)n[e]=A[e];for(let e of Object.keys(A))if(!bUA.has(e))n[e]=A[e];if(Object.keys(n).length>0)t.registry.add(g,n);return g}function bZ(A,t){if(typeof A==="boolean")return A?QA.any():QA.never();let g=NUA(A,t?.defaultTarget),i=A.$defs||A.definitions||{},n={version:g,defs:i,refs:new Map,processing:new Set,rootSchema:A,registry:t?.registry??st};return cg(A,n)}var QA,bUA;var NZ=D(()=>{mC();ua();pC();tc();QA={...Ac,...Na,iso:zQ},bUA=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"])});var yc={};ei(yc,{string:()=>UUA,number:()=>FUA,date:()=>lUA,boolean:()=>LUA,bigint:()=>SUA});function UUA(A){return yS(Pe,A)}function FUA(A){return US(Oe,A)}function LUA(A){return $S(ve,A)}function SUA(A){return GS(Ze,A)}function lUA(A){return VS(Ic,A)}var uZ=D(()=>{nn();tc()});var I={};ei(I,{xor:()=>d4,xid:()=>F4,void:()=>_4,uuidv7:()=>a4,uuidv6:()=>D4,uuidv4:()=>y4,uuid:()=>E4,util:()=>q,url:()=>$a,uppercase:()=>Fe,unknown:()=>et,union:()=>Bt,undefined:()=>j4,ulid:()=>U4,uint64:()=>H4,uint32:()=>W4,tuple:()=>yM,trim:()=>$e,treeifyError:()=>nU,transform:()=>ma,toUpperCase:()=>Ge,toLowerCase:()=>ke,toJSONSchema:()=>ba,templateLiteral:()=>eZ,symbol:()=>K4,superRefine:()=>ZM,success:()=>QZ,stringbool:()=>DZ,stringFormat:()=>R4,string:()=>l,strictObject:()=>q4,startsWith:()=>Se,slugify:()=>Je,size:()=>Wo,setErrorMap:()=>wUA,set:()=>tZ,safeParseAsync:()=>Kl,safeParse:()=>Hl,safeEncodeAsync:()=>sl,safeEncode:()=>ql,safeDecodeAsync:()=>pl,safeDecode:()=>dl,registry:()=>HD,regexes:()=>un,regex:()=>ue,refine:()=>vM,record:()=>At,readonly:()=>TM,property:()=>Da,promise:()=>BZ,prettifyError:()=>iU,preprocess:()=>Ec,prefault:()=>lM,positive:()=>Ca,pipe:()=>ic,partialRecord:()=>s4,parseAsync:()=>Xl,parse:()=>Vl,overwrite:()=>Xn,optional:()=>Ct,object:()=>gA,number:()=>vA,nullish:()=>iZ,nullable:()=>nc,null:()=>oc,normalize:()=>Ye,nonpositive:()=>Ea,nonoptional:()=>MM,nonnegative:()=>ya,never:()=>_a,negative:()=>ca,nativeEnum:()=>gZ,nanoid:()=>b4,nan:()=>oZ,multipleOf:()=>JQ,minSize:()=>yi,minLength:()=>qi,mime:()=>Me,meta:()=>EZ,maxSize:()=>TQ,maxLength:()=>Vo,map:()=>AZ,mac:()=>l4,lte:()=>gn,lt:()=>ci,lowercase:()=>Ue,looseRecord:()=>p4,looseObject:()=>kt,locales:()=>_C,literal:()=>BA,length:()=>Xo,lazy:()=>PM,ksuid:()=>L4,keyof:()=>x4,jwt:()=>T4,json:()=>aZ,iso:()=>zQ,ipv6:()=>M4,ipv4:()=>S4,intersection:()=>We,int64:()=>X4,int32:()=>Z4,int:()=>la,instanceof:()=>yZ,includes:()=>Le,httpUrl:()=>w4,hostname:()=>f4,hex:()=>P4,hash:()=>z4,guid:()=>c4,gte:()=>Fg,gt:()=>Ei,globalRegistry:()=>st,getErrorMap:()=>rUA,function:()=>hZ,fromJSONSchema:()=>bZ,formatError:()=>PC,float64:()=>v4,float32:()=>O4,flattenError:()=>fC,file:()=>nZ,exactOptional:()=>uM,enum:()=>pt,endsWith:()=>le,encodeAsync:()=>ml,encode:()=>jl,emoji:()=>r4,email:()=>C4,e164:()=>J4,discriminatedUnion:()=>hc,describe:()=>cZ,decodeAsync:()=>xl,decode:()=>_l,date:()=>m4,custom:()=>pa,cuid2:()=>u4,cuid:()=>N4,core:()=>di,config:()=>$t,coerce:()=>yc,codec:()=>IZ,clone:()=>Ug,cidrv6:()=>$4,cidrv4:()=>Y4,check:()=>CZ,catch:()=>kM,boolean:()=>sA,bigint:()=>V4,base64url:()=>G4,base64:()=>k4,array:()=>AA,any:()=>ja,_function:()=>hZ,_default:()=>LM,_ZodString:()=>Ma,ZodXor:()=>hM,ZodXID:()=>fa,ZodVoid:()=>eM,ZodUnknown:()=>oM,ZodUnion:()=>Bc,ZodUndefined:()=>nM,ZodUUID:()=>Di,ZodURL:()=>Qc,ZodULID:()=>Ra,ZodType:()=>JA,ZodTuple:()=>EM,ZodTransform:()=>bM,ZodTemplateLiteral:()=>RM,ZodSymbol:()=>gM,ZodSuccess:()=>YM,ZodStringFormat:()=>It,ZodString:()=>Pe,ZodSet:()=>aM,ZodRecord:()=>Cc,ZodRealError:()=>Og,ZodReadonly:()=>JM,ZodPromise:()=>zM,ZodPrefault:()=>SM,ZodPipe:()=>da,ZodOptional:()=>xa,ZodObject:()=>ec,ZodNumberFormat:()=>Ho,ZodNumber:()=>Oe,ZodNullable:()=>UM,ZodNull:()=>iM,ZodNonOptional:()=>qa,ZodNever:()=>IM,ZodNanoID:()=>Ga,ZodNaN:()=>GM,ZodMap:()=>DM,ZodMAC:()=>tM,ZodLiteral:()=>wM,ZodLazy:()=>fM,ZodKSUID:()=>Pa,ZodJWT:()=>Ha,ZodIssueCode:()=>VM,ZodIntersection:()=>cM,ZodISOTime:()=>La,ZodISODuration:()=>Sa,ZodISODateTime:()=>Ua,ZodISODate:()=>Fa,ZodIPv6:()=>Oa,ZodIPv4:()=>za,ZodGUID:()=>gc,ZodFunction:()=>OM,ZodFirstPartyTypeKind:()=>WM,ZodFile:()=>rM,ZodExactOptional:()=>NM,ZodError:()=>DUA,ZodEnum:()=>fe,ZodEmoji:()=>ka,ZodEmail:()=>Ya,ZodE164:()=>Xa,ZodDiscriminatedUnion:()=>CM,ZodDefault:()=>FM,ZodDate:()=>Ic,ZodCustomStringFormat:()=>ze,ZodCustom:()=>cc,ZodCodec:()=>sa,ZodCatch:()=>$M,ZodCUID2:()=>Ta,ZodCUID:()=>Ja,ZodCIDRv6:()=>Za,ZodCIDRv4:()=>va,ZodBoolean:()=>ve,ZodBigIntFormat:()=>Ka,ZodBigInt:()=>Ze,ZodBase64URL:()=>Va,ZodBase64:()=>Wa,ZodArray:()=>BM,ZodAny:()=>QM,TimePrecision:()=>aS,NEVER:()=>MC,$output:()=>hS,$input:()=>CS,$brand:()=>_u});var Aw=D(()=>{nn();nn();UL();nn();sC();NZ();BS();pC();pC();uZ();tc();ua();Wl();AM();wZ();$t(XC())});var TA=D(()=>{Aw();Aw()});var UZ,FZ,LZ,SZ,lZ,MZ,YZ,$Z,kZ,GZ,JZ,TZ,RZ,XM,MUA,HM,fZ,YUA,KM="cursor",jM="GET",_M="control",mM="[DONE]";var PZ=D(()=>{TA();UZ=I.object({type:I.literal("run_started"),runId:I.string().describe("Server-assigned run ID for the started run.")}),FZ=I.object({type:I.literal("message_started"),messageId:I.string().describe("Server-assigned assistant message ID for this run.")}),LZ=I.object({type:I.literal("text_chunk"),messageId:I.string().describe("Assistant message the chunk belongs to."),content:I.string().describe("Incremental text delta to append.")}),SZ=I.object({type:I.literal("reasoning_chunk"),messageId:I.string().describe("Assistant message the chunk belongs to."),content:I.string().describe("Incremental reasoning delta to append.")}),lZ=I.object({type:I.literal("text_complete"),messageId:I.string().describe("Assistant message that completed."),content:I.string().describe("Full assistant text for the message.")}),MZ=I.object({type:I.literal("reasoning_complete"),messageId:I.string().describe("Assistant message that completed."),content:I.string().describe("Full reasoning text for the message.")}),YZ=I.object({type:I.literal("tool_call_pending"),toolCallId:I.string().describe("Stable identifier for the tool call."),name:I.string().describe("Name of the tool being called.")}),$Z=I.object({type:I.literal("tool_call_start"),toolCallId:I.string().describe("Stable identifier for the tool call."),name:I.string().describe("Name of the tool being called."),params:I.unknown().describe("Resolved tool input params.")}),kZ=I.object({type:I.literal("tool_call_complete"),toolCallId:I.string().describe("Stable identifier for the tool call."),status:I.enum(["in_progress","success","error"]).describe("Terminal (or transitional) status of the tool call."),result:I.unknown().optional().describe("Tool output, when available."),durationMs:I.number().nonnegative().optional().describe("Authoritative server-measured tool execution time in ms.")}),GZ=I.object({type:I.literal("artifact"),name:I.string().describe("Artifact kind (for example table, timeseries)."),data:I.unknown().describe("Artifact payload; shape depends on name."),toolCallId:I.string().describe("Tool call that produced the artifact.")}),JZ=I.object({type:I.literal("error"),message:I.string().describe("Human-readable error message."),name:I.string().optional().describe("Optional error class/name.")}),TZ=I.object({type:I.literal("stream_reset"),messageId:I.string().describe("Assistant message whose content to reset.")}),RZ=I.object({type:I.literal("disconnected")}),XM=I.discriminatedUnion("type",[UZ,FZ,LZ,SZ,lZ,MZ,YZ,$Z,kZ,GZ,JZ,TZ,RZ]),MUA=I.enum(["run_started","message_started","text_chunk","reasoning_chunk","text_complete","reasoning_complete","tool_call_pending","tool_call_start","tool_call_complete","artifact","error","stream_reset","disconnected"]),HM=I.object({streamNextOffset:I.string().describe("Opaque resume cursor for the next unread event; pass back as the stream 'cursor' query param.")}),fZ=I.string().describe("Opaque resume cursor from a prior control frame's streamNextOffset."),YUA=I.object({cursor:fZ.optional().describe("Resume the stream after this offset. Omit to start from the beginning of the retained buffer.")})});var L=(A)=>{let t={operationId:A.operationId,backend:A.backend,pagination:A.pagination,async:A.async,examples:A.examples??[]};return{...A,contract:M1.$meta(t).route({method:A.route.method,path:A.route.path,tags:A.route.tags,operationId:A.operationId,summary:A.summary,description:A.description,successStatus:A.route.successStatus,successDescription:A.route.successDescription,deprecated:A.route.deprecated,inputStructure:A.route.inputStructure}).input(A.input).output(A.output)}};var zZ=D(()=>{Xu()});var OZ=D(()=>{zZ()});var VA=D(()=>{OZ()});var ac,ZZ,WZ,VZ,XZ,HZ,KZ,jZ,_Z,mZ,$UA,sM,xZ,tw,gw,Ve,nw,iw,qZ,dZ,Qw,sZ,pZ,Xe,xM,kUA,AW,tW,gW,GUA,nW,iW,QW,pM,oW,IW,eW,ow,Iw,ew,Bw,wc,BW,qM,hW,rc,AY,CW,cW,JUA,TUA,tY,EW,yW,DW,aW,wW,rW,bW,gY,hw,Cw,cw,Ew,nY,NW,dM,Dc,iY,RUA,yw,uW,UW,FW,LW,vZ,SW,lW,MW,Dw,aw,YW,QY,$W,kW,GW,JW,TW,ww,rw,fUA;var oY=D(()=>{TA();VA();ac=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),description:I.string().nullable(),origin:I.enum(["user_declared","code_detected","log_observed"]),lifecycle:I.enum(["active","retired","merged"]),observationState:I.enum(["observed","stale","unobserved"]),registryRevision:I.number().int().nonnegative(),canonicalComponentId:I.string().uuid(),mergedIntoComponentId:I.string().uuid().nullable(),currentStatus:I.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:I.string().datetime(),lastSeenAt:I.string().datetime(),deletedAt:I.string().datetime().nullable().describe("Timestamp when this component was retired, if any."),retiredAt:I.string().datetime().nullable(),retirementReason:I.string().nullable(),legacyStateUnknown:I.boolean().describe("True only for migration-era inactive rows whose retirement authority is unknown.")}),ZZ=I.object({projectId:I.string().uuid().optional().describe("Project to list components for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:I.union([I.boolean(),I.stringbool()]).default(!1).describe("When true, include retired and merged components.")}),WZ=I.object({components:I.array(ac),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),VZ=I.object({componentId:I.string().uuid().describe("Component ID to retrieve.")}),XZ=I.object({component:ac}),HZ=I.object({projectId:I.string().uuid().optional().describe("Project to register the component in. Auto-filled from CLI and SDK context when omitted."),name:I.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:I.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:I.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request."),origin:I.enum(["code_detected","log_observed"]).optional().describe("Machine provenance of this registration: 'code_detected' when the component was inferred from repository or code analysis, 'log_observed' (the default) when inferred from telemetry. Only applies to machine (secret-key) callers; human registrations are always recorded as 'user_declared' and ignore this field.")}),KZ=I.object({component:ac}),jZ=I.object({componentId:I.string().uuid().describe("Active component ID to rename."),name:I.string().trim().min(1,"Name is required"),requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),_Z=I.object({component:ac}),mZ=I.object({componentId:I.string().uuid().describe("Component ID to deregister."),reason:I.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),$UA=I.object({openIssueIds:I.array(I.string().uuid()),activeComponentIssueIds:I.array(I.string().uuid()),automationBindingIds:I.array(I.string().uuid()),notificationRuleIds:I.array(I.string().uuid()),dataSourceMappingIds:I.array(I.string().uuid()),observationIds:I.array(I.string().uuid()),relationshipIds:I.array(I.string().uuid()),recommendationScopeIds:I.array(I.string().uuid()),externalIncidentIds:I.array(I.string().uuid()),authorizedDeliveryIds:I.array(I.string().uuid()),authorizedAutomationRunIds:I.array(I.string().uuid())}),sM=I.object({requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),canonicalComponentName:I.string(),lifecycle:I.enum(["active","retired"]),affectedComponentIds:I.array(I.string().uuid()),componentRevisions:I.record(I.string().uuid(),I.number().int().nonnegative()),requiresCanonicalGroupConfirmation:I.boolean(),recommendationScopeEnabled:I.literal(!1),dependents:$UA,counts:I.record(I.string(),I.number().int().nonnegative())}),xZ=I.discriminatedUnion("status",[I.object({status:I.literal("observation_withdrawn"),componentId:I.string().uuid(),sourceType:I.literal("secret_key"),withdrawn:I.boolean()}),I.object({status:I.literal("retirement_confirmation_required"),preview:sM})]),tw=L({operationId:"components.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/components",tags:["Components"]},input:ZZ,output:WZ,pagination:"cursor",async:"sync"}),gw=L({operationId:"components.get",description:"Get a single component by ID.",backend:"api",route:{method:"GET",path:"/components/{componentId}",tags:["Components"]},input:VZ,output:XZ,pagination:"none",async:"sync"}),Ve=L({operationId:"components.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/components",tags:["Components"]},input:HZ,output:KZ,pagination:"none",async:"sync"}),nw=L({operationId:"components.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/components/{componentId}/deregister",tags:["Components"]},input:mZ,output:xZ,pagination:"none",async:"sync"}),iw=L({operationId:"components.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/components/{componentId}/rename",tags:["Components"]},input:jZ,output:_Z,pagination:"none",async:"sync"}),qZ=I.object({componentId:I.string().uuid().describe("Component whose owning team to set."),teamId:I.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),dZ=I.object({componentId:I.string().uuid().describe("Component that was updated."),teamId:I.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),Qw=L({operationId:"components.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/components/{componentId}/team",tags:["Components"]},input:qZ,output:dZ,pagination:"none",async:"sync"}),sZ=I.object({componentId:I.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),pZ=I.object({preview:sM}),Xe=I.record(I.string().uuid(),I.number().int().nonnegative()),xM=I.object({id:I.string().uuid(),rowRevision:I.number().int().nonnegative()}),kUA=I.object({notificationRules:I.array(xM),automationBindings:I.array(xM),relationships:I.array(xM)}),AW=I.object({componentId:I.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:Xe.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:I.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),tW=I.object({operationId:I.string().uuid(),status:I.enum(["committed","complete","followup_failed"]),requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),affectedComponentIds:I.array(I.string().uuid()),counts:I.record(I.string(),I.number().int().nonnegative()),authorizedDeliveryIds:I.array(I.string().uuid()),authorizedAutomationRunIds:I.array(I.string().uuid()),manualExternalIncidentIds:I.array(I.string().uuid()),issueAutomationSuppressions:I.number().int().nonnegative(),outboxEffectCount:I.number().int().nonnegative(),manifest:kUA,followups:I.record(I.string(),I.unknown()).optional()}),gW=I.object({result:tW}),GUA=I.object({notificationRuleIds:I.array(I.string().uuid()),automationBindingIds:I.array(I.string().uuid()),recommendationScopeIds:I.array(I.string().uuid()),relationshipIds:I.array(I.string().uuid())}),nW=I.object({componentId:I.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:I.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),iW=I.object({requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),canonicalComponentName:I.string(),retirementOperationId:I.string().uuid(),affectedComponentIds:I.array(I.string().uuid()),componentRevisions:Xe,eligible:GUA}),QW=I.object({preview:iW}),pM=I.object({notificationRuleIds:I.array(I.string().uuid()).default([]),automationBindingIds:I.array(I.string().uuid()).default([]),recommendationScopeIds:I.array(I.string().uuid()).default([]),relationshipIds:I.array(I.string().uuid()).default([])}),oW=I.object({componentId:I.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:I.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:Xe.describe("Exact canonical-group revisions returned by restorationPreview."),selections:pM.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),IW=I.object({operationId:I.string().uuid(),status:I.literal("complete"),requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),affectedComponentIds:I.array(I.string().uuid()),restored:pM}),eW=I.object({result:IW}),ow=L({operationId:"components.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retirement/preview",tags:["Components"]},input:sZ,output:pZ,pagination:"none",async:"sync"}),Iw=L({operationId:"components.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retire",tags:["Components"]},input:AW,output:gW,pagination:"none",async:"sync"}),ew=L({operationId:"components.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restoration/preview",tags:["Components"]},input:nW,output:QW,pagination:"none",async:"sync"}),Bw=L({operationId:"components.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restore",tags:["Components"]},input:oW,output:eW,pagination:"none",async:"sync"}),wc=I.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),BW=I.enum(["observed","stale","unobserved"]),qM=I.object({originalComponentId:I.string().uuid(),effectiveComponentId:I.string().uuid(),name:I.string(),lifecycle:I.enum(["active","retired","merged"]),observationState:BW}),hW=I.object({id:I.string().uuid(),source:qM,target:qM,relationshipType:wc,createdAt:I.string().datetime(),endedAt:I.string().datetime().nullable(),endReason:I.string().nullable(),rowRevision:I.number().int().nonnegative()}),rc=I.object({projectId:I.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),AY=I.object({sourceComponentId:I.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:I.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:wc}),CW=rc.extend({includeHistorical:I.union([I.boolean(),I.stringbool()]).default(!1).describe("Include historically ended relationships.")}),cW=I.object({relationships:I.array(hW)}),JUA=I.object({ruleId:I.string().uuid(),ruleGroupId:I.string().uuid().nullable(),ownerComponentId:I.string().uuid(),destinationIds:I.array(I.string().uuid()),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),TUA=I.object({bindingId:I.string().uuid(),automationId:I.string().uuid(),ownerComponentId:I.string().uuid(),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),tY=I.object({notificationRules:I.array(JUA),automationBindings:I.array(TUA)}),EW=AY.extend({action:I.enum(["add","remove"]),organizationId:I.string(),projectId:I.string().uuid(),relationshipId:I.string().uuid().nullable(),componentRevisions:I.record(I.string().uuid(),I.number().int().nonnegative()),policyImpact:tY,confirmationRequired:I.boolean()}),yW=rc.merge(AY).extend({action:I.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),DW=I.object({preview:EW}),aW=rc.merge(AY).extend({requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:I.string().trim().min(1,"Reason cannot be empty"),componentRevisions:I.record(I.string().uuid(),I.number().int().nonnegative()),confirmPolicyImpact:I.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),wW=aW,rW=aW,bW=I.object({action:I.enum(["add","remove"]),relationshipId:I.string().uuid(),sourceComponentId:I.string().uuid(),targetComponentId:I.string().uuid(),relationshipType:wc,policyImpact:tY}),gY=I.object({result:bW}),hw=L({operationId:"components.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/components/relationships",tags:["Components"]},input:CW,output:cW,pagination:"none",async:"sync"}),Cw=L({operationId:"components.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/components/relationships/preview",tags:["Components"]},input:yW,output:DW,pagination:"none",async:"sync"}),cw=L({operationId:"components.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships",tags:["Components"]},input:wW,output:gY,pagination:"none",async:"sync"}),Ew=L({operationId:"components.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships/remove",tags:["Components"]},input:rW,output:gY,pagination:"none",async:"sync"}),nY=I.enum(["suspend","move"]),NW=I.object({disposition:nY,beforeComponentIds:I.array(I.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:I.array(I.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),dM=I.object({kind:I.enum(["notification_rule","automation_binding"]),policyId:I.string().uuid(),sourceRowRevision:I.number().int().nonnegative(),sourceComponentId:I.string().uuid(),equivalentPolicyId:I.string().uuid().nullable(),equivalent:I.boolean(),defaultDisposition:I.enum(["deduplicate","suspend"]),allowedDispositions:I.array(nY),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),Dc=I.object({kind:I.enum(["notification_rule","automation_binding"]),policyId:I.string().uuid(),ownerComponentId:I.string().uuid(),rowRevision:I.number().int().nonnegative(),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),iY=I.object({relationshipId:I.string().uuid(),action:I.enum(["rewire","close_self","close_duplicate"]),relationshipType:wc,beforeSourceComponentId:I.string().uuid(),beforeTargetComponentId:I.string().uuid(),afterSourceComponentId:I.string().uuid(),afterTargetComponentId:I.string().uuid(),survivingRelationshipId:I.string().uuid().nullable(),beforeRowRevision:I.number().int().nonnegative(),afterRowRevision:I.number().int().nonnegative().nullable()}),RUA=I.object({openIssueIds:I.array(I.string().uuid()),componentIssueIds:I.array(I.string().uuid()),observationIds:I.array(I.string().uuid()),dataSourceMappingIds:I.array(I.string().uuid()),nameIds:I.array(I.string().uuid()),relationshipIds:I.array(I.string().uuid()),recommendationScopeIds:I.array(I.string().uuid())}),yw=I.object({sourceComponentId:I.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:I.string().uuid().describe("Active terminal component that becomes the canonical target.")}),uW=rc.merge(yw),UW=yw.extend({organizationId:I.string(),projectId:I.string().uuid(),sourceGroupComponentIds:I.array(I.string().uuid()),targetGroupComponentIds:I.array(I.string().uuid()),affectedComponentIds:I.array(I.string().uuid()),componentRevisions:Xe,inventory:RUA,notificationPolicies:I.array(dM),automationBindings:I.array(dM),notificationScopeChanges:I.array(Dc),automationScopeChanges:I.array(Dc),relationshipChanges:I.array(iY),recommendationScopeEnabled:I.literal(!1),dependentCount:I.number().int().nonnegative(),ordinaryTransactionLimit:I.number().int().positive(),operatorAssistanceRequired:I.boolean(),confirmationRequired:I.boolean()}),FW=I.object({preview:UW}),LW=rc.merge(yw).extend({requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:Xe.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:I.record(I.string().uuid(),NW).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:I.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),vZ=I.object({policyId:I.string().uuid(),action:I.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:I.string().uuid().nullable(),beforeRowRevision:I.number().int().nonnegative(),afterRowRevision:I.number().int().nonnegative(),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),SW=I.object({componentRevisions:Xe,redirectedComponentIds:I.array(I.string().uuid()),dataSourceMappingIds:I.array(I.string().uuid()),movedAliasIds:I.array(I.string().uuid()),historicalDisplayIds:I.array(I.string().uuid()),relationshipChanges:I.array(iY),notificationPolicies:I.array(vZ),automationBindings:I.array(vZ),notificationScopeChanges:I.array(Dc),automationScopeChanges:I.array(Dc),recommendationScopeIds:I.array(I.string().uuid())}),lW=yw.extend({operationId:I.string().uuid(),status:I.literal("complete"),affectedComponentIds:I.array(I.string().uuid()),manifest:SW}),MW=I.object({result:lW}),Dw=L({operationId:"components.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/components/merge/preview",tags:["Components"]},input:uW,output:FW,pagination:"none",async:"sync"}),aw=L({operationId:"components.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/components/merge",tags:["Components"]},input:LW,output:MW,pagination:"none",async:"sync"}),YW=I.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),QY=I.object({id:I.string().uuid(),componentId:I.string().uuid(),projectId:I.string().uuid(),severity:YW,summary:I.string().describe("Human-readable summary of the status-page issue."),startedAt:I.string().datetime().describe("When the incident began affecting the component."),resolvedAt:I.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),$W=I.object({projectId:I.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:I.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:I.union([I.boolean(),I.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),kW=I.object({incidents:I.array(QY),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),GW=I.object({timestamp:I.string().datetime(),status:I.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),JW=I.object({componentId:I.string().uuid().describe("Component to build the timeline for."),windowStart:I.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:I.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),TW=I.object({componentId:I.string().uuid(),windowStart:I.string().datetime(),windowEnd:I.string().datetime(),timeline:I.array(GW),incidents:I.array(QY)}),ww=L({operationId:"components.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Components"]},input:$W,output:kW,pagination:"cursor",async:"sync"}),rw=L({operationId:"components.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/components/{componentId}/timeline",tags:["Components"]},input:JW,output:TW,pagination:"none",async:"sync"}),fUA={list:tw.contract,get:gw.contract,register:Ve.contract,deregister:nw.contract,rename:iw.contract,assignTeam:Qw.contract,retirementPreview:ow.contract,retire:Iw.contract,restorationPreview:ew.contract,restore:Bw.contract,mergePreview:Dw.contract,merge:aw.contract,relationships:{list:hw.contract,preview:Cw.contract,add:cw.contract,remove:Ew.contract},incidents:{list:ww.contract},timeline:rw.contract}});var bw,IY,RW,fW,eY,PW,zW,OW,BY,vW,ZW,WW,hY,VW,XW,CY;var cY=D(()=>{TA();VA();bw=["github","google","microsoft","linear","bitbucket","slack"],IY=I.enum(bw),RW=I.object({organizationId:I.string().min(1).optional().describe("Organization to connect within. Auto-filled from CLI and SDK context when omitted."),provider:IY.describe("Connected-account provider to connect.")}),fW=I.object({url:I.string().describe("Vendor authorization URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:I.string().uuid().describe("Connect attempt to poll via `connectedAccounts.getConnectAttempt` while the browser flow completes."),expiresAt:I.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),eY=L({operationId:"connectedAccounts.beginConnect",description:"Begin a browser connect flow for a connected-account provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/connected-accounts/connect",tags:["Connected Accounts"],successStatus:201},input:RW,output:fW,pagination:"none",async:"sync"}),PW=I.enum(["pending","completed","failed","expired"]),zW=I.object({organizationId:I.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:I.string().uuid().describe("Connect attempt ID to poll.")}),OW=I.object({status:PW.describe("Attempt state. `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:I.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized).")}),BY=L({operationId:"connectedAccounts.getConnectAttempt",description:"Poll a browser connect attempt started with `connectedAccounts.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/connected-accounts/connect/attempts/{attemptId}",tags:["Connected Accounts"]},input:zW,output:OW,pagination:"none",async:"sync"}),vW=I.object({organizationId:I.string().min(1).optional().describe("Organization to list accounts for. Auto-filled from CLI and SDK context when omitted.")}),ZW=I.object({provider:I.string().describe("Provider identifier."),externalName:I.string().nullable().describe("Display name from the provider."),externalLogin:I.string().nullable().describe("Username or login from the provider."),connectedAt:I.string().datetime().nullable().describe("When the account was connected."),authMode:I.enum(["oauth","pat"]).nullable().describe("Auth mode used."),needsReconnect:I.boolean().describe("Whether the token is expired and a reconnect is required.")}),WW=I.object({accounts:I.array(ZW)}),hY=L({operationId:"connectedAccounts.list",description:"List the calling user's connected accounts for the organization.",backend:"api",route:{method:"GET",path:"/connected-accounts",tags:["Connected Accounts"]},input:vW,output:WW,pagination:"none",async:"sync"}),VW=I.object({organizationId:I.string().min(1).optional().describe("Organization the account belongs to. Auto-filled from CLI and SDK context when omitted."),provider:IY.describe("Provider to disconnect.")}),XW=I.object({success:I.literal(!0)}),CY=L({operationId:"connectedAccounts.disconnect",description:"Disconnect the calling user's connected account for a provider (soft delete).",backend:"api",route:{method:"DELETE",path:"/connected-accounts/{provider}",tags:["Connected Accounts"]},input:VW,output:XW,pagination:"none",async:"sync"})});var Ko,EY,HW,KW,PUA,zUA,OUA,jW,bc,vUA,ZUA,WUA,VUA,XUA,HUA,KUA,jUA,_UA,mUA,xUA,qUA,yY,DY,aY,wY,rY,bY,dUA,sUA,pUA,AFA,NY,uY,tFA,gFA,nFA,iFA,UY,EEt;var _W=D(()=>{TA();VA();Ko=I.string().uuid().describe("Automation ID."),EY=I.enum(["running","succeeded","failed","timed_out","cancelled"]),HW=I.object({id:I.string().uuid(),automationRunKey:I.string(),status:EY,startedAt:I.string().datetime(),completedAt:I.string().datetime().nullable(),durationMs:I.number().int().nullable(),exitCode:I.number().int().nullable()}),KW=HW.extend({scheduledAt:I.string().datetime().nullable().describe("When the run was scheduled to start, if known."),dueAt:I.string().datetime().nullable().describe("When the run became due, if known."),errorMessage:I.string().nullable().describe("Failure detail for the run, if it failed or timed out.")}),PUA=KW.extend({automationId:I.string().uuid().describe("Automation that owns this run.")}),zUA=I.enum(["script","log_match"]),OUA=I.enum(["expression_matched"]),jW=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),kind:zUA.describe("Automation kind: a scheduled script or a log-match investigation."),scriptId:I.string().uuid().nullable().describe("ID of the project_scripts row this automation runs, for DB-backed script automations. Null for legacy script_path automations and for log-match automations."),scriptName:I.string().nullable().describe("Name of the project_scripts row this automation runs (see scriptId). Null when scriptId is null."),logMatchExpressionId:I.string().uuid().nullable().describe("Deprecated: use signalDefinitionId. Log-match expression bound to this automation. Null for script automations."),signalDefinitionId:I.string().uuid().nullable().describe("Signal definition bound to this automation. Null for script automations."),signalType:OUA.nullable().describe("Signal trigger type for log-match automations. Null for script automations."),source:I.enum(["sazabi_managed","custom"]).describe("Whether the automation is Sazabi-managed or customer-defined."),enabled:I.boolean(),cronExpression:I.string().nullable().describe("Cron schedule for scheduled automations. Null for signal automations."),timezone:I.string(),timeoutSeconds:I.number().int().nullable(),health:I.enum(["healthy","failing","never_run"]).describe("Health derived from the most recent run."),lastRun:HW.nullable(),successRate:I.number().nullable().describe("Fraction of terminal runs that succeeded over the last 7 days."),runCount:I.number().int().describe("Total runs over the last 7 days."),failedRunCount:I.number().int().describe("Failed or timed-out runs over the last 7 days.")}),bc=jW.extend({createdAt:I.string().datetime(),updatedAt:I.string().datetime(),recordedHistoryStartsAt:I.string().datetime().describe("Earliest timestamp for which run history is recorded."),scriptIdentifier:I.string().nullable().describe("Relative project script path executed by the automation. Null for signal automations."),canToggle:I.boolean().describe("Whether the caller may enable or disable this automation.")}),vUA=I.object({projectId:I.string().uuid().optional().describe("Project to list automations for. Auto-filled from CLI and SDK context when omitted."),search:I.string().optional().describe("Case-insensitive partial match on automation name."),status:I.enum(["active","paused"]).optional().describe("Filter by enabled (active) or disabled (paused) automations."),health:I.enum(["healthy","failing","never_run"]).optional().describe("Filter by automation health."),source:I.enum(["sazabi_managed","custom"]).optional().describe("Filter by automation source."),sort:I.enum(["name","last_run","failures","runs"]).default("name").describe("Sort order for the returned automations."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of automations to return per page."),cursor:I.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),ZUA=I.object({automations:I.array(jW),nextCursor:I.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),WUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),VUA=I.object({automation:bc}),XUA=I.object({projectId:I.string().uuid().optional().describe("Project to create the automation in. Auto-filled from CLI and SDK context when omitted."),name:I.string().min(1).max(200).describe("Automation name."),description:I.string().max(2000).nullable().optional().describe("Human-readable description. Required for log-match automations (investigation instructions)."),scriptId:I.string().uuid().optional().describe("Project script to run, by ID. Provide exactly one of scriptId, script, or expressionId."),script:I.string().optional().describe("Project script to run, by name (resolved to scriptId server-side). Provide exactly one of scriptId, script, or expressionId."),expressionId:I.string().uuid().optional().describe("Log-match expression to bind. Creates a signal automation that investigates matching logs. Mutually exclusive with scriptId and script."),cronExpression:I.string().optional().describe("Cron schedule for the automation. Defaults to every minute when omitted."),timezone:I.string().optional().describe("IANA timezone for cronExpression. Defaults to UTC."),timeoutSeconds:I.coerce.number().int().min(1).max(3600).optional().describe("Execution timeout in seconds. Defaults to 60."),enabled:I.boolean().optional().describe("Whether the automation starts enabled. Defaults to true.")}).superRefine((A,t)=>{let g=A.scriptId!=null,i=A.script!=null,n=A.expressionId!=null;if(Number(g)+Number(i)+Number(n)!==1){t.addIssue({code:"custom",message:"Provide exactly one of scriptId, script, or expressionId.",path:["scriptId"]});return}if(n){if(A.cronExpression!=null)t.addIssue({code:"custom",message:"cronExpression is not used for log-match automations.",path:["cronExpression"]});if(A.timezone!=null)t.addIssue({code:"custom",message:"timezone is not used for log-match automations.",path:["timezone"]});if(A.timeoutSeconds!=null)t.addIssue({code:"custom",message:"timeoutSeconds is not used for log-match automations.",path:["timeoutSeconds"]});if(!A.description?.trim())t.addIssue({code:"custom",message:"description is required for log-match automations (investigation instructions).",path:["description"]})}}),HUA=I.object({automation:bc}),KUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),name:I.string().min(1).max(200).optional().describe("New automation name."),description:I.string().max(2000).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged."),cronExpression:I.string().optional().describe("New cron schedule."),timezone:I.string().optional().describe("New IANA timezone."),timeoutSeconds:I.coerce.number().int().min(1).max(3600).optional().describe("New execution timeout in seconds.")}),jUA=I.object({automation:bc}),_UA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),mUA=I.object({automation:bc}),xUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),qUA=I.object({automation:bc}),yY=L({operationId:"automations.list",description:"List scheduled automations in a project, with run health and recent run stats.",backend:"api",route:{method:"GET",path:"/automations",tags:["Automations"]},input:vUA,output:ZUA,pagination:"cursor",async:"sync"}),DY=L({operationId:"automations.get",description:"Get a single automation by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}",tags:["Automations"]},input:WUA,output:VUA,pagination:"none",async:"sync"}),aY=L({operationId:"automations.create",description:"Create an automation: either a cron-driven project script (see scripts.create) or a log-match investigation bound to an expression (see logMatchExpressions.create).",backend:"api",route:{method:"POST",path:"/automations",successStatus:201,tags:["Automations"]},input:XUA,output:HUA,pagination:"none",async:"sync"}),wY=L({operationId:"automations.update",description:"Update an automation's name, description, or schedule. Does not change which script it runs.",backend:"api",route:{method:"PATCH",path:"/automations/{automationId}",tags:["Automations"]},input:KUA,output:jUA,pagination:"none",async:"sync"}),rY=L({operationId:"automations.enable",description:"Enable an automation so it runs on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/enable",tags:["Automations"]},input:_UA,output:mUA,pagination:"none",async:"sync"}),bY=L({operationId:"automations.disable",description:"Disable an automation so it stops running on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/disable",tags:["Automations"]},input:xUA,output:qUA,pagination:"none",async:"sync"}),dUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),status:I.union([EY,I.array(EY)]).optional().describe("Filter runs by status. Accepts a single status or an array of statuses (matched as OR)."),cursor:I.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page.")}),sUA=I.object({runs:I.array(KW),nextCursor:I.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results."),recordedHistoryStartsAt:I.string().datetime().describe("Earliest timestamp for which run history is recorded.")}),pUA=I.object({automationId:Ko,runId:I.string().uuid().describe("Automation run ID."),projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),AFA=I.object({run:PUA}),NY=L({operationId:"automations.runs.list",description:"List runs for an automation, most recent first.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs",tags:["Automations"]},input:dUA,output:sUA,pagination:"cursor",async:"sync"}),uY=L({operationId:"automations.runs.get",description:"Get a single automation run by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}",tags:["Automations"]},input:pUA,output:AFA,pagination:"none",async:"sync"}),tFA=I.enum(["queued","running","succeeded","failed","timed_out"]),gFA=I.object({stdout:I.string().describe("Captured standard output for the run."),stderr:I.string().describe("Captured standard error for the run."),exitCode:I.number().int().nullable().describe("Process exit code of the run's command, if it finished."),status:tFA.describe("Execution status of the run's captured command."),truncated:I.boolean().describe("Whether the captured output exceeded the inline preview limit. The full output is returned when it could be read from durable storage; otherwise the truncated preview is returned with this flag set."),startedAt:I.string().datetime().nullable().describe("When the command started executing, if known."),completedAt:I.string().datetime().nullable().describe("When the command finished executing, if known."),durationMs:I.number().int().nullable().describe("Command execution duration in milliseconds, if known.")}),nFA=I.object({automationId:Ko,runId:I.string().uuid().describe("Automation run ID."),projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),iFA=I.object({logs:gFA}),UY=L({operationId:"automations.runs.logs",description:"Get the captured stdout/stderr for a single automation run, reading the full output from durable storage when the inline preview was truncated.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}/logs",tags:["Automations"]},input:nFA,output:iFA,pagination:"none",async:"sync"}),EEt={list:yY.contract,get:DY.contract,create:aY.contract,update:wY.contract,enable:rY.contract,disable:bY.contract,runs:{list:NY.contract,get:uY.contract,logs:UY.contract}}});var QFA,oFA,mW,IFA,Nw,eFA,BFA,xW,hFA,CFA,cFA,EFA,yFA,DFA,aFA,LY,SY,lY,Hn,qW,FY,MY,wFA,dW,rFA,bFA,NFA,uFA,UFA,FFA,LFA,SFA,lFA,MFA,YFA,$FA,kFA,GFA,JFA,TFA,RFA,fFA,PFA,YY,sW,zFA,OFA,$Y,kY,GY,JY,TY,RY,fY,PY,zY,OY,vY,ZY,WY,wEt;var pW=D(()=>{TA();VA();QFA=I.enum(["logs_ingested_bytes","logs_accepted_bytes","input_tokens","output_tokens","issues_created","automation_runs_completed","pull_requests_created","pull_request_reviews_completed"]),oFA=I.enum(["cycle_top_up","upgrade_top_up","deficit_settlement","auto_top_up","one_off_top_up","usage_debit","adjustment","migration_opening_balance","void"]),mW=I.object({startsAt:I.string().datetime(),endsAt:I.string().datetime(),billableStartsAt:I.string().datetime()}),IFA=I.object({subscriptionChargeAmount:I.string(),creditDeficitAmount:I.string(),creditDeficitChargeAmount:I.string(),totalAmount:I.string(),currency:I.string()}),Nw=I.object({billingSubscriptionChangeId:I.string(),effectiveAt:I.string().datetime(),planSlug:I.string().nullable(),planName:I.string().nullable(),price:I.string().nullable(),currency:I.string().nullable(),targetCreditBalance:I.string().nullable()}),eFA=I.object({id:I.string(),status:I.string(),billingPlanId:I.string(),priceBookId:I.string(),cycleType:I.string(),cancelAt:I.string().datetime().nullable(),canceledAt:I.string().datetime().nullable()}),BFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to query billing for. Auto-filled from CLI and SDK context when omitted.")}),xW=I.object({status:I.enum(["current","payment_retrying","delinquent"]).describe("Negative-balance collection state. `current` means no open collection case; `payment_retrying` means a scheduled retry cadence is running; `delinquent` means retries are exhausted and intake is denied until payment settles the balance."),outstandingCredits:I.string().nullable().describe("Credits owed (absolute value of the negative balance)."),outstandingAmount:I.string().nullable().describe("Amount owed in `currency` at the current additional-credit price."),currency:I.string().nullable(),scheduledAttemptsMade:I.number().int().describe("Scheduled collection attempts consumed by confirmed payment failures."),nextRetryAt:I.string().datetime().nullable(),billingInvoiceId:I.string().nullable(),hostedInvoiceUrl:I.string().nullable()}).describe("Read-only negative-balance collection state for the organization."),hFA=I.object({billingModel:I.enum(["credit-balance-v1"]),billable:I.boolean(),nonBillableReason:I.string().nullable(),status:I.string(),planName:I.string().nullable(),planSlug:I.string().nullable(),currency:I.string().nullable(),currentBalance:I.string().nullable(),targetCreditBalance:I.string().nullable(),currentCycle:mW.nullable(),currentPeriodEstimate:IFA.nullable(),pendingDowngrade:Nw.nullable(),subscription:eFA.nullable(),collection:xW,currentPlan:I.object({slug:I.string(),name:I.string(),price:I.string().nullable(),currency:I.string().nullable(),targetCreditBalance:I.string().nullable(),subscriptionStatus:I.string(),cycleStartsAt:I.string().datetime().nullable(),cycleEndsAt:I.string().datetime().nullable(),renewalAt:I.string().datetime().nullable(),pendingSwitch:Nw.nullable(),pendingCancellation:I.object({effectiveAt:I.string().datetime()}).nullable()}).nullable()}),CFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to query usage for. Auto-filled from CLI and SDK context when omitted."),cycle:I.enum(["current","previous"]).default("current").describe("Which billing cycle to report usage for.")}),cFA=I.object({dimension:QFA,totalQuantity:I.string(),ratedQuantity:I.string(),creditsConsumed:I.string(),sourceBreakdown:I.record(I.string(),I.string())}),EFA=I.object({cycle:mW.nullable(),usage:I.array(cFA)}),yFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to query transactions for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of transactions to return per page."),page:I.coerce.number().int().min(1).default(1).describe("Page number for pagination (1-indexed).")}),DFA=I.object({id:I.string(),transactionType:oFA,creditDelta:I.string(),balanceAfter:I.string(),occurredAt:I.string().datetime(),billingInvoiceId:I.string().nullable()}),aFA=I.object({items:I.array(DFA),pagination:I.object({page:I.number(),limit:I.number(),total:I.number(),totalPages:I.number(),hasNext:I.boolean(),hasPrev:I.boolean()}).describe("Pagination metadata for the transaction list.")}),LY=L({operationId:"billing.getSummary",description:"Get a billing summary for the current organization, including plan, balance, and cycle information.",backend:"api",route:{method:"GET",path:"/billing/summary",tags:["Billing"]},input:BFA,output:hFA,pagination:"none",async:"sync"}),SY=L({operationId:"billing.getUsage",description:"Get per-dimension usage breakdown for the current or previous billing cycle.",backend:"api",route:{method:"GET",path:"/billing/usage",tags:["Billing"]},input:CFA,output:EFA,pagination:"none",async:"sync"}),lY=L({operationId:"billing.listTransactions",description:"List recent credit ledger transactions with pagination.",backend:"api",route:{method:"GET",path:"/billing/transactions",tags:["Billing"]},input:yFA,output:aFA,pagination:"page",async:"sync"}),Hn=I.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),qW=I.string().trim().regex(/^\d+(?:\.\d{1,6})?$/,"Expected a decimal with up to 6 places"),FY=qW.refine((A)=>{let[,t=""]=A.split(".");return t.slice(2).replaceAll("0","")===""},"Expected a currency amount with up to 2 decimal places").refine((A)=>/[1-9]/.test(A),"Expected a positive currency amount"),MY=I.string().trim().min(1).max(100),wFA=I.object({organizationId:Hn}),dW=I.object({supported:I.boolean().describe("Whether auto top-up is available for the account's plan."),enabled:I.boolean(),triggerCreditBalance:I.string(),topUpAmount:I.string(),cycleSpendingLimit:I.string(),currency:I.string(),creditsToGrant:I.string().nullable(),status:I.string()}),rFA=I.object({organizationId:Hn,enabled:I.boolean(),triggerCreditBalance:qW,topUpAmount:FY,cycleSpendingLimit:FY}),bFA=I.object({organizationId:Hn,amount:FY.describe("Amount to charge in the account currency; grants an equal credit balance."),idempotencyKey:I.string().trim().min(1).max(128).describe("Client-generated key. Repeating a request with the same key returns the original purchase instead of charging again.")}),NFA=I.object({status:I.enum(["paid","pending_payment"]),billingInvoiceId:I.string(),topUpAmount:I.string(),creditsToGrant:I.string(),currency:I.string()}),uFA=I.object({organizationId:Hn}),UFA=I.object({slug:I.string(),billingModel:I.string(),name:I.string(),description:I.string(),bestFor:I.string().nullable(),price:I.string(),currency:I.string(),targetCreditBalance:I.string().nullable(),logsIncludedBytes:I.string(),inputTokensIncluded:I.string(),outputTokensIncluded:I.string()}),FFA=I.object({billingModel:I.string(),currentPlanSlug:I.string().nullable(),hasActiveStripeBilling:I.boolean(),plans:I.array(UFA)}),LFA=I.object({organizationId:Hn,planSlug:MY}),SFA=I.object({calculatedAt:I.string().datetime(),type:I.enum(["upgrade","downgrade"]),effectiveAt:I.string().datetime(),currency:I.string(),currentPlanSlug:I.string(),targetPlanSlug:I.string(),currentPlanName:I.string(),targetPlanName:I.string(),currentPlanPrice:I.string(),targetPlanPrice:I.string(),currentTargetCreditBalance:I.string(),targetCreditBalance:I.string(),creditDeficitAmount:I.string(),creditDeficitChargeAmount:I.string(),additionalCreditPrice:I.string(),immediateChargeAmount:I.string(),subscriptionChargeAmount:I.string(),proratedCreditGrantAmount:I.string(),remainingCycleFraction:I.string(),nextCycleChargeAmount:I.string()}),lFA=I.object({organizationId:Hn,planSlug:MY}),MFA=I.object({billingSubscriptionChangeId:I.string(),billingSubscriptionId:I.string(),status:I.string(),type:I.string(),effectiveAt:I.string().datetime(),invoiceId:I.string().nullable(),creditDeficitAmount:I.string().optional(),creditDeficitChargeAmount:I.string().optional(),creditTopUpAmount:I.string().optional(),immediateChargeAmount:I.string().optional(),subscriptionChargeAmount:I.string().optional(),proratedCreditGrantAmount:I.string().optional()}),YFA=I.object({organizationId:Hn,planSlug:MY}),$FA=I.object({sessionId:I.string(),checkoutUrl:I.string().url()}),kFA=I.object({organizationId:Hn,sessionId:I.string().min(1).describe("The checkout session id returned by createCheckoutSession.")}),GFA=I.object({status:I.enum(["pending","active","expired"])}),JFA=I.object({organizationId:Hn}),TFA=I.object({portalUrl:I.string().url()}),RFA=I.object({organizationId:Hn}),fFA=I.object({hasPaymentMethod:I.boolean(),brand:I.string().nullable(),last4:I.string().nullable(),type:I.string().nullable(),expiryMonth:I.number().int().min(1).max(12).nullable(),expiryYear:I.number().int().nullable(),isDefault:I.boolean(),display:I.string().nullable()}),PFA=I.object({slug:I.string(),name:I.string(),price:I.string().nullable(),currency:I.string().nullable(),targetCreditBalance:I.string().nullable(),subscriptionStatus:I.string(),cycleStartsAt:I.string().datetime().nullable(),cycleEndsAt:I.string().datetime().nullable(),renewalAt:I.string().datetime().nullable(),pendingSwitch:Nw.nullable(),pendingCancellation:I.object({effectiveAt:I.string().datetime()}).nullable()}),YY=I.object({organizationId:Hn}),sW=I.object({currentPlan:PFA,effectiveAt:I.string().datetime(),currentBalance:I.string(),servicePolicy:I.literal("active_until_period_end"),creditPolicy:I.literal("dormant_until_resubscription"),scheduledFinalCharge:I.string().nullable(),autoTopUpEnabled:I.boolean(),pendingDowngrade:Nw.nullable(),collectionState:xW,calculatedAt:I.string().datetime()}),zFA=sW.extend({billingSubscriptionChangeId:I.string(),alreadyScheduled:I.boolean()}),OFA=I.object({billingSubscriptionId:I.string(),resumed:I.literal(!0)}),$Y=L({operationId:"billing.getAutoTopUp",description:"Get the organization's credit auto top-up settings (trigger balance, top-up amount, cycle spending limit).",backend:"api",route:{method:"GET",path:"/billing/auto-top-up",tags:["Billing"]},input:wFA,output:dW,pagination:"none",async:"sync"}),kY=L({operationId:"billing.updateAutoTopUp",description:"Enable/disable and configure credit auto top-up. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"PUT",path:"/billing/auto-top-up",tags:["Billing"]},input:rFA,output:dW,pagination:"none",async:"sync"}),GY=L({operationId:"billing.purchaseCredits",description:"Purchase a one-time amount of credits against the saved payment method. Requires a user credential with `billing:manage` and a stable idempotency key.",backend:"api",route:{method:"POST",path:"/billing/credits/purchase",tags:["Billing"]},input:bFA,output:NFA,pagination:"none",async:"sync"}),JY=L({operationId:"billing.listPlans",description:"List the self-serve credit plans available for checkout, including the current plan.",backend:"api",route:{method:"GET",path:"/billing/plans",tags:["Billing"]},input:uFA,output:FFA,pagination:"none",async:"sync"}),TY=L({operationId:"billing.previewPlanChange",description:"Preview the cost and effect of changing to a plan without applying it. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change/preview",tags:["Billing"]},input:LFA,output:SFA,pagination:"none",async:"sync"}),RY=L({operationId:"billing.changePlan",description:"Apply a plan upgrade or schedule a downgrade. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change",tags:["Billing"]},input:lFA,output:MFA,pagination:"none",async:"sync"}),fY=L({operationId:"billing.createCheckoutSession",description:"Create a hosted Stripe Checkout session for first-time subscribe from the terminal. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/checkout-session",tags:["Billing"]},input:YFA,output:$FA,pagination:"none",async:"sync"}),PY=L({operationId:"billing.getCheckoutSessionStatus",description:"Poll the completion status of a checkout session created by this organization.",backend:"api",route:{method:"GET",path:"/billing/checkout-session/{sessionId}",tags:["Billing"]},input:kFA,output:GFA,pagination:"none",async:"sync"}),zY=L({operationId:"billing.createPortalSession",description:"Create a Stripe Customer Portal session for updating the payment method. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/portal-session",tags:["Billing"]},input:JFA,output:TFA,pagination:"none",async:"sync"}),OY=L({operationId:"billing.getPaymentMethod",description:"Get a summary of the organization's saved payment method (brand and last 4 digits).",backend:"api",route:{method:"GET",path:"/billing/payment-method",tags:["Billing"]},input:RFA,output:fFA,pagination:"none",async:"sync"}),vY=L({operationId:"billing.previewSubscriptionCancellation",description:"Preview period-end subscription cancellation without changing billing state.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/preview",tags:["Billing"]},input:YY,output:sW,pagination:"none",async:"sync"}),ZY=L({operationId:"billing.scheduleSubscriptionCancellation",description:"Schedule cancellation at the end of the paid billing cycle.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation",tags:["Billing"]},input:YY,output:zFA,pagination:"none",async:"sync"}),WY=L({operationId:"billing.resumeSubscriptionCancellation",description:"Resume renewal before a scheduled cancellation takes effect.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/resume",tags:["Billing"]},input:YY,output:OFA,pagination:"none",async:"sync"}),wEt={getSummary:LY.contract,getUsage:SY.contract,listTransactions:lY.contract,getAutoTopUp:$Y.contract,updateAutoTopUp:kY.contract,purchaseCredits:GY.contract,listPlans:JY.contract,previewPlanChange:TY.contract,changePlan:RY.contract,createCheckoutSession:fY.contract,getCheckoutSessionStatus:PY.contract,createPortalSession:zY.contract,getPaymentMethod:OY.contract,previewSubscriptionCancellation:vY.contract,scheduleSubscriptionCancellation:ZY.contract,resumeSubscriptionCancellation:WY.contract}});var vFA,Nc,ZFA,WFA,VFA,XFA,HFA,KFA,uc,AV,jFA,_FA,tV,mFA,xFA,gV,qFA,dFA,nV,sFA,pFA,iV,ALA,tLA,QV,gLA,nLA,iLA,oV,QLA,oLA,IV,ILA,eLA,eV,VY,BV,hV,CV,cV,EV,yV,Uc,DV,BLA,aV,hLA,wV,rV,CLA,cLA,bV,ELA,NV,yLA,DLA,uV;var UV=D(()=>{TA();VA();vFA=["slack","github","linear","pagerduty","victorops","rootly","incident_io","webhook","teams","bitbucket","jira"],Nc=I.enum(vFA),ZFA=I.enum(["oauth","app_installation","api_key"]),WFA=I.enum(["alert_routing","inbound_webhooks","messaging","code_search","health_check"]),VFA=I.enum(["pending","connected","error","revoked"]),XFA=I.enum(["healthy","unhealthy","unknown"]),HFA=I.object({name:I.string().describe("Field name used as the JSON key in `credentials`."),label:I.string().describe("Human-readable field label."),required:I.boolean().describe("Whether the field is required."),secret:I.boolean().describe("Whether the field is a secret (masked in UIs, encrypted)."),description:I.string().nullable().describe("Optional hint for the field's expected value.")}),KFA=I.object({id:Nc.describe("Integration provider identifier."),name:I.string().describe("Human-readable display name."),description:I.string().describe("Short description of the provider."),authType:ZFA.describe("Auth flow used to connect this provider."),capabilities:I.array(WFA).describe("Capabilities the provider exposes once connected."),connectionCount:I.number().int().describe("Number of active connections for this provider in the organization, including error-status connections that need attention."),credentialFields:I.array(HFA).optional().describe("Fields required in `credentials` when creating an api_key connection. Absent for browser-auth providers."),browserConnectSupported:I.boolean().describe("Whether this provider's browser connect flow (`integrations.beginConnect`) is available in this environment. Readiness-derived: the provider begins on the consolidated OAuth callback route and its OAuth client credentials are provisioned. Providers still on legacy browser paths (Slack, Linear, Bitbucket) report false and connect from the dashboard.")}),uc=I.object({id:I.string().uuid(),provider:Nc,displayName:I.string().nullable(),status:VFA,isActive:I.boolean().describe("Whether this connection counts as connected (status 'connected' or 'error'). An error-status connection is the organization's connection — broken, not absent."),needsAttention:I.boolean().describe("Whether the connection should surface a reconnect prompt (status 'error' or health status 'unhealthy')."),metadata:I.record(I.string(),I.unknown()).describe("Non-secret provider metadata (e.g. workspace/team names)."),healthStatus:XFA,healthMessage:I.string().nullable(),healthCheckedAt:I.string().datetime().nullable(),healthConsecutiveFailures:I.number().int(),connectedBy:I.string().nullable(),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),AV=I.object({organizationEnabled:I.boolean().describe("Stored organization-wide policy."),connectionEnabled:I.boolean().describe("Stored connection policy."),effectiveEnabled:I.boolean().describe("True only when both stored policies are enabled.")}),jFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to list providers for. Auto-filled from CLI and SDK context when omitted.")}),_FA=I.object({providers:I.array(KFA)}),tV=L({operationId:"integrations.listProviders",description:"List supported integration providers and how many connections the organization has for each.",backend:"api",route:{method:"GET",path:"/integrations/providers",tags:["Integrations"]},input:jFA,output:_FA,pagination:"none",async:"sync"}),mFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to list connections for. Auto-filled from CLI and SDK context when omitted."),provider:Nc.optional().describe("Filter connections by provider.")}),xFA=I.object({connections:I.array(uc)}),gV=L({operationId:"integrations.listConnections",description:"List integration connections and their connection state for the organization.",backend:"api",route:{method:"GET",path:"/integrations/connections",tags:["Integrations"]},input:mFA,output:xFA,pagination:"none",async:"sync"}),qFA=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Connection ID to fetch.")}),dFA=I.object({connection:uc}),nV=L({operationId:"integrations.getConnection",description:"Get one integration connection by ID (non-secret config only).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:qFA,output:dFA,pagination:"none",async:"sync"}),sFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:Nc.describe("Integration provider to connect. Must use api_key auth (see `authType` in the provider catalog)."),displayName:I.string().trim().min(1).max(255).optional().describe("Optional display name for the connection."),credentials:I.record(I.string(),I.unknown()).describe("Vendor credentials. Fields vary by provider (see `credentialFields` on the provider catalog). Validated against the vendor before the connection is created; never returned.")}),pFA=I.object({connection:uc}),iV=L({operationId:"integrations.createConnection",description:"Create an integration connection for an api_key provider. Credentials are validated against the vendor, then stored encrypted.",backend:"api",route:{method:"POST",path:"/integrations/connections",tags:["Integrations"],successStatus:201},input:sFA,output:pFA,pagination:"none",async:"sync"}),ALA=I.object({organizationId:I.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:Nc.describe("Browser-auth provider to connect (oauth or app_installation). Must report `browserConnectSupported: true` in the provider catalog."),displayName:I.string().trim().min(1).max(255).optional().describe("Optional display name for the resulting connection."),projectId:I.string().trim().min(1).optional().describe("Project the completed connection defaults its routing to. Must belong to the organization.")}),tLA=I.object({url:I.string().describe("Vendor authorization (or app installation) URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:I.string().uuid().describe("Connect attempt to poll via `integrations.getConnectAttempt` while the browser flow completes."),expiresAt:I.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),QV=L({operationId:"integrations.beginConnect",description:"Begin a browser connect flow for an OAuth or app-installation provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/integrations/connect",tags:["Integrations"],successStatus:201},input:ALA,output:tLA,pagination:"none",async:"sync"}),gLA=I.enum(["pending","completed","not_connected","failed","expired"]),nLA=I.object({organizationId:I.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:I.string().uuid().describe("Connect attempt ID to poll.")}),iLA=I.object({status:gLA.describe("Attempt state. `not_connected` means the flow finished but the connection is not live yet (most commonly awaiting a third-party admin's approval). `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:I.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized) or `not_connected` (e.g. `installation_requested` for GitHub installs awaiting org-admin approval)."),connection:uc.optional().describe("The created connection when status is `completed`.")}),oV=L({operationId:"integrations.getConnectAttempt",description:"Poll a browser connect attempt started with `integrations.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/integrations/connect/attempts/{attemptId}",tags:["Integrations"]},input:nLA,output:iLA,pagination:"none",async:"sync"}),QLA=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Connection ID to disconnect.")}),oLA=I.object({success:I.literal(!0)}),IV=L({operationId:"integrations.disconnectConnection",description:"Disconnect an integration connection (soft delete). Always succeeds regardless of stored credential state; cached vendor catalogs and routing derived from the connection are removed.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:QLA,output:oLA,pagination:"none",async:"sync"}),ILA=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Connection ID to update."),credentials:I.record(I.string(),I.unknown()).describe("Replacement vendor credentials for an api_key connection. Validated against the vendor; resets the connection's health state on success.")}),eLA=I.object({connection:uc}),eV=L({operationId:"integrations.updateConnectionCredentials",description:"Replace an api_key connection's credentials in place — the reconnect path for a connection that needs attention. Keeps connection-scoped configuration.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/credentials",tags:["Integrations"]},input:ILA,output:eLA,pagination:"none",async:"sync"}),VY=I.object({organizationId:I.string().min(1).optional()}),BV=I.object({organizationEnabled:I.boolean(),effectiveEnabled:I.boolean()}),hV=VY.extend({connectionId:I.string().uuid().describe("Integration connection whose JIT policy is being read or updated.")}),CV=L({operationId:"integrations.getOrganizationExternalIdentityJitPolicy",description:"Read the organization's stored external-identity JIT policy.",backend:"api",route:{method:"GET",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:VY,output:BV,pagination:"none",async:"sync"}),cV=L({operationId:"integrations.updateOrganizationExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT across an organization.",backend:"api",route:{method:"PATCH",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:VY.extend({enabled:I.boolean()}),output:BV,pagination:"none",async:"sync"}),EV=L({operationId:"integrations.getConnectionExternalIdentityJitPolicy",description:"Read stored and effective JIT policy for one connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:hV,output:AV,pagination:"none",async:"sync"}),yV=L({operationId:"integrations.updateConnectionExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT for one connection.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:hV.extend({enabled:I.boolean()}),output:AV,pagination:"none",async:"sync"}),Uc=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Slack integration connection ID (the `integration_connections.id`, not the Slack team id).")}),DV=I.object({connectionId:I.string().uuid(),defaultProjectId:I.string().uuid().nullable().describe("Project new threads route to when no channel mapping matches."),automaticResponses:I.boolean().describe("Auto-respond to messages in channels the bot is in (autoReactEnabled)."),acknowledgementMessage:I.boolean().describe("Post a processing acknowledgement while a run is in flight (processingMessageEnabled).")}),BLA=Uc,aV=L({operationId:"integrations.getSlackConfiguration",description:"Read Slack connection configuration (default project, automatic responses, acknowledgement message).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:BLA,output:DV,pagination:"none",async:"sync"}),hLA=Uc.extend({defaultProjectId:I.string().uuid().nullable().optional().describe("Project new threads route to when no channel mapping matches. Pass null to clear it. Omit to leave unchanged."),automaticResponses:I.boolean().optional().describe("Omit to leave unchanged."),acknowledgementMessage:I.boolean().optional().describe("Omit to leave unchanged.")}),wV=L({operationId:"integrations.updateSlackConfiguration",description:"Update Slack connection configuration. Omitted fields are left unchanged.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:hLA,output:DV,pagination:"none",async:"sync"}),rV=I.object({connectionId:I.string().uuid(),slackChannelId:I.string().min(1),slackChannelName:I.string().min(1),projectId:I.string().uuid()}),CLA=Uc,cLA=I.object({mappings:I.array(rV)}),bV=L({operationId:"integrations.listSlackChannelProjectMappings",description:"List channel-to-project mappings for a Slack connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings",tags:["Integrations"]},input:CLA,output:cLA,pagination:"none",async:"sync"}),ELA=Uc.extend({slackChannelId:I.string().min(1).describe("Slack channel ID (e.g. C0123ABCDEF)."),slackChannelName:I.string().min(1).optional().describe("Optional. Ignored for storage — the authoritative channel name is "+"always resolved from the connection's channel catalog. Accepted only as a convenience/label; the response returns the catalog name."),projectId:I.string().uuid().describe("Project the channel routes to. Must belong to the organization.")}),NV=L({operationId:"integrations.setSlackChannelProjectMapping",description:"Create or update the channel-to-project mapping for one Slack channel. Idempotent on (connection, channel).",backend:"api",route:{method:"PUT",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:ELA,output:rV,pagination:"none",async:"sync"}),yLA=Uc.extend({slackChannelId:I.string().min(1)}),DLA=I.object({success:I.boolean()}),uV=L({operationId:"integrations.deleteSlackChannelProjectMapping",description:"Delete a channel-to-project mapping.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:yLA,output:DLA,pagination:"none",async:"sync"})});var Kn,aLA,wLA,FV,uw,Uw,LV,XY,SV,HY,lV,MV,rLA,bLA,YV,$V,kV,GV,JV,TV,RV,fV,PV,zV,OV,vV,ZV,WV,VV,He,Fw,Lw,Sw,lw,Mw,Yw,$w,kw,Gw,Jw,NLA;var KY=D(()=>{TA();VA();Kn=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),description:I.string().nullable(),status:I.enum(["open","resolved","ignored"]),severity:I.enum(["low","medium","high","critical"]),componentId:I.string().uuid().nullable(),createdAt:I.string().datetime(),resolvedAt:I.string().datetime().nullable(),mutedAt:I.string().datetime().nullable(),muteHitCount:I.number().int().nonnegative(),lastActivityAt:I.string().datetime().nullable(),lastDeliveredAt:I.string().datetime().nullable(),locked:I.boolean(),redacted:I.boolean()}),aLA=I.object({channelId:I.string().nullable(),channelName:I.string().nullable(),threadTs:I.string().nullable(),permalink:I.string().nullable(),workspaceName:I.string().nullable()}),wLA=Kn.extend({slackChannels:I.array(aLA)}),FV=Kn.extend({delivery:I.record(I.string(),I.unknown()).nullable().optional()}),uw=I.object({projectId:I.string().uuid().optional().describe("Project to create the issue in. Auto-filled from CLI and SDK context when omitted."),name:I.string().trim().min(1).optional().describe("Stable issue name for indexing and mute matching. When omitted, the name is derived from contentMdx."),contentMdx:I.string().trim().min(1,"contentMdx cannot be empty").optional().describe("Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence). Required unless sample is true."),severity:I.enum(["low","medium","high","critical"]).default("medium").describe("Issue severity used for prioritization and triage."),componentId:I.string().uuid().optional().describe("UUID of a registered component this issue belongs to. Required unless sample is true: every issue must be attributed to a component. List components first and pick the best match; register one if none fits. Missing or unknown IDs are rejected."),statusStartedAt:I.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident began."),sample:I.boolean().optional().describe("When true, creates (or returns) the organization's onboarding sample issue for the target project using the curated sample payload, and the alert rides the normal issue_triggered broadcast to the configured delivery rules. Mutually exclusive with the content inputs (name, contentMdx, severity, componentId, statusStartedAt); projectId stays allowed. Idempotent per project: an existing sample attempt's issue is returned instead of creating a new one. Requires a user credential.")}),Uw=uw.superRefine((A,t)=>{if(A.sample){let g=[["name",A.name!==void 0],["contentMdx",A.contentMdx!==void 0],["severity",A.severity!=="medium"],["componentId",A.componentId!==void 0],["statusStartedAt",A.statusStartedAt!==void 0]];for(let[i,n]of g)if(n)t.addIssue({code:"custom",path:[i],message:`${i} is not allowed when sample is true.`})}else{if(!A.contentMdx)t.addIssue({code:"custom",path:["contentMdx"],message:"contentMdx is required"});if(!A.componentId)t.addIssue({code:"custom",path:["componentId"],message:"componentId is required"})}if(A.statusStartedAt&&!A.componentId)t.addIssue({code:"custom",path:["statusStartedAt"],message:"statusStartedAt requires componentId."})}),LV=I.object({issue:Kn,duplicateIssueId:I.string().uuid().optional().describe("Present when creation reused an existing open issue instead of creating a new one.")}),XY=I.object({projectId:I.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:I.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:I.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),componentId:I.string().uuid().optional().describe("Filter by component ID.")}),SV=I.object({issues:I.array(Kn),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),HY=XY.extend({name:I.string().trim().optional().describe("Case-insensitive partial match on issue name."),includeDeliveryMetadata:I.union([I.boolean(),I.stringbool()]).default(!1).describe("When true, include raw delivery metadata in each issue.")}),lV=I.object({issues:I.array(FV),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),MV=HY.omit({limit:!0,cursor:!0,includeDeliveryMetadata:!0}),rLA=I.object({open:I.number().int().nonnegative(),resolved:I.number().int().nonnegative(),ignored:I.number().int().nonnegative()}),bLA=I.object({low:I.number().int().nonnegative(),medium:I.number().int().nonnegative(),high:I.number().int().nonnegative(),critical:I.number().int().nonnegative()}),YV=I.object({total:I.number().int().nonnegative(),byStatus:rLA,bySeverity:bLA,filters:I.object({name:I.string().nullable(),status:I.enum(["open","resolved","ignored"]).nullable(),severity:I.enum(["low","medium","high","critical"]).nullable(),componentId:I.string().uuid().nullable()})}),$V=I.object({issueId:I.string().uuid().describe("Issue ID to retrieve.")}),kV=I.object({issue:wLA}),GV=I.object({issueId:I.string().uuid().describe("Issue ID to resolve."),statusResolvedAt:I.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident ended.")}),JV=I.object({issue:Kn}),TV=I.object({issueId:I.string().uuid().describe("Issue ID to ignore.")}),RV=I.object({issue:Kn}),fV=I.object({issueId:I.string().uuid().describe("Issue ID to reopen.")}),PV=I.object({issue:Kn}),zV=I.object({issueId:I.string().uuid().describe("Issue ID to reassign and reopen."),targetComponentId:I.string().uuid().describe("Active canonical component that will own the reopened issue.")}),OV=I.object({issue:Kn,sourceComponentId:I.string().uuid(),targetComponentId:I.string().uuid()}),vV=I.object({issueId:I.string().uuid().describe("Issue ID to mute.")}),ZV=I.object({issue:Kn}),WV=I.object({issueId:I.string().uuid().describe("Issue ID to unmute.")}),VV=I.object({issue:Kn}),He=L({operationId:"issues.create",description:"Create an issue in a project, returning an existing open issue when root-cause deduplication finds a match.",backend:"api",route:{method:"POST",path:"/issues",tags:["Issues"],successStatus:201},input:Uw,output:LV,pagination:"none",async:"sync"}),Fw=L({operationId:"issues.list",description:"List issues in a project, optionally filtered by status and severity.",backend:"api",route:{method:"GET",path:"/issues",tags:["Issues"]},input:XY,output:SV,pagination:"cursor",async:"sync"}),Lw=L({operationId:"issues.search",description:"Search issues in a project by name, status, and severity.",backend:"api",route:{method:"GET",path:"/issues/search",tags:["Issues"]},input:HY,output:lV,pagination:"cursor",async:"sync"}),Sw=L({operationId:"issues.count",description:"Count issues in a project with status and severity breakdowns.",backend:"api",route:{method:"GET",path:"/issues/count",tags:["Issues"]},input:MV,output:YV,pagination:"none",async:"sync"}),lw=L({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:$V,output:kV,pagination:"none",async:"sync"}),Mw=L({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:GV,output:JV,pagination:"none",async:"sync"}),Yw=L({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:TV,output:RV,pagination:"none",async:"sync"}),$w=L({operationId:"issues.reopen",description:"Reopen a resolved or ignored issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reopen",tags:["Issues"]},input:fV,output:PV,pagination:"none",async:"sync"}),kw=L({operationId:"issues.reassignAndReopen",description:"Atomically reassign a resolved or ignored issue to an active component and reopen it.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reassign-and-reopen",tags:["Issues"]},input:zV,output:OV,pagination:"none",async:"sync"}),Gw=L({operationId:"issues.mute",description:"Mute an issue, suppressing future re-fires without changing status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/mute",tags:["Issues"]},input:vV,output:ZV,pagination:"none",async:"sync"}),Jw=L({operationId:"issues.unmute",description:"Unmute an issue, preserving its current status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unmute",tags:["Issues"]},input:WV,output:VV,pagination:"none",async:"sync"}),NLA={count:Sw.contract,create:He.contract,list:Fw.contract,search:Lw.contract,get:lw.contract,resolve:Mw.contract,ignore:Yw.contract,reopen:$w.contract,reassignAndReopen:kw.contract,mute:Gw.contract,unmute:Jw.contract}});var jY,XV,Tw,Rw,HV,KV,jV,_V,fw,_Y,mV,xV,qV,dV,sV,pV,AX,tX,gX,nX,iX,QX,Ke,je,_e,me,xe,Pw,zw,Ow,vw,Zw,uLA,ULA;var mY=D(()=>{TA();VA();jY=/^[a-zA-Z0-9\s\-_]+$/,XV=I.object({id:I.string().uuid(),name:I.string(),expiresAt:I.string().datetime().nullable(),lastUsedAt:I.string().datetime().nullable(),createdAt:I.string().datetime()}),Tw=XV.extend({projectId:I.string().uuid(),dataSourceConnectionId:I.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:I.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),Rw=XV.extend({projectId:I.string().uuid().nullable()}),HV=I.object({projectId:I.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),KV=I.object({publicKeys:I.array(Tw),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),jV=I.object({secretKeys:I.array(Rw),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),_V=I.object({projectId:I.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:I.string().uuid().describe("Key ID to fetch.")}),fw=I.object({publicKey:Tw}),_Y=I.object({secretKey:Rw}),mV=I.object({publicKey:Tw.extend({value:I.string()})}),xV=I.object({projectId:I.string().uuid().optional().describe("Project to ensure the log forwarding key for. Auto-filled from CLI and SDK context when omitted.")}),qV=I.object({secretKey:Rw.extend({value:I.string()})}),dV=I.object({projectId:I.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:I.string().uuid().describe("Key ID to update."),name:I.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(jY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:I.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),sV=I.object({params:I.object({keyId:I.string().uuid().describe("Public key ID to deactivate.")}),query:I.object({projectId:I.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),pV=fw,AX=I.void(),tX=I.object({organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),gX=I.object({keyId:I.string().uuid().describe("Key ID to fetch."),organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one.")}),nX=I.object({organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one."),projectId:I.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project. Omit for organization-wide access."),name:I.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(jY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:I.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),iX=I.object({keyId:I.string().uuid().describe("Key ID to update."),organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one."),name:I.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(jY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:I.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),QX=I.object({params:I.object({keyId:I.string().uuid().describe("Key ID to delete.")}),organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one.")}).transform(({params:A,organizationId:t})=>({...A,...t!==void 0?{organizationId:t}:{}})),Ke=L({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:HV,output:KV,pagination:"cursor",async:"sync",examples:[{name:"list-public-keys",input:{projectId:"11111111-1111-4111-8111-111111111111",limit:25},output:{publicKeys:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),je=L({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:_V,output:fw,pagination:"none",async:"sync",examples:[{name:"get-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),_e=L({operationId:"publicKeys.ensureLogForwarding",description:"Ensure a reusable project-scoped public key exists for CLI log forwarding.",backend:"api",route:{method:"POST",path:"/public-keys/log-forwarding/ensure",tags:["Public Keys"]},input:xV,output:mV,pagination:"none",async:"sync",examples:[{name:"ensure-log-forwarding-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"sazabi-cli-forward",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_public_example"}}}]}),me=L({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:dV,output:fw,pagination:"none",async:"sync",examples:[{name:"rename-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222",name:"Updated CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"Updated CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),xe=L({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Recently validated requests may continue to authenticate for a short period after deactivation.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:sV,output:pV,pagination:"none",async:"sync"}),Pw=L({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:tX,output:jV,pagination:"cursor",async:"sync",examples:[{name:"list-secret-keys",input:{limit:25},output:{secretKeys:[{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),zw=L({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:gX,output:_Y,pagination:"none",async:"sync",examples:[{name:"get-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Ow=L({operationId:"secretKeys.create",description:"Create one secret key within the organization.",backend:"api",route:{method:"POST",path:"/secret-keys",successStatus:201,tags:["Secret Keys"]},input:nX,output:qV,pagination:"none",async:"sync",examples:[{name:"create-secret-key",input:{name:"CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_secret_example"}}}]}),vw=L({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:iX,output:_Y,pagination:"none",async:"sync",examples:[{name:"rename-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333",name:"Updated CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"Updated CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Zw=L({operationId:"secretKeys.delete",description:"Delete one secret key within the organization.",backend:"api",route:{method:"DELETE",path:"/secret-keys/{keyId}",successStatus:204,tags:["Secret Keys"],inputStructure:"detailed"},input:QX,output:AX,pagination:"none",async:"sync"}),uLA={list:Ke.contract,get:je.contract,ensureLogForwarding:_e.contract,update:me.contract,deactivate:xe.contract},ULA={list:Pw.contract,get:zw.contract,create:Ow.contract,update:vw.contract,delete:Zw.contract}});var xY,oX,qY,Fc,FLA,LLA,SLA,lLA,MLA,YLA,$LA,kLA,GLA,JLA,dY,sY,pY,A$,t$,kEt;var IX=D(()=>{TA();VA();xY=I.string().uuid().describe("Log match expression ID."),oX=I.string().min(1).max(200).describe("Human-readable expression name."),qY=I.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),Fc=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),expression:qY,enabled:I.boolean(),compiledVersion:I.number().int(),linkedAutomationIds:I.array(I.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),FLA=I.object({projectId:I.string().uuid().optional().describe("Project to list expressions for. Auto-filled from CLI and SDK context when omitted.")}),LLA=I.object({expressions:I.array(Fc)}),SLA=I.object({expressionId:xY,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),lLA=I.object({expression:Fc}),MLA=I.object({projectId:I.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:oX,expression:qY,enabled:I.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),YLA=I.object({expression:Fc}),$LA=I.object({expressionId:xY,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:oX.optional(),expression:qY.optional(),enabled:I.boolean().optional().describe("Whether the expression is enabled.")}),kLA=I.object({expression:Fc}),GLA=I.object({expressionId:xY,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),JLA=I.object({expression:Fc}),dY=L({operationId:"logMatchExpressions.list",description:"List CEL log-match expressions in a project.",backend:"api",route:{method:"GET",path:"/log-match-expressions",tags:["Log match expressions"]},input:FLA,output:LLA,pagination:"none",async:"sync"}),sY=L({operationId:"logMatchExpressions.get",description:"Get a single log-match expression by ID.",backend:"api",route:{method:"GET",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:SLA,output:lLA,pagination:"none",async:"sync"}),pY=L({operationId:"logMatchExpressions.create",description:"Create a CEL log-match expression for a project.",backend:"api",route:{method:"POST",path:"/log-match-expressions",successStatus:201,tags:["Log match expressions"]},input:MLA,output:YLA,pagination:"none",async:"sync"}),A$=L({operationId:"logMatchExpressions.update",description:"Update a log-match expression's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:$LA,output:kLA,pagination:"none",async:"sync"}),t$=L({operationId:"logMatchExpressions.disable",description:"Disable a log-match expression so it stops matching logs.",backend:"api",route:{method:"POST",path:"/log-match-expressions/{expressionId}/disable",tags:["Log match expressions"]},input:GLA,output:JLA,pagination:"none",async:"sync"}),kEt={list:dY.contract,get:sY.contract,create:pY.contract,update:A$.contract,disable:t$.contract}});var BX="## Overview\n\nSend Claude Code session telemetry to Sazabi. Every session emits lifecycle events — prompts, tool calls, and model API requests with token counts and cost — as OTLP log records.\n\n## How it works\n\nClaude Code has a first-party OTLP exporter. Set a handful of environment variables in `~/.claude/settings.json` pointing the exporter at your Sazabi intake URL, and Claude Code sends telemetry over OTLP/HTTP on its own — no separate SDK or code changes required.\n\n## Streams\n\n- **Session events** — `claude_code.user_prompt`, `claude_code.tool_result`, `claude_code.api_request`, and related events, with attributes for `prompt`, `model`, `session.id`, `user.email`, token counts, and cost.\n\n## Limitations\n\n- Claude Code **metrics** are not ingested; only the logs exporter is supported.\n";var eX=()=>{};var CX=`---
|
|
105
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of A.seen.entries()){let e=o[1];if(t===o[0]){Q(o);continue}if(A.external){let h=A.external.registry.get(o[0])?.id;if(t!==o[0]&&h){Q(o);continue}}if(A.metadataRegistry.get(o[0])?.id){Q(o);continue}if(e.cycle){Q(o);continue}if(e.count>1){if(A.reused==="ref"){Q(o);continue}}}}function PQ(A,t){let g=A.seen.get(t);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let i=(o)=>{let e=A.seen.get(o);if(e.ref===null)return;let B=e.def??e.schema,h={...B},C=e.ref;if(e.ref=null,C){i(C);let E=A.seen.get(C),y=E.schema;if(y.$ref&&(A.target==="draft-07"||A.target==="draft-04"||A.target==="openapi-3.0"))B.allOf=B.allOf??[],B.allOf.push(y);else Object.assign(B,y);if(Object.assign(B,h),o._zod.parent===C)for(let w in B){if(w==="$ref"||w==="allOf")continue;if(!(w in h))delete B[w]}if(y.$ref&&E.def)for(let w in B){if(w==="$ref"||w==="allOf")continue;if(w in E.def&&JSON.stringify(B[w])===JSON.stringify(E.def[w]))delete B[w]}}let c=o._zod.parent;if(c&&c!==C){i(c);let E=A.seen.get(c);if(E?.schema.$ref){if(B.$ref=E.schema.$ref,E.def)for(let y in B){if(y==="$ref"||y==="allOf")continue;if(y in E.def&&JSON.stringify(B[y])===JSON.stringify(E.def[y]))delete B[y]}}}A.override({zodSchema:o,jsonSchema:B,path:e.path??[]})};for(let o of[...A.seen.entries()].reverse())i(o[0]);let n={};if(A.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(A.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(A.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(A.target==="openapi-3.0");if(A.external?.uri){let o=A.external.registry.get(t)?.id;if(!o)throw Error("Schema is missing an `id` property");n.$id=A.external.uri(o)}Object.assign(n,g.def??g.schema);let Q=A.external?.defs??{};for(let o of A.seen.entries()){let e=o[1];if(e.def&&e.defId)Q[e.defId]=e.def}if(A.external);else if(Object.keys(Q).length>0)if(A.target==="draft-2020-12")n.$defs=Q;else n.definitions=Q;try{let o=JSON.parse(JSON.stringify(n));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Re(t,"input",A.processors),output:Re(t,"output",A.processors)}},enumerable:!1,writable:!1}),o}catch(o){throw Error("Error converting schema to JSON.")}}function Lg(A,t){let g=t??{seen:new Set};if(g.seen.has(A))return!1;g.seen.add(A);let i=A._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Lg(i.element,g);if(i.type==="set")return Lg(i.valueType,g);if(i.type==="lazy")return Lg(i.getter(),g);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Lg(i.innerType,g);if(i.type==="intersection")return Lg(i.left,g)||Lg(i.right,g);if(i.type==="record"||i.type==="map")return Lg(i.keyType,g)||Lg(i.valueType,g);if(i.type==="pipe")return Lg(i.in,g)||Lg(i.out,g);if(i.type==="object"){for(let n in i.shape)if(Lg(i.shape[n],g))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(Lg(n,g))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(Lg(n,g))return!0;if(i.rest&&Lg(i.rest,g))return!0;return!1}return!1}var sS=(A,t={})=>(g)=>{let i=RQ({...g,processors:t});return dA(A,i),fQ(i,A),PQ(i,A)},Re=(A,t,g={})=>(i)=>{let{libraryOptions:n,target:Q}=i??{},o=RQ({...n??{},target:Q,io:t,processors:g});return dA(A,o),fQ(o,A),PQ(o,A)};var dC=D(()=>{mC()});function ba(A,t){if("_idmap"in A){let i=A,n=RQ({...t,processors:aa}),Q={};for(let B of i._idmap.entries()){let[h,C]=B;dA(C,n)}let o={},e={registry:i,uri:t?.uri,defs:Q};n.external=e;for(let B of i._idmap.entries()){let[h,C]=B;fQ(n,C),o[h]=PQ(n,C)}if(Object.keys(Q).length>0){let B=n.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[B]:Q}}return{schemas:o}}let g=RQ({...t,processors:aa});return dA(A,g),fQ(g,A),PQ(g,A)}var EUA,pS=(A,t,g,i)=>{let n=g;n.type="string";let{minimum:Q,maximum:o,format:e,patterns:B,contentEncoding:h}=A._zod.bag;if(typeof Q==="number")n.minLength=Q;if(typeof o==="number")n.maxLength=o;if(e){if(n.format=EUA[e]??e,n.format==="")delete n.format;if(e==="time")delete n.format}if(h)n.contentEncoding=h;if(B&&B.size>0){let C=[...B];if(C.length===1)n.pattern=C[0].source;else if(C.length>1)n.allOf=[...C.map((c)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))]}},Al=(A,t,g,i)=>{let n=g,{minimum:Q,maximum:o,format:e,multipleOf:B,exclusiveMaximum:h,exclusiveMinimum:C}=A._zod.bag;if(typeof e==="string"&&e.includes("int"))n.type="integer";else n.type="number";if(typeof C==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.minimum=C,n.exclusiveMinimum=!0;else n.exclusiveMinimum=C;if(typeof Q==="number"){if(n.minimum=Q,typeof C==="number"&&t.target!=="draft-04")if(C>=Q)delete n.minimum;else delete n.exclusiveMinimum}if(typeof h==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")n.maximum=h,n.exclusiveMaximum=!0;else n.exclusiveMaximum=h;if(typeof o==="number"){if(n.maximum=o,typeof h==="number"&&t.target!=="draft-04")if(h<=o)delete n.maximum;else delete n.exclusiveMaximum}if(typeof B==="number")n.multipleOf=B},tl=(A,t,g,i)=>{g.type="boolean"},gl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},nl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},il=(A,t,g,i)=>{if(t.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},Ql=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},ol=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Il=(A,t,g,i)=>{g.not={}},el=(A,t,g,i)=>{},Bl=(A,t,g,i)=>{},hl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Cl=(A,t,g,i)=>{let n=A._zod.def,Q=$C(n.entries);if(Q.every((o)=>typeof o==="number"))g.type="number";if(Q.every((o)=>typeof o==="string"))g.type="string";g.enum=Q},cl=(A,t,g,i)=>{let n=A._zod.def,Q=[];for(let o of n.values)if(o===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else Q.push(Number(o));else Q.push(o);if(Q.length===0);else if(Q.length===1){let o=Q[0];if(g.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0")g.enum=[o];else g.const=o}else{if(Q.every((o)=>typeof o==="number"))g.type="number";if(Q.every((o)=>typeof o==="string"))g.type="string";if(Q.every((o)=>typeof o==="boolean"))g.type="boolean";if(Q.every((o)=>o===null))g.type="null";g.enum=Q}},El=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},yl=(A,t,g,i)=>{let n=g,Q=A._zod.pattern;if(!Q)throw Error("Pattern not found in template literal");n.type="string",n.pattern=Q.source},Dl=(A,t,g,i)=>{let n=g,Q={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:e,mime:B}=A._zod.bag;if(o!==void 0)Q.minLength=o;if(e!==void 0)Q.maxLength=e;if(B)if(B.length===1)Q.contentMediaType=B[0],Object.assign(n,Q);else Object.assign(n,Q),n.anyOf=B.map((h)=>({contentMediaType:h}));else Object.assign(n,Q)},al=(A,t,g,i)=>{g.type="boolean"},wl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},rl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},bl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},Nl=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},ul=(A,t,g,i)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Ul=(A,t,g,i)=>{let n=g,Q=A._zod.def,{minimum:o,maximum:e}=A._zod.bag;if(typeof o==="number")n.minItems=o;if(typeof e==="number")n.maxItems=e;n.type="array",n.items=dA(Q.element,t,{...i,path:[...i.path,"items"]})},Fl=(A,t,g,i)=>{let n=g,Q=A._zod.def;n.type="object",n.properties={};let o=Q.shape;for(let h in o)n.properties[h]=dA(o[h],t,{...i,path:[...i.path,"properties",h]});let e=new Set(Object.keys(o)),B=new Set([...e].filter((h)=>{let C=Q.shape[h]._zod;if(t.io==="input")return C.optin===void 0;else return C.optout===void 0}));if(B.size>0)n.required=Array.from(B);if(Q.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!Q.catchall){if(t.io==="output")n.additionalProperties=!1}else if(Q.catchall)n.additionalProperties=dA(Q.catchall,t,{...i,path:[...i.path,"additionalProperties"]})},wa=(A,t,g,i)=>{let n=A._zod.def,Q=n.inclusive===!1,o=n.options.map((e,B)=>dA(e,t,{...i,path:[...i.path,Q?"oneOf":"anyOf",B]}));if(Q)g.oneOf=o;else g.anyOf=o},Ll=(A,t,g,i)=>{let n=A._zod.def,Q=dA(n.left,t,{...i,path:[...i.path,"allOf",0]}),o=dA(n.right,t,{...i,path:[...i.path,"allOf",1]}),e=(h)=>("allOf"in h)&&Object.keys(h).length===1,B=[...e(Q)?Q.allOf:[Q],...e(o)?o.allOf:[o]];g.allOf=B},Sl=(A,t,g,i)=>{let n=g,Q=A._zod.def;n.type="array";let o=t.target==="draft-2020-12"?"prefixItems":"items",e=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",B=Q.items.map((E,y)=>dA(E,t,{...i,path:[...i.path,o,y]})),h=Q.rest?dA(Q.rest,t,{...i,path:[...i.path,e,...t.target==="openapi-3.0"?[Q.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=B,h)n.items=h}else if(t.target==="openapi-3.0"){if(n.items={anyOf:B},h)n.items.anyOf.push(h);if(n.minItems=B.length,!h)n.maxItems=B.length}else if(n.items=B,h)n.additionalItems=h;let{minimum:C,maximum:c}=A._zod.bag;if(typeof C==="number")n.minItems=C;if(typeof c==="number")n.maxItems=c},ll=(A,t,g,i)=>{let n=g,Q=A._zod.def;n.type="object";let o=Q.keyType,B=o._zod.bag?.patterns;if(Q.mode==="loose"&&B&&B.size>0){let C=dA(Q.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let c of B)n.patternProperties[c.source]=C}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=dA(Q.keyType,t,{...i,path:[...i.path,"propertyNames"]});n.additionalProperties=dA(Q.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let h=o._zod.values;if(h){let C=[...h].filter((c)=>typeof c==="string"||typeof c==="number");if(C.length>0)n.required=C}},Ml=(A,t,g,i)=>{let n=A._zod.def,Q=dA(n.innerType,t,i),o=t.seen.get(A);if(t.target==="openapi-3.0")o.ref=n.innerType,g.nullable=!0;else g.anyOf=[Q,{type:"null"}]},Yl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType},$l=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType,g.default=JSON.parse(JSON.stringify(n.defaultValue))},kl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);if(Q.ref=n.innerType,t.io==="input")g._prefault=JSON.parse(JSON.stringify(n.defaultValue))},Gl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType;let o;try{o=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=o},Jl=(A,t,g,i)=>{let n=A._zod.def,Q=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;dA(Q,t,i);let o=t.seen.get(A);o.ref=Q},Tl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType,g.readOnly=!0},Rl=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType},ra=(A,t,g,i)=>{let n=A._zod.def;dA(n.innerType,t,i);let Q=t.seen.get(A);Q.ref=n.innerType},fl=(A,t,g,i)=>{let n=A._zod.innerType;dA(n,t,i);let Q=t.seen.get(A);Q.ref=n},aa;var sC=D(()=>{dC();cA();EUA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aa={string:pS,number:Al,boolean:tl,bigint:gl,symbol:nl,null:il,undefined:Ql,void:ol,never:Il,any:el,unknown:Bl,date:hl,enum:Cl,literal:cl,nan:El,template_literal:yl,file:Dl,success:al,custom:wl,function:rl,transform:bl,map:Nl,set:ul,array:Ul,object:Fl,union:wa,intersection:Ll,tuple:Sl,record:ll,nullable:Ml,nonoptional:Yl,default:$l,prefault:kl,catch:Gl,pipe:Jl,readonly:Tl,promise:Rl,optional:ra,lazy:fl}});class Pl{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(A){this.ctx.counter=A}get seen(){return this.ctx.seen}constructor(A){let t=A?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=RQ({processors:aa,target:t,...A?.metadata&&{metadata:A.metadata},...A?.unrepresentable&&{unrepresentable:A.unrepresentable},...A?.override&&{override:A.override},...A?.io&&{io:A.io}})}process(A,t={path:[],schemaPath:[]}){return dA(A,this.ctx,t)}emit(A,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}fQ(this.ctx,A);let g=PQ(this.ctx,A),{"~standard":i,...n}=g;return n}}var I4=D(()=>{sC();dC()});var e4={};var B4=()=>{};var di={};ei(di,{version:()=>tF,util:()=>q,treeifyError:()=>nU,toJSONSchema:()=>ba,toDotPath:()=>v1,safeParseAsync:()=>IU,safeParse:()=>oU,safeEncodeAsync:()=>NNA,safeEncode:()=>rNA,safeDecodeAsync:()=>uNA,safeDecode:()=>bNA,registry:()=>HD,regexes:()=>un,process:()=>dA,prettifyError:()=>iU,parseAsync:()=>ND,parse:()=>bD,meta:()=>qS,locales:()=>_C,isValidJWT:()=>i2,isValidBase64URL:()=>n2,isValidBase64:()=>LF,initializeContext:()=>RQ,globalRegistry:()=>st,globalConfig:()=>lC,formatError:()=>PC,flattenError:()=>fC,finalize:()=>PQ,extractDefs:()=>fQ,encodeAsync:()=>aNA,encode:()=>yNA,describe:()=>xS,decodeAsync:()=>wNA,decode:()=>DNA,createToJSONSchemaMethod:()=>sS,createStandardJSONSchemaMethod:()=>Re,config:()=>$t,clone:()=>Ug,_xor:()=>KuA,_xid:()=>ta,_void:()=>ZS,_uuidv7:()=>xD,_uuidv6:()=>mD,_uuidv4:()=>_D,_uuid:()=>jD,_url:()=>qC,_uppercase:()=>Fe,_unknown:()=>OS,_union:()=>HuA,_undefined:()=>fS,_ulid:()=>Aa,_uint64:()=>TS,_uint32:()=>MS,_tuple:()=>muA,_trim:()=>$e,_transform:()=>tUA,_toUpperCase:()=>Ge,_toLowerCase:()=>ke,_templateLiteral:()=>hUA,_symbol:()=>RS,_superRefine:()=>mS,_success:()=>oUA,_stringbool:()=>dS,_stringFormat:()=>Te,_string:()=>ES,_startsWith:()=>Se,_slugify:()=>Je,_size:()=>Wo,_set:()=>duA,_safeParseAsync:()=>re,_safeParse:()=>we,_safeEncodeAsync:()=>MD,_safeEncode:()=>SD,_safeDecodeAsync:()=>YD,_safeDecode:()=>lD,_regex:()=>ue,_refine:()=>_S,_record:()=>xuA,_readonly:()=>BUA,_property:()=>Da,_promise:()=>cUA,_positive:()=>Ca,_pipe:()=>eUA,_parseAsync:()=>ae,_parse:()=>De,_overwrite:()=>Xn,_optional:()=>gUA,_number:()=>uS,_nullable:()=>nUA,_null:()=>PS,_normalize:()=>Ye,_nonpositive:()=>Ea,_nonoptional:()=>QUA,_nonnegative:()=>ya,_never:()=>vS,_negative:()=>ca,_nativeEnum:()=>puA,_nanoid:()=>dD,_nan:()=>XS,_multipleOf:()=>JQ,_minSize:()=>yi,_minLength:()=>qi,_min:()=>Fg,_mime:()=>Me,_maxSize:()=>TQ,_maxLength:()=>Vo,_max:()=>gn,_map:()=>quA,_mac:()=>DS,_lte:()=>gn,_lt:()=>ci,_lowercase:()=>Ue,_literal:()=>AUA,_length:()=>Xo,_lazy:()=>CUA,_ksuid:()=>ga,_jwt:()=>ha,_isoTime:()=>bS,_isoDuration:()=>NS,_isoDateTime:()=>wS,_isoDate:()=>rS,_ipv6:()=>ia,_ipv4:()=>na,_intersection:()=>_uA,_int64:()=>JS,_int32:()=>lS,_int:()=>FS,_includes:()=>Le,_guid:()=>xC,_gte:()=>Fg,_gt:()=>Ei,_float64:()=>SS,_float32:()=>LS,_file:()=>KS,_enum:()=>suA,_endsWith:()=>le,_encodeAsync:()=>FD,_encode:()=>uD,_emoji:()=>qD,_email:()=>KD,_e164:()=>Ba,_discriminatedUnion:()=>juA,_default:()=>iUA,_decodeAsync:()=>LD,_decode:()=>UD,_date:()=>WS,_custom:()=>jS,_cuid2:()=>pD,_cuid:()=>sD,_coercedString:()=>yS,_coercedNumber:()=>US,_coercedDate:()=>VS,_coercedBoolean:()=>$S,_coercedBigint:()=>GS,_cidrv6:()=>oa,_cidrv4:()=>Qa,_check:()=>Q4,_catch:()=>IUA,_boolean:()=>YS,_bigint:()=>kS,_base64url:()=>ea,_base64:()=>Ia,_array:()=>HS,_any:()=>zS,TimePrecision:()=>aS,NEVER:()=>MC,JSONSchemaGenerator:()=>Pl,JSONSchema:()=>e4,Doc:()=>RD,$output:()=>hS,$input:()=>CS,$constructor:()=>k,$brand:()=>_u,$ZodXor:()=>VF,$ZodXID:()=>EF,$ZodVoid:()=>OF,$ZodUnknown:()=>PF,$ZodUnion:()=>WC,$ZodUndefined:()=>TF,$ZodUUID:()=>QF,$ZodURL:()=>IF,$ZodULID:()=>cF,$ZodType:()=>lA,$ZodTuple:()=>VD,$ZodTransform:()=>dF,$ZodTemplateLiteral:()=>eL,$ZodSymbol:()=>JF,$ZodSuccess:()=>nL,$ZodStringFormat:()=>ot,$ZodString:()=>Zo,$ZodSet:()=>_F,$ZodRegistry:()=>cS,$ZodRecord:()=>KF,$ZodRealError:()=>zg,$ZodReadonly:()=>IL,$ZodPromise:()=>hL,$ZodPrefault:()=>tL,$ZodPipe:()=>oL,$ZodOptional:()=>XD,$ZodObjectJIT:()=>WF,$ZodObject:()=>I2,$ZodNumberFormat:()=>kF,$ZodNumber:()=>ZD,$ZodNullable:()=>pF,$ZodNull:()=>RF,$ZodNonOptional:()=>gL,$ZodNever:()=>zF,$ZodNanoID:()=>BF,$ZodNaN:()=>QL,$ZodMap:()=>jF,$ZodMAC:()=>uF,$ZodLiteral:()=>xF,$ZodLazy:()=>CL,$ZodKSUID:()=>yF,$ZodJWT:()=>YF,$ZodIntersection:()=>HF,$ZodISOTime:()=>wF,$ZodISODuration:()=>rF,$ZodISODateTime:()=>DF,$ZodISODate:()=>aF,$ZodIPv6:()=>NF,$ZodIPv4:()=>bF,$ZodGUID:()=>iF,$ZodFunction:()=>BL,$ZodFile:()=>qF,$ZodExactOptional:()=>sF,$ZodError:()=>RC,$ZodEnum:()=>mF,$ZodEncodeError:()=>zo,$ZodEmoji:()=>eF,$ZodEmail:()=>oF,$ZodE164:()=>MF,$ZodDiscriminatedUnion:()=>XF,$ZodDefault:()=>AL,$ZodDate:()=>vF,$ZodCustomStringFormat:()=>$F,$ZodCustom:()=>cL,$ZodCodec:()=>VC,$ZodCheckUpperCase:()=>mU,$ZodCheckStringFormat:()=>be,$ZodCheckStartsWith:()=>qU,$ZodCheckSizeEquals:()=>VU,$ZodCheckRegex:()=>jU,$ZodCheckProperty:()=>sU,$ZodCheckOverwrite:()=>AF,$ZodCheckNumberFormat:()=>OU,$ZodCheckMultipleOf:()=>zU,$ZodCheckMinSize:()=>WU,$ZodCheckMinLength:()=>HU,$ZodCheckMimeType:()=>pU,$ZodCheckMaxSize:()=>ZU,$ZodCheckMaxLength:()=>XU,$ZodCheckLowerCase:()=>_U,$ZodCheckLessThan:()=>GD,$ZodCheckLengthEquals:()=>KU,$ZodCheckIncludes:()=>xU,$ZodCheckGreaterThan:()=>JD,$ZodCheckEndsWith:()=>dU,$ZodCheckBigIntFormat:()=>vU,$ZodCheck:()=>ht,$ZodCatch:()=>iL,$ZodCUID2:()=>CF,$ZodCUID:()=>hF,$ZodCIDRv6:()=>FF,$ZodCIDRv4:()=>UF,$ZodBoolean:()=>ZC,$ZodBigIntFormat:()=>GF,$ZodBigInt:()=>WD,$ZodBase64URL:()=>lF,$ZodBase64:()=>SF,$ZodAsyncError:()=>Ci,$ZodArray:()=>ZF,$ZodAny:()=>fF});var nn=D(()=>{cA();kD();BS();sC();I4();B4();Ce();eU();QU();EL();TD();gF();mC();o4();dC()});var Na={};ei(Na,{uppercase:()=>Fe,trim:()=>$e,toUpperCase:()=>Ge,toLowerCase:()=>ke,startsWith:()=>Se,slugify:()=>Je,size:()=>Wo,regex:()=>ue,property:()=>Da,positive:()=>Ca,overwrite:()=>Xn,normalize:()=>Ye,nonpositive:()=>Ea,nonnegative:()=>ya,negative:()=>ca,multipleOf:()=>JQ,minSize:()=>yi,minLength:()=>qi,mime:()=>Me,maxSize:()=>TQ,maxLength:()=>Vo,lte:()=>gn,lt:()=>ci,lowercase:()=>Ue,length:()=>Xo,includes:()=>Le,gte:()=>Fg,gt:()=>Ei,endsWith:()=>le});var ua=D(()=>{nn()});var zQ={};ei(zQ,{time:()=>vl,duration:()=>Zl,datetime:()=>zl,date:()=>Ol,ZodISOTime:()=>La,ZodISODuration:()=>Sa,ZodISODateTime:()=>Ua,ZodISODate:()=>Fa});function zl(A){return wS(Ua,A)}function Ol(A){return rS(Fa,A)}function vl(A){return bS(La,A)}function Zl(A){return NS(Sa,A)}var Ua,Fa,La,Sa;var pC=D(()=>{nn();tc();Ua=k("ZodISODateTime",(A,t)=>{DF.init(A,t),It.init(A,t)});Fa=k("ZodISODate",(A,t)=>{aF.init(A,t),It.init(A,t)});La=k("ZodISOTime",(A,t)=>{wF.init(A,t),It.init(A,t)});Sa=k("ZodISODuration",(A,t)=>{rF.init(A,t),It.init(A,t)})});var h4=(A,t)=>{RC.init(A,t),A.name="ZodError",Object.defineProperties(A,{format:{value:(g)=>PC(A,g)},flatten:{value:(g)=>fC(A,g)},addIssue:{value:(g)=>{A.issues.push(g),A.message=JSON.stringify(A.issues,ce,2)}},addIssues:{value:(g)=>{A.issues.push(...g),A.message=JSON.stringify(A.issues,ce,2)}},isEmpty:{get(){return A.issues.length===0}}})},DUA,Og;var Wl=D(()=>{nn();nn();cA();DUA=k("ZodError",h4),Og=k("ZodError",h4,{Parent:Error})});var Vl,Xl,Hl,Kl,jl,_l,ml,xl,ql,dl,sl,pl;var AM=D(()=>{nn();Wl();Vl=De(Og),Xl=ae(Og),Hl=we(Og),Kl=re(Og),jl=uD(Og),_l=UD(Og),ml=FD(Og),xl=LD(Og),ql=SD(Og),dl=lD(Og),sl=MD(Og),pl=YD(Og)});var Ac={};ei(Ac,{xor:()=>d4,xid:()=>F4,void:()=>_4,uuidv7:()=>a4,uuidv6:()=>D4,uuidv4:()=>y4,uuid:()=>E4,url:()=>$a,unknown:()=>et,union:()=>Bt,undefined:()=>j4,ulid:()=>U4,uint64:()=>H4,uint32:()=>W4,tuple:()=>yM,transform:()=>ma,templateLiteral:()=>eZ,symbol:()=>K4,superRefine:()=>ZM,success:()=>QZ,stringbool:()=>DZ,stringFormat:()=>R4,string:()=>l,strictObject:()=>q4,set:()=>tZ,refine:()=>vM,record:()=>At,readonly:()=>TM,promise:()=>BZ,preprocess:()=>Ec,prefault:()=>lM,pipe:()=>ic,partialRecord:()=>s4,optional:()=>Ct,object:()=>gA,number:()=>vA,nullish:()=>iZ,nullable:()=>nc,null:()=>oc,nonoptional:()=>MM,never:()=>_a,nativeEnum:()=>gZ,nanoid:()=>b4,nan:()=>oZ,meta:()=>EZ,map:()=>AZ,mac:()=>l4,looseRecord:()=>p4,looseObject:()=>kt,literal:()=>BA,lazy:()=>PM,ksuid:()=>L4,keyof:()=>x4,jwt:()=>T4,json:()=>aZ,ipv6:()=>M4,ipv4:()=>S4,intersection:()=>We,int64:()=>X4,int32:()=>Z4,int:()=>la,instanceof:()=>yZ,httpUrl:()=>w4,hostname:()=>f4,hex:()=>P4,hash:()=>z4,guid:()=>c4,function:()=>hZ,float64:()=>v4,float32:()=>O4,file:()=>nZ,exactOptional:()=>uM,enum:()=>pt,emoji:()=>r4,email:()=>C4,e164:()=>J4,discriminatedUnion:()=>hc,describe:()=>cZ,date:()=>m4,custom:()=>pa,cuid2:()=>u4,cuid:()=>N4,codec:()=>IZ,cidrv6:()=>$4,cidrv4:()=>Y4,check:()=>CZ,catch:()=>kM,boolean:()=>sA,bigint:()=>V4,base64url:()=>G4,base64:()=>k4,array:()=>AA,any:()=>ja,_function:()=>hZ,_default:()=>LM,_ZodString:()=>Ma,ZodXor:()=>hM,ZodXID:()=>fa,ZodVoid:()=>eM,ZodUnknown:()=>oM,ZodUnion:()=>Bc,ZodUndefined:()=>nM,ZodUUID:()=>Di,ZodURL:()=>Qc,ZodULID:()=>Ra,ZodType:()=>JA,ZodTuple:()=>EM,ZodTransform:()=>bM,ZodTemplateLiteral:()=>RM,ZodSymbol:()=>gM,ZodSuccess:()=>YM,ZodStringFormat:()=>It,ZodString:()=>Pe,ZodSet:()=>aM,ZodRecord:()=>Cc,ZodReadonly:()=>JM,ZodPromise:()=>zM,ZodPrefault:()=>SM,ZodPipe:()=>da,ZodOptional:()=>xa,ZodObject:()=>ec,ZodNumberFormat:()=>Ho,ZodNumber:()=>Oe,ZodNullable:()=>UM,ZodNull:()=>iM,ZodNonOptional:()=>qa,ZodNever:()=>IM,ZodNanoID:()=>Ga,ZodNaN:()=>GM,ZodMap:()=>DM,ZodMAC:()=>tM,ZodLiteral:()=>wM,ZodLazy:()=>fM,ZodKSUID:()=>Pa,ZodJWT:()=>Ha,ZodIntersection:()=>cM,ZodIPv6:()=>Oa,ZodIPv4:()=>za,ZodGUID:()=>gc,ZodFunction:()=>OM,ZodFile:()=>rM,ZodExactOptional:()=>NM,ZodEnum:()=>fe,ZodEmoji:()=>ka,ZodEmail:()=>Ya,ZodE164:()=>Xa,ZodDiscriminatedUnion:()=>CM,ZodDefault:()=>FM,ZodDate:()=>Ic,ZodCustomStringFormat:()=>ze,ZodCustom:()=>cc,ZodCodec:()=>sa,ZodCatch:()=>$M,ZodCUID2:()=>Ta,ZodCUID:()=>Ja,ZodCIDRv6:()=>Za,ZodCIDRv4:()=>va,ZodBoolean:()=>ve,ZodBigIntFormat:()=>Ka,ZodBigInt:()=>Ze,ZodBase64URL:()=>Va,ZodBase64:()=>Wa,ZodArray:()=>BM,ZodAny:()=>QM});function l(A){return ES(Pe,A)}function C4(A){return KD(Ya,A)}function c4(A){return xC(gc,A)}function E4(A){return jD(Di,A)}function y4(A){return _D(Di,A)}function D4(A){return mD(Di,A)}function a4(A){return xD(Di,A)}function $a(A){return qC(Qc,A)}function w4(A){return qC(Qc,{protocol:/^https?$/,hostname:un.domain,...q.normalizeParams(A)})}function r4(A){return qD(ka,A)}function b4(A){return dD(Ga,A)}function N4(A){return sD(Ja,A)}function u4(A){return pD(Ta,A)}function U4(A){return Aa(Ra,A)}function F4(A){return ta(fa,A)}function L4(A){return ga(Pa,A)}function S4(A){return na(za,A)}function l4(A){return DS(tM,A)}function M4(A){return ia(Oa,A)}function Y4(A){return Qa(va,A)}function $4(A){return oa(Za,A)}function k4(A){return Ia(Wa,A)}function G4(A){return ea(Va,A)}function J4(A){return Ba(Xa,A)}function T4(A){return ha(Ha,A)}function R4(A,t,g={}){return Te(ze,A,t,g)}function f4(A){return Te(ze,"hostname",un.hostname,A)}function P4(A){return Te(ze,"hex",un.hex,A)}function z4(A,t){let g=t?.enc??"hex",i=`${A}_${g}`,n=un[i];if(!n)throw Error(`Unrecognized hash format: ${i}`);return Te(ze,i,n,t)}function vA(A){return uS(Oe,A)}function la(A){return FS(Ho,A)}function O4(A){return LS(Ho,A)}function v4(A){return SS(Ho,A)}function Z4(A){return lS(Ho,A)}function W4(A){return MS(Ho,A)}function sA(A){return YS(ve,A)}function V4(A){return kS(Ze,A)}function X4(A){return JS(Ka,A)}function H4(A){return TS(Ka,A)}function K4(A){return RS(gM,A)}function j4(A){return fS(nM,A)}function oc(A){return PS(iM,A)}function ja(){return zS(QM)}function et(){return OS(oM)}function _a(A){return vS(IM,A)}function _4(A){return ZS(eM,A)}function m4(A){return WS(Ic,A)}function AA(A,t){return HS(BM,A,t)}function x4(A){let t=A._zod.def.shape;return pt(Object.keys(t))}function gA(A,t){let g={type:"object",shape:A??{},...q.normalizeParams(t)};return new ec(g)}function q4(A,t){return new ec({type:"object",shape:A,catchall:_a(),...q.normalizeParams(t)})}function kt(A,t){return new ec({type:"object",shape:A,catchall:et(),...q.normalizeParams(t)})}function Bt(A,t){return new Bc({type:"union",options:A,...q.normalizeParams(t)})}function d4(A,t){return new hM({type:"union",options:A,inclusive:!1,...q.normalizeParams(t)})}function hc(A,t,g){return new CM({type:"union",options:t,discriminator:A,...q.normalizeParams(g)})}function We(A,t){return new cM({type:"intersection",left:A,right:t})}function yM(A,t,g){let i=t instanceof lA,n=i?g:t;return new EM({type:"tuple",items:A,rest:i?t:null,...q.normalizeParams(n)})}function At(A,t,g){return new Cc({type:"record",keyType:A,valueType:t,...q.normalizeParams(g)})}function s4(A,t,g){let i=Ug(A);return i._zod.values=void 0,new Cc({type:"record",keyType:i,valueType:t,...q.normalizeParams(g)})}function p4(A,t,g){return new Cc({type:"record",keyType:A,valueType:t,mode:"loose",...q.normalizeParams(g)})}function AZ(A,t,g){return new DM({type:"map",keyType:A,valueType:t,...q.normalizeParams(g)})}function tZ(A,t){return new aM({type:"set",valueType:A,...q.normalizeParams(t)})}function pt(A,t){let g=Array.isArray(A)?Object.fromEntries(A.map((i)=>[i,i])):A;return new fe({type:"enum",entries:g,...q.normalizeParams(t)})}function gZ(A,t){return new fe({type:"enum",entries:A,...q.normalizeParams(t)})}function BA(A,t){return new wM({type:"literal",values:Array.isArray(A)?A:[A],...q.normalizeParams(t)})}function nZ(A){return KS(rM,A)}function ma(A){return new bM({type:"transform",transform:A})}function Ct(A){return new xa({type:"optional",innerType:A})}function uM(A){return new NM({type:"optional",innerType:A})}function nc(A){return new UM({type:"nullable",innerType:A})}function iZ(A){return Ct(nc(A))}function LM(A,t){return new FM({type:"default",innerType:A,get defaultValue(){return typeof t==="function"?t():q.shallowClone(t)}})}function lM(A,t){return new SM({type:"prefault",innerType:A,get defaultValue(){return typeof t==="function"?t():q.shallowClone(t)}})}function MM(A,t){return new qa({type:"nonoptional",innerType:A,...q.normalizeParams(t)})}function QZ(A){return new YM({type:"success",innerType:A})}function kM(A,t){return new $M({type:"catch",innerType:A,catchValue:typeof t==="function"?t:()=>t})}function oZ(A){return XS(GM,A)}function ic(A,t){return new da({type:"pipe",in:A,out:t})}function IZ(A,t,g){return new sa({type:"pipe",in:A,out:t,transform:g.decode,reverseTransform:g.encode})}function TM(A){return new JM({type:"readonly",innerType:A})}function eZ(A,t){return new RM({type:"template_literal",parts:A,...q.normalizeParams(t)})}function PM(A){return new fM({type:"lazy",getter:A})}function BZ(A){return new zM({type:"promise",innerType:A})}function hZ(A){return new OM({type:"function",input:Array.isArray(A?.input)?yM(A?.input):A?.input??AA(et()),output:A?.output??et()})}function CZ(A){let t=new ht({check:"custom"});return t._zod.check=A,t}function pa(A,t){return jS(cc,A??(()=>!0),t)}function vM(A,t={}){return _S(cc,A,t)}function ZM(A){return mS(A)}function yZ(A,t={}){let g=new cc({type:"custom",check:"custom",fn:(i)=>i instanceof A,abort:!0,...q.normalizeParams(t)});return g._zod.bag.Class=A,g._zod.check=(i)=>{if(!(i.value instanceof A))i.issues.push({code:"invalid_type",expected:A.name,input:i.value,inst:g,path:[...g._zod.def.path??[]]})},g}function aZ(A){let t=PM(()=>{return Bt([l(A),vA(),sA(),oc(),AA(t),At(l(),t)])});return t}function Ec(A,t){return ic(ma(A),t)}var JA,Ma,Pe,It,Ya,gc,Di,Qc,ka,Ga,Ja,Ta,Ra,fa,Pa,za,tM,Oa,va,Za,Wa,Va,Xa,Ha,ze,Oe,Ho,ve,Ze,Ka,gM,nM,iM,QM,oM,IM,eM,Ic,BM,ec,Bc,hM,CM,cM,EM,Cc,DM,aM,fe,wM,rM,bM,xa,NM,UM,FM,SM,qa,YM,$M,GM,da,sa,JM,RM,fM,zM,OM,cc,cZ,EZ,DZ=(...A)=>dS({Codec:sa,Boolean:ve,String:Pe},...A);var tc=D(()=>{nn();nn();sC();dC();ua();pC();AM();JA=k("ZodType",(A,t)=>{return lA.init(A,t),Object.assign(A["~standard"],{jsonSchema:{input:Re(A,"input"),output:Re(A,"output")}}),A.toJSONSchema=sS(A,{}),A.def=t,A.type=t.type,Object.defineProperty(A,"_def",{value:t}),A.check=(...g)=>{return A.clone(q.mergeDefs(t,{checks:[...t.checks??[],...g.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},A.with=A.check,A.clone=(g,i)=>Ug(A,g,i),A.brand=()=>A,A.register=(g,i)=>{return g.add(A,i),A},A.parse=(g,i)=>Vl(A,g,i,{callee:A.parse}),A.safeParse=(g,i)=>Hl(A,g,i),A.parseAsync=async(g,i)=>Xl(A,g,i,{callee:A.parseAsync}),A.safeParseAsync=async(g,i)=>Kl(A,g,i),A.spa=A.safeParseAsync,A.encode=(g,i)=>jl(A,g,i),A.decode=(g,i)=>_l(A,g,i),A.encodeAsync=async(g,i)=>ml(A,g,i),A.decodeAsync=async(g,i)=>xl(A,g,i),A.safeEncode=(g,i)=>ql(A,g,i),A.safeDecode=(g,i)=>dl(A,g,i),A.safeEncodeAsync=async(g,i)=>sl(A,g,i),A.safeDecodeAsync=async(g,i)=>pl(A,g,i),A.refine=(g,i)=>A.check(vM(g,i)),A.superRefine=(g)=>A.check(ZM(g)),A.overwrite=(g)=>A.check(Xn(g)),A.optional=()=>Ct(A),A.exactOptional=()=>uM(A),A.nullable=()=>nc(A),A.nullish=()=>Ct(nc(A)),A.nonoptional=(g)=>MM(A,g),A.array=()=>AA(A),A.or=(g)=>Bt([A,g]),A.and=(g)=>We(A,g),A.transform=(g)=>ic(A,ma(g)),A.default=(g)=>LM(A,g),A.prefault=(g)=>lM(A,g),A.catch=(g)=>kM(A,g),A.pipe=(g)=>ic(A,g),A.readonly=()=>TM(A),A.describe=(g)=>{let i=A.clone();return st.add(i,{description:g}),i},Object.defineProperty(A,"description",{get(){return st.get(A)?.description},configurable:!0}),A.meta=(...g)=>{if(g.length===0)return st.get(A);let i=A.clone();return st.add(i,g[0]),i},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A.apply=(g)=>g(A),A}),Ma=k("_ZodString",(A,t)=>{Zo.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>pS(A,i,n,Q);let g=A._zod.bag;A.format=g.format??null,A.minLength=g.minimum??null,A.maxLength=g.maximum??null,A.regex=(...i)=>A.check(ue(...i)),A.includes=(...i)=>A.check(Le(...i)),A.startsWith=(...i)=>A.check(Se(...i)),A.endsWith=(...i)=>A.check(le(...i)),A.min=(...i)=>A.check(qi(...i)),A.max=(...i)=>A.check(Vo(...i)),A.length=(...i)=>A.check(Xo(...i)),A.nonempty=(...i)=>A.check(qi(1,...i)),A.lowercase=(i)=>A.check(Ue(i)),A.uppercase=(i)=>A.check(Fe(i)),A.trim=()=>A.check($e()),A.normalize=(...i)=>A.check(Ye(...i)),A.toLowerCase=()=>A.check(ke()),A.toUpperCase=()=>A.check(Ge()),A.slugify=()=>A.check(Je())}),Pe=k("ZodString",(A,t)=>{Zo.init(A,t),Ma.init(A,t),A.email=(g)=>A.check(KD(Ya,g)),A.url=(g)=>A.check(qC(Qc,g)),A.jwt=(g)=>A.check(ha(Ha,g)),A.emoji=(g)=>A.check(qD(ka,g)),A.guid=(g)=>A.check(xC(gc,g)),A.uuid=(g)=>A.check(jD(Di,g)),A.uuidv4=(g)=>A.check(_D(Di,g)),A.uuidv6=(g)=>A.check(mD(Di,g)),A.uuidv7=(g)=>A.check(xD(Di,g)),A.nanoid=(g)=>A.check(dD(Ga,g)),A.guid=(g)=>A.check(xC(gc,g)),A.cuid=(g)=>A.check(sD(Ja,g)),A.cuid2=(g)=>A.check(pD(Ta,g)),A.ulid=(g)=>A.check(Aa(Ra,g)),A.base64=(g)=>A.check(Ia(Wa,g)),A.base64url=(g)=>A.check(ea(Va,g)),A.xid=(g)=>A.check(ta(fa,g)),A.ksuid=(g)=>A.check(ga(Pa,g)),A.ipv4=(g)=>A.check(na(za,g)),A.ipv6=(g)=>A.check(ia(Oa,g)),A.cidrv4=(g)=>A.check(Qa(va,g)),A.cidrv6=(g)=>A.check(oa(Za,g)),A.e164=(g)=>A.check(Ba(Xa,g)),A.datetime=(g)=>A.check(zl(g)),A.date=(g)=>A.check(Ol(g)),A.time=(g)=>A.check(vl(g)),A.duration=(g)=>A.check(Zl(g))});It=k("ZodStringFormat",(A,t)=>{ot.init(A,t),Ma.init(A,t)}),Ya=k("ZodEmail",(A,t)=>{oF.init(A,t),It.init(A,t)});gc=k("ZodGUID",(A,t)=>{iF.init(A,t),It.init(A,t)});Di=k("ZodUUID",(A,t)=>{QF.init(A,t),It.init(A,t)});Qc=k("ZodURL",(A,t)=>{IF.init(A,t),It.init(A,t)});ka=k("ZodEmoji",(A,t)=>{eF.init(A,t),It.init(A,t)});Ga=k("ZodNanoID",(A,t)=>{BF.init(A,t),It.init(A,t)});Ja=k("ZodCUID",(A,t)=>{hF.init(A,t),It.init(A,t)});Ta=k("ZodCUID2",(A,t)=>{CF.init(A,t),It.init(A,t)});Ra=k("ZodULID",(A,t)=>{cF.init(A,t),It.init(A,t)});fa=k("ZodXID",(A,t)=>{EF.init(A,t),It.init(A,t)});Pa=k("ZodKSUID",(A,t)=>{yF.init(A,t),It.init(A,t)});za=k("ZodIPv4",(A,t)=>{bF.init(A,t),It.init(A,t)});tM=k("ZodMAC",(A,t)=>{uF.init(A,t),It.init(A,t)});Oa=k("ZodIPv6",(A,t)=>{NF.init(A,t),It.init(A,t)});va=k("ZodCIDRv4",(A,t)=>{UF.init(A,t),It.init(A,t)});Za=k("ZodCIDRv6",(A,t)=>{FF.init(A,t),It.init(A,t)});Wa=k("ZodBase64",(A,t)=>{SF.init(A,t),It.init(A,t)});Va=k("ZodBase64URL",(A,t)=>{lF.init(A,t),It.init(A,t)});Xa=k("ZodE164",(A,t)=>{MF.init(A,t),It.init(A,t)});Ha=k("ZodJWT",(A,t)=>{YF.init(A,t),It.init(A,t)});ze=k("ZodCustomStringFormat",(A,t)=>{$F.init(A,t),It.init(A,t)});Oe=k("ZodNumber",(A,t)=>{ZD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>Al(A,i,n,Q),A.gt=(i,n)=>A.check(Ei(i,n)),A.gte=(i,n)=>A.check(Fg(i,n)),A.min=(i,n)=>A.check(Fg(i,n)),A.lt=(i,n)=>A.check(ci(i,n)),A.lte=(i,n)=>A.check(gn(i,n)),A.max=(i,n)=>A.check(gn(i,n)),A.int=(i)=>A.check(la(i)),A.safe=(i)=>A.check(la(i)),A.positive=(i)=>A.check(Ei(0,i)),A.nonnegative=(i)=>A.check(Fg(0,i)),A.negative=(i)=>A.check(ci(0,i)),A.nonpositive=(i)=>A.check(gn(0,i)),A.multipleOf=(i,n)=>A.check(JQ(i,n)),A.step=(i,n)=>A.check(JQ(i,n)),A.finite=()=>A;let g=A._zod.bag;A.minValue=Math.max(g.minimum??Number.NEGATIVE_INFINITY,g.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min(g.maximum??Number.POSITIVE_INFINITY,g.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=(g.format??"").includes("int")||Number.isSafeInteger(g.multipleOf??0.5),A.isFinite=!0,A.format=g.format??null});Ho=k("ZodNumberFormat",(A,t)=>{kF.init(A,t),Oe.init(A,t)});ve=k("ZodBoolean",(A,t)=>{ZC.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>tl(A,g,i,n)});Ze=k("ZodBigInt",(A,t)=>{WD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>gl(A,i,n,Q),A.gte=(i,n)=>A.check(Fg(i,n)),A.min=(i,n)=>A.check(Fg(i,n)),A.gt=(i,n)=>A.check(Ei(i,n)),A.gte=(i,n)=>A.check(Fg(i,n)),A.min=(i,n)=>A.check(Fg(i,n)),A.lt=(i,n)=>A.check(ci(i,n)),A.lte=(i,n)=>A.check(gn(i,n)),A.max=(i,n)=>A.check(gn(i,n)),A.positive=(i)=>A.check(Ei(BigInt(0),i)),A.negative=(i)=>A.check(ci(BigInt(0),i)),A.nonpositive=(i)=>A.check(gn(BigInt(0),i)),A.nonnegative=(i)=>A.check(Fg(BigInt(0),i)),A.multipleOf=(i,n)=>A.check(JQ(i,n));let g=A._zod.bag;A.minValue=g.minimum??null,A.maxValue=g.maximum??null,A.format=g.format??null});Ka=k("ZodBigIntFormat",(A,t)=>{GF.init(A,t),Ze.init(A,t)});gM=k("ZodSymbol",(A,t)=>{JF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>nl(A,g,i,n)});nM=k("ZodUndefined",(A,t)=>{TF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ql(A,g,i,n)});iM=k("ZodNull",(A,t)=>{RF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>il(A,g,i,n)});QM=k("ZodAny",(A,t)=>{fF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>el(A,g,i,n)});oM=k("ZodUnknown",(A,t)=>{PF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Bl(A,g,i,n)});IM=k("ZodNever",(A,t)=>{zF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Il(A,g,i,n)});eM=k("ZodVoid",(A,t)=>{OF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ol(A,g,i,n)});Ic=k("ZodDate",(A,t)=>{vF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>hl(A,i,n,Q),A.min=(i,n)=>A.check(Fg(i,n)),A.max=(i,n)=>A.check(gn(i,n));let g=A._zod.bag;A.minDate=g.minimum?new Date(g.minimum):null,A.maxDate=g.maximum?new Date(g.maximum):null});BM=k("ZodArray",(A,t)=>{ZF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ul(A,g,i,n),A.element=t.element,A.min=(g,i)=>A.check(qi(g,i)),A.nonempty=(g)=>A.check(qi(1,g)),A.max=(g,i)=>A.check(Vo(g,i)),A.length=(g,i)=>A.check(Xo(g,i)),A.unwrap=()=>A.element});ec=k("ZodObject",(A,t)=>{WF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Fl(A,g,i,n),q.defineLazy(A,"shape",()=>{return t.shape}),A.keyof=()=>pt(Object.keys(A._zod.def.shape)),A.catchall=(g)=>A.clone({...A._zod.def,catchall:g}),A.passthrough=()=>A.clone({...A._zod.def,catchall:et()}),A.loose=()=>A.clone({...A._zod.def,catchall:et()}),A.strict=()=>A.clone({...A._zod.def,catchall:_a()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=(g)=>{return q.extend(A,g)},A.safeExtend=(g)=>{return q.safeExtend(A,g)},A.merge=(g)=>q.merge(A,g),A.pick=(g)=>q.pick(A,g),A.omit=(g)=>q.omit(A,g),A.partial=(...g)=>q.partial(xa,A,g[0]),A.required=(...g)=>q.required(qa,A,g[0])});Bc=k("ZodUnion",(A,t)=>{WC.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wa(A,g,i,n),A.options=t.options});hM=k("ZodXor",(A,t)=>{Bc.init(A,t),VF.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wa(A,g,i,n),A.options=t.options});CM=k("ZodDiscriminatedUnion",(A,t)=>{Bc.init(A,t),XF.init(A,t)});cM=k("ZodIntersection",(A,t)=>{HF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ll(A,g,i,n)});EM=k("ZodTuple",(A,t)=>{VD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Sl(A,g,i,n),A.rest=(g)=>A.clone({...A._zod.def,rest:g})});Cc=k("ZodRecord",(A,t)=>{KF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ll(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType});DM=k("ZodMap",(A,t)=>{jF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Nl(A,g,i,n),A.keyType=t.keyType,A.valueType=t.valueType,A.min=(...g)=>A.check(yi(...g)),A.nonempty=(g)=>A.check(yi(1,g)),A.max=(...g)=>A.check(TQ(...g)),A.size=(...g)=>A.check(Wo(...g))});aM=k("ZodSet",(A,t)=>{_F.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ul(A,g,i,n),A.min=(...g)=>A.check(yi(...g)),A.nonempty=(g)=>A.check(yi(1,g)),A.max=(...g)=>A.check(TQ(...g)),A.size=(...g)=>A.check(Wo(...g))});fe=k("ZodEnum",(A,t)=>{mF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(i,n,Q)=>Cl(A,i,n,Q),A.enum=t.entries,A.options=Object.values(t.entries);let g=new Set(Object.keys(t.entries));A.extract=(i,n)=>{let Q={};for(let o of i)if(g.has(o))Q[o]=t.entries[o];else throw Error(`Key ${o} not found in enum`);return new fe({...t,checks:[],...q.normalizeParams(n),entries:Q})},A.exclude=(i,n)=>{let Q={...t.entries};for(let o of i)if(g.has(o))delete Q[o];else throw Error(`Key ${o} not found in enum`);return new fe({...t,checks:[],...q.normalizeParams(n),entries:Q})}});wM=k("ZodLiteral",(A,t)=>{xF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>cl(A,g,i,n),A.values=new Set(t.values),Object.defineProperty(A,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});rM=k("ZodFile",(A,t)=>{qF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Dl(A,g,i,n),A.min=(g,i)=>A.check(yi(g,i)),A.max=(g,i)=>A.check(TQ(g,i)),A.mime=(g,i)=>A.check(Me(Array.isArray(g)?g:[g],i))});bM=k("ZodTransform",(A,t)=>{dF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>bl(A,g,i,n),A._zod.parse=(g,i)=>{if(i.direction==="backward")throw new zo(A.constructor.name);g.addIssue=(Q)=>{if(typeof Q==="string")g.issues.push(q.issue(Q,g.value,t));else{let o=Q;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=g.value),o.inst??(o.inst=A),g.issues.push(q.issue(o))}};let n=t.transform(g.value,g);if(n instanceof Promise)return n.then((Q)=>{return g.value=Q,g});return g.value=n,g}});xa=k("ZodOptional",(A,t)=>{XD.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ra(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});NM=k("ZodExactOptional",(A,t)=>{sF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>ra(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});UM=k("ZodNullable",(A,t)=>{pF.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Ml(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});FM=k("ZodDefault",(A,t)=>{AL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>$l(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});SM=k("ZodPrefault",(A,t)=>{tL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>kl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});qa=k("ZodNonOptional",(A,t)=>{gL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Yl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});YM=k("ZodSuccess",(A,t)=>{nL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>al(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});$M=k("ZodCatch",(A,t)=>{iL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Gl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});GM=k("ZodNaN",(A,t)=>{QL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>El(A,g,i,n)});da=k("ZodPipe",(A,t)=>{oL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Jl(A,g,i,n),A.in=t.in,A.out=t.out});sa=k("ZodCodec",(A,t)=>{da.init(A,t),VC.init(A,t)});JM=k("ZodReadonly",(A,t)=>{IL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Tl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});RM=k("ZodTemplateLiteral",(A,t)=>{eL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>yl(A,g,i,n)});fM=k("ZodLazy",(A,t)=>{CL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>fl(A,g,i,n),A.unwrap=()=>A._zod.def.getter()});zM=k("ZodPromise",(A,t)=>{hL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>Rl(A,g,i,n),A.unwrap=()=>A._zod.def.innerType});OM=k("ZodFunction",(A,t)=>{BL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>rl(A,g,i,n)});cc=k("ZodCustom",(A,t)=>{cL.init(A,t),JA.init(A,t),A._zod.processJSONSchema=(g,i,n)=>wl(A,g,i,n)});cZ=xS,EZ=qS});function wUA(A){$t({customError:A})}function rUA(){return $t().customError}var VM,WM;var wZ=D(()=>{nn();VM={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"};(function(A){})(WM||(WM={}))});function NUA(A,t){let g=A.$schema;if(g==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(g==="http://json-schema.org/draft-07/schema#")return"draft-7";if(g==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function uUA(A,t){if(!A.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let g=A.slice(1).split("/").filter(Boolean);if(g.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===i){let n=g[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${A}`);return t.defs[n]}throw Error(`Reference not found: ${A}`)}function rZ(A,t){if(A.not!==void 0){if(typeof A.not==="object"&&Object.keys(A.not).length===0)return QA.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(A.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(A.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(A.if!==void 0||A.then!==void 0||A.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(A.dependentSchemas!==void 0||A.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(A.$ref){let n=A.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return QA.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let Q=uUA(n,t),o=cg(Q,t);return t.refs.set(n,o),t.processing.delete(n),o}if(A.enum!==void 0){let n=A.enum;if(t.version==="openapi-3.0"&&A.nullable===!0&&n.length===1&&n[0]===null)return QA.null();if(n.length===0)return QA.never();if(n.length===1)return QA.literal(n[0]);if(n.every((o)=>typeof o==="string"))return QA.enum(n);let Q=n.map((o)=>QA.literal(o));if(Q.length<2)return Q[0];return QA.union([Q[0],Q[1],...Q.slice(2)])}if(A.const!==void 0)return QA.literal(A.const);let g=A.type;if(Array.isArray(g)){let n=g.map((Q)=>{let o={...A,type:Q};return rZ(o,t)});if(n.length===0)return QA.never();if(n.length===1)return n[0];return QA.union(n)}if(!g)return QA.any();let i;switch(g){case"string":{let n=QA.string();if(A.format){let Q=A.format;if(Q==="email")n=n.check(QA.email());else if(Q==="uri"||Q==="uri-reference")n=n.check(QA.url());else if(Q==="uuid"||Q==="guid")n=n.check(QA.uuid());else if(Q==="date-time")n=n.check(QA.iso.datetime());else if(Q==="date")n=n.check(QA.iso.date());else if(Q==="time")n=n.check(QA.iso.time());else if(Q==="duration")n=n.check(QA.iso.duration());else if(Q==="ipv4")n=n.check(QA.ipv4());else if(Q==="ipv6")n=n.check(QA.ipv6());else if(Q==="mac")n=n.check(QA.mac());else if(Q==="cidr")n=n.check(QA.cidrv4());else if(Q==="cidr-v6")n=n.check(QA.cidrv6());else if(Q==="base64")n=n.check(QA.base64());else if(Q==="base64url")n=n.check(QA.base64url());else if(Q==="e164")n=n.check(QA.e164());else if(Q==="jwt")n=n.check(QA.jwt());else if(Q==="emoji")n=n.check(QA.emoji());else if(Q==="nanoid")n=n.check(QA.nanoid());else if(Q==="cuid")n=n.check(QA.cuid());else if(Q==="cuid2")n=n.check(QA.cuid2());else if(Q==="ulid")n=n.check(QA.ulid());else if(Q==="xid")n=n.check(QA.xid());else if(Q==="ksuid")n=n.check(QA.ksuid())}if(typeof A.minLength==="number")n=n.min(A.minLength);if(typeof A.maxLength==="number")n=n.max(A.maxLength);if(A.pattern)n=n.regex(new RegExp(A.pattern));i=n;break}case"number":case"integer":{let n=g==="integer"?QA.number().int():QA.number();if(typeof A.minimum==="number")n=n.min(A.minimum);if(typeof A.maximum==="number")n=n.max(A.maximum);if(typeof A.exclusiveMinimum==="number")n=n.gt(A.exclusiveMinimum);else if(A.exclusiveMinimum===!0&&typeof A.minimum==="number")n=n.gt(A.minimum);if(typeof A.exclusiveMaximum==="number")n=n.lt(A.exclusiveMaximum);else if(A.exclusiveMaximum===!0&&typeof A.maximum==="number")n=n.lt(A.maximum);if(typeof A.multipleOf==="number")n=n.multipleOf(A.multipleOf);i=n;break}case"boolean":{i=QA.boolean();break}case"null":{i=QA.null();break}case"object":{let n={},Q=A.properties||{},o=new Set(A.required||[]);for(let[B,h]of Object.entries(Q)){let C=cg(h,t);n[B]=o.has(B)?C:C.optional()}if(A.propertyNames){let B=cg(A.propertyNames,t),h=A.additionalProperties&&typeof A.additionalProperties==="object"?cg(A.additionalProperties,t):QA.any();if(Object.keys(n).length===0){i=QA.record(B,h);break}let C=QA.object(n).passthrough(),c=QA.looseRecord(B,h);i=QA.intersection(C,c);break}if(A.patternProperties){let B=A.patternProperties,h=Object.keys(B),C=[];for(let E of h){let y=cg(B[E],t),a=QA.string().regex(new RegExp(E));C.push(QA.looseRecord(a,y))}let c=[];if(Object.keys(n).length>0)c.push(QA.object(n).passthrough());if(c.push(...C),c.length===0)i=QA.object({}).passthrough();else if(c.length===1)i=c[0];else{let E=QA.intersection(c[0],c[1]);for(let y=2;y<c.length;y++)E=QA.intersection(E,c[y]);i=E}break}let e=QA.object(n);if(A.additionalProperties===!1)i=e.strict();else if(typeof A.additionalProperties==="object")i=e.catchall(cg(A.additionalProperties,t));else i=e.passthrough();break}case"array":{let{prefixItems:n,items:Q}=A;if(n&&Array.isArray(n)){let o=n.map((B)=>cg(B,t)),e=Q&&typeof Q==="object"&&!Array.isArray(Q)?cg(Q,t):void 0;if(e)i=QA.tuple(o).rest(e);else i=QA.tuple(o);if(typeof A.minItems==="number")i=i.check(QA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(QA.maxLength(A.maxItems))}else if(Array.isArray(Q)){let o=Q.map((B)=>cg(B,t)),e=A.additionalItems&&typeof A.additionalItems==="object"?cg(A.additionalItems,t):void 0;if(e)i=QA.tuple(o).rest(e);else i=QA.tuple(o);if(typeof A.minItems==="number")i=i.check(QA.minLength(A.minItems));if(typeof A.maxItems==="number")i=i.check(QA.maxLength(A.maxItems))}else if(Q!==void 0){let o=cg(Q,t),e=QA.array(o);if(typeof A.minItems==="number")e=e.min(A.minItems);if(typeof A.maxItems==="number")e=e.max(A.maxItems);i=e}else i=QA.array(QA.any());break}default:throw Error(`Unsupported type: ${g}`)}if(A.description)i=i.describe(A.description);if(A.default!==void 0)i=i.default(A.default);return i}function cg(A,t){if(typeof A==="boolean")return A?QA.any():QA.never();let g=rZ(A,t),i=A.type||A.enum!==void 0||A.const!==void 0;if(A.anyOf&&Array.isArray(A.anyOf)){let e=A.anyOf.map((h)=>cg(h,t)),B=QA.union(e);g=i?QA.intersection(g,B):B}if(A.oneOf&&Array.isArray(A.oneOf)){let e=A.oneOf.map((h)=>cg(h,t)),B=QA.xor(e);g=i?QA.intersection(g,B):B}if(A.allOf&&Array.isArray(A.allOf))if(A.allOf.length===0)g=i?g:QA.any();else{let e=i?g:cg(A.allOf[0],t),B=i?0:1;for(let h=B;h<A.allOf.length;h++)e=QA.intersection(e,cg(A.allOf[h],t));g=e}if(A.nullable===!0&&t.version==="openapi-3.0")g=QA.nullable(g);if(A.readOnly===!0)g=QA.readonly(g);let n={},Q=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let e of Q)if(e in A)n[e]=A[e];let o=["contentEncoding","contentMediaType","contentSchema"];for(let e of o)if(e in A)n[e]=A[e];for(let e of Object.keys(A))if(!bUA.has(e))n[e]=A[e];if(Object.keys(n).length>0)t.registry.add(g,n);return g}function bZ(A,t){if(typeof A==="boolean")return A?QA.any():QA.never();let g=NUA(A,t?.defaultTarget),i=A.$defs||A.definitions||{},n={version:g,defs:i,refs:new Map,processing:new Set,rootSchema:A,registry:t?.registry??st};return cg(A,n)}var QA,bUA;var NZ=D(()=>{mC();ua();pC();tc();QA={...Ac,...Na,iso:zQ},bUA=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"])});var yc={};ei(yc,{string:()=>UUA,number:()=>FUA,date:()=>lUA,boolean:()=>LUA,bigint:()=>SUA});function UUA(A){return yS(Pe,A)}function FUA(A){return US(Oe,A)}function LUA(A){return $S(ve,A)}function SUA(A){return GS(Ze,A)}function lUA(A){return VS(Ic,A)}var uZ=D(()=>{nn();tc()});var I={};ei(I,{xor:()=>d4,xid:()=>F4,void:()=>_4,uuidv7:()=>a4,uuidv6:()=>D4,uuidv4:()=>y4,uuid:()=>E4,util:()=>q,url:()=>$a,uppercase:()=>Fe,unknown:()=>et,union:()=>Bt,undefined:()=>j4,ulid:()=>U4,uint64:()=>H4,uint32:()=>W4,tuple:()=>yM,trim:()=>$e,treeifyError:()=>nU,transform:()=>ma,toUpperCase:()=>Ge,toLowerCase:()=>ke,toJSONSchema:()=>ba,templateLiteral:()=>eZ,symbol:()=>K4,superRefine:()=>ZM,success:()=>QZ,stringbool:()=>DZ,stringFormat:()=>R4,string:()=>l,strictObject:()=>q4,startsWith:()=>Se,slugify:()=>Je,size:()=>Wo,setErrorMap:()=>wUA,set:()=>tZ,safeParseAsync:()=>Kl,safeParse:()=>Hl,safeEncodeAsync:()=>sl,safeEncode:()=>ql,safeDecodeAsync:()=>pl,safeDecode:()=>dl,registry:()=>HD,regexes:()=>un,regex:()=>ue,refine:()=>vM,record:()=>At,readonly:()=>TM,property:()=>Da,promise:()=>BZ,prettifyError:()=>iU,preprocess:()=>Ec,prefault:()=>lM,positive:()=>Ca,pipe:()=>ic,partialRecord:()=>s4,parseAsync:()=>Xl,parse:()=>Vl,overwrite:()=>Xn,optional:()=>Ct,object:()=>gA,number:()=>vA,nullish:()=>iZ,nullable:()=>nc,null:()=>oc,normalize:()=>Ye,nonpositive:()=>Ea,nonoptional:()=>MM,nonnegative:()=>ya,never:()=>_a,negative:()=>ca,nativeEnum:()=>gZ,nanoid:()=>b4,nan:()=>oZ,multipleOf:()=>JQ,minSize:()=>yi,minLength:()=>qi,mime:()=>Me,meta:()=>EZ,maxSize:()=>TQ,maxLength:()=>Vo,map:()=>AZ,mac:()=>l4,lte:()=>gn,lt:()=>ci,lowercase:()=>Ue,looseRecord:()=>p4,looseObject:()=>kt,locales:()=>_C,literal:()=>BA,length:()=>Xo,lazy:()=>PM,ksuid:()=>L4,keyof:()=>x4,jwt:()=>T4,json:()=>aZ,iso:()=>zQ,ipv6:()=>M4,ipv4:()=>S4,intersection:()=>We,int64:()=>X4,int32:()=>Z4,int:()=>la,instanceof:()=>yZ,includes:()=>Le,httpUrl:()=>w4,hostname:()=>f4,hex:()=>P4,hash:()=>z4,guid:()=>c4,gte:()=>Fg,gt:()=>Ei,globalRegistry:()=>st,getErrorMap:()=>rUA,function:()=>hZ,fromJSONSchema:()=>bZ,formatError:()=>PC,float64:()=>v4,float32:()=>O4,flattenError:()=>fC,file:()=>nZ,exactOptional:()=>uM,enum:()=>pt,endsWith:()=>le,encodeAsync:()=>ml,encode:()=>jl,emoji:()=>r4,email:()=>C4,e164:()=>J4,discriminatedUnion:()=>hc,describe:()=>cZ,decodeAsync:()=>xl,decode:()=>_l,date:()=>m4,custom:()=>pa,cuid2:()=>u4,cuid:()=>N4,core:()=>di,config:()=>$t,coerce:()=>yc,codec:()=>IZ,clone:()=>Ug,cidrv6:()=>$4,cidrv4:()=>Y4,check:()=>CZ,catch:()=>kM,boolean:()=>sA,bigint:()=>V4,base64url:()=>G4,base64:()=>k4,array:()=>AA,any:()=>ja,_function:()=>hZ,_default:()=>LM,_ZodString:()=>Ma,ZodXor:()=>hM,ZodXID:()=>fa,ZodVoid:()=>eM,ZodUnknown:()=>oM,ZodUnion:()=>Bc,ZodUndefined:()=>nM,ZodUUID:()=>Di,ZodURL:()=>Qc,ZodULID:()=>Ra,ZodType:()=>JA,ZodTuple:()=>EM,ZodTransform:()=>bM,ZodTemplateLiteral:()=>RM,ZodSymbol:()=>gM,ZodSuccess:()=>YM,ZodStringFormat:()=>It,ZodString:()=>Pe,ZodSet:()=>aM,ZodRecord:()=>Cc,ZodRealError:()=>Og,ZodReadonly:()=>JM,ZodPromise:()=>zM,ZodPrefault:()=>SM,ZodPipe:()=>da,ZodOptional:()=>xa,ZodObject:()=>ec,ZodNumberFormat:()=>Ho,ZodNumber:()=>Oe,ZodNullable:()=>UM,ZodNull:()=>iM,ZodNonOptional:()=>qa,ZodNever:()=>IM,ZodNanoID:()=>Ga,ZodNaN:()=>GM,ZodMap:()=>DM,ZodMAC:()=>tM,ZodLiteral:()=>wM,ZodLazy:()=>fM,ZodKSUID:()=>Pa,ZodJWT:()=>Ha,ZodIssueCode:()=>VM,ZodIntersection:()=>cM,ZodISOTime:()=>La,ZodISODuration:()=>Sa,ZodISODateTime:()=>Ua,ZodISODate:()=>Fa,ZodIPv6:()=>Oa,ZodIPv4:()=>za,ZodGUID:()=>gc,ZodFunction:()=>OM,ZodFirstPartyTypeKind:()=>WM,ZodFile:()=>rM,ZodExactOptional:()=>NM,ZodError:()=>DUA,ZodEnum:()=>fe,ZodEmoji:()=>ka,ZodEmail:()=>Ya,ZodE164:()=>Xa,ZodDiscriminatedUnion:()=>CM,ZodDefault:()=>FM,ZodDate:()=>Ic,ZodCustomStringFormat:()=>ze,ZodCustom:()=>cc,ZodCodec:()=>sa,ZodCatch:()=>$M,ZodCUID2:()=>Ta,ZodCUID:()=>Ja,ZodCIDRv6:()=>Za,ZodCIDRv4:()=>va,ZodBoolean:()=>ve,ZodBigIntFormat:()=>Ka,ZodBigInt:()=>Ze,ZodBase64URL:()=>Va,ZodBase64:()=>Wa,ZodArray:()=>BM,ZodAny:()=>QM,TimePrecision:()=>aS,NEVER:()=>MC,$output:()=>hS,$input:()=>CS,$brand:()=>_u});var Aw=D(()=>{nn();nn();UL();nn();sC();NZ();BS();pC();pC();uZ();tc();ua();Wl();AM();wZ();$t(XC())});var TA=D(()=>{Aw();Aw()});var UZ,FZ,LZ,SZ,lZ,MZ,YZ,$Z,kZ,GZ,JZ,TZ,RZ,XM,MUA,HM,fZ,YUA,KM="cursor",jM="GET",_M="control",mM="[DONE]";var PZ=D(()=>{TA();UZ=I.object({type:I.literal("run_started"),runId:I.string().describe("Server-assigned run ID for the started run.")}),FZ=I.object({type:I.literal("message_started"),messageId:I.string().describe("Server-assigned assistant message ID for this run.")}),LZ=I.object({type:I.literal("text_chunk"),messageId:I.string().describe("Assistant message the chunk belongs to."),content:I.string().describe("Incremental text delta to append.")}),SZ=I.object({type:I.literal("reasoning_chunk"),messageId:I.string().describe("Assistant message the chunk belongs to."),content:I.string().describe("Incremental reasoning delta to append.")}),lZ=I.object({type:I.literal("text_complete"),messageId:I.string().describe("Assistant message that completed."),content:I.string().describe("Full assistant text for the message.")}),MZ=I.object({type:I.literal("reasoning_complete"),messageId:I.string().describe("Assistant message that completed."),content:I.string().describe("Full reasoning text for the message.")}),YZ=I.object({type:I.literal("tool_call_pending"),toolCallId:I.string().describe("Stable identifier for the tool call."),name:I.string().describe("Name of the tool being called.")}),$Z=I.object({type:I.literal("tool_call_start"),toolCallId:I.string().describe("Stable identifier for the tool call."),name:I.string().describe("Name of the tool being called."),params:I.unknown().describe("Resolved tool input params.")}),kZ=I.object({type:I.literal("tool_call_complete"),toolCallId:I.string().describe("Stable identifier for the tool call."),status:I.enum(["in_progress","success","error"]).describe("Terminal (or transitional) status of the tool call."),result:I.unknown().optional().describe("Tool output, when available."),durationMs:I.number().nonnegative().optional().describe("Authoritative server-measured tool execution time in ms.")}),GZ=I.object({type:I.literal("artifact"),name:I.string().describe("Artifact kind (for example table, timeseries)."),data:I.unknown().describe("Artifact payload; shape depends on name."),toolCallId:I.string().describe("Tool call that produced the artifact.")}),JZ=I.object({type:I.literal("error"),message:I.string().describe("Human-readable error message."),name:I.string().optional().describe("Optional error class/name.")}),TZ=I.object({type:I.literal("stream_reset"),messageId:I.string().describe("Assistant message whose content to reset.")}),RZ=I.object({type:I.literal("disconnected")}),XM=I.discriminatedUnion("type",[UZ,FZ,LZ,SZ,lZ,MZ,YZ,$Z,kZ,GZ,JZ,TZ,RZ]),MUA=I.enum(["run_started","message_started","text_chunk","reasoning_chunk","text_complete","reasoning_complete","tool_call_pending","tool_call_start","tool_call_complete","artifact","error","stream_reset","disconnected"]),HM=I.object({streamNextOffset:I.string().describe("Opaque resume cursor for the next unread event; pass back as the stream 'cursor' query param.")}),fZ=I.string().describe("Opaque resume cursor from a prior control frame's streamNextOffset."),YUA=I.object({cursor:fZ.optional().describe("Resume the stream after this offset. Omit to start from the beginning of the retained buffer.")})});var L=(A)=>{let t={operationId:A.operationId,backend:A.backend,pagination:A.pagination,async:A.async,examples:A.examples??[]};return{...A,contract:M1.$meta(t).route({method:A.route.method,path:A.route.path,tags:A.route.tags,operationId:A.operationId,summary:A.summary,description:A.description,successStatus:A.route.successStatus,successDescription:A.route.successDescription,deprecated:A.route.deprecated,inputStructure:A.route.inputStructure}).input(A.input).output(A.output)}};var zZ=D(()=>{Xu()});var OZ=D(()=>{zZ()});var VA=D(()=>{OZ()});var ac,ZZ,WZ,VZ,XZ,HZ,KZ,jZ,_Z,mZ,$UA,sM,xZ,tw,gw,Ve,nw,iw,qZ,dZ,Qw,sZ,pZ,Xe,xM,kUA,AW,tW,gW,GUA,nW,iW,QW,pM,oW,IW,eW,ow,Iw,ew,Bw,wc,BW,qM,hW,rc,AY,CW,cW,JUA,TUA,tY,EW,yW,DW,aW,wW,rW,bW,gY,hw,Cw,cw,Ew,nY,NW,dM,Dc,iY,RUA,yw,uW,UW,FW,LW,vZ,SW,lW,MW,Dw,aw,YW,QY,$W,kW,GW,JW,TW,ww,rw,fUA;var oY=D(()=>{TA();VA();ac=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),description:I.string().nullable(),origin:I.enum(["user_declared","code_detected","log_observed"]),lifecycle:I.enum(["active","retired","merged"]),observationState:I.enum(["observed","stale","unobserved"]),registryRevision:I.number().int().nonnegative(),canonicalComponentId:I.string().uuid(),mergedIntoComponentId:I.string().uuid().nullable(),currentStatus:I.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:I.string().datetime(),lastSeenAt:I.string().datetime(),deletedAt:I.string().datetime().nullable().describe("Timestamp when this component was retired, if any."),retiredAt:I.string().datetime().nullable(),retirementReason:I.string().nullable(),legacyStateUnknown:I.boolean().describe("True only for migration-era inactive rows whose retirement authority is unknown.")}),ZZ=I.object({projectId:I.string().uuid().optional().describe("Project to list components for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of components to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:I.union([I.boolean(),I.stringbool()]).default(!1).describe("When true, include retired and merged components.")}),WZ=I.object({components:I.array(ac),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),VZ=I.object({componentId:I.string().uuid().describe("Component ID to retrieve.")}),XZ=I.object({component:ac}),HZ=I.object({projectId:I.string().uuid().optional().describe("Project to register the component in. Auto-filled from CLI and SDK context when omitted."),name:I.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:I.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:I.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request."),origin:I.enum(["code_detected","log_observed"]).optional().describe("Machine provenance of this registration: 'code_detected' when the component was inferred from repository or code analysis, 'log_observed' (the default) when inferred from telemetry. Only applies to machine (secret-key) callers; human registrations are always recorded as 'user_declared' and ignore this field.")}),KZ=I.object({component:ac}),jZ=I.object({componentId:I.string().uuid().describe("Active component ID to rename."),name:I.string().trim().min(1,"Name is required"),requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),_Z=I.object({component:ac}),mZ=I.object({componentId:I.string().uuid().describe("Component ID to deregister."),reason:I.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),$UA=I.object({openIssueIds:I.array(I.string().uuid()),activeComponentIssueIds:I.array(I.string().uuid()),automationBindingIds:I.array(I.string().uuid()),notificationRuleIds:I.array(I.string().uuid()),dataSourceMappingIds:I.array(I.string().uuid()),observationIds:I.array(I.string().uuid()),relationshipIds:I.array(I.string().uuid()),recommendationScopeIds:I.array(I.string().uuid()),externalIncidentIds:I.array(I.string().uuid()),authorizedDeliveryIds:I.array(I.string().uuid()),authorizedAutomationRunIds:I.array(I.string().uuid())}),sM=I.object({requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),canonicalComponentName:I.string(),lifecycle:I.enum(["active","retired"]),affectedComponentIds:I.array(I.string().uuid()),componentRevisions:I.record(I.string().uuid(),I.number().int().nonnegative()),requiresCanonicalGroupConfirmation:I.boolean(),recommendationScopeEnabled:I.literal(!1),dependents:$UA,counts:I.record(I.string(),I.number().int().nonnegative())}),xZ=I.discriminatedUnion("status",[I.object({status:I.literal("observation_withdrawn"),componentId:I.string().uuid(),sourceType:I.literal("secret_key"),withdrawn:I.boolean()}),I.object({status:I.literal("retirement_confirmation_required"),preview:sM})]),tw=L({operationId:"components.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/components",tags:["Components"]},input:ZZ,output:WZ,pagination:"cursor",async:"sync"}),gw=L({operationId:"components.get",description:"Get a single component by ID.",backend:"api",route:{method:"GET",path:"/components/{componentId}",tags:["Components"]},input:VZ,output:XZ,pagination:"none",async:"sync"}),Ve=L({operationId:"components.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/components",tags:["Components"]},input:HZ,output:KZ,pagination:"none",async:"sync"}),nw=L({operationId:"components.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/components/{componentId}/deregister",tags:["Components"]},input:mZ,output:xZ,pagination:"none",async:"sync"}),iw=L({operationId:"components.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/components/{componentId}/rename",tags:["Components"]},input:jZ,output:_Z,pagination:"none",async:"sync"}),qZ=I.object({componentId:I.string().uuid().describe("Component whose owning team to set."),teamId:I.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),dZ=I.object({componentId:I.string().uuid().describe("Component that was updated."),teamId:I.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),Qw=L({operationId:"components.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/components/{componentId}/team",tags:["Components"]},input:qZ,output:dZ,pagination:"none",async:"sync"}),sZ=I.object({componentId:I.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),pZ=I.object({preview:sM}),Xe=I.record(I.string().uuid(),I.number().int().nonnegative()),xM=I.object({id:I.string().uuid(),rowRevision:I.number().int().nonnegative()}),kUA=I.object({notificationRules:I.array(xM),automationBindings:I.array(xM),relationships:I.array(xM)}),AW=I.object({componentId:I.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:Xe.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:I.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),tW=I.object({operationId:I.string().uuid(),status:I.enum(["committed","complete","followup_failed"]),requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),affectedComponentIds:I.array(I.string().uuid()),counts:I.record(I.string(),I.number().int().nonnegative()),authorizedDeliveryIds:I.array(I.string().uuid()),authorizedAutomationRunIds:I.array(I.string().uuid()),manualExternalIncidentIds:I.array(I.string().uuid()),issueAutomationSuppressions:I.number().int().nonnegative(),outboxEffectCount:I.number().int().nonnegative(),manifest:kUA,followups:I.record(I.string(),I.unknown()).optional()}),gW=I.object({result:tW}),GUA=I.object({notificationRuleIds:I.array(I.string().uuid()),automationBindingIds:I.array(I.string().uuid()),recommendationScopeIds:I.array(I.string().uuid()),relationshipIds:I.array(I.string().uuid())}),nW=I.object({componentId:I.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:I.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),iW=I.object({requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),canonicalComponentName:I.string(),retirementOperationId:I.string().uuid(),affectedComponentIds:I.array(I.string().uuid()),componentRevisions:Xe,eligible:GUA}),QW=I.object({preview:iW}),pM=I.object({notificationRuleIds:I.array(I.string().uuid()).default([]),automationBindingIds:I.array(I.string().uuid()).default([]),recommendationScopeIds:I.array(I.string().uuid()).default([]),relationshipIds:I.array(I.string().uuid()).default([])}),oW=I.object({componentId:I.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:I.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:Xe.describe("Exact canonical-group revisions returned by restorationPreview."),selections:pM.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),IW=I.object({operationId:I.string().uuid(),status:I.literal("complete"),requestedComponentId:I.string().uuid(),canonicalComponentId:I.string().uuid(),affectedComponentIds:I.array(I.string().uuid()),restored:pM}),eW=I.object({result:IW}),ow=L({operationId:"components.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retirement/preview",tags:["Components"]},input:sZ,output:pZ,pagination:"none",async:"sync"}),Iw=L({operationId:"components.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/components/{componentId}/retire",tags:["Components"]},input:AW,output:gW,pagination:"none",async:"sync"}),ew=L({operationId:"components.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restoration/preview",tags:["Components"]},input:nW,output:QW,pagination:"none",async:"sync"}),Bw=L({operationId:"components.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/components/{componentId}/restore",tags:["Components"]},input:oW,output:eW,pagination:"none",async:"sync"}),wc=I.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),BW=I.enum(["observed","stale","unobserved"]),qM=I.object({originalComponentId:I.string().uuid(),effectiveComponentId:I.string().uuid(),name:I.string(),lifecycle:I.enum(["active","retired","merged"]),observationState:BW}),hW=I.object({id:I.string().uuid(),source:qM,target:qM,relationshipType:wc,createdAt:I.string().datetime(),endedAt:I.string().datetime().nullable(),endReason:I.string().nullable(),rowRevision:I.number().int().nonnegative()}),rc=I.object({projectId:I.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),AY=I.object({sourceComponentId:I.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:I.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:wc}),CW=rc.extend({includeHistorical:I.union([I.boolean(),I.stringbool()]).default(!1).describe("Include historically ended relationships.")}),cW=I.object({relationships:I.array(hW)}),JUA=I.object({ruleId:I.string().uuid(),ruleGroupId:I.string().uuid().nullable(),ownerComponentId:I.string().uuid(),destinationIds:I.array(I.string().uuid()),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),TUA=I.object({bindingId:I.string().uuid(),automationId:I.string().uuid(),ownerComponentId:I.string().uuid(),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),tY=I.object({notificationRules:I.array(JUA),automationBindings:I.array(TUA)}),EW=AY.extend({action:I.enum(["add","remove"]),organizationId:I.string(),projectId:I.string().uuid(),relationshipId:I.string().uuid().nullable(),componentRevisions:I.record(I.string().uuid(),I.number().int().nonnegative()),policyImpact:tY,confirmationRequired:I.boolean()}),yW=rc.merge(AY).extend({action:I.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),DW=I.object({preview:EW}),aW=rc.merge(AY).extend({requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:I.string().trim().min(1,"Reason cannot be empty"),componentRevisions:I.record(I.string().uuid(),I.number().int().nonnegative()),confirmPolicyImpact:I.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),wW=aW,rW=aW,bW=I.object({action:I.enum(["add","remove"]),relationshipId:I.string().uuid(),sourceComponentId:I.string().uuid(),targetComponentId:I.string().uuid(),relationshipType:wc,policyImpact:tY}),gY=I.object({result:bW}),hw=L({operationId:"components.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/components/relationships",tags:["Components"]},input:CW,output:cW,pagination:"none",async:"sync"}),Cw=L({operationId:"components.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/components/relationships/preview",tags:["Components"]},input:yW,output:DW,pagination:"none",async:"sync"}),cw=L({operationId:"components.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships",tags:["Components"]},input:wW,output:gY,pagination:"none",async:"sync"}),Ew=L({operationId:"components.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/components/relationships/remove",tags:["Components"]},input:rW,output:gY,pagination:"none",async:"sync"}),nY=I.enum(["suspend","move"]),NW=I.object({disposition:nY,beforeComponentIds:I.array(I.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:I.array(I.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),dM=I.object({kind:I.enum(["notification_rule","automation_binding"]),policyId:I.string().uuid(),sourceRowRevision:I.number().int().nonnegative(),sourceComponentId:I.string().uuid(),equivalentPolicyId:I.string().uuid().nullable(),equivalent:I.boolean(),defaultDisposition:I.enum(["deduplicate","suspend"]),allowedDispositions:I.array(nY),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),Dc=I.object({kind:I.enum(["notification_rule","automation_binding"]),policyId:I.string().uuid(),ownerComponentId:I.string().uuid(),rowRevision:I.number().int().nonnegative(),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),iY=I.object({relationshipId:I.string().uuid(),action:I.enum(["rewire","close_self","close_duplicate"]),relationshipType:wc,beforeSourceComponentId:I.string().uuid(),beforeTargetComponentId:I.string().uuid(),afterSourceComponentId:I.string().uuid(),afterTargetComponentId:I.string().uuid(),survivingRelationshipId:I.string().uuid().nullable(),beforeRowRevision:I.number().int().nonnegative(),afterRowRevision:I.number().int().nonnegative().nullable()}),RUA=I.object({openIssueIds:I.array(I.string().uuid()),componentIssueIds:I.array(I.string().uuid()),observationIds:I.array(I.string().uuid()),dataSourceMappingIds:I.array(I.string().uuid()),nameIds:I.array(I.string().uuid()),relationshipIds:I.array(I.string().uuid()),recommendationScopeIds:I.array(I.string().uuid())}),yw=I.object({sourceComponentId:I.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:I.string().uuid().describe("Active terminal component that becomes the canonical target.")}),uW=rc.merge(yw),UW=yw.extend({organizationId:I.string(),projectId:I.string().uuid(),sourceGroupComponentIds:I.array(I.string().uuid()),targetGroupComponentIds:I.array(I.string().uuid()),affectedComponentIds:I.array(I.string().uuid()),componentRevisions:Xe,inventory:RUA,notificationPolicies:I.array(dM),automationBindings:I.array(dM),notificationScopeChanges:I.array(Dc),automationScopeChanges:I.array(Dc),relationshipChanges:I.array(iY),recommendationScopeEnabled:I.literal(!1),dependentCount:I.number().int().nonnegative(),ordinaryTransactionLimit:I.number().int().positive(),operatorAssistanceRequired:I.boolean(),confirmationRequired:I.boolean()}),FW=I.object({preview:UW}),LW=rc.merge(yw).extend({requestId:I.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:I.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:Xe.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:I.record(I.string().uuid(),NW).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:I.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),vZ=I.object({policyId:I.string().uuid(),action:I.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:I.string().uuid().nullable(),beforeRowRevision:I.number().int().nonnegative(),afterRowRevision:I.number().int().nonnegative(),beforeComponentIds:I.array(I.string().uuid()),afterComponentIds:I.array(I.string().uuid())}),SW=I.object({componentRevisions:Xe,redirectedComponentIds:I.array(I.string().uuid()),dataSourceMappingIds:I.array(I.string().uuid()),movedAliasIds:I.array(I.string().uuid()),historicalDisplayIds:I.array(I.string().uuid()),relationshipChanges:I.array(iY),notificationPolicies:I.array(vZ),automationBindings:I.array(vZ),notificationScopeChanges:I.array(Dc),automationScopeChanges:I.array(Dc),recommendationScopeIds:I.array(I.string().uuid())}),lW=yw.extend({operationId:I.string().uuid(),status:I.literal("complete"),affectedComponentIds:I.array(I.string().uuid()),manifest:SW}),MW=I.object({result:lW}),Dw=L({operationId:"components.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/components/merge/preview",tags:["Components"]},input:uW,output:FW,pagination:"none",async:"sync"}),aw=L({operationId:"components.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/components/merge",tags:["Components"]},input:LW,output:MW,pagination:"none",async:"sync"}),YW=I.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),QY=I.object({id:I.string().uuid(),componentId:I.string().uuid(),projectId:I.string().uuid(),severity:YW,summary:I.string().describe("Human-readable summary of the status-page issue."),startedAt:I.string().datetime().describe("When the incident began affecting the component."),resolvedAt:I.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),$W=I.object({projectId:I.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:I.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:I.union([I.boolean(),I.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),kW=I.object({incidents:I.array(QY),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),GW=I.object({timestamp:I.string().datetime(),status:I.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),JW=I.object({componentId:I.string().uuid().describe("Component to build the timeline for."),windowStart:I.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:I.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),TW=I.object({componentId:I.string().uuid(),windowStart:I.string().datetime(),windowEnd:I.string().datetime(),timeline:I.array(GW),incidents:I.array(QY)}),ww=L({operationId:"components.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Components"]},input:$W,output:kW,pagination:"cursor",async:"sync"}),rw=L({operationId:"components.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/components/{componentId}/timeline",tags:["Components"]},input:JW,output:TW,pagination:"none",async:"sync"}),fUA={list:tw.contract,get:gw.contract,register:Ve.contract,deregister:nw.contract,rename:iw.contract,assignTeam:Qw.contract,retirementPreview:ow.contract,retire:Iw.contract,restorationPreview:ew.contract,restore:Bw.contract,mergePreview:Dw.contract,merge:aw.contract,relationships:{list:hw.contract,preview:Cw.contract,add:cw.contract,remove:Ew.contract},incidents:{list:ww.contract},timeline:rw.contract}});var bw,IY,RW,fW,eY,PW,zW,OW,BY,vW,ZW,WW,hY,VW,XW,CY;var cY=D(()=>{TA();VA();bw=["github","google","microsoft","linear","bitbucket","slack"],IY=I.enum(bw),RW=I.object({organizationId:I.string().min(1).optional().describe("Organization to connect within. Auto-filled from CLI and SDK context when omitted."),provider:IY.describe("Connected-account provider to connect.")}),fW=I.object({url:I.string().describe("Vendor authorization URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:I.string().uuid().describe("Connect attempt to poll via `connectedAccounts.getConnectAttempt` while the browser flow completes."),expiresAt:I.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),eY=L({operationId:"connectedAccounts.beginConnect",description:"Begin a browser connect flow for a connected-account provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/connected-accounts/connect",tags:["Connected Accounts"],successStatus:201},input:RW,output:fW,pagination:"none",async:"sync"}),PW=I.enum(["pending","completed","failed","expired"]),zW=I.object({organizationId:I.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:I.string().uuid().describe("Connect attempt ID to poll.")}),OW=I.object({status:PW.describe("Attempt state. `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:I.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized).")}),BY=L({operationId:"connectedAccounts.getConnectAttempt",description:"Poll a browser connect attempt started with `connectedAccounts.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/connected-accounts/connect/attempts/{attemptId}",tags:["Connected Accounts"]},input:zW,output:OW,pagination:"none",async:"sync"}),vW=I.object({organizationId:I.string().min(1).optional().describe("Organization to list accounts for. Auto-filled from CLI and SDK context when omitted.")}),ZW=I.object({provider:I.string().describe("Provider identifier."),externalName:I.string().nullable().describe("Display name from the provider."),externalLogin:I.string().nullable().describe("Username or login from the provider."),connectedAt:I.string().datetime().nullable().describe("When the account was connected."),authMode:I.enum(["oauth","pat"]).nullable().describe("Auth mode used."),needsReconnect:I.boolean().describe("Whether the token is expired and a reconnect is required.")}),WW=I.object({accounts:I.array(ZW)}),hY=L({operationId:"connectedAccounts.list",description:"List the calling user's connected accounts for the organization.",backend:"api",route:{method:"GET",path:"/connected-accounts",tags:["Connected Accounts"]},input:vW,output:WW,pagination:"none",async:"sync"}),VW=I.object({organizationId:I.string().min(1).optional().describe("Organization the account belongs to. Auto-filled from CLI and SDK context when omitted."),provider:IY.describe("Provider to disconnect.")}),XW=I.object({success:I.literal(!0)}),CY=L({operationId:"connectedAccounts.disconnect",description:"Disconnect the calling user's connected account for a provider (soft delete).",backend:"api",route:{method:"DELETE",path:"/connected-accounts/{provider}",tags:["Connected Accounts"]},input:VW,output:XW,pagination:"none",async:"sync"})});var Ko,EY,HW,KW,PUA,zUA,OUA,jW,bc,vUA,ZUA,WUA,VUA,XUA,HUA,KUA,jUA,_UA,mUA,xUA,qUA,yY,DY,aY,wY,rY,bY,dUA,sUA,pUA,AFA,NY,uY,tFA,gFA,nFA,iFA,UY,EEt;var _W=D(()=>{TA();VA();Ko=I.string().uuid().describe("Automation ID."),EY=I.enum(["running","succeeded","failed","timed_out","cancelled"]),HW=I.object({id:I.string().uuid(),automationRunKey:I.string(),status:EY,startedAt:I.string().datetime(),completedAt:I.string().datetime().nullable(),durationMs:I.number().int().nullable(),exitCode:I.number().int().nullable()}),KW=HW.extend({scheduledAt:I.string().datetime().nullable().describe("When the run was scheduled to start, if known."),dueAt:I.string().datetime().nullable().describe("When the run became due, if known."),errorMessage:I.string().nullable().describe("Failure detail for the run, if it failed or timed out.")}),PUA=KW.extend({automationId:I.string().uuid().describe("Automation that owns this run.")}),zUA=I.enum(["script","log_match"]),OUA=I.enum(["expression_matched"]),jW=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),kind:zUA.describe("Automation kind: a scheduled script or a log-match investigation."),scriptId:I.string().uuid().nullable().describe("ID of the project_scripts row this automation runs, for DB-backed script automations. Null for legacy script_path automations and for log-match automations."),scriptName:I.string().nullable().describe("Name of the project_scripts row this automation runs (see scriptId). Null when scriptId is null."),logMatchExpressionId:I.string().uuid().nullable().describe("Deprecated: use signalDefinitionId. Log-match expression bound to this automation. Null for script automations."),signalDefinitionId:I.string().uuid().nullable().describe("Signal definition bound to this automation. Null for script automations."),signalType:OUA.nullable().describe("Signal trigger type for log-match automations. Null for script automations."),source:I.enum(["sazabi_managed","custom"]).describe("Whether the automation is Sazabi-managed or customer-defined."),enabled:I.boolean(),cronExpression:I.string().nullable().describe("Cron schedule for scheduled automations. Null for signal automations."),timezone:I.string(),timeoutSeconds:I.number().int().nullable(),health:I.enum(["healthy","failing","never_run"]).describe("Health derived from the most recent run."),lastRun:HW.nullable(),successRate:I.number().nullable().describe("Fraction of terminal runs that succeeded over the last 7 days."),runCount:I.number().int().describe("Total runs over the last 7 days."),failedRunCount:I.number().int().describe("Failed or timed-out runs over the last 7 days.")}),bc=jW.extend({createdAt:I.string().datetime(),updatedAt:I.string().datetime(),recordedHistoryStartsAt:I.string().datetime().describe("Earliest timestamp for which run history is recorded."),scriptIdentifier:I.string().nullable().describe("Relative project script path executed by the automation. Null for signal automations."),canToggle:I.boolean().describe("Whether the caller may enable or disable this automation.")}),vUA=I.object({projectId:I.string().uuid().optional().describe("Project to list automations for. Auto-filled from CLI and SDK context when omitted."),search:I.string().optional().describe("Case-insensitive partial match on automation name."),status:I.enum(["active","paused"]).optional().describe("Filter by enabled (active) or disabled (paused) automations."),health:I.enum(["healthy","failing","never_run"]).optional().describe("Filter by automation health."),source:I.enum(["sazabi_managed","custom"]).optional().describe("Filter by automation source."),sort:I.enum(["name","last_run","failures","runs"]).default("name").describe("Sort order for the returned automations."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of automations to return per page."),cursor:I.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),ZUA=I.object({automations:I.array(jW),nextCursor:I.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),WUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),VUA=I.object({automation:bc}),XUA=I.object({projectId:I.string().uuid().optional().describe("Project to create the automation in. Auto-filled from CLI and SDK context when omitted."),name:I.string().min(1).max(200).describe("Automation name."),description:I.string().max(2000).nullable().optional().describe("Human-readable description. Required for log-match automations (investigation instructions)."),scriptId:I.string().uuid().optional().describe("Project script to run, by ID. Provide exactly one of scriptId, script, or expressionId."),script:I.string().optional().describe("Project script to run, by name (resolved to scriptId server-side). Provide exactly one of scriptId, script, or expressionId."),expressionId:I.string().uuid().optional().describe("Log-match expression to bind. Creates a signal automation that investigates matching logs. Mutually exclusive with scriptId and script."),cronExpression:I.string().optional().describe("Cron schedule for the automation. Defaults to every minute when omitted."),timezone:I.string().optional().describe("IANA timezone for cronExpression. Defaults to UTC."),timeoutSeconds:I.coerce.number().int().min(1).max(3600).optional().describe("Execution timeout in seconds. Defaults to 60."),enabled:I.boolean().optional().describe("Whether the automation starts enabled. Defaults to true.")}).superRefine((A,t)=>{let g=A.scriptId!=null,i=A.script!=null,n=A.expressionId!=null;if(Number(g)+Number(i)+Number(n)!==1){t.addIssue({code:"custom",message:"Provide exactly one of scriptId, script, or expressionId.",path:["scriptId"]});return}if(n){if(A.cronExpression!=null)t.addIssue({code:"custom",message:"cronExpression is not used for log-match automations.",path:["cronExpression"]});if(A.timezone!=null)t.addIssue({code:"custom",message:"timezone is not used for log-match automations.",path:["timezone"]});if(A.timeoutSeconds!=null)t.addIssue({code:"custom",message:"timeoutSeconds is not used for log-match automations.",path:["timeoutSeconds"]});if(!A.description?.trim())t.addIssue({code:"custom",message:"description is required for log-match automations (investigation instructions).",path:["description"]})}}),HUA=I.object({automation:bc}),KUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),name:I.string().min(1).max(200).optional().describe("New automation name."),description:I.string().max(2000).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged."),cronExpression:I.string().optional().describe("New cron schedule."),timezone:I.string().optional().describe("New IANA timezone."),timeoutSeconds:I.coerce.number().int().min(1).max(3600).optional().describe("New execution timeout in seconds.")}),jUA=I.object({automation:bc}),_UA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),mUA=I.object({automation:bc}),xUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),qUA=I.object({automation:bc}),yY=L({operationId:"automations.list",description:"List scheduled automations in a project, with run health and recent run stats.",backend:"api",route:{method:"GET",path:"/automations",tags:["Automations"]},input:vUA,output:ZUA,pagination:"cursor",async:"sync"}),DY=L({operationId:"automations.get",description:"Get a single automation by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}",tags:["Automations"]},input:WUA,output:VUA,pagination:"none",async:"sync"}),aY=L({operationId:"automations.create",description:"Create an automation: either a cron-driven project script (see scripts.create) or a log-match investigation bound to an expression (see logMatchExpressions.create).",backend:"api",route:{method:"POST",path:"/automations",successStatus:201,tags:["Automations"]},input:XUA,output:HUA,pagination:"none",async:"sync"}),wY=L({operationId:"automations.update",description:"Update an automation's name, description, or schedule. Does not change which script it runs.",backend:"api",route:{method:"PATCH",path:"/automations/{automationId}",tags:["Automations"]},input:KUA,output:jUA,pagination:"none",async:"sync"}),rY=L({operationId:"automations.enable",description:"Enable an automation so it runs on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/enable",tags:["Automations"]},input:_UA,output:mUA,pagination:"none",async:"sync"}),bY=L({operationId:"automations.disable",description:"Disable an automation so it stops running on its schedule.",backend:"api",route:{method:"POST",path:"/automations/{automationId}/disable",tags:["Automations"]},input:xUA,output:qUA,pagination:"none",async:"sync"}),dUA=I.object({automationId:Ko,projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted."),status:I.union([EY,I.array(EY)]).optional().describe("Filter runs by status. Accepts a single status or an array of statuses (matched as OR)."),cursor:I.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page.")}),sUA=I.object({runs:I.array(KW),nextCursor:I.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results."),recordedHistoryStartsAt:I.string().datetime().describe("Earliest timestamp for which run history is recorded.")}),pUA=I.object({automationId:Ko,runId:I.string().uuid().describe("Automation run ID."),projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),AFA=I.object({run:PUA}),NY=L({operationId:"automations.runs.list",description:"List runs for an automation, most recent first.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs",tags:["Automations"]},input:dUA,output:sUA,pagination:"cursor",async:"sync"}),uY=L({operationId:"automations.runs.get",description:"Get a single automation run by ID.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}",tags:["Automations"]},input:pUA,output:AFA,pagination:"none",async:"sync"}),tFA=I.enum(["queued","running","succeeded","failed","timed_out"]),gFA=I.object({stdout:I.string().describe("Captured standard output for the run."),stderr:I.string().describe("Captured standard error for the run."),exitCode:I.number().int().nullable().describe("Process exit code of the run's command, if it finished."),status:tFA.describe("Execution status of the run's captured command."),truncated:I.boolean().describe("Whether the captured output exceeded the inline preview limit. The full output is returned when it could be read from durable storage; otherwise the truncated preview is returned with this flag set."),startedAt:I.string().datetime().nullable().describe("When the command started executing, if known."),completedAt:I.string().datetime().nullable().describe("When the command finished executing, if known."),durationMs:I.number().int().nullable().describe("Command execution duration in milliseconds, if known.")}),nFA=I.object({automationId:Ko,runId:I.string().uuid().describe("Automation run ID."),projectId:I.string().uuid().optional().describe("Project that owns the automation. Auto-filled from CLI and SDK context when omitted.")}),iFA=I.object({logs:gFA}),UY=L({operationId:"automations.runs.logs",description:"Get the captured stdout/stderr for a single automation run, reading the full output from durable storage when the inline preview was truncated.",backend:"api",route:{method:"GET",path:"/automations/{automationId}/runs/{runId}/logs",tags:["Automations"]},input:nFA,output:iFA,pagination:"none",async:"sync"}),EEt={list:yY.contract,get:DY.contract,create:aY.contract,update:wY.contract,enable:rY.contract,disable:bY.contract,runs:{list:NY.contract,get:uY.contract,logs:UY.contract}}});var QFA,oFA,mW,IFA,Nw,eFA,BFA,xW,hFA,CFA,cFA,EFA,yFA,DFA,aFA,LY,SY,lY,Hn,qW,FY,MY,wFA,dW,rFA,bFA,NFA,uFA,UFA,FFA,LFA,SFA,lFA,MFA,YFA,$FA,kFA,GFA,JFA,TFA,RFA,fFA,PFA,YY,sW,zFA,OFA,$Y,kY,GY,JY,TY,RY,fY,PY,zY,OY,vY,ZY,WY,wEt;var pW=D(()=>{TA();VA();QFA=I.enum(["logs_ingested_bytes","logs_accepted_bytes","input_tokens","output_tokens","issues_created","automation_runs_completed","pull_requests_created","pull_request_reviews_completed"]),oFA=I.enum(["cycle_top_up","upgrade_top_up","deficit_settlement","auto_top_up","one_off_top_up","usage_debit","adjustment","migration_opening_balance","void"]),mW=I.object({startsAt:I.string().datetime(),endsAt:I.string().datetime(),billableStartsAt:I.string().datetime()}),IFA=I.object({subscriptionChargeAmount:I.string(),creditDeficitAmount:I.string(),creditDeficitChargeAmount:I.string(),totalAmount:I.string(),currency:I.string()}),Nw=I.object({billingSubscriptionChangeId:I.string(),effectiveAt:I.string().datetime(),planSlug:I.string().nullable(),planName:I.string().nullable(),price:I.string().nullable(),currency:I.string().nullable(),targetCreditBalance:I.string().nullable()}),eFA=I.object({id:I.string(),status:I.string(),billingPlanId:I.string(),priceBookId:I.string(),cycleType:I.string(),cancelAt:I.string().datetime().nullable(),canceledAt:I.string().datetime().nullable()}),BFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to query billing for. Auto-filled from CLI and SDK context when omitted.")}),xW=I.object({status:I.enum(["current","payment_retrying","delinquent"]).describe("Negative-balance collection state. `current` means no open collection case; `payment_retrying` means a scheduled retry cadence is running; `delinquent` means retries are exhausted and intake is denied until payment settles the balance."),outstandingCredits:I.string().nullable().describe("Credits owed (absolute value of the negative balance)."),outstandingAmount:I.string().nullable().describe("Amount owed in `currency` at the current additional-credit price."),currency:I.string().nullable(),scheduledAttemptsMade:I.number().int().describe("Scheduled collection attempts consumed by confirmed payment failures."),nextRetryAt:I.string().datetime().nullable(),billingInvoiceId:I.string().nullable(),hostedInvoiceUrl:I.string().nullable()}).describe("Read-only negative-balance collection state for the organization."),hFA=I.object({billingModel:I.enum(["credit-balance-v1"]),billable:I.boolean(),nonBillableReason:I.string().nullable(),status:I.string(),planName:I.string().nullable(),planSlug:I.string().nullable(),currency:I.string().nullable(),currentBalance:I.string().nullable(),targetCreditBalance:I.string().nullable(),currentCycle:mW.nullable(),currentPeriodEstimate:IFA.nullable(),pendingDowngrade:Nw.nullable(),subscription:eFA.nullable(),collection:xW,currentPlan:I.object({slug:I.string(),name:I.string(),price:I.string().nullable(),currency:I.string().nullable(),targetCreditBalance:I.string().nullable(),subscriptionStatus:I.string(),cycleStartsAt:I.string().datetime().nullable(),cycleEndsAt:I.string().datetime().nullable(),renewalAt:I.string().datetime().nullable(),pendingSwitch:Nw.nullable(),pendingCancellation:I.object({effectiveAt:I.string().datetime()}).nullable()}).nullable()}),CFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to query usage for. Auto-filled from CLI and SDK context when omitted."),cycle:I.enum(["current","previous"]).default("current").describe("Which billing cycle to report usage for.")}),cFA=I.object({dimension:QFA,totalQuantity:I.string(),ratedQuantity:I.string(),creditsConsumed:I.string(),sourceBreakdown:I.record(I.string(),I.string())}),EFA=I.object({cycle:mW.nullable(),usage:I.array(cFA)}),yFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to query transactions for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of transactions to return per page."),page:I.coerce.number().int().min(1).default(1).describe("Page number for pagination (1-indexed).")}),DFA=I.object({id:I.string(),transactionType:oFA,creditDelta:I.string(),balanceAfter:I.string(),occurredAt:I.string().datetime(),billingInvoiceId:I.string().nullable()}),aFA=I.object({items:I.array(DFA),pagination:I.object({page:I.number(),limit:I.number(),total:I.number(),totalPages:I.number(),hasNext:I.boolean(),hasPrev:I.boolean()}).describe("Pagination metadata for the transaction list.")}),LY=L({operationId:"billing.getSummary",description:"Get a billing summary for the current organization, including plan, balance, and cycle information.",backend:"api",route:{method:"GET",path:"/billing/summary",tags:["Billing"]},input:BFA,output:hFA,pagination:"none",async:"sync"}),SY=L({operationId:"billing.getUsage",description:"Get per-dimension usage breakdown for the current or previous billing cycle.",backend:"api",route:{method:"GET",path:"/billing/usage",tags:["Billing"]},input:CFA,output:EFA,pagination:"none",async:"sync"}),lY=L({operationId:"billing.listTransactions",description:"List recent credit ledger transactions with pagination.",backend:"api",route:{method:"GET",path:"/billing/transactions",tags:["Billing"]},input:yFA,output:aFA,pagination:"page",async:"sync"}),Hn=I.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),qW=I.string().trim().regex(/^\d+(?:\.\d{1,6})?$/,"Expected a decimal with up to 6 places"),FY=qW.refine((A)=>{let[,t=""]=A.split(".");return t.slice(2).replaceAll("0","")===""},"Expected a currency amount with up to 2 decimal places").refine((A)=>/[1-9]/.test(A),"Expected a positive currency amount"),MY=I.string().trim().min(1).max(100),wFA=I.object({organizationId:Hn}),dW=I.object({supported:I.boolean().describe("Whether auto top-up is available for the account's plan."),enabled:I.boolean(),triggerCreditBalance:I.string(),topUpAmount:I.string(),cycleSpendingLimit:I.string(),currency:I.string(),creditsToGrant:I.string().nullable(),status:I.string()}),rFA=I.object({organizationId:Hn,enabled:I.boolean(),triggerCreditBalance:qW,topUpAmount:FY,cycleSpendingLimit:FY}),bFA=I.object({organizationId:Hn,amount:FY.describe("Amount to charge in the account currency; grants an equal credit balance."),idempotencyKey:I.string().trim().min(1).max(128).describe("Client-generated key. Repeating a request with the same key returns the original purchase instead of charging again.")}),NFA=I.object({status:I.enum(["paid","pending_payment"]),billingInvoiceId:I.string(),topUpAmount:I.string(),creditsToGrant:I.string(),currency:I.string()}),uFA=I.object({organizationId:Hn}),UFA=I.object({slug:I.string(),billingModel:I.string(),name:I.string(),description:I.string(),bestFor:I.string().nullable(),price:I.string(),currency:I.string(),targetCreditBalance:I.string().nullable(),logsIncludedBytes:I.string(),inputTokensIncluded:I.string(),outputTokensIncluded:I.string()}),FFA=I.object({billingModel:I.string(),currentPlanSlug:I.string().nullable(),hasActiveStripeBilling:I.boolean(),plans:I.array(UFA)}),LFA=I.object({organizationId:Hn,planSlug:MY}),SFA=I.object({calculatedAt:I.string().datetime(),type:I.enum(["upgrade","downgrade"]),effectiveAt:I.string().datetime(),currency:I.string(),currentPlanSlug:I.string(),targetPlanSlug:I.string(),currentPlanName:I.string(),targetPlanName:I.string(),currentPlanPrice:I.string(),targetPlanPrice:I.string(),currentTargetCreditBalance:I.string(),targetCreditBalance:I.string(),creditDeficitAmount:I.string(),creditDeficitChargeAmount:I.string(),additionalCreditPrice:I.string(),immediateChargeAmount:I.string(),subscriptionChargeAmount:I.string(),proratedCreditGrantAmount:I.string(),remainingCycleFraction:I.string(),nextCycleChargeAmount:I.string()}),lFA=I.object({organizationId:Hn,planSlug:MY}),MFA=I.object({billingSubscriptionChangeId:I.string(),billingSubscriptionId:I.string(),status:I.string(),type:I.string(),effectiveAt:I.string().datetime(),invoiceId:I.string().nullable(),creditDeficitAmount:I.string().optional(),creditDeficitChargeAmount:I.string().optional(),creditTopUpAmount:I.string().optional(),immediateChargeAmount:I.string().optional(),subscriptionChargeAmount:I.string().optional(),proratedCreditGrantAmount:I.string().optional()}),YFA=I.object({organizationId:Hn,planSlug:MY}),$FA=I.object({sessionId:I.string(),checkoutUrl:I.string().url()}),kFA=I.object({organizationId:Hn,sessionId:I.string().min(1).describe("The checkout session id returned by createCheckoutSession.")}),GFA=I.object({status:I.enum(["pending","active","expired"])}),JFA=I.object({organizationId:Hn}),TFA=I.object({portalUrl:I.string().url()}),RFA=I.object({organizationId:Hn}),fFA=I.object({hasPaymentMethod:I.boolean(),brand:I.string().nullable(),last4:I.string().nullable(),type:I.string().nullable(),expiryMonth:I.number().int().min(1).max(12).nullable(),expiryYear:I.number().int().nullable(),isDefault:I.boolean(),display:I.string().nullable()}),PFA=I.object({slug:I.string(),name:I.string(),price:I.string().nullable(),currency:I.string().nullable(),targetCreditBalance:I.string().nullable(),subscriptionStatus:I.string(),cycleStartsAt:I.string().datetime().nullable(),cycleEndsAt:I.string().datetime().nullable(),renewalAt:I.string().datetime().nullable(),pendingSwitch:Nw.nullable(),pendingCancellation:I.object({effectiveAt:I.string().datetime()}).nullable()}),YY=I.object({organizationId:Hn}),sW=I.object({currentPlan:PFA,effectiveAt:I.string().datetime(),currentBalance:I.string(),servicePolicy:I.literal("active_until_period_end"),creditPolicy:I.literal("dormant_until_resubscription"),scheduledFinalCharge:I.string().nullable(),autoTopUpEnabled:I.boolean(),pendingDowngrade:Nw.nullable(),collectionState:xW,calculatedAt:I.string().datetime()}),zFA=sW.extend({billingSubscriptionChangeId:I.string(),alreadyScheduled:I.boolean()}),OFA=I.object({billingSubscriptionId:I.string(),resumed:I.literal(!0)}),$Y=L({operationId:"billing.getAutoTopUp",description:"Get the organization's credit auto top-up settings (trigger balance, top-up amount, cycle spending limit).",backend:"api",route:{method:"GET",path:"/billing/auto-top-up",tags:["Billing"]},input:wFA,output:dW,pagination:"none",async:"sync"}),kY=L({operationId:"billing.updateAutoTopUp",description:"Enable/disable and configure credit auto top-up. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"PUT",path:"/billing/auto-top-up",tags:["Billing"]},input:rFA,output:dW,pagination:"none",async:"sync"}),GY=L({operationId:"billing.purchaseCredits",description:"Purchase a one-time amount of credits against the saved payment method. Requires a user credential with `billing:manage` and a stable idempotency key.",backend:"api",route:{method:"POST",path:"/billing/credits/purchase",tags:["Billing"]},input:bFA,output:NFA,pagination:"none",async:"sync"}),JY=L({operationId:"billing.listPlans",description:"List the self-serve credit plans available for checkout, including the current plan.",backend:"api",route:{method:"GET",path:"/billing/plans",tags:["Billing"]},input:uFA,output:FFA,pagination:"none",async:"sync"}),TY=L({operationId:"billing.previewPlanChange",description:"Preview the cost and effect of changing to a plan without applying it. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change/preview",tags:["Billing"]},input:LFA,output:SFA,pagination:"none",async:"sync"}),RY=L({operationId:"billing.changePlan",description:"Apply a plan upgrade or schedule a downgrade. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/plan-change",tags:["Billing"]},input:lFA,output:MFA,pagination:"none",async:"sync"}),fY=L({operationId:"billing.createCheckoutSession",description:"Create a hosted Stripe Checkout session for first-time subscribe from the terminal. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/checkout-session",tags:["Billing"]},input:YFA,output:$FA,pagination:"none",async:"sync"}),PY=L({operationId:"billing.getCheckoutSessionStatus",description:"Poll the completion status of a checkout session created by this organization.",backend:"api",route:{method:"GET",path:"/billing/checkout-session/{sessionId}",tags:["Billing"]},input:kFA,output:GFA,pagination:"none",async:"sync"}),zY=L({operationId:"billing.createPortalSession",description:"Create a Stripe Customer Portal session for updating the payment method. Requires a user credential with `billing:manage`.",backend:"api",route:{method:"POST",path:"/billing/portal-session",tags:["Billing"]},input:JFA,output:TFA,pagination:"none",async:"sync"}),OY=L({operationId:"billing.getPaymentMethod",description:"Get a summary of the organization's saved payment method (brand and last 4 digits).",backend:"api",route:{method:"GET",path:"/billing/payment-method",tags:["Billing"]},input:RFA,output:fFA,pagination:"none",async:"sync"}),vY=L({operationId:"billing.previewSubscriptionCancellation",description:"Preview period-end subscription cancellation without changing billing state.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/preview",tags:["Billing"]},input:YY,output:sW,pagination:"none",async:"sync"}),ZY=L({operationId:"billing.scheduleSubscriptionCancellation",description:"Schedule cancellation at the end of the paid billing cycle.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation",tags:["Billing"]},input:YY,output:zFA,pagination:"none",async:"sync"}),WY=L({operationId:"billing.resumeSubscriptionCancellation",description:"Resume renewal before a scheduled cancellation takes effect.",backend:"api",route:{method:"POST",path:"/billing/subscription-cancellation/resume",tags:["Billing"]},input:YY,output:OFA,pagination:"none",async:"sync"}),wEt={getSummary:LY.contract,getUsage:SY.contract,listTransactions:lY.contract,getAutoTopUp:$Y.contract,updateAutoTopUp:kY.contract,purchaseCredits:GY.contract,listPlans:JY.contract,previewPlanChange:TY.contract,changePlan:RY.contract,createCheckoutSession:fY.contract,getCheckoutSessionStatus:PY.contract,createPortalSession:zY.contract,getPaymentMethod:OY.contract,previewSubscriptionCancellation:vY.contract,scheduleSubscriptionCancellation:ZY.contract,resumeSubscriptionCancellation:WY.contract}});var vFA,Nc,ZFA,WFA,VFA,XFA,HFA,KFA,uc,AV,jFA,_FA,tV,mFA,xFA,gV,qFA,dFA,nV,sFA,pFA,iV,ALA,tLA,QV,gLA,nLA,iLA,oV,QLA,oLA,IV,ILA,eLA,eV,VY,BV,hV,CV,cV,EV,yV,Uc,DV,BLA,aV,hLA,wV,rV,CLA,cLA,bV,ELA,NV,yLA,DLA,uV;var UV=D(()=>{TA();VA();vFA=["slack","github","linear","pagerduty","victorops","rootly","incident_io","webhook","teams","bitbucket","jira"],Nc=I.enum(vFA),ZFA=I.enum(["oauth","app_installation","api_key"]),WFA=I.enum(["alert_routing","inbound_webhooks","messaging","code_search","health_check"]),VFA=I.enum(["pending","connected","error","revoked"]),XFA=I.enum(["healthy","unhealthy","unknown"]),HFA=I.object({name:I.string().describe("Field name used as the JSON key in `credentials`."),label:I.string().describe("Human-readable field label."),required:I.boolean().describe("Whether the field is required."),secret:I.boolean().describe("Whether the field is a secret (masked in UIs, encrypted)."),description:I.string().nullable().describe("Optional hint for the field's expected value.")}),KFA=I.object({id:Nc.describe("Integration provider identifier."),name:I.string().describe("Human-readable display name."),description:I.string().describe("Short description of the provider."),authType:ZFA.describe("Auth flow used to connect this provider."),capabilities:I.array(WFA).describe("Capabilities the provider exposes once connected."),connectionCount:I.number().int().describe("Number of active connections for this provider in the organization, including error-status connections that need attention."),credentialFields:I.array(HFA).optional().describe("Fields required in `credentials` when creating an api_key connection. Absent for browser-auth providers."),browserConnectSupported:I.boolean().describe("Whether this provider's browser connect flow (`integrations.beginConnect`) is available in this environment. Readiness-derived: the provider begins on the consolidated OAuth callback route and its OAuth client credentials are provisioned. Providers still on legacy browser paths (Slack, Linear, Bitbucket) report false and connect from the dashboard.")}),uc=I.object({id:I.string().uuid(),provider:Nc,displayName:I.string().nullable(),status:VFA,isActive:I.boolean().describe("Whether this connection counts as connected (status 'connected' or 'error'). An error-status connection is the organization's connection — broken, not absent."),needsAttention:I.boolean().describe("Whether the connection should surface a reconnect prompt (status 'error' or health status 'unhealthy')."),metadata:I.record(I.string(),I.unknown()).describe("Non-secret provider metadata (e.g. workspace/team names)."),healthStatus:XFA,healthMessage:I.string().nullable(),healthCheckedAt:I.string().datetime().nullable(),healthConsecutiveFailures:I.number().int(),connectedBy:I.string().nullable(),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),AV=I.object({organizationEnabled:I.boolean().describe("Stored organization-wide policy."),connectionEnabled:I.boolean().describe("Stored connection policy."),effectiveEnabled:I.boolean().describe("True only when both stored policies are enabled.")}),jFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to list providers for. Auto-filled from CLI and SDK context when omitted.")}),_FA=I.object({providers:I.array(KFA)}),tV=L({operationId:"integrations.listProviders",description:"List supported integration providers and how many connections the organization has for each.",backend:"api",route:{method:"GET",path:"/integrations/providers",tags:["Integrations"]},input:jFA,output:_FA,pagination:"none",async:"sync"}),mFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to list connections for. Auto-filled from CLI and SDK context when omitted."),provider:Nc.optional().describe("Filter connections by provider.")}),xFA=I.object({connections:I.array(uc)}),gV=L({operationId:"integrations.listConnections",description:"List integration connections and their connection state for the organization.",backend:"api",route:{method:"GET",path:"/integrations/connections",tags:["Integrations"]},input:mFA,output:xFA,pagination:"none",async:"sync"}),qFA=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Connection ID to fetch.")}),dFA=I.object({connection:uc}),nV=L({operationId:"integrations.getConnection",description:"Get one integration connection by ID (non-secret config only).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:qFA,output:dFA,pagination:"none",async:"sync"}),sFA=I.object({organizationId:I.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:Nc.describe("Integration provider to connect. Must use api_key auth (see `authType` in the provider catalog)."),displayName:I.string().trim().min(1).max(255).optional().describe("Optional display name for the connection."),credentials:I.record(I.string(),I.unknown()).describe("Vendor credentials. Fields vary by provider (see `credentialFields` on the provider catalog). Validated against the vendor before the connection is created; never returned.")}),pFA=I.object({connection:uc}),iV=L({operationId:"integrations.createConnection",description:"Create an integration connection for an api_key provider. Credentials are validated against the vendor, then stored encrypted.",backend:"api",route:{method:"POST",path:"/integrations/connections",tags:["Integrations"],successStatus:201},input:sFA,output:pFA,pagination:"none",async:"sync"}),ALA=I.object({organizationId:I.string().min(1).optional().describe("Organization to connect in. Auto-filled from CLI and SDK context when omitted."),provider:Nc.describe("Browser-auth provider to connect (oauth or app_installation). Must report `browserConnectSupported: true` in the provider catalog."),displayName:I.string().trim().min(1).max(255).optional().describe("Optional display name for the resulting connection."),projectId:I.string().trim().min(1).optional().describe("Project the completed connection defaults its routing to. Must belong to the organization.")}),tLA=I.object({url:I.string().describe("Vendor authorization (or app installation) URL to open in a browser signed into the Sazabi dashboard as the same user."),attemptId:I.string().uuid().describe("Connect attempt to poll via `integrations.getConnectAttempt` while the browser flow completes."),expiresAt:I.string().datetime().describe("When the attempt expires if the browser flow never completes.")}),QV=L({operationId:"integrations.beginConnect",description:"Begin a browser connect flow for an OAuth or app-installation provider. Returns a vendor URL to open in a browser and an attempt to poll; the vendor exchange completes server-side and no token ever reaches the caller.",backend:"api",route:{method:"POST",path:"/integrations/connect",tags:["Integrations"],successStatus:201},input:ALA,output:tLA,pagination:"none",async:"sync"}),gLA=I.enum(["pending","completed","not_connected","failed","expired"]),nLA=I.object({organizationId:I.string().min(1).optional().describe("Organization the attempt belongs to. Auto-filled from CLI and SDK context when omitted."),attemptId:I.string().uuid().describe("Connect attempt ID to poll.")}),iLA=I.object({status:gLA.describe("Attempt state. `not_connected` means the flow finished but the connection is not live yet (most commonly awaiting a third-party admin's approval). `expired` means the browser flow did not complete in time — begin a new connect."),errorCode:I.string().nullable().describe("Reason code when status is `failed` (the shared OAuth callback vocabulary, e.g. vendor_denied, not_authorized) or `not_connected` (e.g. `installation_requested` for GitHub installs awaiting org-admin approval)."),connection:uc.optional().describe("The created connection when status is `completed`.")}),oV=L({operationId:"integrations.getConnectAttempt",description:"Poll a browser connect attempt started with `integrations.beginConnect`. Visible only to the user who began it.",backend:"api",route:{method:"GET",path:"/integrations/connect/attempts/{attemptId}",tags:["Integrations"]},input:nLA,output:iLA,pagination:"none",async:"sync"}),QLA=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Connection ID to disconnect.")}),oLA=I.object({success:I.literal(!0)}),IV=L({operationId:"integrations.disconnectConnection",description:"Disconnect an integration connection (soft delete). Always succeeds regardless of stored credential state; cached vendor catalogs and routing derived from the connection are removed.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}",tags:["Integrations"]},input:QLA,output:oLA,pagination:"none",async:"sync"}),ILA=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Connection ID to update."),credentials:I.record(I.string(),I.unknown()).describe("Replacement vendor credentials for an api_key connection. Validated against the vendor; resets the connection's health state on success.")}),eLA=I.object({connection:uc}),eV=L({operationId:"integrations.updateConnectionCredentials",description:"Replace an api_key connection's credentials in place — the reconnect path for a connection that needs attention. Keeps connection-scoped configuration.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/credentials",tags:["Integrations"]},input:ILA,output:eLA,pagination:"none",async:"sync"}),VY=I.object({organizationId:I.string().min(1).optional()}),BV=I.object({organizationEnabled:I.boolean(),effectiveEnabled:I.boolean()}),hV=VY.extend({connectionId:I.string().uuid().describe("Integration connection whose JIT policy is being read or updated.")}),CV=L({operationId:"integrations.getOrganizationExternalIdentityJitPolicy",description:"Read the organization's stored external-identity JIT policy.",backend:"api",route:{method:"GET",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:VY,output:BV,pagination:"none",async:"sync"}),cV=L({operationId:"integrations.updateOrganizationExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT across an organization.",backend:"api",route:{method:"PATCH",path:"/integrations/external-identity-jit-policy",tags:["Integrations"]},input:VY.extend({enabled:I.boolean()}),output:BV,pagination:"none",async:"sync"}),EV=L({operationId:"integrations.getConnectionExternalIdentityJitPolicy",description:"Read stored and effective JIT policy for one connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:hV,output:AV,pagination:"none",async:"sync"}),yV=L({operationId:"integrations.updateConnectionExternalIdentityJitPolicy",description:"Enable or disable external-identity JIT for one connection.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/external-identity-jit-policy",tags:["Integrations"]},input:hV.extend({enabled:I.boolean()}),output:AV,pagination:"none",async:"sync"}),Uc=I.object({organizationId:I.string().min(1).optional().describe("Organization the connection belongs to. Auto-filled from CLI and SDK context when omitted."),connectionId:I.string().uuid().describe("Slack integration connection ID (the `integration_connections.id`, not the Slack team id).")}),DV=I.object({connectionId:I.string().uuid(),defaultProjectId:I.string().uuid().nullable().describe("Project new threads route to when no channel mapping matches."),automaticResponses:I.boolean().describe("Auto-respond to messages in channels the bot is in (autoReactEnabled)."),acknowledgementMessage:I.boolean().describe("Post a processing acknowledgement while a run is in flight (processingMessageEnabled).")}),BLA=Uc,aV=L({operationId:"integrations.getSlackConfiguration",description:"Read Slack connection configuration (default project, automatic responses, acknowledgement message).",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:BLA,output:DV,pagination:"none",async:"sync"}),hLA=Uc.extend({defaultProjectId:I.string().uuid().nullable().optional().describe("Project new threads route to when no channel mapping matches. Pass null to clear it. Omit to leave unchanged."),automaticResponses:I.boolean().optional().describe("Omit to leave unchanged."),acknowledgementMessage:I.boolean().optional().describe("Omit to leave unchanged.")}),wV=L({operationId:"integrations.updateSlackConfiguration",description:"Update Slack connection configuration. Omitted fields are left unchanged.",backend:"api",route:{method:"PATCH",path:"/integrations/connections/{connectionId}/slack-configuration",tags:["Integrations"]},input:hLA,output:DV,pagination:"none",async:"sync"}),rV=I.object({connectionId:I.string().uuid(),slackChannelId:I.string().min(1),slackChannelName:I.string().min(1),projectId:I.string().uuid()}),CLA=Uc,cLA=I.object({mappings:I.array(rV)}),bV=L({operationId:"integrations.listSlackChannelProjectMappings",description:"List channel-to-project mappings for a Slack connection.",backend:"api",route:{method:"GET",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings",tags:["Integrations"]},input:CLA,output:cLA,pagination:"none",async:"sync"}),ELA=Uc.extend({slackChannelId:I.string().min(1).describe("Slack channel ID (e.g. C0123ABCDEF)."),slackChannelName:I.string().min(1).optional().describe("Optional. Ignored for storage — the authoritative channel name is "+"always resolved from the connection's channel catalog. Accepted only as a convenience/label; the response returns the catalog name."),projectId:I.string().uuid().describe("Project the channel routes to. Must belong to the organization.")}),NV=L({operationId:"integrations.setSlackChannelProjectMapping",description:"Create or update the channel-to-project mapping for one Slack channel. Idempotent on (connection, channel).",backend:"api",route:{method:"PUT",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:ELA,output:rV,pagination:"none",async:"sync"}),yLA=Uc.extend({slackChannelId:I.string().min(1)}),DLA=I.object({success:I.boolean()}),uV=L({operationId:"integrations.deleteSlackChannelProjectMapping",description:"Delete a channel-to-project mapping.",backend:"api",route:{method:"DELETE",path:"/integrations/connections/{connectionId}/slack-channel-project-mappings/{slackChannelId}",tags:["Integrations"]},input:yLA,output:DLA,pagination:"none",async:"sync"})});var Kn,aLA,wLA,FV,uw,Uw,LV,XY,SV,HY,lV,MV,rLA,bLA,YV,$V,kV,GV,JV,TV,RV,fV,PV,zV,OV,vV,ZV,WV,VV,He,Fw,Lw,Sw,lw,Mw,Yw,$w,kw,Gw,Jw,NLA;var KY=D(()=>{TA();VA();Kn=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),description:I.string().nullable(),status:I.enum(["open","resolved","ignored"]),severity:I.enum(["low","medium","high","critical"]),componentId:I.string().uuid().nullable(),createdAt:I.string().datetime(),resolvedAt:I.string().datetime().nullable(),mutedAt:I.string().datetime().nullable(),muteHitCount:I.number().int().nonnegative(),lastActivityAt:I.string().datetime().nullable(),lastDeliveredAt:I.string().datetime().nullable(),locked:I.boolean(),redacted:I.boolean()}),aLA=I.object({channelId:I.string().nullable(),channelName:I.string().nullable(),threadTs:I.string().nullable(),permalink:I.string().nullable(),workspaceName:I.string().nullable()}),wLA=Kn.extend({slackChannels:I.array(aLA)}),FV=Kn.extend({delivery:I.record(I.string(),I.unknown()).nullable().optional()}),uw=I.object({projectId:I.string().uuid().optional().describe("Project to create the issue in. Auto-filled from CLI and SDK context when omitted."),name:I.string().trim().min(1).optional().describe("Stable issue name for indexing and mute matching. When omitted, the name is derived from contentMdx."),contentMdx:I.string().trim().min(1,"contentMdx cannot be empty").optional().describe("Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence). Required unless sample is true."),severity:I.enum(["low","medium","high","critical"]).default("medium").describe("Issue severity used for prioritization and triage."),componentId:I.string().uuid().optional().describe("UUID of a registered component this issue belongs to. Required unless sample is true: every issue must be attributed to a component. List components first and pick the best match; register one if none fits. Missing or unknown IDs are rejected."),statusStartedAt:I.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident began."),sample:I.boolean().optional().describe("When true, creates (or returns) the organization's onboarding sample issue for the target project using the curated sample payload, and the alert rides the normal issue_triggered broadcast to the configured delivery rules. Mutually exclusive with the content inputs (name, contentMdx, severity, componentId, statusStartedAt); projectId stays allowed. Idempotent per project: an existing sample attempt's issue is returned instead of creating a new one. Requires a user credential.")}),Uw=uw.superRefine((A,t)=>{if(A.sample){let g=[["name",A.name!==void 0],["contentMdx",A.contentMdx!==void 0],["severity",A.severity!=="medium"],["componentId",A.componentId!==void 0],["statusStartedAt",A.statusStartedAt!==void 0]];for(let[i,n]of g)if(n)t.addIssue({code:"custom",path:[i],message:`${i} is not allowed when sample is true.`})}else{if(!A.contentMdx)t.addIssue({code:"custom",path:["contentMdx"],message:"contentMdx is required"});if(!A.componentId)t.addIssue({code:"custom",path:["componentId"],message:"componentId is required"})}if(A.statusStartedAt&&!A.componentId)t.addIssue({code:"custom",path:["statusStartedAt"],message:"statusStartedAt requires componentId."})}),LV=I.object({issue:Kn,duplicateIssueId:I.string().uuid().optional().describe("Present when creation reused an existing open issue instead of creating a new one.")}),XY=I.object({projectId:I.string().uuid().optional().describe("Project to list issues for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:I.enum(["open","resolved","ignored"]).optional().describe("Filter by issue status."),severity:I.enum(["low","medium","high","critical"]).optional().describe("Filter by severity."),componentId:I.string().uuid().optional().describe("Filter by component ID.")}),SV=I.object({issues:I.array(Kn),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),HY=XY.extend({name:I.string().trim().optional().describe("Case-insensitive partial match on issue name."),includeDeliveryMetadata:I.union([I.boolean(),I.stringbool()]).default(!1).describe("When true, include raw delivery metadata in each issue.")}),lV=I.object({issues:I.array(FV),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),MV=HY.omit({limit:!0,cursor:!0,includeDeliveryMetadata:!0}),rLA=I.object({open:I.number().int().nonnegative(),resolved:I.number().int().nonnegative(),ignored:I.number().int().nonnegative()}),bLA=I.object({low:I.number().int().nonnegative(),medium:I.number().int().nonnegative(),high:I.number().int().nonnegative(),critical:I.number().int().nonnegative()}),YV=I.object({total:I.number().int().nonnegative(),byStatus:rLA,bySeverity:bLA,filters:I.object({name:I.string().nullable(),status:I.enum(["open","resolved","ignored"]).nullable(),severity:I.enum(["low","medium","high","critical"]).nullable(),componentId:I.string().uuid().nullable()})}),$V=I.object({issueId:I.string().uuid().describe("Issue ID to retrieve.")}),kV=I.object({issue:wLA}),GV=I.object({issueId:I.string().uuid().describe("Issue ID to resolve."),statusResolvedAt:I.string().datetime({offset:!0}).optional().describe("Optional ISO timestamp for when the linked status-page incident ended.")}),JV=I.object({issue:Kn}),TV=I.object({issueId:I.string().uuid().describe("Issue ID to ignore.")}),RV=I.object({issue:Kn}),fV=I.object({issueId:I.string().uuid().describe("Issue ID to reopen.")}),PV=I.object({issue:Kn}),zV=I.object({issueId:I.string().uuid().describe("Issue ID to reassign and reopen."),targetComponentId:I.string().uuid().describe("Active canonical component that will own the reopened issue.")}),OV=I.object({issue:Kn,sourceComponentId:I.string().uuid(),targetComponentId:I.string().uuid()}),vV=I.object({issueId:I.string().uuid().describe("Issue ID to mute.")}),ZV=I.object({issue:Kn}),WV=I.object({issueId:I.string().uuid().describe("Issue ID to unmute.")}),VV=I.object({issue:Kn}),He=L({operationId:"issues.create",description:"Create an issue in a project, returning an existing open issue when root-cause deduplication finds a match.",backend:"api",route:{method:"POST",path:"/issues",tags:["Issues"],successStatus:201},input:Uw,output:LV,pagination:"none",async:"sync"}),Fw=L({operationId:"issues.list",description:"List issues in a project, optionally filtered by status and severity.",backend:"api",route:{method:"GET",path:"/issues",tags:["Issues"]},input:XY,output:SV,pagination:"cursor",async:"sync"}),Lw=L({operationId:"issues.search",description:"Search issues in a project by name, status, and severity.",backend:"api",route:{method:"GET",path:"/issues/search",tags:["Issues"]},input:HY,output:lV,pagination:"cursor",async:"sync"}),Sw=L({operationId:"issues.count",description:"Count issues in a project with status and severity breakdowns.",backend:"api",route:{method:"GET",path:"/issues/count",tags:["Issues"]},input:MV,output:YV,pagination:"none",async:"sync"}),lw=L({operationId:"issues.get",description:"Get a single issue by ID.",backend:"api",route:{method:"GET",path:"/issues/{issueId}",tags:["Issues"]},input:$V,output:kV,pagination:"none",async:"sync"}),Mw=L({operationId:"issues.resolve",description:"Resolve an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/resolve",tags:["Issues"]},input:GV,output:JV,pagination:"none",async:"sync"}),Yw=L({operationId:"issues.ignore",description:"Ignore an open issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/ignore",tags:["Issues"]},input:TV,output:RV,pagination:"none",async:"sync"}),$w=L({operationId:"issues.reopen",description:"Reopen a resolved or ignored issue.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reopen",tags:["Issues"]},input:fV,output:PV,pagination:"none",async:"sync"}),kw=L({operationId:"issues.reassignAndReopen",description:"Atomically reassign a resolved or ignored issue to an active component and reopen it.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/reassign-and-reopen",tags:["Issues"]},input:zV,output:OV,pagination:"none",async:"sync"}),Gw=L({operationId:"issues.mute",description:"Mute an issue, suppressing future re-fires without changing status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/mute",tags:["Issues"]},input:vV,output:ZV,pagination:"none",async:"sync"}),Jw=L({operationId:"issues.unmute",description:"Unmute an issue, preserving its current status.",backend:"api",route:{method:"POST",path:"/issues/{issueId}/unmute",tags:["Issues"]},input:WV,output:VV,pagination:"none",async:"sync"}),NLA={count:Sw.contract,create:He.contract,list:Fw.contract,search:Lw.contract,get:lw.contract,resolve:Mw.contract,ignore:Yw.contract,reopen:$w.contract,reassignAndReopen:kw.contract,mute:Gw.contract,unmute:Jw.contract}});var jY,XV,Tw,Rw,HV,KV,jV,_V,fw,_Y,mV,xV,qV,dV,sV,pV,AX,tX,gX,nX,iX,QX,Ke,je,_e,me,xe,Pw,zw,Ow,vw,Zw,uLA,ULA;var mY=D(()=>{TA();VA();jY=/^[a-zA-Z0-9\s\-_]+$/,XV=I.object({id:I.string().uuid(),name:I.string(),expiresAt:I.string().datetime().nullable(),lastUsedAt:I.string().datetime().nullable(),createdAt:I.string().datetime()}),Tw=XV.extend({projectId:I.string().uuid(),dataSourceConnectionId:I.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source."),deactivatedAt:I.string().datetime().nullable().describe("Timestamp when this public key was deactivated.")}),Rw=XV.extend({projectId:I.string().uuid().nullable()}),HV=I.object({projectId:I.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),KV=I.object({publicKeys:I.array(Tw),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),jV=I.object({secretKeys:I.array(Rw),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),_V=I.object({projectId:I.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:I.string().uuid().describe("Key ID to fetch.")}),fw=I.object({publicKey:Tw}),_Y=I.object({secretKey:Rw}),mV=I.object({publicKey:Tw.extend({value:I.string()})}),xV=I.object({projectId:I.string().uuid().optional().describe("Project to ensure the log forwarding key for. Auto-filled from CLI and SDK context when omitted.")}),qV=I.object({secretKey:Rw.extend({value:I.string()})}),dV=I.object({projectId:I.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:I.string().uuid().describe("Key ID to update."),name:I.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(jY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:I.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),sV=I.object({params:I.object({keyId:I.string().uuid().describe("Public key ID to deactivate.")}),query:I.object({projectId:I.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),pV=fw,AX=I.void(),tX=I.object({organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),gX=I.object({keyId:I.string().uuid().describe("Key ID to fetch."),organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one.")}),nX=I.object({organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one."),projectId:I.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project. Omit for organization-wide access."),name:I.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(jY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:I.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),iX=I.object({keyId:I.string().uuid().describe("Key ID to update."),organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one."),name:I.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(jY,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:I.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),QX=I.object({params:I.object({keyId:I.string().uuid().describe("Key ID to delete.")}),query:I.object({organizationId:I.string().min(1).optional().describe("Organization whose keys the operation targets. Without it, the credential's active organization is used — for CLI user tokens that is the server session's organization, which can differ from the CLI's selected one.")}).default({})}).transform(({params:A,query:t})=>({...A,...t.organizationId!==void 0?{organizationId:t.organizationId}:{}})),Ke=L({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:HV,output:KV,pagination:"cursor",async:"sync",examples:[{name:"list-public-keys",input:{projectId:"11111111-1111-4111-8111-111111111111",limit:25},output:{publicKeys:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),je=L({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:_V,output:fw,pagination:"none",async:"sync",examples:[{name:"get-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),_e=L({operationId:"publicKeys.ensureLogForwarding",description:"Ensure a reusable project-scoped public key exists for CLI log forwarding.",backend:"api",route:{method:"POST",path:"/public-keys/log-forwarding/ensure",tags:["Public Keys"]},input:xV,output:mV,pagination:"none",async:"sync",examples:[{name:"ensure-log-forwarding-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"sazabi-cli-forward",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_public_example"}}}]}),me=L({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:dV,output:fw,pagination:"none",async:"sync",examples:[{name:"rename-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222",name:"Updated CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"Updated CLI forwarder",dataSourceConnectionId:null,deactivatedAt:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),xe=L({operationId:"publicKeys.deactivate",description:"Deactivate one public key within one project. Recently validated requests may continue to authenticate for a short period after deactivation.",backend:"api",route:{method:"POST",path:"/public-keys/{keyId}/deactivate",tags:["Public Keys"],inputStructure:"detailed"},input:sV,output:pV,pagination:"none",async:"sync"}),Pw=L({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:tX,output:jV,pagination:"cursor",async:"sync",examples:[{name:"list-secret-keys",input:{limit:25},output:{secretKeys:[{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),zw=L({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:gX,output:_Y,pagination:"none",async:"sync",examples:[{name:"get-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Ow=L({operationId:"secretKeys.create",description:"Create one secret key within the organization.",backend:"api",route:{method:"POST",path:"/secret-keys",successStatus:201,tags:["Secret Keys"]},input:nX,output:qV,pagination:"none",async:"sync",examples:[{name:"create-secret-key",input:{name:"CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_secret_example"}}}]}),vw=L({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:iX,output:_Y,pagination:"none",async:"sync",examples:[{name:"rename-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333",name:"Updated CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"Updated CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),Zw=L({operationId:"secretKeys.delete",description:"Delete one secret key within the organization.",backend:"api",route:{method:"DELETE",path:"/secret-keys/{keyId}",successStatus:204,tags:["Secret Keys"],inputStructure:"detailed"},input:QX,output:AX,pagination:"none",async:"sync"}),uLA={list:Ke.contract,get:je.contract,ensureLogForwarding:_e.contract,update:me.contract,deactivate:xe.contract},ULA={list:Pw.contract,get:zw.contract,create:Ow.contract,update:vw.contract,delete:Zw.contract}});var xY,oX,qY,Fc,FLA,LLA,SLA,lLA,MLA,YLA,$LA,kLA,GLA,JLA,dY,sY,pY,A$,t$,kEt;var IX=D(()=>{TA();VA();xY=I.string().uuid().describe("Log match expression ID."),oX=I.string().min(1).max(200).describe("Human-readable expression name."),qY=I.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),Fc=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),expression:qY,enabled:I.boolean(),compiledVersion:I.number().int(),linkedAutomationIds:I.array(I.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),FLA=I.object({projectId:I.string().uuid().optional().describe("Project to list expressions for. Auto-filled from CLI and SDK context when omitted.")}),LLA=I.object({expressions:I.array(Fc)}),SLA=I.object({expressionId:xY,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),lLA=I.object({expression:Fc}),MLA=I.object({projectId:I.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:oX,expression:qY,enabled:I.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),YLA=I.object({expression:Fc}),$LA=I.object({expressionId:xY,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:oX.optional(),expression:qY.optional(),enabled:I.boolean().optional().describe("Whether the expression is enabled.")}),kLA=I.object({expression:Fc}),GLA=I.object({expressionId:xY,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),JLA=I.object({expression:Fc}),dY=L({operationId:"logMatchExpressions.list",description:"List CEL log-match expressions in a project.",backend:"api",route:{method:"GET",path:"/log-match-expressions",tags:["Log match expressions"]},input:FLA,output:LLA,pagination:"none",async:"sync"}),sY=L({operationId:"logMatchExpressions.get",description:"Get a single log-match expression by ID.",backend:"api",route:{method:"GET",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:SLA,output:lLA,pagination:"none",async:"sync"}),pY=L({operationId:"logMatchExpressions.create",description:"Create a CEL log-match expression for a project.",backend:"api",route:{method:"POST",path:"/log-match-expressions",successStatus:201,tags:["Log match expressions"]},input:MLA,output:YLA,pagination:"none",async:"sync"}),A$=L({operationId:"logMatchExpressions.update",description:"Update a log-match expression's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/log-match-expressions/{expressionId}",tags:["Log match expressions"]},input:$LA,output:kLA,pagination:"none",async:"sync"}),t$=L({operationId:"logMatchExpressions.disable",description:"Disable a log-match expression so it stops matching logs.",backend:"api",route:{method:"POST",path:"/log-match-expressions/{expressionId}/disable",tags:["Log match expressions"]},input:GLA,output:JLA,pagination:"none",async:"sync"}),kEt={list:dY.contract,get:sY.contract,create:pY.contract,update:A$.contract,disable:t$.contract}});var BX="## Overview\n\nSend Claude Code session telemetry to Sazabi. Every session emits lifecycle events — prompts, tool calls, and model API requests with token counts and cost — as OTLP log records.\n\n## How it works\n\nClaude Code has a first-party OTLP exporter. Set a handful of environment variables in `~/.claude/settings.json` pointing the exporter at your Sazabi intake URL, and Claude Code sends telemetry over OTLP/HTTP on its own — no separate SDK or code changes required.\n\n## Streams\n\n- **Session events** — `claude_code.user_prompt`, `claude_code.tool_result`, `claude_code.api_request`, and related events, with attributes for `prompt`, `model`, `session.id`, `user.email`, token counts, and cost.\n\n## Limitations\n\n- Claude Code **metrics** are not ingested; only the logs exporter is supported.\n";var eX=()=>{};var CX=`---
|
|
106
106
|
name: claude-code-log-source-setup
|
|
107
107
|
description: Export Claude Code session telemetry to a Sazabi project. Use when the user wants to "connect Claude Code", "set up Claude Code telemetry", "ingest Claude Code events", "send my coding agent telemetry to Sazabi", or after running \`sazabi log-sources skill --provider claude_code\`. Points Claude Code's built-in OTLP exporter at Sazabi's keyed intake host — no SDK or code changes required.
|
|
108
108
|
surface: log-source
|
|
@@ -8706,7 +8706,7 @@ Connect 1Password so Sazabi agents can work with your vaults and secrets through
|
|
|
8706
8706
|
`)}],evidenceHints:["drive.google.com / docs.google.com links, or Google Drive file IDs in runbooks","googleapis / google-auth-library packages, or GOOGLE_* / GDRIVE_* environment variables","README/runbooks naming Google Drive as a document or asset store"],helpText:"Search and read files and metadata in a Google Drive through Google's hosted MCP server. Coming soon — requires a Sazabi-provisioned Google OAuth client and isn't self-serve connectable yet."})});var LBA;var SBA=D(()=>{hA();LBA=V({id:"grafana",label:"Grafana Cloud",iconKey:"grafana",defaultServerUrl:"https://mcp.grafana.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"grafana",callbackPathSegment:"grafana",authorizationUrl:"https://mcp.grafana.com/mcp/oauth/authorize",tokenUrl:"https://mcp.grafana.com/mcp/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.grafana.com/mcp/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"grafana:read",label:"Read",description:"Read Grafana dashboards, panels, metrics, logs, traces, alerts, and incidents."},{value:"grafana:write",label:"Write",description:"Create and modify Grafana resources. Write tools require explicit approval per your organization's tool policy."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["grafana.net / grafana.com links, Grafana dashboards, or GRAFANA_* environment variables","Prometheus, Loki, Tempo, or Mimir data sources wired into Grafana","README/runbooks naming Grafana for dashboards, metrics, logs, traces, or alerts"],helpText:"Browse Grafana dashboards, metrics, logs, traces, and alerts across your Grafana Cloud stack."})});var lBA;var MBA=D(()=>{hA();lBA=V({id:"granola",label:"Granola",iconKey:"granola",defaultServerUrl:"https://mcp.granola.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"granola",callbackPathSegment:"granola",authorizationUrl:"https://mcp-auth.granola.ai/oauth2/authorize",tokenUrl:"https://mcp-auth.granola.ai/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp-auth.granola.ai/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["granola.ai meeting links, Granola notes exports, or GRANOLA_* environment variables","Incident, customer-call, or product-feedback docs naming Granola","Operational runbooks that refer to meeting notes or transcripts in Granola"],helpText:"Search and browse Granola meeting notes, transcripts, and folders."})});var YBA;var $BA=D(()=>{hA();YBA=V({id:"happenstance",label:"Happenstance",iconKey:"happenstance",defaultServerUrl:"https://happenstance.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"happenstance",callbackPathSegment:"happenstance",authorizationUrl:"https://happenstance.ai/oauth/authorize",tokenUrl:"https://clerk.happenstance.ai/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://clerk.happenstance.ai/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"profile",label:"Profile",description:"Read your Happenstance profile."},{value:"email",label:"Email",description:"Read the email associated with your Happenstance account."},{value:"offline_access",label:"Offline access",description:"Keep the connection alive by refreshing access without re-authentication."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["happenstance.ai links or references to a Happenstance network/graph","HAPPENSTANCE_* environment variables or scripts calling Happenstance APIs","Docs naming Happenstance as the people/relationship search tool"],helpText:"Search your Happenstance network to find and get introduced to people."})});var kBA;var GBA=D(()=>{hA();kBA=V({id:"honeycomb",label:"Honeycomb",iconKey:"honeycomb",defaultServerUrl:"https://mcp.honeycomb.io/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"honeycomb",callbackPathSegment:"honeycomb",authorizationUrl:"https://ui.honeycomb.io/oauth/authorize",tokenUrl:"https://ui.honeycomb.io/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://ui.honeycomb.io/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp:read",label:"Read",description:"Query Honeycomb environments, datasets, columns, boards, triggers, SLOs, and run queries."},{value:"mcp:write",label:"Write",description:"Create and update Honeycomb boards, triggers, and other resources."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.honeycomb.io/mcp"},{label:"Europe (EU)",serverUrl:"https://mcp.eu1.honeycomb.io/mcp",authorizationUrl:"https://ui.eu1.honeycomb.io/oauth/authorize",tokenUrl:"https://ui.eu1.honeycomb.io/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://ui.eu1.honeycomb.io/oauth/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["honeycomb.io URLs, HONEYCOMB_API_KEY / HONEYCOMB_DATASET environment variables, or honeycomb:// dataset URIs","libhoney, @honeycombio packages, or OpenTelemetry exporters pointed at api.honeycomb.io / api.eu1.honeycomb.io","README/runbooks naming Honeycomb as the observability or tracing provider"],helpText:"Query Honeycomb environments, datasets, columns, boards, and triggers, run queries, and create or update boards and triggers. Choose the US or EU region when connecting."})});var JBA;var TBA=D(()=>{hA();JBA=V({id:"incident-io",label:"incident.io",iconKey:"incident-io",defaultServerUrl:"https://mcp.incident.io/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"incident-io",callbackPathSegment:"incident-io",authorizationUrl:"https://app.incident.io/auth/plugin/authorize",tokenUrl:"https://app.incident.io/auth/plugin/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.incident.io/mcp/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["incident.io alert-source URLs, escalation docs, or incident IDs","INCIDENT_IO_* environment variables or webhooks into incident.io","README/runbooks naming incident.io for incidents, alerts, or on-call"],helpText:"Browse incidents, alerts, and on-call.",skill:"incident-io",setupSkill:"incident-io-setup"})});var RBA;var fBA=D(()=>{Tt();hA();RBA=V({id:"intercom",label:"Intercom",iconKey:"intercom",defaultServerUrl:"https://mcp.intercom.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Intercom config, INTERCOM_* environment variables, or intercom-client packages","Support inbox, conversations, help center, or customer messaging docs naming Intercom","README/docs naming Intercom for support threads or customer conversations"],helpText:"Read Intercom support conversations, contacts, and help center content using an Intercom API access token. US-hosted Intercom workspaces only.",setupGroups:[{id:"developer-app",title:"Open Intercom developer settings",description:"Use an Intercom app with an access token for the workspace you want to connect.",body:"In Intercom, go to **Settings > Integrations > Developer Hub**, open (or create) an app for your workspace, and confirm it has the permissions you want agents to use. The hosted MCP server lives at `https://mcp.intercom.com/mcp` and currently supports US-hosted Intercom workspaces only."},{id:"access-token",title:"Copy your access token",description:"Copy the Intercom API access token the hosted MCP server will use.",body:"From your Intercom app's **Authentication** section, copy the access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:teA,normalizeHeaders:AeA})});var PBA;var zBA=D(()=>{Tt();hA();PBA=V({id:"langfuse",label:"Langfuse",iconKey:"langfuse",defaultServerUrl:"https://us.cloud.langfuse.com/api/public/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",regions:[{label:"United States (US)",serverUrl:"https://us.cloud.langfuse.com/api/public/mcp"},{label:"Europe (EU)",serverUrl:"https://cloud.langfuse.com/api/public/mcp"},{label:"Asia Pacific (JP)",serverUrl:"https://jp.cloud.langfuse.com/api/public/mcp"}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Langfuse SDK usage (langfuse, langfuse-langchain) or @langfuse packages","LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY / LANGFUSE_HOST environment variables","README/docs naming Langfuse as the LLM tracing, evaluation, or observability provider"],helpText:"Query Langfuse traces, observations, metrics, scores, comments, and prompts using project API keys.",setupGroups:[{id:"region",title:"Pick your Langfuse Cloud region",description:"Select the Langfuse Cloud region that hosts your project (or use the custom connector for a self-hosted deployment).",body:"Langfuse Cloud is region-scoped: US (`https://us.cloud.langfuse.com`), EU (`https://cloud.langfuse.com`), or JP (`https://jp.cloud.langfuse.com`). Choose the region matching your Langfuse account; the hosted MCP server lives at `/api/public/mcp` on that host."},{id:"api-keys",title:"Create project API keys",description:"Generate the Langfuse project API key pair the hosted MCP server will use.",body:"In Langfuse, open **Project settings → API keys** and create a new key pair. Copy the Public key (`pk-lf-...`) and Secret key (`sk-lf-...`). Sazabi combines them into an HTTP Basic `Authorization` header (`Basic base64(publicKey:secretKey)`) and sends it to the MCP server. Paste the combined `Authorization` value into Sazabi.",fieldKeys:["authorization"]}],validateCredentials:weA,normalizeHeaders:DeA})});var OBA;var vBA=D(()=>{hA();OBA=V({id:"langsmith",label:"LangSmith",iconKey:"langsmith",defaultServerUrl:"https://api.smith.langchain.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"langsmith",callbackPathSegment:"langsmith",authorizationUrl:"https://api.smith.langchain.com/oauth/authorize",tokenUrl:"https://api.smith.langchain.com/oauth/token",resourceUrl:"https://api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,regions:[{label:"GCP United States (US)",serverUrl:"https://api.smith.langchain.com/mcp"},{label:"GCP Europe (EU)",serverUrl:"https://eu.api.smith.langchain.com/mcp",authorizationUrl:"https://eu.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://eu.api.smith.langchain.com/oauth/token",resourceUrl:"https://eu.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://eu.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},{label:"GCP Asia Pacific (APAC)",serverUrl:"https://apac.api.smith.langchain.com/mcp",authorizationUrl:"https://apac.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://apac.api.smith.langchain.com/oauth/token",resourceUrl:"https://apac.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://apac.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},{label:"AWS United States (US)",serverUrl:"https://aws.api.smith.langchain.com/mcp",authorizationUrl:"https://aws.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://aws.api.smith.langchain.com/oauth/token",resourceUrl:"https://aws.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://aws.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["LANGSMITH_* or LANGCHAIN_* environment variables, or langsmith SDK usage","LangSmith tracing projects, runs, datasets, or evaluations","README/docs naming LangSmith for LLM tracing, evals, or observability"],helpText:"Query LangSmith tracing projects, runs, datasets, and evaluations to investigate LLM application behavior. Choose the region where your LangSmith organization lives when connecting."})});var ZBA;var WBA=D(()=>{hA();ZBA=V({id:"linear",label:"Linear",iconKey:"linear",defaultServerUrl:"https://mcp.linear.app/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"linear",callbackPathSegment:"linear",authorizationUrl:"https://mcp.linear.app/authorize",tokenUrl:"https://mcp.linear.app/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.linear.app/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Linear issues, projects, teams, comments, and related data."},{value:"write",label:"Write",description:"Create and update Linear issues, comments, and project data."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"linear",setupSkill:"linear-setup",evidenceHints:["linear.app URLs, Linear issue keys, or team/project IDs in docs","LINEAR_* environment variables or scripts that call Linear APIs","README/runbooks naming Linear as the issue tracker or planning system"],helpText:"Browse and search Linear issues and projects, and create or update issues, comments, and project data."})});var VBA;var XBA=D(()=>{hA();VBA=V({id:"logfire",label:"Pydantic Logfire",iconKey:"logfire",defaultServerUrl:"https://logfire-us.pydantic.dev/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"logfire",callbackPathSegment:"logfire",authorizationUrl:"https://logfire-us.pydantic.dev/api/oauth/authorize",tokenUrl:"https://logfire-us.pydantic.dev/api/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://logfire-us.pydantic.dev/api/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"organization:read_channel"},{value:"project:read"},{value:"project:read_alert"},{value:"project:read_dashboard"},{value:"project:read_variables"}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Pydantic Logfire config, LOGFIRE_* environment variables, or logfire SDK packages","Python/Pydantic observability docs naming Logfire","Alerts, dashboards, or traces hosted in Logfire"],helpText:"Query Pydantic Logfire traces, metrics, and exceptions, and browse projects, alerts, and dashboards. Hosted on Logfire's US region (logfire-us.pydantic.dev)."})});var HBA;var KBA=D(()=>{hA();HBA=V({id:"mercury",label:"Mercury",iconKey:"mercury",defaultServerUrl:"https://mcp.mercury.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"mercury",callbackPathSegment:"mercury",authorizationUrl:"https://mcp.mercury.com/authorize",tokenUrl:"https://mcp.mercury.com/token",resourceUrl:"https://mcp.mercury.com/mcp",omitScopeFromAuthorizationUrl:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.mercury.com/register",tokenEndpointAuthMethod:"client_secret_basic",includeScopesInRegistration:!0}},getAvailableScopes:async()=>[{value:"read",label:"Read access",description:"Read Mercury accounts, cards, recipients, transactions, treasury, and organization data."},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!1},skill:"mercury",setupSkill:"mercury-setup",evidenceHints:["Mercury dashboard links, mercury.com references, or Mercury API usage","MERCURY_* environment variables or docs mentioning Mercury banking","Treasury, card, account, recipient, or transaction workflows backed by Mercury"],helpText:"Search Mercury banking data including accounts, cards, recipients, transactions, treasury, and organization records. Read-only: this connection cannot move money or change your Mercury account."})});var jBA;var _BA=D(()=>{hA();jBA=V({id:"neon",label:"Neon",iconKey:"neon",defaultServerUrl:"https://mcp.neon.tech/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"neon",callbackPathSegment:"neon",authorizationUrl:"https://mcp.neon.tech/api/authorize",tokenUrl:"https://mcp.neon.tech/api/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.neon.tech/api/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Neon projects, branches, databases, and run queries."},{value:"write",label:"Write",description:"Create and modify Neon projects, branches, and databases."},{value:"*",label:"Full access",description:"All access - read and manage every Neon resource the connected account can reach."}],getUrlConfiguration:async()=>({docsUrl:"https://neon.com/docs/ai/neon-mcp-server",instructions:"Copy the hosted MCP server URL below. Optional: to narrow access, append ?readonly=true, &projectId=<id>, and/or &category=<groups> (see the Neon MCP docs), then copy the edited URL.",defaultServerUrl:"https://mcp.neon.tech/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Neon connection strings, neon.tech hosts, or @neondatabase/serverless packages","DATABASE_URL/POSTGRES_URL values documented as Neon","README/docs naming Neon as the Postgres provider"],helpText:"Manage Neon projects, branches, databases, and run SQL queries."})});var mBA;var xBA=D(()=>{hA();mBA=V({id:"notion",label:"Notion",iconKey:"notion",defaultServerUrl:"https://mcp.notion.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"notion",callbackPathSegment:"notion",authorizationUrl:"https://mcp.notion.com/authorize",tokenUrl:"https://mcp.notion.com/token",resourceUrl:"https://mcp.notion.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://mcp.notion.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"default",label:"Default",description:"Access Notion pages, databases, and workspace content via MCP."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"notion",setupSkill:"notion-setup",evidenceHints:["notion.so URLs, Notion page IDs, or database IDs in docs","NOTION_* environment variables or scripts that call Notion APIs","README/runbooks naming Notion as the wiki or knowledge base"],helpText:"Browse and manage Notion pages, databases, and workspace content. During authorization, choose which pages and databases to share with the connection."})});var qBA;var dBA=D(()=>{hA();qBA=V({id:"1password",label:"1Password",iconKey:"onepassword",defaultServerUrl:"https://developer.1password.com/get-started/secure-ai-access",transport:"streamable-http",authMode:"none",availability:"disabled",getUrlConfiguration:async()=>null,evidenceHints:["1Password service-account tokens (ops_...), op CLI usage, or OP_SERVICE_ACCOUNT_TOKEN","1password.com / *.1password.com references, or op:// secret references","README/docs naming 1Password as the secrets manager or vault"],helpText:"Access 1Password via its documented secure AI access options. A general-purpose hosted MCP server is not available today; use the 1Password CLI (op) sandbox preset instead."})});var sBA;var pBA=D(()=>{hA();sBA=V({id:"paper",label:"Paper MCP",iconKey:"paper",defaultServerUrl:"http://127.0.0.1:29979/mcp",transport:"streamable-http",authMode:"none",availability:"disabled",getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["paper.design URLs, Paper Desktop app references, or PAPER_* environment variables","Design files, component libraries, or design-system docs naming Paper","HTML-to-PDF slide or presentation workflows that reference Paper"],helpText:"Read and write Paper design files, including nodes, selections, text content, and design-system elements. Coming soon — Paper's MCP server runs on desktop localhost and can't be reached by hosted Sazabi agents yet."})});var AhA;var thA=D(()=>{hA();AhA=V({id:"plain",label:"Plain",iconKey:"plain",defaultServerUrl:"https://mcp.plain.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"plain",callbackPathSegment:"plain",authorizationUrl:"https://signin.auth.plain.com/oauth2/authorize",tokenUrl:"https://signin.auth.plain.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://signin.auth.plain.com/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["plain.com links, Plain customer/thread IDs, or PLAIN_* environment variables","Support inbox, customer thread, or tenant docs naming Plain","Code or scripts syncing customers, tenants, or support threads with Plain"],helpText:"Search and manage Plain support threads, customers, and tenants.",skill:"plain",setupSkill:"plain-setup"})});var ghA;var nhA=D(()=>{hA();ghA=V({id:"planetscale",label:"PlanetScale",iconKey:"planetscale",defaultServerUrl:"https://mcp.pscale.dev/mcp/planetscale",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"planetscale",callbackPathSegment:"planetscale",authorizationUrl:"https://app.planetscale.com/oauth/authorize",tokenUrl:"https://auth.planetscale.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://auth.planetscale.com/oauth/registration",tokenEndpointAuthMethod:"client_secret_basic"}},getAvailableScopes:async()=>[{value:"read_databases"},{value:"read_user"},{value:"read_organization"},{value:"write_databases"},{value:"write_organization"}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["PlanetScale connection strings, pscale CLI config, or planetscale.com links","PLANETSCALE_* or DATABASE_URL values documented as PlanetScale","README/docs naming PlanetScale for MySQL, branching, or schema changes"],helpText:"Query PlanetScale databases, inspect schema, and browse Insights data.",skill:"planetscale",setupSkill:"planetscale-setup"})});var ihA;var QhA=D(()=>{hA();ihA=V({id:"posthog",label:"PostHog",iconKey:"posthog",defaultServerUrl:"https://mcp.posthog.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"posthog",callbackPathSegment:"posthog",authorizationUrl:"https://oauth.posthog.com/oauth/authorize/",tokenUrl:"https://oauth.posthog.com/oauth/token/",dynamicClientRegistration:{registrationEndpoint:"https://oauth.posthog.com/oauth/register/",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"query:read"},{value:"insight:read"},{value:"insight:write"},{value:"feature_flag:read"},{value:"feature_flag:write"},{value:"experiment:read"},{value:"experiment:write"},{value:"dashboard:read"},{value:"dashboard:write"},{value:"event_definition:read"},{value:"event_definition:write"},{value:"person:read"},{value:"user:read",required:!0},{value:"user:write"},{value:"organization:read",required:!0},{value:"project:read",required:!0},{value:"project:write"},{value:"survey:read"},{value:"survey:write"},{value:"error_tracking:read"},{value:"logs:read"},{value:"tracing:read"},{value:"error_tracking:write"},{value:"session_recording:read"},{value:"session_recording_playlist:read"},{value:"alert:read"},{value:"activity_log:read"},{value:"annotation:read"},{value:"cohort:read"},{value:"hog_function:read"}],getUrlConfiguration:async()=>({docsUrl:"https://posthog.com/docs/model-context-protocol/faq",instructions:"Copy the hosted MCP server URL below. Optional: to expose only some tools, append ?features=<groups> or ?tools=<names> (see the PostHog MCP docs), then copy the edited URL.",defaultServerUrl:"https://mcp.posthog.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["posthog-js, posthog-node, POSTHOG_* or NEXT_PUBLIC_POSTHOG_* environment variables","Feature flag, experiment, session replay, or product analytics code using PostHog","README/docs naming PostHog for analytics, flags, experiments, logs, or tracing"],helpText:"Query PostHog analytics, feature flags, and experiments.",skill:"posthog",setupSkill:"posthog-setup"})});var ohA;var IhA=D(()=>{hA();ohA=V({id:"pylon",label:"Pylon",iconKey:"pylon",defaultServerUrl:"https://mcp.usepylon.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"pylon",callbackPathSegment:"pylon",authorizationUrl:"https://o.auth.usepylon.com/oauth2/authorize",tokenUrl:"https://o.auth.usepylon.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://o.auth.usepylon.com/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["usepylon.com links, Pylon issue/account IDs, or PYLON_* environment variables","Customer support workflows or account runbooks naming Pylon","Code or scripts syncing support issues, accounts, or contacts with Pylon"],helpText:"Search and manage Pylon support issues, accounts, and contacts.",skill:"pylon",setupSkill:"pylon-setup"})});var ehA;var BhA=D(()=>{hA();ehA=V({id:"railway",label:"Railway",iconKey:"railway",defaultServerUrl:"https://mcp.railway.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"railway",callbackPathSegment:"railway",authorizationUrl:"https://backboard.railway.com/oauth/auth",tokenUrl:"https://backboard.railway.com/oauth/token",resourceUrl:"https://mcp.railway.com",dynamicClientRegistration:{registrationEndpoint:"https://backboard.railway.com/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"profile",required:!0},{value:"email",required:!0},{value:"offline_access",required:!0},{value:"workspace:member",label:"Workspace access",description:"Read and manage Railway projects, services, deployments, variables, and logs in the workspaces the connected account belongs to."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"railway",setupSkill:"railway-setup",evidenceHints:["railway.app / railway.com links, RAILWAY_* environment variables, or a railway.json/railway.toml in the repo","Deploy workflows or runbooks naming Railway as the hosting/PaaS provider","Railway project/service/environment IDs referenced in docs or CI"],helpText:"Manage Railway projects, services, deployments, variables, and logs."})});var hhA;var ChA=D(()=>{Tt();hA();hhA=V({id:"render",label:"Render",iconKey:"render",defaultServerUrl:"https://mcp.render.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["render.com links, RENDER_* environment variables, or a render.yaml in the repo","Deploy workflows or runbooks naming Render as the hosting/PaaS provider","Render service/deploy IDs referenced in docs or CI"],helpText:"Manage Render services, deploys, environment variables, logs, and metrics.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Render API key Sazabi will send to Render's hosted MCP endpoint.",body:"Create a Render [API key](https://dashboard.render.com/settings/api-keys) in **Account Settings > API Keys**, then paste it below. Note: a Render API key is account-wide and can manage and deploy every service in the account, so treat it as a powerful credential.",fieldKeys:["apiKey"]}],validateCredentials:neA,normalizeHeaders:geA})});var chA;var EhA=D(()=>{Tt();hA();chA=V({id:"rentahuman",label:"RentAHuman",iconKey:"rentahuman",defaultServerUrl:"https://rentahuman.ai/api/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["rentahuman.ai, RENTAHUMAN_API_KEY environment variables, or RentAHuman API keys","rentahuman-mcp usage or a rentahuman.ai/api/mcp server URL in MCP client config","README/docs naming RentAHuman for hiring humans or human-in-the-loop work"],helpText:"Hire and coordinate human workers for real-world tasks with RentAHuman's hosted MCP server using an API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the RentAHuman API key Sazabi will send to its hosted MCP endpoint.",body:"Create or copy an API key from the [RentAHuman API keys page](https://rentahuman.ai/account/api-keys), then paste it below. Sazabi stores it securely and sends it as the `X-API-Key` header. Note: this key can hire workers and trigger payments, so keep the per-connection read-only toggle on unless you intend the agent to act.",fieldKeys:["apiKey"]}],validateCredentials:CeA,normalizeHeaders:heA,skill:"rentahuman",setupSkill:"rentahuman-setup"})});var yhA;var DhA=D(()=>{Tt();hA();yhA=V({id:"resend",label:"Resend",iconKey:"resend",defaultServerUrl:"https://mcp.resend.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Resend email API usage, RESEND_API_KEY environment variables, or the resend SDK","resend-mcp usage or a mcp.resend.com server URL in MCP client config","README/docs naming Resend for transactional or marketing email"],helpText:"Send transactional emails and manage domains, contacts, and audiences with Resend's hosted MCP server using your Resend API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Resend API key Sazabi will send to Resend's hosted MCP endpoint.",body:"Create or copy an API key from the [Resend dashboard](https://resend.com/api-keys), then paste it below. Choose the key's permission to match what you want the agent to do: **Sending access** (send emails only, the safer choice) or **Full access** (also manage domains, contacts, and audiences). Sazabi stores it securely and sends it as the `Authorization: Bearer` token to Resend's MCP endpoint (`https://mcp.resend.com/mcp`).",fieldKeys:["apiKey"]}],validateCredentials:beA,normalizeHeaders:reA,skill:"resend",setupSkill:"resend-setup"})});var ahA;var whA=D(()=>{Tt();hA();ahA=V({id:"respan",label:"Respan",iconKey:"respan",defaultServerUrl:"https://mcp.respan.ai/api/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Respan / Keywords AI observability usage, RESPAN_API_KEY environment variables, or the respan-ai / keywordsai SDK","respan-mcp usage or a mcp.respan.ai server URL in MCP client config","README/docs naming Respan or Keywords AI for LLM logs, traces, or prompt management"],helpText:"Query LLM request logs, traces, prompts, and customer data from your Respan account using Respan's hosted MCP server and your Respan API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Respan API key Sazabi will send to Respan's hosted MCP endpoint.",body:"Create or copy an API key from the [Respan dashboard](https://platform.respan.ai/platform/api/api-keys), then paste it below. Sazabi stores it securely and sends it as the `Authorization: Bearer` token to Respan's MCP endpoint (`https://mcp.respan.ai/api/mcp`).",fieldKeys:["apiKey"]}],validateCredentials:ueA,normalizeHeaders:NeA,skill:"respan",setupSkill:"respan-setup"})});var rhA;var bhA=D(()=>{hA();rhA=V({id:"salesforce",label:"Salesforce",iconKey:"salesforce",defaultServerUrl:"https://api.salesforce.com/platform/mcp/v1/platform/sobject-all",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"salesforce",callbackPathSegment:"salesforce",authorizationUrl:"https://login.salesforce.com/services/oauth2/authorize",tokenUrl:"https://login.salesforce.com/services/oauth2/token"},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"mcp_api",label:"MCP API access",description:"Access Salesforce data and metadata (sObjects, Apex invocable actions, Flows) through the hosted MCP server. Salesforce hosted MCP External Client Apps require the MCP-specific `mcp_api` scope."},{value:"refresh_token",label:"Offline access",description:"Refresh the access token without requiring the user to re-authenticate.",required:!0}],capabilityOverrides:{allowWriteTools:!0},setupGroups:[{id:"external-client-app",title:"Register an External Client App in Salesforce",description:"Salesforce hosted MCP servers do not support automatic client registration. An admin must create an External Client App (ECA) in the org and enable it for the hosted MCP server.",body:["1. In Salesforce Setup, open **App Manager** and create a new **External Client App**.","2. Enable OAuth, add the **mcp_api** and **refresh_token (offline access)** scopes, and require PKCE.","3. Set the callback URL to the Sazabi Salesforce MCP callback URL shown on this page.","4. Enable the app for your hosted MCP server under **Setup → MCP Servers**.","5. Provide the generated **Consumer Key (Client ID)** and **Consumer Secret (Client Secret)** to your Sazabi deployment configuration."].join(`
|
|
8707
8707
|
`)}],evidenceHints:["force.com / my.salesforce.com URLs, SALESFORCE_* or SFDC_* environment variables, or sf/sfdx CLI usage","jsforce, simple-salesforce, or @salesforce packages","README/runbooks naming Salesforce as the CRM or system of record"],helpText:"Query Salesforce data and metadata, and run Apex invocable actions and Flows exposed by a hosted MCP server. Coming soon — a Salesforce admin registers an External Client App in your org and Sazabi provisions its credentials, so it isn't self-serve connectable yet."})});var NhA;var uhA=D(()=>{hA();NhA=V({id:"secureframe",label:"Secureframe",iconKey:"secureframe",defaultServerUrl:"https://mcp.secureframe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"secureframe",callbackPathSegment:"secureframe",authorizationUrl:"https://mcp.secureframe.com/oauth/authorize",tokenUrl:"https://mcp.secureframe.com/oauth/token",resourceUrl:"https://mcp.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp.secureframe.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp",label:"MCP Access",description:"Query and manage Secureframe compliance data, controls, tests, vendors, risks, and framework requirements."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.secureframe.com"},{label:"United Kingdom (UK)",serverUrl:"https://mcp-uk.secureframe.com",authorizationUrl:"https://mcp-uk.secureframe.com/oauth/authorize",tokenUrl:"https://mcp-uk.secureframe.com/oauth/token",resourceUrl:"https://mcp-uk.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp-uk.secureframe.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["secureframe.com URLs, SECUREFRAME_API_KEY / SECUREFRAME_API_SECRET environment variables","SOC 2, ISO 27001, HIPAA, PCI DSS, GDPR, or NIST compliance frameworks and controls","README/docs or compliance runbooks naming Secureframe for automated compliance and continuous monitoring"],helpText:"Query and manage Secureframe compliance data, controls, automated tests, vendors, risks, and framework requirements. Choose the US or UK region when connecting.",skill:"secureframe",setupSkill:"secureframe-setup"})});var UhA;var FhA=D(()=>{hA();UhA=V({id:"sentry",label:"Sentry",iconKey:"sentry",defaultServerUrl:"https://mcp.sentry.dev/mcp",serverUrlPathSuffixMaxSegments:2,transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"sentry",callbackPathSegment:"sentry",authorizationUrl:"https://mcp.sentry.dev/oauth/authorize",tokenUrl:"https://mcp.sentry.dev/oauth/token",useServerUrlAsResource:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.sentry.dev/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"org:read"},{value:"project:write"},{value:"team:write"},{value:"event:write"}],getUrlConfiguration:async()=>({docsUrl:"https://mcp.sentry.dev/",instructions:"Copy the hosted MCP server URL below. Optional: to scope this connection to one organization or project, copy a path-scoped URL from the Sentry MCP page (e.g. .../mcp/your-org).",defaultServerUrl:"https://mcp.sentry.dev/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["@sentry packages, sentry.properties, SENTRY_* environment variables, or sentry-cli usage","Sentry.init calls, release/deploy automation, or Sentry alert docs","README/docs naming Sentry as the error tracking provider"],helpText:"Browse Sentry organizations, teams, projects, and events."})});var LhA;var ShA=D(()=>{Tt();hA();LhA=V({id:"signoz",label:"SigNoz",iconKey:"signoz",defaultServerUrl:"https://mcp.us.signoz.cloud/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["SigNoz config, SIGNOZ_* environment variables, or signoz.io links","OpenTelemetry Collector exporting to SigNoz, or a signoz docker-compose / self-hosted deployment","README/docs naming SigNoz for metrics, logs, traces, alerts, or dashboards"],helpText:"Query SigNoz metrics, logs, traces, alerts, and dashboards to investigate production issues.",setupGroups:[{id:"instance",title:"Find your SigNoz instance",description:"Point Sazabi at the SigNoz instance whose telemetry you want to query.",body:"For SigNoz Cloud, use the regional MCP endpoint for your account, such as `https://mcp.us.signoz.cloud/mcp` (replace the region as needed). For self-hosted SigNoz, use your instance's MCP endpoint and set the SigNoz base URL below so the server knows which instance to target.",fieldKeys:["signozUrl"]},{id:"api-key",title:"Create an API key",description:"Create or copy the SigNoz API key Sazabi will send to SigNoz's MCP endpoint.",body:"In SigNoz, go to **Settings > API Keys** and create or copy an API key. Alert, dashboard, and notification-channel tools require an admin-level key. Paste it below.",fieldKeys:["apiKey"]}],validateCredentials:QeA,normalizeHeaders:ieA})});var lhA;var MhA=D(()=>{hA();lhA=V({id:"slack",label:"Slack",iconKey:"slack",defaultServerUrl:"https://mcp.slack.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"slack",callbackPathSegment:"slack",authorizationUrl:"https://slack.com/oauth/v2_user/authorize",tokenUrl:"https://slack.com/api/oauth.v2.user.access"},getAvailableScopes:async()=>[{value:"search:read.public"},{value:"search:read.private"},{value:"search:read.mpim"},{value:"search:read.im"},{value:"search:read.files"},{value:"search:read.users"},{value:"canvases:read"},{value:"users:read"},{value:"users:read.email"}],getUrlConfiguration:async()=>null,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Slack app manifests, bot/webhook URLs, SLACK_* environment variables, or slack.com links","Runbooks that route incidents, alerts, or deploy notices through Slack","Code or docs naming Slack channels for operational triage"],helpText:"Browse Slack messages, files, and threads. Coming soon — requires backend OAuth plumbing for user_scope and isn't self-serve connectable yet.",skill:"slack",setupSkill:"slack-setup"})});var YhA;var $hA=D(()=>{hA();YhA=V({id:"stripe",label:"Stripe MCP",iconKey:"stripe",defaultServerUrl:"https://mcp.stripe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"stripe",callbackPathSegment:"stripe",authorizationUrl:"https://access.stripe.com/mcp/oauth2/authorize",tokenUrl:"https://access.stripe.com/mcp/oauth2/token",resourceUrl:"https://mcp.stripe.com",dynamicClientRegistration:{registrationEndpoint:"https://access.stripe.com/mcp/oauth2/register",tokenEndpointAuthMethod:"none"},defaultAccessTokenTtlSeconds:21600},getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Access the Stripe MCP server tools for the connected account.",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Stripe dashboard URLs, `sk_`/`rk_`/`pk_` API keys, or Stripe object IDs (cus_, pi_, ch_)","STRIPE_* environment variables or code that imports the `stripe` SDK","README/runbooks naming Stripe for billing, payments, or subscriptions"],helpText:"Query and manage Stripe payments, customers, and billing."})});var khA;var GhA=D(()=>{hA();khA=V({id:"supabase",label:"Supabase",iconKey:"supabase",defaultServerUrl:"https://mcp.supabase.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"supabase",callbackPathSegment:"supabase",authorizationUrl:"https://api.supabase.com/v1/oauth/authorize",tokenUrl:"https://api.supabase.com/v1/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://api.supabase.com/platform/oauth/apps/register",tokenEndpointAuthMethod:"client_secret_post"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"analytics:read"},{value:"auth:read"},{value:"auth:write"},{value:"database:read"},{value:"database:write"},{value:"domains:read"},{value:"domains:write"},{value:"edge_functions:read"},{value:"edge_functions:write"},{value:"environment:read"},{value:"environment:write"},{value:"organizations:read"},{value:"projects:read"},{value:"projects:write"},{value:"rest:read"},{value:"rest:write"},{value:"secrets:read"},{value:"secrets:write"},{value:"storage:read"}],getUrlConfiguration:async()=>({docsUrl:"https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool",instructions:"Choose your project and options in the Supabase configuration panel, then copy the generated Server URL.",defaultServerUrl:"https://mcp.supabase.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["supabase/ directory, supabase/config.toml, or @supabase packages","SUPABASE_* or NEXT_PUBLIC_SUPABASE_* environment variables","README/docs naming Supabase for Postgres, Auth, Storage, or Edge Functions"],helpText:"Manage Supabase organizations, projects, databases, and run SQL.",skill:"supabase",setupSkill:"supabase-setup"})});var JhA;var ThA=D(()=>{hA();JhA=V({id:"superhuman",label:"Superhuman",iconKey:"superhuman",defaultServerUrl:"https://mcp.mail.superhuman.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"superhuman",callbackPathSegment:"superhuman",authorizationUrl:"https://mcp.auth.mail.superhuman.com/oauth2/authorize",tokenUrl:"https://mcp.auth.mail.superhuman.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.auth.mail.superhuman.com/oauth2/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"email",required:!0},{value:"offline_access",required:!0},{value:"openid",required:!0},{value:"profile",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Superhuman mail links, SUPERHUMAN_* environment variables, or support workflows naming Superhuman","Customer communication runbooks that depend on email search or drafting","Docs naming Superhuman Mail for sales, support, or founder-led customer comms"],helpText:"Search, draft, send, and triage emails in Superhuman Mail."})});var RhA;var fhA=D(()=>{Tt();hA();RhA=V({id:"the-context-company",label:"The Context Company",iconKey:"the-context-company",defaultServerUrl:"https://api.thecontext.company/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!1},evidenceHints:["The Context Company, context company, or context observability references","insight_search, get_agent_runs, or get_agent_sessions tool usage","THE_CONTEXT_COMPANY_API_KEY or api.thecontext.company in MCP configuration"],helpText:"Query agent insights, runs, and sessions through The Context Company's read-only hosted MCP server.",setupGroups:[{id:"api-key",title:"Create a read-only API key",description:"Create the API key The Context Company's hosted MCP server will use.",body:"Generate a read-only API key on The Context Company's [Access Data page](https://www.thecontextcompany.com/prod/mcp-and-api), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:qIA,normalizeHeaders:xIA,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var PhA;var zhA=D(()=>{hA();PhA=V({id:"vercel",label:"Vercel",iconKey:"vercel",defaultServerUrl:"https://mcp.vercel.com",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"vercel",callbackPathSegment:"vercel",authorizationUrl:"https://vercel.com/oauth/authorize",tokenUrl:"https://vercel.com/api/login/oauth/token",resourceUrl:"https://mcp.vercel.com",dynamicClientRegistration:{registrationEndpoint:"https://vercel.com/api/login/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["vercel.com links, VERCEL_* environment variables, or a vercel.json in the repo","Deploy workflows or runbooks naming Vercel as the frontend/hosting provider","Vercel project/deployment IDs or preview URLs referenced in docs or CI"],helpText:"Manage Vercel projects, deployments, and access Vercel platform documentation. Coming soon — Vercel's hosted MCP only authorizes allowlisted clients and Sazabi is pending approval, so it isn't connectable yet."})});var OhA;var vhA=D(()=>{Tt();hA();OhA=V({id:"x",label:"X",iconKey:"x",defaultServerUrl:"https://api.x.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["search_news","get_news","get_trends_by_woeid","get_posts_by_ids","get_posts_counts_recent","search_posts_all","get_posts_by_id","get_posts_liking_users","get_posts_quoted_posts","get_posts_reposted_by","get_users_by_usernames","get_users_by_username","get_users_me","search_users","get_users_by_id","get_users_bookmarks","get_users_bookmark_folders","get_users_bookmarks_by_folder_id","get_users_mentions","get_users_timeline","get_users_posts"]},evidenceHints:["X (Twitter) API usage, X_BEARER_TOKEN, or TWITTER_* environment variables","twitter-api-v2, tweepy, or other X/Twitter API client packages","README/docs naming the X API, X Developer Platform, or tweet automation"],helpText:"Search X posts and access real-time X data using your app's app-only Bearer Token.",setupGroups:[{id:"developer-app",title:"Open the X Developer Portal",description:"Use an X developer project/app with access to the X API v2.",body:"Go to the [X Developer Portal](https://developer.x.com/en/portal/dashboard), open the project and app you want Sazabi to use, and confirm the app has access to the API tiers you need. The hosted MCP server lives at `https://api.x.com/mcp`."},{id:"bearer-token",title:"Copy the app's Bearer Token",description:"Copy the app-only Bearer Token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, find the app-only **Bearer Token** and copy it (regenerate it if you don't have it saved). This is the app-only token, not a user OAuth 2.0 access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:dIA,normalizeHeaders:mIA,skill:"x",setupSkill:"x-setup"})});var WhA,Fft;var VhA=D(()=>{JeA();ReA();PeA();OeA();gN();gN();WeA();XeA();KeA();_eA();xeA();deA();peA();tBA();nBA();QBA();IBA();BBA();CBA();EBA();DBA();wBA();bBA();uBA();FBA();SBA();MBA();$BA();GBA();TBA();fBA();zBA();vBA();WBA();XBA();KBA();_BA();xBA();dBA();pBA();thA();nhA();QhA();IhA();BhA();ChA();EhA();DhA();whA();bhA();uhA();FhA();ShA();MhA();$hA();GhA();ThA();fhA();zhA();vhA();WhA=[khA,cBA,yBA,GeA,TeA,feA,zeA,veA,ZeA,VeA,HeA,jeA,meA,qeA,ABA,gBA,iBA,oBA,seA,eBA,hBA,aBA,rBA,NBA,UBA,LBA,lBA,YBA,kBA,JBA,RBA,PBA,OBA,ZBA,VBA,HBA,jBA,mBA,qBA,sBA,AhA,ghA,ihA,ohA,ehA,chA,hhA,yhA,ahA,rhA,NhA,UhA,LhA,lhA,YhA,JhA,RhA,PhA,OhA],Fft=new Map(WhA.map((A)=>[A.id,A]))});var XhA=()=>{};var HhA=()=>{};var KhA=()=>{};var jhA=()=>{};var _hA=()=>{};var mhA=()=>{};var xhA=()=>{};var qhA=()=>{};var dhA=()=>{};var shA=()=>{};var phA=()=>{};var ACA=()=>{};var tCA=()=>{};var gCA=()=>{};var nCA=()=>{};var iCA=()=>{};var QCA=()=>{};var oCA=()=>{};var ICA=()=>{};var eCA=()=>{};var BCA=()=>{};var hCA=()=>{};var CCA=()=>{};var cCA=()=>{};var ECA=()=>{};var yCA=()=>{};var DCA=()=>{};var aCA=()=>{};var wCA=()=>{};var rCA=()=>{};var bCA=()=>{};var NCA=()=>{};var uCA=()=>{};var UCA=()=>{};var FCA=()=>{};var LCA=()=>{};var SCA=()=>{};var lCA=()=>{};var MCA=()=>{};var YCA=()=>{};var $CA=()=>{};var kCA=()=>{};var GCA=()=>{};var JCA=()=>{};var TCA=D(()=>{XhA();HhA();KhA();jhA();_hA();mhA();xhA();qhA();dhA();shA();phA();ACA();tCA();gCA();nCA();iCA();QCA();oCA();ICA();eCA();BCA();hCA();CCA();cCA();ECA();yCA();DCA();aCA();wCA();rCA();bCA();NCA();uCA();UCA();FCA();LCA();SCA();lCA();MCA();YCA();$CA();kCA();GCA();JCA()});var RCA=D(()=>{gN()});var fCA=()=>{};var PCA=D(()=>{e6();pw();ZIA();Tt();SeA();leA();VhA();NP();TCA();RCA();fCA()});var zCA,p3A,OCA,A7A,vCA,uP,ZCA,WCA,uo,VCA,XCA,HCA,Uh,KCA,jCA,Fh,_CA,mCA,Lh,xCA,t7A,qCA,nN,dCA,sCA,pCA,AcA,Sh,tcA,gcA,lh,ncA,icA,Mh,UP,FP,QcA,ocA,Yh,IcA,ecA,$h,BcA,g7A,kh,hcA,CcA,Gh,ccA,EcA,Jh,ycA,DcA,Th,n7A;var LP=D(()=>{PCA();TA();VA();zCA=["configured","authorizing","connected","error"],p3A=I.enum(zCA),OCA=["preset","custom"],A7A=I.enum(OCA),vCA=["streamable-http","sse"],uP=I.enum(vCA),ZCA=["none","headers","oauth","aws-sigv4"],WCA=I.enum(ZCA),uo=I.object({connectionId:I.string().uuid().describe("Connection ID."),connectionKey:I.string().describe("Stable key used to reference this connector in tool calls."),providerId:I.string().describe('Provider identifier, e.g. "linear".'),displayName:I.string().describe("Human-readable connector name."),source:A7A.describe("Whether the connector is a built-in preset or a custom server."),installStatus:p3A.describe("Current connection lifecycle status."),authMode:WCA.describe("Authentication mode."),transport:uP.describe("Transport protocol."),serverUrl:I.string().describe("MCP server URL."),readOnly:I.boolean().describe("Whether the connector is restricted to read-only tools."),management:Gk.describe("Lifecycle owner and supported connector mutations."),enabledToolCount:I.number().int().nonnegative().describe("Number of tools enabled and available for this connector."),connectedAt:I.string().datetime().nullable().describe("When the connector last became connected, if ever."),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),VCA=I.object({name:I.string().describe("Tool name as invoked."),title:I.string().describe("Human-readable tool title."),description:I.string().describe("Tool description."),isReadOnly:I.boolean().describe("Whether the tool is considered read-only."),enabled:I.boolean().describe("Whether the tool is enabled and available given the connector config.")}),XCA=I.object({projectId:I.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:I.union([I.boolean(),I.stringbool()]).optional().describe("When true, only return connectors that are connected.")}),HCA=I.object({connectors:I.array(uo)}),Uh=L({operationId:"mcpConnectors.list",description:"List configured MCP connectors within one project with provider, status, and enabled-tool count.",backend:"api",route:{method:"GET",path:"/mcp-connectors",tags:["MCP Connectors"]},input:XCA,output:HCA,pagination:"none",async:"sync"}),KCA=I.object({connectionId:I.string().uuid().describe("Connection ID to fetch."),projectId:I.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),jCA=I.object({connector:uo}),Fh=L({operationId:"mcpConnectors.get",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:KCA,output:jCA,pagination:"none",async:"sync"}),_CA=I.object({connectionId:I.string().uuid().describe("Connection ID to inspect."),projectId:I.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),mCA=I.object({connector:uo,tools:I.array(VCA)}),Lh=L({operationId:"mcpConnectors.details",description:"Inspect one MCP connector's tool surface, including each tool's name, description, and read-only status.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}/details",tags:["MCP Connectors"]},input:_CA,output:mCA,pagination:"none",async:"sync"}),xCA=I.object({providerId:I.string().describe('Provider identifier, e.g. "linear".'),label:I.string().describe("Human-readable provider name."),authMode:WCA.describe("Authentication mode."),availability:I.enum(iB).describe("Whether the provider is enabled or coming soon."),setupSkill:I.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),t7A=I.object({}),qCA=I.object({providers:I.array(xCA)}),nN=L({operationId:"mcpConnectors.listProviders",description:"List all supported MCP connector providers with their auth mode and setup skill.",backend:"api",route:{method:"GET",path:"/mcp-connectors/providers",tags:["MCP Connectors"]},input:t7A,output:qCA,pagination:"none",async:"sync"}),dCA=I.object({connectionKey:I.string().describe("Stable key used to call this connector."),displayName:I.string().describe("Human-readable connector name."),providerId:I.string().describe('Provider identifier, e.g. "linear".'),toolCount:I.number().int().nonnegative().describe("Number of executable tools on this connector.")}),sCA=I.object({connectionKey:I.string().describe("Connector that exposes this tool."),toolName:I.string().describe("Tool name as invoked."),providerId:I.string().describe('Provider identifier, e.g. "linear".'),displayName:I.string().describe("Human-readable connector name."),isReadOnly:I.boolean().describe("Whether the tool is considered read-only."),description:I.string().describe("Tool description from the stored snapshot."),score:I.number().describe("BM25 rank score. Zero when enumerating a namespace."),inputSchema:I.record(I.string(),I.unknown()).optional().describe("JSON Schema for the tool's arguments, when requested.")}),pCA=I.object({projectId:I.string().uuid().optional().describe("Project to search connectors in. Auto-filled from SDK context when omitted."),query:I.string().optional().describe("Free-text query over tool names, titles, connector keys, and descriptions. Omit or empty to list connectors, or to enumerate one connector when namespace is set."),namespace:I.string().min(1).optional().describe("Restrict results to one connectionKey or providerId."),limit:I.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of connectors or tool hits to return."),offset:I.coerce.number().int().min(0).default(0).describe("Number of connectors or tool hits to skip."),includeInputSchema:I.union([I.boolean(),I.stringbool()]).optional().describe("When true, tool hits include inputSchema so a caller can execute without a describe round-trip.")}),AcA=I.object({kind:I.enum(["connectors","tools"]).describe("connectors when the query is empty and no namespace is set; tools otherwise."),total:I.number().int().nonnegative().describe("Total matches before limit and offset."),connectors:I.array(dCA).describe("Connector index. Empty when kind is tools."),tools:I.array(sCA).describe("Ranked or enumerated tool hits. Empty when kind is connectors.")}),Sh=L({operationId:"mcpConnectors.search",description:"Search executable third-party MCP connector tools by free-text query. Empty query lists connectors; empty query plus namespace enumerates that connector. Hits omit input schemas unless includeInputSchema is true.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/search",tags:["MCP Connectors"]},input:pCA,output:AcA,pagination:"none",async:"sync"}),tcA=I.object({projectId:I.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:I.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:I.string().min(1).describe("Tool name as invoked.")}),gcA=I.object({connectionKey:I.string().describe("Connector that exposes this tool."),toolName:I.string().describe("Tool name as invoked."),providerId:I.string().describe('Provider identifier, e.g. "linear".'),displayName:I.string().describe("Human-readable connector name."),title:I.string().describe("Human-readable tool title."),description:I.string().describe("Tool description from the stored snapshot."),isReadOnly:I.boolean().describe("Whether the tool is considered read-only."),inputSchema:I.record(I.string(),I.unknown()).describe("JSON Schema for the tool's arguments.")}),lh=L({operationId:"mcpConnectors.describe",description:"Load one executable third-party MCP connector tool, including its input schema.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/describe",tags:["MCP Connectors"]},input:tcA,output:gcA,pagination:"none",async:"sync"}),ncA=I.object({projectId:I.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:I.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:I.string().min(1).describe("Tool name as invoked."),arguments:I.record(I.string(),I.unknown()).optional().describe("Arguments matching the tool's input schema.")}),icA=I.discriminatedUnion("ok",[I.object({ok:I.literal(!0),connectionKey:I.string().describe("Connector that ran the tool."),toolName:I.string().describe("Tool name as invoked."),result:I.unknown().describe("Vendor tool result payload."),structuredContent:I.unknown().optional().describe("Structured content from the vendor when present."),content:I.array(I.record(I.string(),I.unknown())).describe("Raw MCP content parts from the vendor."),text:I.string().nullable().describe("Concatenated text content, if any.")}),I.object({ok:I.literal(!1),code:I.enum(["TOOL_NOT_ENABLED","READ_ONLY","MCP_ERROR"]).describe("Why the tool did not run."),message:I.string().describe("Caller-facing error message.")})]),Mh=L({operationId:"mcpConnectors.call",description:"Invoke one executable third-party MCP connector tool using that connection's stored credential.",backend:"api",route:{method:"POST",path:"/mcp-connectors/tools/call",tags:["MCP Connectors"]},input:ncA,output:icA,pagination:"none",async:"sync"}),UP=I.object({id:I.string().min(1).describe("Stable ID for this header (must be unique within the connector)."),name:I.string().trim().min(1).describe("HTTP header name."),value:I.string().min(1).describe("HTTP header value (passed verbatim).")}),FP=I.object({accessKeyId:I.string().trim().min(1).describe("AWS access key ID."),secretAccessKey:I.string().min(1).describe("AWS secret access key."),sessionToken:I.string().min(1).optional().describe("Optional session token for temporary credentials."),region:I.string().trim().min(1).describe("AWS region.")}),QcA=I.object({projectId:I.string().uuid().optional().describe("Project to create the connector in. Auto-filled from SDK context when omitted."),serverUrl:I.string().url().describe("MCP server URL (must be https)."),transport:uP.describe("Transport protocol."),headers:I.array(UP).optional().describe("HTTP headers to send with each request."),awsSigV4:FP.optional().describe("AWS SigV4 credentials for AWS MCP servers."),providerId:I.string().min(1).describe("Built-in preset provider ID (for example, linear or datadog)."),readOnly:I.boolean().optional().describe("Restrict the connector to read-only tools. Defaults to false.")}),ocA=I.object({connector:uo}),Yh=L({operationId:"mcpConnectors.create",description:"Create a preset MCP connector with header-based or AWS SigV4 authentication. The server URL must match the selected provider's supported endpoints. Connects immediately and returns the connector with its discovered tool snapshot.",backend:"api",route:{method:"POST",path:"/mcp-connectors",tags:["MCP Connectors"],successStatus:201},input:QcA,output:ocA,pagination:"none",async:"sync"}),IcA=I.object({connectionId:I.string().uuid().describe("Connection ID to update."),projectId:I.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),serverUrl:I.string().url().optional().describe("New MCP server URL."),transport:uP.optional().describe("New transport protocol."),headers:I.array(UP).optional().describe("Complete replacement header set. Replaces all existing headers."),awsSigV4:FP.optional().describe("Replacement AWS SigV4 credentials. Mutually exclusive with headers.")}),ecA=I.object({connector:uo}),$h=L({operationId:"mcpConnectors.update",description:"Deprecated. Preset MCP connector updates are no longer supported via the public API; disconnect and reconnect instead.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:IcA,output:ecA,pagination:"none",async:"sync"}),BcA=I.object({connectionId:I.string().uuid().describe("Connection ID to disconnect."),projectId:I.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),g7A=I.void(),kh=L({operationId:"mcpConnectors.disconnect",description:"Disconnect and permanently remove an MCP connector.",backend:"api",route:{method:"DELETE",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"],successStatus:204},input:BcA,output:g7A,pagination:"none",async:"sync"}),hcA=I.object({connectionId:I.string().uuid().describe("Connection ID to update."),projectId:I.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),readOnly:I.boolean().describe("True to restrict to read-only tools; false to allow all enabled tools.")}),CcA=I.object({connector:uo}),Gh=L({operationId:"mcpConnectors.setReadOnly",description:"Toggle the read-only restriction on an MCP connector.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}/read-only",tags:["MCP Connectors"]},input:hcA,output:CcA,pagination:"none",async:"sync"}),ccA=I.object({projectId:I.string().uuid().optional().describe("Project to install into. Auto-filled from SDK context when omitted."),providerId:I.string().min(1).describe('Provider ID to install, e.g. "linear".'),requestedScopes:I.array(I.string()).optional().describe("Scopes to request. Defaults to the provider's recommended scope set."),serverUrl:I.string().url().optional().describe("Server URL for multi-region providers; defaults to the provider's primary server."),readOnly:I.boolean().optional().describe("Restrict the connector to read-only tools after install. Defaults to false."),returnTo:I.string().optional().describe("Path to redirect the user to after OAuth completes.")}),EcA=I.object({authorizationUrl:I.string().describe("Authorization URL to open in the user's browser."),connectionId:I.string().uuid().describe("Connection ID to poll for completion via getMcpOAuthInstallAttempt."),expiresAt:I.string().datetime().describe("When the OAuth authorization attempt expires.")}),Jh=L({operationId:"mcpConnectors.beginOAuthInstall",description:"Begin an OAuth browser flow to install a preset MCP connector. Opens an authorization URL in the user's browser; poll getMcpOAuthInstallAttempt with the returned connectionId to check completion.",backend:"api",route:{method:"POST",path:"/mcp-connectors/oauth/begin",tags:["MCP Connectors"],successStatus:201},input:ccA,output:EcA,pagination:"none",async:"sync"}),ycA=I.object({connectionId:I.string().uuid().describe("Connection ID returned by beginMcpOAuthInstall."),projectId:I.string().uuid().optional().describe("Project the connection belongs to. Auto-filled from SDK context when omitted.")}),DcA=I.object({status:I.enum(["authorizing","connected","error"]).describe("Current install status."),connector:uo.optional().describe("Connector details once connected or in error state.")}),Th=L({operationId:"mcpConnectors.getOAuthInstallAttempt",description:"Poll the status of an in-progress OAuth MCP connector install. Returns authorizing while the user completes the browser flow, connected on success, or error on failure.",backend:"api",route:{method:"GET",path:"/mcp-connectors/oauth/attempts/{connectionId}",tags:["MCP Connectors"]},input:ycA,output:DcA,pagination:"none",async:"sync"}),n7A={list:Uh.contract,get:Fh.contract,details:Lh.contract,listProviders:nN.contract,search:Sh.contract,describe:lh.contract,call:Mh.contract,create:Yh.contract,update:$h.contract,disconnect:kh.contract,setReadOnly:Gh.contract,beginOAuthInstall:Jh.contract,getOAuthInstallAttempt:Th.contract}});var Uo,i7A,Q7A,o7A,I7A,e7A,B7A,h7A,SP,C1t;var iN=D(()=>{TA();VA();Uo=I.enum(["admin","member"]),i7A=I.object({id:I.string().min(1),name:I.string(),slug:I.string(),logo:I.string().nullable().optional(),role:Uo}),Q7A=I.object({id:I.string().min(1),name:I.string().nullable(),email:I.string().email()}),o7A=I.object({credentialType:I.literal("user"),user:Q7A,activeOrganizationId:I.string().min(1).nullable(),authorizedOrganizationId:I.string().min(1).nullable(),authorizedProjectId:I.string().min(1).nullable(),organizations:I.array(i7A).describe("Organizations the user belongs to, including membership role.")}),I7A=I.object({credentialType:I.literal("secret"),organization:I.object({id:I.string().min(1),name:I.string(),slug:I.string(),logo:I.string().nullable().optional()}),keyName:I.string()}),e7A=I.object({credentialType:I.literal("partner"),superorganization:I.object({id:I.string().uuid(),name:I.string()})}),B7A=I.object({}),h7A=I.discriminatedUnion("credentialType",[o7A,I7A,e7A]),SP=L({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:B7A,output:h7A,pagination:"none",async:"sync"}),C1t=SP.contract});var acA,wcA,rcA,C7A,c7A,E7A,y7A,D7A,a7A,lP,MP,YP,w7A,r7A,b7A,N7A,u7A,U7A,$P,kP,GP,a1t;var bcA=D(()=>{TA();VA();iN();acA=I.object({membershipId:I.string().min(1).describe("Organization membership record ID."),userId:I.string().min(1).describe("User ID for the organization member."),name:I.string().nullable().describe("Display name for the member, when available."),email:I.string().email().describe("Email address for the member."),imageUrl:I.string().nullable().describe("Profile image URL for the member, when available."),role:Uo.describe("Organization role."),createdAt:I.string().datetime().describe("When the membership was created.")}),wcA=I.object({id:I.string().min(1).describe("Invitation ID."),email:I.string().email().describe("Invited email address."),role:Uo.describe("Role the invitee will receive when they accept."),status:I.string().min(1).describe('Invitation status (e.g. "pending").'),createdAt:I.string().datetime().describe("When the invitation was created."),expiresAt:I.string().datetime().describe("When the invitation expires.")}),rcA=I.string().min(1).describe("A user ID, or a URL-encoded email address, of the member."),C7A=I.object({organizationId:I.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted.")}),c7A=I.object({members:I.array(acA).describe("Members visible within the selected organization.")}),E7A=I.object({organizationId:I.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted."),member:rcA.describe("User ID, or URL-encoded email address, of the member to update."),role:Uo.describe("Role to assign.")}),y7A=I.object({member:acA.describe("Updated organization member.")}),D7A=I.object({params:I.object({member:rcA.describe("User ID, or URL-encoded email address, of the member to remove.")}),query:I.object({organizationId:I.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),a7A=I.object({removedUserId:I.string().min(1).describe("User ID removed from the organization.")}),lP=L({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:C7A,output:c7A,pagination:"none",async:"sync",examples:[{name:"organization-members",input:{organizationId:"organization-123"},output:{members:[{membershipId:"membership-123",userId:"user-123",name:"Alex Admin",email:"alex@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}]}}]}),MP=L({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{member}/role",tags:["Members"]},input:E7A,output:y7A,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",member:"user-456",role:"admin"},output:{member:{membershipId:"membership-456",userId:"user-456",name:"Mina Member",email:"mina@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}}}]}),YP=L({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{member}",tags:["Members"],inputStructure:"detailed"},input:D7A,output:a7A,pagination:"none",async:"sync"}),w7A=I.object({organizationId:I.string().min(1).optional().describe("Organization to invite into. Auto-filled from CLI and SDK context when omitted."),email:I.string().email().describe("Email address to invite."),role:Uo.optional().default("member").describe('Role to grant on acceptance. Defaults to "member".')}),r7A=I.object({invitation:wcA.describe("The created pending invitation.")}),b7A=I.object({organizationId:I.string().min(1).optional().describe("Organization to list invitations for. Auto-filled from CLI and SDK context when omitted.")}),N7A=I.object({invitations:I.array(wcA).describe("Pending invitations visible within the selected organization.")}),u7A=I.object({params:I.object({invitationId:I.string().min(1).describe("ID of the invitation to revoke.")}),query:I.object({organizationId:I.string().min(1).optional().describe("Organization containing the invitation. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:A,query:t})=>({...t,...A})),U7A=I.object({revokedInvitationId:I.string().min(1).describe("ID of the revoked invitation.")}),$P=L({operationId:"members.invite",description:"Invite a person to the organization by email.",backend:"api",route:{method:"POST",path:"/members/invitations",tags:["Members"],successStatus:201},input:w7A,output:r7A,pagination:"none",async:"sync",examples:[{name:"invite-member",input:{organizationId:"organization-123",email:"newhire@example.com",role:"member"},output:{invitation:{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}}}]}),kP=L({operationId:"members.listInvitations",description:"List pending invitations for an organization.",backend:"api",route:{method:"GET",path:"/members/invitations",tags:["Members"]},input:b7A,output:N7A,pagination:"none",async:"sync",examples:[{name:"organization-invitations",input:{organizationId:"organization-123"},output:{invitations:[{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}]}}]}),GP=L({operationId:"members.revokeInvitation",description:"Revoke a pending invitation.",backend:"api",route:{method:"DELETE",path:"/members/invitations/{invitationId}",tags:["Members"],inputStructure:"detailed"},input:u7A,output:U7A,pagination:"none",async:"sync"}),a1t={list:lP.contract,updateRole:MP.contract,remove:YP.contract,invite:$P.contract,listInvitations:kP.contract,revokeInvitation:GP.contract}});var ucA,UcA,QN,FcA,oN,NcA=4194304,JP,TP,F7A=(A)=>{let t=A.split(",").map((i)=>i.trim()).filter(Boolean),g=I.array(QN).safeParse(t);if(!g.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return g.data},Dy,RP,fP,LcA,ScA,lcA,McA,YcA,$cA,kcA,GcA,JcA,TcA,RcA,fcA,Rh,fh,Ph,zh,Oh,L7A;var PP=D(()=>{TA();VA();ucA=["note","runbook"],UcA=["note","runbook","change"],QN=I.enum(UcA),FcA=I.enum(ucA),oN=I.string().min(1).max(512).refine((A)=>!A.startsWith("/"),{message:"Path must be relative without a leading slash."}).describe("Relative memory path, for example AGENTS.md or notes/architecture.md."),JP=I.string().min(1).refine((A)=>new TextEncoder().encode(A).length<=NcA,{message:`Memory body must be at most ${NcA} bytes (4 MiB).`}).describe("Document body stored in project memory."),TP=I.string().regex(/^(\d+)(s|m|h|d)$/u,"Duration must use s, m, h, or d units, for example 7d or 30m.").describe("Relative time window, for example 7d or 30m."),Dy=I.string().min(1).transform(F7A).describe("Comma-separated kinds, for example note,runbook."),RP=I.object({id:I.string().uuid(),projectId:I.string().uuid(),kind:QN,managed:I.boolean(),path:I.string().nullable(),title:I.string().nullable(),contentHash:I.string(),attrs:I.record(I.string(),I.unknown()),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),fP=RP.extend({body:JP}),LcA=I.object({projectId:I.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:oN.describe("Relative path for the curated document."),body:JP,kind:FcA.default("note").describe("Curated document kind. Only note and runbook may be written through the API."),title:I.string().max(500).optional().describe("Optional display title. Defaults to the path basename.")}),ScA=I.object({document:fP}),lcA=I.object({projectId:I.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:I.string().uuid().optional().describe("Document id."),path:oN.optional().describe("Relative curated path.")}).superRefine((A,t)=>{let g=A.id!==void 0,i=A.path!==void 0;if(g===i)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),McA=I.object({document:fP}),YcA=I.object({projectId:I.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:Dy.optional(),since:TP.optional().describe("Only return documents updated within this window, for example 7d."),service:I.string().min(1).optional().describe("Filter to documents whose attrs.services contains this value."),pathPrefix:I.string().min(1).optional().describe("Filter to paths starting with this prefix."),managed:I.coerce.boolean().optional(),cursor:I.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of documents to return per page.")}),$cA=I.object({documents:I.array(RP),nextCursor:I.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),kcA=I.object({documentId:I.string().uuid(),kind:QN,managed:I.boolean(),path:I.string().nullable(),title:I.string().nullable(),snippet:I.string(),score:I.number()}),GcA=I.object({calibrated:I.literal(!0),minScoreThreshold:I.number(),queryTerms:I.array(I.string()),message:I.string()}),JcA=I.object({projectId:I.string().uuid().optional().describe("Project to search memory for. Auto-filled from CLI and SDK context when omitted."),query:I.string().trim().min(1).max(500).describe("Natural-language search query."),kind:Dy.optional(),since:TP.optional(),service:I.string().min(1).optional(),pathPrefix:I.string().min(1).optional(),managed:I.coerce.boolean().optional(),limit:I.coerce.number().int().min(1).max(50).default(10).describe("Maximum ranked search hits to return.")}),TcA=I.object({hits:I.array(kcA),emptyVerdict:GcA.nullable()}),RcA=I.object({projectId:I.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:I.string().uuid().optional().describe("Document id."),path:oN.optional()}).superRefine((A,t)=>{let g=A.id!==void 0,i=A.path!==void 0;if(g===i)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),fcA=I.void(),Rh=L({operationId:"memory.put",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:LcA,output:ScA,pagination:"none",async:"sync"}),fh=L({operationId:"memory.get",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:lcA,output:McA,pagination:"none",async:"sync"}),Ph=L({operationId:"memory.list",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:YcA,output:$cA,pagination:"cursor",async:"sync"}),zh=L({operationId:"memory.search",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:JcA,output:TcA,pagination:"none",async:"sync"}),Oh=L({operationId:"memory.delete",description:"Soft-delete a curated project memory document by id or path.",backend:"api",route:{method:"DELETE",path:"/memory/document",successStatus:204,tags:["Memory"]},input:RcA,output:fcA,pagination:"none",async:"sync"}),L7A={put:Rh.contract,get:fh.contract,list:Ph.contract,search:zh.contract,delete:Oh.contract}});var PcA,zcA,S7A,l7A,M7A,Y7A,$7A,ay,k7A,G7A,J7A,zP,OP,vP,ZP,F1t;var IN=D(()=>{TA();VA();PcA=I.enum(["processing","completed","aborted","error"]),zcA=I.object({id:I.string().uuid(),threadId:I.string().uuid(),userMessageId:I.string().uuid().nullable(),assistantMessageId:I.string().uuid().nullable(),parentRunId:I.string().uuid().nullable(),workflowRunId:I.string().nullable(),status:PcA,source:I.enum(["app","api","mcp","slack","teams","linear","github","agent","cli","web","sdk","bitbucket","system"]),createdAt:I.string().datetime(),updatedAt:I.string().datetime(),completedAt:I.string().datetime().nullable()}),S7A=I.object({projectId:I.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:I.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),l7A=I.object({runs:I.array(zcA),nextCursor:I.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),M7A=I.object({threadId:I.string().uuid().describe("Thread ID to list runs for."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:I.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),Y7A=I.object({runs:I.array(zcA),nextCursor:I.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),$7A=I.object({runId:I.string().uuid().describe("Run ID returned by a deferred operation.")}),ay=I.object({completed:I.boolean().describe("Whether the run has reached a terminal status."),threadId:I.string().uuid().describe("Thread ID associated with the run."),runId:I.string().uuid().describe("Run ID for subsequent polling."),messageId:I.string().uuid().optional().describe("ID of the user message that triggered this run."),status:PcA.describe("Current run lifecycle status."),response:I.string().nullable().describe("Assistant response text when the run has completed.")}),k7A=ay.describe("Current run state and, when complete, the assistant response."),G7A=I.object({runId:I.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),J7A=I.object({success:I.literal(!0).describe("Always true when the cancellation request was accepted.")}),zP=L({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:S7A,output:l7A,pagination:"cursor",async:"sync"}),OP=L({operationId:"runs.listForThread",summary:"List Runs for a Thread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:M7A,output:Y7A,pagination:"cursor",async:"sync"}),vP=L({operationId:"runs.get",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:$7A,output:k7A,pagination:"none",async:"sync",examples:[{name:"processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),ZP=L({operationId:"runs.cancel",description:"Request cancellation of an in-flight run. Idempotent and best-effort: returns success even when the run has already reached a terminal status.",backend:"api",route:{method:"POST",path:"/runs/{runId}/cancel",tags:["Runs"]},input:G7A,output:J7A,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),F1t={list:zP.contract,listForThread:OP.contract,get:vP.contract,cancel:ZP.contract}});var eN=(A,t,g)=>{let i=t?20000:1e4;if(A.length>i)g.addIssue({code:"too_big",maximum:i,type:"string",inclusive:!0,message:`Message cannot exceed ${i} characters`,origin:"string",path:["message"]})},BN=(A,t,g)=>{if(A&&!t)g.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var OcA,wy,T7A,R7A,f7A,P7A,z7A,O7A,v7A,Z7A,W7A,WP,V7A,X7A,H7A,K7A,j7A,_7A,m7A,x7A,q7A,d7A,s7A,p7A,VP,XP,HP,KP,jP,_P,vcA,AxA,txA,gxA,nxA,ZcA,ixA,QxA,oxA,IxA,exA,BxA,HI="22222222-2222-4222-8222-222222222222",WcA="11111111-1111-4111-8111-111111111111",hxA="44444444-4444-4444-8444-444444444444",VcA="55555555-5555-4555-8555-555555555555",mP,xP,qP,dP,sP,k1t;var pP=D(()=>{TA();VA();IN();OcA=I.enum(["slack","teams","linear","github","app","mcp","agent","api","cli","web","sdk","bitbucket","system"]),wy=I.object({id:I.string().uuid(),projectId:I.string().uuid(),title:I.string().nullable(),status:I.enum(["regular","archived"]),source:OcA.nullable(),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),T7A=I.object({type:I.literal("message"),message:I.string()}),R7A=I.object({type:I.literal("reasoning"),reasoning:I.string(),status:I.enum(["in_progress","complete"]).optional()}),f7A=I.object({type:I.literal("tool_call"),name:I.string(),params:I.any().optional(),result:I.any().optional(),status:I.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:I.string().optional(),durationMs:I.number().nonnegative().optional()}),P7A=I.object({type:I.literal("artifact"),name:I.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card","mdx"]),data:I.any(),toolCallId:I.string().optional()}),z7A=I.object({type:I.literal("fork"),sourceThreadId:I.string(),sourceMessageId:I.string(),sourceThreadTitle:I.string().nullable()}),O7A=I.object({type:I.literal("summary"),summary:I.string()}),v7A=I.object({type:I.literal("slack_context"),channelId:I.string(),isTruncated:I.boolean().optional(),messages:I.array(I.object({timestamp:I.string(),slackUserId:I.string().optional(),displayName:I.string(),text:I.string(),isBot:I.boolean(),files:I.array(I.object({name:I.string(),mimetype:I.string(),size:I.number().optional(),attachmentId:I.string().uuid().optional(),ingestionStatus:I.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),Z7A=I.object({type:I.literal("teams_context"),conversationId:I.string(),isTruncated:I.boolean().optional(),messages:I.array(I.object({activityId:I.string().optional(),displayName:I.string(),text:I.string(),isBot:I.boolean(),createdDateTime:I.string().optional()}))}),W7A=I.union([T7A,R7A,f7A,P7A,z7A,O7A,v7A,Z7A]),WP=I.object({id:I.string().uuid(),role:I.enum(["user","assistant"]),content:I.array(W7A),source:OcA,createdAt:I.string().datetime()}),V7A=I.object({projectId:I.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:I.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),X7A=I.object({threads:I.array(wy).describe("The page of threads matching the query."),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),H7A=I.object({threadId:I.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),K7A=I.object({thread:wy.describe("The requested thread."),messages:I.array(WP).describe("Messages currently stored on the thread in chronological order.")}),j7A=I.object({projectId:I.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:I.string().min(1,"Message cannot be empty").describe("Initial user message that starts the thread."),wait:I.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:I.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:I.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:I.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((A,t)=>{eN(A.message,A.automationId,t),BN(A.ambientServiceRun,A.automationId,t)}),_7A=ay.describe("Deferred run result for creating a thread."),m7A=I.object({threadId:I.string().uuid().describe("Thread ID whose current processing status should be returned.")}),x7A=I.object({status:I.enum(["idle","processing"]),lastRunStatus:I.enum(["error"]).nullable()}),q7A=I.object({threadId:I.string().uuid().describe("Thread ID whose active run should be stopped.")}),d7A=I.object({success:I.literal(!0).describe("Always true when the stop request was accepted.")}),s7A=I.object({threadId:I.string().uuid().describe("Thread ID of the thread to update."),status:I.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),p7A=I.object({thread:wy.describe("The updated thread.")}),VP=L({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:V7A,output:X7A,pagination:"cursor",async:"sync",examples:[{name:"active-threads",input:{projectId:"11111111-1111-4111-8111-111111111111",status:"regular",limit:10},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),XP=L({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:H7A,output:K7A,pagination:"none",async:"sync"}),HP=L({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:m7A,output:x7A,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),KP=L({operationId:"threads.stop",description:"Stop a thread's in-flight run. Idempotent and best-effort: returns success even when the thread has no active run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/stop",tags:["Threads"]},input:q7A,output:d7A,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),jP=L({operationId:"threads.create",description:"Create a thread with an initial message and optionally wait for the agent response.",backend:"api",route:{method:"POST",path:"/threads",tags:["Threads"],successStatus:201},input:j7A,output:_7A,pagination:"none",async:"deferred",examples:[{name:"async-handoff",input:{projectId:"11111111-1111-4111-8111-111111111111",message:"Investigate elevated 500s in production.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),_P=L({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:s7A,output:p7A,pagination:"none",async:"sync",examples:[{name:"archive-thread",input:{threadId:"22222222-2222-4222-8222-222222222222",status:"archived"},output:{thread:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"archived",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),vcA=I.enum(["private","organization"]),AxA=I.object({threadId:I.string().uuid().describe("Thread ID of the source thread to fork."),messageId:I.string().uuid().describe("Message ID in the source thread to fork from. The new thread copies messages up to and including this message.")}),txA=I.object({thread:wy.describe("The newly created forked thread.")}),gxA=I.object({threadId:I.string().uuid().describe("Thread ID of the thread to update."),visibility:vcA.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),nxA=I.object({thread:wy.describe("The updated thread."),visibility:vcA.describe("The thread's resulting visibility.")}),ZcA=I.object({shareId:I.string().uuid().describe("Unique identifier for the snapshot."),threadId:I.string().uuid().describe("Thread the snapshot was taken from."),url:I.string().describe("Public read-only URL for the snapshot."),createdAt:I.string().datetime()}),ixA=I.object({threadId:I.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),QxA=I.object({share:ZcA.describe("The created share link.")}),oxA=I.object({threadId:I.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:I.string().uuid().describe("Snapshot ID to revoke.")}),IxA=I.void(),exA=I.object({threadId:I.string().uuid().describe("Thread ID to list public snapshots for.")}),BxA=I.object({shares:I.array(ZcA).describe("Active share links for the thread.")}),mP=L({operationId:"threads.fork",description:"Fork a thread from a specific message, creating a new thread that copies messages up to that point.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/fork",tags:["Threads"],successStatus:201},input:AxA,output:txA,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:HI,messageId:hxA},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:WcA,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),xP=L({operationId:"threads.setVisibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:gxA,output:nxA,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:HI,visibility:"private"},output:{thread:{id:HI,projectId:WcA,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),qP=L({operationId:"threads.createShareLink",description:"Create a public read-only share link for a thread's current messages.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/share",tags:["Threads"],successStatus:201},input:ixA,output:QxA,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:HI},output:{share:{shareId:VcA,threadId:HI,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),dP=L({operationId:"threads.listShareLinks",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:exA,output:BxA,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:HI},output:{shares:[{shareId:VcA,threadId:HI,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),sP=L({operationId:"threads.revokeShareLink",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:oxA,output:IxA,pagination:"none",async:"sync"}),k1t={list:VP.contract,get:XP.contract,getStatus:HP.contract,stop:KP.contract,create:jP.contract,update:_P.contract,fork:mP.contract,setVisibility:xP.contract,createShareLink:qP.contract,listShareLinks:dP.contract,revokeShareLink:sP.contract}});var CxA,cxA,ExA,yxA,XcA,HcA;var KcA=D(()=>{TA();VA();IN();pP();CxA=I.object({threadId:I.string().uuid().describe("Thread ID to list messages for."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),cxA=I.object({messages:I.array(WP),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),ExA=I.object({threadId:I.string().uuid().describe("Thread ID to append the message to."),message:I.string().min(1,"Message cannot be empty").describe("Message body to append to the thread."),wait:I.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:I.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:I.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:I.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((A,t)=>{eN(A.message,A.automationId,t),BN(A.ambientServiceRun,A.automationId,t)}),yxA=ay.describe("Deferred run result for appending a message to an existing thread."),XcA=L({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:CxA,output:cxA,pagination:"cursor",async:"sync",examples:[{name:"thread-messages",input:{threadId:"22222222-2222-4222-8222-222222222222",limit:2},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",role:"user",content:[{type:"message",message:"What changed in the intake pipeline?"}],source:"api",createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),HcA=L({operationId:"messages.append",description:"Append a user message to an existing thread and trigger a deferred run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/messages",successStatus:201,tags:["Messages"]},input:ExA,output:yxA,pagination:"none",async:"deferred",examples:[{name:"append-processing",input:{threadId:"22222222-2222-4222-8222-222222222222",message:"Follow up on the intake backlog.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]})});var En,_cA,Az,vh,tz,hN,Fo,mcA,jcA;var ry=D(()=>{TA();En={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",MICROSOFT_TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},_cA=[En.IN_APP,En.SLACK,En.EMAIL,En.SMS],Az=[En.SLACK_CHANNEL,En.MICROSOFT_TEAMS_CHANNEL,En.INCIDENT_IO,En.PAGERDUTY,En.ROOTLY,En.WEBHOOK],vh=Object.values(En),tz=[...vh,"victorops"],hN=I.enum(vh),Fo=I.enum(Az),mcA=[{channel:"in_app",name:"In-app",description:"Show notifications in your Sazabi notification feed.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"email",name:"Email",description:"Send notifications to your account email address.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"sms",name:"SMS",description:"Send notifications to your verified phone number.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/account?phone-number=add"},{channel:"slack",name:"Slack DMs",description:"Send personal notifications by Slack DM.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/connected-accounts/slack"},{channel:"slack_channel",name:"Slack",description:"Post this project's alerts to selected Slack channels.",scope:"project",destinationManagement:"slack_channels",projectIntegrationPath:"slack"},{channel:"teams_channel",name:"Microsoft Teams",description:"Post this project's alerts to selected Microsoft Teams channels.",scope:"project",destinationManagement:"teams_channels",projectIntegrationPath:"teams"},{channel:"incident_io",name:"incident.io",description:"Route this project's alerts to incident.io.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"incident-io"},{channel:"pagerduty",name:"PagerDuty",description:"Route this project's alerts to PagerDuty.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"pagerduty"},{channel:"rootly",name:"Rootly",description:"Route this project's alerts to Rootly.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"rootly"},{channel:"webhook",name:"Webhooks",description:"Send this project's alerts to configured HTTPS endpoints.",scope:"project",destinationManagement:"webhook_endpoints",projectSettingsPath:"webhooks"}],jcA=new Set(mcA.map(({channel:A})=>A));if(jcA.size!==vh.length||vh.some((A)=>!jcA.has(A)))throw Error("Notification channel definitions must represent every channel")});var xcA,DxA=(A,t)=>A.value===t.value&&A.label===t.label&&A.scope===t.scope&&A.role===t.role&&A.defaultOff===t.defaultOff&&(A.defaultOffChannels??[]).join(",")===(t.defaultOffChannels??[]).join(",")&&A.email?.template===t.email?.template&&A.email?.ctaLabel===t.email?.ctaLabel&&(A.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),Jg=(A)=>{for(let t of Object.values(A)){let g=xcA.get(t.value);if(g&&!DxA(g,t))throw Error(`Notification type registered twice with conflicting definitions: ${t.value}`);if(t.role!==void 0&&t.scope!=="org")throw Error(`Notification type role restrictions require org scope: ${t.value}`);if(t.label.trim().length===0)throw Error(`Notification type needs a display label: ${t.value}`);if(t.email&&t.email.ctaLabel.trim().length===0)throw Error(`Notification email presentation needs a CTA label: ${t.value}`);if(t.defaultOff&&t.defaultOffChannels)throw Error(`Notification type declares both defaultOff and defaultOffChannels: ${t.value}`);xcA.set(t.value,t)}return A};var cQ=D(()=>{xcA=new Map});var qcA;var dcA=D(()=>{cQ();qcA=Jg({AUTOMATION_FINISHED:{value:"automation_finished",label:"Automation completed",scope:"project",defaultOff:!0},AUTOMATION_RUN_FAILED:{value:"automation_run_failed",label:"Automation run failed",scope:"project"}})});var CN;var gz=D(()=>{cQ();CN=Jg({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage auto top-up"}},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View invoice"}},BILLING_INVOICE_PAYMENT_FAILED:{value:"billing_invoice_payment_failed",label:"Billing invoice payment failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED:{value:"billing_subscription_cancellation_scheduled",label:"Billing cancellation scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage subscription"}},BILLING_SUBSCRIPTION_CANCELED:{value:"billing_subscription_canceled",label:"Billing subscription canceled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_PAYMENT_METHOD_EXPIRING:{value:"billing_payment_method_expiring",label:"Billing payment method expiring",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_PAYMENT_METHOD_CHANGED:{value:"billing_payment_method_changed",label:"Billing payment method changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Review payment method"}},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}}})});var scA;var pcA=D(()=>{cQ();scA=Jg({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var AEA;var tEA=D(()=>{cQ();AEA=Jg({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]}})});var gEA;var nEA=D(()=>{cQ();gEA=Jg({PROJECT_CREATED:{value:"project_created",label:"Project created",scope:"org",defaultOff:!0},PROJECT_DELETED:{value:"project_deleted",label:"Project deleted",scope:"org",defaultOff:!0},MEMBER_INVITED:{value:"member_invited",label:"Member invited",scope:"org",defaultOff:!0},USER_REMOVED:{value:"user_removed",label:"Member removed",scope:"org",defaultOff:!0},MCP_CONNECTOR_ADDED:{value:"mcp_connector_added",label:"MCP connector added",scope:"org",defaultOff:!0},MCP_CONNECTOR_REMOVED:{value:"mcp_connector_removed",label:"MCP connector removed",scope:"org",defaultOff:!0},SECRET_KEY_CREATED:{value:"secret_key_created",label:"Secret key created",scope:"org",defaultOff:!0},SECRET_KEY_DELETED:{value:"secret_key_deleted",label:"Secret key deleted",scope:"org",defaultOff:!0}})});var iEA;var QEA=D(()=>{cQ();iEA=Jg({SANDBOX_CREATED:{value:"sandbox_created",label:"Sandbox connected",scope:"project",defaultOff:!0},SANDBOX_DELETED:{value:"sandbox_deleted",label:"Sandbox disconnected",scope:"project",defaultOff:!0},LOG_SOURCE_CONNECTED:{value:"log_source_connected",label:"Log source connected",scope:"project",defaultOff:!0},LOG_SOURCE_DISCONNECTED:{value:"log_source_disconnected",label:"Log source disconnected",scope:"project"},GITHUB_CONNECTED:{value:"github_connected",label:"GitHub connected",scope:"project",defaultOff:!0},GITHUB_DISCONNECTED:{value:"github_disconnected",label:"GitHub disconnected",scope:"project"},CODE_REPO_CONNECTED:{value:"code_repo_connected",label:"Code repository connected",scope:"project",defaultOff:!0},CODE_REPO_DISCONNECTED:{value:"code_repo_disconnected",label:"Code repository disconnected",scope:"project"},PUBLIC_KEY_DEACTIVATED:{value:"public_key_deactivated",label:"Public key deactivated",scope:"project"}})});var oEA;var IEA=D(()=>{cQ();oEA=Jg({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var nz,Yt,wxA,iz=(A)=>{let t=wxA.get(A)?.label;if(t)return t;let g=A.replace(/_/g," ").trim();return g?g.charAt(0).toUpperCase()+g.slice(1):A};var by=D(()=>{dcA();gz();gz();pcA();tEA();nEA();QEA();IEA();cQ();nz={...oEA,...gEA,...scA,...qcA,...AEA,...iEA,...CN},Yt=Object.fromEntries(Object.entries(nz).map(([A,t])=>[A,t.value])),wxA=new Map(Object.values(nz).map((A)=>[A.value,A]))});var cN,BEA,c2t,fi,E2t;var KI=D(()=>{by();ry();ry();cN=Object.values(Yt),BEA=[Yt.BILLING_PLAN_UPGRADE_APPLIED,Yt.BILLING_PLAN_DOWNGRADE_SCHEDULED,Yt.BILLING_PLAN_DOWNGRADE_APPLIED,Yt.BILLING_CREDIT_BALANCE_LOW,Yt.BILLING_CREDIT_BALANCE_DEPLETED,Yt.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,Yt.BILLING_AUTO_TOP_UP_FAILED,Yt.BILLING_INVOICE_PAID,Yt.BILLING_NEGATIVE_BALANCE_COLLECTED,Yt.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED,Yt.BILLING_INVOICE_PAYMENT_FAILED,Yt.BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED,Yt.BILLING_SUBSCRIPTION_CANCELED,Yt.BILLING_PAYMENT_METHOD_EXPIRING,Yt.BILLING_PAYMENT_METHOD_CHANGED],c2t=new Set(BEA),fi=[Yt.ISSUE_TRIGGERED,Yt.ISSUE_RESOLVED,Yt.ISSUE_IGNORED,Yt.AUTOMATION_RUN_FAILED],E2t=new Set(fi)});var Ny,hEA,CEA=(A)=>typeof A==="string"&&(A in hEA)?hEA[A]:A,bxA;var cEA=D(()=>{ry();TA();KI();Ny=I.enum(cN),hEA={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},bxA=I.preprocess(CEA,Ny)});var NxA;var EEA=D(()=>{by();KI();NxA=fi.map((A)=>({notificationType:A,label:iz(A)}))});var yEA=D(()=>{by();KI()});var DEA=D(()=>{ry();by();KI();cEA();EEA();yEA()});var aEA=()=>{};var wEA=D(()=>{KI()});var rEA=D(()=>{KI()});var Qz=D(()=>{aEA();wEA();rEA();DEA()});var LxA,SxA,lxA,MxA,YxA,$xA,kxA,oz,$4t;var bEA=D(()=>{Qz();TA();VA();LxA=I.enum(["ready","missing","degraded","unavailable"]),SxA=I.object({id:I.string(),label:I.string(),status:I.enum(["active","inactive","degraded"]),statusLabel:I.string()}),lxA=I.object({channel:hN,name:I.string(),description:I.string(),scope:I.enum(["personal","project"]),enabled:I.boolean().nullable(),preferenceId:I.string().nullable(),prerequisite:I.object({status:LxA,statusLabel:I.string(),message:I.string()}),action:I.object({label:I.string(),href:I.string()}).nullable(),destinations:I.array(SxA),destinationManagement:I.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:I.boolean(),supportedNotificationTypes:I.array(Ny)}),MxA=I.object({channel:Fo,enabled:I.boolean(),preferenceId:I.string().nullable()}),YxA=I.object({channel:Fo,notificationType:Ny,enabled:I.boolean(),preferenceId:I.string()}),$xA=I.object({projectId:I.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),kxA=I.object({channelCards:I.array(lxA).length(10),channels:I.array(MxA),notificationTypePreferences:I.array(YxA),issueNotificationMinSeverity:I.enum(["low","medium","high","critical"])}),oz=L({operationId:"notificationChannels.getProject",summary:"List Project Notification Channels",description:"List a project's notification channels with preferences, prerequisites, connection state, configured destinations, and supported notification types.",backend:"api",route:{method:"GET",path:"/notification-channels",tags:["Notification channels"]},input:$xA,output:kxA,pagination:"none",async:"sync"}),$4t={getProject:oz.contract}});var NEA,ez,uEA,Bz,R4t,f4t,hz,Cz=(A,t)=>{if((A.componentIds?.length||A.componentId)&&"componentIds"in A.condition&&A.condition.componentIds?.length)t.addIssue({code:"custom",path:["condition","componentIds"],message:"Use componentIds instead of legacy condition.componentIds."});if(A.componentIds?.length&&A.componentId)t.addIssue({code:"custom",path:["componentId"],message:"Use componentIds instead of componentId."})},P4t,UEA,Iz,cz,uy,FEA,GxA,JxA,TxA,RxA,fxA,PxA,zxA,OxA,vxA,Ez,yz,Dz,az,wz,z4t;var LEA=D(()=>{Qz();TA();VA();NEA=I.enum(["low","medium","high","critical"]),ez=I.object({severities:I.array(NEA).min(1).optional()}).strict(),uEA=I.object({componentIds:I.array(I.string().uuid()).min(1).optional(),severities:I.array(NEA).min(1).optional()}).strict(),Bz=I.object({channel:Fo,destinationKey:I.string().min(1)}),R4t=I.object({destinations:I.array(Bz).min(1),notificationTypes:I.array(I.enum(fi)).min(1),componentIds:I.array(I.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),includeDescendants:I.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:ez}),f4t=I.object({destinations:I.array(Bz).min(1),notificationTypes:I.array(I.enum(fi)).min(1),condition:uEA}),hz=I.object({destinations:I.array(Bz).min(1),notificationTypes:I.array(I.enum(fi)).min(1),componentIds:I.array(I.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),componentId:I.string().uuid().optional().describe("Deprecated single-component compatibility input."),includeDescendants:I.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:I.union([ez,uEA])}),P4t=hz.superRefine(Cz),UEA=I.object({id:I.string(),channel:Fo,destinationKey:I.string(),displayName:I.string()}),Iz=I.object({id:I.string().uuid(),label:I.string(),lifecycle:I.enum(["active","retired","merged"])}),cz=I.object({id:I.string().uuid(),projectId:I.string().uuid(),notificationTypes:I.array(I.enum(fi)),destinations:I.array(UEA),condition:ez,component:Iz.nullable(),componentId:I.string().uuid().nullable(),includeDescendants:I.boolean(),suspendedAt:I.string().datetime().nullable(),suspensionReason:I.string().nullable(),components:I.array(Iz),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),uy=I.object({projectId:I.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),FEA=I.string().uuid().describe("Logical notification delivery rule ID."),GxA=uy,JxA=I.object({rules:I.array(cz)}),TxA=I.object({destinations:I.array(UEA),notificationTypes:I.array(I.object({notificationType:I.enum(fi),label:I.string(),conditions:I.array(I.enum(["component","severity"]))})),components:I.array(Iz)}),RxA=uy.extend(hz.shape).superRefine(Cz),fxA=cz,PxA=uy.extend({...hz.shape,ruleId:FEA}).superRefine(Cz),zxA=cz,OxA=uy.extend({ruleId:FEA}),vxA=I.object({removed:I.boolean()}),Ez=L({operationId:"notificationDeliveryRules.list",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:GxA,output:JxA,pagination:"none",async:"sync"}),yz=L({operationId:"notificationDeliveryRules.options",description:"List available destinations, events, and conditions for project delivery rules.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules/options",tags:["Notification delivery rules"]},input:uy,output:TxA,pagination:"none",async:"sync"}),Dz=L({operationId:"notificationDeliveryRules.create",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:RxA,output:fxA,pagination:"none",async:"sync"}),az=L({operationId:"notificationDeliveryRules.update",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:PxA,output:zxA,pagination:"none",async:"sync"}),wz=L({operationId:"notificationDeliveryRules.delete",description:"Delete a positive delivery rule without deleting its reusable destinations.",backend:"api",route:{method:"DELETE",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:OxA,output:vxA,pagination:"none",async:"sync"}),z4t={list:Ez.contract,options:yz.contract,create:Dz.contract,update:az.contract,delete:wz.contract}});var rz,ZxA,WxA,VxA,XxA,HxA,KxA,bz,jxA,_xA,Nz,mxA,xxA,uz,qxA,dxA,Uz,sxA,pxA,Fz,W4t;var SEA=D(()=>{TA();VA();rz=I.enum(["verify-email","accept-invite","create-organization","billing","configure-project","connect-github-account","install-github-app","configure-code-search","install-slack-app","configure-slack-notifications","trigger-issue","confirm-issue","finish"]),ZxA=I.enum(["needs-onboarding","blocked","ready"]),WxA=I.enum(["incomplete","complete","skipped"]),VxA=I.object({invitationId:I.string(),organizationId:I.string(),organizationName:I.string(),organizationSlug:I.string(),organizationImageUrl:I.string().nullable(),inviterName:I.string().nullable()}),XxA=I.object({gate:ZxA,canonicalStep:rz.nullable(),organizationId:I.string().nullable(),projectId:I.string().nullable(),completionByStep:I.record(rz,WxA),githubSkipped:I.boolean(),githubAppSkipped:I.boolean(),slackSkipped:I.boolean(),sampleIssueId:I.string().nullable(),actorRole:I.enum(["admin","member"]).nullable(),requiredStep:I.union([rz,I.literal("select-organization")]).nullable(),isCompleted:I.boolean(),onboardingRecommendationsThreadId:I.string().nullable(),hasOrganizations:I.boolean(),hasPaidBillingSubscription:I.boolean(),billingStepEnabled:I.boolean(),pendingInvitations:I.array(VxA)}),HxA=I.object({projectId:I.string().uuid().optional().describe("Project whose onboarding state to bind (sample-issue attempt and project-scoped facts). Auto-filled from CLI and SDK context when omitted.")}),KxA=I.object({onboarding:XxA}),bz=L({operationId:"onboarding.getState",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:HxA,output:KxA,pagination:"none",async:"sync"}),jxA=I.object({integration:I.enum(["github","slack"]).describe("Integration onboarding step to skip."),projectId:I.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),_xA=I.object({skipped:I.literal(!0)}),Nz=L({operationId:"onboarding.skipIntegration",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:jxA,output:_xA,pagination:"none",async:"sync"}),mxA=I.object({projectId:I.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),xxA=I.object({skipped:I.literal(!0)}),uz=L({operationId:"onboarding.skipGithubAppInstallation",summary:"Skip GitHub App Installation",description:"Skip GitHub App installation during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-github-app",tags:["Onboarding"]},input:mxA,output:xxA,pagination:"none",async:"sync"}),qxA=I.object({projectId:I.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),dxA=I.object({skipped:I.literal(!0)}),Uz=L({operationId:"onboarding.skipSampleIssue",summary:"Skip Test Issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:qxA,output:dxA,pagination:"none",async:"sync"}),sxA=I.object({projectId:I.string().uuid().describe("Project that completed onboarding.")}),pxA=I.object({completed:I.boolean()}),Fz=L({operationId:"onboarding.finish",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:sxA,output:pxA,pagination:"none",async:"sync"}),W4t={getState:bz.contract,skipIntegration:Nz.contract,skipGithubAppInstallation:uz.contract,skipSampleIssue:Uz.contract,finish:Fz.contract}});var EN,AqA,tqA,gqA,nqA,iqA,QqA,oqA,IqA,eqA,BqA,Lz,Sz,lz,Mz,j4t;var lEA=D(()=>{TA();VA();iN();EN=I.object({id:I.string().min(1),name:I.string(),slug:I.string(),logo:I.string().nullable().optional()}),AqA=EN.extend({role:Uo.optional()}),tqA=I.object({}),gqA=I.object({organizations:I.array(AqA).describe("Organizations available to the current credential.")}),nqA=I.object({organizationId:I.string().min(1).describe("Organization ID to fetch.")}),iqA=I.object({organization:EN}),QqA=I.object({organizationId:I.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:I.string().trim().min(1).max(100).describe("New organization name.")}),oqA=I.object({organization:EN.describe("Updated organization.")}),IqA=I.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),eqA=I.object({name:IqA.describe("Organization display name.")}),BqA=I.object({organization:EN}),Lz=L({operationId:"organizations.create",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:eqA,output:BqA,pagination:"none",async:"sync"}),Sz=L({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:tqA,output:gqA,pagination:"none",async:"sync"}),lz=L({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:nqA,output:iqA,pagination:"none",async:"sync"}),Mz=L({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:QqA,output:oqA,pagination:"none",async:"sync",examples:[{name:"rename-organization",input:{organizationId:"organization-123",name:"Observed Platform"},output:{organization:{id:"organization-123",name:"Observed Platform",slug:"acme",logo:null}}}]}),j4t={list:Sz.contract,get:lz.contract,create:Lz.contract,update:Mz.contract}});var Zh,Uy,MEA,YEA,$EA,kEA,GEA,JEA,TEA,yN,DN,aN,REA,fEA,wN,PEA,zEA,rN,hqA;var Yz=D(()=>{TA();VA();Zh=I.enum(["us-east-1","us-east-2","us-west-1","us-west-2","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3"]),Uy=I.object({id:I.string().uuid(),organizationId:I.string().min(1),name:I.string(),region:Zh}),MEA=I.object({organizationId:I.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted.")}),YEA=I.object({projects:I.array(Uy).describe("Projects visible within the selected organization.")}),$EA=I.object({projectId:I.string().uuid().describe("Project ID to fetch.")}),kEA=I.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),GEA=I.object({organizationId:I.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted."),name:kEA.describe("Project name."),region:Zh.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),JEA=I.object({project:Uy}),TEA=I.object({project:Uy}),yN=L({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:MEA,output:YEA,pagination:"none",async:"sync"}),DN=L({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:$EA,output:TEA,pagination:"none",async:"sync"}),aN=L({operationId:"projects.create",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:GEA,output:JEA,pagination:"none",async:"sync"}),REA=I.object({projectId:I.string().uuid().describe("Project ID to update."),name:kEA.optional().describe("New project name.")}),fEA=I.object({project:Uy}),wN=L({operationId:"projects.update",description:"Update (rename) one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"PATCH",path:"/projects/{projectId}",tags:["Projects"]},input:REA,output:fEA,pagination:"none",async:"sync"}),PEA=I.object({projectId:I.string().uuid().describe("Project ID to delete.")}),zEA=I.void(),rN=L({operationId:"projects.delete",description:"Delete one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"DELETE",path:"/projects/{projectId}",successStatus:204,tags:["Projects"]},input:PEA,output:zEA,pagination:"none",async:"sync"}),hqA={list:yN.contract,get:DN.contract,create:aN.contract,update:wN.contract,delete:rN.contract}});var OEA,CqA,cqA,EqA,yqA,DqA,$z,p4t;var vEA=D(()=>{TA();VA();OEA=I.enum(["open","merged","closed"]),CqA=I.enum(["review_required","approved","changes_requested"]),cqA=I.enum(["passing","failing","pending"]),EqA=I.object({id:I.string().uuid(),projectId:I.string().uuid(),repositoryFullName:I.string(),pullRequestId:I.string().describe("Provider-native pull request identifier (GitHub PR number or Bitbucket PR id), serialized as a string."),githubPullRequestId:I.number().int().describe("Deprecated: use pullRequestId. Numeric form of the provider-native pull request identifier; kept for backward compatibility."),title:I.string().nullable(),url:I.string().nullable(),status:OEA.nullable(),reviewState:CqA.nullable(),checksState:cqA.nullable(),requestedByUserId:I.string().nullable(),authorLogin:I.string().nullable().describe("Forge login that authored the pull request (often the Sazabi app identity)."),githubAuthorLogin:I.string().nullable().describe("Deprecated: use authorLogin. Kept for backward compatibility."),threadId:I.string().uuid().nullable(),runId:I.string().uuid().nullable(),createdAt:I.string().datetime(),mergedAt:I.string().datetime().nullable(),closedAt:I.string().datetime().nullable()}),yqA=I.object({projectId:I.string().uuid().optional().describe("Project to list pull requests for. Auto-filled from CLI and SDK context when omitted."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of pull requests to return per page."),cursor:I.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:OEA.optional().describe("Filter by pull request status (open, merged, or closed)."),repositoryFullName:I.string().trim().optional().describe("Filter by repository full name, for example owner/repo. Case-insensitive."),requestedByUserId:I.string().trim().optional().describe("Filter by the Sazabi user who requested the pull request. Pass 'me' to filter to the authenticated user.")}),DqA=I.object({pullRequests:I.array(EqA),nextCursor:I.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),$z=L({operationId:"pullRequests.list",description:"List pull requests that Sazabi opened, optionally filtered by status, repository, and requesting user.",backend:"api",route:{method:"GET",path:"/pull-requests",tags:["Pull Requests"]},input:yqA,output:DqA,pagination:"cursor",async:"sync"}),p4t={list:$z.contract}});var ZEA,WEA,VEA,XEA,HEA,Fy;var kz=D(()=>{TA();VA();ZEA=I.enum(["log_source","mcp_connector","sandbox_cli","integration"]),WEA=I.enum(["connected","recommended"]),VEA=I.object({kind:ZEA.describe("What the recommendation targets: a log source, MCP connector, sandbox CLI, or integration."),targetId:I.string().describe("Exact catalog id for the kind (log source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:WEA.describe("Resolved live against current connections: connected (already set up) or recommended (suggested, not yet connected)."),roiScore:I.number().int().min(0).max(100).describe("Intrinsic ROI score, 0–100 — a normalized blend of how valuable, how easy to connect, and how proven the item is. A pure function of the item; computed live on read, never stored."),priority:I.number().int().min(1).describe("1-based rank within this list, sorted by roiScore (best first). Items are already returned in priority order; the field lets consumers recover the rank without trusting array position.")}),XEA=I.object({projectId:I.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),HEA=I.object({recommendations:I.array(VEA).describe("The project's configuration recommendations, deduped by (kind, targetId), with status resolved live and each item's ROI score. Returned in priority order (highest roiScore first).")}),Fy=L({operationId:"recommendations.list",description:"List a project's configuration recommendations (data sources, MCP connectors, sandbox CLIs, and integrations) with each item's live connection status.",backend:"api",route:{method:"GET",path:"/recommendations",tags:["Recommendations"]},input:XEA,output:HEA,pagination:"none",async:"sync"})});var KEA,Gz,jEA,_EA,mEA,xEA,qEA,dEA,Ly,Sy,ly;var Jz=D(()=>{TA();VA();KEA=I.enum(["github","bitbucket"]),Gz=I.object({id:I.string().uuid().describe("Repository row id — stable across access sources; use it as the path id for repos.remove."),accessSourceId:I.string().uuid().describe("Access source granting this view of the repository (GitHub App installation, personal connection, or integration). Pass to repos.add to link the repository through this source."),source:I.enum(["githubApp","personal","integration"]).describe("Kind of access source granting this view: an organization GitHub App installation, the caller's personal forge connection, or an organization integration."),sourceLabel:I.string().describe('Display label for the access source (e.g. "GitHub app", "Personal").'),provider:KEA.describe("Forge hosting the repository."),owner:I.string().describe("Repository owner (user or organization)."),name:I.string().describe("Repository name without the owner."),fullName:I.string().describe("Full name in owner/name form."),defaultBranch:I.string().nullable().describe("Default branch, when the forge reports one."),isPrivate:I.boolean().describe("Whether the repository is private."),linked:I.boolean().describe("Whether the repository is already linked to the project.")}),jEA=I.object({projectId:I.string().uuid().optional().describe("Project to list repositories for. Auto-filled from CLI and SDK context when omitted.")}),_EA=I.object({repos:I.array(Gz).describe("Every repository available to the project's organization (from GitHub App installations, the caller's personal forge connections, and integrations), with `linked` marking the ones already linked to the project.")}),mEA=I.object({projectId:I.string().uuid().optional().describe("Project to link the repositories to. Auto-filled from CLI and SDK context when omitted."),accessSourceIds:I.array(I.string().uuid()).min(1).describe("Access source ids (from repos.list) to link. Select only one access source per repository.")}),xEA=I.object({repos:I.array(Gz).describe("The now-linked repositories.")}),qEA=I.object({id:I.string().uuid().describe("Repository row id (from repos.list) to unlink."),projectId:I.string().uuid().optional().describe("Project to unlink the repository from. Auto-filled from CLI and SDK context when omitted.")}),dEA=I.void(),Ly=L({operationId:"repos.list",description:"List the repositories available to a project — every repository reachable through the organization's GitHub App installations, the caller's personal forge connections, and integrations — with each one's linked status.",backend:"api",route:{method:"GET",path:"/repos",tags:["Repos"]},input:jEA,output:_EA,pagination:"none",async:"sync"}),Sy=L({operationId:"repos.add",description:"Link repositories to a project by access source id. Select only one access source per repository; re-linking an already-linked repository refreshes its selected access source.",backend:"api",route:{method:"POST",path:"/repos",tags:["Repos"]},input:mEA,output:xEA,pagination:"none",async:"sync"}),ly=L({operationId:"repos.remove",description:"Unlink a repository from a project by repository row id.",backend:"api",route:{method:"DELETE",path:"/repos/{id}",successStatus:204,tags:["Repos"]},input:qEA,output:dEA,pagination:"none",async:"sync"})});var sEA,aqA,pEA,bN,AyA,tyA,gyA,nyA,Wh,Tz,iyA,QyA,Vh,oyA,IyA,Xh,eyA,ByA,Hh,wqA;var Rz=D(()=>{TA();VA();sEA=I.object({type:I.string().describe("Preset type identifier."),label:I.string().describe("Human-readable display name."),executableNames:I.array(I.string()).describe("CLI binary names installed by this preset."),envVarKeys:I.array(I.string()).describe("Environment variables required for authentication."),setupSkill:I.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),aqA=I.object({}),pEA=I.object({types:I.array(sEA)}),bN=L({operationId:"sandboxPresets.listTypes",description:"List all supported sandbox CLI types with their environment variable requirements and setup skills.",backend:"api",route:{method:"GET",path:"/sandbox-presets/types",tags:["Sandbox Presets"]},input:aqA,output:pEA,pagination:"none",async:"sync"}),AyA=I.enum(["github_app","bitbucket_integration","personal_access_token","stored_credentials"]),tyA=I.object({presetType:I.string().describe("Preset type identifier."),credentialSource:AyA.describe("Authoritative credential source for the preset."),isSystemManaged:I.boolean().describe("Whether the connection follows an integration lifecycle."),fallbackConfigured:I.boolean().describe("Whether user-provided fallback credentials are stored for this preset."),envVarKeys:I.array(I.string()).describe("Stored environment variable names. Secret values are omitted.")}),gyA=I.object({projectId:I.string().uuid().optional().describe("Project to inspect. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted.")}),nyA=I.object({connections:I.array(tyA)}),Wh=L({operationId:"sandboxPresets.listConnections",description:"List a project's stored and integration-backed sandbox CLI connections without returning secret values.",backend:"api",route:{method:"GET",path:"/sandbox-presets/connections",tags:["Sandbox Presets"]},input:gyA,output:nyA,pagination:"none",async:"sync"}),Tz=I.object({key:I.string().min(1).max(256).regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable keys must match /^[A-Za-z_][A-Za-z0-9_]*$/.").describe("Environment variable name (e.g. KUBECONFIG_CONTENTS)."),value:I.string().max(10240).describe("Secret value. Encrypted at rest; never returned by any API response.")}),iyA=I.object({projectId:I.string().uuid().optional().describe("Project to configure. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:I.string().min(1).describe("Preset type identifier (e.g. kubectl, aws, github)."),environmentVariables:I.array(Tz).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),QyA=I.object({projectId:I.string().uuid().describe("Project the preset was written to."),presetType:I.string().describe("Preset type that was upserted."),envVarKeys:I.array(I.string()).describe("Env var key names now stored for this preset. Values are never returned.")}),Vh=L({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI connection",description:"Set or replace a project's CLI connection credentials (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires write access to the target project.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:iyA,output:QyA,pagination:"none",async:"sync"}),oyA=I.object({projectId:I.string().uuid().optional().describe("Project to update. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:I.string().min(1).describe("Preset type identifier.")}),IyA=I.object({projectId:I.string().uuid().describe("Project the CLI connection belonged to."),presetType:I.string().describe("Preset type that was disconnected."),deleted:I.boolean().describe("Whether a stored CLI connection was deleted.")}),Xh=L({operationId:"sandboxPresets.deletePreset",summary:"Disconnect CLI",description:"Delete a project's stored CLI connection. Integration-managed access remains available until its owning integration is disconnected.",backend:"api",route:{method:"DELETE",path:"/sandbox-presets/config/{presetType}",tags:["Sandbox Presets"]},input:oyA,output:IyA,pagination:"none",async:"sync"}),eyA=I.object({projectId:I.string().uuid().optional().describe("Project to test from. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:I.string().min(1).describe("Preset type identifier."),environmentVariables:I.array(Tz).max(100).describe("Unsaved credentials to validate in a readonly sandbox.")}),ByA=I.object({status:I.enum(["success","failed"]),message:I.string().nullable(),stdout:I.string().describe("Truncated command output with submitted credentials redacted."),stderr:I.string().describe("Truncated command errors with submitted credentials redacted.")}),Hh=L({operationId:"sandboxPresets.testPreset",summary:"Test CLI connection",description:"Validate unsaved CLI credentials in a read-only ephemeral sandbox without persisting them.",backend:"api",route:{method:"POST",path:"/sandbox-presets/test",tags:["Sandbox Presets"]},input:eyA,output:ByA,pagination:"none",async:"sync"}),wqA={deletePreset:Xh.contract,listConnections:Wh.contract,listTypes:bN.contract,testPreset:Hh.contract,upsertPreset:Vh.contract}});var NN,hyA=1048576,fz,CyA,Pz,rqA,bqA,NqA,uqA,UqA,FqA,LqA,SqA,lqA,MqA,zz,Oz,vz,Zz,Wz,cZt;var cyA=D(()=>{TA();VA();NN=I.string().min(1).max(64).regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/,"Name must start with a letter or digit and contain only letters, digits, underscores, and hyphens (max 64 characters).").describe("Script name. Must be unique within the project among non-deleted scripts."),fz=I.string().min(1).refine((A)=>new TextEncoder().encode(A).length<=hyA,{message:`Script content must be at most ${hyA} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),CyA=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),description:I.string().nullable(),contentHash:I.string().describe("sha256 hex digest of the script content."),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),Pz=CyA.extend({content:fz}),rqA=I.object({projectId:I.string().uuid().optional().describe("Project to list scripts for. Auto-filled from CLI and SDK context when omitted."),search:I.string().optional().describe("Case-insensitive partial match on script name."),cursor:I.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:I.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of scripts to return per page.")}),bqA=I.object({scripts:I.array(CyA),nextCursor:I.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),NqA=I.object({name:NN.describe("Script name to fetch."),projectId:I.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),uqA=I.object({script:Pz}),UqA=I.object({projectId:I.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:NN.describe("Script name. Must be unique within the project among non-deleted scripts."),content:fz,description:I.string().max(500).nullable().optional().describe("Optional human-readable description.")}),FqA=I.object({script:Pz}),LqA=I.object({name:NN.describe("Script to update."),projectId:I.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),content:fz.optional().describe("New script body. Omit to leave content unchanged."),description:I.string().max(500).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged.")}),SqA=I.object({script:Pz}),lqA=I.object({name:NN.describe("Script to delete."),projectId:I.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),MqA=I.void(),zz=L({operationId:"scripts.list",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:rqA,output:bqA,pagination:"cursor",async:"sync"}),Oz=L({operationId:"scripts.get",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:NqA,output:uqA,pagination:"none",async:"sync"}),vz=L({operationId:"scripts.create",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:UqA,output:FqA,pagination:"none",async:"sync"}),Zz=L({operationId:"scripts.update",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:LqA,output:SqA,pagination:"none",async:"sync"}),Wz=L({operationId:"scripts.delete",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:lqA,output:MqA,pagination:"none",async:"sync"}),cZt={list:zz.contract,get:Oz.contract,create:vz.contract,update:Zz.contract,delete:Wz.contract}});var Vz,EyA,yyA,DyA,ayA,Kh,jh,YqA;var Xz=D(()=>{TA();VA();Vz=I.object({projectId:I.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:I.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:I.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:I.coerce.number().min(1).default(1).describe("One-based page number.")}),EyA=Vz.extend({status:I.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),yyA=Vz.extend({threadId:I.string().uuid().optional().describe("Optional thread restriction for message search."),role:I.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),DyA=I.object({threads:I.array(I.object({id:I.string().uuid(),projectId:I.string().uuid().optional(),title:I.string(),status:I.enum(["regular","archived"]),labels:I.array(I.string()),createdAt:I.string().datetime(),updatedAt:I.string().datetime(),highlights:I.array(I.string()),score:I.number().optional()})),pagination:I.object({page:I.number(),limit:I.number(),totalResults:I.number(),totalPages:I.number()}).describe("Page-based pagination metadata for the current search result.")}),ayA=I.object({messages:I.array(I.object({id:I.string().uuid(),threadId:I.string().uuid(),threadTitle:I.string(),role:I.enum(["user","assistant"]),content:I.string(),createdAt:I.string().datetime(),updatedAt:I.string().datetime(),highlights:I.array(I.string()),score:I.number().optional()})),pagination:I.object({page:I.number(),limit:I.number(),totalResults:I.number(),totalPages:I.number()}).describe("Page-based pagination metadata for the current search result.")}),Kh=L({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:EyA,output:DyA,pagination:"page",async:"sync",examples:[{name:"search-open-incidents",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"payment timeout",status:"regular",limit:10,page:1},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"Payment timeout in us-west-2",status:"regular",labels:["payments","timeout"],createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["payment timeout"],score:123.45}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),jh=L({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:yyA,output:ayA,pagination:"page",async:"sync",examples:[{name:"search-assistant-messages",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"rollback",role:"assistant",limit:10,page:1},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",threadId:"22222222-2222-4222-8222-222222222222",threadTitle:"Deployment rollback guidance",role:"assistant",content:"Rollback the ingestion deployment and confirm queue depth.",createdAt:"2026-01-02T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["Rollback the ingestion deployment"],score:98.76}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),YqA={threads:Kh.contract,messages:jh.contract}});var uN,wyA,Hz,My,$qA,kqA,GqA,JqA,TqA,RqA,fqA,PqA,zqA,OqA,Kz,jz,_z,mz,xz,vqA,ZqA,qz,bZt;var ryA=D(()=>{TA();VA();uN=I.string().uuid().describe("Signal definition ID."),wyA=I.string().min(1).max(200).describe("Human-readable expression name."),Hz=I.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),My=I.object({id:I.string().uuid(),projectId:I.string().uuid(),name:I.string(),expression:Hz,enabled:I.boolean(),compiledVersion:I.number().int(),linkedAutomationIds:I.array(I.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:I.string().datetime(),updatedAt:I.string().datetime()}),$qA=I.object({projectId:I.string().uuid().optional().describe("Project to list signal definitions for. Auto-filled from CLI and SDK context when omitted.")}),kqA=I.object({signalDefinitions:I.array(My)}),GqA=I.object({signalDefinitionId:uN,projectId:I.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),JqA=I.object({signalDefinition:My}),TqA=I.object({projectId:I.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:wyA,expression:Hz,enabled:I.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),RqA=I.object({signalDefinition:My}),fqA=I.object({signalDefinitionId:uN,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:wyA.optional(),expression:Hz.optional(),enabled:I.boolean().optional().describe("Whether the expression is enabled.")}),PqA=I.object({signalDefinition:My}),zqA=I.object({signalDefinitionId:uN,projectId:I.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),OqA=I.object({signalDefinition:My}),Kz=L({operationId:"signalDefinitions.list",description:"List signal definitions in a project.",backend:"api",route:{method:"GET",path:"/signal-definitions",tags:["Signal definitions"]},input:$qA,output:kqA,pagination:"none",async:"sync"}),jz=L({operationId:"signalDefinitions.get",description:"Get a single signal definition by ID.",backend:"api",route:{method:"GET",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:GqA,output:JqA,pagination:"none",async:"sync"}),_z=L({operationId:"signalDefinitions.create",description:"Create a CEL signal definition for a project.",backend:"api",route:{method:"POST",path:"/signal-definitions",successStatus:201,tags:["Signal definitions"]},input:TqA,output:RqA,pagination:"none",async:"sync"}),mz=L({operationId:"signalDefinitions.update",description:"Update a signal definition's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:fqA,output:PqA,pagination:"none",async:"sync"}),xz=L({operationId:"signalDefinitions.disable",description:"Disable a signal definition so it stops matching logs.",backend:"api",route:{method:"POST",path:"/signal-definitions/{signalDefinitionId}/disable",tags:["Signal definitions"]},input:zqA,output:OqA,pagination:"none",async:"sync"}),vqA=I.object({signalDefinitionId:uN,projectId:I.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),ZqA=I.void(),qz=L({operationId:"signalDefinitions.delete",description:"Permanently delete a signal definition.",backend:"api",route:{method:"DELETE",path:"/signal-definitions/{signalDefinitionId}",successStatus:204,tags:["Signal definitions"]},input:vqA,output:ZqA,pagination:"none",async:"sync"}),bZt={list:Kz.contract,get:jz.contract,create:_z.contract,update:mz.contract,disable:xz.contract,delete:qz.contract}});var byA;var NyA=D(()=>{byA=["onboarding","setup"]});var uyA,UyA,FyA,LyA,Yy;var dz=D(()=>{NyA();TA();VA();uyA=I.enum(byA),UyA=I.object({id:I.string().describe("Unique task identifier (e.g. install_github_app)."),label:I.string().describe("Short human-readable task name."),description:I.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:I.string().describe("Step-by-step instructions for completing this task."),completed:I.boolean().describe("Whether the task has been completed."),completedAt:I.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:uyA.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),FyA=I.object({projectId:I.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),LyA=I.object({tasks:I.array(UyA).describe("All onboarding and setup tasks with their current completion status.")}),Yy=L({operationId:"tasks.list",description:"List all onboarding and setup tasks for a project, including their current completion status and a description of what is required to complete each task.",backend:"api",route:{method:"GET",path:"/tasks",tags:["Tasks"]},input:FyA,output:LyA,pagination:"none",async:"sync"})});var WqA,VqA,jI,XqA,HqA,KqA,jqA,_qA,mqA,xqA,qqA,dqA,sqA,pqA,AdA,tdA,gdA,sz,pz,AO,tO,gO,nO,iO,YZt;var SyA=D(()=>{TA();VA();WqA=I.object({id:I.string().uuid().describe("Team ID."),name:I.string().describe("Team name, unique among the org's active teams."),description:I.string().nullable().describe("Optional team description."),createdAt:I.string().datetime().describe("When the team was created."),memberCount:I.number().int().nonnegative().describe("Number of active members in the team.")}),VqA=I.object({userId:I.string().min(1).describe("User ID of the team member."),name:I.string().nullable().describe("Display name for the member, when available."),email:I.string().email().describe("Email address for the member."),addedAt:I.string().datetime().describe("When the member was added to the team.")}),jI=I.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),XqA=I.object({organizationId:jI}),HqA=I.object({teams:I.array(WqA).describe("Active teams in the organization.")}),KqA=I.object({organizationId:jI,name:I.string().trim().min(1).describe("Team name."),description:I.string().trim().min(1).optional().describe("Optional team description.")}),jqA=I.object({id:I.string().uuid().describe("ID of the created team.")}),_qA=I.object({organizationId:jI,teamId:I.string().uuid().describe("Team to update."),name:I.string().trim().min(1).optional().describe("New team name."),description:I.string().trim().min(1).nullable().optional().describe("New team description; null clears it.")}),mqA=I.object({id:I.string().uuid().describe("ID of the updated team.")}),xqA=I.object({params:I.object({teamId:I.string().uuid().describe("Team to delete.")}),query:I.object({organizationId:jI})}).transform(({params:A,query:t})=>({...t,...A})),qqA=I.object({success:I.literal(!0).describe("The team and its memberships were removed.")}),dqA=I.object({organizationId:jI,teamId:I.string().uuid().describe("Team to add the member to."),userId:I.string().min(1).describe("User ID of an active organization member to add.")}),sqA=I.object({id:I.string().uuid().describe("ID of the team membership.")}),pqA=I.object({params:I.object({teamId:I.string().uuid().describe("Team to remove the member from."),userId:I.string().min(1).describe("User ID of the member to remove.")}),query:I.object({organizationId:jI})}).transform(({params:A,query:t})=>({...t,...A})),AdA=I.object({success:I.literal(!0).describe("The membership was removed.")}),tdA=I.object({organizationId:jI,teamId:I.string().uuid().describe("Team to list members for.")}),gdA=I.object({members:I.array(VqA).describe("Active members of the team.")}),sz=L({operationId:"teams.list",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:XqA,output:HqA,pagination:"none",async:"sync",examples:[{name:"organization-teams",input:{organizationId:"organization-123"},output:{teams:[{id:"5c0f9866-31ab-4237-94cc-a1d0ba2f6de2",name:"Payments",description:"Owns checkout and billing components.",createdAt:"2026-01-01T00:00:00.000Z",memberCount:4}]}}]}),pz=L({operationId:"teams.create",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:KqA,output:jqA,pagination:"none",async:"sync"}),AO=L({operationId:"teams.update",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:_qA,output:mqA,pagination:"none",async:"sync"}),tO=L({operationId:"teams.delete",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:xqA,output:qqA,pagination:"none",async:"sync"}),gO=L({operationId:"teams.addMember",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:dqA,output:sqA,pagination:"none",async:"sync"}),nO=L({operationId:"teams.removeMember",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:pqA,output:AdA,pagination:"none",async:"sync"}),iO=L({operationId:"teams.listMembers",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:tdA,output:gdA,pagination:"none",async:"sync"}),YZt={list:sz.contract,create:pz.contract,update:AO.contract,delete:tO.contract,addMember:gO.contract,removeMember:nO.contract,listMembers:iO.contract}});var ndA,idA,QdA,QO,odA,IdA,oO,edA,BdA,IO,JZt;var lyA=D(()=>{TA();VA();ndA=I.object({kind:I.enum(["user","workspace"]),name:I.string().optional(),email:I.string().optional()}),idA=I.object({container:I.string().min(1).describe("The container to create the work item in: its id, short key (e.g. a Linear team key like ENG), or display name."),title:I.string().min(1),bodyMarkdown:I.string().optional(),state:I.string().optional(),itemType:I.string().optional(),organizationId:I.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Defaults to the credential's active organization."),clientRequestId:I.string().min(1).optional().describe("Optional caller-supplied idempotency key. When provided, retrying the same logical create with the same clientRequestId reuses the original result instead of creating a duplicate external work item.")}).strict(),QdA=I.object({identifier:I.string(),title:I.string(),url:I.string(),state:I.string(),attribution:ndA.optional(),reused:I.boolean()}),QO=L({operationId:"work-items.create",description:"Create a work item (e.g. a Linear issue) in a connected issue tracker, attributing the write to the requesting user.",backend:"api",route:{method:"POST",path:"/work-items",tags:["Work Items"],successStatus:201},input:idA,output:QdA,pagination:"none",async:"sync"}),odA=I.object({itemId:I.string().min(1).describe("The work item to comment on."),bodyMarkdown:I.string().min(1),organizationId:I.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Defaults to the credential's active organization.")}).strict(),IdA=I.object({identifier:I.string(),url:I.string()}),oO=L({operationId:"work-items.comment",description:"Add a comment to an existing work item.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/comment",tags:["Work Items"]},input:odA,output:IdA,pagination:"none",async:"sync"}),edA=I.object({itemId:I.string().min(1).describe("The work item to transition."),state:I.string().min(1).describe("The target workflow state."),organizationId:I.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Defaults to the credential's active organization.")}).strict(),BdA=I.object({identifier:I.string(),title:I.string(),url:I.string(),state:I.string(),changed:I.boolean()}),IO=L({operationId:"work-items.transition",description:"Move a work item to a target workflow state.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/transition",tags:["Work Items"]},input:edA,output:BdA,pagination:"none",async:"sync"}),JZt={create:QO.contract,comment:oO.contract,transition:IO.contract}});var eO;var MyA=D(()=>{_W();pW();oY();cY();UV();KY();mY();IX();xw();v_();Lk();LP();iN();bcA();PP();KcA();bEA();LEA();SEA();lEA();Yz();vEA();kz();Jz();IN();Rz();cyA();Xz();ryA();dz();SyA();pP();lyA();eO={me:SP.contract,automations:{list:yY.contract,get:DY.contract,create:aY.contract,update:wY.contract,enable:rY.contract,disable:bY.contract,runs:{list:NY.contract,get:uY.contract,logs:UY.contract}},logs:{query:pe.contract,schema:AB.contract,volume:tB.contract,patterns:gB.contract,nativeQuery:nB.contract},logSources:{listProviders:Kw.contract,list:de.contract,create:se.contract,get:jw.contract,update:_w.contract,delete:mw.contract},logStreams:{list:wk.contract,create:rk.contract,get:bk.contract,update:Nk.contract,delete:uk.contract,reassign:Uk.contract},connectedAccounts:{beginConnect:eY.contract,getConnectAttempt:BY.contract,list:hY.contract,disconnect:CY.contract},integrations:{listProviders:tV.contract,listConnections:gV.contract,getConnection:nV.contract,createConnection:iV.contract,beginConnect:QV.contract,getConnectAttempt:oV.contract,disconnectConnection:IV.contract,updateConnectionCredentials:eV.contract,getOrganizationExternalIdentityJitPolicy:CV.contract,updateOrganizationExternalIdentityJitPolicy:cV.contract,getConnectionExternalIdentityJitPolicy:EV.contract,updateConnectionExternalIdentityJitPolicy:yV.contract,getSlackConfiguration:aV.contract,updateSlackConfiguration:wV.contract,listSlackChannelProjectMappings:bV.contract,setSlackChannelProjectMapping:NV.contract,deleteSlackChannelProjectMapping:uV.contract},notificationChannels:{getProject:oz.contract},notificationDeliveryRules:{list:Ez.contract,options:yz.contract,create:Dz.contract,update:az.contract,delete:wz.contract},mcpConnectors:{listProviders:nN.contract,list:Uh.contract,get:Fh.contract,details:Lh.contract,search:Sh.contract,describe:lh.contract,call:Mh.contract,create:Yh.contract,update:$h.contract,disconnect:kh.contract,setReadOnly:Gh.contract,beginOAuthInstall:Jh.contract,getOAuthInstallAttempt:Th.contract},sandboxPresets:{deletePreset:Xh.contract,listConnections:Wh.contract,listTypes:bN.contract,testPreset:Hh.contract,upsertPreset:Vh.contract},scripts:{list:zz.contract,get:Oz.contract,create:vz.contract,update:Zz.contract,delete:Wz.contract},logMatchExpressions:{list:dY.contract,get:sY.contract,create:pY.contract,update:A$.contract,disable:t$.contract},signalDefinitions:{list:Kz.contract,get:jz.contract,create:_z.contract,update:mz.contract,disable:xz.contract,delete:qz.contract},memory:{put:Rh.contract,get:fh.contract,list:Ph.contract,search:zh.contract,delete:Oh.contract},onboarding:{getState:bz.contract,skipIntegration:Nz.contract,skipGithubAppInstallation:uz.contract,skipSampleIssue:Uz.contract,finish:Fz.contract},organizations:{list:Sz.contract,get:lz.contract,create:Lz.contract,update:Mz.contract},members:{list:lP.contract,updateRole:MP.contract,remove:YP.contract,invite:$P.contract,listInvitations:kP.contract,revokeInvitation:GP.contract},teams:{list:sz.contract,create:pz.contract,update:AO.contract,delete:tO.contract,addMember:gO.contract,removeMember:nO.contract,listMembers:iO.contract},publicKeys:{list:Ke.contract,get:je.contract,ensureLogForwarding:_e.contract,update:me.contract,deactivate:xe.contract},secretKeys:{list:Pw.contract,get:zw.contract,create:Ow.contract,update:vw.contract,delete:Zw.contract},projects:{list:yN.contract,get:DN.contract,create:aN.contract,update:wN.contract,delete:rN.contract},search:{threads:Kh.contract,messages:jh.contract},messages:{list:XcA.contract,append:HcA.contract},threads:{list:VP.contract,get:XP.contract,getStatus:HP.contract,stop:KP.contract,create:jP.contract,update:_P.contract,fork:mP.contract,setVisibility:xP.contract,createShareLink:qP.contract,listShareLinks:dP.contract,revokeShareLink:sP.contract},runs:{list:zP.contract,listForThread:OP.contract,get:vP.contract,cancel:ZP.contract},pullRequests:{list:$z.contract},issues:{count:Sw.contract,create:He.contract,list:Fw.contract,search:Lw.contract,get:lw.contract,resolve:Mw.contract,ignore:Yw.contract,reopen:$w.contract,reassignAndReopen:kw.contract,mute:Gw.contract,unmute:Jw.contract},workItems:{create:QO.contract,comment:oO.contract,transition:IO.contract},billing:{getSummary:LY.contract,getUsage:SY.contract,listTransactions:lY.contract,getAutoTopUp:$Y.contract,updateAutoTopUp:kY.contract,purchaseCredits:GY.contract,listPlans:JY.contract,previewPlanChange:TY.contract,previewSubscriptionCancellation:vY.contract,scheduleSubscriptionCancellation:ZY.contract,resumeSubscriptionCancellation:WY.contract,changePlan:RY.contract,createCheckoutSession:fY.contract,getCheckoutSessionStatus:PY.contract,createPortalSession:zY.contract,getPaymentMethod:OY.contract},tasks:{list:Yy.contract},recommendations:{list:Fy.contract},repos:{list:Ly.contract,add:Sy.contract,remove:ly.contract},components:{list:tw.contract,get:gw.contract,register:Ve.contract,deregister:nw.contract,rename:iw.contract,assignTeam:Qw.contract,retirementPreview:ow.contract,retire:Iw.contract,restorationPreview:ew.contract,restore:Bw.contract,mergePreview:Dw.contract,merge:aw.contract,relationships:{list:hw.contract,preview:Cw.contract,add:cw.contract,remove:Ew.contract},incidents:{list:ww.contract},timeline:rw.contract}}});var _I=D(()=>{PZ();oY();cY();MyA();KY();mY();xw();Lk();LP();PP();Yz();kz();Jz();Rz();Xz();dz()});var hdA="https://api.sazabi.com",CdA="x-sazabi-client-source",$yA=(A)=>{return{streamRun:async(t)=>{return YyA({options:A,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal})},streamThread:async(t)=>{return YyA({options:A,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}}},YyA=async(A)=>{let t=A.options.fetch??globalThis.fetch;if(!t)throw Error("Fetch transport is not available in this runtime.");let g=await A.options.credentialProvider.getToken(),i=cdA(A.options.apiBaseUrl,A.path,A.cursor);return ydA({url:i,token:g,clientSource:A.options.clientSource,initialCursor:A.cursor,signal:A.signal,fetch:t})},cdA=(A,t,g)=>{let i=EdA(A??hdA),n=new URL(`${i}${t}`);if(g)n.searchParams.set(KM,g);return n.toString()},EdA=(A)=>{let t=A.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},ydA=async(A)=>{let t=[],g=[],i=!1,n=!1,Q,o=A.initialCursor,e=new AbortController,B=(w)=>{if(i)return;i=!0,Q=w;while(g.length>0)g.shift()?.({value:void 0,done:!0})},h=(w)=>{let u=g.shift();if(u){u({value:w,done:!1});return}t.push(w)},C=(w)=>{if(w.event===_M){let F=bdA(w.data);if(F!==void 0)o=F;return}if(w.data===mM){n=!0,e.abort(),B();return}let u=NdA(w.data);if(u)h(u)},c=()=>{n=!0,e.abort(),B()};if(A.signal)if(A.signal.aborted)n=!0,e.abort();else A.signal.addEventListener("abort",c,{once:!0});let E={[Symbol.asyncIterator](){return E},get cursor(){return o},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(i){if(Q)throw Q;return{value:void 0,done:!0}}return new Promise((w)=>{g.push(w)}).then((w)=>{if(w.done&&Q)throw Q;return w})},return:async()=>{return n=!0,e.abort(),B(),{value:void 0,done:!0}},throw:async(w)=>{throw n=!0,e.abort(),B(w instanceof Error?w:Error(String(w))),w},close:async()=>{n=!0,e.abort(),B()}};if(n)return B(),E;let y=await A.fetch(A.url,{method:jM,headers:DdA(A.token,A.clientSource),signal:e.signal});if(await adA(y))B();else wdA(y,C).then(()=>B()).catch((w)=>{if(UdA(w)||n||A.signal?.aborted){B();return}B(FdA(w))});return E},DdA=(A,t)=>{return{accept:"text/event-stream",authorization:`Bearer ${A}`,...t?{[CdA]:t}:{}}},adA=async(A)=>{if(A.status===204)return!0;if(A.ok&&A.body)return!1;let t=await udA(A);if(A.status===401)throw Error("Authentication failed. Check your credential.");if(A.status===403)throw Error(`Forbidden (403): ${t||"Credential may not have access to this resource"}`);if(A.status===404)throw Error(`Not found (404): ${t||"Run or thread not found"}`);if(A.status===400)throw Error(`Invalid stream cursor (400): ${t||"The provided cursor was rejected"}`);if(A.status>=400&&A.status<500&&A.status!==429)throw Error(`Client error (${A.status}): ${t}`);if(!A.body)throw Error("Agent stream response did not include a body.");throw Error(A.status===429?`Rate limited (429): ${t}`:`Server error (${A.status}): ${t}`)},wdA=async(A,t)=>{let g=A.body?.getReader();if(!g)throw Error("Agent stream response did not include a body.");let i=new TextDecoder,n="",Q=rdA(t);try{while(!0){let o=await g.read();if(o.done)break;n+=i.decode(o.value,{stream:!0});let e=n.split(/\r\n|\r|\n/);n=e.pop()??"";for(let B of e)Q.line(B)}if(n+=i.decode(),n)for(let o of n.split(/\r\n|\r|\n/))Q.line(o);Q.flush()}finally{g.releaseLock()}},rdA=(A)=>{let t="message",g=[],i=()=>{t="message",g=[]},n=()=>{if(g.length===0){i();return}A({event:t,data:g.join(`
|
|
8708
8708
|
`)}),i()};return{line:(Q)=>{if(Q===""){n();return}if(Q.startsWith(":"))return;let o=Q.indexOf(":"),e=o===-1?Q:Q.slice(0,o),B=o===-1?"":Q.slice(o+1),h=B.startsWith(" ")?B.slice(1):B;if(e==="event"){t=h||"message";return}if(e==="data")g.push(h)},flush:n}},bdA=(A)=>{try{let t=HM.safeParse(JSON.parse(A));return t.success?t.data.streamNextOffset:void 0}catch{return}},NdA=(A)=>{try{let t=XM.safeParse(JSON.parse(A));return t.success?t.data:void 0}catch{return}},udA=async(A)=>{try{return await A.text()}catch{return""}},UdA=(A)=>{return A instanceof Error&&A.name==="AbortError"},FdA=(A)=>{return A instanceof Error?A:Error(String(A))};var kyA=D(()=>{_I()});var BO,hO,CO,GyA;var JyA=D(()=>{TA();BO=I.object({severities:I.array(I.string()).optional().describe("Limit results to the listed severities."),services:I.array(I.string()).optional().describe("Limit results to the listed service names."),environments:I.array(I.string()).optional().describe("Limit results to the listed deployment environments."),searchTerm:I.string().optional().describe("Case-insensitive substring match against the log body."),traceId:I.string().optional().describe("Limit results to one trace ID."),attributes:I.record(I.string(),I.string()).optional().describe("Limit results to logs whose attributes contain every listed key with an exactly equal value.")}),hO=I.object({service:I.string(),namespace:I.string(),environment:I.string(),host:I.string(),container:I.string(),pod:I.string()}),CO=I.object({id:I.string(),timestamp:I.string().datetime(),severity:I.string(),body:I.string(),service:I.string(),traceId:I.string(),spanId:I.string(),attributes:I.record(I.string(),I.string()),resource:hO}),GyA=I.object({type:I.literal("logs"),timestamp:I.string().datetime(),data:I.array(CO)})});var LdA="https://{region}.intake.sazabi.com",SdA="https://{region}.tail.sazabi.com",fyA=500,ldA=5000,PyA="sazabi.public_key",MdA="x-sazabi-internal-log-forwarding-secret",YdA="x-sazabi-internal-log-forwarding-source",$dA=(A)=>{return A.startsWith("[")&&A.endsWith("]")?A.slice(1,-1):A},zyA=(A)=>{let t=$dA(A);return t==="localhost"||t==="127.0.0.1"||t==="::1"},kdA,GdA,JdA,OyA=(A)=>{let t=new Map;return{tail:async(g)=>{let i=await HdA(A.credentialProvider,g.projectId,"logs.tail"),n=await KdA(A,t,i,g.region,"logs.tail"),Q=fdA({projectId:i,region:n,filters:g.filters,apiBaseUrl:A.apiBaseUrl,tailBaseUrl:A.tailBaseUrl}),o=await A.credentialProvider.getToken(),e=A.fetch??globalThis.fetch;if(!e)throw Error("Fetch transport is not available in this runtime.");return _dA({token:o,url:Q,signal:g.signal,fetch:e})},forward:async(g)=>{let i=await jdA(A,t,g.projectId??await A.credentialProvider.getProjectId?.(),g.region,"logs.forward"),n=vdA(i,A.intakeBaseUrl),Q=A.fetch??globalThis.fetch,o=WdA(g.logs,g.publicKey),e=tsA(o);return await AsA(Q,n,o,XdA(g.sazabiInternalForwarding)),{forwardedCount:e,failedCount:0}}}},TdA="3010",RdA,fdA=(A)=>{let t=(A.tailBaseUrl??PdA({region:A.region,apiBaseUrl:A.apiBaseUrl})).replace("{region}",A.region),g=zdA(t);g.searchParams.set("projectId",A.projectId);let i=OdA(A.filters);if(i)g.searchParams.set("filters",i);return g.toString()},PdA=(A)=>{if(A.apiBaseUrl)try{let t=new URL(A.apiBaseUrl).hostname;if(t.endsWith(".sazabi.dev")){let g=t.includes(".staging.")?"staging.sazabi.dev":"development.sazabi.dev";return`https://${A.region}.tail.${g}`}}catch{}return SdA.replace("{region}",A.region)},zdA=(A)=>{let t=(()=>{try{return new URL(A)}catch{return null}})();if(!t)throw Error(`Invalid tail base URL: ${A}`);if(zyA(t.hostname)){if(t.protocol="http:",!t.port||RdA.has(t.port))t.port=TdA;return t.pathname="/v1/tail",t.search="",t.hash="",t}if(t.protocol==="ws:"||t.protocol==="wss:")t.protocol=t.protocol==="wss:"?"https:":"http:";if(t.protocol!=="http:"&&t.protocol!=="https:")throw Error(`Invalid tail base URL protocol: ${t.protocol}. Expected http:, https:, ws:, or wss:.`);return t.pathname="/v1/tail",t.search="",t.hash="",t},OdA=(A)=>{if(!A)return;let t=Object.entries(A).filter(([,g])=>g!==void 0&&(!Array.isArray(g)||g.length>0)&&(typeof g!=="object"||Array.isArray(g)||g===null||Object.keys(g).length>0)&&g!=="");if(t.length===0)return;return JSON.stringify(Object.fromEntries(t))},vdA=(A,t)=>{let g=(t??LdA).replace("{region}",A),i=g.endsWith("/")?g.slice(0,-1):g,n=ZdA(i);if(n)return n;let Q=i.match(/^https:\/\/([a-z0-9-]+)\.intake\.([a-z0-9.]+)$/);return`${Q?`https://otlp.${Q[1]}.intake.${Q[2]}`:i}/v1/logs`},ZdA=(A)=>{let t=(()=>{try{return new URL(A)}catch{return null}})();if(!t)return;if(!zyA(t.hostname))return;return t.pathname="/adapters/otlp",t.toString()},WdA=(A,t)=>{let g=A.resourceLogs;if(!g||g.length===0)return{...A,resourceLogs:[{resource:{attributes:[vyA(t)]},scopeLogs:[]}]};return{...A,resourceLogs:g.map((i)=>({...i,resource:{...i.resource,attributes:VdA(i.resource?.attributes,t)}}))}},VdA=(A,t)=>{return[...(A??[]).filter((i)=>i?.key!==PyA),vyA(t)]},vyA=(A)=>({key:PyA,value:{stringValue:A}}),XdA=(A)=>{if(!A?.secret)return{};return{[MdA]:A.secret,...A.source?{[YdA]:A.source}:{}}},HdA=async(A,t,g)=>{let i=t??await A.getProjectId?.();if(i)return i;throw VyA(g,"Project ID is required",["projectId"])},KdA=async(A,t,g,i,n)=>{return i??await ZyA(A,t,g)},jdA=async(A,t,g,i,n)=>{if(i)return i;if(!g)throw VyA(n,"Project ID is required",["projectId"]);return ZyA(A,t,g)},ZyA=async(A,t,g)=>{let i=t.get(g);if(i)return i;let n=A.raw.projects.get({projectId:g}).then((Q)=>Q.project.region);t.set(g,n);try{return await n}catch(Q){throw t.delete(g),Q}},_dA=async(A)=>{let t=[],g=[],i=!1,n=!1,Q,o=0,e,B,h=(u)=>{if(i)return;i=!0,Q=u;while(g.length>0){let F=g.shift();if(F)F({value:void 0,done:!0})}},C=(u)=>{let F=g.shift();if(F){F({value:u,done:!1});return}t.push(u)},c=()=>{B?.abort()},E=(u)=>{if(u.event!=="log"){if(u.id)e=u.id;return}let F=sdA(u.data);for(let $ of F)C($);if(u.id)e=u.id},y=async(u)=>{let F=!1;while(!i&&!n){let $=new AbortController,J=()=>$.abort();B=$;let m=!1;A.signal?.addEventListener("abort",J,{once:!0});try{let v=await A.fetch(mdA(A.url,e),{method:"GET",headers:{accept:"text/event-stream",authorization:`Bearer ${A.token}`},signal:$.signal});await xdA(v),o=0,F=!0,u(),await qdA(v,E),m=!0}catch(v){if(RyA(v)||A.signal?.aborted)break;let eA=TyA(v);if(!F||pdA(eA))throw eA;m=!0}finally{if(A.signal?.removeEventListener("abort",J),B===$)B=void 0}if(i||n||A.signal?.aborted)break;if(!m)continue;o+=1,await WyA(Math.min(fyA*2**(o-1),ldA),A.signal)}};if(A.signal?.addEventListener("abort",()=>{n=!0,c(),h()},{once:!0}),A.signal?.aborted)n=!0,c(),h();await new Promise((u,F)=>{let $=!1;y(()=>{if(!$)$=!0,u()}).catch((m)=>{let v=TyA(m);if(!$){$=!0,F(v);return}if(!RyA(m))h(v)})});let w={[Symbol.asyncIterator](){return w},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(i){if(Q)throw Q;return{value:void 0,done:!0}}return new Promise((u)=>{g.push(u)}).then((u)=>{if(u.done&&Q)throw Q;return u})},return:async()=>{return n=!0,c(),h(),{value:void 0,done:!0}},throw:async(u)=>{throw n=!0,c(),h(u instanceof Error?u:Error(String(u))),u}};return w},mdA=(A,t)=>{if(!t)return A;let g=new URL(A);return g.searchParams.set("cursor",t),g.toString()},xdA=async(A)=>{if(A.ok&&A.body)return;let t=await A.text();if(A.status===401)throw Error("Authentication failed. Check your credential.");if(A.status===403){if(/not served by this region/i.test(t))throw Error(`Wrong region (403): ${t||"Project is not served by this region"}`);throw Error(`Forbidden (403): ${t||"Credential may not have access to this project"}`)}if(A.status>=400&&A.status<500&&A.status!==429)throw Error(`Client error (${A.status}): ${t}`);if(!A.body)throw Error("Tail stream response did not include a body.");throw Error(A.status===429?`Rate limited (429): ${t}`:`Server error (${A.status}): ${t}`)},qdA=async(A,t)=>{let g=A.body?.getReader();if(!g)throw Error("Tail stream response did not include a body.");let i=new TextDecoder,n="",Q=ddA(t);try{while(!0){let o=await g.read();if(o.done)break;n+=i.decode(o.value,{stream:!0});let e=n.split(/\r\n|\r|\n/);n=e.pop()??"";for(let B of e)Q.line(B)}if(n+=i.decode(),n){let o=n.split(/\r\n|\r|\n/);for(let e of o)Q.line(e)}Q.flush()}finally{g.releaseLock()}},ddA=(A)=>{let t="message",g,i=[],n=()=>{t="message",g=void 0,i=[]},Q=()=>{if(i.length===0&&!g){n();return}A({event:t,data:i.join(`
|
|
8709
|
-
`),...g?{id:g}:{}}),n()};return{line:(o)=>{if(o===""){Q();return}if(o.startsWith(":"))return;let e=o.indexOf(":"),B=e===-1?o:o.slice(0,e),h=e===-1?"":o.slice(e+1),C=h.startsWith(" ")?h.slice(1):h;if(B==="event"){t=C||"message";return}if(B==="data"){i.push(C);return}if(B==="id"&&!C.includes("\x00"))g=C},flush:Q}},sdA=(A)=>{try{let t=GyA.safeParse(JSON.parse(A));if(!t.success)return[];return t.data.data}catch{return[]}},TyA=(A)=>{return A instanceof Error?A:Error(String(A))},RyA=(A)=>{return A instanceof Error&&A.name==="AbortError"},pdA=(A)=>{return A.message.startsWith("Authentication failed")||A.message.startsWith("Forbidden (")||A.message.startsWith("Wrong region (")||A.message.startsWith("Client error (")},AsA=async(A,t,g,i={},n=3,Q=1e4)=>{let o;for(let e=0;e<=n;e+=1){let B=new AbortController,h=globalThis.setTimeout(()=>B.abort(),Q);try{let C=await A(t,{method:"POST",headers:{"content-type":"application/json",...i},body:JSON.stringify(g),signal:B.signal});if(C.ok)return;let c=await C.text();if(C.status===401||C.status===403)throw Error("Authentication failed. Check your public key.");if(C.status>=400&&C.status<500&&C.status!==429)throw Error(`Client error (${C.status}): ${c}`);o=Error(C.status===429?`Rate limited (429): ${c}`:`Server error (${C.status}): ${c}`)}catch(C){let c=C instanceof Error?C.message:String(C);if(c.startsWith("Authentication failed")||c.startsWith("Client error ("))throw C instanceof Error?C:Error(c);o=C instanceof Error&&C.name==="AbortError"?Error("Request timed out"):C instanceof Error?C:Error(String(C))}finally{globalThis.clearTimeout(h)}if(e<n)await WyA(fyA*2**e)}throw Error(`Failed after ${n+1} attempts: ${o?.message??"Unknown error"}`)},tsA=(A)=>{return A.resourceLogs?.reduce((t,g)=>t+(g.scopeLogs?.reduce((i,n)=>i+(n.logRecords?.length??0),0)??0),0)??0},WyA=async(A,t)=>{if(t?.aborted)return;await new Promise((g)=>{let i=globalThis.setTimeout(g,A);t?.addEventListener("abort",()=>{globalThis.clearTimeout(i),g()},{once:!0})})},VyA=(A,t,g)=>{return new dt("BAD_REQUEST",{message:t,data:{operationId:A,missingContext:g}})};var cO=D(()=>{he();JyA();TA();kdA=I.object({projectId:I.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:BO.optional().describe("Optional filters applied by the tail SSE service.")}),GdA=I.object({publicKey:I.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:I.custom((A)=>typeof A==="object"&&A!==null).describe("OTLP logs export request payload to send to the intake service.")}),JdA=I.object({forwardedCount:I.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:I.number().int().nonnegative().describe("Number of log records rejected by the intake request.")}),RdA=new Set(["15006","3010"])});var EO="https://api.sazabi.com",HyA="https://api.platform.sazabi.com",KyA="sazabi-cli",gsA="urn:ietf:params:oauth:grant-type:device_code",jyA=(A)=>{let t=Tu(new ju(eO,{url:nsA(A.apiBaseUrl??EO),headers:async()=>{let n=new Headers({authorization:`Bearer ${await A.credentialProvider.getToken()}`});if(A.clientSource)n.set("x-sazabi-client-source",A.clientSource);if(A.sandboxActorDescriptor)n.set("x-sazabi-sandbox-actor",A.sandboxActorDescriptor);return n},fetch:A.fetch,customErrorResponseBodyDecoder:(n,Q)=>{let o=CsA(n);if(!o)return null;return new dt(o.code,{message:o.message,status:Q.status,data:{operationId:o.operationId,missingContext:o.missingContext,...o.reason!==void 0?{reason:o.reason}:{},...o.retryAfterSeconds!==void 0?{retryAfterSeconds:o.retryAfterSeconds}:{}}})}})),g=OyA({raw:t,credentialProvider:A.credentialProvider,fetch:A.fetch,apiBaseUrl:A.apiBaseUrl??EO,intakeBaseUrl:A.intakeBaseUrl,tailBaseUrl:A.tailBaseUrl}),i=$yA({credentialProvider:A.credentialProvider,fetch:A.fetch,apiBaseUrl:A.apiBaseUrl??EO,clientSource:A.clientSource});return{raw:t,me:async()=>t.me({}),automations:{list:async(n={})=>t.automations.list(await p(A.credentialProvider,n,"automations.list")),get:async(n)=>t.automations.get(await p(A.credentialProvider,n,"automations.get")),create:async(n)=>t.automations.create(await p(A.credentialProvider,n,"automations.create")),update:async(n)=>t.automations.update(await p(A.credentialProvider,n,"automations.update")),enable:async(n)=>t.automations.enable(await p(A.credentialProvider,n,"automations.enable")),disable:async(n)=>t.automations.disable(await p(A.credentialProvider,n,"automations.disable")),runs:{list:async(n)=>t.automations.runs.list(await p(A.credentialProvider,n,"automations.runs.list")),get:async(n)=>t.automations.runs.get(await p(A.credentialProvider,n,"automations.runs.get")),logs:async(n)=>t.automations.runs.logs(await p(A.credentialProvider,n,"automations.runs.logs"))}},logs:{...g,query:async(n={})=>t.logs.query(await p(A.credentialProvider,n,pe.operationId)),schema:async(n={})=>t.logs.schema(await p(A.credentialProvider,n,AB.operationId)),volume:async(n)=>t.logs.volume(await p(A.credentialProvider,n,tB.operationId)),patterns:async(n={})=>t.logs.patterns(await p(A.credentialProvider,n,gB.operationId)),nativeQuery:async(n)=>t.logs.nativeQuery(await p(A.credentialProvider,n,nB.operationId))},onboarding:{getState:async(n={})=>t.onboarding.getState(await osA(A.credentialProvider,n)),skipSampleIssue:async(n)=>t.onboarding.skipSampleIssue(n??{}),finish:async(n)=>t.onboarding.finish(n)},organizations:{list:async()=>t.organizations.list({}),get:async(n)=>t.organizations.get(n),create:async(n)=>t.organizations.create(n),update:async(n)=>t.organizations.update(await QsA(A.credentialProvider,n))},members:{list:async(n={})=>t.members.list(await LA(A.credentialProvider,n)),updateRole:async(n)=>t.members.updateRole(await LA(A.credentialProvider,n)),remove:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.members.remove({params:{member:Q.member},query:{organizationId:Q.organizationId}})},invite:async(n)=>t.members.invite(await LA(A.credentialProvider,n)),listInvitations:async(n={})=>t.members.listInvitations(await LA(A.credentialProvider,n)),revokeInvitation:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.members.revokeInvitation({params:{invitationId:Q.invitationId},query:{organizationId:Q.organizationId}})}},teams:{list:async(n={})=>t.teams.list(await LA(A.credentialProvider,n)),create:async(n)=>t.teams.create(await LA(A.credentialProvider,n)),update:async(n)=>t.teams.update(await LA(A.credentialProvider,n)),delete:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.teams.delete({params:{teamId:Q.teamId},query:{organizationId:Q.organizationId}})},addMember:async(n)=>t.teams.addMember(await LA(A.credentialProvider,n)),removeMember:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.teams.removeMember({params:{teamId:Q.teamId,userId:Q.userId},query:{organizationId:Q.organizationId}})},listMembers:async(n)=>t.teams.listMembers(await LA(A.credentialProvider,n))},publicKeys:{list:async(n={})=>t.publicKeys.list(await p(A.credentialProvider,n,Ke.operationId)),get:async(n)=>t.publicKeys.get(await p(A.credentialProvider,n,je.operationId)),ensureLogForwarding:async(n={})=>t.publicKeys.ensureLogForwarding(await p(A.credentialProvider,n,_e.operationId)),update:async(n)=>t.publicKeys.update(await p(A.credentialProvider,n,me.operationId)),deactivate:async(n)=>{let Q=await p(A.credentialProvider,n,xe.operationId);return t.publicKeys.deactivate({params:{keyId:Q.keyId},query:{projectId:Q.projectId}})}},secretKeys:{list:async(n={})=>t.secretKeys.list(await LA(A.credentialProvider,n)),get:async(n)=>t.secretKeys.get(await LA(A.credentialProvider,n)),create:async(n)=>t.secretKeys.create(await LA(A.credentialProvider,n)),update:async(n)=>t.secretKeys.update(await LA(A.credentialProvider,n)),delete:async(n)=>{let{organizationId:Q}=await LA(A.credentialProvider,n);await t.secretKeys.delete({params:{keyId:n.keyId},...Q!==void 0?{organizationId:Q}:{}})}},search:{threads:async(n)=>t.search.threads(await p(A.credentialProvider,n,Kh.operationId)),messages:async(n)=>t.search.messages(await p(A.credentialProvider,n,jh.operationId))},projects:{list:async(n={})=>t.projects.list(await isA(A.credentialProvider,n)),get:async(n)=>t.projects.get(n),create:async(n)=>t.projects.create(await LA(A.credentialProvider,n))},messages:{list:async(n)=>t.messages.list(n),append:async(n)=>XyA(t,await t.messages.append(hsA(n)))},threads:{list:async(n={})=>t.threads.list(await IsA(A.credentialProvider,n)),get:async(n)=>t.threads.get(n),getStatus:async(n)=>t.threads.getStatus(n),stop:async(n)=>t.threads.stop(n),create:async(n)=>XyA(t,await t.threads.create(await BsA(A.credentialProvider,n))),update:async(n)=>t.threads.update(n),fork:async(n)=>t.threads.fork(n),setVisibility:async(n)=>t.threads.setVisibility(n),createShareLink:async(n)=>t.threads.createShareLink(n),listShareLinks:async(n)=>t.threads.listShareLinks(n),revokeShareLink:async(n)=>t.threads.revokeShareLink(n),stream:async(n)=>i.streamThread(n)},runs:{list:async(n={})=>t.runs.list(await esA(A.credentialProvider,n)),listForThread:async(n)=>t.runs.listForThread(n),get:async(n)=>t.runs.get(n),cancel:async(n)=>t.runs.cancel(n),stream:async(n)=>i.streamRun(n)},logSources:{listProviders:async()=>t.logSources.listProviders({}),list:async(n={})=>t.logSources.list(await p(A.credentialProvider,n,de.operationId)),get:async(n)=>t.logSources.get(n),create:async(n)=>t.logSources.create(await p(A.credentialProvider,n,se.operationId)),update:async(n)=>t.logSources.update(n),delete:async(n)=>t.logSources.delete(n)},logStreams:{list:async(n)=>t.logStreams.list(n),get:async(n)=>t.logStreams.get(n),create:async(n)=>t.logStreams.create(n),update:async(n)=>t.logStreams.update(n),delete:async(n)=>t.logStreams.delete(n),reassign:async(n)=>t.logStreams.reassign(n)},connectedAccounts:{beginConnect:async(n)=>t.connectedAccounts.beginConnect(await LA(A.credentialProvider,n)),getConnectAttempt:async(n)=>t.connectedAccounts.getConnectAttempt(await LA(A.credentialProvider,n)),list:async(n={})=>t.connectedAccounts.list(await LA(A.credentialProvider,n)),disconnect:async(n)=>t.connectedAccounts.disconnect(await LA(A.credentialProvider,n))},integrations:{listProviders:async(n={})=>t.integrations.listProviders(await LA(A.credentialProvider,n)),listConnections:async(n={})=>t.integrations.listConnections(await LA(A.credentialProvider,n)),getConnection:async(n)=>t.integrations.getConnection(await LA(A.credentialProvider,n)),createConnection:async(n)=>t.integrations.createConnection(await LA(A.credentialProvider,n)),beginConnect:async(n)=>t.integrations.beginConnect(await LA(A.credentialProvider,n)),getConnectAttempt:async(n)=>t.integrations.getConnectAttempt(await LA(A.credentialProvider,n)),disconnectConnection:async(n)=>t.integrations.disconnectConnection(await LA(A.credentialProvider,n)),updateConnectionCredentials:async(n)=>t.integrations.updateConnectionCredentials(await LA(A.credentialProvider,n))},mcpConnectors:{list:async(n={})=>t.mcpConnectors.list(await p(A.credentialProvider,n,Uh.operationId)),get:async(n)=>t.mcpConnectors.get(await p(A.credentialProvider,n,Fh.operationId)),details:async(n)=>t.mcpConnectors.details(await p(A.credentialProvider,n,Lh.operationId)),listProviders:async()=>t.mcpConnectors.listProviders({}),search:async(n={})=>t.mcpConnectors.search(await p(A.credentialProvider,n,Sh.operationId)),describe:async(n)=>t.mcpConnectors.describe(await p(A.credentialProvider,n,lh.operationId)),call:async(n)=>t.mcpConnectors.call(await p(A.credentialProvider,n,Mh.operationId)),create:async(n)=>t.mcpConnectors.create(await p(A.credentialProvider,n,Yh.operationId)),update:async(n)=>t.mcpConnectors.update(await p(A.credentialProvider,n,$h.operationId)),disconnect:async(n)=>{await t.mcpConnectors.disconnect(await p(A.credentialProvider,n,kh.operationId))},setReadOnly:async(n)=>t.mcpConnectors.setReadOnly(await p(A.credentialProvider,n,Gh.operationId)),beginOAuthInstall:async(n)=>t.mcpConnectors.beginOAuthInstall(await p(A.credentialProvider,n,Jh.operationId)),getOAuthInstallAttempt:async(n)=>t.mcpConnectors.getOAuthInstallAttempt(await p(A.credentialProvider,n,Th.operationId))},sandboxPresets:{delete:async(n)=>t.sandboxPresets.deletePreset(await p(A.credentialProvider,n,Xh.operationId)),listConnections:async(n={})=>t.sandboxPresets.listConnections(await p(A.credentialProvider,n,Wh.operationId)),listTypes:async()=>t.sandboxPresets.listTypes({}),test:async(n)=>t.sandboxPresets.testPreset(await p(A.credentialProvider,n,Hh.operationId)),upsert:async(n)=>t.sandboxPresets.upsertPreset(await p(A.credentialProvider,n,Vh.operationId))},memory:{list:async(n={})=>t.memory.list(await p(A.credentialProvider,n,Ph.operationId)),get:async(n)=>t.memory.get(await p(A.credentialProvider,n,fh.operationId)),put:async(n)=>t.memory.put(await p(A.credentialProvider,n,Rh.operationId)),search:async(n)=>t.memory.search(await p(A.credentialProvider,n,zh.operationId)),delete:async(n)=>t.memory.delete(await p(A.credentialProvider,n,Oh.operationId))},logMatchExpressions:{list:async(n={})=>t.logMatchExpressions.list(await p(A.credentialProvider,n,"logMatchExpressions.list")),get:async(n)=>t.logMatchExpressions.get(await p(A.credentialProvider,n,"logMatchExpressions.get")),create:async(n)=>t.logMatchExpressions.create(await p(A.credentialProvider,n,"logMatchExpressions.create")),update:async(n)=>t.logMatchExpressions.update(await p(A.credentialProvider,n,"logMatchExpressions.update")),disable:async(n)=>t.logMatchExpressions.disable(await p(A.credentialProvider,n,"logMatchExpressions.disable"))},signalDefinitions:{list:async(n={})=>t.signalDefinitions.list(await p(A.credentialProvider,n,"signalDefinitions.list")),get:async(n)=>t.signalDefinitions.get(await p(A.credentialProvider,n,"signalDefinitions.get")),create:async(n)=>t.signalDefinitions.create(await p(A.credentialProvider,n,"signalDefinitions.create")),update:async(n)=>t.signalDefinitions.update(await p(A.credentialProvider,n,"signalDefinitions.update")),disable:async(n)=>t.signalDefinitions.disable(await p(A.credentialProvider,n,"signalDefinitions.disable"))},scripts:{list:async(n={})=>t.scripts.list(await p(A.credentialProvider,n,"scripts.list")),get:async(n)=>t.scripts.get(await p(A.credentialProvider,n,"scripts.get")),create:async(n)=>t.scripts.create(await p(A.credentialProvider,n,"scripts.create")),update:async(n)=>t.scripts.update(await p(A.credentialProvider,n,"scripts.update")),delete:async(n)=>t.scripts.delete(await p(A.credentialProvider,n,"scripts.delete"))},issues:{count:async(n={})=>t.issues.count(await p(A.credentialProvider,n,"issues.count")),create:async(n)=>t.issues.create(await p(A.credentialProvider,n,He.operationId)),list:async(n={})=>t.issues.list(await p(A.credentialProvider,n,"issues.list")),search:async(n={})=>t.issues.search(await p(A.credentialProvider,n,"issues.search")),get:async(n)=>t.issues.get(n),resolve:async(n)=>t.issues.resolve(n),ignore:async(n)=>t.issues.ignore(n),reopen:async(n)=>t.issues.reopen(n),mute:async(n)=>t.issues.mute(n),unmute:async(n)=>t.issues.unmute(n)},workItems:{create:async(n)=>t.workItems.create(n),comment:async(n)=>t.workItems.comment(n),transition:async(n)=>t.workItems.transition(n)},pullRequests:{list:async(n={})=>t.pullRequests.list(await p(A.credentialProvider,n,"pullRequests.list"))},components:{list:async(n={})=>t.components.list(await p(A.credentialProvider,n,"components.list")),get:async(n)=>t.components.get(n),register:async(n)=>t.components.register(await p(A.credentialProvider,n,Ve.operationId)),deregister:async(n)=>t.components.deregister({componentId:n.componentId,...n.reason!==void 0?{reason:n.reason}:{}}),rename:async(n)=>t.components.rename(n),assignTeam:async(n)=>t.components.assignTeam(n),retirementPreview:async(n)=>t.components.retirementPreview(n),retire:async(n)=>t.components.retire(n),restorationPreview:async(n)=>t.components.restorationPreview(n),restore:async(n)=>t.components.restore(n),mergePreview:async(n)=>t.components.mergePreview(await p(A.credentialProvider,n,"components.mergePreview")),merge:async(n)=>t.components.merge(await p(A.credentialProvider,n,"components.merge")),relationships:{list:async(n={})=>t.components.relationships.list(await p(A.credentialProvider,n,"components.relationships.list")),preview:async(n)=>t.components.relationships.preview(await p(A.credentialProvider,n,"components.relationships.preview")),add:async(n)=>t.components.relationships.add(await p(A.credentialProvider,n,"components.relationships.add")),remove:async(n)=>t.components.relationships.remove(await p(A.credentialProvider,n,"components.relationships.remove"))},incidents:{list:async(n={})=>t.components.incidents.list(await p(A.credentialProvider,n,"components.incidents.list"))},timeline:async(n)=>t.components.timeline(n)},billing:{getSummary:async(n={})=>t.billing.getSummary(await LA(A.credentialProvider,n)),getUsage:async(n={})=>t.billing.getUsage(await LA(A.credentialProvider,n)),listTransactions:async(n={})=>t.billing.listTransactions(await LA(A.credentialProvider,n)),previewSubscriptionCancellation:async(n={})=>t.billing.previewSubscriptionCancellation(await LA(A.credentialProvider,n)),scheduleSubscriptionCancellation:async(n={})=>t.billing.scheduleSubscriptionCancellation(await LA(A.credentialProvider,n)),resumeSubscriptionCancellation:async(n={})=>t.billing.resumeSubscriptionCancellation(await LA(A.credentialProvider,n)),getAutoTopUp:async(n={})=>t.billing.getAutoTopUp(await LA(A.credentialProvider,n)),updateAutoTopUp:async(n)=>t.billing.updateAutoTopUp(await LA(A.credentialProvider,n)),purchaseCredits:async(n)=>t.billing.purchaseCredits(await LA(A.credentialProvider,n)),listPlans:async(n={})=>t.billing.listPlans(await LA(A.credentialProvider,n)),previewPlanChange:async(n)=>t.billing.previewPlanChange(await LA(A.credentialProvider,n)),changePlan:async(n)=>t.billing.changePlan(await LA(A.credentialProvider,n)),createCheckoutSession:async(n)=>t.billing.createCheckoutSession(await LA(A.credentialProvider,n)),getCheckoutSessionStatus:async(n)=>t.billing.getCheckoutSessionStatus(await LA(A.credentialProvider,n)),createPortalSession:async(n={})=>t.billing.createPortalSession(await LA(A.credentialProvider,n)),getPaymentMethod:async(n={})=>t.billing.getPaymentMethod(await LA(A.credentialProvider,n))},tasks:{list:async(n={})=>t.tasks.list(await p(A.credentialProvider,n,Yy.operationId))},recommendations:{list:async(n={})=>t.recommendations.list(await p(A.credentialProvider,n,Fy.operationId))},repos:{list:async(n={})=>t.repos.list(await p(A.credentialProvider,n,Ly.operationId)),add:async(n)=>t.repos.add(await p(A.credentialProvider,n,Sy.operationId)),remove:async(n)=>t.repos.remove(await p(A.credentialProvider,n,ly.operationId))},notificationDeliveryRules:{list:async(n={})=>t.notificationDeliveryRules.list(await p(A.credentialProvider,n,"notificationDeliveryRules.list")),options:async(n={})=>t.notificationDeliveryRules.options(await p(A.credentialProvider,n,"notificationDeliveryRules.options")),create:async(n)=>t.notificationDeliveryRules.create(await p(A.credentialProvider,n,"notificationDeliveryRules.create")),update:async(n)=>t.notificationDeliveryRules.update(await p(A.credentialProvider,n,"notificationDeliveryRules.update")),delete:async(n)=>t.notificationDeliveryRules.delete(await p(A.credentialProvider,n,"notificationDeliveryRules.delete"))},notificationChannels:{getProject:async(n={})=>t.notificationChannels.getProject(await p(A.credentialProvider,n,"notificationChannels.getProject"))}}},DO=async(A={})=>{let t=await xyA(A.fetch)(_yA(A.apiBaseUrl??HyA,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:A.clientId??KyA,...A.scope?{scope:A.scope}:{}})}),g=await t.json();if(!t.ok)throw csA(g,t.status);let i=g;return{deviceCode:_h(i.device_code,"device_code"),userCode:_h(i.user_code,"user_code"),verificationUri:_h(i.verification_uri,"verification_uri"),verificationUriComplete:_h(i.verification_uri_complete,"verification_uri_complete"),expiresIn:yO(i.expires_in,"expires_in"),interval:yO(i.interval,"interval")}},aO=async(A)=>{let t=await xyA(A.fetch)(_yA(A.apiBaseUrl??HyA,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:gsA,device_code:A.deviceCode,client_id:A.clientId??KyA})}),g=await t.json();if(t.ok){let n=g;return{status:"authorized",accessToken:_h(n.access_token,"access_token"),tokenType:_h(n.token_type,"token_type"),expiresIn:yO(n.expires_in,"expires_in"),scope:typeof n.scope==="string"?n.scope:""}}let i=myA(g);if(!i)throw Error(`Device authorization failed with status ${t.status}`);if(i.error==="authorization_pending")return{status:"pending"};if(i.error==="slow_down")return{status:"pending",interval:10};if(i.error==="access_denied")return{status:"denied",message:i.errorDescription};if(i.error==="expired_token"||i.error==="invalid_grant")return{status:"expired",message:i.errorDescription};throw Error(i.errorDescription)},nsA=(A)=>{let t=A.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},_yA=(A,t)=>{return`${A.replace(/\/+$/,"")}/api/auth${t}`},isA=async(A,t)=>{return LA(A,t)},LA=async(A,t)=>{let g=t.organizationId??await A.getOrganizationId?.();return g?{...t,organizationId:g}:t},QsA=async(A,t)=>{let g=t.organizationId??await A.getOrganizationId?.();if(!g)throw new dt("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...t,organizationId:g}},osA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},p=async(A,t,g)=>{let i=t.projectId??await A.getProjectId?.();if(!i)throw new dt("BAD_REQUEST",{message:"Project ID is required",data:{operationId:g,missingContext:["projectId"]},status:400});return{...t,projectId:i}},IsA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},esA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},BsA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},hsA=(A)=>{return{threadId:A.threadId,message:A.message,wait:A.wait??!0,timeoutSeconds:A.timeoutSeconds??20,...A.automationId!==void 0?{automationId:A.automationId}:{}}},CsA=(A)=>{if(!A||typeof A!=="object")return null;let t=A;if(typeof t.code!=="string"||typeof t.message!=="string"||typeof t.operationId!=="string")return null;return{code:t.code,message:t.message,operationId:t.operationId,missingContext:Array.isArray(t.missingContext)?t.missingContext.filter((g)=>typeof g==="string"):[],...typeof t.reason==="string"?{reason:t.reason}:{},...typeof t.retryAfterSeconds==="number"?{retryAfterSeconds:t.retryAfterSeconds}:{}}},myA=(A)=>{if(!A||typeof A!=="object")return null;let t=A;if(typeof t.error!=="string"||typeof t.error_description!=="string")return null;return{error:t.error,errorDescription:t.error_description}},csA=(A,t)=>{let g=myA(A);return Error(g?.errorDescription??`Device authorization failed with status ${t}`)},xyA=(A)=>{return A??globalThis.fetch},XyA=(A,t)=>({result:t,poll:()=>A.runs.get({runId:t.runId}),waitForCompletion:async(g={})=>EsA(A,t,g)}),EsA=async(A,t,g)=>{if(t.completed)return t;let i=g.intervalMs??2000,n=Date.now(),Q=t;while(!Q.completed){if(g.timeoutMs!==void 0&&Date.now()-n>=g.timeoutMs)return Q;await ysA(i),Q=await A.runs.get({runId:Q.runId})}return Q},ysA=async(A)=>{await new Promise((t)=>globalThis.setTimeout(t,A))},_h=(A,t)=>{if(typeof A==="string")return A;throw Error(`Expected '${t}' to be a string.`)},yO=(A,t)=>{if(typeof A==="number")return A;throw Error(`Expected '${t}' to be a number.`)};var wO=D(()=>{he();T1();_I();kyA();cO();cO()});var Ut=(A)=>({success:!0,value:A}),at=(A,t,g)=>({success:!1,error:A,...t!==void 0&&{statusCode:t},...g!==void 0&&{errorPayload:g}}),DsA=(A)=>{if(A===void 0)return"NETWORK_ERROR";if(A===401)return"UNAUTHORIZED";if(A===403)return"FORBIDDEN";if(A===404)return"NOT_FOUND";if(A===429)return"TOO_MANY_REQUESTS";if(A>=500)return"SERVER_ERROR";return"REQUEST_FAILED"},N=(A,t,g)=>{if(!A.success){let i=`${t}: ${A.error}`;if(g)return b(A.errorPayload??{code:DsA(A.statusCode),message:i,operationId:null});return r(i)}return A.value};var IA=D(()=>{nA()});var asA="https://api.sazabi.com",rO,wsA=30,rsA=(A)=>new Promise((t)=>setTimeout(t,A)),Y=async(A)=>{for(let t=0;;t+=1)try{return Ut(await A())}catch(g){let i=bsA(g),n=NsA(g),Q=i?.retryAfterSeconds;if(n===429&&t===0&&Q!==void 0&&Q<=wsA&&process.env.SAZABI_NO_RETRY!=="1"){process.stderr.write(`Rate limited; retrying in ~${Q}s…
|
|
8709
|
+
`),...g?{id:g}:{}}),n()};return{line:(o)=>{if(o===""){Q();return}if(o.startsWith(":"))return;let e=o.indexOf(":"),B=e===-1?o:o.slice(0,e),h=e===-1?"":o.slice(e+1),C=h.startsWith(" ")?h.slice(1):h;if(B==="event"){t=C||"message";return}if(B==="data"){i.push(C);return}if(B==="id"&&!C.includes("\x00"))g=C},flush:Q}},sdA=(A)=>{try{let t=GyA.safeParse(JSON.parse(A));if(!t.success)return[];return t.data.data}catch{return[]}},TyA=(A)=>{return A instanceof Error?A:Error(String(A))},RyA=(A)=>{return A instanceof Error&&A.name==="AbortError"},pdA=(A)=>{return A.message.startsWith("Authentication failed")||A.message.startsWith("Forbidden (")||A.message.startsWith("Wrong region (")||A.message.startsWith("Client error (")},AsA=async(A,t,g,i={},n=3,Q=1e4)=>{let o;for(let e=0;e<=n;e+=1){let B=new AbortController,h=globalThis.setTimeout(()=>B.abort(),Q);try{let C=await A(t,{method:"POST",headers:{"content-type":"application/json",...i},body:JSON.stringify(g),signal:B.signal});if(C.ok)return;let c=await C.text();if(C.status===401||C.status===403)throw Error("Authentication failed. Check your public key.");if(C.status>=400&&C.status<500&&C.status!==429)throw Error(`Client error (${C.status}): ${c}`);o=Error(C.status===429?`Rate limited (429): ${c}`:`Server error (${C.status}): ${c}`)}catch(C){let c=C instanceof Error?C.message:String(C);if(c.startsWith("Authentication failed")||c.startsWith("Client error ("))throw C instanceof Error?C:Error(c);o=C instanceof Error&&C.name==="AbortError"?Error("Request timed out"):C instanceof Error?C:Error(String(C))}finally{globalThis.clearTimeout(h)}if(e<n)await WyA(fyA*2**e)}throw Error(`Failed after ${n+1} attempts: ${o?.message??"Unknown error"}`)},tsA=(A)=>{return A.resourceLogs?.reduce((t,g)=>t+(g.scopeLogs?.reduce((i,n)=>i+(n.logRecords?.length??0),0)??0),0)??0},WyA=async(A,t)=>{if(t?.aborted)return;await new Promise((g)=>{let i=globalThis.setTimeout(g,A);t?.addEventListener("abort",()=>{globalThis.clearTimeout(i),g()},{once:!0})})},VyA=(A,t,g)=>{return new dt("BAD_REQUEST",{message:t,data:{operationId:A,missingContext:g}})};var cO=D(()=>{he();JyA();TA();kdA=I.object({projectId:I.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:BO.optional().describe("Optional filters applied by the tail SSE service.")}),GdA=I.object({publicKey:I.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:I.custom((A)=>typeof A==="object"&&A!==null).describe("OTLP logs export request payload to send to the intake service.")}),JdA=I.object({forwardedCount:I.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:I.number().int().nonnegative().describe("Number of log records rejected by the intake request.")}),RdA=new Set(["15006","3010"])});var EO="https://api.sazabi.com",HyA="https://api.platform.sazabi.com",KyA="sazabi-cli",gsA="urn:ietf:params:oauth:grant-type:device_code",jyA=(A)=>{let t=Tu(new ju(eO,{url:nsA(A.apiBaseUrl??EO),headers:async()=>{let n=new Headers({authorization:`Bearer ${await A.credentialProvider.getToken()}`});if(A.clientSource)n.set("x-sazabi-client-source",A.clientSource);if(A.sandboxActorDescriptor)n.set("x-sazabi-sandbox-actor",A.sandboxActorDescriptor);return n},fetch:A.fetch,customErrorResponseBodyDecoder:(n,Q)=>{let o=CsA(n);if(!o)return null;return new dt(o.code,{message:o.message,status:Q.status,data:{operationId:o.operationId,missingContext:o.missingContext,...o.reason!==void 0?{reason:o.reason}:{},...o.retryAfterSeconds!==void 0?{retryAfterSeconds:o.retryAfterSeconds}:{}}})}})),g=OyA({raw:t,credentialProvider:A.credentialProvider,fetch:A.fetch,apiBaseUrl:A.apiBaseUrl??EO,intakeBaseUrl:A.intakeBaseUrl,tailBaseUrl:A.tailBaseUrl}),i=$yA({credentialProvider:A.credentialProvider,fetch:A.fetch,apiBaseUrl:A.apiBaseUrl??EO,clientSource:A.clientSource});return{raw:t,me:async()=>t.me({}),automations:{list:async(n={})=>t.automations.list(await p(A.credentialProvider,n,"automations.list")),get:async(n)=>t.automations.get(await p(A.credentialProvider,n,"automations.get")),create:async(n)=>t.automations.create(await p(A.credentialProvider,n,"automations.create")),update:async(n)=>t.automations.update(await p(A.credentialProvider,n,"automations.update")),enable:async(n)=>t.automations.enable(await p(A.credentialProvider,n,"automations.enable")),disable:async(n)=>t.automations.disable(await p(A.credentialProvider,n,"automations.disable")),runs:{list:async(n)=>t.automations.runs.list(await p(A.credentialProvider,n,"automations.runs.list")),get:async(n)=>t.automations.runs.get(await p(A.credentialProvider,n,"automations.runs.get")),logs:async(n)=>t.automations.runs.logs(await p(A.credentialProvider,n,"automations.runs.logs"))}},logs:{...g,query:async(n={})=>t.logs.query(await p(A.credentialProvider,n,pe.operationId)),schema:async(n={})=>t.logs.schema(await p(A.credentialProvider,n,AB.operationId)),volume:async(n)=>t.logs.volume(await p(A.credentialProvider,n,tB.operationId)),patterns:async(n={})=>t.logs.patterns(await p(A.credentialProvider,n,gB.operationId)),nativeQuery:async(n)=>t.logs.nativeQuery(await p(A.credentialProvider,n,nB.operationId))},onboarding:{getState:async(n={})=>t.onboarding.getState(await osA(A.credentialProvider,n)),skipSampleIssue:async(n)=>t.onboarding.skipSampleIssue(n??{}),finish:async(n)=>t.onboarding.finish(n)},organizations:{list:async()=>t.organizations.list({}),get:async(n)=>t.organizations.get(n),create:async(n)=>t.organizations.create(n),update:async(n)=>t.organizations.update(await QsA(A.credentialProvider,n))},members:{list:async(n={})=>t.members.list(await LA(A.credentialProvider,n)),updateRole:async(n)=>t.members.updateRole(await LA(A.credentialProvider,n)),remove:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.members.remove({params:{member:Q.member},query:{organizationId:Q.organizationId}})},invite:async(n)=>t.members.invite(await LA(A.credentialProvider,n)),listInvitations:async(n={})=>t.members.listInvitations(await LA(A.credentialProvider,n)),revokeInvitation:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.members.revokeInvitation({params:{invitationId:Q.invitationId},query:{organizationId:Q.organizationId}})}},teams:{list:async(n={})=>t.teams.list(await LA(A.credentialProvider,n)),create:async(n)=>t.teams.create(await LA(A.credentialProvider,n)),update:async(n)=>t.teams.update(await LA(A.credentialProvider,n)),delete:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.teams.delete({params:{teamId:Q.teamId},query:{organizationId:Q.organizationId}})},addMember:async(n)=>t.teams.addMember(await LA(A.credentialProvider,n)),removeMember:async(n)=>{let Q=await LA(A.credentialProvider,n);return t.teams.removeMember({params:{teamId:Q.teamId,userId:Q.userId},query:{organizationId:Q.organizationId}})},listMembers:async(n)=>t.teams.listMembers(await LA(A.credentialProvider,n))},publicKeys:{list:async(n={})=>t.publicKeys.list(await p(A.credentialProvider,n,Ke.operationId)),get:async(n)=>t.publicKeys.get(await p(A.credentialProvider,n,je.operationId)),ensureLogForwarding:async(n={})=>t.publicKeys.ensureLogForwarding(await p(A.credentialProvider,n,_e.operationId)),update:async(n)=>t.publicKeys.update(await p(A.credentialProvider,n,me.operationId)),deactivate:async(n)=>{let Q=await p(A.credentialProvider,n,xe.operationId);return t.publicKeys.deactivate({params:{keyId:Q.keyId},query:{projectId:Q.projectId}})}},secretKeys:{list:async(n={})=>t.secretKeys.list(await LA(A.credentialProvider,n)),get:async(n)=>t.secretKeys.get(await LA(A.credentialProvider,n)),create:async(n)=>t.secretKeys.create(await LA(A.credentialProvider,n)),update:async(n)=>t.secretKeys.update(await LA(A.credentialProvider,n)),delete:async(n)=>{let{organizationId:Q}=await LA(A.credentialProvider,n);await t.secretKeys.delete({params:{keyId:n.keyId},query:Q!==void 0?{organizationId:Q}:{}})}},search:{threads:async(n)=>t.search.threads(await p(A.credentialProvider,n,Kh.operationId)),messages:async(n)=>t.search.messages(await p(A.credentialProvider,n,jh.operationId))},projects:{list:async(n={})=>t.projects.list(await isA(A.credentialProvider,n)),get:async(n)=>t.projects.get(n),create:async(n)=>t.projects.create(await LA(A.credentialProvider,n))},messages:{list:async(n)=>t.messages.list(n),append:async(n)=>XyA(t,await t.messages.append(hsA(n)))},threads:{list:async(n={})=>t.threads.list(await IsA(A.credentialProvider,n)),get:async(n)=>t.threads.get(n),getStatus:async(n)=>t.threads.getStatus(n),stop:async(n)=>t.threads.stop(n),create:async(n)=>XyA(t,await t.threads.create(await BsA(A.credentialProvider,n))),update:async(n)=>t.threads.update(n),fork:async(n)=>t.threads.fork(n),setVisibility:async(n)=>t.threads.setVisibility(n),createShareLink:async(n)=>t.threads.createShareLink(n),listShareLinks:async(n)=>t.threads.listShareLinks(n),revokeShareLink:async(n)=>t.threads.revokeShareLink(n),stream:async(n)=>i.streamThread(n)},runs:{list:async(n={})=>t.runs.list(await esA(A.credentialProvider,n)),listForThread:async(n)=>t.runs.listForThread(n),get:async(n)=>t.runs.get(n),cancel:async(n)=>t.runs.cancel(n),stream:async(n)=>i.streamRun(n)},logSources:{listProviders:async()=>t.logSources.listProviders({}),list:async(n={})=>t.logSources.list(await p(A.credentialProvider,n,de.operationId)),get:async(n)=>t.logSources.get(n),create:async(n)=>t.logSources.create(await p(A.credentialProvider,n,se.operationId)),update:async(n)=>t.logSources.update(n),delete:async(n)=>t.logSources.delete(n)},logStreams:{list:async(n)=>t.logStreams.list(n),get:async(n)=>t.logStreams.get(n),create:async(n)=>t.logStreams.create(n),update:async(n)=>t.logStreams.update(n),delete:async(n)=>t.logStreams.delete(n),reassign:async(n)=>t.logStreams.reassign(n)},connectedAccounts:{beginConnect:async(n)=>t.connectedAccounts.beginConnect(await LA(A.credentialProvider,n)),getConnectAttempt:async(n)=>t.connectedAccounts.getConnectAttempt(await LA(A.credentialProvider,n)),list:async(n={})=>t.connectedAccounts.list(await LA(A.credentialProvider,n)),disconnect:async(n)=>t.connectedAccounts.disconnect(await LA(A.credentialProvider,n))},integrations:{listProviders:async(n={})=>t.integrations.listProviders(await LA(A.credentialProvider,n)),listConnections:async(n={})=>t.integrations.listConnections(await LA(A.credentialProvider,n)),getConnection:async(n)=>t.integrations.getConnection(await LA(A.credentialProvider,n)),createConnection:async(n)=>t.integrations.createConnection(await LA(A.credentialProvider,n)),beginConnect:async(n)=>t.integrations.beginConnect(await LA(A.credentialProvider,n)),getConnectAttempt:async(n)=>t.integrations.getConnectAttempt(await LA(A.credentialProvider,n)),disconnectConnection:async(n)=>t.integrations.disconnectConnection(await LA(A.credentialProvider,n)),updateConnectionCredentials:async(n)=>t.integrations.updateConnectionCredentials(await LA(A.credentialProvider,n))},mcpConnectors:{list:async(n={})=>t.mcpConnectors.list(await p(A.credentialProvider,n,Uh.operationId)),get:async(n)=>t.mcpConnectors.get(await p(A.credentialProvider,n,Fh.operationId)),details:async(n)=>t.mcpConnectors.details(await p(A.credentialProvider,n,Lh.operationId)),listProviders:async()=>t.mcpConnectors.listProviders({}),search:async(n={})=>t.mcpConnectors.search(await p(A.credentialProvider,n,Sh.operationId)),describe:async(n)=>t.mcpConnectors.describe(await p(A.credentialProvider,n,lh.operationId)),call:async(n)=>t.mcpConnectors.call(await p(A.credentialProvider,n,Mh.operationId)),create:async(n)=>t.mcpConnectors.create(await p(A.credentialProvider,n,Yh.operationId)),update:async(n)=>t.mcpConnectors.update(await p(A.credentialProvider,n,$h.operationId)),disconnect:async(n)=>{await t.mcpConnectors.disconnect(await p(A.credentialProvider,n,kh.operationId))},setReadOnly:async(n)=>t.mcpConnectors.setReadOnly(await p(A.credentialProvider,n,Gh.operationId)),beginOAuthInstall:async(n)=>t.mcpConnectors.beginOAuthInstall(await p(A.credentialProvider,n,Jh.operationId)),getOAuthInstallAttempt:async(n)=>t.mcpConnectors.getOAuthInstallAttempt(await p(A.credentialProvider,n,Th.operationId))},sandboxPresets:{delete:async(n)=>t.sandboxPresets.deletePreset(await p(A.credentialProvider,n,Xh.operationId)),listConnections:async(n={})=>t.sandboxPresets.listConnections(await p(A.credentialProvider,n,Wh.operationId)),listTypes:async()=>t.sandboxPresets.listTypes({}),test:async(n)=>t.sandboxPresets.testPreset(await p(A.credentialProvider,n,Hh.operationId)),upsert:async(n)=>t.sandboxPresets.upsertPreset(await p(A.credentialProvider,n,Vh.operationId))},memory:{list:async(n={})=>t.memory.list(await p(A.credentialProvider,n,Ph.operationId)),get:async(n)=>t.memory.get(await p(A.credentialProvider,n,fh.operationId)),put:async(n)=>t.memory.put(await p(A.credentialProvider,n,Rh.operationId)),search:async(n)=>t.memory.search(await p(A.credentialProvider,n,zh.operationId)),delete:async(n)=>t.memory.delete(await p(A.credentialProvider,n,Oh.operationId))},logMatchExpressions:{list:async(n={})=>t.logMatchExpressions.list(await p(A.credentialProvider,n,"logMatchExpressions.list")),get:async(n)=>t.logMatchExpressions.get(await p(A.credentialProvider,n,"logMatchExpressions.get")),create:async(n)=>t.logMatchExpressions.create(await p(A.credentialProvider,n,"logMatchExpressions.create")),update:async(n)=>t.logMatchExpressions.update(await p(A.credentialProvider,n,"logMatchExpressions.update")),disable:async(n)=>t.logMatchExpressions.disable(await p(A.credentialProvider,n,"logMatchExpressions.disable"))},signalDefinitions:{list:async(n={})=>t.signalDefinitions.list(await p(A.credentialProvider,n,"signalDefinitions.list")),get:async(n)=>t.signalDefinitions.get(await p(A.credentialProvider,n,"signalDefinitions.get")),create:async(n)=>t.signalDefinitions.create(await p(A.credentialProvider,n,"signalDefinitions.create")),update:async(n)=>t.signalDefinitions.update(await p(A.credentialProvider,n,"signalDefinitions.update")),disable:async(n)=>t.signalDefinitions.disable(await p(A.credentialProvider,n,"signalDefinitions.disable"))},scripts:{list:async(n={})=>t.scripts.list(await p(A.credentialProvider,n,"scripts.list")),get:async(n)=>t.scripts.get(await p(A.credentialProvider,n,"scripts.get")),create:async(n)=>t.scripts.create(await p(A.credentialProvider,n,"scripts.create")),update:async(n)=>t.scripts.update(await p(A.credentialProvider,n,"scripts.update")),delete:async(n)=>t.scripts.delete(await p(A.credentialProvider,n,"scripts.delete"))},issues:{count:async(n={})=>t.issues.count(await p(A.credentialProvider,n,"issues.count")),create:async(n)=>t.issues.create(await p(A.credentialProvider,n,He.operationId)),list:async(n={})=>t.issues.list(await p(A.credentialProvider,n,"issues.list")),search:async(n={})=>t.issues.search(await p(A.credentialProvider,n,"issues.search")),get:async(n)=>t.issues.get(n),resolve:async(n)=>t.issues.resolve(n),ignore:async(n)=>t.issues.ignore(n),reopen:async(n)=>t.issues.reopen(n),mute:async(n)=>t.issues.mute(n),unmute:async(n)=>t.issues.unmute(n)},workItems:{create:async(n)=>t.workItems.create(n),comment:async(n)=>t.workItems.comment(n),transition:async(n)=>t.workItems.transition(n)},pullRequests:{list:async(n={})=>t.pullRequests.list(await p(A.credentialProvider,n,"pullRequests.list"))},components:{list:async(n={})=>t.components.list(await p(A.credentialProvider,n,"components.list")),get:async(n)=>t.components.get(n),register:async(n)=>t.components.register(await p(A.credentialProvider,n,Ve.operationId)),deregister:async(n)=>t.components.deregister({componentId:n.componentId,...n.reason!==void 0?{reason:n.reason}:{}}),rename:async(n)=>t.components.rename(n),assignTeam:async(n)=>t.components.assignTeam(n),retirementPreview:async(n)=>t.components.retirementPreview(n),retire:async(n)=>t.components.retire(n),restorationPreview:async(n)=>t.components.restorationPreview(n),restore:async(n)=>t.components.restore(n),mergePreview:async(n)=>t.components.mergePreview(await p(A.credentialProvider,n,"components.mergePreview")),merge:async(n)=>t.components.merge(await p(A.credentialProvider,n,"components.merge")),relationships:{list:async(n={})=>t.components.relationships.list(await p(A.credentialProvider,n,"components.relationships.list")),preview:async(n)=>t.components.relationships.preview(await p(A.credentialProvider,n,"components.relationships.preview")),add:async(n)=>t.components.relationships.add(await p(A.credentialProvider,n,"components.relationships.add")),remove:async(n)=>t.components.relationships.remove(await p(A.credentialProvider,n,"components.relationships.remove"))},incidents:{list:async(n={})=>t.components.incidents.list(await p(A.credentialProvider,n,"components.incidents.list"))},timeline:async(n)=>t.components.timeline(n)},billing:{getSummary:async(n={})=>t.billing.getSummary(await LA(A.credentialProvider,n)),getUsage:async(n={})=>t.billing.getUsage(await LA(A.credentialProvider,n)),listTransactions:async(n={})=>t.billing.listTransactions(await LA(A.credentialProvider,n)),previewSubscriptionCancellation:async(n={})=>t.billing.previewSubscriptionCancellation(await LA(A.credentialProvider,n)),scheduleSubscriptionCancellation:async(n={})=>t.billing.scheduleSubscriptionCancellation(await LA(A.credentialProvider,n)),resumeSubscriptionCancellation:async(n={})=>t.billing.resumeSubscriptionCancellation(await LA(A.credentialProvider,n)),getAutoTopUp:async(n={})=>t.billing.getAutoTopUp(await LA(A.credentialProvider,n)),updateAutoTopUp:async(n)=>t.billing.updateAutoTopUp(await LA(A.credentialProvider,n)),purchaseCredits:async(n)=>t.billing.purchaseCredits(await LA(A.credentialProvider,n)),listPlans:async(n={})=>t.billing.listPlans(await LA(A.credentialProvider,n)),previewPlanChange:async(n)=>t.billing.previewPlanChange(await LA(A.credentialProvider,n)),changePlan:async(n)=>t.billing.changePlan(await LA(A.credentialProvider,n)),createCheckoutSession:async(n)=>t.billing.createCheckoutSession(await LA(A.credentialProvider,n)),getCheckoutSessionStatus:async(n)=>t.billing.getCheckoutSessionStatus(await LA(A.credentialProvider,n)),createPortalSession:async(n={})=>t.billing.createPortalSession(await LA(A.credentialProvider,n)),getPaymentMethod:async(n={})=>t.billing.getPaymentMethod(await LA(A.credentialProvider,n))},tasks:{list:async(n={})=>t.tasks.list(await p(A.credentialProvider,n,Yy.operationId))},recommendations:{list:async(n={})=>t.recommendations.list(await p(A.credentialProvider,n,Fy.operationId))},repos:{list:async(n={})=>t.repos.list(await p(A.credentialProvider,n,Ly.operationId)),add:async(n)=>t.repos.add(await p(A.credentialProvider,n,Sy.operationId)),remove:async(n)=>t.repos.remove(await p(A.credentialProvider,n,ly.operationId))},notificationDeliveryRules:{list:async(n={})=>t.notificationDeliveryRules.list(await p(A.credentialProvider,n,"notificationDeliveryRules.list")),options:async(n={})=>t.notificationDeliveryRules.options(await p(A.credentialProvider,n,"notificationDeliveryRules.options")),create:async(n)=>t.notificationDeliveryRules.create(await p(A.credentialProvider,n,"notificationDeliveryRules.create")),update:async(n)=>t.notificationDeliveryRules.update(await p(A.credentialProvider,n,"notificationDeliveryRules.update")),delete:async(n)=>t.notificationDeliveryRules.delete(await p(A.credentialProvider,n,"notificationDeliveryRules.delete"))},notificationChannels:{getProject:async(n={})=>t.notificationChannels.getProject(await p(A.credentialProvider,n,"notificationChannels.getProject"))}}},DO=async(A={})=>{let t=await xyA(A.fetch)(_yA(A.apiBaseUrl??HyA,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:A.clientId??KyA,...A.scope?{scope:A.scope}:{}})}),g=await t.json();if(!t.ok)throw csA(g,t.status);let i=g;return{deviceCode:_h(i.device_code,"device_code"),userCode:_h(i.user_code,"user_code"),verificationUri:_h(i.verification_uri,"verification_uri"),verificationUriComplete:_h(i.verification_uri_complete,"verification_uri_complete"),expiresIn:yO(i.expires_in,"expires_in"),interval:yO(i.interval,"interval")}},aO=async(A)=>{let t=await xyA(A.fetch)(_yA(A.apiBaseUrl??HyA,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:gsA,device_code:A.deviceCode,client_id:A.clientId??KyA})}),g=await t.json();if(t.ok){let n=g;return{status:"authorized",accessToken:_h(n.access_token,"access_token"),tokenType:_h(n.token_type,"token_type"),expiresIn:yO(n.expires_in,"expires_in"),scope:typeof n.scope==="string"?n.scope:""}}let i=myA(g);if(!i)throw Error(`Device authorization failed with status ${t.status}`);if(i.error==="authorization_pending")return{status:"pending"};if(i.error==="slow_down")return{status:"pending",interval:10};if(i.error==="access_denied")return{status:"denied",message:i.errorDescription};if(i.error==="expired_token"||i.error==="invalid_grant")return{status:"expired",message:i.errorDescription};throw Error(i.errorDescription)},nsA=(A)=>{let t=A.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},_yA=(A,t)=>{return`${A.replace(/\/+$/,"")}/api/auth${t}`},isA=async(A,t)=>{return LA(A,t)},LA=async(A,t)=>{let g=t.organizationId??await A.getOrganizationId?.();return g?{...t,organizationId:g}:t},QsA=async(A,t)=>{let g=t.organizationId??await A.getOrganizationId?.();if(!g)throw new dt("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...t,organizationId:g}},osA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},p=async(A,t,g)=>{let i=t.projectId??await A.getProjectId?.();if(!i)throw new dt("BAD_REQUEST",{message:"Project ID is required",data:{operationId:g,missingContext:["projectId"]},status:400});return{...t,projectId:i}},IsA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},esA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},BsA=async(A,t)=>{let g=t.projectId??await A.getProjectId?.();return g?{...t,projectId:g}:t},hsA=(A)=>{return{threadId:A.threadId,message:A.message,wait:A.wait??!0,timeoutSeconds:A.timeoutSeconds??20,...A.automationId!==void 0?{automationId:A.automationId}:{}}},CsA=(A)=>{if(!A||typeof A!=="object")return null;let t=A;if(typeof t.code!=="string"||typeof t.message!=="string"||typeof t.operationId!=="string")return null;return{code:t.code,message:t.message,operationId:t.operationId,missingContext:Array.isArray(t.missingContext)?t.missingContext.filter((g)=>typeof g==="string"):[],...typeof t.reason==="string"?{reason:t.reason}:{},...typeof t.retryAfterSeconds==="number"?{retryAfterSeconds:t.retryAfterSeconds}:{}}},myA=(A)=>{if(!A||typeof A!=="object")return null;let t=A;if(typeof t.error!=="string"||typeof t.error_description!=="string")return null;return{error:t.error,errorDescription:t.error_description}},csA=(A,t)=>{let g=myA(A);return Error(g?.errorDescription??`Device authorization failed with status ${t}`)},xyA=(A)=>{return A??globalThis.fetch},XyA=(A,t)=>({result:t,poll:()=>A.runs.get({runId:t.runId}),waitForCompletion:async(g={})=>EsA(A,t,g)}),EsA=async(A,t,g)=>{if(t.completed)return t;let i=g.intervalMs??2000,n=Date.now(),Q=t;while(!Q.completed){if(g.timeoutMs!==void 0&&Date.now()-n>=g.timeoutMs)return Q;await ysA(i),Q=await A.runs.get({runId:Q.runId})}return Q},ysA=async(A)=>{await new Promise((t)=>globalThis.setTimeout(t,A))},_h=(A,t)=>{if(typeof A==="string")return A;throw Error(`Expected '${t}' to be a string.`)},yO=(A,t)=>{if(typeof A==="number")return A;throw Error(`Expected '${t}' to be a number.`)};var wO=D(()=>{he();T1();_I();kyA();cO();cO()});var Ut=(A)=>({success:!0,value:A}),at=(A,t,g)=>({success:!1,error:A,...t!==void 0&&{statusCode:t},...g!==void 0&&{errorPayload:g}}),DsA=(A)=>{if(A===void 0)return"NETWORK_ERROR";if(A===401)return"UNAUTHORIZED";if(A===403)return"FORBIDDEN";if(A===404)return"NOT_FOUND";if(A===429)return"TOO_MANY_REQUESTS";if(A>=500)return"SERVER_ERROR";return"REQUEST_FAILED"},N=(A,t,g)=>{if(!A.success){let i=`${t}: ${A.error}`;if(g)return b(A.errorPayload??{code:DsA(A.statusCode),message:i,operationId:null});return r(i)}return A.value};var IA=D(()=>{nA()});var asA="https://api.sazabi.com",rO,wsA=30,rsA=(A)=>new Promise((t)=>setTimeout(t,A)),Y=async(A)=>{for(let t=0;;t+=1)try{return Ut(await A())}catch(g){let i=bsA(g),n=NsA(g),Q=i?.retryAfterSeconds;if(n===429&&t===0&&Q!==void 0&&Q<=wsA&&process.env.SAZABI_NO_RETRY!=="1"){process.stderr.write(`Rate limited; retrying in ~${Q}s…
|
|
8710
8710
|
`),await rsA(Q*1000);continue}let o=g instanceof Error?g.message:String(g);if(Q!==void 0)o+=` Retry in ~${Q}s.`;return at(o,n,i)}},bsA=(A)=>{if(!A||typeof A!=="object")return;let t=A;if(typeof t.code!=="string"||typeof t.message!=="string"||!t.data||typeof t.data!=="object")return;let g=t.data;if(typeof g.operationId!=="string")return;return{code:t.code,message:t.message,operationId:g.operationId,...typeof g.reason==="string"?{reason:g.reason}:{},...typeof g.retryAfterSeconds==="number"?{retryAfterSeconds:g.retryAfterSeconds}:{},...Array.isArray(g.missingContext)?{missingContext:g.missingContext.filter((i)=>typeof i==="string")}:{}}},NsA=(A)=>{if(!A||typeof A!=="object")return;let t=A;return typeof t.status==="number"?t.status:void 0},EQ=(A)=>{let t=jyA({apiBaseUrl:A.baseUrl??asA,clientSource:"cli",sandboxActorDescriptor:A.sandboxActorDescriptor,credentialProvider:{getToken:()=>A.token,getOrganizationId:()=>A.organizationId,getProjectId:()=>A.projectId},intakeBaseUrl:A.intakeBaseUrl,tailBaseUrl:A.tailBaseUrl});return{me:()=>{let g=`${A.token}::${A.baseUrl??""}`,i=rO.get(g);if(i)return i;let n=Y(()=>t.me()).then((Q)=>{if(!Q.success)rO.delete(g);return Q});return rO.set(g,n),n},automations:{list:(g={})=>Y(()=>t.automations.list(g)),get:(g)=>Y(()=>t.automations.get({automationId:g})),create:(g)=>Y(()=>t.automations.create(g)),update:(g)=>Y(()=>t.automations.update(g)),enable:(g)=>Y(()=>t.automations.enable({automationId:g})),disable:(g)=>Y(()=>t.automations.disable({automationId:g})),runs:{list:(g,i={})=>Y(()=>t.automations.runs.list({automationId:g,...i})),get:(g,i)=>Y(()=>t.automations.runs.get({automationId:g,runId:i})),logs:(g,i)=>Y(()=>t.automations.runs.logs({automationId:g,runId:i}))}},logs:{tail:(g)=>Y(()=>t.logs.tail(g)),forward:(g)=>Y(()=>t.logs.forward(g)),query:(g={})=>Y(()=>t.logs.query(g)),schema:(g={})=>Y(()=>t.logs.schema(g)),volume:(g)=>Y(()=>t.logs.volume(g)),patterns:(g={})=>Y(()=>t.logs.patterns(g)),nativeQuery:(g)=>Y(()=>t.logs.nativeQuery(g))},organizations:{list:()=>Y(()=>t.organizations.list()),get:(g)=>Y(()=>t.organizations.get({organizationId:g})),create:(g)=>Y(()=>t.organizations.create({name:g})),rename:(g,i)=>Y(()=>t.organizations.update({organizationId:i,name:g}))},members:{list:(g={})=>Y(()=>t.members.list(g)),updateRole:(g,i,n)=>Y(()=>t.members.updateRole({organizationId:n,member:g,role:i})),remove:(g,i)=>Y(()=>t.members.remove({organizationId:i,member:g})),invite:(g)=>Y(()=>t.members.invite({organizationId:g.organizationId,email:g.email,role:g.role})),listInvitations:(g)=>Y(()=>t.members.listInvitations({organizationId:g})),revokeInvitation:(g)=>Y(()=>t.members.revokeInvitation({organizationId:g.organizationId,invitationId:g.invitationId}))},teams:{list:(g={})=>Y(()=>t.teams.list(g)),create:(g,i,n)=>Y(()=>t.teams.create({organizationId:n,name:g,...i!==void 0?{description:i}:{}})),update:(g,i,n)=>Y(()=>t.teams.update({organizationId:n,teamId:g,...i.name!==void 0?{name:i.name}:{},...i.description!==void 0?{description:i.description}:{}})),delete:(g,i)=>Y(()=>t.teams.delete({organizationId:i,teamId:g})),addMember:(g,i,n)=>Y(()=>t.teams.addMember({organizationId:n,teamId:g,userId:i})),removeMember:(g,i,n)=>Y(()=>t.teams.removeMember({organizationId:n,teamId:g,userId:i})),listMembers:(g,i)=>Y(()=>t.teams.listMembers({organizationId:i,teamId:g}))},projects:{list:(g={})=>Y(()=>t.projects.list(g)),get:(g)=>Y(()=>t.projects.get({projectId:g})),create:(g)=>Y(()=>t.projects.create(g))},threads:{list:(g={})=>Y(()=>t.threads.list(g)),get:(g)=>Y(()=>t.threads.get({threadId:g})),create:(g)=>Y(()=>t.threads.create(g)),getStatus:(g)=>Y(()=>t.threads.getStatus({threadId:g})),update:(g,i)=>Y(()=>t.threads.update({threadId:g,status:i})),fork:(g,i)=>Y(()=>t.threads.fork({threadId:g,messageId:i})),setVisibility:(g,i)=>Y(()=>t.threads.setVisibility({threadId:g,visibility:i})),createShareLink:(g)=>Y(()=>t.threads.createShareLink({threadId:g})),listShareLinks:(g)=>Y(()=>t.threads.listShareLinks({threadId:g})),revokeShareLink:(g,i)=>Y(()=>t.threads.revokeShareLink({threadId:g,shareId:i})),stop:(g)=>Y(()=>t.threads.stop({threadId:g})),stream:(g)=>Y(()=>t.threads.stream(g))},messages:{list:(g,i={})=>Y(()=>t.messages.list({threadId:g,...i})),append:(g,i,n,Q,o,e)=>Y(()=>t.messages.append({threadId:g,message:i,wait:n,timeoutSeconds:Q,...o!==void 0?{automationId:o}:{},...e?{ambientServiceRun:e}:{}}))},runs:{get:(g)=>Y(()=>t.runs.get({runId:g})),cancel:(g)=>Y(()=>t.runs.cancel({runId:g})),stream:(g)=>Y(()=>t.runs.stream(g))},search:{threads:(g)=>Y(()=>t.search.threads(g)),messages:(g)=>Y(()=>t.search.messages(g))},publicKeys:{list:(g)=>Y(()=>t.publicKeys.list(g)),get:(g,i)=>Y(()=>t.publicKeys.get(i?{keyId:g,projectId:i}:{keyId:g})),ensureLogForwarding:(g)=>Y(()=>t.publicKeys.ensureLogForwarding(g)),update:(g)=>Y(()=>t.publicKeys.update(g)),deactivate:(g)=>Y(()=>t.publicKeys.deactivate(g))},secretKeys:{list:(g)=>Y(()=>t.secretKeys.list(g)),get:(g)=>Y(()=>t.secretKeys.get({keyId:g})),create:(g)=>Y(()=>t.secretKeys.create(g)),update:(g)=>Y(()=>t.secretKeys.update(g)),delete:(g)=>Y(()=>t.secretKeys.delete(g))},issues:{count:(g={})=>Y(()=>t.issues.count(g)),create:(g)=>Y(()=>t.issues.create(g)),list:(g={})=>Y(()=>t.issues.list(g)),search:(g={})=>Y(()=>t.issues.search(g)),get:(g)=>Y(()=>t.issues.get({issueId:g})),resolve:(g)=>Y(()=>t.issues.resolve({issueId:g})),ignore:(g)=>Y(()=>t.issues.ignore({issueId:g})),reopen:(g)=>Y(()=>t.issues.reopen({issueId:g})),mute:(g)=>Y(()=>t.issues.mute({issueId:g})),unmute:(g)=>Y(()=>t.issues.unmute({issueId:g}))},pullRequests:{list:(g={})=>Y(()=>t.pullRequests.list(g))},workItems:{create:(g)=>Y(()=>t.workItems.create(g)),comment:(g)=>Y(()=>t.workItems.comment(g)),transition:(g)=>Y(()=>t.workItems.transition(g))},components:{list:(g={})=>Y(()=>t.components.list(g)),get:(g)=>Y(()=>t.components.get({componentId:g})),register:(g)=>Y(()=>t.components.register(g)),deregister:(g,i)=>Y(()=>t.components.deregister({componentId:g,...i!==void 0?{reason:i}:{}})),rename:(g)=>Y(()=>t.components.rename(g)),retirementPreview:(g)=>Y(()=>t.components.retirementPreview(g)),retire:(g)=>Y(()=>t.components.retire(g)),restorationPreview:(g)=>Y(()=>t.components.restorationPreview(g)),restore:(g)=>Y(()=>t.components.restore(g)),mergePreview:(g)=>Y(()=>t.components.mergePreview(g)),merge:(g)=>Y(()=>t.components.merge(g)),relationships:{list:(g={})=>Y(()=>t.components.relationships.list(g)),preview:(g)=>Y(()=>t.components.relationships.preview(g)),add:(g)=>Y(()=>t.components.relationships.add(g)),remove:(g)=>Y(()=>t.components.relationships.remove(g))},incidents:{list:(g={})=>Y(()=>t.components.incidents.list(g))},timeline:(g)=>Y(()=>t.components.timeline(g))},billing:{getSummary:(g={})=>Y(()=>t.billing.getSummary(g)),getUsage:(g={})=>Y(()=>t.billing.getUsage(g)),listTransactions:(g={})=>Y(()=>t.billing.listTransactions(g)),previewSubscriptionCancellation:()=>Y(()=>t.billing.previewSubscriptionCancellation()),scheduleSubscriptionCancellation:()=>Y(()=>t.billing.scheduleSubscriptionCancellation()),resumeSubscriptionCancellation:()=>Y(()=>t.billing.resumeSubscriptionCancellation()),getAutoTopUp:(g={})=>Y(()=>t.billing.getAutoTopUp(g)),updateAutoTopUp:(g)=>Y(()=>t.billing.updateAutoTopUp(g)),purchaseCredits:(g)=>Y(()=>t.billing.purchaseCredits(g)),listPlans:(g={})=>Y(()=>t.billing.listPlans(g)),previewPlanChange:(g)=>Y(()=>t.billing.previewPlanChange(g)),changePlan:(g)=>Y(()=>t.billing.changePlan(g)),createCheckoutSession:(g)=>Y(()=>t.billing.createCheckoutSession(g)),getCheckoutSessionStatus:(g)=>Y(()=>t.billing.getCheckoutSessionStatus(g)),createPortalSession:(g={})=>Y(()=>t.billing.createPortalSession(g)),getPaymentMethod:(g={})=>Y(()=>t.billing.getPaymentMethod(g))},tasks:{list:(g={})=>Y(()=>t.tasks.list(g))},recommendations:{list:(g={})=>Y(()=>t.recommendations.list(g))},repos:{list:(g={})=>Y(()=>t.repos.list(g)),add:(g)=>Y(()=>t.repos.add(g)),remove:(g)=>Y(()=>t.repos.remove(g))},onboarding:{getState:(g={})=>Y(()=>t.onboarding.getState(g)),skipSampleIssue:(g)=>Y(()=>t.onboarding.skipSampleIssue(g)),finish:(g)=>Y(()=>t.onboarding.finish(g))},notificationDeliveryRules:{list:()=>Y(()=>t.notificationDeliveryRules.list()),options:()=>Y(()=>t.notificationDeliveryRules.options()),create:(g)=>Y(()=>t.notificationDeliveryRules.create(g)),update:(g)=>Y(()=>t.notificationDeliveryRules.update(g)),delete:(g)=>Y(()=>t.notificationDeliveryRules.delete({ruleId:g}))},notificationChannels:{getProject:()=>Y(()=>t.notificationChannels.getProject())},logSources:{listProviders:()=>Y(()=>t.logSources.listProviders()),list:(g)=>Y(()=>t.logSources.list(g)),get:(g)=>Y(()=>t.logSources.get({logSourceId:g})),create:(g)=>Y(()=>t.logSources.create(g)),update:(g)=>Y(()=>t.logSources.update(g)),delete:(g)=>Y(()=>t.logSources.delete({logSourceId:g}))},logStreams:{list:(g)=>Y(()=>t.logStreams.list({logSourceId:g})),get:(g)=>Y(()=>t.logStreams.get({streamId:g})),create:(g)=>Y(()=>t.logStreams.create(g)),update:(g)=>Y(()=>t.logStreams.update(g)),delete:(g)=>Y(()=>t.logStreams.delete({streamId:g})),reassign:(g)=>Y(()=>t.logStreams.reassign(g))},integrations:{listProviders:()=>Y(()=>t.integrations.listProviders()),listConnections:(g)=>Y(()=>t.integrations.listConnections(g)),getConnection:(g)=>Y(()=>t.integrations.getConnection({connectionId:g})),createConnection:(g)=>Y(()=>t.integrations.createConnection(g)),beginConnect:(g)=>Y(()=>t.integrations.beginConnect(g)),getConnectAttempt:(g)=>Y(()=>t.integrations.getConnectAttempt({attemptId:g})),disconnectConnection:(g)=>Y(()=>t.integrations.disconnectConnection({connectionId:g})),updateConnectionCredentials:(g)=>Y(()=>t.integrations.updateConnectionCredentials(g))},connectedAccounts:{beginConnect:(g)=>Y(()=>t.connectedAccounts.beginConnect(g)),getConnectAttempt:(g)=>Y(()=>t.connectedAccounts.getConnectAttempt({attemptId:g})),list:()=>Y(()=>t.connectedAccounts.list({})),disconnect:(g)=>Y(()=>t.connectedAccounts.disconnect(g))},mcpConnectors:{list:(g)=>Y(()=>t.mcpConnectors.list(g)),get:(g)=>Y(()=>t.mcpConnectors.get(g)),details:(g)=>Y(()=>t.mcpConnectors.details(g)),listProviders:()=>Y(()=>t.mcpConnectors.listProviders()),beginOAuthInstall:(g)=>Y(()=>t.mcpConnectors.beginOAuthInstall(g)),getOAuthInstallAttempt:(g)=>Y(()=>t.mcpConnectors.getOAuthInstallAttempt(g)),disconnect:(g)=>Y(()=>t.mcpConnectors.disconnect(g)),update:(g)=>Y(()=>t.mcpConnectors.update(g))},sandboxPresets:{delete:(g)=>Y(()=>t.sandboxPresets.delete(g)),listConnections:(g)=>Y(()=>t.sandboxPresets.listConnections(g)),listTypes:()=>Y(()=>t.sandboxPresets.listTypes()),test:(g)=>Y(()=>t.sandboxPresets.test(g)),upsert:(g)=>Y(()=>t.sandboxPresets.upsert(g))},memory:{list:(g={})=>Y(()=>t.memory.list(g)),get:(g)=>Y(()=>t.memory.get(g)),search:(g)=>Y(()=>t.memory.search(g)),put:(g)=>Y(()=>t.memory.put({kind:"note",...g})),delete:(g)=>Y(()=>t.memory.delete(g))},logMatchExpressions:{list:(g={})=>Y(()=>t.logMatchExpressions.list(g)),get:(g)=>Y(()=>t.logMatchExpressions.get({expressionId:g})),create:(g)=>Y(()=>t.logMatchExpressions.create(g)),update:(g,i={})=>Y(()=>t.logMatchExpressions.update({expressionId:g,...i})),disable:(g)=>Y(()=>t.logMatchExpressions.disable({expressionId:g}))},signalDefinitions:{list:(g={})=>Y(()=>t.signalDefinitions.list(g)),get:(g)=>Y(()=>t.signalDefinitions.get({signalDefinitionId:g})),create:(g)=>Y(()=>t.signalDefinitions.create(g)),update:(g,i={})=>Y(()=>t.signalDefinitions.update({signalDefinitionId:g,...i})),disable:(g)=>Y(()=>t.signalDefinitions.disable({signalDefinitionId:g}))},scripts:{list:(g={})=>Y(()=>t.scripts.list(g)),get:(g)=>Y(()=>t.scripts.get({name:g})),create:(g)=>Y(()=>t.scripts.create(g)),update:(g,i={})=>Y(()=>t.scripts.update({name:g,...i})),delete:(g)=>Y(()=>t.scripts.delete({name:g}))}}};var $y=D(()=>{wO();IA();rO=new Map});var qyA;var dyA=D(()=>{qyA={version:2,activeProfile:"default",profiles:{default:{}}}});import*as yQ from"node:fs";import*as syA from"node:os";import*as uO from"node:path";var bg=(A)=>{if(A===void 0||A===null)return;if(typeof A==="string")return A.length>0?A:void 0;return},usA=(A)=>{if(typeof A!=="object"||A===null||Array.isArray(A))return;let t={};for(let[g,i]of Object.entries(A)){if(!Array.isArray(i))continue;let n=i.filter((Q)=>typeof Q==="string"&&Q.length>0);if(n.length>0)t[g]=n}return Object.keys(t).length>0?t:void 0},bO,mh,UsA=()=>{if(!yQ.existsSync(bO))yQ.mkdirSync(bO,{recursive:!0,mode:448})},NO,pyA=(A)=>{NO=A},ADA=(A)=>({token:bg(A.token),activeOrganizationId:bg(A.activeOrganizationId??A.organizationId),organizationName:bg(A.organizationName),activeProjectId:bg(A.activeProjectId??A.defaultProjectId),apiBaseUrl:bg(A.apiBaseUrl),authBaseUrl:bg(A.authBaseUrl),webBaseUrl:bg(A.webBaseUrl),intakeBaseUrl:bg(A.intakeBaseUrl),tailBaseUrl:bg(A.tailBaseUrl),apiDomain:bg(A.apiDomain),webDomain:bg(A.webDomain),intakeDomain:bg(A.intakeDomain),tailDomain:bg(A.tailDomain),forwardPublicKey:bg(A.forwardPublicKey),forwardPublicKeyProjectId:bg(A.forwardPublicKeyProjectId),skippedOnboardingSteps:usA(A.skippedOnboardingSteps)}),FsA=(A)=>({version:2,activeProfile:"default",profiles:{default:ADA(A)}}),LsA=(A)=>{let t=bg(A.activeProfile)??"default",g=typeof A.profiles==="object"&&A.profiles!==null?A.profiles:{},i={};for(let[n,Q]of Object.entries(g)){if(typeof Q!=="object"||Q===null)continue;i[n]=ADA(Q)}if(!i[t])i[t]={};return{version:2,activeProfile:t,profiles:i}},mA=()=>{try{if(!yQ.existsSync(mh))return Ut(qyA);let A=yQ.readFileSync(mh,"utf-8"),t=JSON.parse(A),g=typeof t.version==="number"?t.version:void 0;if(g!==void 0&&g>2)return at("Settings file requires a newer CLI version. Upgrade with 'npm install -g @sazabi/cli@latest'.");if(g===2)return Ut(LsA(t));let i=FsA(t),n=wt(i);if(!n.success)return n;return Ut(i)}catch(A){let t=A instanceof Error?A.message:String(A);return at(t)}},wt=(A)=>{try{return UsA(),yQ.writeFileSync(mh,JSON.stringify(A,null,2),{encoding:"utf-8",mode:384}),Ut(void 0)}catch(t){let g=t instanceof Error?t.message:String(t);return at(g)}},zn=(A,t)=>{if(t)return t;if(NO)return NO;let g=process.env.SAZABI_PROFILE?.trim();if(g)return g;return A.activeProfile??"default"},mt=(A,t)=>{let g=zn(A,t),i=A.profiles[g];if(i)return Ut(i);if(g==="default")return Ut({});return at(`Profile '${g}' does not exist. Run 'sazabi profiles create ${g}' first.`)},oi=()=>{let A=mA();if(!A.success)return A;return mt(A.value)},xt=(A,t,g)=>{let i=zn(A,g);if(!A.profiles[i])return at(`Profile '${i}' does not exist. Run 'sazabi profiles create ${i}' first.`);return Ut({...A,profiles:{...A.profiles,[i]:{...A.profiles[i],...t}}})},tDA=(A,t)=>A?.skippedOnboardingSteps?.[t]??[],gDA=(A,t,g,i)=>{let n=mt(A,i);if(!n.success)return n;let Q={...n.value.skippedOnboardingSteps},o=Q[t]??[];if(!o.includes(g))Q[t]=[...o,g];return xt(A,{skippedOnboardingSteps:Q},i)},nDA=(A,t,g)=>{let i=mt(A,g);if(!i.success)return i;let{[t]:n,...Q}=i.value.skippedOnboardingSteps??{};return xt(A,{skippedOnboardingSteps:Object.keys(Q).length>0?Q:void 0},g)},On=(A)=>{if(!A?.forwardPublicKey&&!A?.forwardPublicKeyProjectId)return{};return{forwardPublicKey:void 0,forwardPublicKeyProjectId:void 0}};var Ng=D(()=>{dyA();IA();bO=uO.join(syA.homedir(),".sazabi"),mh=uO.join(bO,"settings.json")});var Pi=(A)=>{let{cliFlag:t,globalUrl:g,globalDomain:i,buildUrlFromDomain:n,defaultUrl:Q}=A;if(t)return t;let o=process.env.SAZABI_API_URL?.trim();if(o)return o;if(g)return g;if(i)return n(i);return Q},f=(A)=>{let{tokenFlag:t,organizationIdFlag:g,projectIdFlag:i,jsonMode:n}=A,Q=t?.trim(),o=process.env.SAZABI_TOKEN?.trim(),e=process.env.SAZABI_ORGANIZATION_ID?.trim(),B=process.env.SAZABI_PROJECT_ID?.trim(),h=N(oi(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",n),C=h.token?.trim(),c=(Q&&Q.length>0?Q:void 0)||(o&&o.length>0?o:void 0)||C,E=Q&&Q.length>0?"flag":o&&o.length>0?"environment":"settings";if(!c||c.length===0){if(n)return b("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return r("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let y,a;if(g)y=g,a="flag";else if(e&&e.length>0)y=e,a="environment";else if(h.activeOrganizationId)y=h.activeOrganizationId,a="settings";let w,u;if(i)w=i,u="flag";else if(B&&B.length>0)w=B,u="environment";else if(h.activeProjectId)w=h.activeProjectId,u="settings";return{token:c,type:"token",projectId:w,organizationId:y,tokenSource:E,organizationSource:a,projectSource:u}},ky=(A)=>{let t=N(oi(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A?.jsonMode);return Pi({cliFlag:A?.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(g)=>`https://api.${g}`,defaultUrl:"https://api.sazabi.com"})},z=(A)=>{let t=ky({apiBaseUrlFlag:A.apiBaseUrlFlag,jsonMode:A.jsonMode});return EQ({token:A.token,baseUrl:t,organizationId:A.organizationId,projectId:A.projectId,sandboxActorDescriptor:process.env.SAZABI_SANDBOX_ACTOR})},iDA,UO,FN=async(A)=>{let t=N(oi(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.jsonMode),g=Pi({cliFlag:A.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(B)=>`https://api.${B}`,defaultUrl:"https://api.sazabi.com"}),i=`${A.token}@${g}@${A.projectId??""}`,n=iDA.get(i);if(n)return n;let Q=UO.get(i);if(Q)return Q;if(!A.projectId){if(A.jsonMode)return b("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.");return r("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let o=A.projectId,e=(async()=>{let h=await EQ({token:A.token,baseUrl:g,projectId:o}).projects.get(o),c=N(h,"Couldn't fetch project info (run 'sazabi projects list' to verify the project ID)",A.jsonMode).project;return iDA.set(i,c),c})();UO.set(i,e);try{return await e}finally{UO.delete(i)}},UN=(A)=>{let t=A.trim().toLowerCase(),g=/^[a-z][a-z0-9+.-]*:\/\//.test(t)?t:`https://${t}`,i=t;try{i=new URL(g).hostname.toLowerCase()}catch{i=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,"").replace(/[/?#].*$/,"").replace(/:\d+$/,"")}return`https://app.${i.replace(/^(?:app\.)+/,"")}`},SsA=(A)=>{try{let t=new URL(A),g=t.hostname.toLowerCase();if(!g.startsWith("api."))return null;return`${t.protocol}//app.${g.slice(4)}`}catch{return null}},zi=(A)=>{let t=(i)=>i.replace(/\/+$/,"");if(A)return t(A);let g=N(oi(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)");if(g.webBaseUrl)return t(g.webBaseUrl);if(g.webDomain)return UN(g.webDomain);if(g.apiDomain)return UN(g.apiDomain);if(g.apiBaseUrl){let i=SsA(g.apiBaseUrl);if(i)return i}return"https://app.sazabi.com"},dg=(A,t)=>{if(A&&A.length>0)return A;let g="No project selected. Pass --project-id, set SAZABI_PROJECT_ID, or run 'sazabi projects use <project-id>'.";if(t)return b(g);return r(g)},Lo=(A,t)=>{return`${zi(t)}/projects/${A}`},vt=(A,t,g,i)=>{let n=`${zi(g)}/projects/${A}/threads/${t}`;return i?`${n}?messageId=${encodeURIComponent(i)}`:n},QDA=(A,t,g,i)=>{return vt(A,t,g,i)},oDA=(A,t,g)=>{return`${Lo(A,g)}/issues/${t}`},IDA=(A,t,g)=>{return`${Lo(A,g)}/automations/${t}`},eDA=(A,t)=>{return`${Lo(A,t)}/status`},BDA=(A,t,g)=>{return`${Lo(A,g)}/settings/log-source-providers/${t}`},hDA=(A,t,g)=>{return`${Lo(A,g)}/settings/mcp-connectors/${t}`},LN=(A,t,g)=>{return`${Lo(A,g)}/settings/sandbox/catalog/${t}`},CDA=(A,t)=>{return`https://otlp.${t}.intake.${A}`};var wA=D(()=>{nA();$y();IA();Ng();iDA=new Map,UO=new Map});var tu,$bA=(A)=>{tu.set(A.name,A)},gu=(A)=>{return tu.get(A)},AD=()=>{return Array.from(tu.values())},kbA=(A)=>{return tu.has(A)};var Tv=D(()=>{tu=new Map});async function Ov(A){let t=await A.publicKeys.list({limit:20});if(!t.success)return[];return t.value.publicKeys.map((g)=>({value:g.id,description:g.name}))}async function vv(A){let t=await A.secretKeys.list({limit:20});if(!t.success)return[];return t.value.secretKeys.map((g)=>({value:g.id,description:g.name}))}async function gD(A){let t=await A.logSources.list();if(!t.success)return[];return t.value.logSources.map((g)=>({value:g.id,description:g.name??g.provider}))}async function JbA(A){let t=await A.members.list();if(!t.success)return[];return t.value.members.map((g)=>({value:g.userId,description:g.name??g.email}))}var UIt=3000,FIt,TbA=async(A,t,g)=>{try{let i=FIt[A]?.[t];if(!i)return[];let n=oi();if(!n.success)return[];let Q=n.value,o=process.env.SAZABI_TOKEN?.trim()||Q.token?.trim();if(!o)return[];let e=Pi({globalUrl:Q.apiBaseUrl,globalDomain:Q.apiDomain,buildUrlFromDomain:(C)=>`https://api.${C}`,defaultUrl:"https://api.sazabi.com"}),B=EQ({token:o,baseUrl:e,organizationId:Q.activeOrganizationId,projectId:Q.activeProjectId});return(await Promise.race([i(B),new Promise((C)=>setTimeout(()=>C([]),UIt))])).filter((C)=>C.value.startsWith(g))}catch{return[]}};var RbA=D(()=>{$y();wA();Ng();FIt={threads:{get:async(A)=>{let t=await A.threads.list({limit:20});if(!t.success)return[];return t.value.threads.map((g)=>({value:g.id,description:g.title??void 0}))}},projects:{use:async(A)=>{let t=await A.projects.list();if(!t.success)return[];return t.value.projects.map((g)=>({value:g.id,description:g.name}))}},organizations:{use:async(A)=>{let t=await A.organizations.list();if(!t.success)return[];return t.value.organizations.map((g)=>({value:g.id,description:g.name}))},rename:async(A)=>{let t=await A.organizations.list();if(!t.success)return[];return t.value.organizations.map((g)=>({value:g.id,description:g.name}))}},"public-keys":{get:Ov,update:Ov,deactivate:Ov},"secret-keys":{get:vv,update:vv,delete:vv},"log-sources":{get:gD,enable:gD,disable:gD,delete:gD,remove:gD},members:{"update-role":JbA,remove:JbA}}});var PbA={};ei(PbA,{parseCompletionContext:()=>lIt,getCompletions:()=>MIt});var LIt,SIt,lIt=(A)=>{let t=A.length>0?A:[""],g=t.length-1,i=t[g]??"";return{words:t,currentIndex:g,partial:i}},MIt=async(A)=>{let{words:t,currentIndex:g,partial:i}=A,n=t[g-1];if(n==="--profile")return GIt(i);let Q=kIt(t),o=Math.max(0,Q.length-(t.length-g));if(o===0)return YIt(i);let e=Q[0]??"",B=gu(e);if(!B)return[];if(o===1&&B.subcommands){if(i.startsWith("-"))return fbA(B.options,Q);return $It(B,i)}let h=B.subcommands?Q[1]:void 0,c=(h?B.subcommands?.[h]:void 0)?.options??B.options;if(i.startsWith("-"))return fbA(c,Q);if(n?.startsWith("--")){let E=n.slice(2);if(c?.[E]?.type==="string"){let a=`${e}:${h??""}`,w=SIt[a]?.[E]??LIt[E];if(w)return w.filter((u)=>u.startsWith(i)).map((u)=>({value:u}));return[]}}return TbA(e,h??"",i)},YIt=(A)=>{let g=AD().filter((n)=>n.name.startsWith(A)).map((n)=>({value:n.name,description:n.description})),i=[{value:"--help",description:"Show help"},{value:"--version",description:"Show version"},{value:"--profile",description:"Use a named profile"}];for(let n of i)if(n.value.startsWith(A))g.push(n);return g},$It=(A,t)=>{if(!A.subcommands)return[];return Object.values(A.subcommands).filter((g)=>g.name.startsWith(t)).map((g)=>({value:g.name,description:g.description}))},fbA=(A,t)=>{let g=t[t.length-1]??"",i=new Set(t.filter((Q)=>Q.startsWith("--")).map((Q)=>Q.replace(/=.*/,""))),n=[];if(!i.has("--help")&&"--help".startsWith(g))n.push({value:"--help",description:"Show help"});if(!i.has("--profile")&&"--profile".startsWith(g))n.push({value:"--profile",description:"Use a named profile"});if(!A)return n;for(let[Q,o]of Object.entries(A)){let e=`--${Q}`;if(i.has(e))continue;if(!e.startsWith(g))continue;n.push({value:e,description:o.description})}return n},kIt=(A)=>{let t=[];for(let g=0;g<A.length;g++){let i=A[g];if(i==="--profile"&&g+1<A.length)g++;else if(i.startsWith("--profile="));else t.push(i)}return t},GIt=(A)=>{try{let t=mA();if(!t.success)return[];return Object.keys(t.value.profiles).filter((g)=>g.startsWith(A)).map((g)=>({value:g,description:g===t.value.activeProfile?"active":void 0}))}catch{return[]}};var zbA=D(()=>{Tv();Ng();RbA();LIt={status:["regular","archived"],format:["json","text"]},SIt={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});nA();nA();nA();import{parseArgs as pv}from"node:util";var S=(A,t,g={})=>{let i=Object.hasOwn(t,"json")&&A.includes("--json"),n=(C,c)=>{if(i)b({code:C,message:c,operationId:null});throw r(c),Error("Unreachable")},Q=(()=>{try{return pv({args:A,options:t,allowPositionals:Boolean(g.allowPositionals),strict:!1,tokens:!0})}catch(C){let c=new Set(Object.keys(t)),E=new Set(Object.values(t).map((a)=>a.short).filter((a)=>Boolean(a)));try{let a=pv({args:A,options:t,allowPositionals:!0,strict:!1,tokens:!0}),w=[...new Set((a.tokens??[]).flatMap((u)=>u.kind==="option"?[u]:[]).filter((u)=>!c.has(u.name)&&!(u.name.length===1&&E.has(u.name))).map((u)=>u.name.length>1?`--${u.name}`:`-${u.name}`))];if(w.length>0)return n("UNEXPECTED_ARGUMENT",`Unknown option${w.length>1?"s":""}: ${w.join(", ")}. Run the command with -h for usage.`)}catch{}let y=C instanceof Error?C.message:"Invalid arguments.";return n("INVALID_ARGUMENT",`${y.endsWith(".")?y:`${y}.`} Run the command with -h for usage.`)}})(),o=Object.hasOwn(t,"json")&&Q.values.json===!0,e=new Set(Object.keys(t)),B=new Set(Object.entries(t).map(([,C])=>C.short).filter((C)=>Boolean(C))),h=[];if(Array.isArray(Q.tokens))for(let C of Q.tokens){if(C.kind!=="option")continue;let c=C.name,E=c.length>1;if(!(e.has(c)||!E&&B.has(c))){let a=E?`--${c}`:`-${c}`;if(!h.includes(a))h.push(a)}}for(let C of Object.keys(Q.values))if(!e.has(C)){let c=C.length>1?`--${C}`:`-${C}`;if(!h.includes(c))h.push(c)}if(h.length>0){let C=`Unknown option${h.length>1?"s":""}: ${h.join(", ")}. Run the command with -h for usage.`;if(o)b({code:"UNEXPECTED_ARGUMENT",message:C,operationId:null});r(C)}for(let[C,c]of Object.entries(t))if(c.type==="string"&&Q.values[C]===!0){let E=C.length===1?`-${C}`:`--${C}`,y=`Option ${E} requires a value. Use '${E} <value>'.`;n("INVALID_ARGUMENT",y)}for(let[C,c]of Object.entries(t)){let E=Q.values[C];if(c.type==="string"&&typeof E==="string"){if(E.length===0){let a=C.length===1?`-${C}`:`--${C}`;n("INVALID_ARGUMENT",`Option ${a} requires a non-empty value.`)}if(E.startsWith("--")||E.length===2&&E[0]==="-"&&/[a-zA-Z]/.test(E.charAt(1))){let w=`Option ${C.length===1?`-${C}`:`--${C}`} received "${E}" as its value. Did you forget to provide a value?`;n("INVALID_ARGUMENT",w)}}}if(!g.allowPositionals&&Q.positionals.length>0)n("UNEXPECTED_ARGUMENT",`Unexpected argument${Q.positionals.length>1?"s":""}: ${Q.positionals.join(", ")}. Run the command with -h for usage.`);return{values:Q.values,positionals:Q.positionals}};var BD=(A,t)=>{if(A?.json?.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class A1{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(A,t,g){this.name=A,this.description=t,this.handler=g}withOptions(A){return this.options=A,this}withSubcommands(A){return this.subcommands=A,this}withExamples(A){return this.examples=A,this}withPositionalArgs(A){return this.positionalArgs=A,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Subcommand "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson&&this.handler)BD(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[A,t]of Object.entries(this.subcommands))if(!t.subcommands)BD(t.options,`Subcommand "${this.name} ${A}"`)}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}class t1{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(A,t){this.name=A,this.description=t}withHandler(A){return this.handler=A,this}withSubcommands(A){return this.subcommands=A,this}withOptions(A){return this.options=A,this}withExamples(A){return this.examples=A,this}withPositionalArgs(A){return this.positionalArgs=A,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Command "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson){if(this.handler)BD(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[A,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;BD(t.options,`Subcommand "${this.name} ${A}"`)}}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}var iA=(A,t)=>{return new t1(A,t)},U=(A,t,g)=>{return new A1(A,t,g)};nA();var Cg=(A,t,g,i,n)=>{let Q=Number.parseInt(A,10);if(Number.isNaN(Q)||Q<t||Q>g){let o=`${i} must be between ${t} and ${g}.`;if(n)return b(o);return r(o)}return Q},An=(A,t,g,i)=>{if(!t.includes(A)){let n=t.map((o)=>`"${o}"`).join(" or "),Q=`${g} must be ${n}.`;if(i)return b(Q);return r(Q)}return A};nA();wA();IA();var LO=(A)=>{let t=[];for(let g of A){let i=0;for(let n of g.content){if(n.type!=="artifact")continue;t.push({id:`${g.id}:${i}`,messageId:g.id,name:n.name,toolCallId:n.toolCallId??null,createdAt:g.createdAt,data:n.data}),i+=1}}return t},EDA=(A)=>{let t=A.lastIndexOf(":");if(t<=0||t===A.length-1)return null;let g=A.slice(0,t),i=A.slice(t+1);if(!/^\d+$/.test(i))return null;return{messageId:g,index:Number.parseInt(i,10)}},yDA=(A,t)=>{return LO(A).find((g)=>g.id===t)},FO=(A)=>typeof A==="object"&&A!==null&&!Array.isArray(A),cDA=(A)=>{let t=A===null||A===void 0?"":typeof A==="object"?JSON.stringify(A):String(A);if(/[",\n\r]/.test(t))return`"${t.replace(/"/g,'""')}"`;return t},lsA=(A)=>{if(Array.isArray(A)&&A.every(FO))return A;if(FO(A))for(let t of["rows","data","items","points"]){let g=A[t];if(Array.isArray(g)&&g.every(FO))return g}return null},DDA=(A)=>{let t=lsA(A);if(!t||t.length===0)return null;let g=[];for(let n of t)for(let Q of Object.keys(n))if(!g.includes(Q))g.push(Q);if(g.length===0)return null;let i=[g.map(cDA).join(",")];for(let n of t)i.push(g.map((Q)=>cDA(n[Q])).join(","));return i.join(`
|
|
8711
8711
|
`)};var MsA=100,aDA=100,YsA=async(A,t,g)=>{let i=[],n;for(let Q=0;Q<aDA;Q++){let o=await A.messages.list(t,{limit:MsA,...n?{cursor:n}:{}}),e=N(o,"Couldn't get artifact (check the thread ID and try again)",g);if(i.push(...e.messages),!e.nextCursor)break;n=e.nextCursor}if(n&&!g)console.error(`Warning: reached the ${aDA}-page limit; the artifact may exist beyond the scanned messages.`);return i},$sA=(A,t,g)=>{if(t)return t;let i=`--thread-id is required to locate artifact '${A}'. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>`;if(g)b(i);else r(i);return},ksA=(A,t)=>{if(t.json){Z({id:A.id,messageId:A.messageId,name:A.name,toolCallId:A.toolCallId,createdAt:A.createdAt,data:A.data});return}if(t.format==="csv"){let g=DDA(A.data);if(g===null){r(`Artifact '${A.id}' (${A.name}) has no embedded rows to render as CSV. Built-in table/timeseries artifacts persist query parameters rather than result rows, so only artifacts that embed their data (such as custom artifacts) can be exported as CSV. Use --json or the default output to inspect this artifact.`);return}console.log(g);return}console.log(JSON.stringify(A.data,null,2))},wDA=async(A,t)=>{if(!EDA(A)){let B=`Invalid artifact ID: '${A}'. Expected format '<message-id>:<index>' (from 'sazabi artifacts list').`;if(t.json)return b(B);return r(B)}let i=$sA(A,t.threadId,t.json);if(!i)return;let n=f({tokenFlag:t.token,jsonMode:t.json}),Q=z({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),o=await YsA(Q,i,t.json),e=yDA(o,A);if(!e){let B=`Artifact '${A}' not found in thread '${i}'. Run 'sazabi artifacts list --thread-id ${i}' to see available artifacts.`;if(t.json)return b(B);return r(B)}ksA(e,t)};nA();wA();IA();var GsA={id:{label:"ID",type:{kind:"string"}},name:{label:"Type",type:{kind:"string"}},toolCallId:{label:"Tool call",type:{kind:"nullable-string",emptyLabel:"(none)"}},createdAt:{label:"Created",type:{kind:"date"}}},JsA={schema:GsA,columns:["id","name","toolCallId","createdAt"],header:"Artifacts",emptyMessage:"No artifacts found in this thread."},TsA=100,rDA=100,RsA=async(A,t,g)=>{let i=[],n;for(let Q=0;Q<rDA;Q++){let o=await A.messages.list(t,{limit:TsA,...n?{cursor:n}:{}}),e=N(o,"Couldn't list artifacts (check the thread ID and try again)",g);if(i.push(...e.messages),!e.nextCursor)break;n=e.nextCursor}if(n&&!g)console.error(`Warning: reached the ${rDA}-page limit; artifact list may be incomplete for this thread.`);return i},bDA=async(A)=>{let t=f({tokenFlag:A.token,jsonMode:A.json}),g=z({token:t.token,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl}),i=await RsA(g,A.threadId,A.json),Q=LO(i).map((o)=>({id:o.id,name:o.name,toolCallId:o.toolCallId,createdAt:o.createdAt}));j(JsA,Q,{json:A.json})};var NDA=iA("artifacts","Retrieve artifacts produced in a thread").withSubcommands({list:U("list","List artifacts produced in a thread",async(A)=>{let{values:t}=S(A,{token:{type:"string"},"thread-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),g=t["thread-id"];if(!g){if(t.json)return b("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>");return r("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>")}await bDA({threadId:g,token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread to list artifacts for (required)"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts list --thread-id <thread-id> --json # Output as JSON"]).build(),get:U("get","Get a single artifact's data",async(A)=>{let{values:t,positionals:g}=S(A,{token:{type:"string"},"thread-id":{type:"string"},format:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),i=g[0];if(!i){if(t.json)return b("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>");return r("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>")}if(g.length>1){let Q=g.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${Q}.`);return r(`Unexpected arguments: ${Q}.`)}let n;if(t.format)n=An(t.format,["json","csv"],"Format",t.json);await wDA(i,{token:t.token,threadId:t["thread-id"],format:n,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<artifact-id>").withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread the artifact belongs to (required)"},format:{type:"string",description:"Output format for non-JSON mode: json (default) or csv"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts get <artifact-id> --thread-id <thread-id> # Print artifact data","sazabi artifacts get <artifact-id> --thread-id <thread-id> --format csv # Render table/timeseries as CSV","sazabi artifacts get <artifact-id> --thread-id <thread-id> --json # Output as JSON"]).build()}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts get <artifact-id> --thread-id <thread-id> # Get one artifact's data"]).build();nA();wO();import{spawn as fsA}from"node:child_process";var P={token:{type:"string"},"api-base-url":{type:"string"},json:{type:"boolean"}},R={token:{type:"string",description:"Override token"},"api-base-url":{type:"string",description:"Override API base URL"},json:{type:"boolean",description:"Output as JSON"}};wA();IA();Ng();var uDA="sazabi:organization:",UDA="sazabi:project:",FDA=(A)=>{let t=null,g=null;for(let i of(A??"").split(/\s+/).filter(Boolean))try{if(i.startsWith(uDA))t=decodeURIComponent(i.slice(uDA.length));else if(i.startsWith(UDA))g=decodeURIComponent(i.slice(UDA.length))}catch{return null}return t?{organizationId:t,projectId:g}:null},xh=(A)=>{if(A==="flag")return"from flag";if(A==="environment")return"from environment";return"from settings"},PsA=async(A={})=>{let t=f({jsonMode:A.json}),g=z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl,jsonMode:A.json}),i=N(await g.me(),"Couldn't fetch authentication details (run 'sazabi auth login' to sign in again)",A.json);if(A.json){Z({credential:i,activeOrganizationId:t.organizationId,activeProjectId:t.projectId,tokenSource:t.tokenSource,organizationSource:t.organizationSource,projectSource:t.projectSource});return}if(rA("Authentication"),i.credentialType==="user"){SA({Type:`User token (${xh(t.tokenSource)})`,User:i.user.name??i.user.email,Email:i.user.email,"Active organization":t.organizationId&&t.organizationSource?`${t.organizationId} (${xh(t.organizationSource)})`:hg("(none)"),"Active project":t.projectId&&t.projectSource?`${t.projectId} (${xh(t.projectSource)})`:hg("(none)"),Organizations:i.organizations.length.toString(),"Dashboard URL":zi()});return}if(i.credentialType==="secret"){SA({Type:`Secret key (${xh(t.tokenSource)})`,Organization:i.organization.name,"Key name":i.keyName,"Active project":t.projectId&&t.projectSource?`${t.projectId} (${xh(t.projectSource)})`:hg("(none)"),"Dashboard URL":zi()});return}SA({Type:`Partner key (${xh(t.tokenSource)})`,Superorganization:i.superorganization.name,"Dashboard URL":zi()})},zsA=async(A,t={})=>{let g=A.trim();if(!g){if(t.json)return b("Token is required.");return r("Token is required.")}let i=N(mA(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",t.json);await lO({token:g,options:t,cliSettings:i,status:"saved"})},LDA=(A)=>{let t=process.platform,g,i;if(t==="darwin")g="open",i=[A];else if(t==="win32")g="cmd",i=["/c","start","",A];else g="xdg-open",i=[A];let n=fsA(g,i,{detached:!0,stdio:"ignore"});n.on("error",()=>{}),n.unref()},SDA=(A)=>new Promise((t)=>setTimeout(t,A)),OsA=async(A={})=>{let t=N(mA(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=zn(t),i=t.profiles[g]??{},n=MO(i,A.apiBaseUrl),Q=lDA(n,A.authBaseUrl??i.authBaseUrl),o;try{o=await DO({apiBaseUrl:Q})}catch(E){let y=E instanceof Error?E.message:String(E);if(A.json)return b(`Failed to initiate sign-up: ${y}`);return r(`Failed to initiate sign-up: ${y}`)}let e=YDA({profile:i,publicApiBaseUrl:n,authBaseUrl:Q,apiBaseUrlOverride:A.apiBaseUrl,authBaseUrlOverride:A.authBaseUrl,webBaseUrlOverride:A.webBaseUrl,verificationUriComplete:o.verificationUriComplete}),B=`/login/cli?user_code=${encodeURIComponent(o.userCode)}`,h=`${e}/sign-up?returnTo=${encodeURIComponent(B)}`,C=new Date(Date.now()+o.expiresIn*1000),c=o.interval*1000;if(!A.json)bA(),rA("Create a Sazabi account"),bA(),ug(`Opening ${d.info(h)}`),bA(),LDA(h),H("Waiting for sign-up to complete...");while(new Date<C){await SDA(c);try{let E=await aO({apiBaseUrl:Q,deviceCode:o.deviceCode});if(E.status==="pending"){c=(E.interval??o.interval)*1000;continue}if(E.status==="denied"){if(A.json)return b("Sign-up was denied.");return bA(),r("Sign-up was denied.")}if(E.status==="expired"){if(A.json)return b("Sign-up request expired. Try again.");return bA(),r("Sign-up request expired. Try again.")}await lO({token:E.accessToken,options:A,cliSettings:t,status:"authorized",approvedContext:FDA(E.scope)});return}catch(E){let y=E instanceof Error?E.message:String(E);if(A.json)return b(`Sign-up failed: ${y}`);return bA(),r(`Sign-up failed: ${y}`)}}if(A.json)return b("Sign-up request expired. Try again.");return bA(),r("Sign-up request expired. Try again.")},vsA=async(A={})=>{await SO(A)},SO=async(A={})=>{let t=N(mA(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=zn(t),i=t.profiles[g]??{},n=MO(i,A.apiBaseUrl),Q=lDA(n,A.authBaseUrl??i.authBaseUrl),o;try{o=await DO({apiBaseUrl:Q})}catch(c){let E=c instanceof Error?c.message:String(c);if(A.json)return b(`Failed to initiate login: ${E}`);return r(`Failed to initiate login: ${E}`)}let e=YDA({profile:i,publicApiBaseUrl:n,authBaseUrl:Q,apiBaseUrlOverride:A.apiBaseUrl,authBaseUrlOverride:A.authBaseUrl,webBaseUrlOverride:A.webBaseUrl,verificationUriComplete:o.verificationUriComplete}),B=_sA(o.verificationUriComplete,e),h=new Date(Date.now()+o.expiresIn*1000),C=o.interval*1000;if(!A.json)bA(),rA("Sign in to Sazabi"),bA(),ug("Enter this code in your browser:"),bA(),ug(d.bold(o.userCode),4),bA(),ug(`Opening ${d.info(B)}`),bA(),LDA(B),H("Waiting for authorization...");while(new Date<h){await SDA(C);try{let c=await aO({apiBaseUrl:Q,deviceCode:o.deviceCode});if(c.status==="pending"){C=(c.interval??o.interval)*1000;continue}if(c.status==="denied"){if(A.json)return b("Authorization was denied.");return bA(),r("Authorization was denied.")}if(c.status==="expired"){if(A.json)return b("Authorization request expired. Try again.");return bA(),r("Authorization request expired. Try again.")}let E=FDA(c.scope);return await lO({token:c.accessToken,options:A,cliSettings:t,status:"authorized",approvedContext:E}),{token:c.accessToken,approvedContext:E}}catch(c){let E=c instanceof Error?c.message:String(c);if(A.json)return b(`Authorization failed: ${E}`);return bA(),r(`Authorization failed: ${E}`)}}if(A.json)return b("Authorization request expired. Try again.");return bA(),r("Authorization request expired. Try again.")},ZsA=(A)=>{let t=N(mA(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",A.json),g=N(mt(t),"Couldn't resolve profile (run 'sazabi profiles list' to see available profiles)",A.json),i=Boolean(g.token),n=N(xt(t,{token:void 0,activeOrganizationId:void 0,organizationName:void 0,activeProjectId:void 0,...On(g)}),"Failed to update profile",A.json);if(N(wt(n),"Failed to remove credentials",A.json),A.json){Z({removed:i});return}if(i){O("Signed out.");return}H("No credentials were saved.")},lO=async({token:A,options:t,cliSettings:g,status:i,approvedContext:n})=>{let Q=zn(g),o=g.profiles[Q]??{},e=MO(o,t.apiBaseUrl),B=z({token:A,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),h=N(await B.me(),`Couldn't resolve authenticated context at ${e} (pass --api-base-url to target a different environment)`,t.json);if(i==="authorized"&&h.credentialType!=="user"){if(t.json)return b("Expected a user session from device authorization.");return r("Expected a user session from device authorization.")}if(n&&h.credentialType==="user"&&h.activeOrganizationId!==n.organizationId){if(t.json)return b("The issued session did not match the organization approved in the browser.");return r("The issued session did not match the organization approved in the browser.")}let C=g.profiles[Q]?g:{...g,profiles:{...g.profiles,[Q]:{}}},c=C.profiles[Q],E=await WsA({client:B,credential:h,currentProjectId:c.activeProjectId,approvedProjectId:n?n.projectId:void 0,jsonMode:t.json}),y=c.token!==A||c.activeOrganizationId!==E.activeOrganizationId||c.activeProjectId!==E.activeProjectId,a=N(xt(C,{token:A,activeOrganizationId:E.activeOrganizationId,organizationName:E.activeOrganizationName,activeProjectId:E.activeProjectId,apiBaseUrl:t.apiBaseUrl??c.apiBaseUrl,authBaseUrl:t.authBaseUrl??c.authBaseUrl,webBaseUrl:t.webBaseUrl??c.webBaseUrl,...y&&On(c)}),"Failed to update profile",t.json);if(N(wt(a),"Failed to save credentials",t.json),t.json){Z({status:i,credential:h,activeOrganizationId:E.activeOrganizationId,activeProjectId:E.activeProjectId,projects:E.projects});return}if(bA(),O(i==="authorized"?"Signed in.":"Token saved."),bA(),XsA({credential:h,activeOrganizationName:E.activeOrganizationName,activeProjectId:E.activeProjectId,projects:E.projects}),E.projects.length>0){bA(),rA("Available projects");for(let w of E.projects){let F=w.id===E.activeProjectId?d.success(" (active)"):"";ug(`${w.name} (${w.region})${F}`)}}},WsA=async({client:A,credential:t,currentProjectId:g,approvedProjectId:i,jsonMode:n})=>{if(t.credentialType==="partner")return{projects:[]};let Q=t.credentialType==="user"?t.activeOrganizationId??t.organizations[0]?.id:t.organization.id,o=t.credentialType==="user"?t.organizations.find((B)=>B.id===Q)?.name:t.organization.name,e=Q?N(await A.projects.list({organizationId:Q}),"Couldn't fetch projects (check your organization access and try again)",n).projects:[];return{activeOrganizationId:Q,activeOrganizationName:o,activeProjectId:VsA(e,g,i),projects:e}},VsA=(A,t,g)=>{if(g===null)return;if(g!==void 0)return A.some((i)=>i.id===g)?g:void 0;if(t&&A.some((i)=>i.id===t))return t;return A[0]?.id},XsA=({credential:A,activeOrganizationName:t,activeProjectId:g,projects:i})=>{if(A.credentialType==="user"){SA({Type:"User token",User:A.user.name??A.user.email,Organizations:A.organizations.length.toString(),"Active organization":t??"(none)","Active project":i.find((n)=>n.id===g)?.name??"(none)"});return}if(A.credentialType==="secret"){SA({Type:"Secret key",Organization:A.organization.name,"Key name":A.keyName,"Active project":i.find((n)=>n.id===g)?.name??"(none)"});return}SA({Type:"Partner key",Superorganization:A.superorganization.name})},MO=(A,t)=>{return Pi({cliFlag:t,globalUrl:A.apiBaseUrl,globalDomain:A.apiDomain,buildUrlFromDomain:(g)=>`https://api.${g}`,defaultUrl:"https://api.sazabi.com"})},lDA=(A,t)=>{if(t)return t;try{let g=new URL(A);if(["localhost","127.0.0.1"].includes(g.hostname)&&["15005","15009"].includes(g.port))return g.port="15001",g.toString().replace(/\/$/,"");if(g.hostname==="api.sazabi.com")return g.hostname="api.platform.sazabi.com",g.toString().replace(/\/$/,"");if(g.hostname==="api.staging.sazabi.dev")return g.hostname="api.platform.staging.sazabi.dev",g.toString().replace(/\/$/,"");return g.toString().replace(/\/$/,"")}catch{return A}},MDA=(A)=>A.replace(/\/+$/,""),yn=(A)=>(A?.trim().length??0)>0,HsA=(A)=>{if(!yn(A))return;try{let t=new URL(A);return`${t.protocol}//${t.host}`}catch{return}},qh=(A)=>{if(!yn(A))return;try{let g=new URL(A).hostname.toLowerCase();if(["localhost","127.0.0.1"].includes(g))return"https://localhost:5173";if(["api.staging.sazabi.dev","api.platform.staging.sazabi.dev"].includes(g))return"https://app.staging.sazabi.dev";if(["api.sazabi.com","api.platform.sazabi.com"].includes(g))return"https://app.sazabi.com"}catch{return}return},KsA=(A)=>{if(yn(A.webBaseUrl))return MDA(A.webBaseUrl);if(yn(A.webDomain))return UN(A.webDomain);return},jsA=({profile:A,publicApiBaseUrl:t})=>{if(!(yn(A.authBaseUrl)||yn(A.apiBaseUrl)||yn(A.apiDomain)))return;if(yn(A.authBaseUrl)){let i=qh(A.authBaseUrl);if(i)return i}return qh(t)},YDA=({profile:A,publicApiBaseUrl:t,authBaseUrl:g,apiBaseUrlOverride:i,authBaseUrlOverride:n,webBaseUrlOverride:Q,verificationUriComplete:o})=>{if(yn(Q))return MDA(Q);let e=process.env.SAZABI_API_URL?.trim(),B=yn(n)||yn(i)||yn(e),h=HsA(o);if(B){let E=yn(n)?qh(g):qh(t);if(E)return E;if(h)return h}let C=KsA(A);if(C)return C;let c=jsA({profile:A,publicApiBaseUrl:t});if(c)return c;if(h)return h;return"https://app.sazabi.com"},_sA=(A,t)=>{if(!t)return A;try{let g=new URL(A),i=new URL(t);return g.protocol=i.protocol,g.host=i.host,g.toString()}catch{return A}},$DA=iA("auth","Manage authentication credentials").withSubcommands({signup:U("signup","Create a new Sazabi account via browser",async(A)=>{let{values:t,positionals:g}=S(A,{...P,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return b(`Unexpected arguments: ${i}.`);return r(`Unexpected arguments: ${i}.`)}await OsA({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...R,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth signup # Create a new account via browser"]).build(),login:U("login","Authenticate via browser",async(A)=>{let{values:t,positionals:g}=S(A,{...P,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return b(`Unexpected arguments: ${i}.`);return r(`Unexpected arguments: ${i}.`)}await vsA({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({...R,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth login # Authenticate via browser"]).build(),save:U("save","Save an existing bearer token",async(A)=>{let{values:t,positionals:g}=S(A,{...P,"web-base-url":{type:"string"}},{allowPositionals:!0}),i=g[0];if(!i){if(t.json)return b("Token is required.");return r("Token is required.")}if(g.length>1){let n=g.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${n}.`);return r(`Unexpected arguments: ${n}.`)}await zsA(i,{json:t.json,apiBaseUrl:t["api-base-url"],webBaseUrl:t["web-base-url"]})}).withPositionalArgs("<token>").withOptions({...R,"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth save sazabi_secret_xxx # Save a secret key for future commands"]).build(),logout:U("logout","Remove saved credentials",async(A)=>{let{values:t,positionals:g}=S(A,P,{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return b(`Unexpected arguments: ${i}.`);return r(`Unexpected arguments: ${i}.`)}ZsA({json:t.json})}).withOptions(R).withExamples(["sazabi auth logout # Remove saved credentials"]).build(),whoami:U("whoami","Display current authentication context (JSON: top-level activeOrganizationId/activeProjectId are the effective CLI context; credential.* echoes the raw server session)",async(A)=>{let{values:t,positionals:g}=S(A,P,{allowPositionals:!0});if(g.length>0){let i=g.join(", ");if(t.json)return b(`Unexpected arguments: ${i}.`);return r(`Unexpected arguments: ${i}.`)}await PsA({json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions(R).withExamples(["sazabi auth whoami # Show current context","sazabi auth whoami --json # Output as JSON"]).build()}).withExamples(["sazabi auth signup # Create a new account via browser","sazabi auth login # Authenticate via browser","sazabi auth save sazabi_secret_xxx # Save an existing token","sazabi auth logout # Remove saved credentials","sazabi auth whoami # Show current context"]).build();nA();wA();IA();var Gy=(A)=>({id:A.id,name:A.name,status:A.enabled?"active":"paused",source:A.source,kind:A.kind,health:A.health,cronExpression:A.cronExpression,timezone:A.timezone,timeoutSeconds:A.timeoutSeconds,successRate:A.successRate,runCount:A.runCount,failedRunCount:A.failedRunCount,lastRunStatus:A.lastRun?.status??null,lastRunAt:A.lastRun?.startedAt??null,scriptIdentifier:"scriptIdentifier"in A?A.scriptIdentifier:null,scriptId:"scriptId"in A?A.scriptId:null,scriptName:"scriptName"in A?A.scriptName:null,canToggle:"canToggle"in A?A.canToggle:null,createdAt:"createdAt"in A?A.createdAt:null,updatedAt:"updatedAt"in A?A.updatedAt:null}),GDA={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"nullable-string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"custom",render:(A)=>A==="active"?"Enabled":"Disabled",serialize:(A)=>A}},source:{label:"Source",type:{kind:"string"}},kind:{label:"Kind",type:{kind:"string"}},health:{label:"Health",type:{kind:"string"}},cronExpression:{label:"Cron",type:{kind:"nullable-string",emptyLabel:"(n/a)"}},timezone:{label:"Timezone",type:{kind:"string"}},timeoutSeconds:{label:"Timeout (s)",type:{kind:"custom",render:(A)=>A==null?"(none)":String(A),serialize:(A)=>A}},successRate:{label:"Success rate",type:{kind:"custom",render:(A)=>A==null?"(n/a)":`${Math.round(Number(A)*100)}%`,serialize:(A)=>A}},runCount:{label:"Runs (7d)",type:{kind:"number"}},failedRunCount:{label:"Failures (7d)",type:{kind:"number"}},lastRunStatus:{label:"Last run status",type:{kind:"nullable-string",emptyLabel:"(never)"}},lastRunAt:{label:"Last run",type:{kind:"nullable-date",emptyLabel:"(never)"}},scriptIdentifier:{label:"Script",type:{kind:"nullable-string"}},scriptId:{label:"Script ID",type:{kind:"nullable-string"}},scriptName:{label:"Script name",type:{kind:"nullable-string"}},canToggle:{label:"Can toggle",type:{kind:"custom",render:(A)=>A==null?"(n/a)":A?"yes":"no",serialize:(A)=>A}},createdAt:{label:"Created at",type:{kind:"nullable-date"}},updatedAt:{label:"Updated at",type:{kind:"nullable-date"}}},msA={schema:GDA,columns:["name","status","health","cronExpression","lastRunAt"],jsonFields:["id","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt"],header:"Automations",emptyMessage:"No automations found."},SN={layout:"field-list",schema:GDA,fields:["id","url","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt","scriptIdentifier","scriptId","scriptName","canToggle","createdAt","updatedAt"],title:"Automation"},JDA=(A)=>({id:A.id,automationRunKey:A.automationRunKey,status:A.status,scheduledAt:A.scheduledAt,dueAt:A.dueAt,startedAt:A.startedAt,completedAt:A.completedAt,durationMs:A.durationMs,exitCode:A.exitCode,errorMessage:A.errorMessage,automationId:"automationId"in A?A.automationId:null}),TDA={id:{label:"ID",type:{kind:"id"}},automationId:{label:"Automation",type:{kind:"nullable-string"}},automationRunKey:{label:"Run key",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},scheduledAt:{label:"Scheduled at",type:{kind:"nullable-date"}},dueAt:{label:"Due at",type:{kind:"nullable-date"}},startedAt:{label:"Started at",type:{kind:"date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},exitCode:{label:"Exit code",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},errorMessage:{label:"Error",type:{kind:"nullable-string",emptyLabel:"(none)"}}},xsA={schema:TDA,columns:["status","startedAt","durationMs","exitCode"],jsonFields:["id","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],header:"Automation runs",emptyMessage:"No automation runs found."},qsA={layout:"field-list",schema:TDA,fields:["id","automationId","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],title:"Automation run"},dsA=(A)=>({status:A.status,exitCode:A.exitCode,truncated:A.truncated,durationMs:A.durationMs,startedAt:A.startedAt,completedAt:A.completedAt,stdout:A.stdout,stderr:A.stderr}),ssA={status:{label:"Status",type:{kind:"string"}},exitCode:{label:"Exit code",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},truncated:{label:"Truncated",type:{kind:"custom",render:(A)=>A?"yes":"no",serialize:(A)=>A}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(A)=>A==null?"(n/a)":String(A),serialize:(A)=>A}},startedAt:{label:"Started at",type:{kind:"nullable-date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},stdout:{label:"Stdout",type:{kind:"custom",render:(A)=>A?String(A):"(empty)",serialize:(A)=>A}},stderr:{label:"Stderr",type:{kind:"custom",render:(A)=>A?String(A):"(empty)",serialize:(A)=>A}}},psA={layout:"field-list",schema:ssA,fields:["status","exitCode","truncated","durationMs","startedAt","completedAt","stdout","stderr"],title:"Automation run logs"},So=(A)=>{let t=f({tokenFlag:A.token,projectIdFlag:A.projectId,jsonMode:A.json});return{client:z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:A.apiBaseUrl,jsonMode:A.json}),projectId:t.projectId}},lN=(A,t)=>t?{...A,url:IDA(t,A.id)}:A,ApA=async(A)=>{let{client:t}=So(A),g=N(await t.automations.list({search:A.search,status:A.status,source:A.source,health:A.health,sort:A.sort,limit:A.limit,cursor:A.cursor}),"Couldn't list automations (check the active project and try again)",A.json);j(msA,g.automations.map(Gy),{json:A.json,nextCursor:g.nextCursor})},tpA=async(A,t)=>{let{client:g,projectId:i}=So(t),n=N(await g.automations.get(A),"Couldn't get automation (run 'sazabi automations list' to see automation IDs)",t.json);X(SN,lN(Gy(n.automation),i),{json:t.json})},gpA=async(A,t)=>{let g=t.scriptId!==void 0,i=t.script!==void 0,n=t.expressionId!==void 0,Q=Number(g)+Number(i)+Number(n),o=(C)=>{if(t.json){b(C);return}r(C)};if(Q!==1){o("Provide exactly one of --script-id, --script, or --expression-id.");return}if(n){if(t.cronExpression!==void 0||t.timezone!==void 0||t.timeoutSeconds!==void 0){o("Cron and timeout flags are not used with --expression-id log-match automations.");return}if(!t.description?.trim()){o("--description is required for log-match automations (investigation instructions).");return}}let{client:e,projectId:B}=So(t),h=N(await e.automations.create({name:A,...t.description!==void 0?{description:t.description}:{},...t.scriptId!==void 0?{scriptId:t.scriptId}:{},...t.script!==void 0?{script:t.script}:{},...t.expressionId!==void 0?{expressionId:t.expressionId}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{},...t.enabled!==void 0?{enabled:t.enabled}:{}}),n?"Couldn't create log-match automation (check the expression ID and description)":"Couldn't create automation (check the script name/ID and try again)",t.json);if(!t.json)O(`Automation "${h.automation.name}" created.`);X(SN,lN(Gy(h.automation),B),{json:t.json})},npA=async(A,t)=>{if(t.name===void 0&&t.description===void 0&&t.clearDescription!==!0&&t.cronExpression===void 0&&t.timezone===void 0&&t.timeoutSeconds===void 0){if(t.json){b("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}r("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}if(t.description!==void 0&&t.clearDescription===!0){if(t.json){b("Use either --description or --clear-description, not both.");return}r("Use either --description or --clear-description, not both.");return}let{client:g,projectId:i}=So(t),n=N(await g.automations.update({automationId:A,...t.name!==void 0?{name:t.name}:{},...t.clearDescription?{description:null}:t.description!==void 0?{description:t.description}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{}}),"Couldn't update automation (run 'sazabi automations list' to see automation IDs)",t.json);if(!t.json)O(`Automation "${n.automation.name}" updated.`);X(SN,lN(Gy(n.automation),i),{json:t.json})},RDA=async(A,t,g)=>{let{client:i,projectId:n}=So(g),Q=N(t?await i.automations.enable(A):await i.automations.disable(A),t?"Failed to enable automation":"Failed to disable automation",g.json),o=lN(Gy(Q.automation),n);if(!g.json)O(`Automation "${o.name}" is now ${t?"enabled":"disabled"}.`);X(SN,o,{json:g.json})},ipA=async(A,t)=>RDA(A,!0,t),QpA=async(A,t)=>RDA(A,!1,t),opA=async(A,t)=>{let{client:g}=So(t),i=N(await g.automations.runs.list(A,{status:t.status,limit:t.limit,cursor:t.cursor}),"Couldn't list automation runs (run 'sazabi automations list' to see automation IDs)",t.json);j(xsA,i.runs.map(JDA),{json:t.json,nextCursor:i.nextCursor})},IpA=async(A,t,g)=>{let{client:i}=So(g),n=N(await i.automations.runs.get(A,t),"Couldn't get automation run (run 'sazabi automations runs list <automation-id>' to see run IDs)",g.json);X(qsA,JDA(n.run),{json:g.json})},epA=async(A,t,g)=>{let{client:i}=So(g),n=N(await i.automations.runs.logs(A,t),"Couldn't get automation run logs (run 'sazabi automations runs list <automation-id>' to see run IDs)",g.json);X(psA,dsA(n.logs),{json:g.json})},DQ={...P,"project-id":{type:"string"}},aQ={...R,"project-id":{type:"string",description:"Override active project ID"}},BpA=(A,t)=>{let g=A[0];if(!g){if(t){b("Automation name is required.");return}r("Automation name is required.");return}return g},mI=(A,t)=>{let g=A[0];if(!g){if(t){b("Automation ID is required.");return}r("Automation ID is required.");return}return g},kDA=(A,t)=>{let g=A[1];if(!g){if(t){b("Run ID is required.");return}r("Run ID is required.");return}return g},fDA=iA("automations","Manage scheduled automations").withSubcommands({list:U("list","List automations in the active project",async(A)=>{let{values:t}=S(A,{...DQ,search:{type:"string"},status:{type:"string"},source:{type:"string"},health:{type:"string"},sort:{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),g=(C)=>{if(t.json){b(C);return}r(C)},i=t.status;if(i!==void 0&&i!=="active"&&i!=="paused")return g(`Invalid --status value "${i}". Expected "active" or "paused".`);let n=t.source;if(n!==void 0&&n!=="sazabi_managed"&&n!=="custom")return g(`Invalid --source value "${n}". Expected "sazabi_managed" or "custom".`);let Q=t.health,o=["healthy","failing","never_run"];if(Q!==void 0&&!o.includes(Q))return g(`Invalid --health value "${Q}". Expected one of: ${o.join(", ")}.`);let e=t.sort,B=["name","last_run","failures","runs"];if(e!==void 0&&!B.includes(e))return g(`Invalid --sort value "${e}". Expected one of: ${B.join(", ")}.`);let h;if(t.limit!==void 0){if(h=Number(t.limit),!Number.isInteger(h)||h<1||h>100)return g(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await ApA({token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],search:t.search,status:i,source:n,health:Q,sort:e,limit:h,cursor:t.cursor})}).withOptions({...aQ,search:{type:"string",description:"Filter by automation name (case-insensitive)"},status:{type:"string",description:"Filter by status: active or paused"},source:{type:"string",description:"Filter by source: sazabi_managed or custom"},health:{type:"string",description:"Filter by health: healthy, failing, or never_run"},sort:{type:"string",description:"Sort by: name, last_run, failures, or runs"},limit:{type:"string",description:"Maximum number of automations to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations list # List all automations","sazabi automations list --status paused # List paused automations"]).build(),get:U("get","Get one automation by ID",async(A)=>{let{values:t,positionals:g}=S(A,DQ,{allowPositionals:!0}),i=mI(g,t.json);if(!i)return;await tpA(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(aQ).withExamples(["sazabi automations get <automation-id> # Get one automation"]).build(),create:U("create","Create an automation",async(A)=>{let{values:t,positionals:g}=S(A,{...DQ,description:{type:"string"},"script-id":{type:"string"},script:{type:"string"},"expression-id":{type:"string"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"},enabled:{type:"boolean"}},{allowPositionals:!0}),i=BpA(g,t.json);if(!i)return;let n=(o)=>{if(t.json){b(o);return}r(o)},Q;if(t["timeout-seconds"]!==void 0){if(Q=Number(t["timeout-seconds"]),!Number.isInteger(Q)||Q<1||Q>3600)return n(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await gpA(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],description:t.description,scriptId:t["script-id"],script:t.script,expressionId:t["expression-id"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:Q,enabled:t.enabled})}).withPositionalArgs("<name>").withOptions({...aQ,description:{type:"string",description:"Human-readable description (required for log-match automations)"},"script-id":{type:"string",description:"Project script ID to run (cron automations)"},script:{type:"string",description:"Project script name to run (cron automations)"},"expression-id":{type:"string",description:"Log-match expression ID to bind (creates a log-match investigation automation)"},"cron-expression":{type:"string",description:"Cron schedule expression"},timezone:{type:"string",description:"IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"Run timeout in seconds (1-3600)"},enabled:{type:"boolean",description:"Create the automation enabled"}}).withExamples(["sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations create deploy-nightly --script-id <script-id> # Create by script ID",'sazabi automations create "Investigate Plain tickets" --expression-id <uuid> --description "When a new Plain ticket is created, investigate …" # Create a log-match investigation automation']).build(),update:U("update","Update an automation",async(A)=>{let{values:t,positionals:g}=S(A,{...DQ,name:{type:"string"},description:{type:"string"},"clear-description":{type:"boolean"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"}},{allowPositionals:!0}),i=mI(g,t.json);if(!i)return;let n=(o)=>{if(t.json){b(o);return}r(o)},Q;if(t["timeout-seconds"]!==void 0){if(Q=Number(t["timeout-seconds"]),!Number.isInteger(Q)||Q<1||Q>3600)return n(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await npA(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,clearDescription:t["clear-description"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:Q})}).withPositionalArgs("<automation-id>").withOptions({...aQ,name:{type:"string",description:"New automation name"},description:{type:"string",description:"New human-readable description"},"clear-description":{type:"boolean",description:"Clear the automation description"},"cron-expression":{type:"string",description:"New cron schedule expression"},timezone:{type:"string",description:"New IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"New run timeout in seconds (1-3600)"}}).withExamples(["sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule"]).build(),enable:U("enable","Enable an automation",async(A)=>{let{values:t,positionals:g}=S(A,DQ,{allowPositionals:!0}),i=mI(g,t.json);if(!i)return;await ipA(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(aQ).withExamples(["sazabi automations enable <automation-id> # Enable an automation"]).build(),disable:U("disable","Disable an automation",async(A)=>{let{values:t,positionals:g}=S(A,DQ,{allowPositionals:!0}),i=mI(g,t.json);if(!i)return;await QpA(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(aQ).withExamples(["sazabi automations disable <automation-id> # Disable an automation"]).build(),runs:U("runs","Inspect automation runs").withSubcommands({list:U("list","List runs for an automation",async(A)=>{let{values:t,positionals:g}=S(A,{...DQ,status:{type:"string"},limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0}),i=mI(g,t.json);if(!i)return;let n=(B)=>{if(t.json){b(B);return}r(B)},Q=t.status,o=["running","succeeded","failed","timed_out","cancelled"];if(Q!==void 0&&!o.includes(Q))return n(`Invalid --status value "${Q}". Expected one of: ${o.join(", ")}.`);let e;if(t.limit!==void 0){if(e=Number(t.limit),!Number.isInteger(e)||e<1||e>100)return n(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await opA(i,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],status:Q,limit:e,cursor:t.cursor})}).withPositionalArgs("<automation-id>").withOptions({...aQ,status:{type:"string",description:"Filter by run status: running, succeeded, failed, timed_out, or cancelled"},limit:{type:"string",description:"Maximum number of runs to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs list <automation-id> --status failed # List failed runs"]).build(),get:U("get","Get one automation run by ID",async(A)=>{let{values:t,positionals:g}=S(A,DQ,{allowPositionals:!0}),i=mI(g,t.json);if(!i)return;let n=kDA(g,t.json);if(!n)return;await IpA(i,n,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(aQ).withExamples(["sazabi automations runs get <automation-id> <run-id> # Get one automation run"]).build(),logs:U("logs","Get the captured logs for an automation run",async(A)=>{let{values:t,positionals:g}=S(A,DQ,{allowPositionals:!0}),i=mI(g,t.json);if(!i)return;let n=kDA(g,t.json);if(!n)return;await epA(i,n,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(aQ).withExamples(["sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations list # List all automations","sazabi automations get <automation-id> # Get one automation","sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule","sazabi automations enable <automation-id> # Enable an automation","sazabi automations disable <automation-id> # Disable an automation","sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build();nA();wA();import{spawn as hpA}from"node:child_process";var wQ=(A)=>{let t=process.platform,g,i;if(t==="darwin")g="open",i=[A];else if(t==="win32")g="cmd",i=["/c","start","",A];else g="xdg-open",i=[A];let n=hpA(g,i,{detached:!0,stdio:"ignore"});n.on("error",()=>{}),n.unref()},Oi=(A)=>new Promise((t)=>setTimeout(t,A));import{randomUUID as CpA}from"node:crypto";import MN from"node:fs";import cpA from"node:os";import PDA from"node:path";var zDA=()=>PDA.join(cpA.homedir(),".sazabi","pending-purchases"),EpA=()=>{MN.mkdirSync(zDA(),{recursive:!0,mode:448})},ODA=(A)=>PDA.join(zDA(),`${encodeURIComponent(A)}.json`),ypA=(A)=>{for(let t=0;t<50;t+=1){let g;try{g=MN.readFileSync(A,"utf-8")}catch(n){if(n.code==="ENOENT")return null;throw n}if(g.trim().length>0)try{let n=JSON.parse(g);if(n?.idempotencyKey&&n.organizationId&&n.amount)return n}catch{}let i=Date.now()+2;while(Date.now()<i);}return null},vDA=({organizationId:A,amount:t,explicitIdempotencyKey:g})=>{EpA();let i=ODA(A);for(let n=0;n<100;n+=1){let Q={idempotencyKey:g??CpA(),organizationId:A,amount:t,createdAt:new Date().toISOString()};try{return MN.writeFileSync(i,JSON.stringify(Q,null,2),{encoding:"utf-8",mode:384,flag:"wx"}),{kind:"reserved",entry:Q}}catch(e){if(e.code!=="EEXIST")throw e}let o=ypA(i);if(!o)continue;if(o.amount!==t)return{kind:"conflict",existing:o,reason:`A pending purchase for ${o.amount} is unresolved. Resolve it before purchasing a different amount.`};if(g&&g!==o.idempotencyKey)return{kind:"conflict",existing:o,reason:"A pending purchase with a different idempotency key is unresolved. Resolve it first."};return{kind:"resumed",entry:o}}throw Error("Could not reserve a pending purchase after repeated attempts.")},YO=(A)=>{try{MN.unlinkSync(ODA(A))}catch(t){if(t.code!=="ENOENT")throw t}};import{createInterface as jDA}from"node:readline";nA();import{createInterface as DpA}from"node:readline";var apA="\x03",wpA="\x1B[A",rpA="\x1B[B",bpA="\x1B[2K",NpA=(A)=>A>0?`\x1B[${A}A`:"",ZDA=(A)=>{try{A.setRawMode?.(!1)}catch{}A.pause?.()},WDA=(A,t)=>{return ZDA(A),t.write(`
|
|
8712
8712
|
`),process.exit(130)},VDA=(A)=>{if(!A.isTTY||typeof A.setRawMode!=="function")return!1;try{A.setRawMode(!0)}catch{return!1}return A.setEncoding?.("utf8"),A.resume?.(),!0},upA=(A)=>{let{choice:t,active:g,checked:i}=A,n=i===void 0?"":i?d.success("[x] "):"[ ] ",Q=t.hint?` ${d.muted(`(${t.hint})`)}`:"",o=g?d.info(t.label):t.label;return`${g?d.info("> "):" "}${n}${o}${Q}`},XDA=(A)=>{let{message:t,choices:g,input:i,output:n,multi:Q}=A,o=Math.max(0,g.findIndex((h)=>h.preselected)),e=new Set(Q?g.flatMap((h,C)=>h.preselected?[C]:[]):[]),B=(h)=>{if(h)n.write(NpA(g.length));else n.write(`${d.bold(t)}
|