@stackone/cli 1.15.0 → 1.15.2

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.
@@ -42,9 +42,9 @@ Verify:`),t.cyan(`claude mcp list`)),x.log(``)}catch(e){l.fail(`Installation to
42
42
  path: iss.path ? [${mr(e)}, ...iss.path] : [${mr(e)}]
43
43
  })));`),t.write(`newResult[${mr(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=gr,o=!Zn.jitless,s=o&&_r.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?co(e,u,t,f):so(e,u,t))):i?co(r,u,t,f):so(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],ee=l.keySet,h=c._zod,te=h.def.type;for(let e of Object.keys(f)){if(ee.has(e))continue;if(te===`never`){m.push(e);continue}let t=h.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>so(t,u,e))):so(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function uo(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>U(e,r,I())))}),t}const fo=F(`$ZodUnion`,(e,t)=>{G.init(e,t),R(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),R(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),R(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),R(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>cr(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>uo(t,n,e,r)):uo(a,n,e,r)}}),po=F(`$ZodDiscriminatedUnion`,(e,t)=>{fo.init(e,t);let n=e._zod.parse;R(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=or(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!gr(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,input:o,path:[t.discriminator],inst:e}),i)}}),mo=F(`$ZodIntersection`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>go(e,t,n)):go(e,i,a)}});function ho(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(vr(e)&&vr(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ho(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ho(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function go(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Pr(e))return e;let r=ho(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const _o=F(`$ZodTuple`,(e,t)=>{G.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({input:o,inst:e,origin:`array`,...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length}}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>vo(e,i,c))):vo(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>vo(e,i,c))):vo(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function vo(e,t,n){e.issues.length&&t.issues.push(...H(n,e.issues)),t.value[n]=e.value}const yo=F(`$ZodRecord`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!vr(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...H(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...H(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>U(e,r,I())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...H(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...H(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),bo=F(`$ZodMap`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{xo(t,a,n,o,i,e,r)})):xo(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function xo(e,t,n,r,i,a,o){e.issues.length&&(xr.has(typeof r)?n.issues.push(...H(r,e.issues)):n.issues.push({origin:`map`,code:`invalid_key`,input:i,inst:a,issues:e.issues.map(e=>U(e,o,I()))})),t.issues.length&&(xr.has(typeof r)?n.issues.push(...H(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>U(e,o,I()))})),n.value.set(e.value,t.value)}const So=F(`$ZodSet`,(e,t)=>{G.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>Co(e,n))):Co(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function Co(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const wo=F(`$ZodEnum`,(e,t)=>{G.init(e,t);let n=ir(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>xr.has(typeof e)).map(e=>typeof e==`string`?Cr(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),To=F(`$ZodLiteral`,(e,t)=>{G.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Cr(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Eo=F(`$ZodFile`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Do=F(`$ZodTransform`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new Xn;return e.value=r,e}}),Oo=F(`$ZodOptional`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,R(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),R(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${cr(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),ko=F(`$ZodNullable`,(e,t)=>{G.init(e,t),R(e._zod,`optin`,()=>t.innerType._zod.optin),R(e._zod,`optout`,()=>t.innerType._zod.optout),R(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${cr(e.source)}|null)$`):void 0}),R(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ao=F(`$ZodDefault`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,R(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>jo(e,t)):jo(r,t)}});function jo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Mo=F(`$ZodPrefault`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,R(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),No=F(`$ZodNonOptional`,(e,t)=>{G.init(e,t),R(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Po(t,e)):Po(i,e)}});function Po(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Fo=F(`$ZodSuccess`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Io=F(`$ZodCatch`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,R(e._zod,`optout`,()=>t.innerType._zod.optout),R(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>U(e,n,I()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>U(e,n,I()))},input:e.value}),e.issues=[]),e)}}),Lo=F(`$ZodNaN`,(e,t)=>{G.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Ro=F(`$ZodPipe`,(e,t)=>{G.init(e,t),R(e._zod,`values`,()=>t.in._zod.values),R(e._zod,`optin`,()=>t.in._zod.optin),R(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>zo(e,t,n)):zo(r,t,n)}});function zo(e,t,n){return Pr(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Bo=F(`$ZodReadonly`,(e,t)=>{G.init(e,t),R(e._zod,`propValues`,()=>t.innerType._zod.propValues),R(e._zod,`values`,()=>t.innerType._zod.values),R(e._zod,`optin`,()=>t.innerType._zod.optin),R(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Vo):Vo(r)}});function Vo(e){return e.value=Object.freeze(e.value),e}const Ho=F(`$ZodTemplateLiteral`,(e,t)=>{G.init(e,t);let n=[];for(let e of t.parts)if(e instanceof G){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=t.startsWith(`^`)?1:0,i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Sr.has(typeof e))n.push(Cr(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(t,n)=>typeof t.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(t.value)||t.issues.push({input:t.value,inst:e,code:`invalid_format`,format:`template_literal`,pattern:e._zod.pattern.source}),t):(t.issues.push({input:t.value,inst:e,expected:`template_literal`,code:`invalid_type`}),t)}),Uo=F(`$ZodPromise`,(e,t)=>{G.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Wo=F(`$ZodLazy`,(e,t)=>{G.init(e,t),R(e._zod,`innerType`,()=>t.getter()),R(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),R(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),R(e._zod,`optin`,()=>e._zod.innerType._zod.optin),R(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Go=F(`$ZodCustom`,(e,t)=>{W.init(e,t),G.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ko(t,n,r,e));Ko(i,n,r,e)}});function Ko(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Rr(e))}}const qo=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${V(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${L(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Jo(){return{localeError:qo()}}const Yo=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${V(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Xo(){return{localeError:Yo()}}function Zo(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Qo=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${V(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Zo(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Zo(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function $o(){return{localeError:Qo()}}const es=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${V(e.values[0])}`:`Opció invàlida: s'esperava una de ${L(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function ts(){return{localeError:es()}}const ns=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;case`boolean`:return`boolean`;case`bigint`:return`bigint`;case`function`:return`funkce`;case`symbol`:return`symbol`;case`undefined`:return`undefined`;case`object`:if(Array.isArray(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${V(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${L(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function rs(){return{localeError:ns()}}const is=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;case`object`:if(Array.isArray(e))return`Array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${V(e.values[0])}`:`Ungültige Option: erwartet eine von ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function as(){return{localeError:is()}}const os=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},ss=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,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`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${os(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${V(e.values[0])}`:`Invalid option: expected one of ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function cs(){return{localeError:ss()}}const ls=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombro`;case`object`:if(Array.isArray(e))return`tabelo`;if(e===null)return`senvalora`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},us=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={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`};return e=>{switch(e.code){case`invalid_type`:return`Nevalida enigo: atendiĝis ${e.expected}, riceviĝis ${ls(e.input)}`;case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${V(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function ds(){return{localeError:us()}}const fs=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`arreglo`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${e.expected}, recibido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${V(e.values[0])}`:`Opción inválida: se esperaba una de ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Demasiado grande: se esperaba que ${e.origin??`valor`} tuviera ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Demasiado grande: se esperaba que ${e.origin??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Demasiado pequeño: se esperaba que ${e.origin} tuviera ${n}${e.minimum.toString()} ${r.unit}`:`Demasiado pequeño: se esperaba que ${e.origin} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${e.origin}`;default:return`Entrada inválida`}}};function ps(){return{localeError:fs()}}const ms=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: می‌بایست ${e.expected} می‌بود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${V(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${L(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${L(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function hs(){return{localeError:ms()}}const gs=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${V(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${L(e.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`}}};function _s(){return{localeError:gs()}}const vs=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${V(e.values[0])} attendu`:`Option invalide : une valeur parmi ${L(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${L(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function ys(){return{localeError:vs()}}const bs=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${V(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${L(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function xs(){return{localeError:bs()}}const Ss=()=>{let e={string:{unit:`אותיות`,verb:`לכלול`},file:{unit:`בייטים`,verb:`לכלול`},array:{unit:`פריטים`,verb:`לכלול`},set:{unit:`פריטים`,verb:`לכלול`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`מחרוזת בבסיס 64`,base64url:`מחרוזת בבסיס 64 לכתובות רשת`,json_string:`מחרוזת JSON`,e164:`מספר E.164`,jwt:`JWT`,template_literal:`קלט`};return e=>{switch(e.code){case`invalid_type`:return`קלט לא תקין: צריך ${e.expected}, התקבל ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`קלט לא תקין: צריך ${V(e.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()} ${r.unit}`:`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`מחרוזת לא תקינה: חייבת להתחיל ב"${t.prefix}"`:t.format===`ends_with`?`מחרוזת לא תקינה: חייבת להסתיים ב "${t.suffix}"`:t.format===`includes`?`מחרוזת לא תקינה: חייבת לכלול "${t.includes}"`:t.format===`regex`?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${t.pattern}`:`${r[t.format]??e.format} לא תקין`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${e.divisor}`;case`unrecognized_keys`:return`מפתח${e.keys.length>1?`ות`:``} לא מזוה${e.keys.length>1?`ים`:`ה`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`מפתח לא תקין ב${e.origin}`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${e.origin}`;default:return`קלט לא תקין`}}};function Cs(){return{localeError:Ss()}}const ws=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${V(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function Ts(){return{localeError:ws()}}const Es=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${V(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function Ds(){return{localeError:Es()}}const Os=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${V(e.values[0])}`:`Opzione non valida: atteso uno tra ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function ks(){return{localeError:Os()}}const As=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${V(e.values[0])}が期待されました`:`無効な選択: ${L(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${L(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function js(){return{localeError:As()}}const Ms=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;case`object`:if(Array.isArray(e))return`អារេ (Array)`;if(e===null)return`គ្មានតម្លៃ (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${V(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${L(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function Ns(){return{localeError:Ms()}}const Ps=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${V(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${L(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${L(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function Fs(){return{localeError:Ps()}}const Is=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${V(e.values[0])}`:`Грешана опција: се очекува една ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function Ls(){return{localeError:Is()}}const Rs=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${V(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${L(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function zs(){return{localeError:Rs()}}const Bs=()=>{let e={string:{unit:`tekens`},file:{unit:`bytes`},array:{unit:`elementen`},set:{unit:`elementen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${V(e.values[0])}`:`Ongeldige optie: verwacht één van ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} bevat`:`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Vs(){return{localeError:Bs()}}const Hs=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${V(e.values[0])}`:`Ugyldig valg: forventet en av ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function Us(){return{localeError:Hs()}}const Ws=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${V(e.values[0])}`:`Fâsit tercih: mûteberler ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Gs(){return{localeError:Ws()}}const Ks=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${V(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${L(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function qs(){return{localeError:Ks()}}const Js=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${V(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Ys(){return{localeError:Js()}}const Xs=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${V(e.values[0])}`:`Opção inválida: esperada uma das ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function Zs(){return{localeError:Xs()}}function Qs(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const $s=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${V(e.values[0])}`:`Неверный вариант: ожидалось одно из ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Qs(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Qs(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function ec(){return{localeError:$s()}}const tc=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${V(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function nc(){return{localeError:tc()}}const rc=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${V(e.values[0])}`:`Ogiltigt val: förväntade en av ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function ic(){return{localeError:rc()}}const ac=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${V(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${L(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function oc(){return{localeError:ac()}}const sc=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;case`object`:if(Array.isArray(e))return`อาร์เรย์ (Array)`;if(e===null)return`ไม่มีค่า (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${V(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${L(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function cc(){return{localeError:sc()}}const lc=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},uc=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={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`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${lc(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${V(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function dc(){return{localeError:uc()}}const fc=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${V(e.values[0])}`:`Неправильна опція: очікується одне з ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${L(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function pc(){return{localeError:fc()}}const mc=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${V(e.values[0])} متوقع تھا`:`غلط آپشن: ${L(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${L(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function hc(){return{localeError:mc()}}const gc=()=>{let e={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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${V(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.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 ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${L(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.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 ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function _c(){return{localeError:gc()}}const vc=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${V(e.values[0])}`:`无效选项:期望以下之一 ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${L(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function yc(){return{localeError:vc()}}const bc=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${V(e.values[0])}`:`無效的選項:預期為以下其中之一 ${L(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${L(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function xc(){return{localeError:bc()}}var Sc={};zn(Sc,{ar:()=>Jo,az:()=>Xo,be:()=>$o,ca:()=>ts,cs:()=>rs,de:()=>as,en:()=>cs,eo:()=>ds,es:()=>ps,fa:()=>hs,fi:()=>_s,fr:()=>ys,frCA:()=>xs,he:()=>Cs,hu:()=>Ts,id:()=>Ds,it:()=>ks,ja:()=>js,kh:()=>Ns,ko:()=>Fs,mk:()=>Ls,ms:()=>zs,nl:()=>Vs,no:()=>Us,ota:()=>Gs,pl:()=>Ys,ps:()=>qs,pt:()=>Zs,ru:()=>ec,sl:()=>nc,sv:()=>ic,ta:()=>oc,th:()=>cc,tr:()=>dc,ua:()=>pc,ur:()=>hc,vi:()=>_c,zhCN:()=>yc,zhTW:()=>xc});const Cc=Symbol(`ZodOutput`),wc=Symbol(`ZodInput`);var Tc=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Ec(){return new Tc}const Dc=Ec();function Oc(e,t){return new e({type:`string`,...B(t)})}function kc(e,t){return new e({type:`string`,coerce:!0,...B(t)})}function Ac(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...B(t)})}function jc(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...B(t)})}function Mc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...B(t)})}function Nc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...B(t)})}function Pc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...B(t)})}function Fc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...B(t)})}function Ic(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...B(t)})}function Lc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...B(t)})}function Rc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...B(t)})}function zc(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...B(t)})}function Bc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...B(t)})}function Vc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...B(t)})}function Hc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...B(t)})}function Uc(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...B(t)})}function Wc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...B(t)})}function Gc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...B(t)})}function Kc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...B(t)})}function qc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...B(t)})}function Jc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...B(t)})}function Yc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...B(t)})}function Xc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...B(t)})}function Zc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...B(t)})}const Qc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function $c(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...B(t)})}function el(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...B(t)})}function tl(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...B(t)})}function nl(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...B(t)})}function rl(e,t){return new e({type:`number`,checks:[],...B(t)})}function il(e,t){return new e({type:`number`,coerce:!0,checks:[],...B(t)})}function al(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...B(t)})}function ol(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...B(t)})}function sl(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...B(t)})}function cl(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...B(t)})}function ll(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...B(t)})}function ul(e,t){return new e({type:`boolean`,...B(t)})}function dl(e,t){return new e({type:`boolean`,coerce:!0,...B(t)})}function fl(e,t){return new e({type:`bigint`,...B(t)})}function pl(e,t){return new e({type:`bigint`,coerce:!0,...B(t)})}function ml(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...B(t)})}function hl(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...B(t)})}function gl(e,t){return new e({type:`symbol`,...B(t)})}function _l(e,t){return new e({type:`undefined`,...B(t)})}function vl(e,t){return new e({type:`null`,...B(t)})}function yl(e){return new e({type:`any`})}function bl(e){return new e({type:`unknown`})}function xl(e,t){return new e({type:`never`,...B(t)})}function Sl(e,t){return new e({type:`void`,...B(t)})}function Cl(e,t){return new e({type:`date`,...B(t)})}function wl(e,t){return new e({type:`date`,coerce:!0,...B(t)})}function Tl(e,t){return new e({type:`nan`,...B(t)})}function El(e,t){return new Ji({check:`less_than`,...B(t),value:e,inclusive:!1})}function q(e,t){return new Ji({check:`less_than`,...B(t),value:e,inclusive:!0})}function Dl(e,t){return new Yi({check:`greater_than`,...B(t),value:e,inclusive:!1})}function J(e,t){return new Yi({check:`greater_than`,...B(t),value:e,inclusive:!0})}function Ol(e){return Dl(0,e)}function kl(e){return El(0,e)}function Al(e){return q(0,e)}function jl(e){return J(0,e)}function Ml(e,t){return new Xi({check:`multiple_of`,...B(t),value:e})}function Nl(e,t){return new $i({check:`max_size`,...B(t),maximum:e})}function Pl(e,t){return new ea({check:`min_size`,...B(t),minimum:e})}function Fl(e,t){return new ta({check:`size_equals`,...B(t),size:e})}function Il(e,t){return new na({check:`max_length`,...B(t),maximum:e})}function Ll(e,t){return new ra({check:`min_length`,...B(t),minimum:e})}function Rl(e,t){return new ia({check:`length_equals`,...B(t),length:e})}function zl(e,t){return new oa({check:`string_format`,format:`regex`,...B(t),pattern:e})}function Bl(e){return new sa({check:`string_format`,format:`lowercase`,...B(e)})}function Vl(e){return new ca({check:`string_format`,format:`uppercase`,...B(e)})}function Hl(e,t){return new la({check:`string_format`,format:`includes`,...B(t),includes:e})}function Ul(e,t){return new ua({check:`string_format`,format:`starts_with`,...B(t),prefix:e})}function Wl(e,t){return new da({check:`string_format`,format:`ends_with`,...B(t),suffix:e})}function Gl(e,t,n){return new pa({check:`property`,property:e,schema:t,...B(n)})}function Kl(e,t){return new ma({check:`mime_type`,mime:e,...B(t)})}function ql(e){return new ha({check:`overwrite`,tx:e})}function Jl(e){return ql(t=>t.normalize(e))}function Yl(){return ql(e=>e.trim())}function Xl(){return ql(e=>e.toLowerCase())}function Zl(){return ql(e=>e.toUpperCase())}function Ql(e,t,n){return new e({type:`array`,element:t,...B(n)})}function $l(e,t,n){return new e({type:`union`,options:t,...B(n)})}function eu(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...B(r)})}function tu(e,t,n){return new e({type:`intersection`,left:t,right:n})}function nu(e,t,n,r){let i=n instanceof G;return new e({type:`tuple`,items:t,rest:i?n:null,...B(i?r:n)})}function ru(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...B(r)})}function iu(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...B(r)})}function au(e,t,n){return new e({type:`set`,valueType:t,...B(n)})}function ou(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...B(n)})}function su(e,t,n){return new e({type:`enum`,entries:t,...B(n)})}function cu(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...B(n)})}function lu(e,t){return new e({type:`file`,...B(t)})}function uu(e,t){return new e({type:`transform`,transform:t})}function du(e,t){return new e({type:`optional`,innerType:t})}function fu(e,t){return new e({type:`nullable`,innerType:t})}function pu(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():n}})}function mu(e,t,n){return new e({type:`nonoptional`,innerType:t,...B(n)})}function hu(e,t){return new e({type:`success`,innerType:t})}function gu(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function _u(e,t,n){return new e({type:`pipe`,in:t,out:n})}function vu(e,t){return new e({type:`readonly`,innerType:t})}function yu(e,t,n){return new e({type:`template_literal`,parts:t,...B(n)})}function bu(e,t){return new e({type:`lazy`,getter:t})}function xu(e,t){return new e({type:`promise`,innerType:t})}function Su(e,t,n){let r=B(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Cu(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...B(n)})}function wu(e,t){let n=B(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Pipe??Ro,c=e.Boolean??Ja,l=e.String??va,u=new(e.Transform??Do)({type:`transform`,transform:(e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:u}),{})},error:n.error});return new s({type:`pipe`,in:new s({type:`pipe`,in:new l({type:`string`,error:n.error}),out:u,error:n.error}),out:new c({type:`boolean`,error:n.error}),error:n.error})}function Tu(e,t,n,r={}){let i=B(r),a={...B(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var Eu=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=((...n)=>{let r=this._def.input?Xr(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=e(...r);return this._def.output?Xr(this._def.output,i,void 0,{callee:t}):i});return t}implementAsync(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=(async(...n)=>{let r=this._def.input?await Qr(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=await e(...r);return this._def.output?Qr(this._def.output,i,void 0,{callee:t}):i});return t}input(...e){let t=this.constructor;return Array.isArray(e[0])?new t({type:`function`,input:new _o({type:`tuple`,items:e[0],rest:e[1]}),output:this._def.output}):new t({type:`function`,input:e[0],output:this._def.output})}output(e){let t=this.constructor;return new t({type:`function`,input:this._def.input,output:e})}};function Du(e){return new Eu({type:`function`,input:Array.isArray(e?.input)?nu(_o,e?.input):e?.input??Ql(oo,bl(to)),output:e?.output??bl(to)})}var Ou=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Dc,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;typeof a==`string`&&a.includes(`int`)?n.type=`integer`:n.type=`number`,typeof c==`number`&&(n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?i.prefixItems=a:i.items=a,r.rest){let e=this.process(r.rest,{...n,path:[...n.path,`items`]});this.target===`draft-2020-12`?i.items=e:i.additionalItems=e}r.rest&&(i.items=this.process(r.rest,{...n,path:[...n.path,`items`]}));let{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s);break}case`record`:{let e=t;e.type=`object`,e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]}),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=ir(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0)if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n;break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:t.anyOf=[this.process(r.innerType,n),{type:`null`}];break;case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&Y(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root>
44
44
 
45
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function ku(e,t){if(e instanceof Tc){let n=new Ou(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new Ou(t);return n.process(e),n.emit(e,t)}function Y(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return Y(r.element,n);case`object`:for(let e in r.shape)if(Y(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(Y(e,n))return!0;return!1;case`intersection`:return Y(r.left,n)||Y(r.right,n);case`tuple`:for(let e of r.items)if(Y(e,n))return!0;return!!(r.rest&&Y(r.rest,n));case`record`:return Y(r.keyType,n)||Y(r.valueType,n);case`map`:return Y(r.keyType,n)||Y(r.valueType,n);case`set`:return Y(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return Y(r.innerType,n);case`lazy`:return Y(r.getter(),n);case`default`:return Y(r.innerType,n);case`prefault`:return Y(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return Y(r.in,n)||Y(r.out,n);case`success`:return!1;case`catch`:return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var Au={},ju={};zn(ju,{$ZodAny:()=>eo,$ZodArray:()=>oo,$ZodAsyncError:()=>Xn,$ZodBase64:()=>za,$ZodBase64URL:()=>Va,$ZodBigInt:()=>Ya,$ZodBigIntFormat:()=>Xa,$ZodBoolean:()=>Ja,$ZodCIDRv4:()=>Ia,$ZodCIDRv6:()=>La,$ZodCUID:()=>Ta,$ZodCUID2:()=>Ea,$ZodCatch:()=>Io,$ZodCheck:()=>W,$ZodCheckBigIntFormat:()=>Qi,$ZodCheckEndsWith:()=>da,$ZodCheckGreaterThan:()=>Yi,$ZodCheckIncludes:()=>la,$ZodCheckLengthEquals:()=>ia,$ZodCheckLessThan:()=>Ji,$ZodCheckLowerCase:()=>sa,$ZodCheckMaxLength:()=>na,$ZodCheckMaxSize:()=>$i,$ZodCheckMimeType:()=>ma,$ZodCheckMinLength:()=>ra,$ZodCheckMinSize:()=>ea,$ZodCheckMultipleOf:()=>Xi,$ZodCheckNumberFormat:()=>Zi,$ZodCheckOverwrite:()=>ha,$ZodCheckProperty:()=>pa,$ZodCheckRegex:()=>oa,$ZodCheckSizeEquals:()=>ta,$ZodCheckStartsWith:()=>ua,$ZodCheckStringFormat:()=>aa,$ZodCheckUpperCase:()=>ca,$ZodCustom:()=>Go,$ZodCustomStringFormat:()=>Ga,$ZodDate:()=>io,$ZodDefault:()=>Ao,$ZodDiscriminatedUnion:()=>po,$ZodE164:()=>Ha,$ZodEmail:()=>xa,$ZodEmoji:()=>Ca,$ZodEnum:()=>wo,$ZodError:()=>Hr,$ZodFile:()=>Eo,$ZodFunction:()=>Eu,$ZodGUID:()=>ya,$ZodIPv4:()=>Pa,$ZodIPv6:()=>Fa,$ZodISODate:()=>ja,$ZodISODateTime:()=>Aa,$ZodISODuration:()=>Na,$ZodISOTime:()=>Ma,$ZodIntersection:()=>mo,$ZodJWT:()=>Wa,$ZodKSUID:()=>ka,$ZodLazy:()=>Wo,$ZodLiteral:()=>To,$ZodMap:()=>bo,$ZodNaN:()=>Lo,$ZodNanoID:()=>wa,$ZodNever:()=>no,$ZodNonOptional:()=>No,$ZodNull:()=>$a,$ZodNullable:()=>ko,$ZodNumber:()=>Ka,$ZodNumberFormat:()=>qa,$ZodObject:()=>lo,$ZodOptional:()=>Oo,$ZodPipe:()=>Ro,$ZodPrefault:()=>Mo,$ZodPromise:()=>Uo,$ZodReadonly:()=>Bo,$ZodRealError:()=>Ur,$ZodRecord:()=>yo,$ZodRegistry:()=>Tc,$ZodSet:()=>So,$ZodString:()=>va,$ZodStringFormat:()=>K,$ZodSuccess:()=>Fo,$ZodSymbol:()=>Za,$ZodTemplateLiteral:()=>Ho,$ZodTransform:()=>Do,$ZodTuple:()=>_o,$ZodType:()=>G,$ZodULID:()=>Da,$ZodURL:()=>Sa,$ZodUUID:()=>ba,$ZodUndefined:()=>Qa,$ZodUnion:()=>fo,$ZodUnknown:()=>to,$ZodVoid:()=>ro,$ZodXID:()=>Oa,$brand:()=>Yn,$constructor:()=>F,$input:()=>wc,$output:()=>Cc,Doc:()=>ga,JSONSchema:()=>Au,JSONSchemaGenerator:()=>Ou,NEVER:()=>Jn,TimePrecision:()=>Qc,_any:()=>yl,_array:()=>Ql,_base64:()=>Jc,_base64url:()=>Yc,_bigint:()=>fl,_boolean:()=>ul,_catch:()=>gu,_cidrv4:()=>Kc,_cidrv6:()=>qc,_coercedBigint:()=>pl,_coercedBoolean:()=>dl,_coercedDate:()=>wl,_coercedNumber:()=>il,_coercedString:()=>kc,_cuid:()=>zc,_cuid2:()=>Bc,_custom:()=>Su,_date:()=>Cl,_default:()=>pu,_discriminatedUnion:()=>eu,_e164:()=>Xc,_email:()=>Ac,_emoji:()=>Lc,_endsWith:()=>Wl,_enum:()=>ou,_file:()=>lu,_float32:()=>ol,_float64:()=>sl,_gt:()=>Dl,_gte:()=>J,_guid:()=>jc,_includes:()=>Hl,_int:()=>al,_int32:()=>cl,_int64:()=>ml,_intersection:()=>tu,_ipv4:()=>Wc,_ipv6:()=>Gc,_isoDate:()=>el,_isoDateTime:()=>$c,_isoDuration:()=>nl,_isoTime:()=>tl,_jwt:()=>Zc,_ksuid:()=>Uc,_lazy:()=>bu,_length:()=>Rl,_literal:()=>cu,_lowercase:()=>Bl,_lt:()=>El,_lte:()=>q,_map:()=>iu,_max:()=>q,_maxLength:()=>Il,_maxSize:()=>Nl,_mime:()=>Kl,_min:()=>J,_minLength:()=>Ll,_minSize:()=>Pl,_multipleOf:()=>Ml,_nan:()=>Tl,_nanoid:()=>Rc,_nativeEnum:()=>su,_negative:()=>kl,_never:()=>xl,_nonnegative:()=>jl,_nonoptional:()=>mu,_nonpositive:()=>Al,_normalize:()=>Jl,_null:()=>vl,_nullable:()=>fu,_number:()=>rl,_optional:()=>du,_overwrite:()=>ql,_parse:()=>Yr,_parseAsync:()=>Zr,_pipe:()=>_u,_positive:()=>Ol,_promise:()=>xu,_property:()=>Gl,_readonly:()=>vu,_record:()=>ru,_refine:()=>Cu,_regex:()=>zl,_safeParse:()=>$r,_safeParseAsync:()=>ti,_set:()=>au,_size:()=>Fl,_startsWith:()=>Ul,_string:()=>Oc,_stringFormat:()=>Tu,_stringbool:()=>wu,_success:()=>hu,_symbol:()=>gl,_templateLiteral:()=>yu,_toLowerCase:()=>Xl,_toUpperCase:()=>Zl,_transform:()=>uu,_trim:()=>Yl,_tuple:()=>nu,_uint32:()=>ll,_uint64:()=>hl,_ulid:()=>Vc,_undefined:()=>_l,_union:()=>$l,_unknown:()=>bl,_uppercase:()=>Vl,_url:()=>Ic,_uuid:()=>Mc,_uuidv4:()=>Nc,_uuidv6:()=>Pc,_uuidv7:()=>Fc,_void:()=>Sl,_xid:()=>Hc,clone:()=>z,config:()=>I,flattenError:()=>Wr,formatError:()=>Gr,function:()=>Du,globalConfig:()=>Zn,globalRegistry:()=>Dc,isValidBase64:()=>Ra,isValidBase64URL:()=>Ba,isValidJWT:()=>Ua,locales:()=>Sc,parse:()=>Xr,parseAsync:()=>Qr,prettifyError:()=>Jr,regexes:()=>ri,registry:()=>Ec,safeParse:()=>ei,safeParseAsync:()=>ni,toDotPath:()=>qr,toJSONSchema:()=>ku,treeifyError:()=>Kr,util:()=>Qn,version:()=>_a});var Mu={};zn(Mu,{ZodISODate:()=>Fu,ZodISODateTime:()=>Nu,ZodISODuration:()=>zu,ZodISOTime:()=>Lu,date:()=>Iu,datetime:()=>Pu,duration:()=>Bu,time:()=>Ru});const Nu=F(`ZodISODateTime`,(e,t)=>{Aa.init(e,t),Z.init(e,t)});function Pu(e){return $c(Nu,e)}const Fu=F(`ZodISODate`,(e,t)=>{ja.init(e,t),Z.init(e,t)});function Iu(e){return el(Fu,e)}const Lu=F(`ZodISOTime`,(e,t)=>{Ma.init(e,t),Z.init(e,t)});function Ru(e){return tl(Lu,e)}const zu=F(`ZodISODuration`,(e,t)=>{Na.init(e,t),Z.init(e,t)});function Bu(e){return nl(zu,e)}const Vu=(e,t)=>{Hr.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Gr(e,t)},flatten:{value:t=>Wr(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})},Hu=F(`ZodError`,Vu),Uu=F(`ZodError`,Vu,{Parent:Error}),Wu=Yr(Uu),Gu=Zr(Uu),Ku=$r(Uu),qu=ti(Uu),X=F(`ZodType`,(e,t)=>(G.init(e,t),e.def=t,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>z(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Wu(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ku(e,t,n),e.parseAsync=async(t,n)=>Gu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qu(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(Tp(t,n)),e.superRefine=t=>e.check(Ep(t)),e.overwrite=t=>e.check(ql(t)),e.optional=()=>Xf(e),e.nullable=()=>Qf(e),e.nullish=()=>Xf(Qf(e)),e.nonoptional=t=>ap(e,t),e.array=()=>yf(e),e.or=t=>Ef([e,t]),e.and=t=>Af(e,t),e.transform=t=>pp(e,Jf(t)),e.default=t=>tp(e,t),e.prefault=t=>rp(e,t),e.catch=t=>lp(e,t),e.pipe=t=>pp(e,t),e.readonly=()=>hp(e),e.describe=t=>{let n=e.clone();return Dc.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Dc.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Dc.get(e);let n=e.clone();return Dc.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ju=F(`_ZodString`,(e,t)=>{va.init(e,t),X.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(zl(...t)),e.includes=(...t)=>e.check(Hl(...t)),e.startsWith=(...t)=>e.check(Ul(...t)),e.endsWith=(...t)=>e.check(Wl(...t)),e.min=(...t)=>e.check(Ll(...t)),e.max=(...t)=>e.check(Il(...t)),e.length=(...t)=>e.check(Rl(...t)),e.nonempty=(...t)=>e.check(Ll(1,...t)),e.lowercase=t=>e.check(Bl(t)),e.uppercase=t=>e.check(Vl(t)),e.trim=()=>e.check(Yl()),e.normalize=(...t)=>e.check(Jl(...t)),e.toLowerCase=()=>e.check(Xl()),e.toUpperCase=()=>e.check(Zl())}),Yu=F(`ZodString`,(e,t)=>{va.init(e,t),Ju.init(e,t),e.email=t=>e.check(Ac(Zu,t)),e.url=t=>e.check(Ic(od,t)),e.jwt=t=>e.check(Zc(Id,t)),e.emoji=t=>e.check(Lc(cd,t)),e.guid=t=>e.check(jc($u,t)),e.uuid=t=>e.check(Mc(td,t)),e.uuidv4=t=>e.check(Nc(td,t)),e.uuidv6=t=>e.check(Pc(td,t)),e.uuidv7=t=>e.check(Fc(td,t)),e.nanoid=t=>e.check(Rc(ud,t)),e.guid=t=>e.check(jc($u,t)),e.cuid=t=>e.check(zc(fd,t)),e.cuid2=t=>e.check(Bc(md,t)),e.ulid=t=>e.check(Vc(gd,t)),e.base64=t=>e.check(Jc(Ad,t)),e.base64url=t=>e.check(Yc(Md,t)),e.xid=t=>e.check(Hc(vd,t)),e.ksuid=t=>e.check(Uc(bd,t)),e.ipv4=t=>e.check(Wc(Sd,t)),e.ipv6=t=>e.check(Gc(wd,t)),e.cidrv4=t=>e.check(Kc(Ed,t)),e.cidrv6=t=>e.check(qc(Od,t)),e.e164=t=>e.check(Xc(Pd,t)),e.datetime=t=>e.check(Pu(t)),e.date=t=>e.check(Iu(t)),e.time=t=>e.check(Ru(t)),e.duration=t=>e.check(Bu(t))});function Xu(e){return Oc(Yu,e)}const Z=F(`ZodStringFormat`,(e,t)=>{K.init(e,t),Ju.init(e,t)}),Zu=F(`ZodEmail`,(e,t)=>{xa.init(e,t),Z.init(e,t)});function Qu(e){return Ac(Zu,e)}const $u=F(`ZodGUID`,(e,t)=>{ya.init(e,t),Z.init(e,t)});function ed(e){return jc($u,e)}const td=F(`ZodUUID`,(e,t)=>{ba.init(e,t),Z.init(e,t)});function nd(e){return Mc(td,e)}function rd(e){return Nc(td,e)}function id(e){return Pc(td,e)}function ad(e){return Fc(td,e)}const od=F(`ZodURL`,(e,t)=>{Sa.init(e,t),Z.init(e,t)});function sd(e){return Ic(od,e)}const cd=F(`ZodEmoji`,(e,t)=>{Ca.init(e,t),Z.init(e,t)});function ld(e){return Lc(cd,e)}const ud=F(`ZodNanoID`,(e,t)=>{wa.init(e,t),Z.init(e,t)});function dd(e){return Rc(ud,e)}const fd=F(`ZodCUID`,(e,t)=>{Ta.init(e,t),Z.init(e,t)});function pd(e){return zc(fd,e)}const md=F(`ZodCUID2`,(e,t)=>{Ea.init(e,t),Z.init(e,t)});function hd(e){return Bc(md,e)}const gd=F(`ZodULID`,(e,t)=>{Da.init(e,t),Z.init(e,t)});function _d(e){return Vc(gd,e)}const vd=F(`ZodXID`,(e,t)=>{Oa.init(e,t),Z.init(e,t)});function yd(e){return Hc(vd,e)}const bd=F(`ZodKSUID`,(e,t)=>{ka.init(e,t),Z.init(e,t)});function xd(e){return Uc(bd,e)}const Sd=F(`ZodIPv4`,(e,t)=>{Pa.init(e,t),Z.init(e,t)});function Cd(e){return Wc(Sd,e)}const wd=F(`ZodIPv6`,(e,t)=>{Fa.init(e,t),Z.init(e,t)});function Td(e){return Gc(wd,e)}const Ed=F(`ZodCIDRv4`,(e,t)=>{Ia.init(e,t),Z.init(e,t)});function Dd(e){return Kc(Ed,e)}const Od=F(`ZodCIDRv6`,(e,t)=>{La.init(e,t),Z.init(e,t)});function kd(e){return qc(Od,e)}const Ad=F(`ZodBase64`,(e,t)=>{za.init(e,t),Z.init(e,t)});function jd(e){return Jc(Ad,e)}const Md=F(`ZodBase64URL`,(e,t)=>{Va.init(e,t),Z.init(e,t)});function Nd(e){return Yc(Md,e)}const Pd=F(`ZodE164`,(e,t)=>{Ha.init(e,t),Z.init(e,t)});function Fd(e){return Xc(Pd,e)}const Id=F(`ZodJWT`,(e,t)=>{Wa.init(e,t),Z.init(e,t)});function Ld(e){return Zc(Id,e)}const Rd=F(`ZodCustomStringFormat`,(e,t)=>{Ga.init(e,t),Z.init(e,t)});function zd(e,t,n={}){return Tu(Rd,e,t,n)}const Bd=F(`ZodNumber`,(e,t)=>{Ka.init(e,t),X.init(e,t),e.gt=(t,n)=>e.check(Dl(t,n)),e.gte=(t,n)=>e.check(J(t,n)),e.min=(t,n)=>e.check(J(t,n)),e.lt=(t,n)=>e.check(El(t,n)),e.lte=(t,n)=>e.check(q(t,n)),e.max=(t,n)=>e.check(q(t,n)),e.int=t=>e.check(Ud(t)),e.safe=t=>e.check(Ud(t)),e.positive=t=>e.check(Dl(0,t)),e.nonnegative=t=>e.check(J(0,t)),e.negative=t=>e.check(El(0,t)),e.nonpositive=t=>e.check(q(0,t)),e.multipleOf=(t,n)=>e.check(Ml(t,n)),e.step=(t,n)=>e.check(Ml(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Vd(e){return rl(Bd,e)}const Hd=F(`ZodNumberFormat`,(e,t)=>{qa.init(e,t),Bd.init(e,t)});function Ud(e){return al(Hd,e)}function Wd(e){return ol(Hd,e)}function Gd(e){return sl(Hd,e)}function Kd(e){return cl(Hd,e)}function qd(e){return ll(Hd,e)}const Jd=F(`ZodBoolean`,(e,t)=>{Ja.init(e,t),X.init(e,t)});function Yd(e){return ul(Jd,e)}const Xd=F(`ZodBigInt`,(e,t)=>{Ya.init(e,t),X.init(e,t),e.gte=(t,n)=>e.check(J(t,n)),e.min=(t,n)=>e.check(J(t,n)),e.gt=(t,n)=>e.check(Dl(t,n)),e.gte=(t,n)=>e.check(J(t,n)),e.min=(t,n)=>e.check(J(t,n)),e.lt=(t,n)=>e.check(El(t,n)),e.lte=(t,n)=>e.check(q(t,n)),e.max=(t,n)=>e.check(q(t,n)),e.positive=t=>e.check(Dl(BigInt(0),t)),e.negative=t=>e.check(El(BigInt(0),t)),e.nonpositive=t=>e.check(q(BigInt(0),t)),e.nonnegative=t=>e.check(J(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ml(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Zd(e){return fl(Xd,e)}const Qd=F(`ZodBigIntFormat`,(e,t)=>{Xa.init(e,t),Xd.init(e,t)});function $d(e){return ml(Qd,e)}function ef(e){return hl(Qd,e)}const tf=F(`ZodSymbol`,(e,t)=>{Za.init(e,t),X.init(e,t)});function nf(e){return gl(tf,e)}const rf=F(`ZodUndefined`,(e,t)=>{Qa.init(e,t),X.init(e,t)});function af(e){return _l(rf,e)}const of=F(`ZodNull`,(e,t)=>{$a.init(e,t),X.init(e,t)});function sf(e){return vl(of,e)}const cf=F(`ZodAny`,(e,t)=>{eo.init(e,t),X.init(e,t)});function lf(){return yl(cf)}const uf=F(`ZodUnknown`,(e,t)=>{to.init(e,t),X.init(e,t)});function df(){return bl(uf)}const ff=F(`ZodNever`,(e,t)=>{no.init(e,t),X.init(e,t)});function pf(e){return xl(ff,e)}const mf=F(`ZodVoid`,(e,t)=>{ro.init(e,t),X.init(e,t)});function hf(e){return Sl(mf,e)}const gf=F(`ZodDate`,(e,t)=>{io.init(e,t),X.init(e,t),e.min=(t,n)=>e.check(J(t,n)),e.max=(t,n)=>e.check(q(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function _f(e){return Cl(gf,e)}const vf=F(`ZodArray`,(e,t)=>{oo.init(e,t),X.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ll(t,n)),e.nonempty=t=>e.check(Ll(1,t)),e.max=(t,n)=>e.check(Il(t,n)),e.length=(t,n)=>e.check(Rl(t,n)),e.unwrap=()=>e.element});function yf(e,t){return Ql(vf,e,t)}function bf(e){let t=e._zod.def.shape;return Wf(Object.keys(t))}const xf=F(`ZodObject`,(e,t)=>{lo.init(e,t),X.init(e,t),R(e,`shape`,()=>t.shape),e.keyof=()=>Vf(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:df()}),e.loose=()=>e.clone({...e._zod.def,catchall:df()}),e.strict=()=>e.clone({...e._zod.def,catchall:pf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ar(e,t),e.merge=t=>jr(e,t),e.pick=t=>Or(e,t),e.omit=t=>kr(e,t),e.partial=(...t)=>Mr(Yf,e,t[0]),e.required=(...t)=>Nr(ip,e,t[0])});function Sf(e,t){return new xf({type:`object`,get shape(){return ur(this,`shape`,{...e}),this.shape},...B(t)})}function Cf(e,t){return new xf({type:`object`,get shape(){return ur(this,`shape`,{...e}),this.shape},catchall:pf(),...B(t)})}function wf(e,t){return new xf({type:`object`,get shape(){return ur(this,`shape`,{...e}),this.shape},catchall:df(),...B(t)})}const Tf=F(`ZodUnion`,(e,t)=>{fo.init(e,t),X.init(e,t),e.options=t.options});function Ef(e,t){return new Tf({type:`union`,options:e,...B(t)})}const Df=F(`ZodDiscriminatedUnion`,(e,t)=>{Tf.init(e,t),po.init(e,t)});function Of(e,t,n){return new Df({type:`union`,options:t,discriminator:e,...B(n)})}const kf=F(`ZodIntersection`,(e,t)=>{mo.init(e,t),X.init(e,t)});function Af(e,t){return new kf({type:`intersection`,left:e,right:t})}const jf=F(`ZodTuple`,(e,t)=>{_o.init(e,t),X.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Mf(e,t,n){let r=t instanceof G;return new jf({type:`tuple`,items:e,rest:r?t:null,...B(r?n:t)})}const Nf=F(`ZodRecord`,(e,t)=>{yo.init(e,t),X.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Pf(e,t,n){return new Nf({type:`record`,keyType:e,valueType:t,...B(n)})}function Ff(e,t,n){return new Nf({type:`record`,keyType:Ef([e,pf()]),valueType:t,...B(n)})}const If=F(`ZodMap`,(e,t)=>{bo.init(e,t),X.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Lf(e,t,n){return new If({type:`map`,keyType:e,valueType:t,...B(n)})}const Rf=F(`ZodSet`,(e,t)=>{So.init(e,t),X.init(e,t),e.min=(...t)=>e.check(Pl(...t)),e.nonempty=t=>e.check(Pl(1,t)),e.max=(...t)=>e.check(Nl(...t)),e.size=(...t)=>e.check(Fl(...t))});function zf(e,t){return new Rf({type:`set`,valueType:e,...B(t)})}const Bf=F(`ZodEnum`,(e,t)=>{wo.init(e,t),X.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Bf({...t,checks:[],...B(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Bf({...t,checks:[],...B(r),entries:i})}});function Vf(e,t){return new Bf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...B(t)})}function Hf(e,t){return new Bf({type:`enum`,entries:e,...B(t)})}const Uf=F(`ZodLiteral`,(e,t)=>{To.init(e,t),X.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Wf(e,t){return new Uf({type:`literal`,values:Array.isArray(e)?e:[e],...B(t)})}const Gf=F(`ZodFile`,(e,t)=>{Eo.init(e,t),X.init(e,t),e.min=(t,n)=>e.check(Pl(t,n)),e.max=(t,n)=>e.check(Nl(t,n)),e.mime=(t,n)=>e.check(Kl(Array.isArray(t)?t:[t],n))});function Kf(e){return lu(Gf,e)}const qf=F(`ZodTransform`,(e,t)=>{Do.init(e,t),X.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rr(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(Rr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Jf(e){return new qf({type:`transform`,transform:e})}const Yf=F(`ZodOptional`,(e,t)=>{Oo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xf(e){return new Yf({type:`optional`,innerType:e})}const Zf=F(`ZodNullable`,(e,t)=>{ko.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qf(e){return new Zf({type:`nullable`,innerType:e})}function $f(e){return Xf(Qf(e))}const ep=F(`ZodDefault`,(e,t)=>{Ao.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tp(e,t){return new ep({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const np=F(`ZodPrefault`,(e,t)=>{Mo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rp(e,t){return new np({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const ip=F(`ZodNonOptional`,(e,t)=>{No.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ap(e,t){return new ip({type:`nonoptional`,innerType:e,...B(t)})}const op=F(`ZodSuccess`,(e,t)=>{Fo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sp(e){return new op({type:`success`,innerType:e})}const cp=F(`ZodCatch`,(e,t)=>{Io.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lp(e,t){return new cp({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const up=F(`ZodNaN`,(e,t)=>{Lo.init(e,t),X.init(e,t)});function dp(e){return Tl(up,e)}const fp=F(`ZodPipe`,(e,t)=>{Ro.init(e,t),X.init(e,t),e.in=t.in,e.out=t.out});function pp(e,t){return new fp({type:`pipe`,in:e,out:t})}const mp=F(`ZodReadonly`,(e,t)=>{Bo.init(e,t),X.init(e,t)});function hp(e){return new mp({type:`readonly`,innerType:e})}const gp=F(`ZodTemplateLiteral`,(e,t)=>{Ho.init(e,t),X.init(e,t)});function _p(e,t){return new gp({type:`template_literal`,parts:e,...B(t)})}const vp=F(`ZodLazy`,(e,t)=>{Wo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.getter()});function yp(e){return new vp({type:`lazy`,getter:e})}const bp=F(`ZodPromise`,(e,t)=>{Uo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xp(e){return new bp({type:`promise`,innerType:e})}const Sp=F(`ZodCustom`,(e,t)=>{Go.init(e,t),X.init(e,t)});function Cp(e){let t=new W({check:`custom`});return t._zod.check=e,t}function wp(e,t){return Su(Sp,e??(()=>!0),t)}function Tp(e,t={}){return Cu(Sp,e,t)}function Ep(e){let t=Cp(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Rr(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Rr(r))}},e(n.value,n)));return t}function Dp(e,t={error:`Input not instance of ${e.name}`}){let n=new Sp({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...B(t)});return n._zod.bag.Class=e,n}const Op=(...e)=>wu({Pipe:fp,Boolean:Jd,String:Yu,Transform:qf},...e);function kp(e){let t=yp(()=>Ef([Xu(e),Vd(),Yd(),sf(),yf(t),Pf(Xu(),t)]));return t}function Ap(e,t){return pp(Jf(e),t)}const jp={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 Mp(e){I({customError:e})}function Np(){return I().customError}var Pp={};zn(Pp,{bigint:()=>Rp,boolean:()=>Lp,date:()=>zp,number:()=>Ip,string:()=>Fp});function Fp(e){return kc(Yu,e)}function Ip(e){return il(Bd,e)}function Lp(e){return dl(Jd,e)}function Rp(e){return pl(Xd,e)}function zp(e){return wl(gf,e)}var Q={};zn(Q,{$brand:()=>Yn,$input:()=>wc,$output:()=>Cc,NEVER:()=>Jn,TimePrecision:()=>Qc,ZodAny:()=>cf,ZodArray:()=>vf,ZodBase64:()=>Ad,ZodBase64URL:()=>Md,ZodBigInt:()=>Xd,ZodBigIntFormat:()=>Qd,ZodBoolean:()=>Jd,ZodCIDRv4:()=>Ed,ZodCIDRv6:()=>Od,ZodCUID:()=>fd,ZodCUID2:()=>md,ZodCatch:()=>cp,ZodCustom:()=>Sp,ZodCustomStringFormat:()=>Rd,ZodDate:()=>gf,ZodDefault:()=>ep,ZodDiscriminatedUnion:()=>Df,ZodE164:()=>Pd,ZodEmail:()=>Zu,ZodEmoji:()=>cd,ZodEnum:()=>Bf,ZodError:()=>Hu,ZodFile:()=>Gf,ZodGUID:()=>$u,ZodIPv4:()=>Sd,ZodIPv6:()=>wd,ZodISODate:()=>Fu,ZodISODateTime:()=>Nu,ZodISODuration:()=>zu,ZodISOTime:()=>Lu,ZodIntersection:()=>kf,ZodIssueCode:()=>jp,ZodJWT:()=>Id,ZodKSUID:()=>bd,ZodLazy:()=>vp,ZodLiteral:()=>Uf,ZodMap:()=>If,ZodNaN:()=>up,ZodNanoID:()=>ud,ZodNever:()=>ff,ZodNonOptional:()=>ip,ZodNull:()=>of,ZodNullable:()=>Zf,ZodNumber:()=>Bd,ZodNumberFormat:()=>Hd,ZodObject:()=>xf,ZodOptional:()=>Yf,ZodPipe:()=>fp,ZodPrefault:()=>np,ZodPromise:()=>bp,ZodReadonly:()=>mp,ZodRealError:()=>Uu,ZodRecord:()=>Nf,ZodSet:()=>Rf,ZodString:()=>Yu,ZodStringFormat:()=>Z,ZodSuccess:()=>op,ZodSymbol:()=>tf,ZodTemplateLiteral:()=>gp,ZodTransform:()=>qf,ZodTuple:()=>jf,ZodType:()=>X,ZodULID:()=>gd,ZodURL:()=>od,ZodUUID:()=>td,ZodUndefined:()=>rf,ZodUnion:()=>Tf,ZodUnknown:()=>uf,ZodVoid:()=>mf,ZodXID:()=>vd,_ZodString:()=>Ju,_default:()=>tp,any:()=>lf,array:()=>yf,base64:()=>jd,base64url:()=>Nd,bigint:()=>Zd,boolean:()=>Yd,catch:()=>lp,check:()=>Cp,cidrv4:()=>Dd,cidrv6:()=>kd,clone:()=>z,coerce:()=>Pp,config:()=>I,core:()=>ju,cuid:()=>pd,cuid2:()=>hd,custom:()=>wp,date:()=>_f,discriminatedUnion:()=>Of,e164:()=>Fd,email:()=>Qu,emoji:()=>ld,endsWith:()=>Wl,enum:()=>Vf,file:()=>Kf,flattenError:()=>Wr,float32:()=>Wd,float64:()=>Gd,formatError:()=>Gr,function:()=>Du,getErrorMap:()=>Np,globalRegistry:()=>Dc,gt:()=>Dl,gte:()=>J,guid:()=>ed,includes:()=>Hl,instanceof:()=>Dp,int:()=>Ud,int32:()=>Kd,int64:()=>$d,intersection:()=>Af,ipv4:()=>Cd,ipv6:()=>Td,iso:()=>Mu,json:()=>kp,jwt:()=>Ld,keyof:()=>bf,ksuid:()=>xd,lazy:()=>yp,length:()=>Rl,literal:()=>Wf,locales:()=>Sc,looseObject:()=>wf,lowercase:()=>Bl,lt:()=>El,lte:()=>q,map:()=>Lf,maxLength:()=>Il,maxSize:()=>Nl,mime:()=>Kl,minLength:()=>Ll,minSize:()=>Pl,multipleOf:()=>Ml,nan:()=>dp,nanoid:()=>dd,nativeEnum:()=>Hf,negative:()=>kl,never:()=>pf,nonnegative:()=>jl,nonoptional:()=>ap,nonpositive:()=>Al,normalize:()=>Jl,null:()=>sf,nullable:()=>Qf,nullish:()=>$f,number:()=>Vd,object:()=>Sf,optional:()=>Xf,overwrite:()=>ql,parse:()=>Wu,parseAsync:()=>Gu,partialRecord:()=>Ff,pipe:()=>pp,positive:()=>Ol,prefault:()=>rp,preprocess:()=>Ap,prettifyError:()=>Jr,promise:()=>xp,property:()=>Gl,readonly:()=>hp,record:()=>Pf,refine:()=>Tp,regex:()=>zl,regexes:()=>ri,registry:()=>Ec,safeParse:()=>Ku,safeParseAsync:()=>qu,set:()=>zf,setErrorMap:()=>Mp,size:()=>Fl,startsWith:()=>Ul,strictObject:()=>Cf,string:()=>Xu,stringFormat:()=>zd,stringbool:()=>Op,success:()=>sp,superRefine:()=>Ep,symbol:()=>nf,templateLiteral:()=>_p,toJSONSchema:()=>ku,toLowerCase:()=>Xl,toUpperCase:()=>Zl,transform:()=>Jf,treeifyError:()=>Kr,trim:()=>Yl,tuple:()=>Mf,uint32:()=>qd,uint64:()=>ef,ulid:()=>_d,undefined:()=>af,union:()=>Ef,unknown:()=>df,uppercase:()=>Vl,url:()=>sd,uuid:()=>nd,uuidv4:()=>rd,uuidv6:()=>id,uuidv7:()=>ad,void:()=>hf,xid:()=>yd}),I(cs()),I({customError:e=>{switch(e.code){case`invalid_type`:return Bp(e);case`invalid_union`:return Vp(e);case`unrecognized_keys`:return Hp(e);case`invalid_value`:return Up(e);default:break}}});const Bp=e=>P(e.input)?`The required field '${Wp(e.path)}' is missing`:`The field '${Wp(e.path)}' is expected to be of type <${e.expected}>, but received type <${typeof e.input}> with value '${e.input}'`,Vp=e=>{let t=[],n=e,r=n?.inst?.def?.discriminator??``;if(n.inst?.options)for(let e of n.inst.options){let n=e;if(r&&n.def?.shape?.[r]){let e=n.def.shape[r];e.def?.type===`enum`&&e.options?t.push(...e.options):e.def?.type===`literal`&&e.def?.values&&t.push(...e.def.values)}}let i=t.length>0?t.join(`, `):`undefined`;return{message:`The field '${r}' has an invalid value: '${e.input?.[r]}'. Allowed values are: [${i}].`}},Hp=e=>{let t=e.keys.length>1,n=Wp(e.path),r=e.keys.map(e=>`${n?`${n}.`:``}${e}`);return{message:`Unknown field${t?`s`:``} '${r.join(`', '`)}'. ${t?`These`:`This`} field${t?`s`:``} ${t?`don`:`doesn`}'t exist in the schema and should be removed.`}},Up=e=>({message:`The field '${Wp(e.path)}' has an invalid value: '${e.input}'. Allowed values are: [${e?.values?.join(`, `)}].`}),Wp=e=>e?.reduce((e,t)=>{if(P(t))return e;if(typeof t==`number`)return`${e}[${t.toString()}]`;if(typeof t==`string`)return e?`${e}.${t.toString()}`:`${t.toString()}`;if(typeof t==`symbol`)return e?`${e}.${String(t)}`:`${String(t)}`},``)??``,Gp=`https://api.stackone.com`;var Kp=class{async execute({profile:e,connector:n,accountId:r,format:i,outputFile:a,apiUrl:o,apiKey:s}={}){if(!e&&!s&&(x.error(`Profile or API key is required`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`To create a profile, run ${C(`stackone init`)}.`),process.exit(1)),e&&s&&(x.error(`Please provide either a profile or an API key, not both`),process.exit(1)),e&&o&&x.warn(`Specifying ${C(`--api-url`)} with a profile won't have any effect. Using API url from profile.`),e&&!Tt(e)){x.error(`Configuration profile ${C(e)} not found`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.\n`);let n=Dt();n.length>0&&(x.info(`Available configuration profiles:`),n.forEach(e=>{x.log(` - ${t.blue(e)}`)})),process.exit(1)}let c=e?wt(e):{apiUrl:o??Gp,apiKey:s};c?.apiKey||(x.error(`API key is missing`),x.log(`Please provide a valid API key in the profile or via the ${C(`--api-key`)} option.`),process.exit(1)),P(n)&&P(r)&&(x.error(`Either ${C(`--connector`)} or ${C(`--account-id`)} must be provided`),process.exit(1)),N(n)&&N(r)&&(x.error(`Please provide either ${C(`--connector`)} or ${C(`--account-id`)}, not both.`),process.exit(1)),N(i)&&i!==`yaml`&&i!==`json`&&(x.error(`Format must be either ${C(`yaml`)} or ${C(`json`)}.`),process.exit(1));let l=c.apiUrl??Gp,u;if(N(n)?(this.#t(n)||(x.error(`Invalid connector format ${$e(n)}. Expected format: ${C(`provider_key@version`)}`),process.exit(1)),u=await this.#n(n,l,c.apiKey,i)):N(r)?u=await this.#r(r,l,c.apiKey,i):(x.error(`Either ${C(`--connector`)} or ${C(`--account-id`)} must be provided`),process.exit(1)),N(a))try{f.writeFileSync(a,u,`utf-8`),x.success(`Connector written to file: ${C(a)}`)}catch(e){x.error(`Failed to write connector to file ${C(a)}: ${e.message}`),process.exit(1)}else if(x.log(`\n${t.blue.inverse(` CONNECTOR CONTENT `)}\n`),!i||i===`yaml`)x.log(this.#e(u));else if(i===`json`)try{Xe(JSON.parse(u))}catch{x.log(u)}else x.log(u);process.exit(0)}#e(e){return e.split(`
45
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function ku(e,t){if(e instanceof Tc){let n=new Ou(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new Ou(t);return n.process(e),n.emit(e,t)}function Y(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return Y(r.element,n);case`object`:for(let e in r.shape)if(Y(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(Y(e,n))return!0;return!1;case`intersection`:return Y(r.left,n)||Y(r.right,n);case`tuple`:for(let e of r.items)if(Y(e,n))return!0;return!!(r.rest&&Y(r.rest,n));case`record`:return Y(r.keyType,n)||Y(r.valueType,n);case`map`:return Y(r.keyType,n)||Y(r.valueType,n);case`set`:return Y(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return Y(r.innerType,n);case`lazy`:return Y(r.getter(),n);case`default`:return Y(r.innerType,n);case`prefault`:return Y(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return Y(r.in,n)||Y(r.out,n);case`success`:return!1;case`catch`:return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var Au={},ju={};zn(ju,{$ZodAny:()=>eo,$ZodArray:()=>oo,$ZodAsyncError:()=>Xn,$ZodBase64:()=>za,$ZodBase64URL:()=>Va,$ZodBigInt:()=>Ya,$ZodBigIntFormat:()=>Xa,$ZodBoolean:()=>Ja,$ZodCIDRv4:()=>Ia,$ZodCIDRv6:()=>La,$ZodCUID:()=>Ta,$ZodCUID2:()=>Ea,$ZodCatch:()=>Io,$ZodCheck:()=>W,$ZodCheckBigIntFormat:()=>Qi,$ZodCheckEndsWith:()=>da,$ZodCheckGreaterThan:()=>Yi,$ZodCheckIncludes:()=>la,$ZodCheckLengthEquals:()=>ia,$ZodCheckLessThan:()=>Ji,$ZodCheckLowerCase:()=>sa,$ZodCheckMaxLength:()=>na,$ZodCheckMaxSize:()=>$i,$ZodCheckMimeType:()=>ma,$ZodCheckMinLength:()=>ra,$ZodCheckMinSize:()=>ea,$ZodCheckMultipleOf:()=>Xi,$ZodCheckNumberFormat:()=>Zi,$ZodCheckOverwrite:()=>ha,$ZodCheckProperty:()=>pa,$ZodCheckRegex:()=>oa,$ZodCheckSizeEquals:()=>ta,$ZodCheckStartsWith:()=>ua,$ZodCheckStringFormat:()=>aa,$ZodCheckUpperCase:()=>ca,$ZodCustom:()=>Go,$ZodCustomStringFormat:()=>Ga,$ZodDate:()=>io,$ZodDefault:()=>Ao,$ZodDiscriminatedUnion:()=>po,$ZodE164:()=>Ha,$ZodEmail:()=>xa,$ZodEmoji:()=>Ca,$ZodEnum:()=>wo,$ZodError:()=>Hr,$ZodFile:()=>Eo,$ZodFunction:()=>Eu,$ZodGUID:()=>ya,$ZodIPv4:()=>Pa,$ZodIPv6:()=>Fa,$ZodISODate:()=>ja,$ZodISODateTime:()=>Aa,$ZodISODuration:()=>Na,$ZodISOTime:()=>Ma,$ZodIntersection:()=>mo,$ZodJWT:()=>Wa,$ZodKSUID:()=>ka,$ZodLazy:()=>Wo,$ZodLiteral:()=>To,$ZodMap:()=>bo,$ZodNaN:()=>Lo,$ZodNanoID:()=>wa,$ZodNever:()=>no,$ZodNonOptional:()=>No,$ZodNull:()=>$a,$ZodNullable:()=>ko,$ZodNumber:()=>Ka,$ZodNumberFormat:()=>qa,$ZodObject:()=>lo,$ZodOptional:()=>Oo,$ZodPipe:()=>Ro,$ZodPrefault:()=>Mo,$ZodPromise:()=>Uo,$ZodReadonly:()=>Bo,$ZodRealError:()=>Ur,$ZodRecord:()=>yo,$ZodRegistry:()=>Tc,$ZodSet:()=>So,$ZodString:()=>va,$ZodStringFormat:()=>K,$ZodSuccess:()=>Fo,$ZodSymbol:()=>Za,$ZodTemplateLiteral:()=>Ho,$ZodTransform:()=>Do,$ZodTuple:()=>_o,$ZodType:()=>G,$ZodULID:()=>Da,$ZodURL:()=>Sa,$ZodUUID:()=>ba,$ZodUndefined:()=>Qa,$ZodUnion:()=>fo,$ZodUnknown:()=>to,$ZodVoid:()=>ro,$ZodXID:()=>Oa,$brand:()=>Yn,$constructor:()=>F,$input:()=>wc,$output:()=>Cc,Doc:()=>ga,JSONSchema:()=>Au,JSONSchemaGenerator:()=>Ou,NEVER:()=>Jn,TimePrecision:()=>Qc,_any:()=>yl,_array:()=>Ql,_base64:()=>Jc,_base64url:()=>Yc,_bigint:()=>fl,_boolean:()=>ul,_catch:()=>gu,_cidrv4:()=>Kc,_cidrv6:()=>qc,_coercedBigint:()=>pl,_coercedBoolean:()=>dl,_coercedDate:()=>wl,_coercedNumber:()=>il,_coercedString:()=>kc,_cuid:()=>zc,_cuid2:()=>Bc,_custom:()=>Su,_date:()=>Cl,_default:()=>pu,_discriminatedUnion:()=>eu,_e164:()=>Xc,_email:()=>Ac,_emoji:()=>Lc,_endsWith:()=>Wl,_enum:()=>ou,_file:()=>lu,_float32:()=>ol,_float64:()=>sl,_gt:()=>Dl,_gte:()=>J,_guid:()=>jc,_includes:()=>Hl,_int:()=>al,_int32:()=>cl,_int64:()=>ml,_intersection:()=>tu,_ipv4:()=>Wc,_ipv6:()=>Gc,_isoDate:()=>el,_isoDateTime:()=>$c,_isoDuration:()=>nl,_isoTime:()=>tl,_jwt:()=>Zc,_ksuid:()=>Uc,_lazy:()=>bu,_length:()=>Rl,_literal:()=>cu,_lowercase:()=>Bl,_lt:()=>El,_lte:()=>q,_map:()=>iu,_max:()=>q,_maxLength:()=>Il,_maxSize:()=>Nl,_mime:()=>Kl,_min:()=>J,_minLength:()=>Ll,_minSize:()=>Pl,_multipleOf:()=>Ml,_nan:()=>Tl,_nanoid:()=>Rc,_nativeEnum:()=>su,_negative:()=>kl,_never:()=>xl,_nonnegative:()=>jl,_nonoptional:()=>mu,_nonpositive:()=>Al,_normalize:()=>Jl,_null:()=>vl,_nullable:()=>fu,_number:()=>rl,_optional:()=>du,_overwrite:()=>ql,_parse:()=>Yr,_parseAsync:()=>Zr,_pipe:()=>_u,_positive:()=>Ol,_promise:()=>xu,_property:()=>Gl,_readonly:()=>vu,_record:()=>ru,_refine:()=>Cu,_regex:()=>zl,_safeParse:()=>$r,_safeParseAsync:()=>ti,_set:()=>au,_size:()=>Fl,_startsWith:()=>Ul,_string:()=>Oc,_stringFormat:()=>Tu,_stringbool:()=>wu,_success:()=>hu,_symbol:()=>gl,_templateLiteral:()=>yu,_toLowerCase:()=>Xl,_toUpperCase:()=>Zl,_transform:()=>uu,_trim:()=>Yl,_tuple:()=>nu,_uint32:()=>ll,_uint64:()=>hl,_ulid:()=>Vc,_undefined:()=>_l,_union:()=>$l,_unknown:()=>bl,_uppercase:()=>Vl,_url:()=>Ic,_uuid:()=>Mc,_uuidv4:()=>Nc,_uuidv6:()=>Pc,_uuidv7:()=>Fc,_void:()=>Sl,_xid:()=>Hc,clone:()=>z,config:()=>I,flattenError:()=>Wr,formatError:()=>Gr,function:()=>Du,globalConfig:()=>Zn,globalRegistry:()=>Dc,isValidBase64:()=>Ra,isValidBase64URL:()=>Ba,isValidJWT:()=>Ua,locales:()=>Sc,parse:()=>Xr,parseAsync:()=>Qr,prettifyError:()=>Jr,regexes:()=>ri,registry:()=>Ec,safeParse:()=>ei,safeParseAsync:()=>ni,toDotPath:()=>qr,toJSONSchema:()=>ku,treeifyError:()=>Kr,util:()=>Qn,version:()=>_a});var Mu={};zn(Mu,{ZodISODate:()=>Fu,ZodISODateTime:()=>Nu,ZodISODuration:()=>zu,ZodISOTime:()=>Lu,date:()=>Iu,datetime:()=>Pu,duration:()=>Bu,time:()=>Ru});const Nu=F(`ZodISODateTime`,(e,t)=>{Aa.init(e,t),Z.init(e,t)});function Pu(e){return $c(Nu,e)}const Fu=F(`ZodISODate`,(e,t)=>{ja.init(e,t),Z.init(e,t)});function Iu(e){return el(Fu,e)}const Lu=F(`ZodISOTime`,(e,t)=>{Ma.init(e,t),Z.init(e,t)});function Ru(e){return tl(Lu,e)}const zu=F(`ZodISODuration`,(e,t)=>{Na.init(e,t),Z.init(e,t)});function Bu(e){return nl(zu,e)}const Vu=(e,t)=>{Hr.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Gr(e,t)},flatten:{value:t=>Wr(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})},Hu=F(`ZodError`,Vu),Uu=F(`ZodError`,Vu,{Parent:Error}),Wu=Yr(Uu),Gu=Zr(Uu),Ku=$r(Uu),qu=ti(Uu),X=F(`ZodType`,(e,t)=>(G.init(e,t),e.def=t,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>z(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Wu(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ku(e,t,n),e.parseAsync=async(t,n)=>Gu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qu(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(Tp(t,n)),e.superRefine=t=>e.check(Ep(t)),e.overwrite=t=>e.check(ql(t)),e.optional=()=>Xf(e),e.nullable=()=>Qf(e),e.nullish=()=>Xf(Qf(e)),e.nonoptional=t=>ap(e,t),e.array=()=>yf(e),e.or=t=>Ef([e,t]),e.and=t=>Af(e,t),e.transform=t=>pp(e,Jf(t)),e.default=t=>tp(e,t),e.prefault=t=>rp(e,t),e.catch=t=>lp(e,t),e.pipe=t=>pp(e,t),e.readonly=()=>hp(e),e.describe=t=>{let n=e.clone();return Dc.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Dc.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Dc.get(e);let n=e.clone();return Dc.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ju=F(`_ZodString`,(e,t)=>{va.init(e,t),X.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(zl(...t)),e.includes=(...t)=>e.check(Hl(...t)),e.startsWith=(...t)=>e.check(Ul(...t)),e.endsWith=(...t)=>e.check(Wl(...t)),e.min=(...t)=>e.check(Ll(...t)),e.max=(...t)=>e.check(Il(...t)),e.length=(...t)=>e.check(Rl(...t)),e.nonempty=(...t)=>e.check(Ll(1,...t)),e.lowercase=t=>e.check(Bl(t)),e.uppercase=t=>e.check(Vl(t)),e.trim=()=>e.check(Yl()),e.normalize=(...t)=>e.check(Jl(...t)),e.toLowerCase=()=>e.check(Xl()),e.toUpperCase=()=>e.check(Zl())}),Yu=F(`ZodString`,(e,t)=>{va.init(e,t),Ju.init(e,t),e.email=t=>e.check(Ac(Zu,t)),e.url=t=>e.check(Ic(od,t)),e.jwt=t=>e.check(Zc(Id,t)),e.emoji=t=>e.check(Lc(cd,t)),e.guid=t=>e.check(jc($u,t)),e.uuid=t=>e.check(Mc(td,t)),e.uuidv4=t=>e.check(Nc(td,t)),e.uuidv6=t=>e.check(Pc(td,t)),e.uuidv7=t=>e.check(Fc(td,t)),e.nanoid=t=>e.check(Rc(ud,t)),e.guid=t=>e.check(jc($u,t)),e.cuid=t=>e.check(zc(fd,t)),e.cuid2=t=>e.check(Bc(md,t)),e.ulid=t=>e.check(Vc(gd,t)),e.base64=t=>e.check(Jc(Ad,t)),e.base64url=t=>e.check(Yc(Md,t)),e.xid=t=>e.check(Hc(vd,t)),e.ksuid=t=>e.check(Uc(bd,t)),e.ipv4=t=>e.check(Wc(Sd,t)),e.ipv6=t=>e.check(Gc(wd,t)),e.cidrv4=t=>e.check(Kc(Ed,t)),e.cidrv6=t=>e.check(qc(Od,t)),e.e164=t=>e.check(Xc(Pd,t)),e.datetime=t=>e.check(Pu(t)),e.date=t=>e.check(Iu(t)),e.time=t=>e.check(Ru(t)),e.duration=t=>e.check(Bu(t))});function Xu(e){return Oc(Yu,e)}const Z=F(`ZodStringFormat`,(e,t)=>{K.init(e,t),Ju.init(e,t)}),Zu=F(`ZodEmail`,(e,t)=>{xa.init(e,t),Z.init(e,t)});function Qu(e){return Ac(Zu,e)}const $u=F(`ZodGUID`,(e,t)=>{ya.init(e,t),Z.init(e,t)});function ed(e){return jc($u,e)}const td=F(`ZodUUID`,(e,t)=>{ba.init(e,t),Z.init(e,t)});function nd(e){return Mc(td,e)}function rd(e){return Nc(td,e)}function id(e){return Pc(td,e)}function ad(e){return Fc(td,e)}const od=F(`ZodURL`,(e,t)=>{Sa.init(e,t),Z.init(e,t)});function sd(e){return Ic(od,e)}const cd=F(`ZodEmoji`,(e,t)=>{Ca.init(e,t),Z.init(e,t)});function ld(e){return Lc(cd,e)}const ud=F(`ZodNanoID`,(e,t)=>{wa.init(e,t),Z.init(e,t)});function dd(e){return Rc(ud,e)}const fd=F(`ZodCUID`,(e,t)=>{Ta.init(e,t),Z.init(e,t)});function pd(e){return zc(fd,e)}const md=F(`ZodCUID2`,(e,t)=>{Ea.init(e,t),Z.init(e,t)});function hd(e){return Bc(md,e)}const gd=F(`ZodULID`,(e,t)=>{Da.init(e,t),Z.init(e,t)});function _d(e){return Vc(gd,e)}const vd=F(`ZodXID`,(e,t)=>{Oa.init(e,t),Z.init(e,t)});function yd(e){return Hc(vd,e)}const bd=F(`ZodKSUID`,(e,t)=>{ka.init(e,t),Z.init(e,t)});function xd(e){return Uc(bd,e)}const Sd=F(`ZodIPv4`,(e,t)=>{Pa.init(e,t),Z.init(e,t)});function Cd(e){return Wc(Sd,e)}const wd=F(`ZodIPv6`,(e,t)=>{Fa.init(e,t),Z.init(e,t)});function Td(e){return Gc(wd,e)}const Ed=F(`ZodCIDRv4`,(e,t)=>{Ia.init(e,t),Z.init(e,t)});function Dd(e){return Kc(Ed,e)}const Od=F(`ZodCIDRv6`,(e,t)=>{La.init(e,t),Z.init(e,t)});function kd(e){return qc(Od,e)}const Ad=F(`ZodBase64`,(e,t)=>{za.init(e,t),Z.init(e,t)});function jd(e){return Jc(Ad,e)}const Md=F(`ZodBase64URL`,(e,t)=>{Va.init(e,t),Z.init(e,t)});function Nd(e){return Yc(Md,e)}const Pd=F(`ZodE164`,(e,t)=>{Ha.init(e,t),Z.init(e,t)});function Fd(e){return Xc(Pd,e)}const Id=F(`ZodJWT`,(e,t)=>{Wa.init(e,t),Z.init(e,t)});function Ld(e){return Zc(Id,e)}const Rd=F(`ZodCustomStringFormat`,(e,t)=>{Ga.init(e,t),Z.init(e,t)});function zd(e,t,n={}){return Tu(Rd,e,t,n)}const Bd=F(`ZodNumber`,(e,t)=>{Ka.init(e,t),X.init(e,t),e.gt=(t,n)=>e.check(Dl(t,n)),e.gte=(t,n)=>e.check(J(t,n)),e.min=(t,n)=>e.check(J(t,n)),e.lt=(t,n)=>e.check(El(t,n)),e.lte=(t,n)=>e.check(q(t,n)),e.max=(t,n)=>e.check(q(t,n)),e.int=t=>e.check(Ud(t)),e.safe=t=>e.check(Ud(t)),e.positive=t=>e.check(Dl(0,t)),e.nonnegative=t=>e.check(J(0,t)),e.negative=t=>e.check(El(0,t)),e.nonpositive=t=>e.check(q(0,t)),e.multipleOf=(t,n)=>e.check(Ml(t,n)),e.step=(t,n)=>e.check(Ml(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Vd(e){return rl(Bd,e)}const Hd=F(`ZodNumberFormat`,(e,t)=>{qa.init(e,t),Bd.init(e,t)});function Ud(e){return al(Hd,e)}function Wd(e){return ol(Hd,e)}function Gd(e){return sl(Hd,e)}function Kd(e){return cl(Hd,e)}function qd(e){return ll(Hd,e)}const Jd=F(`ZodBoolean`,(e,t)=>{Ja.init(e,t),X.init(e,t)});function Yd(e){return ul(Jd,e)}const Xd=F(`ZodBigInt`,(e,t)=>{Ya.init(e,t),X.init(e,t),e.gte=(t,n)=>e.check(J(t,n)),e.min=(t,n)=>e.check(J(t,n)),e.gt=(t,n)=>e.check(Dl(t,n)),e.gte=(t,n)=>e.check(J(t,n)),e.min=(t,n)=>e.check(J(t,n)),e.lt=(t,n)=>e.check(El(t,n)),e.lte=(t,n)=>e.check(q(t,n)),e.max=(t,n)=>e.check(q(t,n)),e.positive=t=>e.check(Dl(BigInt(0),t)),e.negative=t=>e.check(El(BigInt(0),t)),e.nonpositive=t=>e.check(q(BigInt(0),t)),e.nonnegative=t=>e.check(J(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ml(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Zd(e){return fl(Xd,e)}const Qd=F(`ZodBigIntFormat`,(e,t)=>{Xa.init(e,t),Xd.init(e,t)});function $d(e){return ml(Qd,e)}function ef(e){return hl(Qd,e)}const tf=F(`ZodSymbol`,(e,t)=>{Za.init(e,t),X.init(e,t)});function nf(e){return gl(tf,e)}const rf=F(`ZodUndefined`,(e,t)=>{Qa.init(e,t),X.init(e,t)});function af(e){return _l(rf,e)}const of=F(`ZodNull`,(e,t)=>{$a.init(e,t),X.init(e,t)});function sf(e){return vl(of,e)}const cf=F(`ZodAny`,(e,t)=>{eo.init(e,t),X.init(e,t)});function lf(){return yl(cf)}const uf=F(`ZodUnknown`,(e,t)=>{to.init(e,t),X.init(e,t)});function df(){return bl(uf)}const ff=F(`ZodNever`,(e,t)=>{no.init(e,t),X.init(e,t)});function pf(e){return xl(ff,e)}const mf=F(`ZodVoid`,(e,t)=>{ro.init(e,t),X.init(e,t)});function hf(e){return Sl(mf,e)}const gf=F(`ZodDate`,(e,t)=>{io.init(e,t),X.init(e,t),e.min=(t,n)=>e.check(J(t,n)),e.max=(t,n)=>e.check(q(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function _f(e){return Cl(gf,e)}const vf=F(`ZodArray`,(e,t)=>{oo.init(e,t),X.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ll(t,n)),e.nonempty=t=>e.check(Ll(1,t)),e.max=(t,n)=>e.check(Il(t,n)),e.length=(t,n)=>e.check(Rl(t,n)),e.unwrap=()=>e.element});function yf(e,t){return Ql(vf,e,t)}function bf(e){let t=e._zod.def.shape;return Wf(Object.keys(t))}const xf=F(`ZodObject`,(e,t)=>{lo.init(e,t),X.init(e,t),R(e,`shape`,()=>t.shape),e.keyof=()=>Vf(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:df()}),e.loose=()=>e.clone({...e._zod.def,catchall:df()}),e.strict=()=>e.clone({...e._zod.def,catchall:pf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Ar(e,t),e.merge=t=>jr(e,t),e.pick=t=>Or(e,t),e.omit=t=>kr(e,t),e.partial=(...t)=>Mr(Yf,e,t[0]),e.required=(...t)=>Nr(ip,e,t[0])});function Sf(e,t){return new xf({type:`object`,get shape(){return ur(this,`shape`,{...e}),this.shape},...B(t)})}function Cf(e,t){return new xf({type:`object`,get shape(){return ur(this,`shape`,{...e}),this.shape},catchall:pf(),...B(t)})}function wf(e,t){return new xf({type:`object`,get shape(){return ur(this,`shape`,{...e}),this.shape},catchall:df(),...B(t)})}const Tf=F(`ZodUnion`,(e,t)=>{fo.init(e,t),X.init(e,t),e.options=t.options});function Ef(e,t){return new Tf({type:`union`,options:e,...B(t)})}const Df=F(`ZodDiscriminatedUnion`,(e,t)=>{Tf.init(e,t),po.init(e,t)});function Of(e,t,n){return new Df({type:`union`,options:t,discriminator:e,...B(n)})}const kf=F(`ZodIntersection`,(e,t)=>{mo.init(e,t),X.init(e,t)});function Af(e,t){return new kf({type:`intersection`,left:e,right:t})}const jf=F(`ZodTuple`,(e,t)=>{_o.init(e,t),X.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Mf(e,t,n){let r=t instanceof G;return new jf({type:`tuple`,items:e,rest:r?t:null,...B(r?n:t)})}const Nf=F(`ZodRecord`,(e,t)=>{yo.init(e,t),X.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Pf(e,t,n){return new Nf({type:`record`,keyType:e,valueType:t,...B(n)})}function Ff(e,t,n){return new Nf({type:`record`,keyType:Ef([e,pf()]),valueType:t,...B(n)})}const If=F(`ZodMap`,(e,t)=>{bo.init(e,t),X.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Lf(e,t,n){return new If({type:`map`,keyType:e,valueType:t,...B(n)})}const Rf=F(`ZodSet`,(e,t)=>{So.init(e,t),X.init(e,t),e.min=(...t)=>e.check(Pl(...t)),e.nonempty=t=>e.check(Pl(1,t)),e.max=(...t)=>e.check(Nl(...t)),e.size=(...t)=>e.check(Fl(...t))});function zf(e,t){return new Rf({type:`set`,valueType:e,...B(t)})}const Bf=F(`ZodEnum`,(e,t)=>{wo.init(e,t),X.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Bf({...t,checks:[],...B(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Bf({...t,checks:[],...B(r),entries:i})}});function Vf(e,t){return new Bf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...B(t)})}function Hf(e,t){return new Bf({type:`enum`,entries:e,...B(t)})}const Uf=F(`ZodLiteral`,(e,t)=>{To.init(e,t),X.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Wf(e,t){return new Uf({type:`literal`,values:Array.isArray(e)?e:[e],...B(t)})}const Gf=F(`ZodFile`,(e,t)=>{Eo.init(e,t),X.init(e,t),e.min=(t,n)=>e.check(Pl(t,n)),e.max=(t,n)=>e.check(Nl(t,n)),e.mime=(t,n)=>e.check(Kl(Array.isArray(t)?t:[t],n))});function Kf(e){return lu(Gf,e)}const qf=F(`ZodTransform`,(e,t)=>{Do.init(e,t),X.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rr(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(Rr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Jf(e){return new qf({type:`transform`,transform:e})}const Yf=F(`ZodOptional`,(e,t)=>{Oo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xf(e){return new Yf({type:`optional`,innerType:e})}const Zf=F(`ZodNullable`,(e,t)=>{ko.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qf(e){return new Zf({type:`nullable`,innerType:e})}function $f(e){return Xf(Qf(e))}const ep=F(`ZodDefault`,(e,t)=>{Ao.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tp(e,t){return new ep({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const np=F(`ZodPrefault`,(e,t)=>{Mo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rp(e,t){return new np({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const ip=F(`ZodNonOptional`,(e,t)=>{No.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ap(e,t){return new ip({type:`nonoptional`,innerType:e,...B(t)})}const op=F(`ZodSuccess`,(e,t)=>{Fo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sp(e){return new op({type:`success`,innerType:e})}const cp=F(`ZodCatch`,(e,t)=>{Io.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lp(e,t){return new cp({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const up=F(`ZodNaN`,(e,t)=>{Lo.init(e,t),X.init(e,t)});function dp(e){return Tl(up,e)}const fp=F(`ZodPipe`,(e,t)=>{Ro.init(e,t),X.init(e,t),e.in=t.in,e.out=t.out});function pp(e,t){return new fp({type:`pipe`,in:e,out:t})}const mp=F(`ZodReadonly`,(e,t)=>{Bo.init(e,t),X.init(e,t)});function hp(e){return new mp({type:`readonly`,innerType:e})}const gp=F(`ZodTemplateLiteral`,(e,t)=>{Ho.init(e,t),X.init(e,t)});function _p(e,t){return new gp({type:`template_literal`,parts:e,...B(t)})}const vp=F(`ZodLazy`,(e,t)=>{Wo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.getter()});function yp(e){return new vp({type:`lazy`,getter:e})}const bp=F(`ZodPromise`,(e,t)=>{Uo.init(e,t),X.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xp(e){return new bp({type:`promise`,innerType:e})}const Sp=F(`ZodCustom`,(e,t)=>{Go.init(e,t),X.init(e,t)});function Cp(e){let t=new W({check:`custom`});return t._zod.check=e,t}function wp(e,t){return Su(Sp,e??(()=>!0),t)}function Tp(e,t={}){return Cu(Sp,e,t)}function Ep(e){let t=Cp(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Rr(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Rr(r))}},e(n.value,n)));return t}function Dp(e,t={error:`Input not instance of ${e.name}`}){let n=new Sp({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...B(t)});return n._zod.bag.Class=e,n}const Op=(...e)=>wu({Pipe:fp,Boolean:Jd,String:Yu,Transform:qf},...e);function kp(e){let t=yp(()=>Ef([Xu(e),Vd(),Yd(),sf(),yf(t),Pf(Xu(),t)]));return t}function Ap(e,t){return pp(Jf(e),t)}const jp={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 Mp(e){I({customError:e})}function Np(){return I().customError}var Pp={};zn(Pp,{bigint:()=>Rp,boolean:()=>Lp,date:()=>zp,number:()=>Ip,string:()=>Fp});function Fp(e){return kc(Yu,e)}function Ip(e){return il(Bd,e)}function Lp(e){return dl(Jd,e)}function Rp(e){return pl(Xd,e)}function zp(e){return wl(gf,e)}var Q={};zn(Q,{$brand:()=>Yn,$input:()=>wc,$output:()=>Cc,NEVER:()=>Jn,TimePrecision:()=>Qc,ZodAny:()=>cf,ZodArray:()=>vf,ZodBase64:()=>Ad,ZodBase64URL:()=>Md,ZodBigInt:()=>Xd,ZodBigIntFormat:()=>Qd,ZodBoolean:()=>Jd,ZodCIDRv4:()=>Ed,ZodCIDRv6:()=>Od,ZodCUID:()=>fd,ZodCUID2:()=>md,ZodCatch:()=>cp,ZodCustom:()=>Sp,ZodCustomStringFormat:()=>Rd,ZodDate:()=>gf,ZodDefault:()=>ep,ZodDiscriminatedUnion:()=>Df,ZodE164:()=>Pd,ZodEmail:()=>Zu,ZodEmoji:()=>cd,ZodEnum:()=>Bf,ZodError:()=>Hu,ZodFile:()=>Gf,ZodGUID:()=>$u,ZodIPv4:()=>Sd,ZodIPv6:()=>wd,ZodISODate:()=>Fu,ZodISODateTime:()=>Nu,ZodISODuration:()=>zu,ZodISOTime:()=>Lu,ZodIntersection:()=>kf,ZodIssueCode:()=>jp,ZodJWT:()=>Id,ZodKSUID:()=>bd,ZodLazy:()=>vp,ZodLiteral:()=>Uf,ZodMap:()=>If,ZodNaN:()=>up,ZodNanoID:()=>ud,ZodNever:()=>ff,ZodNonOptional:()=>ip,ZodNull:()=>of,ZodNullable:()=>Zf,ZodNumber:()=>Bd,ZodNumberFormat:()=>Hd,ZodObject:()=>xf,ZodOptional:()=>Yf,ZodPipe:()=>fp,ZodPrefault:()=>np,ZodPromise:()=>bp,ZodReadonly:()=>mp,ZodRealError:()=>Uu,ZodRecord:()=>Nf,ZodSet:()=>Rf,ZodString:()=>Yu,ZodStringFormat:()=>Z,ZodSuccess:()=>op,ZodSymbol:()=>tf,ZodTemplateLiteral:()=>gp,ZodTransform:()=>qf,ZodTuple:()=>jf,ZodType:()=>X,ZodULID:()=>gd,ZodURL:()=>od,ZodUUID:()=>td,ZodUndefined:()=>rf,ZodUnion:()=>Tf,ZodUnknown:()=>uf,ZodVoid:()=>mf,ZodXID:()=>vd,_ZodString:()=>Ju,_default:()=>tp,any:()=>lf,array:()=>yf,base64:()=>jd,base64url:()=>Nd,bigint:()=>Zd,boolean:()=>Yd,catch:()=>lp,check:()=>Cp,cidrv4:()=>Dd,cidrv6:()=>kd,clone:()=>z,coerce:()=>Pp,config:()=>I,core:()=>ju,cuid:()=>pd,cuid2:()=>hd,custom:()=>wp,date:()=>_f,discriminatedUnion:()=>Of,e164:()=>Fd,email:()=>Qu,emoji:()=>ld,endsWith:()=>Wl,enum:()=>Vf,file:()=>Kf,flattenError:()=>Wr,float32:()=>Wd,float64:()=>Gd,formatError:()=>Gr,function:()=>Du,getErrorMap:()=>Np,globalRegistry:()=>Dc,gt:()=>Dl,gte:()=>J,guid:()=>ed,includes:()=>Hl,instanceof:()=>Dp,int:()=>Ud,int32:()=>Kd,int64:()=>$d,intersection:()=>Af,ipv4:()=>Cd,ipv6:()=>Td,iso:()=>Mu,json:()=>kp,jwt:()=>Ld,keyof:()=>bf,ksuid:()=>xd,lazy:()=>yp,length:()=>Rl,literal:()=>Wf,locales:()=>Sc,looseObject:()=>wf,lowercase:()=>Bl,lt:()=>El,lte:()=>q,map:()=>Lf,maxLength:()=>Il,maxSize:()=>Nl,mime:()=>Kl,minLength:()=>Ll,minSize:()=>Pl,multipleOf:()=>Ml,nan:()=>dp,nanoid:()=>dd,nativeEnum:()=>Hf,negative:()=>kl,never:()=>pf,nonnegative:()=>jl,nonoptional:()=>ap,nonpositive:()=>Al,normalize:()=>Jl,null:()=>sf,nullable:()=>Qf,nullish:()=>$f,number:()=>Vd,object:()=>Sf,optional:()=>Xf,overwrite:()=>ql,parse:()=>Wu,parseAsync:()=>Gu,partialRecord:()=>Ff,pipe:()=>pp,positive:()=>Ol,prefault:()=>rp,preprocess:()=>Ap,prettifyError:()=>Jr,promise:()=>xp,property:()=>Gl,readonly:()=>hp,record:()=>Pf,refine:()=>Tp,regex:()=>zl,regexes:()=>ri,registry:()=>Ec,safeParse:()=>Ku,safeParseAsync:()=>qu,set:()=>zf,setErrorMap:()=>Mp,size:()=>Fl,startsWith:()=>Ul,strictObject:()=>Cf,string:()=>Xu,stringFormat:()=>zd,stringbool:()=>Op,success:()=>sp,superRefine:()=>Ep,symbol:()=>nf,templateLiteral:()=>_p,toJSONSchema:()=>ku,toLowerCase:()=>Xl,toUpperCase:()=>Zl,transform:()=>Jf,treeifyError:()=>Kr,trim:()=>Yl,tuple:()=>Mf,uint32:()=>qd,uint64:()=>ef,ulid:()=>_d,undefined:()=>af,union:()=>Ef,unknown:()=>df,uppercase:()=>Vl,url:()=>sd,uuid:()=>nd,uuidv4:()=>rd,uuidv6:()=>id,uuidv7:()=>ad,void:()=>hf,xid:()=>yd}),I(cs()),I({customError:e=>{switch(e.code){case`invalid_type`:return Bp(e);case`invalid_union`:return Vp(e);case`unrecognized_keys`:return Hp(e);case`invalid_value`:return Up(e);default:break}}});const Bp=e=>P(e.input)?`The required field '${Wp(e.path)}' is missing`:`The field '${Wp(e.path)}' is expected to be of type <${e.expected}>, but received type <${typeof e.input}> with value '${e.input}'`,Vp=e=>{let t=[],n=e,r=n?.inst?.def?.discriminator??``;if(n.inst?.options)for(let e of n.inst.options){let n=e;if(r&&n.def?.shape?.[r]){let e=n.def.shape[r];e.def?.type===`enum`&&e.options?t.push(...e.options):e.def?.type===`literal`&&e.def?.values&&t.push(...e.def.values)}}let i=t.length>0?t.join(`, `):`undefined`;return{message:`The field '${r}' has an invalid value: '${e.input?.[r]}'. Allowed values are: [${i}].`}},Hp=e=>{let t=e.keys.length>1,n=Wp(e.path),r=e.keys.map(e=>`${n?`${n}.`:``}${e}`);return{message:`Unknown field${t?`s`:``} '${r.join(`', '`)}'. ${t?`These`:`This`} field${t?`s`:``} ${t?`don`:`doesn`}'t exist in the schema and should be removed.`}},Up=e=>({message:`The field '${Wp(e.path)}' has an invalid value: '${e.input}'. Allowed values are: [${e?.values?.join(`, `)}].`}),Wp=e=>e?.reduce((e,t)=>{if(P(t))return e;if(typeof t==`number`)return`${e}[${t.toString()}]`;if(typeof t==`string`)return e?`${e}.${t.toString()}`:`${t.toString()}`;if(typeof t==`symbol`)return e?`${e}.${String(t)}`:`${String(t)}`},``)??``,Gp=`https://api.stackone.com`;var Kp=class{async execute({profile:e,connector:n,accountId:r,format:i,outputFile:a,apiUrl:o,apiKey:s}={}){if(!e&&!s&&(x.error(`Profile or API key is required`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`To create a profile, run ${C(`stackone init`)}.`),process.exit(1)),e&&s&&(x.error(`Please provide either a profile or an API key, not both`),process.exit(1)),e&&o&&x.warn(`Specifying ${C(`--api-url`)} with a profile won't have any effect. Using API url from profile.`),e&&!Tt(e)){x.error(`Configuration profile ${C(e)} not found`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.\n`);let n=Dt();n.length>0&&(x.info(`Available configuration profiles:`),n.forEach(e=>{x.log(` - ${t.blue(e)}`)})),process.exit(1)}let c=e?wt(e):{apiUrl:o??Gp,apiKey:s};c?.apiKey||(x.error(`API key is missing`),x.log(`Please provide a valid API key in the profile or via the ${C(`--api-key`)} option.`),process.exit(1)),P(n)&&P(r)&&(x.error(`Either ${C(`--connector`)} or ${C(`--account-id`)} must be provided`),process.exit(1)),N(n)&&N(r)&&(x.error(`Please provide either ${C(`--connector`)} or ${C(`--account-id`)}, not both.`),process.exit(1)),N(i)&&i!==`yaml`&&i!==`json`&&(x.error(`Format must be either ${C(`yaml`)} or ${C(`json`)}.`),process.exit(1));let l=c.apiUrl??Gp,u;if(N(n)){this.#t(n)||(x.error(`Invalid connector format ${$e(n)}. Expected format: ${C(`provider_key@version`)} or ${C(`provider_key`)}`),process.exit(1));let e=this.#n(n);u=await this.#r(e,l,c.apiKey,i)}else N(r)?u=await this.#i(r,l,c.apiKey,i):(x.error(`Either ${C(`--connector`)} or ${C(`--account-id`)} must be provided`),process.exit(1));if(N(a))try{f.writeFileSync(a,u,`utf-8`),x.success(`Connector written to file: ${C(a)}`)}catch(e){x.error(`Failed to write connector to file ${C(a)}: ${e.message}`),process.exit(1)}else if(x.log(`\n${t.blue.inverse(` CONNECTOR CONTENT `)}\n`),!i||i===`yaml`)x.log(this.#e(u));else if(i===`json`)try{Xe(JSON.parse(u))}catch{x.log(u)}else x.log(u);process.exit(0)}#e(e){return e.split(`
46
46
  `).map(e=>{if(e.trim().startsWith(`#`))return t.gray(e);if(e.includes(`:`)){let n=e.indexOf(`:`),r=e.substring(0,n+1),i=e.substring(n+1),a=i,o=i.trim();return o===`true`||o===`false`?a=i.replace(o,t.cyan(o)):o===`null`||o===`~`?a=i.replace(o,t.gray(o)):/^-?\d+(\.\d+)?$/.test(o)?a=i.replace(o,t.green(o)):(o.startsWith(`"`)&&o.endsWith(`"`)||o.startsWith(`'`)&&o.endsWith(`'`)||o&&!o.startsWith(`-`))&&(a=i.replace(o,t.yellow(o))),t.red(r)+a}return e.trim().startsWith(`-`)?e.replace(`-`,t.gray(`-`)):e}).join(`
47
- `)}#t=e=>e.includes(`@`)&&e.split(`@`).length===2&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.endsWith(`.yaml`)&&!e.endsWith(`.yml`);async#n(e,t,n,r){let i=d(`Getting connector ${C(e)} from registry...`).start();try{let a=Buffer.from(n).toString(`base64`),o=r?`?format=${r}`:``,s=await fetch(`${t}/registry/connectors/${e}${o}`,{method:`GET`,headers:{Authorization:`Basic ${a}`}});return i.stop(),s.ok||(await Ze(s,`Failed to get connector ${C(e)} from the registry`),process.exit(1)),await s.text()}catch(n){i.stop(),x.error(`Failed to get connector ${C(e)} from the registry: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}}async#r(e,t,n,r){let i=d(`Getting connector from account ${C(e)}...`).start();try{let a=Buffer.from(n).toString(`base64`),o=r?`?format=${r}`:``,s=await fetch(`${t}/accounts/${e}/connector${o}`,{method:`GET`,headers:{Authorization:`Basic ${a}`}});return i.stop(),s.ok||(await Ze(s,`Failed to get connector from account ${C(e)}`),process.exit(1)),await s.text()}catch(n){i.stop(),x.error(`Failed to get connector from account ${C(e)}: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}}};const qp=`http://localhost:4000`;var Jp=class{async execute({environment:e}={}){let n=e?.toLowerCase()??`production`;try{_e(`${t.inverse(` Initialize profile `)}`);let e=await Se({message:`Profile label`,validate:e=>{if(!e||e.trim().length===0)return`The profile label is required`;if(e.includes(` `))return`The profile label cannot contain spaces`}});if(ve(e))return he(`Configuration profile initialization cancelled`),process.exit(0);if(Tt(e)){let t=await ge({message:`Configuration profile with name ${C(e)} already exists. Do you want to overwrite it?`});if(ve(t)||!t)return he(`Configuration profile initialization cancelled`),process.exit(0)}let r;if(n===`production`)r=`https://api.stackone.com`;else if(n===`staging`)r=`https://api.stackone-dev.com`;else{let e=await Se({message:`API URL`,placeholder:qp,initialValue:qp,validate:e=>{if(!e||e.trim().length===0)return`API URL is required`;try{new URL(e)}catch{return`Please enter a valid URL`}}});if(ve(e))return he(`Configuration profile initialization cancelled`),process.exit(0);r=e}let i=await be({message:`API Key`,validate:e=>{if(!e||e.trim().length===0)return`API Key is required`}});if(ve(i))return he(`Configuration profile initialization cancelled`),process.exit(0);Et(e,{label:e,environment:n,apiUrl:r,apiKey:i}),ye(`${t.green(`✔`)} Configuration profile ${C(e)} initialized successfully!`),process.exit(0)}catch(e){e?.isTtyError?x.error(`Prompt couldn't be rendered in the current environment`):x.error(`Failed to initialize configuration profile: ${e}`),process.exit(1)}}};const $={pending:`○`,acceptRemote:`●`,acceptLocal:`◐`,acceptBoth:`◑`,current:`◉`,arrow:`→`,check:`✓`,cross:`✗`,warning:`⚠`};var Yp=class{constructor(e,t,n,r){this.conflicts=[],this.currentIndex=0,this.totalConflicts=0,this.currentCleanup=null,this.connectorId=t,this.localVersion=n,this.remoteVersion=r,this.conflicts=e.map(e=>({conflict:e,choice:e.type===`unchanged`?`remote`:`pending`})),this.totalConflicts=e.filter(e=>e.type===`conflict`).length}resetForReResolution(){this.currentIndex=0}async resolve(){return this.totalConflicts===0?{cancelled:!1,states:this.conflicts}:(this.moveToNextConflict(),new Promise(e=>{let t=De({input:process.stdin,output:process.stdout});process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume(),this.render();let n=n=>{let r=n.toString();if(r===``){this.cleanup(t),this.renderCancelled(),e({cancelled:!0,states:this.conflicts});return}if(r===`\x1B`&&n.length===1){this.cleanup(t),this.renderCancelled(),e({cancelled:!0,states:this.conflicts});return}if(r.startsWith(`\x1B[`)){switch(r.slice(2)){case`D`:this.moveToPrevConflict(),this.render();break;case`C`:this.moveToNextConflict(),this.render();break}return}switch(r){case`r`:case`R`:this.setCurrentChoice(`remote`),this.advanceAfterChoice(t);break;case`l`:case`L`:this.setCurrentChoice(`local`),this.advanceAfterChoice(t);break;case`b`:case`B`:this.setCurrentChoice(`both`),this.advanceAfterChoice(t);break;case`\r`:case`
47
+ `)}#t=e=>!e.includes(`/`)&&!e.includes(`\\`)&&!e.endsWith(`.yaml`)&&!e.endsWith(`.yml`)?e.includes(`@`)?e.split(`@`).length===2:!0:!1;#n=e=>e.includes(`@`)?e:`${e}@latest`;async#r(e,t,n,r){let i=d(`Getting connector ${C(e)} from registry...`).start();try{let a=Buffer.from(n).toString(`base64`),o=r?`?format=${r}`:``,s=await fetch(`${t}/registry/connectors/${e}${o}`,{method:`GET`,headers:{Authorization:`Basic ${a}`}});return i.stop(),s.ok||(await Ze(s,`Failed to get connector ${C(e)} from the registry`),process.exit(1)),await s.text()}catch(n){i.stop(),x.error(`Failed to get connector ${C(e)} from the registry: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}}async#i(e,t,n,r){let i=d(`Getting connector from account ${C(e)}...`).start();try{let a=Buffer.from(n).toString(`base64`),o=r?`?format=${r}`:``,s=await fetch(`${t}/accounts/${e}/connector${o}`,{method:`GET`,headers:{Authorization:`Basic ${a}`}});return i.stop(),s.ok||(await Ze(s,`Failed to get connector from account ${C(e)}`),process.exit(1)),await s.text()}catch(n){i.stop(),x.error(`Failed to get connector from account ${C(e)}: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}}};const qp=`http://localhost:4000`;var Jp=class{async execute({environment:e}={}){let n=e?.toLowerCase()??`production`;try{_e(`${t.inverse(` Initialize profile `)}`);let e=await Se({message:`Profile label`,validate:e=>{if(!e||e.trim().length===0)return`The profile label is required`;if(e.includes(` `))return`The profile label cannot contain spaces`}});if(ve(e))return he(`Configuration profile initialization cancelled`),process.exit(0);if(Tt(e)){let t=await ge({message:`Configuration profile with name ${C(e)} already exists. Do you want to overwrite it?`});if(ve(t)||!t)return he(`Configuration profile initialization cancelled`),process.exit(0)}let r;if(n===`production`)r=`https://api.stackone.com`;else if(n===`staging`)r=`https://api.stackone-dev.com`;else{let e=await Se({message:`API URL`,placeholder:qp,initialValue:qp,validate:e=>{if(!e||e.trim().length===0)return`API URL is required`;try{new URL(e)}catch{return`Please enter a valid URL`}}});if(ve(e))return he(`Configuration profile initialization cancelled`),process.exit(0);r=e}let i=await be({message:`API Key`,validate:e=>{if(!e||e.trim().length===0)return`API Key is required`}});if(ve(i))return he(`Configuration profile initialization cancelled`),process.exit(0);Et(e,{label:e,environment:n,apiUrl:r,apiKey:i}),ye(`${t.green(`✔`)} Configuration profile ${C(e)} initialized successfully!`),process.exit(0)}catch(e){e?.isTtyError?x.error(`Prompt couldn't be rendered in the current environment`):x.error(`Failed to initialize configuration profile: ${e}`),process.exit(1)}}};const $={pending:`○`,acceptRemote:`●`,acceptLocal:`◐`,acceptBoth:`◑`,current:`◉`,arrow:`→`,check:`✓`,cross:`✗`,warning:`⚠`};var Yp=class{constructor(e,t,n,r){this.conflicts=[],this.currentIndex=0,this.totalConflicts=0,this.currentCleanup=null,this.connectorId=t,this.localVersion=n,this.remoteVersion=r,this.conflicts=e.map(e=>({conflict:e,choice:e.type===`unchanged`?`remote`:`pending`})),this.totalConflicts=e.filter(e=>e.type===`conflict`).length}resetForReResolution(){this.currentIndex=0}async resolve(){return this.totalConflicts===0?{cancelled:!1,states:this.conflicts}:(this.moveToNextConflict(),new Promise(e=>{let t=De({input:process.stdin,output:process.stdout});process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume(),this.render();let n=n=>{let r=n.toString();if(r===``){this.cleanup(t),this.renderCancelled(),e({cancelled:!0,states:this.conflicts});return}if(r===`\x1B`&&n.length===1){this.cleanup(t),this.renderCancelled(),e({cancelled:!0,states:this.conflicts});return}if(r.startsWith(`\x1B[`)){switch(r.slice(2)){case`D`:this.moveToPrevConflict(),this.render();break;case`C`:this.moveToNextConflict(),this.render();break}return}switch(r){case`r`:case`R`:this.setCurrentChoice(`remote`),this.advanceAfterChoice(t);break;case`l`:case`L`:this.setCurrentChoice(`local`),this.advanceAfterChoice(t);break;case`b`:case`B`:this.setCurrentChoice(`both`),this.advanceAfterChoice(t);break;case`\r`:case`
48
48
  `:this.allResolved()?(this.cleanup(t),e({cancelled:!1,states:this.conflicts})):(this.moveToNextUnresolved(),this.render());break;case`q`:case`Q`:this.cleanup(t),this.renderCancelled(),e({cancelled:!0,states:this.conflicts});break;case`a`:case`A`:this.acceptAllRemaining(`remote`),this.render();break;case`u`:case`U`:this.setCurrentChoice(`pending`),this.render();break}};process.stdin.on(`data`,n),this.currentCleanup=()=>{process.stdin.removeListener(`data`,n),process.stdin.isTTY&&process.stdin.setRawMode(!1),t.close()}}))}cleanup(e){this.currentCleanup?(this.currentCleanup(),this.currentCleanup=null):(process.stdin.isTTY&&process.stdin.setRawMode(!1),e.close())}advanceAfterChoice(e){this.allResolved()||this.moveToNextUnresolved(),this.render()}render(){et();let e=process.stdout.columns||80;this.renderHeader(e),this.renderProgressBar(e),this.renderCurrentConflict(e),this.renderControls(e)}renderHeader(e){let n=this.connectorId,r=`${this.localVersion} ${$.arrow} ${this.remoteVersion}`,i=Math.max(0,e-17),a=Math.floor(i/2),o=i-a,s=` `.repeat(a)+`CONFLICT RESOLVER`+` `.repeat(o);x.log(``),x.log(t.bgBlue.white.bold(s)),x.log(t.gray(this.centerText(n,e))),x.log(t.gray(this.centerText(r,e))),x.log(``)}renderProgressBar(e){let n=this.conflicts.filter(e=>e.conflict.type===`conflict`),r=this.getCurrentConflictIndex(),i=n.map((e,n)=>{let i=n===r,a,o;switch(e.choice){case`remote`:a=i?$.current:$.acceptRemote,o=t.green;break;case`local`:a=i?$.current:$.acceptLocal,o=t.yellow;break;case`both`:a=i?$.current:$.acceptBoth,o=t.cyan;break;default:a=i?$.current:$.pending,o=i?t.white:t.gray}return o(a)}),a=n.filter(e=>e.choice!==`pending`).length,o=` Conflict ${r+1} of ${this.totalConflicts} • ${a}/${this.totalConflicts} resolved `;x.log(t.gray(this.centerText(o,e))),x.log(this.centerText(i.join(` `),e)),x.log(``)}renderCurrentConflict(e){let n=this.conflicts[this.currentIndex];if(!n||n.conflict.type!==`conflict`)return;let r=n.conflict;if(x.log(t.gray(`_`.repeat(e))),x.log(`
49
49
 
50
50
  `),r.local){let e=n.choice===`local`||n.choice===`both`?t.yellow.bold(`${$.check} LOCAL (keeping)`):t.red.bold(`${$.cross} LOCAL (removing)`),i=r.local.split(`
@@ -60,7 +60,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
60
60
  `),x.log(t.gray(`_`.repeat(e))),x.log(``)}renderControls(e){let n=[t.green(`[R] Accept Remote`),t.yellow(`[L] Keep Local`),t.cyan(`[B] Keep Both`),t.gray(`[U] Undo`)],r=[t.gray(`[←/→] Navigate`),t.gray(`[A] Accept all remaining`)],i=this.allResolved()?[t.green.bold(`[Enter] Apply Changes`),t.gray(`[Esc] Cancel`)]:[t.gray(`[Enter] Next Unresolved`),t.gray(`[Esc] Cancel`)];x.log(this.centerText(n.join(` `),e)),x.log(``),x.log(this.centerText(r.join(` `),e)),x.log(``),x.log(this.centerText(i.join(` `),e)),this.allResolved()&&(x.log(``),x.log(t.green.bold(this.centerText(`✓ All conflicts resolved!`,e))))}renderFinalSummary(){et();let e=this.conflicts.filter(e=>e.conflict.type===`conflict`),n=0,r=0,i=0;for(let t of e)switch(t.choice){case`remote`:n++;break;case`local`:r++;break;case`both`:i++;break}let a=[t.green.bold(`Conflict resolution complete`),``,`${t.bold(this.totalConflicts)} conflicts resolved:`,``,`${t.green($.acceptRemote)} Accepted remote: ${n}`,`${t.yellow($.acceptLocal)} Kept local: ${r}`,`${t.cyan($.acceptBoth)} Kept both: ${i}`];x.box(a.join(`
61
61
  `))}renderCancelled(){et(),x.log(t.yellow(`Conflict resolution cancelled`)),x.log(``),x.log(`No changes were made to your local connector file.`)}getCurrentConflictIndex(){let e=-1;for(let t=0;t<=this.currentIndex&&t<this.conflicts.length;t++)this.conflicts[t].conflict.type===`conflict`&&e++;return e}moveToNextConflict(){for(let e=this.currentIndex+1;e<this.conflicts.length;e++)if(this.conflicts[e].conflict.type===`conflict`){this.currentIndex=e;return}for(let e=0;e<this.currentIndex;e++)if(this.conflicts[e].conflict.type===`conflict`){this.currentIndex=e;return}}moveToPrevConflict(){for(let e=this.currentIndex-1;e>=0;e--)if(this.conflicts[e].conflict.type===`conflict`){this.currentIndex=e;return}for(let e=this.conflicts.length-1;e>this.currentIndex;e--)if(this.conflicts[e].conflict.type===`conflict`){this.currentIndex=e;return}}moveToNextUnresolved(){for(let e=this.currentIndex+1;e<this.conflicts.length;e++)if(this.conflicts[e].conflict.type===`conflict`&&this.conflicts[e].choice===`pending`){this.currentIndex=e;return}for(let e=0;e<this.currentIndex;e++)if(this.conflicts[e].conflict.type===`conflict`&&this.conflicts[e].choice===`pending`){this.currentIndex=e;return}}setCurrentChoice(e){this.conflicts[this.currentIndex]?.conflict.type===`conflict`&&(this.conflicts[this.currentIndex].choice=e)}allResolved(){return this.conflicts.filter(e=>e.conflict.type===`conflict`).every(e=>e.choice!==`pending`)}acceptAllRemaining(e){for(let t of this.conflicts)t.conflict.type===`conflict`&&t.choice===`pending`&&(t.choice=e)}centerText(e,t){let n=this.stripAnsi(e),r=Math.max(0,Math.floor((t-n.length)/2));return` `.repeat(r)+e}stripAnsi(e){return e.replace(/\x1b\[[0-9;]*m/g,``)}getResolvedContent(){let e=[];for(let t of this.conflicts)if(t.conflict.type===`unchanged`)e.push(t.conflict.content||``);else if(t.conflict.type===`conflict`)switch(t.choice){case`remote`:t.conflict.remote&&e.push(t.conflict.remote);break;case`local`:t.conflict.local&&e.push(t.conflict.local);break;case`both`:t.conflict.local&&e.push(t.conflict.local),t.conflict.remote&&e.push(t.conflict.remote);break;case`pending`:t.conflict.remote&&e.push(t.conflict.remote);break}return e.join(``)}};const Xp=`https://api.stackone.com`;var Zp=class{async execute({profile:e,connector:n,outputPath:r,apiUrl:i,apiKey:a}={}){if(P(n)&&(x.error(`Connector identifier is required`),x.log(`Please provide a connector identifier using the ${C(`--connector`)} option in the format: ${C(`provider_key@version`)} or ${C(`provider_key`)}`),x.log(`If no version is specified, the latest version will be pulled.`),process.exit(1)),!e&&!a&&(x.error(`Profile or API key is required`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`To create a profile, run ${C(`stackone init`)}.`),process.exit(1)),e&&a&&(x.error(`Please provide either a profile or an API key, not both`),process.exit(1)),e&&i&&x.warn(`Specifying ${C(`--api-url`)} with a profile won't have any effect. Using API url from profile.`),e&&!Tt(e)){x.error(`Configuration profile ${C(e)} not found`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.\n`);let n=Dt();n.length>0&&(x.info(`Available configuration profiles:`),n.forEach(e=>{x.log(` - ${t.blue(e)}`)})),process.exit(1)}let o=e?wt(e):{apiUrl:i??Xp,apiKey:a};o?.apiKey||(x.error(`API key is missing`),x.log(`Please provide a valid API key in the profile or via the ${C(`--api-key`)} option.`),process.exit(1));let s=o.apiUrl??Xp,[c,l]=n.split(`@`),u=await this.#f(c,s,o.apiKey,l??`latest`),d=this.#e(u),f=d.version??`unknown`,p=this.#t(r,d.key,f),m=this.#r(p),ee=m===null,h=u;if(!ee){let e=this.#i(m,p);e&&(x.warn(e.message),e.errors.length>0&&S(e.errors,!1),x.log(``));let t=e?void 0:this.#e(m);if(this.#o(m,u)){this.#a(m,u,p);let e=t?.version??`unknown`,r=await this.#s(m,u,n,e,f);r.action===`cancel`&&(he(`Pull cancelled`),process.exit(0)),r.action===`keep-local`&&(x.log(``),x.info(`Keeping local version. No changes made.`),process.exit(0)),r.action===`interactive-cancel`&&process.exit(0),r.action===`interactive`&&(h=r.resolvedContent)}else x.info(`No changes detected in connector configuration.`),process.exit(0)}let te=Te(h).connector,g=te?.key??d.key,ne=te?.version??f,_=this.#t(r,g,ne),v=_;if(_!==p){let e=await this.#n(_);x.log(``),e!==void 0&&(v=e)}await this.#d(v,h),ee?x.success(`Connector ${C(g)}@${C(ne)} pulled successfully (new connector)`):x.success(`Connector ${C(g)}@${C(ne)} updated successfully`);let re=g===d.key?C(g):`${C(d.key)} ${t.whiteBright(`→`)} ${C(g)}`,ie=ne===f?C(ne):`${C(f)} ${t.whiteBright(`→`)} ${C(ne)}`,y=v===p?C(v):`${C(p)}\n ${t.whiteBright(`→`)} ${C(v)}`;x.log(`\n${t.blue.inverse(` CONNECTOR DETAILS `)}\n`),x.log(` Provider: ${re}`),x.log(` Version: ${ie}`),x.log(` Output file: ${y}`),process.exit(0)}#e(e){let t=Te(e),n=t?.errors??[];if(t.success)return t.connector;x.error(`Connector pulled from the registry is not valid`),x.log(`Please make sure you are using the latest version of the StackOne CLI by running ${C(`stackone update`)}`),n.length>0&&S(n,!0),process.exit(1)}#t(e,t,n){let r=`${t}_v${n.replaceAll(`.`,`-`)}.s1.yaml`;return e?(f.existsSync(e)&&(f.statSync(e).isDirectory()||(x.error(`Output path ${C(e)} is not a directory`),x.log(`Please provide a valid directory path to store connectors or use the default path.`),process.exit(1))),v.resolve(e,t,r)):v.resolve(process.cwd(),`connectors`,t,r)}async#n(e){if(!f.existsSync(e))return;let t=v.basename(e),n=v.dirname(e);x.warn(`File ${C(t)} already exists at ${C(n)}`);let r=await xe({message:`How would you like to proceed?`,options:[{value:`override`,label:`Override existing file`,hint:`Replace the existing file with the new content`},{value:`rename`,label:`Save with a different name`,hint:`Provide a new filename for the connector`},{value:`cancel`,label:`Cancel`,hint:`Abort the pull operation`}]});if((ve(r)||r===`cancel`)&&(he(`Operation cancelled. No local changes were made.`),process.exit(0)),r===`override`)return;let i=await Se({message:`Enter the new filename:`,placeholder:t,validate:e=>{if(!e||e.trim()===``)return`Filename cannot be empty`;if(!e.endsWith(`.s1.yaml`))return`Filename must end with .s1.yaml`;let t=v.join(n,e.trim());if(f.existsSync(t))return`File ${e} already exists`}});return ve(i)&&(he(`Operation cancelled. No local changes were made.`),process.exit(0)),v.join(n,i.trim())}#r(e){if(!f.existsSync(e))return null;try{return f.readFileSync(e,`utf-8`)}catch{return null}}#i(e,t){try{let n=Te(e);if(!n.success){let e=n.errors??[];return{message:`Local connector ${C(v.basename(t))} has validation errors:`,errors:e}}}catch(e){return{message:`Local connector ${C(v.basename(t))} could not be validated: ${e.message}`,errors:[]}}return null}#a(e,n,r){let i=Ee(e,n);if(!i.some(e=>e.added||e.removed)){x.info(`No changes detected in connector configuration.`);return}x.log(`${t.blue.inverse(` CHANGES `)}\n`),x.log(t.gray(`--- local: ${r}`)),x.log(t.gray(`+++ remote: StackOne Registry`)),x.log(``);let a=0,o=0;for(let e of i){let n=e.value.split(`
62
62
  `).filter(e=>e!==``);if(e.added){a+=n.length;for(let e of n)x.log(t.green(`+ ${e}`))}else if(e.removed){o+=n.length;for(let e of n)x.log(t.red(`- ${e}`))}else if(n.length<=6)for(let e of n)x.log(t.gray(` ${e}`));else{for(let e=0;e<3;e++)x.log(t.gray(` ${n[e]}`));x.log(t.gray(` ... (${n.length-6} unchanged lines)`));for(let e=n.length-3;e<n.length;e++)x.log(t.gray(` ${n[e]}`))}}x.log(``),x.log(t.gray(`Summary: ${t.green(`+${a}`)} additions, ${t.red(`-${o}`)} deletions`))}#o(e,t){return Ee(e,t).some(e=>e.added||e.removed)}async#s(e,t,n,r,i){x.log(``);let a=await xe({message:`How would you like to resolve the differences?`,options:[{value:`override`,label:`Override local with remote`,hint:`Replace your local file with the StackOne version`},{value:`keep-local`,label:`Keep local version`,hint:`Cancel the pull and keep your current file`},{value:`interactive`,label:`Resolve conflicts interactively`,hint:`Choose which changes to accept one by one`},{value:`cancel`,label:`Cancel`,hint:`Abort the pull operation`}]});if(ve(a))return{action:`cancel`};if(a===`override`)return{action:`override`};if(a===`keep-local`)return{action:`keep-local`};if(a===`interactive`){let a=await this.#c(e,t,n,r,i);return a===null?{action:`interactive-cancel`}:{action:`interactive`,resolvedContent:a}}return{action:`cancel`}}async#c(e,t,n,r,i){let a=Ee(e,t),o=this.#u(a);if(o.length===0)return x.info(`No conflicts to resolve.`),t;let s=new Yp(o,n,r,i);for(;;){if((await s.resolve()).cancelled)return null;let e=s.getResolvedContent(),t=Te(e);if(t.success)return s.renderFinalSummary(),e;let n=await this.#l(t.errors);if(n===`cancel`)return et(),x.info(`Operation cancelled. No changes were made to the local connector.`),null;if(n===`save`)return et(),x.warn(`The connector was saved but it is invalid`),e;s.resetForReResolution()}}async#l(e){let{createInterface:n}=await import(`readline`);return new Promise(r=>{et();let i=(e||[{message:`Unknown validation error`}]).map(e=>` • ${e.message}`).join(`
63
- `);x.box({title:`⚠️ Validation Failed`,message:`The resolved connector configuration is invalid:\n\n${i}`,style:{borderColor:`yellow`,padding:1}}),x.log(``),x.log(t.bold(` Choose an action:`)),x.log(``),x.log(t.cyan(` [B]`)+` ← Go back to conflict resolution`),x.log(t.dim(` Modify your choices to fix the validation errors`)),x.log(``),x.log(t.yellow(` [S]`)+` 💾 Save anyway`),x.log(t.dim(` Save the invalid configuration (not recommended)`)),x.log(``),x.log(t.red(` [C]`)+` ✖ Cancel`),x.log(t.dim(` Discard all changes`)),x.log(``);let a=n({input:process.stdin,output:process.stdout});process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume();let o=e=>{let t=e.toString().toLowerCase(),n=()=>{process.stdin.removeListener(`data`,o),process.stdin.isTTY&&process.stdin.setRawMode(!1),a.close()};if(t===``||t===`\x1B`){n(),r(`cancel`);return}switch(t){case`b`:n(),r(`back`);break;case`s`:n(),r(`save`);break;case`c`:case`q`:n(),r(`cancel`);break}};process.stdin.on(`data`,o)})}#u(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!r.added&&!r.removed)t.push({type:`unchanged`,content:r.value}),n++;else if(r.removed){let i=e[n+1];i?.added?(t.push({type:`conflict`,local:r.value,remote:i.value}),n+=2):(t.push({type:`conflict`,local:r.value,remote:void 0}),n++)}else r.added&&t.push({type:`conflict`,local:void 0,remote:r.value}),n++}return t}async#d(e,t){let n=v.dirname(e);f.existsSync(n)||f.mkdirSync(n,{recursive:!0});try{f.writeFileSync(e,t,`utf-8`)}catch(t){x.error(`Failed to write connector to file ${C(e)}: ${t.message}`),process.exit(1)}}async#f(e,t,n,r){let i=d(`Pulling connector ${C(e)}@${C(r)} from registry...`).start();try{let a=Buffer.from(n).toString(`base64`),o=`${t}/registry/connectors/${e}@${r}`,s=await fetch(o,{method:`GET`,headers:{Authorization:`Basic ${a}`}});return i.stop(),s.ok||(await this.#p(s,e,r),process.exit(1)),await s.text()}catch(n){i.stop(),x.error(`Failed to pull connector ${C(e)}@${C(r)} from the registry: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid.`),process.exit(1)}}async#p(e,t,n){switch(e.status){case 401:case 403:x.error(`Access denied`),x.log(`Please ensure that your API key is valid and has the ${C(`connectors:read`)} scope required to pull connectors.`);break;case 404:x.error(`Connector ${C(t)}@${C(n)} was not found in the registry`),await this.#m(t);break;case 429:x.error(`Rate limit exceeded`),x.log(`Too many requests. Please wait a moment before trying again.`);break;default:await Ze(e,`Failed to pull connector ${C(t)}`)}}async#m(e){x.info(`To see available versions, check the connector documentation or contact support.`)}};const Qp=`https://api.stackone.com`;var $p=class{async execute({profile:e,fileOrDir:n,apiUrl:r,apiKey:i}={}){if(!e&&!i&&(x.error(`Profile or API key is required`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`To create a profile, run ${C(`stackone init`)}.`),process.exit(1)),e&&i&&(x.error(`Please provide either a profile or an API key, not both`),process.exit(1)),e&&r&&x.warn(`Specifying ${C(`--api-url`)} with a profile won't have any effect. Using API url from profile.`),e&&!Tt(e)){x.error(`Configuration profile ${C(e)} not found`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.\n`);let n=Dt();n.length>0&&(x.info(`Available configuration profiles:`),n.forEach(e=>{x.log(` - ${t.blue(e)}`)})),process.exit(1)}let a=e?wt(e):{apiUrl:r??Qp,apiKey:i};a?.apiKey||(x.error(`API key is missing`),x.log(`Please provide a valid API key in the profile or via the ${C(`--api-key`)} option.`),process.exit(1)),n||(x.error(`File or directory is required.`),process.exit(1));try{g(n)}catch{x.error(`File or directory not found: ${t.red(n)}`),process.exit(1)}let o=g(n),s=a.apiUrl??Qp;if(o.isDirectory()){let e=tm(n),r=0;e.length===0?(x.error(`No .s1.yaml connector files found in the directory: ${n}.`),process.exit(1)):(x.start(`Found ${e.length} connector(s) file(s). Pushing to registry...`),x.log(``));for(let t of e)await this.uploadFile(t,s,a.apiKey)&&r++;r===0?x.error(`Error while pushing connectors: no files were uploaded`):(x.log(``),x.info(`Upload completed: ${t.green(r)} of ${t.blue(e.length)} file(s) uploaded successfully.`)),process.exit(r>0?0:1)}else n.endsWith(`.s1.yaml`)||(x.error(`Only ${C(`.s1.yaml`)} files are supported for upload`),process.exit(1));let c=await this.uploadFile(n,s,a.apiKey);process.exit(c?0:1)}async uploadFile(e,t,n){let r=d(`📤 Pushing connector in ${re(e)}...`).start();try{let i=em(e);if(!i)return!1;let a=re(e),o=new FormData,s=new Blob([i],{type:`application/x-yaml`});o.append(`file`,s,a);let c=Buffer.from(n).toString(`base64`),l=await fetch(`${t}/registry/connectors`,{method:`POST`,headers:{Authorization:`Basic ${c}`},body:o});if(r.stop(),!l.ok)return await Ze(l,`Failed to push connector in ${C(a)} to the registry`),!1;let u=await l.json();return x.success(`Successfully uploaded ${C(a)} with connector ${C(u.provider)}@${C(u.version)}`),!0}catch(n){return r.stop(),x.error(`Failed to upload file ${C(e)}: ${n}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),!1}}};const em=e=>{let t=Ce(e),n=Te(t),r=n?.errors??[];if(n.success)return t;r.length>0?(x.error(`Connector in ${$e(e)} is not valid`),S(r,!0)):x.error(`Connector in ${$e(e)} is not valid. Please check the file for errors.`)},tm=e=>{let t=[],n=h(e,{withFileTypes:!0});for(let r of n){let n=y(e,r.name);r.isDirectory()?t.push(...tm(n)):r.name.endsWith(`.s1.yaml`)&&t.push(n)}return t},nm=Q.object({provider_key:Q.string().optional(),provider_version:Q.string().optional(),auth_config_key:Q.string(),environment:Q.string().default(`production`),organization_id:Q.string().default(`cli-organization-id`),account_id:Q.string().default(`cli-account-secure-id`),project_id:Q.string().default(`cli-project-secure-id`),credentials:Q.record(Q.string(),Q.any()).default({})}),rm=Q.record(Q.string(),Q.any()),im=Q.object({path:Q.record(Q.string(),Q.any()).default({}),queryParams:Q.record(Q.string(),Q.any()).default({}),header:Q.record(Q.string(),Q.any()).default({}),body:Q.record(Q.string(),Q.any()).default({})}),am=`https://api.stackone.com`;var om=class{async execute({connector:e,action:n,actionId:r,account:i,accountId:a,params:o,credentials:s,profile:c,outputFile:l,debug:u,apiUrl:d,apiKey:p}={}){if(!c&&!p&&a&&(x.error(`Profile or API key is required when providing an account ID`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`To create a profile, run ${C(`stackone init`)}.`),process.exit(1)),c&&p&&(x.error(`Please provide either a profile or an API key, not both`),process.exit(1)),c&&d&&x.warn(`Specifying --api-url with a profile won't have any effect. Using API url from profile.`),c&&!Tt(c)){x.error(`Configuration profile ${C(c)} not found`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.\n`);let e=Dt();e.length>0&&(x.info(`Available configuration profiles:`),e.forEach(e=>{x.log(` - ${t.blue(e)}`)})),process.exit(1)}let m=c?wt(c):{apiUrl:d??am,apiKey:p};P(i)&&P(a)&&(x.error(`A valid account or account ID is required to run an action`),process.exit(1));let ee;N(e)?this.#a(e)?(!c&&!p&&(x.error(`Profile or API key is required when using a connector identifier (provider_key@version)`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.`),process.exit(1)),ee=await this.#o(e,m?.apiUrl??am,m?.apiKey)):ee=this.#e(e):N(a)&&(ee=await this.#s(a,m?.apiUrl??am,m?.apiKey));let h=N(n)?this.#r(n,e):ee;P(h)&&(x.error(`A valid connector is required to run an action.`),process.exit(1));let te=N(h?.actions)?Object.keys(h?.actions).length:0,g=N(h?.actions)?Object.keys(h.actions)[te-1]:void 0,ne=N(g)?h?.actions?.[g]?.id:void 0,_=(N(r)&&!r?.startsWith(`${h.key}_`)?`${h.key}_${r}`:r)??ne;P(_)&&(x.error(`A valid action ID is required to run an action`),process.exit(1));let v=N(a)?await this.#c(a,m?.apiUrl??am,m?.apiKey):{},re=N(i)?this.#i(i,h.key??`unknown`,h.version??`unknown`):void 0,ie=N(s)?this.#l(s):{},y={...v,...re,credentials:{...v.credentials??{},...ie}};P(y)&&(x.error(`A valid account data is required to run an action.`),process.exit(1));let ae=h.actions?.[_];P(ae)&&(x.error(`Action ID ${C(_)} not found in the connector ${C(h.key)}@${C(h.version)}.`),process.exit(1));let oe=N(o)?this.#u(o,_):{path:{},queryParams:{},header:{},body:{}},b=Date.now(),se=await this.#d({connector:h,actionId:_,account:y,queryParams:{...oe.queryParams,...u?{debug:`true`}:{}},pathParams:oe.path,body:oe.body,headers:oe.header}),ce=Date.now()-b;if(N(l))try{f.writeFileSync(l,JSON.stringify(se.output,null,2),`utf-8`),x.info(`Output written to file: ${l}`)}catch(e){x.error(`Failed to write output to file ${l}: ${e.message}`),process.exit(1)}else x.log(`\n${t.blue.inverse(` ACTION OUTPUT `)}`),Xe(se.output);x.log(``),x.info(`Action ${C(_)} from connector ${C(h?.key)}@${C(h?.version)} finished in ${t.yellowBright((ce/1e3).toFixed(2))} seconds.`),process.exit(0)}#e=e=>{let t=e;try{t=Ce(e)}catch{}return t?this.#n(t):void 0};#t=e=>{try{return Ce(e)}catch(t){x.error(`Failed to load connector file from ${C(e)}: ${t.message}`),process.exit(1)}};#n=e=>{let t=Te(e),n=t?.errors??[];if(t.success)return t.connector||(x.error(`Failed to load connector.`),process.exit(1)),t.connector;n.length>0?(x.error(`Connector is not valid`),S(n,!0),process.exit(1)):(x.error(`Connector is not valid. Please check the file for errors.`),process.exit(1))};#r=(e,t)=>{let n=e;try{n=f.readFileSync(e,`utf-8`)}catch{}P(t)&&(x.error(`A valid connector is required to load an action.`),process.exit(1));let r=`${this.#t(t)} - ${n.split(`
63
+ `);x.box({title:`⚠️ Validation Failed`,message:`The resolved connector configuration is invalid:\n\n${i}`,style:{borderColor:`yellow`,padding:1}}),x.log(``),x.log(t.bold(` Choose an action:`)),x.log(``),x.log(t.cyan(` [B]`)+` ← Go back to conflict resolution`),x.log(t.dim(` Modify your choices to fix the validation errors`)),x.log(``),x.log(t.yellow(` [S]`)+` 💾 Save anyway`),x.log(t.dim(` Save the invalid configuration (not recommended)`)),x.log(``),x.log(t.red(` [C]`)+` ✖ Cancel`),x.log(t.dim(` Discard all changes`)),x.log(``);let a=n({input:process.stdin,output:process.stdout});process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume();let o=e=>{let t=e.toString().toLowerCase(),n=()=>{process.stdin.removeListener(`data`,o),process.stdin.isTTY&&process.stdin.setRawMode(!1),a.close()};if(t===``||t===`\x1B`){n(),r(`cancel`);return}switch(t){case`b`:n(),r(`back`);break;case`s`:n(),r(`save`);break;case`c`:case`q`:n(),r(`cancel`);break}};process.stdin.on(`data`,o)})}#u(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!r.added&&!r.removed)t.push({type:`unchanged`,content:r.value}),n++;else if(r.removed){let i=e[n+1];i?.added?(t.push({type:`conflict`,local:r.value,remote:i.value}),n+=2):(t.push({type:`conflict`,local:r.value,remote:void 0}),n++)}else r.added&&t.push({type:`conflict`,local:void 0,remote:r.value}),n++}return t}async#d(e,t){let n=v.dirname(e);f.existsSync(n)||f.mkdirSync(n,{recursive:!0});try{f.writeFileSync(e,t,`utf-8`)}catch(t){x.error(`Failed to write connector to file ${C(e)}: ${t.message}`),process.exit(1)}}async#f(e,t,n,r){let i=d(`Pulling connector ${C(e)}@${C(r)} from registry...`).start();try{let a=Buffer.from(n).toString(`base64`),o=`${t}/registry/connectors/${e}@${r}`,s=await fetch(o,{method:`GET`,headers:{Authorization:`Basic ${a}`}});return i.stop(),s.ok||(await this.#p(s,e,r),process.exit(1)),await s.text()}catch(n){i.stop(),x.error(`Failed to pull connector ${C(e)}@${C(r)} from the registry: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid.`),process.exit(1)}}async#p(e,t,n){switch(e.status){case 401:case 403:x.error(`Access denied`),x.log(`Please ensure that your API key is valid and has the ${C(`connectors:read`)} scope required to pull connectors.`);break;case 404:x.error(`Connector ${C(t)}@${C(n)} was not found in the registry`),await this.#m(t);break;case 429:x.error(`Rate limit exceeded`),x.log(`Too many requests. Please wait a moment before trying again.`);break;default:await Ze(e,`Failed to pull connector ${C(t)}`)}}async#m(e){x.info(`To see available versions, check the connector documentation or contact support.`)}};const Qp=`https://api.stackone.com`;var $p=class{async execute({profile:e,fileOrDir:n,apiUrl:r,apiKey:i}={}){if(!e&&!i&&(x.error(`Profile or API key is required`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`To create a profile, run ${C(`stackone init`)}.`),process.exit(1)),e&&i&&(x.error(`Please provide either a profile or an API key, not both`),process.exit(1)),e&&r&&x.warn(`Specifying ${C(`--api-url`)} with a profile won't have any effect. Using API url from profile.`),e&&!Tt(e)){x.error(`Configuration profile ${C(e)} not found`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.\n`);let n=Dt();n.length>0&&(x.info(`Available configuration profiles:`),n.forEach(e=>{x.log(` - ${t.blue(e)}`)})),process.exit(1)}let a=e?wt(e):{apiUrl:r??Qp,apiKey:i};a?.apiKey||(x.error(`API key is missing`),x.log(`Please provide a valid API key in the profile or via the ${C(`--api-key`)} option.`),process.exit(1)),n||(x.error(`File or directory is required.`),process.exit(1));try{g(n)}catch{x.error(`File or directory not found: ${t.red(n)}`),process.exit(1)}let o=g(n),s=a.apiUrl??Qp;if(o.isDirectory()){let e=tm(n),r=0;e.length===0?(x.error(`No .s1.yaml connector files found in the directory: ${n}.`),process.exit(1)):(x.start(`Found ${e.length} connector(s) file(s). Pushing to registry...`),x.log(``));for(let t of e)await this.uploadFile(t,s,a.apiKey)&&r++;r===0?x.error(`Error while pushing connectors: no files were uploaded`):(x.log(``),x.info(`Upload completed: ${t.green(r)} of ${t.blue(e.length)} file(s) uploaded successfully.`)),process.exit(r>0?0:1)}else n.endsWith(`.s1.yaml`)||(x.error(`Only ${C(`.s1.yaml`)} files are supported for upload`),process.exit(1));let c=await this.uploadFile(n,s,a.apiKey);process.exit(c?0:1)}async uploadFile(e,t,n){let r=d(`📤 Pushing connector in ${re(e)}...`).start();try{let i=em(e);if(!i)return!1;let a=re(e),o=new FormData,s=new Blob([i],{type:`application/x-yaml`});o.append(`file`,s,a);let c=Buffer.from(n).toString(`base64`),l=await fetch(`${t}/registry/connectors`,{method:`POST`,headers:{Authorization:`Basic ${c}`},body:o});if(r.stop(),!l.ok)return await Ze(l,`Failed to push connector in ${C(a)} to the registry`),!1;let u=await l.json();return x.success(`Successfully uploaded ${C(a)} with connector ${C(u.provider)}@${C(u.version)}`),!0}catch(n){return r.stop(),x.error(`Failed to upload file ${C(e)}: ${n}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),!1}}};const em=e=>{let t=Ce(e),n=Te(t),r=n?.errors??[];if(n.success)return t;r.length>0?(x.error(`Connector in ${$e(e)} is not valid`),S(r,!0)):x.error(`Connector in ${$e(e)} is not valid. Please check the file for errors.`)},tm=e=>{let t=[],n=h(e,{withFileTypes:!0});for(let r of n){let n=y(e,r.name);r.isDirectory()?t.push(...tm(n)):r.name.endsWith(`.s1.yaml`)&&t.push(n)}return t},nm=Q.object({provider_key:Q.string().optional(),provider_version:Q.string().optional(),auth_config_key:Q.string(),environment:Q.string().default(`production`),organization_id:Q.string().default(`cli-organization-id`),account_id:Q.string().default(`cli-account-secure-id`),project_id:Q.string().default(`cli-project-secure-id`),credentials:Q.record(Q.string(),Q.any()).default({})}),rm=Q.record(Q.string(),Q.any()),im=Q.object({path:Q.record(Q.string(),Q.any()).default({}),queryParams:Q.record(Q.string(),Q.any()).default({}),header:Q.record(Q.string(),Q.any()).default({}),body:Q.record(Q.string(),Q.any()).default({})}),am=`https://api.stackone.com`;var om=class{async execute({connector:e,action:n,actionId:r,account:i,accountId:a,params:o,credentials:s,profile:c,outputFile:l,debug:u,apiUrl:d,apiKey:p}={}){if(!c&&!p&&a&&(x.error(`Profile or API key is required when providing an account ID`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`To create a profile, run ${C(`stackone init`)}.`),process.exit(1)),c&&p&&(x.error(`Please provide either a profile or an API key, not both`),process.exit(1)),c&&d&&x.warn(`Specifying --api-url with a profile won't have any effect. Using API url from profile.`),c&&!Tt(c)){x.error(`Configuration profile ${C(c)} not found`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.\n`);let e=Dt();e.length>0&&(x.info(`Available configuration profiles:`),e.forEach(e=>{x.log(` - ${t.blue(e)}`)})),process.exit(1)}let m=c?wt(c):{apiUrl:d??am,apiKey:p};P(i)&&P(a)&&(x.error(`A valid account or account ID is required to run an action`),process.exit(1));let ee;if(N(e))if(this.#a(e)){!c&&!p&&(x.error(`Profile or API key is required when using a connector identifier`),x.log(`Please provide a profile using the ${C(`--profile`)} option or an API key using the ${C(`--api-key`)} option.`),x.log(`Run ${C(`stackone init`)} to create a new configuration profile.`),process.exit(1));let t=this.#o(e);ee=await this.#s(t,m?.apiUrl??am,m?.apiKey)}else ee=this.#e(e);else N(a)&&(ee=await this.#c(a,m?.apiUrl??am,m?.apiKey));let h=N(n)?this.#r(n,e):ee;P(h)&&(x.error(`A valid connector is required to run an action.`),process.exit(1));let te=N(h?.actions)?Object.keys(h?.actions).length:0,g=N(h?.actions)?Object.keys(h.actions)[te-1]:void 0,ne=N(g)?h?.actions?.[g]?.id:void 0,_=(N(r)&&!r?.startsWith(`${h.key}_`)?`${h.key}_${r}`:r)??ne;P(_)&&(x.error(`A valid action ID is required to run an action`),process.exit(1));let v=N(a)?await this.#l(a,m?.apiUrl??am,m?.apiKey):{},re=N(i)?this.#i(i,h.key??`unknown`,h.version??`unknown`):void 0,ie=N(s)?this.#u(s):{},y={...v,...re,credentials:{...v.credentials??{},...ie}};P(y)&&(x.error(`A valid account data is required to run an action.`),process.exit(1));let ae=h.actions?.[_];P(ae)&&(x.error(`Action ID ${C(_)} not found in the connector ${C(h.key)}@${C(h.version)}.`),process.exit(1));let oe=N(o)?this.#d(o,_):{path:{},queryParams:{},header:{},body:{}},b=Date.now(),se=await this.#f({connector:h,actionId:_,account:y,queryParams:{...oe.queryParams,...u?{debug:`true`}:{}},pathParams:oe.path,body:oe.body,headers:oe.header}),ce=Date.now()-b;if(N(l))try{f.writeFileSync(l,JSON.stringify(se.output,null,2),`utf-8`),x.info(`Output written to file: ${l}`)}catch(e){x.error(`Failed to write output to file ${l}: ${e.message}`),process.exit(1)}else x.log(`\n${t.blue.inverse(` ACTION OUTPUT `)}`),Xe(se.output);x.log(``),x.info(`Action ${C(_)} from connector ${C(h?.key)}@${C(h?.version)} finished in ${t.yellowBright((ce/1e3).toFixed(2))} seconds.`),process.exit(0)}#e=e=>{let t=e;try{t=Ce(e)}catch{}return t?this.#n(t):void 0};#t=e=>{try{return Ce(e)}catch(t){x.error(`Failed to load connector file from ${C(e)}: ${t.message}`),process.exit(1)}};#n=e=>{let t=Te(e),n=t?.errors??[];if(t.success)return t.connector||(x.error(`Failed to load connector.`),process.exit(1)),t.connector;n.length>0?(x.error(`Connector is not valid`),S(n,!0),process.exit(1)):(x.error(`Connector is not valid. Please check the file for errors.`),process.exit(1))};#r=(e,t)=>{let n=e;try{n=f.readFileSync(e,`utf-8`)}catch{}P(t)&&(x.error(`A valid connector is required to load an action.`),process.exit(1));let r=`${this.#t(t)} - ${n.split(`
64
64
  `).map((e,t)=>t===0?e:` ${e}`).join(`
65
- `)}`;return this.#n(r)};#i=(e,t,n)=>{let r=e;try{r=f.readFileSync(e,`utf-8`)}catch{}try{let e=nm.parse(JSON.parse(r));return{providerKey:t,providerVersion:n,authConfigKey:e.auth_config_key,environment:e.environment,organizationId:e.organization_id,secureId:e.account_id,projectSecureId:e.project_id}}catch(e){let t=[];try{t=JSON.parse(e.message)}catch{}x.error(`Failed to parse account information`),S(t,!1),t.length===0&&x.log(e.message),process.exit(1)}};#a=e=>e.includes(`@`)&&e.split(`@`).length===2&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.endsWith(`.yaml`)&&!e.endsWith(`.yml`);#o=async(e,t,n)=>{(P(e)||P(t)||P(n))&&(x.error(`Connector identifier, API URL, and API key are required to fetch connector from registry.`),process.exit(1));let r=d();try{r.text=`Fetching connector ${C(e)} from registry...`,r.start();let i=Buffer.from(n).toString(`base64`),a=await fetch(`${t}/registry/connectors/${e}`,{method:`GET`,headers:{Authorization:`Basic ${i}`}});r.stop(),a.ok||(await Ze(a,`Failed to fetch connector ${C(e)} from registry`),process.exit(1));let o=await a.text(),s=this.#n(o);return x.success(`Fetched connector ${C(s.key)}@${C(s.version)} from registry`),s}catch(n){r.stop(),x.error(`Failed to fetch connector ${C(e)} from registry: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}};#s=async(e,t,n)=>{(P(e)||P(t)||P(n))&&(x.error(`Account ID, API URL, and API key are required to fetch connector`),process.exit(1));let r=d();try{r.text=`Fetching connector for account ${C(e)} from API...`,r.start();let i=Buffer.from(n).toString(`base64`),a=await fetch(`${t}/accounts/${e}/connector`,{method:`GET`,headers:{Authorization:`Basic ${i}`}});r.stop(),a.ok||(await Ze(a,`Failed to fetch connector`),process.exit(1));let o=await a.text(),s=this.#n(o);return x.success(`Fetched connector ${C(s.key)}@${C(s.version)} for account ${C(e)}`),s}catch(e){r.stop(),x.error(`Failed to fetch connector: ${e.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}};#c=async(e,t,n)=>{(P(e)||P(t)||P(n))&&(x.error(`Account ID, API URL, and API key are required to fetch account information.`),process.exit(1));let r=d();try{r.text=`Fetching account ${C(e)} information from API...`,r.start();let i=Buffer.from(n).toString(`base64`),a=await fetch(`${t}/accounts/${e}/credentials`,{method:`GET`,headers:{Authorization:`Basic ${i}`}});r.stop(),a.ok||(await Ze(a,`Failed to fetch account ${C(e)} information`),process.exit(1));let o=await a.json();return x.success(`Fetched account ${C(e)} information from project ${C(o.project_id)}`),{providerKey:o.provider_key,providerVersion:o.provider_version,authConfigKey:o.auth_config_key,environment:o.environment,organizationId:o.organization_id,secureId:o.account_id,projectSecureId:o.project_id,credentials:o.credentials}}catch(n){r.stop(),x.error(`Failed to fetch account ${C(e)} information: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}};#l=e=>{let t=e;try{t=f.readFileSync(e,`utf-8`)}catch{}try{return rm.parse(JSON.parse(t))}catch(e){let t=[];try{t=JSON.parse(e.message)}catch{}x.error(`Failed to parse credentials`),S(t,!1),t.length===0&&x.log(e.message),process.exit(1)}};#u=(e,t)=>{let n=e;try{n=f.readFileSync(e,`utf-8`)}catch{}try{return im.parse(JSON.parse(n))}catch(e){let n=[];try{n=JSON.parse(e.message)}catch{}x.error(`Invalid parameters for action ${C(t)}.`),S(n,!1),n.length===0&&x.log(e.message),process.exit(1)}};async#d({connector:e,actionId:n,account:r,pathParams:i={},queryParams:a={},body:o={},headers:s={}}){try{let c=await we({mode:`action_id`,actionId:n,account:r,connector:e,pathParams:i,queryParams:a,body:o,headers:s,getHttpClient:async()=>new Oe});if(c.response?.successful){let e={...this.#f(a,c.steps),...Kn(c.outputs)?c.outputs:{data:c.outputs}};return{statusCode:c.response?.statusCode,output:e}}else{let r=c.response?.message??`An error occurred while processing the request`;x.error(`Action ID ${C(n)} from connector ${C(e.key)}@${C(e.version)} failed with status ${c.response?.statusCode}: ${r}`);let i={...this.#f(a,c.steps)};Object.keys(i).length>0&&(x.log(`${t.yellow.inverse(` EXECUTION DETAILS `)}`),Xe(i)),process.exit(1)}}catch(e){this.#p(e)}}#f(e,t){return e?.debug===`true`?{debug:{steps:t}}:{}}#p(e){let t=e;switch(P(t.errorType)&&(x.error(`An unknown error occurred`),x.log(`${e instanceof Error?e.message:String(e)}`),process.exit(1)),t.errorType){case`MISSING_ACTION_ERROR`:x.error(`The specified action was not found: ${t.message}`);break;case`INVALID_ACTION_INPUTS_ERROR`:let e=t;x.error(`Invalid action inputs`),S(e.validationErrors,!1);break;case`INVALID_CURSOR_ERROR`:x.error(`Invalid cursor: ${t.message}`);break;default:x.error(`An error occurred: ${t.message}`)}process.exit(1)}};const sm=()=>{try{let e=y(ie(Pe(import.meta.url)),`..`,`package.json`);return JSON.parse(ee(e,`utf8`)).version}catch{return`unknown`}},cm=u(i);var lm=class{constructor(){this.packageName=`@stackone/cli`,this.spinner=d(),this.currentVersion=sm()}async execute(e={}){this.spinner.text=`Checking for updates...`,this.spinner.start();try{let n=await this.getLatestVersion();this.spinner.stop(),n||(x.error(`Failed to check for updates`),process.exit(1)),this.isNewerVersion(n,this.currentVersion)?(x.box(`New version available: ${t.yellow(this.currentVersion)} → ${t.green(n)}`),await this.performUpdate(n)):e.force?(x.warn(`No updates available, but forcing reinstall...`),await this.performUpdate(n)):x.success(`You are already on the latest version (${this.currentVersion})`),process.exit(0)}catch(e){this.spinner.stop(),x.error(`Error while trying to update StackOne CLI: ${e?.message??`Unknown error`}`),process.exit(1)}}async getLatestVersion(){try{let{stdout:e}=await cm(`npm view ${this.packageName} version`,{encoding:`utf-8`});return e.trim()}catch{return null}}isNewerVersion(e,t){return Ne.gt(e,t)}isUsingVolta(){if(typeof process.env.VOLTA_HOME!=`string`||process.env.VOLTA_HOME.length===0)return!1;let e=l(process.env.VOLTA_HOME,`bin`),t=l(e,`stackone`),n=l(e,`stackone.exe`);return ke(t)||ke(n)}async performUpdate(e){let t=this.isUsingVolta();this.spinner.text=`Updating to latest version (${C(e)})...`,this.spinner.start();try{await cm(t?`volta install ${this.packageName}@latest`:`npm install -g ${this.packageName}@latest`,{encoding:`utf-8`}),this.spinner.stop(),x.success(`StackOne CLI updated successfully to latest version (${C(e)})`)}catch{this.spinner.stop();let e=t?`volta install ${this.packageName}@latest`:`npm install -g ${this.packageName}@latest`;throw Error(`Failed to install update. Please try manually: ${e}`)}}};const um=()=>{x.log(`${t.gray.inverse(` CONNECTORS VALIDATION `)} ${t.yellow.inverse(` WATCH MODE `)}\n`)};var dm=class{async execute(e){let{watchMode:n,fileOrDir:r}=e,i=d(`Watching for file changes... ${t.gray(`(press "q" to quit)`)}`);if(!r)return;let a=ae(r);try{await Ie(a)}catch{x.error(`The specified path does not exist: ${a}\n`),process.exit(1)}if(n){et();let e={},{watch:n}=await import(`chokidar`),r=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout});process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding(`utf8`);let o=()=>{c.close(),i.stop(),r.close(),x.log(t.grey(`
66
- Exiting watch mode...`)),process.exit(0)};um(),x.start(`Validating connectors...`);let s=await hm(a);e=fm(e,s||{}),pm(e,a),i.start();let c=n(a,{persistent:!0,ignoreInitial:!0}),l=async n=>{if(!n.endsWith(`.s1.yaml`)&&!n.endsWith(`s1.partial.yaml`))return;let r=n.endsWith(`s1.partial.yaml`)?await _m(n):[n];if(!(!r||r.length===0)){et(),i.stop(),um(),x.log(t.gray(`File change detected: ${n}`)),x.start(`Validating connectors...`);for(let t of r){let n=await hm(t);e=fm(e,n||{})}pm(e,a),i.start()}};c.on(`change`,async e=>await l(e)),process.stdin.on(`data`,e=>{e.toString()===`q`&&o()}),process.on(`SIGINT`,()=>{o()})}else await hm(a,x),process.exit(0)}};const fm=(e,t)=>{for(let[n,r]of Object.entries(t))e[n]=r;return e},pm=(e,n)=>{et(),um();let r=0,i=0;for(let[t,n]of Object.entries(e))n===null?r++:(x?.error(`Connector ${C(t)} is not valid`),S(n,!0),i++);x.log(``),x.log(t.blue.inverse(` Validation Summary `)),x.log(`Connectors path: ${C(n)}`),x.log(`${r===0?t.red(`0`):t.green(r)} valid, ${i===0?t.green(`0`):t.red(i)} invalid connectors\n`)},mm=async e=>{let t=[],n=await Fe(e);for(let r of n){let n=y(e,r),i=await Ie(n);i.isDirectory()?t.push(...await mm(n)):i.isFile()&&r.endsWith(`.s1.yaml`)&&t.push(n)}return t},hm=async(e,n)=>{let r=await Ie(e),i={};if(r.isDirectory()){let r=await mm(e);if(r.length===0)return n?.error(`No StackOne connector found in ${$e(e)}`),n?.log(`Connector files need to have the extension ${C(`*.s1.yaml`)}`),null;let a=0,o=0;for(let e of r){let t=await gm(e,n);t===null?a++:(n?.log(``),o++),i[e]=t}return n?.log(``),n?.log(t.blue.inverse(` Validation Summary `)),n?.log(`${a===0?t.red(`0`):t.green(a)} valid, ${o===0?t.green(`0`):t.red(o)} invalid connectors`),i}else if(r.isFile()&&e.endsWith(`s1.yaml`))return i[e]=await gm(e,n),i;else if(r.isFile()&&e.endsWith(`partial.yaml`)){n?.error(`Partial connector files cannot be validated directly`),n?.log(`The file ${$e(e)} is a partial connector file.`);let t=await _m(e);return t&&t?.length>0&&n?.log(`Did you mean ${C(t[0])}?`),null}else return n?.error(`No StackOne connector found in ${$e(e)}`),n?.log(`Connector files need to have the extension ${C(`*.s1.yaml`)}`),null},gm=async(e,t)=>{let n=Te(Ce(e)),r=n?.errors??[];if(n.success){let n=e.split(`/`).pop()||e;return t?.success(`Connector ${C(n)} is valid!`),null}else if(r.length>0)return t?.error(`Connector ${C(e)} is not valid`),t&&S(r,!0),r;else return t?.error(`Connector ${C(e)} is not valid. Please check the file for errors`),[]},_m=async e=>{let t=ie(e);try{return(await Fe(t)).filter(e=>e.endsWith(`.s1.yaml`))?.map(e=>y(t,e))}catch{}},vm=l(Le(),`.stackone`),ym=l(vm,`version-check.json`),bm=(e=!1)=>{let t=wm(),n=Date.now();if(e||!t||n-t.lastCheckTime>1728e5){let e=xm();e&&Sm(e)&&Cm(e),Tm({lastCheckTime:n})}},xm=()=>{try{return a(`npm view @stackone/cli version`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`],timeout:15e3}).trim()}catch{return null}},Sm=e=>{try{let t=sm();return Ne.gt(e,t)}catch{return!1}},Cm=e=>{let n=sm(),r=`Update available: ${t.dim(n)} → ${t.green(e)}`,i=`\n\nRun ${t.cyan(`stackone update`)} to update`;x.box(r,i)},wm=()=>{try{if(!ke(ym))return null;let e=je(ym,`utf-8`);return JSON.parse(e)}catch{return null}},Tm=e=>{try{ke(vm)||Ae(vm,{recursive:!0}),Me(ym,JSON.stringify(e,null,2),`utf-8`)}catch{}};var Em=class{constructor(e=new r,t=sm()){this.program=e,this.version=t,this.setupProgram(),this.registerCommands()}setupProgram(){this.program.name(`stackone`).description(`StackOne CLI`).version(this.version,`-v, --version`)}registerCommands(){let e=new Jp,r=new $p,i=new Zp,a=new kt,o=new Kp,s=new dm,c=new _t,l=new xt,u=new pt,d=new om,f=new lm;this.program.configureOutput({writeOut:e=>process.stdout.write(e),writeErr:e=>process.stderr.write(e),outputError:(e,n)=>{n(t.red(e))}}),this.program.command(`init`).option(`-e, --env <environment>`,`Specify the environment for the configuration profile`).description(`Initialize & create a StackOne CLI configuration profile`).action(t=>{e.execute({environment:t.env})}),this.program.command(`push`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).addArgument(new n(`<path>`,`Connector file or directory to push`)).description(`Push a connector to the StackOne registry`).action((e,t)=>{r.execute({profile:t.profile,fileOrDir:e,apiUrl:t.apiUrl,apiKey:t.apiKey})}),this.program.command(`drop`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).addArgument(new n(`<connector>`,`Connector identifier in format provider_key@version`)).description(`Drop a connector from the StackOne registry`).action((e,t)=>{a.execute({profile:t.profile,connector:e,apiUrl:t.apiUrl,apiKey:t.apiKey})}),this.program.command(`get`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).option(`-c, --connector <connector>`,`Connector identifier in format provider_key@version`).option(`--account-id <account-id>`,`Account ID to fetch connector from`).option(`-f, --format <format>`,`Output format: yaml or json (default: yaml)`,`yaml`).option(`-o, --output-file <output-file>`,`File to write the output to`).description(`Get a connector from the StackOne registry`).action(e=>{o.execute({profile:e.profile,connector:e.connector,accountId:e.accountId,format:e.format,outputFile:e.outputFile,apiUrl:e.apiUrl,apiKey:e.apiKey})}),this.program.command(`pull`).option(`-c, --connector <connector>`,`Connector identifier in format provider_key@version or provider_key`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).option(`-o, --output <path>`,`Output directory for the connectors files (default: ./connectors)`).description(`Pull a connector configuration from StackOne registry to local filesystem`).action(e=>{i.execute({profile:e.profile,connector:e.connector,outputPath:e.output,apiUrl:e.apiUrl,apiKey:e.apiKey})}),this.program.command(`validate`).option(`-w, --watch`,`Run in watch mode`).addArgument(new n(`<path>`,`Connector file or directory with connectors to validate`)).description(`Validate a StackOne connector`).action((e,t)=>{s.execute({watchMode:t.watch,fileOrDir:e})}),this.program.command(`run`).option(`--connector <connector>`,`Connector file to run (optional when using --account-id)`).option(`--action <action>`,`Action to execute on the connector (path to file or inline string action code)`).option(`--action-id <action-id>`,`Action ID to execute on the connector`).option(`--account <account>`,`Account details to use for running the connector (path to file or inline string account data)`).option(`--account-id <account-id>`,`Account ID to use for running the connector against (fetches connector from API if --connector not provided)`).option(`--params <params>`,`Action parameters (path to file or inline string with JSON parameters)`).option(`--credentials <credentials>`,`Credentials to use (path to file or inline string with JSON credentials)`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).option(`-o, --output-file <output-file>`,`File to write the output to`).option(`-d, --debug`,`Enables debug mode to include more details in the action execution output`).description(`Run a connector action`).action(e=>{d.execute({connector:e.connector,action:e.action,actionId:e.actionId,account:e.account,accountId:e.accountId,params:e.params,credentials:e.credentials,profile:e.profile,outputFile:e.outputFile,debug:e.debug,apiUrl:e.apiUrl,apiKey:e.apiKey})});let p=this.program.command(`agent`).description(`StackOne agent commands`);p.command(`setup`).option(`-g, --global`,`Setup global configuration`).option(`-l, --local`,`Setup local project configuration`).description(`Setup StackOne agent (global or local)`).action(e=>{e.global?c.execute():l.execute()}),p.command(`cleanup`).description(`Remove all API keys and credentials from configurations`).action(()=>{u.execute()}),this.program.command(`update`).option(`-f, --force`,`Force reinstall even if already on latest version`).description(`Update the CLI to the latest version`).action(e=>{f.execute({force:e.force})}),this.program.command(`version`).description(`Show version information`).action(async()=>{x.log(`${t.inverse.greenBright(`StackOne`)} ${t.grey(`CLI`)} ${t.whiteBright(this.version)}`),bm(!0),process.exit(0)})}run(){process.argv.includes(`version`)||bm(),this.program.parse(process.argv)}};export{Em as t};
65
+ `)}`;return this.#n(r)};#i=(e,t,n)=>{let r=e;try{r=f.readFileSync(e,`utf-8`)}catch{}try{let e=nm.parse(JSON.parse(r));return{providerKey:t,providerVersion:n,authConfigKey:e.auth_config_key,environment:e.environment,organizationId:e.organization_id,secureId:e.account_id,projectSecureId:e.project_id}}catch(e){let t=[];try{t=JSON.parse(e.message)}catch{}x.error(`Failed to parse account information`),S(t,!1),t.length===0&&x.log(e.message),process.exit(1)}};#a=e=>!e.includes(`/`)&&!e.includes(`\\`)&&!e.endsWith(`.yaml`)&&!e.endsWith(`.yml`)?e.includes(`@`)?e.split(`@`).length===2:!0:!1;#o=e=>e.includes(`@`)?e:`${e}@latest`;#s=async(e,t,n)=>{(P(e)||P(t)||P(n))&&(x.error(`Connector identifier, API URL, and API key are required to fetch connector from registry.`),process.exit(1));let r=d();try{r.text=`Fetching connector ${C(e)} from registry...`,r.start();let i=Buffer.from(n).toString(`base64`),a=await fetch(`${t}/registry/connectors/${e}`,{method:`GET`,headers:{Authorization:`Basic ${i}`}});r.stop(),a.ok||(await Ze(a,`Failed to fetch connector ${C(e)} from registry`),process.exit(1));let o=await a.text(),s=this.#n(o);return x.success(`Fetched connector ${C(s.key)}@${C(s.version)} from registry`),s}catch(n){r.stop(),x.error(`Failed to fetch connector ${C(e)} from registry: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}};#c=async(e,t,n)=>{(P(e)||P(t)||P(n))&&(x.error(`Account ID, API URL, and API key are required to fetch connector`),process.exit(1));let r=d();try{r.text=`Fetching connector for account ${C(e)} from API...`,r.start();let i=Buffer.from(n).toString(`base64`),a=await fetch(`${t}/accounts/${e}/connector`,{method:`GET`,headers:{Authorization:`Basic ${i}`}});r.stop(),a.ok||(await Ze(a,`Failed to fetch connector`),process.exit(1));let o=await a.text(),s=this.#n(o);return x.success(`Fetched connector ${C(s.key)}@${C(s.version)} for account ${C(e)}`),s}catch(e){r.stop(),x.error(`Failed to fetch connector: ${e.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}};#l=async(e,t,n)=>{(P(e)||P(t)||P(n))&&(x.error(`Account ID, API URL, and API key are required to fetch account information.`),process.exit(1));let r=d();try{r.text=`Fetching account ${C(e)} information from API...`,r.start();let i=Buffer.from(n).toString(`base64`),a=await fetch(`${t}/accounts/${e}/credentials`,{method:`GET`,headers:{Authorization:`Basic ${i}`}});r.stop(),a.ok||(await Ze(a,`Failed to fetch account ${C(e)} information`),process.exit(1));let o=await a.json();return x.success(`Fetched account ${C(e)} information from project ${C(o.project_id)}`),{providerKey:o.provider_key,providerVersion:o.provider_version,authConfigKey:o.auth_config_key,environment:o.environment,organizationId:o.organization_id,secureId:o.account_id,projectSecureId:o.project_id,credentials:o.credentials}}catch(n){r.stop(),x.error(`Failed to fetch account ${C(e)} information: ${n.message}`),x.log(`Please ensure that the API at ${Qe(t)} is reachable and the API key is valid`),process.exit(1)}};#u=e=>{let t=e;try{t=f.readFileSync(e,`utf-8`)}catch{}try{return rm.parse(JSON.parse(t))}catch(e){let t=[];try{t=JSON.parse(e.message)}catch{}x.error(`Failed to parse credentials`),S(t,!1),t.length===0&&x.log(e.message),process.exit(1)}};#d=(e,t)=>{let n=e;try{n=f.readFileSync(e,`utf-8`)}catch{}try{return im.parse(JSON.parse(n))}catch(e){let n=[];try{n=JSON.parse(e.message)}catch{}x.error(`Invalid parameters for action ${C(t)}.`),S(n,!1),n.length===0&&x.log(e.message),process.exit(1)}};async#f({connector:e,actionId:n,account:r,pathParams:i={},queryParams:a={},body:o={},headers:s={}}){try{let c=await we({mode:`action_id`,actionId:n,account:r,connector:e,pathParams:i,queryParams:a,body:o,headers:s,getHttpClient:async()=>new Oe});if(c.response?.successful){let e={...this.#p(a,c.steps),...Kn(c.outputs)?c.outputs:{data:c.outputs}};return{statusCode:c.response?.statusCode,output:e}}else{let r=c.response?.message??`An error occurred while processing the request`;x.error(`Action ID ${C(n)} from connector ${C(e.key)}@${C(e.version)} failed with status ${c.response?.statusCode}: ${r}`);let i={...this.#p(a,c.steps)};Object.keys(i).length>0&&(x.log(`${t.yellow.inverse(` EXECUTION DETAILS `)}`),Xe(i)),process.exit(1)}}catch(e){this.#m(e)}}#p(e,t){return e?.debug===`true`?{debug:{steps:t}}:{}}#m(e){let t=e;switch(P(t.errorType)&&(x.error(`An unknown error occurred`),x.log(`${e instanceof Error?e.message:String(e)}`),process.exit(1)),t.errorType){case`MISSING_ACTION_ERROR`:x.error(`The specified action was not found: ${t.message}`);break;case`INVALID_ACTION_INPUTS_ERROR`:let e=t;x.error(`Invalid action inputs`),S(e.validationErrors,!1);break;case`INVALID_CURSOR_ERROR`:x.error(`Invalid cursor: ${t.message}`);break;default:x.error(`An error occurred: ${t.message}`)}process.exit(1)}};const sm=()=>{try{let e=y(ie(Pe(import.meta.url)),`..`,`package.json`);return JSON.parse(ee(e,`utf8`)).version}catch{return`unknown`}},cm=u(i);var lm=class{constructor(){this.packageName=`@stackone/cli`,this.spinner=d(),this.currentVersion=sm()}async execute(e={}){this.spinner.text=`Checking for updates...`,this.spinner.start();try{let n=await this.getLatestVersion();this.spinner.stop(),n||(x.error(`Failed to check for updates`),process.exit(1)),this.isNewerVersion(n,this.currentVersion)?(x.box(`New version available: ${t.yellow(this.currentVersion)} → ${t.green(n)}`),await this.performUpdate(n)):e.force?(x.warn(`No updates available, but forcing reinstall...`),await this.performUpdate(n)):x.success(`You are already on the latest version (${this.currentVersion})`),process.exit(0)}catch(e){this.spinner.stop(),x.error(`Error while trying to update StackOne CLI: ${e?.message??`Unknown error`}`),process.exit(1)}}async getLatestVersion(){try{let{stdout:e}=await cm(`npm view ${this.packageName} version`,{encoding:`utf-8`});return e.trim()}catch{return null}}isNewerVersion(e,t){return Ne.gt(e,t)}isUsingVolta(){if(typeof process.env.VOLTA_HOME!=`string`||process.env.VOLTA_HOME.length===0)return!1;let e=l(process.env.VOLTA_HOME,`bin`),t=l(e,`stackone`),n=l(e,`stackone.exe`);return ke(t)||ke(n)}async performUpdate(e){let t=this.isUsingVolta();this.spinner.text=`Updating to latest version (${C(e)})...`,this.spinner.start();try{await cm(t?`volta install ${this.packageName}@latest`:`npm install -g ${this.packageName}@latest`,{encoding:`utf-8`}),this.spinner.stop(),x.success(`StackOne CLI updated successfully to latest version (${C(e)})`)}catch{this.spinner.stop();let e=t?`volta install ${this.packageName}@latest`:`npm install -g ${this.packageName}@latest`;throw Error(`Failed to install update. Please try manually: ${e}`)}}};const um=()=>{x.log(`${t.gray.inverse(` CONNECTORS VALIDATION `)} ${t.yellow.inverse(` WATCH MODE `)}\n`)};var dm=class{async execute(e){let{watchMode:n,fileOrDir:r}=e,i=d(`Watching for file changes... ${t.gray(`(press "q" to quit)`)}`);if(!r)return;let a=ae(r);try{await Ie(a)}catch{x.error(`The specified path does not exist: ${a}\n`),process.exit(1)}if(n){et();let e={},{watch:n}=await import(`chokidar`),r=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout});process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding(`utf8`);let o=()=>{c.close(),i.stop(),r.close(),x.log(t.grey(`
66
+ Exiting watch mode...`)),process.exit(0)};um(),x.start(`Validating connectors...`);let s=await hm(a);e=fm(e,s||{}),pm(e,a),i.start();let c=n(a,{persistent:!0,ignoreInitial:!0}),l=async n=>{if(!n.endsWith(`.s1.yaml`)&&!n.endsWith(`s1.partial.yaml`))return;let r=n.endsWith(`s1.partial.yaml`)?await _m(n):[n];if(!(!r||r.length===0)){et(),i.stop(),um(),x.log(t.gray(`File change detected: ${n}`)),x.start(`Validating connectors...`);for(let t of r){let n=await hm(t);e=fm(e,n||{})}pm(e,a),i.start()}};c.on(`change`,async e=>await l(e)),process.stdin.on(`data`,e=>{e.toString()===`q`&&o()}),process.on(`SIGINT`,()=>{o()})}else await hm(a,x),process.exit(0)}};const fm=(e,t)=>{for(let[n,r]of Object.entries(t))e[n]=r;return e},pm=(e,n)=>{et(),um();let r=0,i=0;for(let[t,n]of Object.entries(e))n===null?r++:(x?.error(`Connector ${C(t)} is not valid`),S(n,!0),i++);x.log(``),x.log(t.blue.inverse(` Validation Summary `)),x.log(`Connectors path: ${C(n)}`),x.log(`${r===0?t.red(`0`):t.green(r)} valid, ${i===0?t.green(`0`):t.red(i)} invalid connectors\n`)},mm=async e=>{let t=[],n=await Fe(e);for(let r of n){let n=y(e,r),i=await Ie(n);i.isDirectory()?t.push(...await mm(n)):i.isFile()&&r.endsWith(`.s1.yaml`)&&t.push(n)}return t},hm=async(e,n)=>{let r=await Ie(e),i={};if(r.isDirectory()){let r=await mm(e);if(r.length===0)return n?.error(`No StackOne connector found in ${$e(e)}`),n?.log(`Connector files need to have the extension ${C(`*.s1.yaml`)}`),null;let a=0,o=0;for(let e of r){let t=await gm(e,n);t===null?a++:(n?.log(``),o++),i[e]=t}return n?.log(``),n?.log(t.blue.inverse(` Validation Summary `)),n?.log(`${a===0?t.red(`0`):t.green(a)} valid, ${o===0?t.green(`0`):t.red(o)} invalid connectors`),i}else if(r.isFile()&&e.endsWith(`s1.yaml`))return i[e]=await gm(e,n),i;else if(r.isFile()&&e.endsWith(`partial.yaml`)){n?.error(`Partial connector files cannot be validated directly`),n?.log(`The file ${$e(e)} is a partial connector file.`);let t=await _m(e);return t&&t?.length>0&&n?.log(`Did you mean ${C(t[0])}?`),null}else return n?.error(`No StackOne connector found in ${$e(e)}`),n?.log(`Connector files need to have the extension ${C(`*.s1.yaml`)}`),null},gm=async(e,t)=>{let n=Te(Ce(e)),r=n?.errors??[];if(n.success){let n=e.split(`/`).pop()||e;return t?.success(`Connector ${C(n)} is valid!`),null}else if(r.length>0)return t?.error(`Connector ${C(e)} is not valid`),t&&S(r,!0),r;else return t?.error(`Connector ${C(e)} is not valid. Please check the file for errors`),[]},_m=async e=>{let t=ie(e);try{return(await Fe(t)).filter(e=>e.endsWith(`.s1.yaml`))?.map(e=>y(t,e))}catch{}},vm=l(Le(),`.stackone`),ym=l(vm,`version-check.json`),bm=(e=!1)=>{let t=wm(),n=Date.now();if(e||!t||n-t.lastCheckTime>1728e5){let e=xm();e&&Sm(e)&&Cm(e),Tm({lastCheckTime:n})}},xm=()=>{try{return a(`npm view @stackone/cli version`,{encoding:`utf-8`,stdio:[`pipe`,`pipe`,`pipe`],timeout:15e3}).trim()}catch{return null}},Sm=e=>{try{let t=sm();return Ne.gt(e,t)}catch{return!1}},Cm=e=>{let n=sm(),r=`Update available: ${t.dim(n)} → ${t.green(e)}`,i=`\n\nRun ${t.cyan(`stackone update`)} to update`;x.box(r,i)},wm=()=>{try{if(!ke(ym))return null;let e=je(ym,`utf-8`);return JSON.parse(e)}catch{return null}},Tm=e=>{try{ke(vm)||Ae(vm,{recursive:!0}),Me(ym,JSON.stringify(e,null,2),`utf-8`)}catch{}};var Em=class{constructor(e=new r,t=sm()){this.program=e,this.version=t,this.setupProgram(),this.registerCommands()}setupProgram(){this.program.name(`stackone`).description(`StackOne CLI`).version(this.version,`-v, --version`)}registerCommands(){let e=new Jp,r=new $p,i=new Zp,a=new kt,o=new Kp,s=new dm,c=new _t,l=new xt,u=new pt,d=new om,f=new lm;this.program.configureOutput({writeOut:e=>process.stdout.write(e),writeErr:e=>process.stderr.write(e),outputError:(e,n)=>{n(t.red(e))}}),this.program.command(`init`).option(`-e, --env <environment>`,`Specify the environment for the configuration profile`).description(`Initialize & create a StackOne CLI configuration profile`).action(t=>{e.execute({environment:t.env})}),this.program.command(`push`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).addArgument(new n(`<path>`,`Connector file or directory to push`)).description(`Push a connector to the StackOne registry`).action((e,t)=>{r.execute({profile:t.profile,fileOrDir:e,apiUrl:t.apiUrl,apiKey:t.apiKey})}),this.program.command(`drop`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).addArgument(new n(`<connector>`,`Connector identifier in format provider_key@version`)).description(`Drop a connector from the StackOne registry`).action((e,t)=>{a.execute({profile:t.profile,connector:e,apiUrl:t.apiUrl,apiKey:t.apiKey})}),this.program.command(`get`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).option(`-c, --connector <connector>`,`Connector identifier in format provider_key@version or provider_key (defaults to latest)`).option(`--account-id <account-id>`,`Account ID to fetch connector from`).option(`-f, --format <format>`,`Output format: yaml or json (default: yaml)`,`yaml`).option(`-o, --output-file <output-file>`,`File to write the output to`).description(`Get a connector from the StackOne registry`).action(e=>{o.execute({profile:e.profile,connector:e.connector,accountId:e.accountId,format:e.format,outputFile:e.outputFile,apiUrl:e.apiUrl,apiKey:e.apiKey})}),this.program.command(`pull`).option(`-c, --connector <connector>`,`Connector identifier in format provider_key@version or provider_key`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).option(`-o, --output <path>`,`Output directory for the connectors files (default: ./connectors)`).description(`Pull a connector configuration from StackOne registry to local filesystem`).action(e=>{i.execute({profile:e.profile,connector:e.connector,outputPath:e.output,apiUrl:e.apiUrl,apiKey:e.apiKey})}),this.program.command(`validate`).option(`-w, --watch`,`Run in watch mode`).addArgument(new n(`<path>`,`Connector file or directory with connectors to validate`)).description(`Validate a StackOne connector`).action((e,t)=>{s.execute({watchMode:t.watch,fileOrDir:e})}),this.program.command(`run`).option(`--connector <connector>`,`Connector file, inline YAML, or identifier (provider_key@version or provider_key for latest)`).option(`--action <action>`,`Action to execute on the connector (path to file or inline string action code)`).option(`--action-id <action-id>`,`Action ID to execute on the connector`).option(`--account <account>`,`Account details to use for running the connector (path to file or inline string account data)`).option(`--account-id <account-id>`,`Account ID to use for running the connector against (fetches connector from API if --connector not provided)`).option(`--params <params>`,`Action parameters (path to file or inline string with JSON parameters)`).option(`--credentials <credentials>`,`Credentials to use (path to file or inline string with JSON credentials)`).option(`-p, --profile <label>`,`Configuration profile to use`).option(`--api-url <api url>`,`API URL`).option(`--api-key <api key>`,`API Key`).option(`-o, --output-file <output-file>`,`File to write the output to`).option(`-d, --debug`,`Enables debug mode to include more details in the action execution output`).description(`Run a connector action`).action(e=>{d.execute({connector:e.connector,action:e.action,actionId:e.actionId,account:e.account,accountId:e.accountId,params:e.params,credentials:e.credentials,profile:e.profile,outputFile:e.outputFile,debug:e.debug,apiUrl:e.apiUrl,apiKey:e.apiKey})});let p=this.program.command(`agent`).description(`StackOne agent commands`);p.command(`setup`).option(`-g, --global`,`Setup global configuration`).option(`-l, --local`,`Setup local project configuration`).description(`Setup StackOne agent (global or local)`).action(e=>{e.global?c.execute():l.execute()}),p.command(`cleanup`).description(`Remove all API keys and credentials from configurations`).action(()=>{u.execute()}),this.program.command(`update`).option(`-f, --force`,`Force reinstall even if already on latest version`).description(`Update the CLI to the latest version`).action(e=>{f.execute({force:e.force})}),this.program.command(`version`).description(`Show version information`).action(async()=>{x.log(`${t.inverse.greenBright(`StackOne`)} ${t.grey(`CLI`)} ${t.whiteBright(this.version)}`),bm(!0),process.exit(0)})}run(){process.argv.includes(`version`)||bm(),this.program.parse(process.argv)}};export{Em as t};