@authhero/drizzle 0.52.3 → 0.52.4

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.
@@ -74,4 +74,4 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
74
74
 
75
75
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Fr,s=!ur.jitless,c=s&&Ir.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let ee=d.value;return o(ee)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Es([],ee,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:ee,inst:e}),d)}});function ks(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ni(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>oi(e,r,dr())))}),t)}var As=M(`$ZodUnion`,(e,t)=>{R.init(e,t),P(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),P(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),P(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),P(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=>Sr(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ks(t,r,e,i)):ks(o,r,e,i)}});function js(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>oi(e,r,dr())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}var Ms=M(`$ZodXor`,(e,t)=>{As.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>js(t,r,e,i)):js(o,r,e,i)}}),Ns=M(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,As.init(e,t);let n=e._zod.parse;P(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=br(()=>{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(!Fr(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||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Ps=M(`$ZodIntersection`,(e,t)=>{R.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])=>Is(e,t,n)):Is(e,i,a)}});function Fs(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Lr(e)&&Lr(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=Fs(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=Fs(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 Is(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),ni(e))return e;let o=Fs(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Ls=M(`$ZodTuple`,(e,t)=>{R.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Rs(n,`optin`),c=Rs(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>zs(t,r,e))):zs(a,r,e)}}return o.length?Promise.all(o).then(()=>Bs(l,r,n,a,c)):Bs(l,r,n,a,c)}});function Rs(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function zs(e,t,n){e.issues.length&&t.issues.push(...ii(n,e.issues)),t.value[n]=e.value}function Bs(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...ii(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Vs=M(`$ZodRecord`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Lr(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>oi(e,r,dr())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...ii(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...ii(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))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(typeof o==`string`&&La.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>oi(e,r,dr())),input:o,path:[o],inst:e});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(...ii(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...ii(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Hs=M(`$ZodMap`,(e,t)=>{R.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])=>{Us(t,a,n,o,i,e,r)})):Us(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function Us(e,t,n,r,i,a,o){e.issues.length&&(Vr.has(typeof r)?n.issues.push(...ii(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>oi(e,o,dr()))})),t.issues.length&&(Vr.has(typeof r)?n.issues.push(...ii(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>oi(e,o,dr()))})),n.value.set(e.value,t.value)}var Ws=M(`$ZodSet`,(e,t)=>{R.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=>Gs(e,n))):Gs(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function Gs(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Ks=M(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=vr(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Vr.has(typeof e)).map(e=>typeof e==`string`?Ur(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qs=M(`$ZodLiteral`,(e,t)=>{if(R.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ur(e):e?Ur(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Js=M(`$ZodFile`,(e,t)=>{R.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}}),Ys=M(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new lr(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new cr;return n.value=i,n.fallback=!0,n}});function Xs(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Zs=M(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,P(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),P(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Sr(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Xs(e,r)):Xs(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Qs=M(`$ZodExactOptional`,(e,t)=>{Zs.init(e,t),P(e._zod,`values`,()=>t.innerType._zod.values),P(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),$s=M(`$ZodNullable`,(e,t)=>{R.init(e,t),P(e._zod,`optin`,()=>t.innerType._zod.optin),P(e._zod,`optout`,()=>t.innerType._zod.optout),P(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Sr(e.source)}|null)$`):void 0}),P(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)}),ec=M(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,P(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(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=>tc(e,t)):tc(r,t)}});function tc(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var nc=M(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,P(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),rc=M(`$ZodNonOptional`,(e,t)=>{R.init(e,t),P(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=>ic(t,e)):ic(i,e)}});function ic(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var ac=M(`$ZodSuccess`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new lr(`ZodSuccess`);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)}}),oc=M(`$ZodCatch`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,P(e._zod,`optout`,()=>t.innerType._zod.optout),P(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(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=>oi(e,n,dr()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>oi(e,n,dr()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),sc=M(`$ZodNaN`,(e,t)=>{R.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)}),cc=M(`$ZodPipe`,(e,t)=>{R.init(e,t),P(e._zod,`values`,()=>t.in._zod.values),P(e._zod,`optin`,()=>t.in._zod.optin),P(e._zod,`optout`,()=>t.out._zod.optout),P(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>lc(e,t.in,n)):lc(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>lc(e,t.out,n)):lc(r,t.out,n)}});function lc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var uc=M(`$ZodCodec`,(e,t)=>{R.init(e,t),P(e._zod,`values`,()=>t.in._zod.values),P(e._zod,`optin`,()=>t.in._zod.optin),P(e._zod,`optout`,()=>t.out._zod.optout),P(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>dc(e,t,n)):dc(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>dc(e,t,n)):dc(r,t,n)}}});function dc(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>fc(e,r,t.out,n)):fc(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>fc(e,r,t.in,n)):fc(e,r,t.in,n)}}function fc(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var pc=M(`$ZodPreprocess`,(e,t)=>{cc.init(e,t)}),mc=M(`$ZodReadonly`,(e,t)=>{R.init(e,t),P(e._zod,`propValues`,()=>t.innerType._zod.propValues),P(e._zod,`values`,()=>t.innerType._zod.values),P(e._zod,`optin`,()=>t.innerType?._zod?.optin),P(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(hc):hc(r)}});function hc(e){return e.value=Object.freeze(e.value),e}var gc=M(`$ZodTemplateLiteral`,(e,t)=>{R.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){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(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Hr.has(typeof e))n.push(Ur(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),_c=M(`$ZodFunction`,(e,t)=>(R.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Di(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Di(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await ki(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await ki(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Ls({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),vc=M(`$ZodPromise`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),yc=M(`$ZodLazy`,(e,t)=>{R.init(e,t),P(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),P(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),P(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),P(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),P(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),bc=M(`$ZodCustom`,(e,t)=>{so.init(e,t),R.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=>xc(t,n,r,e));xc(i,n,r,e)}});function xc(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(li(e))}}var Sc=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n={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:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${I(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${N(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}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${N(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()}}var wc=()=>{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={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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${I(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${N(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ış ${n[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`:``}: ${N(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 Tc(){return{localeError:wc()}}function Ec(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}var Dc=()=>{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={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:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${I(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Ec(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=Ec(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}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Oc(){return{localeError:Dc()}}var kc=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={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:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${I(e.values[0])}`:`Невалидна опция: очаквано едно от ${N(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;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function Ac(){return{localeError:kc()}}var jc=()=>{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={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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${I(e.values[0])}`:`Opció invàlida: s'esperava una de ${N(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 ${n[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`:``}: ${N(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 Mc(){return{localeError:jc()}}var Nc=()=>{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={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`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${I(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${N(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 ${n[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: ${N(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 Pc(){return{localeError:Nc()}}var Fc=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${I(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function Ic(){return{localeError:Fc()}}var Lc=()=>{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={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`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${I(e.values[0])}`:`Ungültige Option: erwartet eine von ${N(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: ${n[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`}: ${N(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 Rc(){return{localeError:Lc()}}var zc=()=>{let e={string:{unit:`χαρακτήρες`,verb:`να έχει`},file:{unit:`bytes`,verb:`να έχει`},array:{unit:`στοιχεία`,verb:`να έχει`},set:{unit:`στοιχεία`,verb:`να έχει`},map:{unit:`καταχωρήσεις`,verb:`να έχει`}};function t(t){return e[t]??null}let n={regex:`είσοδος`,email:`διεύθυνση 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`,mac:`διεύθυνση MAC`,cidrv4:`εύρος IPv4`,cidrv6:`εύρος IPv6`,base64:`συμβολοσειρά κωδικοποιημένη σε base64`,base64url:`συμβολοσειρά κωδικοποιημένη σε base64url`,json_string:`συμβολοσειρά JSON`,e164:`αριθμός E.164`,jwt:`JWT`,template_literal:`είσοδος`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return typeof e.expected==`string`&&/^[A-Z]/.test(e.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${e.expected}, λήφθηκε ${i}`:`Μη έγκυρη είσοδος: αναμενόταν ${t}, λήφθηκε ${i}`}case`invalid_value`:return e.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${I(e.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${N(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}`:`Μη έγκυρο: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${e.divisor}`;case`unrecognized_keys`:return`Άγνωστ${e.keys.length>1?`α`:`ο`} κλειδ${e.keys.length>1?`ιά`:`ί`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Μη έγκυρο κλειδί στο ${e.origin}`;case`invalid_union`:return`Μη έγκυρη είσοδος`;case`invalid_element`:return`Μη έγκυρη τιμή στο ${e.origin}`;default:return`Μη έγκυρη είσοδος`}}};function Bc(){return{localeError:zc()}}var Vc=()=>{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`},map:{unit:`entries`,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`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${I(e.values[0])}`:`Invalid option: expected one of ${N(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`:``}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Hc(){return{localeError:Vc()}}var Uc=()=>{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`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${I(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${N(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`:``}: ${N(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 Wc(){return{localeError:Uc()}}var Gc=()=>{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={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`},r={nan:`NaN`,string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${I(e.values[0])}`:`Opción inválida: se esperaba una de ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} 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 ${n[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`:``}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}};function Kc(){return{localeError:Gc()}}var qc=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n={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:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: می‌بایست instanceof ${e.expected} می‌بود، ${i} دریافت شد`:`ورودی نامعتبر: می‌بایست ${t} می‌بود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${I(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${N(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} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${N(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function Jc(){return{localeError:qc()}}var Yc=()=>{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={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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${I(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${N(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 ${n[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`}: ${N(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 Xc(){return{localeError:Yc()}}var Zc=()=>{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={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`},r={string:`chaîne`,number:`nombre`,int:`entier`,boolean:`booléen`,bigint:`grand entier`,symbol:`symbole`,undefined:`indéfini`,null:`null`,never:`jamais`,void:`vide`,date:`date`,array:`tableau`,object:`objet`,tuple:`tuple`,record:`enregistrement`,map:`carte`,set:`ensemble`,file:`fichier`,nonoptional:`non-optionnel`,nan:`NaN`,function:`fonction`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${I(e.values[0])} attendu`:`Option invalide : une valeur parmi ${N(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin);return i?`Trop grand : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.maximum.toString()} ${i.unit??`élément(s)`}`:`Trop grand : ${r[e.origin]??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin);return i?`Trop petit : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.minimum.toString()} ${i.unit}`:`Trop petit : ${r[e.origin]??`valeur`} 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}`:`${n[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`:``} : ${N(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 Qc(){return{localeError:Zc()}}var $c=()=>{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={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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${I(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${N(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}`:`${n[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`:``} : ${N(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 el(){return{localeError:$c()}}var tl=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},jwt:{label:`JWT`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=L(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${I(t.values[0])}`;let e=t.values.map(e=>I(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${N(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}};function nl(){return{localeError:tl()}}var rl=()=>{let e={string:{unit:`znakova`,verb:`imati`},file:{unit:`bajtova`,verb:`imati`},array:{unit:`stavki`,verb:`imati`},set:{unit:`stavki`,verb:`imati`}};function t(t){return e[t]??null}let n={regex:`unos`,email:`email 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:`ISO datum i vrijeme`,date:`ISO datum`,time:`ISO vrijeme`,duration:`ISO trajanje`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`IPv4 raspon`,cidrv6:`IPv6 raspon`,base64:`base64 kodirani tekst`,base64url:`base64url kodirani tekst`,json_string:`JSON tekst`,e164:`E.164 broj`,jwt:`JWT`,template_literal:`unos`},r={nan:`NaN`,string:`tekst`,number:`broj`,boolean:`boolean`,array:`niz`,object:`objekt`,set:`skup`,file:`datoteka`,date:`datum`,bigint:`bigint`,symbol:`simbol`,undefined:`undefined`,null:`null`,function:`funkcija`,map:`mapa`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neispravan unos: očekuje se instanceof ${e.expected}, a primljeno je ${i}`:`Neispravan unos: očekuje se ${t}, a primljeno je ${i}`}case`invalid_value`:return e.values.length===1?`Neispravna vrijednost: očekivano ${I(e.values[0])}`:`Neispravna opcija: očekivano jedno od ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Preveliko: očekivano da ${a??`vrijednost`} ima ${n}${e.maximum.toString()} ${i.unit??`elemenata`}`:`Preveliko: očekivano da ${a??`vrijednost`} bude ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Premalo: očekivano da ${a} ima ${n}${e.minimum.toString()} ${i.unit}`:`Premalo: očekivano da ${a} bude ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neispravan tekst: mora započinjati s "${t.prefix}"`:t.format===`ends_with`?`Neispravan tekst: mora završavati s "${t.suffix}"`:t.format===`includes`?`Neispravan tekst: mora sadržavati "${t.includes}"`:t.format===`regex`?`Neispravan tekst: mora odgovarati uzorku ${t.pattern}`:`Neispravna ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neispravan broj: mora biti višekratnik od ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznat${e.keys.length>1?`i ključevi`:` ključ`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Neispravan ključ u ${r[e.origin]??e.origin}`;case`invalid_union`:return`Neispravan unos`;case`invalid_element`:return`Neispravna vrijednost u ${r[e.origin]??e.origin}`;default:return`Neispravan unos`}}};function il(){return{localeError:rl()}}var al=()=>{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={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`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${I(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${N(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 ${n[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`:``}: ${N(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 ol(){return{localeError:al()}}function sl(e,t,n){return Math.abs(e)===1?t:n}function cl(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}var ll=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let n={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:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${I(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=sl(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${cl(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${cl(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=sl(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${cl(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${cl(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} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${N(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${cl(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${cl(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}};function ul(){return{localeError:ll()}}var dl=()=>{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={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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${I(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${N(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}`:`${n[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`:``}: ${N(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 fl(){return{localeError:dl()}}var pl=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,jwt:`JWT`,template_literal:`gildi`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${I(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function ml(){return{localeError:pl()}}var hl=()=>{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={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`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${I(e.values[0])}`:`Opzione non valida: atteso uno tra ${N(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}`:`Input non valido: ${n[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`}: ${N(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 gl(){return{localeError:hl()}}var _l=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n={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:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${I(e.values[0])}が期待されました`:`無効な選択: ${N(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}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${N(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function vl(){return{localeError:_l()}}var yl=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული ველი`,base64url:`base64url-კოდირებული ველი`,json_string:`JSON ველი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`ველი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${I(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${N(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}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function bl(){return{localeError:yl()}}var xl=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n={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:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${I(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${N(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}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${N(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function Sl(){return{localeError:xl()}}function Cl(){return Sl()}var wl=()=>{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={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:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${I(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${N(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} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${N(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function Tl(){return{localeError:wl()}}var El=e=>e.charAt(0).toUpperCase()+e.slice(1);function Dl(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}var Ol=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`},r={nan:`NaN`,number:`skaičius`,bigint:`sveikasis skaičius`,string:`eilutė`,boolean:`loginė reikšmė`,undefined:`neapibrėžta reikšmė`,function:`funkcija`,symbol:`simbolis`,array:`masyvas`,object:`objektas`,null:`nulinė reikšmė`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${I(e.values[0])}`:`Privalo būti vienas iš ${N(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Dl(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${El(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${El(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Dl(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${El(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${El(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:return`${El(r[e.origin]??e.origin??e.origin??`reikšmė`)} turi klaidingą įvestį`;default:return`Klaidinga įvestis`}}};function kl(){return{localeError:Ol()}}var Al=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n={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:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${I(e.values[0])}`:`Грешана опција: се очекува една ${N(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 ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function jl(){return{localeError:Al()}}var Ml=()=>{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={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`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${I(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${N(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}`:`${n[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: ${N(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 Nl(){return{localeError:Ml()}}var Pl=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let n={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`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${I(e.values[0])}`:`Ongeldige optie: verwacht één van ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: 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: ${n[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`:``}: ${N(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 Fl(){return{localeError:Pl()}}var Il=()=>{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={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`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${I(e.values[0])}`:`Ugyldig valg: forventet en av ${N(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 ${n[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`}: ${N(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 Ll(){return{localeError:Il()}}var Rl=()=>{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={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`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${I(e.values[0])}`:`Fâsit tercih: mûteberler ${N(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 ${n[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`:``}: ${N(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 zl(){return{localeError:Rl()}}var Bl=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n={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:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${I(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${N(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} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${N(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function Vl(){return{localeError:Bl()}}var Hl=()=>{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={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`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${I(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${N(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) ${n[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`:``}: ${N(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 Ul(){return{localeError:Hl()}}var Wl=()=>{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={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`},r={nan:`NaN`,number:`número`,null:`nulo`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}`:`Tipo inválido: esperado ${t}, recebido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${I(e.values[0])}`:`Opção inválida: esperada uma das ${N(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}`:`${n[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`:``}: ${N(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 Gl(){return{localeError:Wl()}}var Kl=()=>{let e={string:{unit:`caractere`,verb:`să aibă`},file:{unit:`octeți`,verb:`să aibă`},array:{unit:`elemente`,verb:`să aibă`},set:{unit:`elemente`,verb:`să aibă`},map:{unit:`intrări`,verb:`să aibă`}};function t(t){return e[t]??null}let n={regex:`intrare`,email:`adresă de 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:`dată și oră ISO`,date:`dată ISO`,time:`oră ISO`,duration:`durată ISO`,ipv4:`adresă IPv4`,ipv6:`adresă IPv6`,mac:`adresă MAC`,cidrv4:`interval IPv4`,cidrv6:`interval IPv6`,base64:`șir codat base64`,base64url:`șir codat base64url`,json_string:`șir JSON`,e164:`număr E.164`,jwt:`JWT`,template_literal:`intrare`},r={nan:`NaN`,string:`șir`,number:`număr`,boolean:`boolean`,function:`funcție`,array:`matrice`,object:`obiect`,undefined:`nedefinit`,symbol:`simbol`,bigint:`număr mare`,void:`void`,never:`never`,map:`hartă`,set:`set`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input);return`Intrare invalidă: așteptat ${t}, primit ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Intrare invalidă: așteptat ${I(e.values[0])}`:`Opțiune invalidă: așteptat una dintre ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Prea mare: așteptat ca ${e.origin??`valoarea`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemente`}`:`Prea mare: așteptat ca ${e.origin??`valoarea`} să fie ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Prea mic: așteptat ca ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Prea mic: așteptat ca ${e.origin} să fie ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Șir invalid: trebuie să înceapă cu "${t.prefix}"`:t.format===`ends_with`?`Șir invalid: trebuie să se termine cu "${t.suffix}"`:t.format===`includes`?`Șir invalid: trebuie să includă "${t.includes}"`:t.format===`regex`?`Șir invalid: trebuie să se potrivească cu modelul ${t.pattern}`:`Format invalid: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Număr invalid: trebuie să fie multiplu de ${e.divisor}`;case`unrecognized_keys`:return`Chei nerecunoscute: ${N(e.keys,`, `)}`;case`invalid_key`:return`Cheie invalidă în ${e.origin}`;case`invalid_union`:return`Intrare invalidă`;case`invalid_element`:return`Valoare invalidă în ${e.origin}`;default:return`Intrare invalidă`}}};function ql(){return{localeError:Kl()}}function Jl(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}var Yl=()=>{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={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:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${I(e.values[0])}`:`Неверный вариант: ожидалось одно из ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Jl(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=Jl(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}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function Xl(){return{localeError:Yl()}}var Zl=()=>{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={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`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${I(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${N(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 ${n[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č`}: ${N(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 Ql(){return{localeError:Zl()}}var $l=()=>{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={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`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${I(e.values[0])}`:`Ogiltigt val: förväntade en av ${N(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) ${n[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`}: ${N(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 eu(){return{localeError:$l()}}var tu=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n={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`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${I(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${N(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} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${N(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function nu(){return{localeError:tu()}}var ru=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n={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:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${I(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${N(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}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${N(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function iu(){return{localeError:ru()}}var au=()=>{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`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${I(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${N(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`:``}: ${N(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 ou(){return{localeError:au()}}var su=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n={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:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${I(e.values[0])}`:`Неправильна опція: очікується одне з ${N(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}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${N(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function cu(){return{localeError:su()}}function lu(){return cu()}var uu=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n={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:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${I(e.values[0])} متوقع تھا`:`غلط آپشن: ${N(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} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${N(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function du(){return{localeError:uu()}}var fu=()=>{let e={string:{unit:`belgi`,verb:`bo‘lishi kerak`},file:{unit:`bayt`,verb:`bo‘lishi kerak`},array:{unit:`element`,verb:`bo‘lishi kerak`},set:{unit:`element`,verb:`bo‘lishi kerak`},map:{unit:`yozuv`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let n={regex:`kirish`,email:`elektron pochta manzili`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sana va vaqti`,date:`ISO sana`,time:`ISO vaqt`,duration:`ISO davomiylik`,ipv4:`IPv4 manzil`,ipv6:`IPv6 manzil`,mac:`MAC manzil`,cidrv4:`IPv4 diapazon`,cidrv6:`IPv6 diapazon`,base64:`base64 kodlangan satr`,base64url:`base64url kodlangan satr`,json_string:`JSON satr`,e164:`E.164 raqam`,jwt:`JWT`,template_literal:`kirish`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${I(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${N(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}};function pu(){return{localeError:fu()}}var mu=()=>{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={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`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${I(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${N(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}`:`${n[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: ${N(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 hu(){return{localeError:mu()}}var gu=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n={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:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${I(e.values[0])}`:`无效选项:期望以下之一 ${N(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}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${N(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function _u(){return{localeError:gu()}}var vu=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n={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:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${I(e.values[0])}`:`無效的選項:預期為以下其中之一 ${N(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}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${N(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function yu(){return{localeError:vu()}}var bu=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=L(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${I(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${N(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${N(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function xu(){return{localeError:bu()}}var Su=a({ar:()=>Cc,az:()=>Tc,be:()=>Oc,bg:()=>Ac,ca:()=>Mc,cs:()=>Pc,da:()=>Ic,de:()=>Rc,el:()=>Bc,en:()=>Hc,eo:()=>Wc,es:()=>Kc,fa:()=>Jc,fi:()=>Xc,fr:()=>Qc,frCA:()=>el,he:()=>nl,hr:()=>il,hu:()=>ol,hy:()=>ul,id:()=>fl,is:()=>ml,it:()=>gl,ja:()=>vl,ka:()=>bl,kh:()=>Cl,km:()=>Sl,ko:()=>Tl,lt:()=>kl,mk:()=>jl,ms:()=>Nl,nl:()=>Fl,no:()=>Ll,ota:()=>zl,pl:()=>Ul,ps:()=>Vl,pt:()=>Gl,ro:()=>ql,ru:()=>Xl,sl:()=>Ql,sv:()=>eu,ta:()=>nu,th:()=>iu,tr:()=>ou,ua:()=>lu,uk:()=>cu,ur:()=>du,uz:()=>pu,vi:()=>hu,yo:()=>xu,zhCN:()=>_u,zhTW:()=>yu}),Cu,wu=Symbol(`ZodOutput`),Tu=Symbol(`ZodInput`),Eu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,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)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Du(){return new Eu}(Cu=globalThis).__zod_globalRegistry??(Cu.__zod_globalRegistry=Du());var Ou=globalThis.__zod_globalRegistry;function ku(e,t){return new e({type:`string`,...F(t)})}function Au(e,t){return new e({type:`string`,coerce:!0,...F(t)})}function ju(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...F(t)})}function Mu(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...F(t)})}function Nu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...F(t)})}function Pu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...F(t)})}function Fu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...F(t)})}function Iu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...F(t)})}function Lu(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...F(t)})}function Ru(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...F(t)})}function zu(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...F(t)})}function Bu(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...F(t)})}function Vu(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...F(t)})}function Hu(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...F(t)})}function Uu(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...F(t)})}function Wu(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...F(t)})}function Gu(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...F(t)})}function Ku(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...F(t)})}function qu(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...F(t)})}function Ju(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...F(t)})}function Yu(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...F(t)})}function Xu(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...F(t)})}function Zu(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...F(t)})}function Qu(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...F(t)})}function $u(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...F(t)})}var ed={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function td(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...F(t)})}function nd(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...F(t)})}function rd(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...F(t)})}function id(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...F(t)})}function ad(e,t){return new e({type:`number`,checks:[],...F(t)})}function od(e,t){return new e({type:`number`,coerce:!0,checks:[],...F(t)})}function sd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...F(t)})}function cd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...F(t)})}function ld(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...F(t)})}function ud(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...F(t)})}function dd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...F(t)})}function fd(e,t){return new e({type:`boolean`,...F(t)})}function pd(e,t){return new e({type:`boolean`,coerce:!0,...F(t)})}function md(e,t){return new e({type:`bigint`,...F(t)})}function hd(e,t){return new e({type:`bigint`,coerce:!0,...F(t)})}function gd(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...F(t)})}function _d(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...F(t)})}function vd(e,t){return new e({type:`symbol`,...F(t)})}function yd(e,t){return new e({type:`undefined`,...F(t)})}function bd(e,t){return new e({type:`null`,...F(t)})}function xd(e){return new e({type:`any`})}function Sd(e){return new e({type:`unknown`})}function Cd(e,t){return new e({type:`never`,...F(t)})}function wd(e,t){return new e({type:`void`,...F(t)})}function Td(e,t){return new e({type:`date`,...F(t)})}function Ed(e,t){return new e({type:`date`,coerce:!0,...F(t)})}function Dd(e,t){return new e({type:`nan`,...F(t)})}function Od(e,t){return new lo({check:`less_than`,...F(t),value:e,inclusive:!1})}function kd(e,t){return new lo({check:`less_than`,...F(t),value:e,inclusive:!0})}function Ad(e,t){return new uo({check:`greater_than`,...F(t),value:e,inclusive:!1})}function jd(e,t){return new uo({check:`greater_than`,...F(t),value:e,inclusive:!0})}function Md(e){return Ad(0,e)}function Nd(e){return Od(0,e)}function Pd(e){return kd(0,e)}function Fd(e){return jd(0,e)}function Id(e,t){return new fo({check:`multiple_of`,...F(t),value:e})}function Ld(e,t){return new ho({check:`max_size`,...F(t),maximum:e})}function Rd(e,t){return new go({check:`min_size`,...F(t),minimum:e})}function zd(e,t){return new _o({check:`size_equals`,...F(t),size:e})}function Bd(e,t){return new vo({check:`max_length`,...F(t),maximum:e})}function Vd(e,t){return new yo({check:`min_length`,...F(t),minimum:e})}function Hd(e,t){return new bo({check:`length_equals`,...F(t),length:e})}function Ud(e,t){return new So({check:`string_format`,format:`regex`,...F(t),pattern:e})}function Wd(e){return new Co({check:`string_format`,format:`lowercase`,...F(e)})}function Gd(e){return new wo({check:`string_format`,format:`uppercase`,...F(e)})}function Kd(e,t){return new To({check:`string_format`,format:`includes`,...F(t),includes:e})}function qd(e,t){return new Eo({check:`string_format`,format:`starts_with`,...F(t),prefix:e})}function Jd(e,t){return new Do({check:`string_format`,format:`ends_with`,...F(t),suffix:e})}function Yd(e,t,n){return new ko({check:`property`,property:e,schema:t,...F(n)})}function Xd(e,t){return new Ao({check:`mime_type`,mime:e,...F(t)})}function Zd(e){return new jo({check:`overwrite`,tx:e})}function Qd(e){return Zd(t=>t.normalize(e))}function $d(){return Zd(e=>e.trim())}function ef(){return Zd(e=>e.toLowerCase())}function tf(){return Zd(e=>e.toUpperCase())}function nf(){return Zd(e=>Nr(e))}function rf(e,t,n){return new e({type:`array`,element:t,...F(n)})}function af(e,t,n){return new e({type:`union`,options:t,...F(n)})}function of(e,t,n){return new e({type:`union`,options:t,inclusive:!1,...F(n)})}function sf(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...F(r)})}function cf(e,t,n){return new e({type:`intersection`,left:t,right:n})}function lf(e,t,n,r){let i=n instanceof R;return new e({type:`tuple`,items:t,rest:i?n:null,...F(i?r:n)})}function uf(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...F(r)})}function df(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...F(r)})}function ff(e,t,n){return new e({type:`set`,valueType:t,...F(n)})}function pf(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...F(n)})}function mf(e,t,n){return new e({type:`enum`,entries:t,...F(n)})}function hf(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...F(n)})}function gf(e,t){return new e({type:`file`,...F(t)})}function _f(e,t){return new e({type:`transform`,transform:t})}function vf(e,t){return new e({type:`optional`,innerType:t})}function yf(e,t){return new e({type:`nullable`,innerType:t})}function bf(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():Rr(n)}})}function xf(e,t,n){return new e({type:`nonoptional`,innerType:t,...F(n)})}function Sf(e,t){return new e({type:`success`,innerType:t})}function Cf(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function wf(e,t,n){return new e({type:`pipe`,in:t,out:n})}function Tf(e,t){return new e({type:`readonly`,innerType:t})}function Ef(e,t,n){return new e({type:`template_literal`,parts:t,...F(n)})}function Df(e,t){return new e({type:`lazy`,getter:t})}function Of(e,t){return new e({type:`promise`,innerType:t})}function kf(e,t,n){let r=F(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Af(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...F(n)})}function jf(e,t){let n=Mf(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(li(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(li(r))}},e(t.value,t)),t);return n}function Mf(e,t){let n=new so({check:`custom`,...F(t)});return n._zod.check=e,n}function Nf(e){let t=new so({check:`describe`});return t._zod.onattach=[t=>{let n=Ou.get(t)??{};Ou.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function Pf(e){let t=new so({check:`meta`});return t._zod.onattach=[t=>{let n=Ou.get(t)??{};Ou.add(t,{...n,...e})}],t._zod.check=()=>{},t}function Ff(e,t){let n=F(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.Codec??uc,c=e.Boolean??ds,l=new s({type:`pipe`,in:new(e.String??Po)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),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:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function If(e,t,n,r={}){let i=F(r),a={...F(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)}function Lf(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ou,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function B(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,B(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Bf(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Rf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.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(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
76
76
 
77
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function zf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Hf(t,`input`,e.processors),output:Hf(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Bf(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Bf(r.element,n);if(r.type===`set`)return Bf(r.valueType,n);if(r.type===`lazy`)return Bf(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Bf(r.innerType,n);if(r.type===`intersection`)return Bf(r.left,n)||Bf(r.right,n);if(r.type===`record`||r.type===`map`)return Bf(r.keyType,n)||Bf(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Bf(r.in,n)||Bf(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Bf(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Bf(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Bf(e,n))return!0;return!!(r.rest&&Bf(r.rest,n))}return!1}var Vf=(e,t={})=>n=>{let r=Lf({...n,processors:t});return B(e,r),Rf(r,e),zf(r,e)},Hf=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Lf({...i??{},target:a,io:t,processors:n});return B(e,o),Rf(o,e),zf(o,e)},Uf={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Wf=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Uf[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Gf=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),ee=t.target===`draft-04`||t.target===`openapi-3.0`;d?ee?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?ee?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Kf=(e,t,n,r)=>{n.type=`boolean`},qf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Jf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Yf=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Xf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Zf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Qf=(e,t,n,r)=>{n.not={}},$f=(e,t,n,r)=>{},ep=(e,t,n,r)=>{},tp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},np=(e,t,n,r)=>{let i=e._zod.def,a=vr(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},rp=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ip=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},ap=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},op=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},sp=(e,t,n,r)=>{n.type=`boolean`},cp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},lp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},up=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},dp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},fp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},pp=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=B(a.element,t,{...r,path:[...r.path,`items`]})},mp=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=B(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=B(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},hp=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>B(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},gp=(e,t,n,r)=>{let i=e._zod.def,a=B(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=B(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},_p=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>B(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?B(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},vp=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=B(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=B(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=B(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},yp=(e,t,n,r)=>{let i=e._zod.def,a=B(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},bp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Sp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Cp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},wp=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;B(o,t,r);let s=t.seen.get(e);s.ref=o},Tp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ep=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Dp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Op=(e,t,n,r)=>{let i=e._zod.innerType;B(i,t,r);let a=t.seen.get(e);a.ref=i},kp={string:Wf,number:Gf,boolean:Kf,bigint:qf,symbol:Jf,null:Yf,undefined:Xf,void:Zf,never:Qf,any:$f,unknown:ep,date:tp,enum:np,literal:rp,nan:ip,template_literal:ap,file:op,success:sp,custom:cp,function:lp,transform:up,map:dp,set:fp,array:pp,object:mp,union:hp,intersection:gp,tuple:_p,record:vp,nullable:yp,nonoptional:bp,default:xp,prefault:Sp,catch:Cp,pipe:wp,readonly:Tp,promise:Ep,optional:Dp,lazy:Op};function Ap(e,t){if(`_idmap`in e){let n=e,r=Lf({...t,processors:kp}),i={};for(let e of n._idmap.entries()){let[t,n]=e;B(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Rf(r,n),a[t]=zf(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Lf({...t,processors:kp});return B(e,n),Rf(n,e),zf(n,e)}var jp=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=Lf({processors:kp,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return B(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Rf(this.ctx,e);let{"~standard":n,...r}=zf(this.ctx,e);return r}},Mp=a({}),Np=a({$ZodAny:()=>_s,$ZodArray:()=>Cs,$ZodAsyncError:()=>cr,$ZodBase64:()=>ns,$ZodBase64URL:()=>is,$ZodBigInt:()=>fs,$ZodBigIntFormat:()=>ps,$ZodBoolean:()=>ds,$ZodCIDRv4:()=>$o,$ZodCIDRv6:()=>es,$ZodCUID:()=>Vo,$ZodCUID2:()=>Ho,$ZodCatch:()=>oc,$ZodCheck:()=>so,$ZodCheckBigIntFormat:()=>mo,$ZodCheckEndsWith:()=>Do,$ZodCheckGreaterThan:()=>uo,$ZodCheckIncludes:()=>To,$ZodCheckLengthEquals:()=>bo,$ZodCheckLessThan:()=>lo,$ZodCheckLowerCase:()=>Co,$ZodCheckMaxLength:()=>vo,$ZodCheckMaxSize:()=>ho,$ZodCheckMimeType:()=>Ao,$ZodCheckMinLength:()=>yo,$ZodCheckMinSize:()=>go,$ZodCheckMultipleOf:()=>fo,$ZodCheckNumberFormat:()=>po,$ZodCheckOverwrite:()=>jo,$ZodCheckProperty:()=>ko,$ZodCheckRegex:()=>So,$ZodCheckSizeEquals:()=>_o,$ZodCheckStartsWith:()=>Eo,$ZodCheckStringFormat:()=>xo,$ZodCheckUpperCase:()=>wo,$ZodCodec:()=>uc,$ZodCustom:()=>bc,$ZodCustomStringFormat:()=>cs,$ZodDate:()=>xs,$ZodDefault:()=>ec,$ZodDiscriminatedUnion:()=>Ns,$ZodE164:()=>as,$ZodEmail:()=>Lo,$ZodEmoji:()=>zo,$ZodEncodeError:()=>lr,$ZodEnum:()=>Ks,$ZodError:()=>yi,$ZodExactOptional:()=>Qs,$ZodFile:()=>Js,$ZodFunction:()=>_c,$ZodGUID:()=>Fo,$ZodIPv4:()=>Xo,$ZodIPv6:()=>Zo,$ZodISODate:()=>qo,$ZodISODateTime:()=>Ko,$ZodISODuration:()=>Yo,$ZodISOTime:()=>Jo,$ZodIntersection:()=>Ps,$ZodJWT:()=>ss,$ZodKSUID:()=>Go,$ZodLazy:()=>yc,$ZodLiteral:()=>qs,$ZodMAC:()=>Qo,$ZodMap:()=>Hs,$ZodNaN:()=>sc,$ZodNanoID:()=>Bo,$ZodNever:()=>ys,$ZodNonOptional:()=>rc,$ZodNull:()=>gs,$ZodNullable:()=>$s,$ZodNumber:()=>ls,$ZodNumberFormat:()=>us,$ZodObject:()=>Ds,$ZodObjectJIT:()=>Os,$ZodOptional:()=>Zs,$ZodPipe:()=>cc,$ZodPrefault:()=>nc,$ZodPreprocess:()=>pc,$ZodPromise:()=>vc,$ZodReadonly:()=>mc,$ZodRealError:()=>bi,$ZodRecord:()=>Vs,$ZodRegistry:()=>Eu,$ZodSet:()=>Ws,$ZodString:()=>Po,$ZodStringFormat:()=>z,$ZodSuccess:()=>ac,$ZodSymbol:()=>ms,$ZodTemplateLiteral:()=>gc,$ZodTransform:()=>Ys,$ZodTuple:()=>Ls,$ZodType:()=>R,$ZodULID:()=>Uo,$ZodURL:()=>Ro,$ZodUUID:()=>Io,$ZodUndefined:()=>hs,$ZodUnion:()=>As,$ZodUnknown:()=>vs,$ZodVoid:()=>bs,$ZodXID:()=>Wo,$ZodXor:()=>Ms,$brand:()=>sr,$constructor:()=>M,$input:()=>Tu,$output:()=>wu,Doc:()=>Mo,JSONSchema:()=>Mp,JSONSchemaGenerator:()=>jp,NEVER:()=>or,TimePrecision:()=>ed,_any:()=>xd,_array:()=>rf,_base64:()=>Xu,_base64url:()=>Zu,_bigint:()=>md,_boolean:()=>fd,_catch:()=>Cf,_check:()=>Mf,_cidrv4:()=>Ju,_cidrv6:()=>Yu,_coercedBigint:()=>hd,_coercedBoolean:()=>pd,_coercedDate:()=>Ed,_coercedNumber:()=>od,_coercedString:()=>Au,_cuid:()=>Bu,_cuid2:()=>Vu,_custom:()=>kf,_date:()=>Td,_decode:()=>Ii,_decodeAsync:()=>Bi,_default:()=>bf,_discriminatedUnion:()=>sf,_e164:()=>Qu,_email:()=>ju,_emoji:()=>Ru,_encode:()=>Pi,_encodeAsync:()=>Ri,_endsWith:()=>Jd,_enum:()=>pf,_file:()=>gf,_float32:()=>cd,_float64:()=>ld,_gt:()=>Ad,_gte:()=>jd,_guid:()=>Mu,_includes:()=>Kd,_int:()=>sd,_int32:()=>ud,_int64:()=>gd,_intersection:()=>cf,_ipv4:()=>Gu,_ipv6:()=>Ku,_isoDate:()=>nd,_isoDateTime:()=>td,_isoDuration:()=>id,_isoTime:()=>rd,_jwt:()=>$u,_ksuid:()=>Wu,_lazy:()=>Df,_length:()=>Hd,_literal:()=>hf,_lowercase:()=>Wd,_lt:()=>Od,_lte:()=>kd,_mac:()=>qu,_map:()=>df,_max:()=>kd,_maxLength:()=>Bd,_maxSize:()=>Ld,_mime:()=>Xd,_min:()=>jd,_minLength:()=>Vd,_minSize:()=>Rd,_multipleOf:()=>Id,_nan:()=>Dd,_nanoid:()=>zu,_nativeEnum:()=>mf,_negative:()=>Nd,_never:()=>Cd,_nonnegative:()=>Fd,_nonoptional:()=>xf,_nonpositive:()=>Pd,_normalize:()=>Qd,_null:()=>bd,_nullable:()=>yf,_number:()=>ad,_optional:()=>vf,_overwrite:()=>Zd,_parse:()=>Ei,_parseAsync:()=>Oi,_pipe:()=>wf,_positive:()=>Md,_promise:()=>Of,_property:()=>Yd,_readonly:()=>Tf,_record:()=>uf,_refine:()=>Af,_regex:()=>Ud,_safeDecode:()=>Wi,_safeDecodeAsync:()=>Ji,_safeEncode:()=>Hi,_safeEncodeAsync:()=>Ki,_safeParse:()=>Ai,_safeParseAsync:()=>Mi,_set:()=>ff,_size:()=>zd,_slugify:()=>nf,_startsWith:()=>qd,_string:()=>ku,_stringFormat:()=>If,_stringbool:()=>Ff,_success:()=>Sf,_superRefine:()=>jf,_symbol:()=>vd,_templateLiteral:()=>Ef,_toLowerCase:()=>ef,_toUpperCase:()=>tf,_transform:()=>_f,_trim:()=>$d,_tuple:()=>lf,_uint32:()=>dd,_uint64:()=>_d,_ulid:()=>Hu,_undefined:()=>yd,_union:()=>af,_unknown:()=>Sd,_uppercase:()=>Gd,_url:()=>Lu,_uuid:()=>Nu,_uuidv4:()=>Pu,_uuidv6:()=>Fu,_uuidv7:()=>Iu,_void:()=>wd,_xid:()=>Uu,_xor:()=>of,clone:()=>Wr,config:()=>dr,createStandardJSONSchemaMethod:()=>Hf,createToJSONSchemaMethod:()=>Vf,decode:()=>Li,decodeAsync:()=>Vi,describe:()=>Nf,encode:()=>Fi,encodeAsync:()=>zi,extractDefs:()=>Rf,finalize:()=>zf,flattenError:()=>xi,formatError:()=>Si,globalConfig:()=>ur,globalRegistry:()=>Ou,initializeContext:()=>Lf,isValidBase64:()=>ts,isValidBase64URL:()=>rs,isValidJWT:()=>os,locales:()=>Su,meta:()=>Pf,parse:()=>Di,parseAsync:()=>ki,prettifyError:()=>Ti,process:()=>B,regexes:()=>Xi,registry:()=>Du,safeDecode:()=>Gi,safeDecodeAsync:()=>Yi,safeEncode:()=>Ui,safeEncodeAsync:()=>qi,safeParse:()=>ji,safeParseAsync:()=>Ni,toDotPath:()=>wi,toJSONSchema:()=>Ap,treeifyError:()=>Ci,util:()=>fr,version:()=>No}),Pp=a({endsWith:()=>Jd,gt:()=>Ad,gte:()=>jd,includes:()=>Kd,length:()=>Hd,lowercase:()=>Wd,lt:()=>Od,lte:()=>kd,maxLength:()=>Bd,maxSize:()=>Ld,mime:()=>Xd,minLength:()=>Vd,minSize:()=>Rd,multipleOf:()=>Id,negative:()=>Nd,nonnegative:()=>Fd,nonpositive:()=>Pd,normalize:()=>Qd,overwrite:()=>Zd,positive:()=>Md,property:()=>Yd,regex:()=>Ud,size:()=>zd,slugify:()=>nf,startsWith:()=>qd,toLowerCase:()=>ef,toUpperCase:()=>tf,trim:()=>$d,uppercase:()=>Gd}),Fp=a({ZodISODate:()=>Rp,ZodISODateTime:()=>Ip,ZodISODuration:()=>Hp,ZodISOTime:()=>Bp,date:()=>zp,datetime:()=>Lp,duration:()=>Up,time:()=>Vp}),Ip=M(`ZodISODateTime`,(e,t)=>{Ko.init(e,t),U.init(e,t)});function Lp(e){return td(Ip,e)}var Rp=M(`ZodISODate`,(e,t)=>{qo.init(e,t),U.init(e,t)});function zp(e){return nd(Rp,e)}var Bp=M(`ZodISOTime`,(e,t)=>{Jo.init(e,t),U.init(e,t)});function Vp(e){return rd(Bp,e)}var Hp=M(`ZodISODuration`,(e,t)=>{Yo.init(e,t),U.init(e,t)});function Up(e){return id(Hp,e)}var Wp=(e,t)=>{yi.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Si(e,t)},flatten:{value:t=>xi(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,yr,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,yr,2)}},isEmpty:{get(){return e.issues.length===0}}})},Gp=M(`ZodError`,Wp),Kp=M(`ZodError`,Wp,{Parent:Error}),qp=Ei(Kp),Jp=Oi(Kp),Yp=Ai(Kp),Xp=Mi(Kp),Zp=Pi(Kp),Qp=Ii(Kp),$p=Ri(Kp),em=Bi(Kp),tm=Hi(Kp),nm=Wi(Kp),rm=Ki(Kp),im=Ji(Kp),am=a({ZodAny:()=>wh,ZodArray:()=>Nh,ZodBase64:()=>Km,ZodBase64URL:()=>Jm,ZodBigInt:()=>ph,ZodBigIntFormat:()=>hh,ZodBoolean:()=>fh,ZodCIDRv4:()=>Hm,ZodCIDRv6:()=>Wm,ZodCUID:()=>Em,ZodCUID2:()=>Om,ZodCatch:()=>Cg,ZodCodec:()=>kg,ZodCustom:()=>Ug,ZodCustomStringFormat:()=>eh,ZodDate:()=>jh,ZodDefault:()=>hg,ZodDiscriminatedUnion:()=>Hh,ZodE164:()=>Xm,ZodEmail:()=>um,ZodEmoji:()=>Sm,ZodEnum:()=>tg,ZodExactOptional:()=>ug,ZodFile:()=>ig,ZodFunction:()=>Vg,ZodGUID:()=>fm,ZodIPv4:()=>Im,ZodIPv6:()=>Bm,ZodIntersection:()=>Wh,ZodJWT:()=>Qm,ZodKSUID:()=>Pm,ZodLazy:()=>Lg,ZodLiteral:()=>rg,ZodMAC:()=>Rm,ZodMap:()=>Zh,ZodNaN:()=>Tg,ZodNanoID:()=>wm,ZodNever:()=>Dh,ZodNonOptional:()=>yg,ZodNull:()=>Sh,ZodNullable:()=>fg,ZodNumber:()=>ah,ZodNumberFormat:()=>oh,ZodObject:()=>Fh,ZodOptional:()=>cg,ZodPipe:()=>Dg,ZodPrefault:()=>_g,ZodPreprocess:()=>Mg,ZodPromise:()=>zg,ZodReadonly:()=>Ng,ZodRecord:()=>Jh,ZodSet:()=>$h,ZodString:()=>lm,ZodStringFormat:()=>U,ZodSuccess:()=>xg,ZodSymbol:()=>vh,ZodTemplateLiteral:()=>Fg,ZodTransform:()=>og,ZodTuple:()=>Kh,ZodType:()=>V,ZodULID:()=>Am,ZodURL:()=>ym,ZodUUID:()=>mm,ZodUndefined:()=>bh,ZodUnion:()=>Rh,ZodUnknown:()=>Th,ZodVoid:()=>kh,ZodXID:()=>Mm,ZodXor:()=>Bh,_ZodString:()=>cm,_default:()=>gg,_function:()=>Hg,any:()=>K,array:()=>q,base64:()=>qm,base64url:()=>Ym,bigint:()=>mh,boolean:()=>G,catch:()=>wg,check:()=>Wg,cidrv4:()=>Um,cidrv6:()=>Gm,codec:()=>Ag,cuid:()=>Dm,cuid2:()=>km,custom:()=>Gg,date:()=>Mh,describe:()=>Jg,discriminatedUnion:()=>Uh,e164:()=>Zm,email:()=>dm,emoji:()=>Cm,enum:()=>X,exactOptional:()=>dg,file:()=>ag,float32:()=>ch,float64:()=>lh,function:()=>Hg,guid:()=>pm,hash:()=>ih,hex:()=>rh,hostname:()=>nh,httpUrl:()=>xm,instanceof:()=>Xg,int:()=>sh,int32:()=>uh,int64:()=>gh,intersection:()=>Gh,invertCodec:()=>jg,ipv4:()=>Lm,ipv6:()=>Vm,json:()=>Qg,jwt:()=>$m,keyof:()=>Ph,ksuid:()=>Fm,lazy:()=>Rg,literal:()=>Z,looseObject:()=>Lh,looseRecord:()=>Xh,mac:()=>zm,map:()=>Qh,meta:()=>Yg,nan:()=>Eg,nanoid:()=>Tm,nativeEnum:()=>ng,never:()=>Oh,nonoptional:()=>bg,null:()=>Ch,nullable:()=>pg,nullish:()=>mg,number:()=>W,object:()=>J,optional:()=>lg,partialRecord:()=>Yh,pipe:()=>Og,prefault:()=>vg,preprocess:()=>$g,promise:()=>Bg,readonly:()=>Pg,record:()=>Y,refine:()=>Kg,set:()=>eg,strictObject:()=>Ih,string:()=>H,stringFormat:()=>th,stringbool:()=>Zg,success:()=>Sg,superRefine:()=>qg,symbol:()=>yh,templateLiteral:()=>Ig,transform:()=>sg,tuple:()=>qh,uint32:()=>dh,uint64:()=>_h,ulid:()=>jm,undefined:()=>xh,union:()=>zh,unknown:()=>Eh,url:()=>bm,uuid:()=>hm,uuidv4:()=>gm,uuidv6:()=>_m,uuidv7:()=>vm,void:()=>Ah,xid:()=>Nm,xor:()=>Vh}),om=new WeakMap;function sm(e,t,n){let r=Object.getPrototypeOf(e),i=om.get(r);if(i||(i=new Set,om.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var V=M(`ZodType`,(e,t)=>(R.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Hf(e,`input`),output:Hf(e,`output`)}}),e.toJSONSchema=Vf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>qp(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yp(e,t,n),e.parseAsync=async(t,n)=>Jp(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Xp(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Zp(e,t,n),e.decode=(t,n)=>Qp(e,t,n),e.encodeAsync=async(t,n)=>$p(e,t,n),e.decodeAsync=async(t,n)=>em(e,t,n),e.safeEncode=(t,n)=>tm(e,t,n),e.safeDecode=(t,n)=>nm(e,t,n),e.safeEncodeAsync=async(t,n)=>rm(e,t,n),e.safeDecodeAsync=async(t,n)=>im(e,t,n),sm(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Dr(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Wr(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kg(e,t))},superRefine(e,t){return this.check(qg(e,t))},overwrite(e){return this.check(Zd(e))},optional(){return lg(this)},exactOptional(){return dg(this)},nullable(){return pg(this)},nullish(){return lg(pg(this))},nonoptional(e){return bg(this,e)},array(){return q(this)},or(e){return zh([this,e])},and(e){return Gh(this,e)},transform(e){return Og(this,sg(e))},default(e){return gg(this,e)},prefault(e){return vg(this,e)},catch(e){return wg(this,e)},pipe(e){return Og(this,e)},readonly(){return Pg(this)},describe(e){let t=this.clone();return Ou.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ou.get(this);let t=this.clone();return Ou.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Ou.get(e)?.description},configurable:!0}),e)),cm=M(`_ZodString`,(e,t)=>{Po.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wf(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,sm(e,`_ZodString`,{regex(...e){return this.check(Ud(...e))},includes(...e){return this.check(Kd(...e))},startsWith(...e){return this.check(qd(...e))},endsWith(...e){return this.check(Jd(...e))},min(...e){return this.check(Vd(...e))},max(...e){return this.check(Bd(...e))},length(...e){return this.check(Hd(...e))},nonempty(...e){return this.check(Vd(1,...e))},lowercase(e){return this.check(Wd(e))},uppercase(e){return this.check(Gd(e))},trim(){return this.check($d())},normalize(...e){return this.check(Qd(...e))},toLowerCase(){return this.check(ef())},toUpperCase(){return this.check(tf())},slugify(){return this.check(nf())}})}),lm=M(`ZodString`,(e,t)=>{Po.init(e,t),cm.init(e,t),e.email=t=>e.check(ju(um,t)),e.url=t=>e.check(Lu(ym,t)),e.jwt=t=>e.check($u(Qm,t)),e.emoji=t=>e.check(Ru(Sm,t)),e.guid=t=>e.check(Mu(fm,t)),e.uuid=t=>e.check(Nu(mm,t)),e.uuidv4=t=>e.check(Pu(mm,t)),e.uuidv6=t=>e.check(Fu(mm,t)),e.uuidv7=t=>e.check(Iu(mm,t)),e.nanoid=t=>e.check(zu(wm,t)),e.guid=t=>e.check(Mu(fm,t)),e.cuid=t=>e.check(Bu(Em,t)),e.cuid2=t=>e.check(Vu(Om,t)),e.ulid=t=>e.check(Hu(Am,t)),e.base64=t=>e.check(Xu(Km,t)),e.base64url=t=>e.check(Zu(Jm,t)),e.xid=t=>e.check(Uu(Mm,t)),e.ksuid=t=>e.check(Wu(Pm,t)),e.ipv4=t=>e.check(Gu(Im,t)),e.ipv6=t=>e.check(Ku(Bm,t)),e.cidrv4=t=>e.check(Ju(Hm,t)),e.cidrv6=t=>e.check(Yu(Wm,t)),e.e164=t=>e.check(Qu(Xm,t)),e.datetime=t=>e.check(Lp(t)),e.date=t=>e.check(zp(t)),e.time=t=>e.check(Vp(t)),e.duration=t=>e.check(Up(t))});function H(e){return ku(lm,e)}var U=M(`ZodStringFormat`,(e,t)=>{z.init(e,t),cm.init(e,t)}),um=M(`ZodEmail`,(e,t)=>{Lo.init(e,t),U.init(e,t)});function dm(e){return ju(um,e)}var fm=M(`ZodGUID`,(e,t)=>{Fo.init(e,t),U.init(e,t)});function pm(e){return Mu(fm,e)}var mm=M(`ZodUUID`,(e,t)=>{Io.init(e,t),U.init(e,t)});function hm(e){return Nu(mm,e)}function gm(e){return Pu(mm,e)}function _m(e){return Fu(mm,e)}function vm(e){return Iu(mm,e)}var ym=M(`ZodURL`,(e,t)=>{Ro.init(e,t),U.init(e,t)});function bm(e){return Lu(ym,e)}function xm(e){return Lu(ym,{protocol:Da,hostname:Ea,...F(e)})}var Sm=M(`ZodEmoji`,(e,t)=>{zo.init(e,t),U.init(e,t)});function Cm(e){return Ru(Sm,e)}var wm=M(`ZodNanoID`,(e,t)=>{Bo.init(e,t),U.init(e,t)});function Tm(e){return zu(wm,e)}var Em=M(`ZodCUID`,(e,t)=>{Vo.init(e,t),U.init(e,t)});function Dm(e){return Bu(Em,e)}var Om=M(`ZodCUID2`,(e,t)=>{Ho.init(e,t),U.init(e,t)});function km(e){return Vu(Om,e)}var Am=M(`ZodULID`,(e,t)=>{Uo.init(e,t),U.init(e,t)});function jm(e){return Hu(Am,e)}var Mm=M(`ZodXID`,(e,t)=>{Wo.init(e,t),U.init(e,t)});function Nm(e){return Uu(Mm,e)}var Pm=M(`ZodKSUID`,(e,t)=>{Go.init(e,t),U.init(e,t)});function Fm(e){return Wu(Pm,e)}var Im=M(`ZodIPv4`,(e,t)=>{Xo.init(e,t),U.init(e,t)});function Lm(e){return Gu(Im,e)}var Rm=M(`ZodMAC`,(e,t)=>{Qo.init(e,t),U.init(e,t)});function zm(e){return qu(Rm,e)}var Bm=M(`ZodIPv6`,(e,t)=>{Zo.init(e,t),U.init(e,t)});function Vm(e){return Ku(Bm,e)}var Hm=M(`ZodCIDRv4`,(e,t)=>{$o.init(e,t),U.init(e,t)});function Um(e){return Ju(Hm,e)}var Wm=M(`ZodCIDRv6`,(e,t)=>{es.init(e,t),U.init(e,t)});function Gm(e){return Yu(Wm,e)}var Km=M(`ZodBase64`,(e,t)=>{ns.init(e,t),U.init(e,t)});function qm(e){return Xu(Km,e)}var Jm=M(`ZodBase64URL`,(e,t)=>{is.init(e,t),U.init(e,t)});function Ym(e){return Zu(Jm,e)}var Xm=M(`ZodE164`,(e,t)=>{as.init(e,t),U.init(e,t)});function Zm(e){return Qu(Xm,e)}var Qm=M(`ZodJWT`,(e,t)=>{ss.init(e,t),U.init(e,t)});function $m(e){return $u(Qm,e)}var eh=M(`ZodCustomStringFormat`,(e,t)=>{cs.init(e,t),U.init(e,t)});function th(e,t,n={}){return If(eh,e,t,n)}function nh(e){return If(eh,`hostname`,Ta,e)}function rh(e){return If(eh,`hex`,Ua,e)}function ih(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Xi[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return If(eh,n,r,t)}var ah=M(`ZodNumber`,(e,t)=>{ls.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gf(e,t,n,r),sm(e,`ZodNumber`,{gt(e,t){return this.check(Ad(e,t))},gte(e,t){return this.check(jd(e,t))},min(e,t){return this.check(jd(e,t))},lt(e,t){return this.check(Od(e,t))},lte(e,t){return this.check(kd(e,t))},max(e,t){return this.check(kd(e,t))},int(e){return this.check(sh(e))},safe(e){return this.check(sh(e))},positive(e){return this.check(Ad(0,e))},nonnegative(e){return this.check(jd(0,e))},negative(e){return this.check(Od(0,e))},nonpositive(e){return this.check(kd(0,e))},multipleOf(e,t){return this.check(Id(e,t))},step(e,t){return this.check(Id(e,t))},finite(){return this}});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 W(e){return ad(ah,e)}var oh=M(`ZodNumberFormat`,(e,t)=>{us.init(e,t),ah.init(e,t)});function sh(e){return sd(oh,e)}function ch(e){return cd(oh,e)}function lh(e){return ld(oh,e)}function uh(e){return ud(oh,e)}function dh(e){return dd(oh,e)}var fh=M(`ZodBoolean`,(e,t)=>{ds.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kf(e,t,n,r)});function G(e){return fd(fh,e)}var ph=M(`ZodBigInt`,(e,t)=>{fs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qf(e,t,n,r),e.gte=(t,n)=>e.check(jd(t,n)),e.min=(t,n)=>e.check(jd(t,n)),e.gt=(t,n)=>e.check(Ad(t,n)),e.gte=(t,n)=>e.check(jd(t,n)),e.min=(t,n)=>e.check(jd(t,n)),e.lt=(t,n)=>e.check(Od(t,n)),e.lte=(t,n)=>e.check(kd(t,n)),e.max=(t,n)=>e.check(kd(t,n)),e.positive=t=>e.check(Ad(BigInt(0),t)),e.negative=t=>e.check(Od(BigInt(0),t)),e.nonpositive=t=>e.check(kd(BigInt(0),t)),e.nonnegative=t=>e.check(jd(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Id(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function mh(e){return md(ph,e)}var hh=M(`ZodBigIntFormat`,(e,t)=>{ps.init(e,t),ph.init(e,t)});function gh(e){return gd(hh,e)}function _h(e){return _d(hh,e)}var vh=M(`ZodSymbol`,(e,t)=>{ms.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jf(e,t,n,r)});function yh(e){return vd(vh,e)}var bh=M(`ZodUndefined`,(e,t)=>{hs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xf(e,t,n,r)});function xh(e){return yd(bh,e)}var Sh=M(`ZodNull`,(e,t)=>{gs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yf(e,t,n,r)});function Ch(e){return bd(Sh,e)}var wh=M(`ZodAny`,(e,t)=>{_s.init(e,t),V.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function K(){return xd(wh)}var Th=M(`ZodUnknown`,(e,t)=>{vs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Eh(){return Sd(Th)}var Dh=M(`ZodNever`,(e,t)=>{ys.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qf(e,t,n,r)});function Oh(e){return Cd(Dh,e)}var kh=M(`ZodVoid`,(e,t)=>{bs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zf(e,t,n,r)});function Ah(e){return wd(kh,e)}var jh=M(`ZodDate`,(e,t)=>{xs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tp(e,t,n,r),e.min=(t,n)=>e.check(jd(t,n)),e.max=(t,n)=>e.check(kd(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 Mh(e){return Td(jh,e)}var Nh=M(`ZodArray`,(e,t)=>{Cs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pp(e,t,n,r),e.element=t.element,sm(e,`ZodArray`,{min(e,t){return this.check(Vd(e,t))},nonempty(e){return this.check(Vd(1,e))},max(e,t){return this.check(Bd(e,t))},length(e,t){return this.check(Hd(e,t))},unwrap(){return this.element}})});function q(e,t){return rf(Nh,e,t)}function Ph(e){let t=e._zod.def.shape;return X(Object.keys(t))}var Fh=M(`ZodObject`,(e,t)=>{Os.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mp(e,t,n,r),P(e,`shape`,()=>t.shape),sm(e,`ZodObject`,{keyof(){return X(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Eh()})},loose(){return this.clone({...this._zod.def,catchall:Eh()})},strict(){return this.clone({...this._zod.def,catchall:Oh()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Zr(this,e)},safeExtend(e){return Qr(this,e)},merge(e){return $r(this,e)},pick(e){return Yr(this,e)},omit(e){return Xr(this,e)},partial(...e){return ei(cg,this,e[0])},required(...e){return ti(yg,this,e[0])}})});function J(e,t){return new Fh({type:`object`,shape:e??{},...F(t)})}function Ih(e,t){return new Fh({type:`object`,shape:e,catchall:Oh(),...F(t)})}function Lh(e,t){return new Fh({type:`object`,shape:e,catchall:Eh(),...F(t)})}var Rh=M(`ZodUnion`,(e,t)=>{As.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hp(e,t,n,r),e.options=t.options});function zh(e,t){return new Rh({type:`union`,options:e,...F(t)})}var Bh=M(`ZodXor`,(e,t)=>{Rh.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hp(e,t,n,r),e.options=t.options});function Vh(e,t){return new Bh({type:`union`,options:e,inclusive:!1,...F(t)})}var Hh=M(`ZodDiscriminatedUnion`,(e,t)=>{Rh.init(e,t),Ns.init(e,t)});function Uh(e,t,n){return new Hh({type:`union`,options:t,discriminator:e,...F(n)})}var Wh=M(`ZodIntersection`,(e,t)=>{Ps.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gp(e,t,n,r)});function Gh(e,t){return new Wh({type:`intersection`,left:e,right:t})}var Kh=M(`ZodTuple`,(e,t)=>{Ls.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_p(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function qh(e,t,n){let r=t instanceof R;return new Kh({type:`tuple`,items:e,rest:r?t:null,...F(r?n:t)})}var Jh=M(`ZodRecord`,(e,t)=>{Vs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vp(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Y(e,t,n){return!t||!t._zod?new Jh({type:`record`,keyType:H(),valueType:e,...F(t)}):new Jh({type:`record`,keyType:e,valueType:t,...F(n)})}function Yh(e,t,n){let r=Wr(e);return r._zod.values=void 0,new Jh({type:`record`,keyType:r,valueType:t,...F(n)})}function Xh(e,t,n){return new Jh({type:`record`,keyType:e,valueType:t,mode:`loose`,...F(n)})}var Zh=M(`ZodMap`,(e,t)=>{Hs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dp(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Rd(...t)),e.nonempty=t=>e.check(Rd(1,t)),e.max=(...t)=>e.check(Ld(...t)),e.size=(...t)=>e.check(zd(...t))});function Qh(e,t,n){return new Zh({type:`map`,keyType:e,valueType:t,...F(n)})}var $h=M(`ZodSet`,(e,t)=>{Ws.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fp(e,t,n,r),e.min=(...t)=>e.check(Rd(...t)),e.nonempty=t=>e.check(Rd(1,t)),e.max=(...t)=>e.check(Ld(...t)),e.size=(...t)=>e.check(zd(...t))});function eg(e,t){return new $h({type:`set`,valueType:e,...F(t)})}var tg=M(`ZodEnum`,(e,t)=>{Ks.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>np(e,t,n,r),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 tg({...t,checks:[],...F(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 tg({...t,checks:[],...F(r),entries:i})}});function X(e,t){return new tg({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...F(t)})}function ng(e,t){return new tg({type:`enum`,entries:e,...F(t)})}var rg=M(`ZodLiteral`,(e,t)=>{qs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rp(e,t,n,r),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 Z(e,t){return new rg({type:`literal`,values:Array.isArray(e)?e:[e],...F(t)})}var ig=M(`ZodFile`,(e,t)=>{Js.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>op(e,t,n,r),e.min=(t,n)=>e.check(Rd(t,n)),e.max=(t,n)=>e.check(Ld(t,n)),e.mime=(t,n)=>e.check(Xd(Array.isArray(t)?t:[t],n))});function ag(e){return gf(ig,e)}var og=M(`ZodTransform`,(e,t)=>{Ys.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>up(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new lr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(li(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(li(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function sg(e){return new og({type:`transform`,transform:e})}var cg=M(`ZodOptional`,(e,t)=>{Zs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lg(e){return new cg({type:`optional`,innerType:e})}var ug=M(`ZodExactOptional`,(e,t)=>{Qs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dg(e){return new ug({type:`optional`,innerType:e})}var fg=M(`ZodNullable`,(e,t)=>{$s.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pg(e){return new fg({type:`nullable`,innerType:e})}function mg(e){return lg(pg(e))}var hg=M(`ZodDefault`,(e,t)=>{ec.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gg(e,t){return new hg({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var _g=M(`ZodPrefault`,(e,t)=>{nc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vg(e,t){return new _g({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var yg=M(`ZodNonOptional`,(e,t)=>{rc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bg(e,t){return new yg({type:`nonoptional`,innerType:e,...F(t)})}var xg=M(`ZodSuccess`,(e,t)=>{ac.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sg(e){return new xg({type:`success`,innerType:e})}var Cg=M(`ZodCatch`,(e,t)=>{oc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wg(e,t){return new Cg({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Tg=M(`ZodNaN`,(e,t)=>{sc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ip(e,t,n,r)});function Eg(e){return Dd(Tg,e)}var Dg=M(`ZodPipe`,(e,t)=>{cc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wp(e,t,n,r),e.in=t.in,e.out=t.out});function Og(e,t){return new Dg({type:`pipe`,in:e,out:t})}var kg=M(`ZodCodec`,(e,t)=>{Dg.init(e,t),uc.init(e,t)});function Ag(e,t,n){return new kg({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function jg(e){let t=e._zod.def;return new kg({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Mg=M(`ZodPreprocess`,(e,t)=>{Dg.init(e,t),pc.init(e,t)}),Ng=M(`ZodReadonly`,(e,t)=>{mc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pg(e){return new Ng({type:`readonly`,innerType:e})}var Fg=M(`ZodTemplateLiteral`,(e,t)=>{gc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ap(e,t,n,r)});function Ig(e,t){return new Fg({type:`template_literal`,parts:e,...F(t)})}var Lg=M(`ZodLazy`,(e,t)=>{yc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Op(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Rg(e){return new Lg({type:`lazy`,getter:e})}var zg=M(`ZodPromise`,(e,t)=>{vc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ep(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bg(e){return new zg({type:`promise`,innerType:e})}var Vg=M(`ZodFunction`,(e,t)=>{_c.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lp(e,t,n,r)});function Hg(e){return new Vg({type:`function`,input:Array.isArray(e?.input)?qh(e?.input):e?.input??q(Eh()),output:e?.output??Eh()})}var Ug=M(`ZodCustom`,(e,t)=>{bc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cp(e,t,n,r)});function Wg(e){let t=new so({check:`custom`});return t._zod.check=e,t}function Gg(e,t){return kf(Ug,e??(()=>!0),t)}function Kg(e,t={}){return Af(Ug,e,t)}function qg(e,t){return jf(e,t)}var Jg=Nf,Yg=Pf;function Xg(e,t={}){let n=new Ug({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...F(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Zg=(...e)=>Ff({Codec:kg,Boolean:fh,String:lm},...e);function Qg(e){let t=Rg(()=>zh([H(e),W(),G(),Ch(),q(t),Y(H(),t)]));return t}function $g(e,t){return new Mg({type:`pipe`,in:sg(e),out:t})}var e_={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 t_(e){dr({customError:e})}function n_(){return dr().customError}var r_;(function(e){})(r_||={});var Q={...am,...Pp,iso:Fp},i_=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function a_(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function o_(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function s_(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return Q.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Q.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=c_(o_(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return Q.null();if(n.length===0)return Q.never();if(n.length===1)return Q.literal(n[0]);if(n.every(e=>typeof e==`string`))return Q.enum(n);let r=n.map(e=>Q.literal(e));return r.length<2?r[0]:Q.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return Q.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>s_({...e,type:n},t));return r.length===0?Q.never():r.length===1?r[0]:Q.union(r)}if(!n)return Q.any();let r;switch(n){case`string`:{let t=Q.string();if(e.format){let n=e.format;n===`email`?t=t.check(Q.email()):n===`uri`||n===`uri-reference`?t=t.check(Q.url()):n===`uuid`||n===`guid`?t=t.check(Q.uuid()):n===`date-time`?t=t.check(Q.iso.datetime()):n===`date`?t=t.check(Q.iso.date()):n===`time`?t=t.check(Q.iso.time()):n===`duration`?t=t.check(Q.iso.duration()):n===`ipv4`?t=t.check(Q.ipv4()):n===`ipv6`?t=t.check(Q.ipv6()):n===`mac`?t=t.check(Q.mac()):n===`cidr`?t=t.check(Q.cidrv4()):n===`cidr-v6`?t=t.check(Q.cidrv6()):n===`base64`?t=t.check(Q.base64()):n===`base64url`?t=t.check(Q.base64url()):n===`e164`?t=t.check(Q.e164()):n===`jwt`?t=t.check(Q.jwt()):n===`emoji`?t=t.check(Q.emoji()):n===`nanoid`?t=t.check(Q.nanoid()):n===`cuid`?t=t.check(Q.cuid()):n===`cuid2`?t=t.check(Q.cuid2()):n===`ulid`?t=t.check(Q.ulid()):n===`xid`?t=t.check(Q.xid()):n===`ksuid`&&(t=t.check(Q.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?Q.number().int():Q.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=Q.boolean();break;case`null`:r=Q.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=c_(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=c_(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?c_(e.additionalProperties,t):Q.any();if(Object.keys(n).length===0){r=Q.record(i,a);break}let o=Q.object(n).passthrough(),s=Q.looseRecord(i,a);r=Q.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=c_(i[e],t),r=Q.string().regex(new RegExp(e));o.push(Q.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(Q.object(n).passthrough()),s.push(...o),s.length===0)r=Q.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=Q.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=Q.intersection(e,s[t]);r=e}break}let o=Q.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(c_(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>c_(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?c_(i,t):void 0;r=o?Q.tuple(a).rest(o):Q.tuple(a),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>c_(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?c_(e.additionalItems,t):void 0;r=a?Q.tuple(n).rest(a):Q.tuple(n),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(i!==void 0){let n=c_(i,t),a=Q.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=Q.array(Q.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function c_(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n=s_(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>c_(e,t)),a=Q.union(i);n=r?Q.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>c_(e,t)),a=Q.xor(i);n=r?Q.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:Q.any();else{let i=r?n:c_(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=Q.intersection(i,c_(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=Q.nullable(n)),e.readOnly===!0&&(n=Q.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))i_.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function l_(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:a_(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Ou};return c_(n,r)}var u_=a({bigint:()=>m_,boolean:()=>p_,date:()=>h_,number:()=>f_,string:()=>d_});function d_(e){return Au(lm,e)}function f_(e){return od(ah,e)}function p_(e){return pd(fh,e)}function m_(e){return hd(ph,e)}function h_(e){return Ed(jh,e)}var g_=a({$brand:()=>sr,$input:()=>Tu,$output:()=>wu,NEVER:()=>or,TimePrecision:()=>ed,ZodAny:()=>wh,ZodArray:()=>Nh,ZodBase64:()=>Km,ZodBase64URL:()=>Jm,ZodBigInt:()=>ph,ZodBigIntFormat:()=>hh,ZodBoolean:()=>fh,ZodCIDRv4:()=>Hm,ZodCIDRv6:()=>Wm,ZodCUID:()=>Em,ZodCUID2:()=>Om,ZodCatch:()=>Cg,ZodCodec:()=>kg,ZodCustom:()=>Ug,ZodCustomStringFormat:()=>eh,ZodDate:()=>jh,ZodDefault:()=>hg,ZodDiscriminatedUnion:()=>Hh,ZodE164:()=>Xm,ZodEmail:()=>um,ZodEmoji:()=>Sm,ZodEnum:()=>tg,ZodError:()=>Gp,ZodExactOptional:()=>ug,ZodFile:()=>ig,ZodFirstPartyTypeKind:()=>r_,ZodFunction:()=>Vg,ZodGUID:()=>fm,ZodIPv4:()=>Im,ZodIPv6:()=>Bm,ZodISODate:()=>Rp,ZodISODateTime:()=>Ip,ZodISODuration:()=>Hp,ZodISOTime:()=>Bp,ZodIntersection:()=>Wh,ZodIssueCode:()=>e_,ZodJWT:()=>Qm,ZodKSUID:()=>Pm,ZodLazy:()=>Lg,ZodLiteral:()=>rg,ZodMAC:()=>Rm,ZodMap:()=>Zh,ZodNaN:()=>Tg,ZodNanoID:()=>wm,ZodNever:()=>Dh,ZodNonOptional:()=>yg,ZodNull:()=>Sh,ZodNullable:()=>fg,ZodNumber:()=>ah,ZodNumberFormat:()=>oh,ZodObject:()=>Fh,ZodOptional:()=>cg,ZodPipe:()=>Dg,ZodPrefault:()=>_g,ZodPreprocess:()=>Mg,ZodPromise:()=>zg,ZodReadonly:()=>Ng,ZodRealError:()=>Kp,ZodRecord:()=>Jh,ZodSet:()=>$h,ZodString:()=>lm,ZodStringFormat:()=>U,ZodSuccess:()=>xg,ZodSymbol:()=>vh,ZodTemplateLiteral:()=>Fg,ZodTransform:()=>og,ZodTuple:()=>Kh,ZodType:()=>V,ZodULID:()=>Am,ZodURL:()=>ym,ZodUUID:()=>mm,ZodUndefined:()=>bh,ZodUnion:()=>Rh,ZodUnknown:()=>Th,ZodVoid:()=>kh,ZodXID:()=>Mm,ZodXor:()=>Bh,_ZodString:()=>cm,_default:()=>gg,_function:()=>Hg,any:()=>K,array:()=>q,base64:()=>qm,base64url:()=>Ym,bigint:()=>mh,boolean:()=>G,catch:()=>wg,check:()=>Wg,cidrv4:()=>Um,cidrv6:()=>Gm,clone:()=>Wr,codec:()=>Ag,coerce:()=>u_,config:()=>dr,core:()=>Np,cuid:()=>Dm,cuid2:()=>km,custom:()=>Gg,date:()=>Mh,decode:()=>Qp,decodeAsync:()=>em,describe:()=>Jg,discriminatedUnion:()=>Uh,e164:()=>Zm,email:()=>dm,emoji:()=>Cm,encode:()=>Zp,encodeAsync:()=>$p,endsWith:()=>Jd,enum:()=>X,exactOptional:()=>dg,file:()=>ag,flattenError:()=>xi,float32:()=>ch,float64:()=>lh,formatError:()=>Si,fromJSONSchema:()=>l_,function:()=>Hg,getErrorMap:()=>n_,globalRegistry:()=>Ou,gt:()=>Ad,gte:()=>jd,guid:()=>pm,hash:()=>ih,hex:()=>rh,hostname:()=>nh,httpUrl:()=>xm,includes:()=>Kd,instanceof:()=>Xg,int:()=>sh,int32:()=>uh,int64:()=>gh,intersection:()=>Gh,invertCodec:()=>jg,ipv4:()=>Lm,ipv6:()=>Vm,iso:()=>Fp,json:()=>Qg,jwt:()=>$m,keyof:()=>Ph,ksuid:()=>Fm,lazy:()=>Rg,length:()=>Hd,literal:()=>Z,locales:()=>Su,looseObject:()=>Lh,looseRecord:()=>Xh,lowercase:()=>Wd,lt:()=>Od,lte:()=>kd,mac:()=>zm,map:()=>Qh,maxLength:()=>Bd,maxSize:()=>Ld,meta:()=>Yg,mime:()=>Xd,minLength:()=>Vd,minSize:()=>Rd,multipleOf:()=>Id,nan:()=>Eg,nanoid:()=>Tm,nativeEnum:()=>ng,negative:()=>Nd,never:()=>Oh,nonnegative:()=>Fd,nonoptional:()=>bg,nonpositive:()=>Pd,normalize:()=>Qd,null:()=>Ch,nullable:()=>pg,nullish:()=>mg,number:()=>W,object:()=>J,optional:()=>lg,overwrite:()=>Zd,parse:()=>qp,parseAsync:()=>Jp,partialRecord:()=>Yh,pipe:()=>Og,positive:()=>Md,prefault:()=>vg,preprocess:()=>$g,prettifyError:()=>Ti,promise:()=>Bg,property:()=>Yd,readonly:()=>Pg,record:()=>Y,refine:()=>Kg,regex:()=>Ud,regexes:()=>Xi,registry:()=>Du,safeDecode:()=>nm,safeDecodeAsync:()=>im,safeEncode:()=>tm,safeEncodeAsync:()=>rm,safeParse:()=>Yp,safeParseAsync:()=>Xp,set:()=>eg,setErrorMap:()=>t_,size:()=>zd,slugify:()=>nf,startsWith:()=>qd,strictObject:()=>Ih,string:()=>H,stringFormat:()=>th,stringbool:()=>Zg,success:()=>Sg,superRefine:()=>qg,symbol:()=>yh,templateLiteral:()=>Ig,toJSONSchema:()=>Ap,toLowerCase:()=>ef,toUpperCase:()=>tf,transform:()=>sg,treeifyError:()=>Ci,trim:()=>$d,tuple:()=>qh,uint32:()=>dh,uint64:()=>_h,ulid:()=>jm,undefined:()=>xh,union:()=>zh,unknown:()=>Eh,uppercase:()=>Gd,url:()=>bm,util:()=>fr,uuid:()=>hm,uuidv4:()=>gm,uuidv6:()=>_m,uuidv7:()=>vm,void:()=>Ah,xid:()=>Nm,xor:()=>Vh});dr(Hc()),rr(g_);var __=J({created_at:H(),updated_at:H()}),v_=J({id:H(),version:H().optional()}),y_=J({name:H(),version:H()}),b_=J({name:H(),value:H().optional()}),x_=J({name:H().max(255),code:H().max(1e5),supported_triggers:q(v_).optional(),runtime:H().max(50).optional(),dependencies:q(y_).optional(),secrets:q(b_).optional(),is_system:G().optional(),inherit:G().optional()});x_.partial().extend({status:X([`draft`,`built`]).optional(),deployed_at:H().optional()}),x_.extend({id:H(),tenant_id:H(),status:X([`draft`,`built`]).default(`built`),deployed_at:H().optional(),secrets:q(J({name:H(),value:H().optional()})).optional()}).extend(__.shape);var S_=H(),C_=X([`unspecified`,`pending`,`final`,`partial`,`canceled`,`suspended`]),w_=J({id:H(),msg:H(),url:H().optional()}),T_=J({action_name:H(),error:w_.nullable(),started_at:H(),ended_at:H()}),E_=J({level:X([`log`,`info`,`warn`,`error`,`debug`]),message:H()}),D_=q(J({action_name:H(),lines:q(E_)}));J({id:H(),tenant_id:H(),trigger_id:S_,status:C_,results:q(T_),logs:D_.optional(),created_at:H(),updated_at:H()}).omit({tenant_id:!0,created_at:!0,updated_at:!0}),J({action_id:H(),code:H().max(1e5),runtime:H().max(50).optional(),dependencies:q(y_).optional(),secrets:q(b_).optional(),supported_triggers:q(v_).optional(),deployed:G().default(!0)}).extend({id:H(),tenant_id:H(),number:W().int()}).extend(__.shape);var O_=X([`user_action`,`admin_action`,`system`,`api`]),k_=J({type:X([`user`,`admin`,`system`,`api_key`,`client_credentials`]),id:H().optional(),email:H().optional(),org_id:H().optional(),org_name:H().optional(),scopes:q(H()).optional(),client_id:H().optional()}),A_=J({type:H(),id:H(),before:Y(H(),Eh()).optional(),after:Y(H(),Eh()).optional(),diff:Y(H(),J({old:Eh(),new:Eh()})).optional()}),j_=J({method:H(),path:H(),query:Y(H(),H()).optional(),body:Eh().optional(),ip:H(),user_agent:H().optional(),correlation_id:H().optional()}),M_=J({status_code:W(),body:Eh().optional()}),N_=J({country_code:H(),city_name:H(),latitude:H(),longitude:H(),time_zone:H(),continent_code:H()}),P_=J({name:H(),version:H(),env:Y(H(),H()).optional()});J({tenant_id:H(),event_type:H(),log_type:H(),description:H().optional(),category:O_,actor:k_,target:A_,request:j_,response:M_.optional(),connection:H().optional(),strategy:H().optional(),strategy_type:H().optional(),audience:H().optional(),scope:H().optional(),location:N_.optional(),auth0_client:P_.optional(),hostname:H(),is_mobile:G().optional(),timestamp:H()}).extend({id:H()}),X([`AUTH0`,`EMAIL`,`REDIRECT`]),X([`CREATE_USER`,`GET_USER`,`UPDATE_USER`,`SEND_REQUEST`,`SEND_EMAIL`]),X([`VERIFY_EMAIL`]);var F_=J({require_mx_record:G().optional(),block_aliases:G().optional(),block_free_emails:G().optional(),block_disposable_emails:G().optional(),blocklist:q(H()).optional(),allowlist:q(H()).optional()}),I_=J({id:H(),alias:H().max(100).optional(),type:Z(`AUTH0`),action:Z(`UPDATE_USER`),allow_failure:G().optional(),mask_output:G().optional(),params:J({connection_id:H().optional(),user_id:H(),changes:Y(H(),K())})}),L_=J({id:H(),alias:H().max(100).optional(),type:Z(`EMAIL`),action:Z(`VERIFY_EMAIL`),allow_failure:G().optional(),mask_output:G().optional(),params:J({email:H(),rules:F_.optional()})}),R_=X([`change-email`,`account`,`custom`]),z_=zh([I_,L_,J({id:H(),alias:H().max(100).optional(),type:Z(`REDIRECT`),action:Z(`REDIRECT_USER`),allow_failure:G().optional(),mask_output:G().optional(),params:J({target:R_.openapi({description:`The predefined target to redirect to, or 'custom' for a custom URL`}),custom_url:H().optional().openapi({description:`Custom URL to redirect to when target is 'custom'`})})})]);J({name:H().min(1).max(150).openapi({description:`The name of the flow`}),actions:q(z_).optional().default([]).openapi({description:`The list of actions to execute in sequence`})}).extend(__.shape).extend({id:H().openapi({description:`Unique identifier for the flow`,example:`af_12tMpdJ3iek7svMyZkSh5M`})}),J({page:H().min(0).optional().default(`0`).transform(e=>parseInt(e,10)).openapi({description:`The page number where 0 is the first page`}),per_page:H().min(1).optional().default(`10`).transform(e=>parseInt(e,10)).openapi({description:`The number of items per page`}),include_totals:H().optional().default(`false`).transform(e=>e===`true`).openapi({description:`If the total number of items should be included in the response`}),sort:H().regex(/^.+:(-1|1)$/).optional().openapi({description:`A property that should have the format 'string:-1' or 'string:1'`}),q:H().optional().openapi({description:`A lucene query string used to filter the results`})}),J({start:W(),limit:W(),length:W(),total:W().optional()});var B_=J({email:H().optional(),email_verified:G().optional(),name:H().optional(),username:H().optional(),given_name:H().optional(),phone_number:H().optional(),phone_verified:G().optional(),family_name:H().optional()}).catchall(K()),V_=J({connection:H(),user_id:H(),provider:H(),isSocial:G(),email:H().optional(),email_verified:G().optional(),phone_number:H().optional(),phone_verified:G().optional(),username:H().optional(),access_token:H().optional(),access_token_secret:H().optional(),refresh_token:H().optional(),profileData:B_.optional()}),H_=J({formatted:H().optional(),street_address:H().optional(),locality:H().optional(),region:H().optional(),postal_code:H().optional(),country:H().optional()}).optional(),U_=J({email:H().transform(e=>e.toLowerCase()).optional(),username:H().refine(e=>!e.includes(`@`),{message:`Usernames must not contain "@". Use the email field for email addresses.`}).optional(),phone_number:H().optional(),phone_verified:G().optional(),given_name:H().optional(),family_name:H().optional(),nickname:H().optional(),name:H().optional(),picture:H().optional(),locale:H().optional(),linked_to:H().optional(),profileData:H().optional(),user_id:H().optional(),app_metadata:K().default({}).optional(),user_metadata:K().default({}).optional(),middle_name:H().optional(),preferred_username:H().optional(),profile:H().optional(),website:H().optional(),gender:H().optional(),birthdate:H().optional(),zoneinfo:H().optional(),address:H_});U_.extend({email_verified:G().default(!1),verify_email:G().optional(),last_ip:H().optional(),last_login:H().optional(),user_id:H().optional(),provider:H().optional(),connection:H(),is_social:G().optional(),registration_completed_at:H().optional(),password:J({hash:H(),algorithm:H()}).optional()}).omit({password:!0}).extend(__.shape).extend({user_id:H(),provider:H(),is_social:G(),email:H().optional(),login_count:W().default(0),identities:q(V_).optional()}).omit({registration_completed_at:!0}),U_.extend({login_count:W(),multifactor:q(H()).optional(),last_ip:H().optional(),last_login:H().optional(),user_id:H()}).catchall(K());var W_=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,G_=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=W_[n[e]&63];return t},K_=J({client_id:H().optional().openapi({description:`ID of this client. Generated server-side if omitted (Auth0 behavior).`}),name:H().min(1).openapi({description:`Name of this client (min length: 1 character, does not allow < or >).`}),description:H().max(140).optional().openapi({description:`Free text description of this client (max length: 140 characters).`}),global:G().default(!1).openapi({description:`Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).`}),client_secret:H().default(()=>G_()).optional().openapi({description:`Client secret (which you must not make public).`}),app_type:X([`native`,`spa`,`regular_web`,`non_interactive`,`resource_server`,`express_configuration`,`rms`,`box`,`cloudbees`,`concur`,`dropbox`,`mscrm`,`echosign`,`egnyte`,`newrelic`,`office365`,`salesforce`,`sentry`,`sharepoint`,`slack`,`springcm`,`zendesk`,`zoom`,`sso_integration`,`oag`]).default(`regular_web`).optional().openapi({description:`The type of application this client represents`}),logo_uri:H().url().optional().openapi({description:`URL of the logo to display for this client. Recommended size is 150x150 pixels.`}),is_first_party:G().default(!1).openapi({description:`Whether this client a first party client (true) or not (false).`}),oidc_conformant:G().default(!0).openapi({description:`Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false).`}),auth0_conformant:G().default(!0).openapi({description:`Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance).`}),callbacks:q(H()).default([]).optional().openapi({description:`Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.`}),allowed_origins:q(H()).default([]).optional().openapi({description:`Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.`}),web_origins:q(H()).default([]).optional().openapi({description:`Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.`}),client_aliases:q(H()).default([]).optional().openapi({description:`List of audiences/realms for SAML protocol. Used by the wsfed addon.`}),allowed_clients:q(H()).default([]).optional().openapi({description:`List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.`}),connections:q(H()).default([]).optional().openapi({description:`List of connection IDs enabled for this client. The order determines the display order on the login page.`}),allowed_logout_urls:q(H()).default([]).optional().openapi({description:`Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.`}),session_transfer:Y(H(),K()).default({}).optional().openapi({description:`Native to Web SSO Configuration`}),oidc_logout:Y(H(),K()).default({}).optional().openapi({description:`Configuration for OIDC backchannel logout`}),grant_types:q(H()).default([]).optional().openapi({description:`List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.`}),jwt_configuration:Y(H(),K()).default({}).optional().openapi({description:`Configuration related to JWTs for the client.`}),signing_keys:q(Y(H(),K())).default([]).optional().openapi({description:`Signing certificates associated with this client.`}),encryption_key:Y(H(),K()).default({}).optional().openapi({description:`Encryption used for WsFed responses with this client.`}),sso:G().default(!1).openapi({description:`Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).`}),sso_disabled:G().default(!1).openapi({description:`Whether Single Sign On is disabled for this client. When true, existing SSO sessions will not be reused and users must authenticate every time.`}),cross_origin_authentication:G().default(!1).openapi({description:`Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).`}),cross_origin_loc:H().url().optional().openapi({description:`URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.`}),custom_login_page_on:G().default(!1).openapi({description:`Whether a custom login page is to be used (true) or the default provided login page (false).`}),custom_login_page:H().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page.`}),custom_login_page_preview:H().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page. (Used on Previews)`}),form_template:H().optional().openapi({description:`HTML form template to be used for WS-Federation.`}),addons:Y(H(),K()).default({}).optional().openapi({description:`Addons enabled for this client and their associated configurations.`}),token_endpoint_auth_method:X([`none`,`client_secret_post`,`client_secret_basic`,`client_secret_jwt`,`private_key_jwt`]).default(`client_secret_basic`).optional().openapi({description:"Defines the requested authentication method for the token endpoint. `none` (public client), `client_secret_post` / `client_secret_basic` (HTTP POST / Basic), `client_secret_jwt` (RFC 7523 HMAC assertion using client_secret), or `private_key_jwt` (RFC 7523 asymmetric assertion verified against the client's `jwks` / `jwks_uri`)."}),client_metadata:Y(H(),H().max(255)).default({}).optional().openapi({description:`Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?"/()<>@ [Tab][Space]`}),hide_sign_up_disabled_error:G().default(!1).optional().openapi({description:"Enumeration-safe variant of the connection-level `disable_signup` flag. When a signup is blocked by the password connection and this is true, the identifier screen does not reveal that an email is unknown — it advances to the OTP/password challenge as if the account existed and fails at credential check. Mitigates email enumeration at the cost of UX: users without an account see a generic credential failure instead of an explicit signup-disabled message."}),mobile:Y(H(),K()).default({}).optional().openapi({description:`Additional configuration for native mobile apps.`}),initiate_login_uri:H().url().optional().openapi({description:`Initiate login uri, must be https`}),native_social_login:Y(H(),K()).default({}).optional(),refresh_token:J({rotation_type:X([`rotating`,`non-rotating`]).optional().openapi({description:`Whether refresh tokens for this client are rotated on every exchange (Auth0 'rotating' behavior) or kept stable (legacy non-rotating). Defaults to 'non-rotating' when unset.`}),leeway:W().int().min(0).max(600).optional().openapi({description:`Seconds after a parent token's first rotation during which presenting it again still mints a fresh sibling child instead of triggering reuse-detection. Defaults to 30s when unset.`}),expiration_type:X([`expiring`,`non-expiring`]).optional().openapi({description:`Auth0-compatible: whether refresh tokens expire.`}),token_lifetime:W().int().min(0).optional().openapi({description:`Auth0-compatible: refresh-token absolute lifetime in seconds.`}),infinite_token_lifetime:G().optional().openapi({description:`Auth0-compatible: when true, refresh tokens have no absolute expiry.`}),idle_token_lifetime:W().int().min(0).optional().openapi({description:`Auth0-compatible: refresh-token idle (sliding) lifetime in seconds.`}),infinite_idle_token_lifetime:G().optional().openapi({description:`Auth0-compatible: when true, refresh tokens have no idle expiry.`})}).default({}).optional().openapi({description:`Refresh token configuration`}),default_organization:Y(H(),K()).default({}).optional().openapi({description:`Defines the default Organization ID and flows`}),organization_usage:X([`deny`,`allow`,`require`]).default(`deny`).optional().openapi({description:`Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require.`}),organization_require_behavior:X([`no_prompt`,`pre_login_prompt`,`post_login_prompt`]).default(`no_prompt`).optional().openapi({description:`Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true.`}),client_authentication_methods:Y(H(),K()).default({}).optional().openapi({description:`Defines client authentication methods.`}),require_pushed_authorization_requests:G().default(!1).openapi({description:`Makes the use of Pushed Authorization Requests mandatory for this client`}),require_proof_of_possession:G().default(!1).openapi({description:`Makes the use of Proof-of-Possession mandatory for this client`}),signed_request_object:Y(H(),K()).default({}).optional().openapi({description:`JWT-secured Authorization Requests (JAR) settings.`}),compliance_level:X([`none`,`fapi1_adv_pkj_par`,`fapi1_adv_mtls_par`,`fapi2_sp_pkj_mtls`,`fapi2_sp_mtls_mtls`]).optional().openapi({description:`Defines the compliance level for this client, which may restrict it's capabilities`}),par_request_expiry:W().optional().openapi({description:`Specifies how long, in seconds, a Pushed Authorization Request URI remains valid`}),token_quota:Y(H(),K()).default({}).optional(),owner_user_id:H().optional().openapi({description:`User ID of the consenting user when this client was created via IAT-gated Dynamic Client Registration. NULL for clients created via the Management API or open DCR.`}),registration_type:X([`manual`,`open_dcr`,`iat_dcr`]).optional().openapi({description:"Provenance of this client. `manual` = Management API; `open_dcr` = RFC 7591 without IAT; `iat_dcr` = RFC 7591 with an Initial Access Token."}),registration_metadata:Y(H(),K()).default({}).optional().openapi({description:"Arbitrary metadata captured at Dynamic Client Registration time that isn't a first-class client field (e.g. integration_type, domain). Also stores `iat_constraints` for clients created via IAT so RFC 7592 PUT can enforce field immutability."}),user_linking_mode:X([`builtin`,`off`]).optional().openapi({description:"Per-client override for the built-in email-based user-linking path. `builtin` runs the legacy in-process linking at user creation/email update. `off` disables the legacy path; linking only happens if the tenant has enabled the `account-linking` template hook. When unset, the service-level `userLinkingMode` default applies."})});J({created_at:H(),updated_at:H()}).extend(K_.shape).extend({client_id:H()});var q_=J({client_id:H().min(1).openapi({description:`ID of the client.`}),audience:H().min(1).openapi({description:`The audience (API identifier) of this client grant.`}),scope:q(H()).optional().openapi({description:`Scopes allowed for this client grant.`}),organization_usage:X([`deny`,`allow`,`require`]).optional().openapi({description:`Defines whether organizations can be used with client credentials exchanges for this grant.`}),allow_any_organization:G().optional().openapi({description:`If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.`}),is_system:G().optional().openapi({description:`If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.`}),subject_type:X([`client`,`user`]).optional().openapi({description:`The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`}),authorization_details_types:q(H()).optional().openapi({description:`Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`})});J({id:H().openapi({description:`ID of the client grant.`})}).extend(q_.shape).extend({created_at:H().optional(),updated_at:H().optional()});var J_=X([`iat`,`rat`]),Y_=J({id:H(),token_hash:H(),type:J_,client_id:H().optional(),sub:H().optional(),constraints:Y(H(),Eh()).optional(),single_use:G().default(!1),expires_at:H().optional()});J({created_at:H(),used_at:H().optional(),revoked_at:H().optional()}).extend(Y_.shape);var X_=J({x:W(),y:W()}),Z_=function(e){return e.RICH_TEXT=`RICH_TEXT`,e.NEXT_BUTTON=`NEXT_BUTTON`,e.BACK_BUTTON=`BACK_BUTTON`,e.SUBMIT_BUTTON=`SUBMIT_BUTTON`,e.DIVIDER=`DIVIDER`,e.TEXT=`TEXT`,e.EMAIL=`EMAIL`,e.PASSWORD=`PASSWORD`,e.NUMBER=`NUMBER`,e.PHONE=`PHONE`,e.DATE=`DATE`,e.CHECKBOX=`CHECKBOX`,e.RADIO=`RADIO`,e.SELECT=`SELECT`,e.HIDDEN=`HIDDEN`,e.LEGAL=`LEGAL`,e}({}),Q_=function(e){return e.BLOCK=`BLOCK`,e.FIELD=`FIELD`,e}({}),$_=J({id:H(),category:ng(Q_),type:ng(Z_)}),ev=zh([$_.extend({category:Z(`BLOCK`),type:Z(`RICH_TEXT`),config:J({content:H()}).passthrough()}),$_.extend({category:Z(`BLOCK`),type:zh([Z(`NEXT_BUTTON`),Z(`BACK_BUTTON`),Z(`SUBMIT_BUTTON`)]),config:J({text:H()}).passthrough()}),$_.extend({category:Z(`FIELD`),type:Z(`LEGAL`),required:G().optional(),sensitive:G().optional(),config:J({text:H()}).passthrough()}),$_.extend({category:Z(`FIELD`),type:zh([Z(`TEXT`),Z(`EMAIL`),Z(`PASSWORD`),Z(`NUMBER`),Z(`PHONE`),Z(`DATE`),Z(`CHECKBOX`),Z(`RADIO`),Z(`SELECT`),Z(`HIDDEN`)]),required:G().optional(),sensitive:G().optional(),config:J({label:H().optional(),placeholder:H().optional()}).passthrough()}),J({id:H(),category:H(),type:H()}).passthrough()]),tv=zh([J({id:H(),type:Z(`STEP`),coordinates:X_,alias:H().optional(),config:J({components:q(ev),next_node:H()}).passthrough()}),J({id:H(),type:Z(`FLOW`),coordinates:X_,alias:H().optional(),config:J({flow_id:H(),next_node:H()})}),J({id:H(),type:Z(`ACTION`),coordinates:X_,alias:H().optional(),config:J({action_type:X([`REDIRECT`]).openapi({description:`The type of action to perform`}),target:X([`change-email`,`account`,`custom`]).openapi({description:`The predefined target to redirect to`}),custom_url:H().optional().openapi({description:`Custom URL when target is 'custom'`}),next_node:H().openapi({description:`The next node to navigate to after action (for non-redirect actions)`})}).passthrough()}),J({id:H(),type:H(),coordinates:X_}).passthrough()]),nv=J({next_node:H(),coordinates:X_}).passthrough(),rv=J({resume_flow:G().optional(),coordinates:X_}).passthrough();J({id:H(),name:H(),languages:J({primary:H()}).passthrough(),nodes:q(tv),start:nv,ending:rv,created_at:H(),updated_at:H(),links:J({sdkSrc:H().optional(),sdk_src:H().optional()}).passthrough()}).passthrough().omit({id:!0,created_at:!0,updated_at:!0});var iv=function(e){return e.TOKEN=`token`,e.ID_TOKEN=`id_token`,e.TOKEN_ID_TOKEN=`id_token token`,e.CODE=`code`,e.CODE_ID_TOKEN=`code id_token`,e.CODE_TOKEN=`code token`,e.CODE_ID_TOKEN_TOKEN=`code id_token token`,e}({}),av=function(e){return e.QUERY=`query`,e.FRAGMENT=`fragment`,e.FORM_POST=`form_post`,e.WEB_MESSAGE=`web_message`,e.SAML_POST=`saml_post`,e}({}),ov=function(e){return e.S256=`S256`,e.Plain=`plain`,e}({}),sv=zh([Ch(),J({essential:G().optional(),value:Eh().optional(),values:q(Eh()).optional()})]).nullable(),cv=J({userinfo:Y(H(),sv).optional(),id_token:Y(H(),sv).optional()}),lv=J({client_id:H(),act_as:H().optional(),response_type:ng(iv).optional(),response_mode:ng(av).optional(),redirect_uri:H().optional(),audience:H().optional(),organization:H().optional(),state:H().optional(),nonce:H().optional(),scope:H().optional(),prompt:H().optional(),code_challenge_method:ng(ov).optional(),code_challenge:H().optional(),username:H().optional(),ui_locales:H().optional(),max_age:W().optional(),acr_values:H().optional(),claims:cv.optional(),vendor_id:H().optional()});J({colors:J({primary:H(),page_background:zh([H(),J({type:H().optional(),start:H().optional(),end:H().optional(),angle_deg:W().optional()})]).optional()}).optional(),logo_url:H().optional(),favicon_url:H().optional(),powered_by_logo_url:H().optional(),font:J({url:H()}).optional(),dark_mode:X([`dark`,`light`,`auto`]).optional()});var uv=X([`password_reset`,`email_verification`,`otp`,`mfa_otp`,`authorization_code`,`oauth2_state`,`ticket`]);J({code_id:H().openapi({description:`The code that will be used in for instance an email verification flow`}),login_id:H().openapi({description:`The id of the login session that the code is connected to`}),connection_id:H().optional().openapi({description:`The connection that the code is connected to`}),code_type:uv,code_verifier:H().optional().openapi({description:`The code verifier used in PKCE in outbound flows`}),code_challenge:H().optional().openapi({description:`The code challenge used in PKCE in outbound flows`}),code_challenge_method:X([`plain`,`S256`]).optional().openapi({description:`The code challenge method used in PKCE in outbound flows`}),redirect_uri:H().optional().openapi({description:`The redirect URI associated with the code`}),otp:H().optional().openapi({description:`The one-time password value for OTP-based flows`}),nonce:H().optional().openapi({description:`The nonce value used for security in OIDC flows`}),state:H().optional().openapi({description:`The state parameter used for CSRF protection in OAuth flows`}),expires_at:H(),used_at:H().optional(),user_id:H().optional()}).extend({created_at:H()});var dv=J({kid:H().optional(),team_id:H().optional(),realms:H().optional(),authentication_method:H().optional(),client_id:H().optional(),client_secret:H().optional(),app_secret:H().optional(),scope:H().optional(),authorization_endpoint:H().optional(),token_endpoint:H().optional(),userinfo_endpoint:H().optional(),jwks_uri:H().optional(),discovery_url:H().optional(),issuer:H().optional(),token_endpoint_auth_method:X([`client_secret_basic`,`client_secret_post`]).optional(),provider:H().optional(),from:H().optional(),twilio_sid:H().optional(),twilio_token:H().optional(),icon_url:H().optional(),domain_aliases:q(H()).optional(),callback_url:H().url().optional(),passwordPolicy:X([`none`,`low`,`fair`,`good`,`excellent`]).optional(),password_complexity_options:J({min_length:W().optional()}).optional(),password_history:J({enable:G().optional(),size:W().optional()}).optional(),password_no_personal_info:J({enable:G().optional()}).optional(),password_dictionary:J({enable:G().optional(),dictionary:q(H()).optional()}).optional(),disable_signup:G().optional(),brute_force_protection:G().optional(),import_mode:G().optional(),configuration:J({token_endpoint:H().optional(),userinfo_endpoint:H().optional(),client_id:H().optional(),client_secret:H().optional(),realm:H().optional()}).optional(),attributes:J({email:J({identifier:J({active:G().optional()}).optional(),signup:J({status:X([`required`,`optional`,`disabled`]).optional(),verification:J({active:G().optional()}).optional()}).optional(),validation:J({allowed:G().optional()}).optional(),unique:G().optional(),profile_required:G().optional(),verification_method:X([`link`,`code`]).optional()}).optional(),username:J({identifier:J({active:G().optional()}).optional(),signup:J({status:X([`required`,`optional`,`disabled`]).optional()}).optional(),validation:J({max_length:W().optional(),min_length:W().optional(),allowed_types:J({email:G().optional(),phone_number:G().optional()}).optional()}).optional(),profile_required:G().optional()}).optional(),phone_number:J({identifier:J({active:G().optional()}).optional(),signup:J({status:X([`required`,`optional`,`disabled`]).optional()}).optional()}).optional()}).optional(),authentication_methods:J({password:J({enabled:G().optional()}).optional(),passkey:J({enabled:G().optional()}).optional()}).optional(),passkey_options:J({challenge_ui:X([`both`,`autofill`,`button`]).optional(),local_enrollment_enabled:G().optional(),progressive_enrollment_enabled:G().optional()}).optional(),requires_username:G().optional(),validation:J({username:J({min:W().optional(),max:W().optional()}).optional()}).optional(),set_user_root_attributes:X([`on_each_login`,`on_first_login`,`never_on_login`]).optional()});function fv(e){if(e!==null){if(Array.isArray(e))return e.filter(e=>e!==null).map(fv);if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))r!==null&&(t[n]=fv(r));return t}return e}}var pv=J({id:H().optional(),name:H(),display_name:H().optional(),strategy:H(),options:$g(e=>e===null?{}:fv(e),dv).default({}),enabled_clients:q(H()).default([]).optional(),response_type:Gg().optional(),response_mode:Gg().optional(),is_domain_connection:G().optional(),show_as_button:G().optional(),metadata:Y(H(),K()).optional(),is_system:G().optional()});J({id:H(),created_at:H().transform(e=>e===null?``:e),updated_at:H().transform(e=>e===null?``:e)}).extend(pv.shape);var mv=J({domain:H(),custom_domain_id:H().optional(),type:X([`auth0_managed_certs`,`self_managed_certs`]),verification_method:X([`txt`]).optional(),tls_policy:X([`recommended`]).optional(),custom_client_ip_header:X([`true-client-ip`,`cf-connecting-ip`,`x-forwarded-for`,`x-azure-clientip`,`null`]).optional(),domain_metadata:Y(H(),H().max(255)).optional()}),hv=Uh(`name`,[J({name:Z(`txt`),record:H(),domain:H()}),J({name:Z(`http`),http_body:H(),http_url:H()})]);mv.extend({custom_domain_id:H(),primary:G(),status:X([`disabled`,`pending`,`pending_verification`,`ready`]),origin_domain_name:H().optional(),verification:J({methods:q(hv)}).optional(),tls_policy:H().optional()}).extend({tenant_id:H()}),J({certificate:H().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/,`must be PEM-encoded; include the full certificate chain in leaf-first order`),private_key:H().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/,`must be a PEM-encoded private key`)});var gv=J({id:H(),order:W().optional(),visible:G().optional().default(!0)}),_v=gv.extend({category:Z(`BLOCK`).optional()}),vv=_v.extend({type:Z(`DIVIDER`),config:J({text:H().optional()}).optional()}),yv=_v.extend({type:Z(`HTML`),config:J({content:H().optional()}).optional()}),bv=_v.extend({type:Z(`IMAGE`),config:J({src:H().optional(),alt:H().optional(),width:W().optional(),height:W().optional()}).optional()}),xv=_v.extend({type:Z(`JUMP_BUTTON`),config:J({text:H().optional(),target_step:H().optional()})}),Sv=_v.extend({type:Z(`RESEND_BUTTON`),config:J({text:H().optional(),resend_action:H().optional()})}),Cv=_v.extend({type:Z(`NEXT_BUTTON`),config:J({text:H().optional()})}),wv=_v.extend({type:Z(`PREVIOUS_BUTTON`),config:J({text:H().optional()})}),Tv=_v.extend({type:Z(`RICH_TEXT`),config:J({content:H().optional()}).optional()}),Ev=gv.extend({category:Z(`WIDGET`).optional(),label:H().min(1).optional(),hint:H().min(1).max(500).optional(),required:G().optional(),sensitive:G().optional()}),Dv=Ev.extend({type:Z(`AUTH0_VERIFIABLE_CREDENTIALS`),config:J({credential_type:H().optional()})}),Ov=Ev.extend({type:Z(`GMAPS_ADDRESS`),config:J({api_key:H().optional()})}),kv=Ev.extend({type:Z(`RECAPTCHA`),config:J({site_key:H().optional()})}),Av=gv.extend({category:Z(`FIELD`).optional(),label:H().min(1).optional(),hint:H().min(1).max(500).optional(),messages:q(J({id:W().optional(),text:H(),type:X([`info`,`error`,`success`,`warning`])})).optional(),required:G().optional(),sensitive:G().optional()}),jv=Av.extend({type:Z(`BOOLEAN`),config:J({default_value:G().optional()}).optional()}),Mv=Av.extend({type:Z(`CARDS`),config:J({options:q(J({value:H(),label:H(),description:H().optional(),image:H().optional()})).optional(),multi_select:G().optional()}).optional()}),Nv=Av.extend({type:Z(`CHOICE`),config:J({options:q(J({value:H(),label:H()})).optional(),display:X([`radio`,`checkbox`]).optional(),multiple:G().optional(),default_value:zh([H(),q(H())]).optional()}).optional()}),Pv=Av.extend({type:Z(`CUSTOM`),config:J({component:H().optional(),props:Y(H(),K()).optional(),schema:Y(H(),K()).optional(),code:H().optional()})}),Fv=Av.extend({type:Z(`DATE`),config:J({format:H().optional(),min:H().optional(),max:H().optional(),default_value:H().optional()}).optional()}),Iv=Av.extend({type:Z(`DROPDOWN`),config:J({options:q(J({value:H(),label:H()})).optional(),placeholder:H().optional(),searchable:G().optional(),multiple:G().optional(),default_value:zh([H(),q(H())]).optional()}).optional()}),Lv=Av.extend({type:Z(`EMAIL`),config:J({placeholder:H().optional(),default_value:H().optional()}).optional()}),Rv=Av.extend({type:Z(`FILE`),config:J({accept:H().optional(),max_size:W().optional(),multiple:G().optional()}).optional()}),zv=Av.extend({type:Z(`LEGAL`),config:J({text:H(),html:G().optional()}).optional()}),Bv=Av.extend({type:Z(`NUMBER`),config:J({placeholder:H().optional(),min:W().optional(),max:W().optional(),step:W().optional(),default_value:H().optional()}).optional()}),Vv=Av.extend({type:Z(`PASSWORD`),config:J({placeholder:H().optional(),min_length:W().optional(),show_toggle:G().optional(),forgot_password_link:H().optional(),default_value:H().optional()}).optional()}),Hv=Av.extend({type:Z(`PAYMENT`),config:J({provider:H().optional(),currency:H().optional()}).optional()}),Uv=Av.extend({type:Z(`SOCIAL`),config:J({providers:q(H()).optional(),provider_details:q(J({name:H(),strategy:H().optional(),display_name:H().optional(),icon_url:H().optional(),href:H().optional()})).optional()}).optional()}),Wv=Av.extend({type:Z(`TEL`),config:J({placeholder:H().optional(),default_country:H().optional(),default_value:H().optional(),allow_email:G().optional()}).optional()}),Gv=Av.extend({type:Z(`TEXT`),config:J({placeholder:H().optional(),multiline:G().optional(),max_length:W().optional(),default_value:H().optional()}).optional()}),Kv=Av.extend({type:Z(`COUNTRY`),config:J({placeholder:H().optional(),default_value:H().optional()}).optional()}),qv=Av.extend({type:Z(`URL`),config:J({placeholder:H().optional(),default_value:H().optional()}).optional()}),Jv=zh([Uh(`type`,[vv,yv,bv,xv,Sv,Cv,wv,Tv]),Uh(`type`,[Dv,Ov,kv]),Uh(`type`,[jv,Mv,Nv,Kv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,qv])]);new Set([`BOOLEAN`,`CARDS`,`CHOICE`,`COUNTRY`,`DATE`,`DROPDOWN`,`EMAIL`,`LEGAL`,`NUMBER`,`PASSWORD`,`TEL`,`TEXT`,`URL`]),J({id:H(),type:Z(`submit`),label:H(),className:H().optional(),disabled:G().optional().default(!1),order:W().optional(),visible:G().optional().default(!0),customizations:Y(H(),K()).optional()});var Yv=J({x:W(),y:W()}),Xv=Uh(`type`,[J({id:H(),type:Z(`FLOW`),coordinates:Yv,alias:H().min(1).max(150).optional(),config:J({flow_id:H().max(30),next_node:H().optional()})}),J({id:H(),type:Z(`ROUTER`),coordinates:Yv,alias:H().min(1).max(150),config:J({rules:q(J({id:H(),alias:H().min(1).max(150).optional(),condition:K(),next_node:H()})),fallback:H()})}),J({id:H(),type:Z(`STEP`),coordinates:Yv,alias:H().min(1).max(150).optional(),config:J({components:q(Jv),next_node:H().optional()})})]),Zv=J({name:H().openapi({description:`The name of the form`}),messages:J({errors:Y(H(),K()).optional(),custom:Y(H(),K()).optional()}).optional(),languages:J({primary:H().optional(),default:H().optional()}).optional(),translations:Y(H(),K()).optional(),nodes:q(Xv).optional(),start:J({hidden_fields:q(J({key:H(),value:H()})).optional(),next_node:H().optional(),coordinates:Yv.optional()}).optional(),ending:J({redirection:J({delay:W().optional(),target:H().optional()}).optional(),after_submit:J({flow_id:H().optional()}).optional(),coordinates:Yv.optional(),resume_flow:G().optional()}).optional(),style:J({css:H().optional()}).optional(),links:J({sdkSrc:H().optional(),sdk_src:H().optional()}).optional()}).openapi({description:`Schema for flow-based forms (matches Auth0 Forms structure)`});__.extend(Zv.shape).extend({id:H()});var Qv=J({id:W().optional(),text:H(),type:X([`info`,`error`,`success`,`warning`])}),$v=J({id:H().optional(),text:H(),href:H(),linkText:H().optional()});J({name:H().optional(),action:H(),method:X([`POST`,`GET`]),title:H().optional(),description:H().optional(),components:q(Jv),messages:q(Qv).optional(),links:q($v).optional(),footer:H().optional()});var ey=X([`pre-user-registration`,`post-user-registration`,`post-user-login`,`post-user-update`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),ty=X([`pre-user-registration`,`post-user-registration`,`post-user-login`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),ny=X([`post-user-login`,`post-user-registration`,`post-user-update`,`credentials-exchange`]),ry=X([`post-user-login`,`credentials-exchange`,`pre-user-registration`,`post-user-registration`]),iy=X([`ensure-username`,`set-preferred-username`,`account-linking`]),ay={enabled:G().default(!1),synchronous:G().default(!1),priority:W().optional(),hook_id:H().optional(),metadata:Y(H(),Eh()).optional()};zh([J({...ay,trigger_id:ey,url:H()}),J({...ay,trigger_id:ty,form_id:H()}),J({...ay,trigger_id:ny,template_id:iy}),J({...ay,trigger_id:ry,code_id:H()})]),zh([J({...ay,trigger_id:ey}).extend(__.shape).extend({hook_id:H(),url:H()}),J({...ay,trigger_id:ty}).extend(__.shape).extend({hook_id:H(),form_id:H()}),J({...ay,trigger_id:ny}).extend(__.shape).extend({hook_id:H(),template_id:iy}),J({...ay,trigger_id:ry}).extend(__.shape).extend({hook_id:H(),code_id:H()})]),J({code:H().max(1e5),secrets:Y(H(),H()).optional()}).extend({id:H(),tenant_id:H()}).extend(__.shape);var oy=J({name:H().optional()}),sy=J({email:H().optional()}),cy=J({id:H().optional(),organization_id:H().max(50),inviter:oy,invitee:sy,invitation_url:H().url(),client_id:H(),connection_id:H().optional(),app_metadata:Y(H(),K()).default({}).optional(),user_metadata:Y(H(),K()).default({}).optional(),ttl_sec:W().int().max(2592e3).default(604800).optional(),roles:q(H()).default([]).optional(),send_invitation_email:G().default(!0).optional()});J({id:H(),organization_id:H().max(50),created_at:H().datetime(),expires_at:H().datetime(),ticket_id:H().optional()}).extend(cy.omit({id:!0}).shape),J({keys:q(J({alg:X([`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`,`HS256`,`HS384`,`HS512`]),kid:H(),kty:X([`RSA`,`EC`,`oct`]),use:X([`sig`,`enc`]).optional(),n:H().optional(),e:H().optional(),crv:H().optional(),x:H().optional(),y:H().optional(),x5t:H().optional(),x5c:q(H()).optional()}).superRefine((e,t)=>{if(e.kty===`RSA`)for(let n of[`n`,`e`])e[n]||t.addIssue({code:e_.custom,path:[n],message:`RSA JWK is missing required member '${n}'`});else if(e.kty===`EC`)for(let n of[`crv`,`x`,`y`])e[n]||t.addIssue({code:e_.custom,path:[n],message:`EC JWK is missing required member '${n}'`})}))}),J({issuer:H(),authorization_endpoint:H(),token_endpoint:H(),userinfo_endpoint:H(),jwks_uri:H(),registration_endpoint:H().optional(),revocation_endpoint:H(),end_session_endpoint:H().optional(),scopes_supported:q(H()),response_types_supported:q(H()),grant_types_supported:q(H()).optional(),code_challenge_methods_supported:q(H()),response_modes_supported:q(H()),subject_types_supported:q(H()),id_token_signing_alg_values_supported:q(H()),token_endpoint_auth_methods_supported:q(H()),claims_supported:q(H()),request_uri_parameter_supported:G(),request_parameter_supported:G(),claims_parameter_supported:G().optional(),request_object_signing_alg_values_supported:q(H()).optional(),token_endpoint_auth_signing_alg_values_supported:q(H()),client_id_metadata_document_supported:G().optional()});var ly=ng(function(e){return e.PENDING=`pending`,e.AUTHENTICATED=`authenticated`,e.AWAITING_EMAIL_VERIFICATION=`awaiting_email_verification`,e.AWAITING_MFA=`awaiting_mfa`,e.AWAITING_HOOK=`awaiting_hook`,e.AWAITING_CONTINUATION=`awaiting_continuation`,e.COMPLETED=`completed`,e.FAILED=`failed`,e.EXPIRED=`expired`,e}({})),uy=J({strategy:H(),strategy_type:H()});J({csrf_token:H(),auth0Client:H().optional(),authParams:lv,expires_at:H(),deleted_at:H().optional(),ip:H().optional(),useragent:H().optional(),session_id:H().optional(),authorization_url:H().optional(),state:ly.optional().default(`pending`),state_data:H().optional(),failure_reason:H().optional(),user_id:H().optional(),auth_connection:H().optional(),auth_strategy:uy.optional(),authenticated_at:H().optional()}).openapi({description:`This represents a login sesion`}).extend({id:H().openapi({description:`This is is used as the state in the universal login`}),created_at:H(),updated_at:H()});var $={ACLS_SUMMARY:`acls_summary`,ACTIONS_EXECUTION_FAILED:`actions_execution_failed`,API_LIMIT:`api_limit`,API_LIMIT_WARNING:`api_limit_warning`,APPI:`appi`,CIBA_EXCHANGE_FAILED:`ciba_exchange_failed`,CIBA_EXCHANGE_SUCCEEDED:`ciba_exchange_succeeded`,CIBA_START_FAILED:`ciba_start_failed`,CIBA_START_SUCCEEDED:`ciba_start_succeeded`,CODE_LINK_SENT:`cls`,CODE_SENT:`cs`,DEPRECATION_NOTICE:`depnote`,FAILED_LOGIN:`f`,FAILED_BY_CONNECTOR:`fc`,FAILED_CHANGE_EMAIL:`fce`,FAILED_BY_CORS:`fco`,FAILED_CROSS_ORIGIN_AUTHENTICATION:`fcoa`,FAILED_CHANGE_PASSWORD:`fcp`,FAILED_POST_CHANGE_PASSWORD_HOOK:`fcph`,FAILED_CHANGE_PHONE_NUMBER:`fcpn`,FAILED_CHANGE_PASSWORD_REQUEST:`fcpr`,FAILED_CONNECTOR_PROVISIONING:`fcpro`,FAILED_CHANGE_USERNAME:`fcu`,FAILED_DELEGATION:`fd`,FAILED_DEVICE_ACTIVATION:`fdeac`,FAILED_DEVICE_AUTHORIZATION_REQUEST:`fdeaz`,USER_CANCELED_DEVICE_CONFIRMATION:`fdecc`,FAILED_USER_DELETION:`fdu`,FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`feacft`,FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`feccft`,FAILED_EXCHANGE_CUSTOM_TOKEN:`fecte`,FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`fede`,FAILED_FEDERATED_LOGOUT:`federated_logout_failed`,FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN:`fens`,FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`feoobft`,FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`feotpft`,FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`fepft`,FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`fepotpft`,FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`fercft`,FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN:`ferrt`,FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`fertft`,FAILED_HOOK:`fh`,FAILED_IMPERSONATION:`fimp`,FAILED_INVITE_ACCEPT:`fi`,FAILED_LOGOUT:`flo`,FLOWS_EXECUTION_COMPLETED:`flows_execution_completed`,FLOWS_EXECUTION_FAILED:`flows_execution_failed`,FAILED_SENDING_NOTIFICATION:`fn`,FORMS_SUBMISSION_FAILED:`forms_submission_failed`,FORMS_SUBMISSION_SUCCEEDED:`forms_submission_succeeded`,FAILED_LOGIN_INCORRECT_PASSWORD:`fp`,FAILED_PUSHED_AUTHORIZATION_REQUEST:`fpar`,FAILED_POST_USER_REGISTRATION_HOOK:`fpurh`,FAILED_SIGNUP:`fs`,FAILED_SILENT_AUTH:`fsa`,FAILED_LOGIN_INVALID_EMAIL_USERNAME:`fu`,FAILED_USERS_IMPORT:`fui`,FAILED_VERIFICATION_EMAIL:`fv`,FAILED_VERIFICATION_EMAIL_REQUEST:`fvr`,EMAIL_VERIFICATION_CONFIRMED:`gd_auth_email_verification`,EMAIL_VERIFICATION_FAILED:`gd_auth_fail_email_verification`,MFA_AUTH_FAILED:`gd_auth_failed`,MFA_AUTH_REJECTED:`gd_auth_rejected`,MFA_AUTH_SUCCESS:`gd_auth_succeed`,MFA_ENROLLMENT_COMPLETE:`gd_enrollment_complete`,TOO_MANY_MFA_FAILURES:`gd_otp_rate_limit_exceed`,MFA_RECOVERY_FAILED:`gd_recovery_failed`,MFA_RECOVERY_RATE_LIMIT_EXCEED:`gd_recovery_rate_limit_exceed`,MFA_RECOVERY_SUCCESS:`gd_recovery_succeed`,MFA_EMAIL_SENT:`gd_send_email`,EMAIL_VERIFICATION_SENT:`gd_send_email_verification`,EMAIL_VERIFICATION_SEND_FAILURE:`gd_send_email_verification_failure`,PUSH_NOTIFICATION_SENT:`gd_send_pn`,ERROR_SENDING_MFA_PUSH_NOTIFICATION:`gd_send_pn_failure`,MFA_SMS_SENT:`gd_send_sms`,ERROR_SENDING_MFA_SMS:`gd_send_sms_failure`,MFA_VOICE_CALL_SUCCESS:`gd_send_voice`,MFA_VOICE_CALL_FAILED:`gd_send_voice_failure`,SECOND_FACTOR_STARTED:`gd_start_auth`,MFA_ENROLL_STARTED:`gd_start_enroll`,MFA_ENROLLMENT_FAILED:`gd_start_enroll_failed`,GUARDIAN_TENANT_UPDATE:`gd_tenant_update`,UNENROLL_DEVICE_ACCOUNT:`gd_unenroll`,UPDATE_DEVICE_ACCOUNT:`gd_update_device_account`,WEBAUTHN_CHALLENGE_FAILED:`gd_webauthn_challenge_failed`,WEBAUTHN_ENROLLMENT_FAILED:`gd_webauthn_enrollment_failed`,FAILED_KMS_API_OPERATION:`kms_key_management_failure`,SUCCESS_KMS_API_OPERATION:`kms_key_management_success`,KMS_KEY_STATE_CHANGED:`kms_key_state_changed`,TOO_MANY_CALLS_TO_DELEGATION:`limit_delegation`,BLOCKED_IP_ADDRESS:`limit_mu`,BLOCKED_ACCOUNT_IP:`limit_sul`,BLOCKED_ACCOUNT_EMAIL:`limit_wc`,INFORMATION:`i`,MFA_REQUIRED:`mfar`,MANAGEMENT_API_READ_OPERATION:`mgmt_api_read`,FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_failed`,SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_succeeded`,FAILED_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_failed`,SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_succeeded`,ORGANIZATION_MEMBER_ADDED:`organization_member_added`,PASSKEY_CHALLENGE_FAILED:`passkey_challenge_failed`,PASSKEY_CHALLENGE_STARTED:`passkey_challenge_started`,PRE_LOGIN_ASSESSMENT:`pla`,BREACHED_PASSWORD:`pwd_leak`,BREACHED_PASSWORD_ON_RESET:`reset_pwd_leak`,SUCCESS_RESOURCE_CLEANUP:`resource_cleanup`,RICH_CONSENTS_ACCESS_ERROR:`rich_consents_access_error`,SUCCESS_LOGIN:`s`,SUCCESS_API_OPERATION:`sapi`,FAILED_API_OPERATION:`fapi`,SUCCESS_CHANGE_EMAIL:`sce`,SUCCESS_CROSS_ORIGIN_AUTHENTICATION:`scoa`,SUCCESS_CHANGE_PASSWORD:`scp`,SUCCESS_CHANGE_PHONE_NUMBER:`scpn`,SUCCESS_CHANGE_PASSWORD_REQUEST:`scpr`,SUCCESS_CHANGE_USERNAME:`scu`,SUCCESS_CREDENTIAL_VALIDATION:`scv`,SUCCESS_DELEGATION:`sd`,SUCCESS_USER_DELETION:`sdu`,SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`seacft`,SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`seccft`,SUCCESS_EXCHANGE_CUSTOM_TOKEN:`secte`,SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`sede`,SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN:`sens`,SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`seoobft`,SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`seotpft`,SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`sepotpft`,SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`sepft`,SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN:`sepkoobft`,SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN:`sepkotpft`,SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sepkrcft`,SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sercft`,SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`sertft`,SUCCESS_IMPERSONATION:`simp`,SUCCESSFULLY_ACCEPTED_USER_INVITE:`si`,BREACHED_PASSWORD_ON_SIGNUP:`signup_pwd_leak`,SUCCESS_LOGOUT:`slo`,SUCCESS_HOOK:`sh`,SUCCESS_PASSWORD_MIGRATION:`spm`,SUCCESS_REVOCATION:`srrt`,SUCCESS_SIGNUP:`ss`,FAILED_SS_SSO_OPERATION:`ss_sso_failure`,INFORMATION_FROM_SS_SSO_OPERATION:`ss_sso_info`,SUCCESS_SS_SSO_OPERATION:`ss_sso_success`,SUCCESS_SILENT_AUTH:`ssa`,SUCCESSFUL_SCIM_OPERATION:`sscim`,SUCCESSFULLY_IMPORTED_USERS:`sui`,SUCCESS_VERIFICATION_EMAIL:`sv`,SUCCESS_VERIFICATION_EMAIL_REQUEST:`svr`,MAX_AMOUNT_OF_AUTHENTICATORS:`too_many_records`,USER_LOGIN_BLOCK_RELEASED:`ublkdu`,FAILED_UNIVERSAL_LOGOUT:`universal_logout_failed`,SUCCESSFUL_UNIVERSAL_LOGOUT:`universal_logout_succeeded`,WARNING_DURING_LOGIN:`w`,WARNING_SENDING_NOTIFICATION:`wn`,WARNING_USER_MANAGEMENT:`wum`},dy=H().refine(e=>Object.values($).includes(e),{message:`Invalid log type`});$.ACLS_SUMMARY,$.ACTIONS_EXECUTION_FAILED,$.API_LIMIT,$.API_LIMIT_WARNING,$.APPI,$.CIBA_EXCHANGE_FAILED,$.CIBA_EXCHANGE_SUCCEEDED,$.CIBA_START_FAILED,$.CIBA_START_SUCCEEDED,$.CODE_LINK_SENT,$.CODE_SENT,$.DEPRECATION_NOTICE,$.FAILED_LOGIN,$.FAILED_BY_CONNECTOR,$.FAILED_CHANGE_EMAIL,$.FAILED_BY_CORS,$.FAILED_CROSS_ORIGIN_AUTHENTICATION,$.FAILED_CHANGE_PASSWORD,$.FAILED_POST_CHANGE_PASSWORD_HOOK,$.FAILED_CHANGE_PHONE_NUMBER,$.FAILED_CHANGE_PASSWORD_REQUEST,$.FAILED_CONNECTOR_PROVISIONING,$.FAILED_CHANGE_USERNAME,$.FAILED_DELEGATION,$.FAILED_DEVICE_ACTIVATION,$.FAILED_DEVICE_AUTHORIZATION_REQUEST,$.USER_CANCELED_DEVICE_CONFIRMATION,$.FAILED_USER_DELETION,$.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,$.FAILED_EXCHANGE_CUSTOM_TOKEN,$.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,$.FAILED_FEDERATED_LOGOUT,$.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN,$.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN,$.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,$.FAILED_HOOK,$.FAILED_IMPERSONATION,$.FAILED_INVITE_ACCEPT,$.FAILED_LOGOUT,$.FLOWS_EXECUTION_COMPLETED,$.FLOWS_EXECUTION_FAILED,$.FAILED_SENDING_NOTIFICATION,$.FORMS_SUBMISSION_FAILED,$.FORMS_SUBMISSION_SUCCEEDED,$.FAILED_LOGIN_INCORRECT_PASSWORD,$.FAILED_PUSHED_AUTHORIZATION_REQUEST,$.FAILED_POST_USER_REGISTRATION_HOOK,$.FAILED_SIGNUP,$.FAILED_SILENT_AUTH,$.FAILED_LOGIN_INVALID_EMAIL_USERNAME,$.FAILED_USERS_IMPORT,$.FAILED_VERIFICATION_EMAIL,$.FAILED_VERIFICATION_EMAIL_REQUEST,$.EMAIL_VERIFICATION_CONFIRMED,$.EMAIL_VERIFICATION_FAILED,$.MFA_AUTH_FAILED,$.MFA_AUTH_REJECTED,$.MFA_AUTH_SUCCESS,$.MFA_ENROLLMENT_COMPLETE,$.TOO_MANY_MFA_FAILURES,$.MFA_RECOVERY_FAILED,$.MFA_RECOVERY_RATE_LIMIT_EXCEED,$.MFA_RECOVERY_SUCCESS,$.MFA_EMAIL_SENT,$.EMAIL_VERIFICATION_SENT,$.EMAIL_VERIFICATION_SEND_FAILURE,$.PUSH_NOTIFICATION_SENT,$.ERROR_SENDING_MFA_PUSH_NOTIFICATION,$.MFA_SMS_SENT,$.ERROR_SENDING_MFA_SMS,$.MFA_VOICE_CALL_SUCCESS,$.MFA_VOICE_CALL_FAILED,$.SECOND_FACTOR_STARTED,$.MFA_ENROLL_STARTED,$.MFA_ENROLLMENT_FAILED,$.GUARDIAN_TENANT_UPDATE,$.UNENROLL_DEVICE_ACCOUNT,$.UPDATE_DEVICE_ACCOUNT,$.WEBAUTHN_CHALLENGE_FAILED,$.WEBAUTHN_ENROLLMENT_FAILED,$.FAILED_KMS_API_OPERATION,$.SUCCESS_KMS_API_OPERATION,$.KMS_KEY_STATE_CHANGED,$.TOO_MANY_CALLS_TO_DELEGATION,$.BLOCKED_IP_ADDRESS,$.BLOCKED_ACCOUNT_IP,$.BLOCKED_ACCOUNT_EMAIL,$.INFORMATION,$.MFA_REQUIRED,$.MANAGEMENT_API_READ_OPERATION,$.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,$.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,$.FAILED_OIDC_BACKCHANNEL_LOGOUT,$.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT,$.ORGANIZATION_MEMBER_ADDED,$.PASSKEY_CHALLENGE_FAILED,$.PASSKEY_CHALLENGE_STARTED,$.PRE_LOGIN_ASSESSMENT,$.BREACHED_PASSWORD,$.BREACHED_PASSWORD_ON_RESET,$.SUCCESS_RESOURCE_CLEANUP,$.RICH_CONSENTS_ACCESS_ERROR,$.SUCCESS_LOGIN,$.SUCCESS_API_OPERATION,$.FAILED_API_OPERATION,$.SUCCESS_CHANGE_EMAIL,$.SUCCESS_CROSS_ORIGIN_AUTHENTICATION,$.SUCCESS_CHANGE_PASSWORD,$.SUCCESS_CHANGE_PHONE_NUMBER,$.SUCCESS_CHANGE_PASSWORD_REQUEST,$.SUCCESS_CHANGE_USERNAME,$.SUCCESS_CREDENTIAL_VALIDATION,$.SUCCESS_DELEGATION,$.SUCCESS_USER_DELETION,$.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,$.SUCCESS_EXCHANGE_CUSTOM_TOKEN,$.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN,$.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,$.SUCCESS_IMPERSONATION,$.SUCCESSFULLY_ACCEPTED_USER_INVITE,$.BREACHED_PASSWORD_ON_SIGNUP,$.SUCCESS_LOGOUT,$.SUCCESS_HOOK,$.SUCCESS_PASSWORD_MIGRATION,$.SUCCESS_REVOCATION,$.SUCCESS_SIGNUP,$.FAILED_SS_SSO_OPERATION,$.INFORMATION_FROM_SS_SSO_OPERATION,$.SUCCESS_SS_SSO_OPERATION,$.SUCCESS_SILENT_AUTH,$.SUCCESSFUL_SCIM_OPERATION,$.SUCCESSFULLY_IMPORTED_USERS,$.SUCCESS_VERIFICATION_EMAIL,$.SUCCESS_VERIFICATION_EMAIL_REQUEST,$.MAX_AMOUNT_OF_AUTHENTICATORS,$.USER_LOGIN_BLOCK_RELEASED,$.FAILED_UNIVERSAL_LOGOUT,$.SUCCESSFUL_UNIVERSAL_LOGOUT,$.WARNING_DURING_LOGIN,$.WARNING_SENDING_NOTIFICATION,$.WARNING_USER_MANAGEMENT,(()=>{let e={};for(let[t,n]of Object.entries($))t.startsWith(`SUCCESS_`)||t.startsWith(`SUCCESSFUL_`)||t.startsWith(`SUCCESSFULLY_`)||t.endsWith(`_SUCCEEDED`)||t.endsWith(`_COMPLETED`)?e[n]=`success`:t.startsWith(`FAILED_`)||t.startsWith(`ERROR_`)||t.startsWith(`BREACHED_`)||t.startsWith(`BLOCKED_`)||t===`MFA_AUTH_FAILED`||t===`MFA_AUTH_REJECTED`||t===`MFA_RECOVERY_FAILED`||t===`MFA_ENROLLMENT_FAILED`||t===`EMAIL_VERIFICATION_FAILED`||t===`WEBAUTHN_CHALLENGE_FAILED`||t===`WEBAUTHN_ENROLLMENT_FAILED`||t===`PASSKEY_CHALLENGE_FAILED`||t===`FLOWS_EXECUTION_FAILED`||t===`FORMS_SUBMISSION_FAILED`||t===`CIBA_EXCHANGE_FAILED`||t===`CIBA_START_FAILED`||t===`ACTIONS_EXECUTION_FAILED`||t===`RICH_CONSENTS_ACCESS_ERROR`||t===`USER_CANCELED_DEVICE_CONFIRMATION`||t===`TOO_MANY_MFA_FAILURES`||t===`MFA_RECOVERY_RATE_LIMIT_EXCEED`||t===`API_LIMIT`||t===`MAX_AMOUNT_OF_AUTHENTICATORS`?e[n]=`failure`:t.startsWith(`WARNING_`)||t===`API_LIMIT_WARNING`||t===`DEPRECATION_NOTICE`||t===`PRE_LOGIN_ASSESSMENT`?e[n]=`warning`:t===`CODE_SENT`||t===`CODE_LINK_SENT`||t===`MFA_EMAIL_SENT`||t===`MFA_SMS_SENT`||t===`EMAIL_VERIFICATION_SENT`||t===`PUSH_NOTIFICATION_SENT`?e[n]=`code_sent`:t===`INFORMATION`||t===`INFORMATION_FROM_SS_SSO_OPERATION`||t===`MANAGEMENT_API_READ_OPERATION`||t===`APPI`||t===`ACLS_SUMMARY`||t===`ORGANIZATION_MEMBER_ADDED`?e[n]=`info`:e[n]=`other`;return e})();var fy=J({name:H(),version:H(),env:J({node:H().optional()}).optional()}),py=J({country_code:H().length(2),city_name:H(),latitude:H(),longitude:H(),time_zone:H(),continent_code:H()});J({type:dy,date:H(),description:H().optional(),ip:H().optional(),user_agent:H().optional(),details:K().optional(),isMobile:G(),user_id:H().optional(),user_name:H().optional(),connection:H().optional(),connection_id:H().optional(),client_id:H().optional(),client_name:H().optional(),audience:H().optional(),scope:H().optional(),strategy:H().optional(),strategy_type:H().optional(),hostname:H().optional(),auth0_client:fy.optional(),log_id:H().optional(),location_info:py.optional()}).extend({log_id:H()});var my=X([`http`,`eventbridge`,`eventgrid`,`splunk`,`datadog`,`sumo`]),hy=X([`active`,`paused`,`suspended`]),gy=J({type:H(),name:H()});J({name:H(),type:my,status:hy.optional(),sink:Y(H(),Eh()),filters:q(gy).optional(),isPriority:G().optional()}).extend({id:H(),status:hy,created_at:H().optional(),updated_at:H().optional()});var _y=X([`auth0`,`cognito`,`okta`,`oidc`]),vy=J({domain:H(),client_id:H(),client_secret:H(),audience:H().optional(),scope:H().optional()}),yy=J({id:H().optional(),name:H(),provider:_y,connection:H(),enabled:G().default(!0),credentials:vy});J({id:H(),created_at:H(),updated_at:H()}).extend(yy.shape);var by=J({enabled:G().optional(),shields:q(H()).optional(),admin_notification_frequency:q(H()).optional(),method:H().optional(),stage:J({"pre-user-registration":J({shields:q(H()).optional()}).optional(),"pre-change-password":J({shields:q(H()).optional()}).optional()}).optional()}),xy=J({enabled:G().optional(),shields:q(H()).optional(),allowlist:q(H()).optional(),mode:H().optional(),max_attempts:W().optional()}),Sy=J({enabled:G().optional(),shields:q(H()).optional(),allowlist:q(H()).optional(),stage:J({"pre-login":J({max_attempts:W().optional(),rate:W().optional()}).optional(),"pre-user-registration":J({max_attempts:W().optional(),rate:W().optional()}).optional()}).optional()}),Cy=J({breached_password_detection:by.optional(),brute_force_protection:xy.optional(),suspicious_ip_throttling:Sy.optional()});J({id:H().optional(),user_id:H(),password:H(),algorithm:X([`bcrypt`,`argon2id`]).default(`argon2id`),is_current:G().default(!0)}).extend({id:H(),created_at:H(),updated_at:H()});var wy=J({initial_user_agent:H().describe(`First user agent of the device from which this user logged in`),initial_ip:H().describe(`First IP address associated with this session`),initial_asn:H().describe(`First autonomous system number associated with this session`),last_user_agent:H().describe(`Last user agent of the device from which this user logged in`),last_ip:H().describe(`Last IP address from which this user logged in`),last_asn:H().describe(`Last autonomous system number from which this user logged in`)}),Ty=J({id:H(),revoked_at:H().optional(),used_at:H().optional(),user_id:H().describe(`The user ID associated with the session`),expires_at:H().optional(),login_session_id:H(),idle_expires_at:H().optional(),device:wy.describe(`Metadata related to the device used in the session`),clients:q(H()).describe(`List of client details for the session`)});J({created_at:H(),updated_at:H(),authenticated_at:H(),last_interaction_at:H()}).extend(Ty.shape),J({kid:H().openapi({description:`The key id of the signing key`}),tenant_id:H().optional().openapi({description:`The tenant the key belongs to. Omitted means the key is shared / control-plane scoped.`}),cert:H().openapi({description:`The public certificate of the signing key`}),fingerprint:H().openapi({description:`The cert fingerprint`}),thumbprint:H().openapi({description:`The cert thumbprint`}),pkcs7:H().optional().openapi({description:`The private key in pkcs7 format`}),current:G().optional().openapi({description:`True if the key is the current key`}),next:G().optional().openapi({description:`True if the key is the next key`}),previous:G().optional().openapi({description:`True if the key is the previous key`}),current_since:H().optional().openapi({description:`The date and time when the key became the current key`}),current_until:H().optional().openapi({description:`The date and time when the current key was rotated`}),revoked:G().optional().openapi({description:`True if the key is revoked`}),revoked_at:H().optional().openapi({description:`The date and time when the key was revoked`}),connection:H().optional().openapi({description:`The connection identifier associated with the key`}),type:X([`jwt_signing`,`saml_encryption`]).openapi({description:`The type of the signing key`})});var Ey=J({id:H().optional(),audience:H(),friendly_name:H(),picture_url:H().optional(),support_email:H().optional(),support_url:H().optional(),sender_email:H().email(),sender_name:H(),session_lifetime:W().optional(),idle_session_lifetime:W().optional(),ephemeral_session_lifetime:W().optional(),idle_ephemeral_session_lifetime:W().optional(),session_cookie:J({mode:X([`persistent`,`non-persistent`]).optional()}).optional(),allowed_logout_urls:q(H()).optional(),default_redirection_uri:H().optional(),default_client_id:H().optional(),enabled_locales:q(H()).optional(),default_directory:H().optional(),error_page:J({html:H().optional(),show_log_link:G().optional(),url:H().optional()}).nullish(),flags:J({allow_changing_enable_sso:G().optional(),allow_legacy_delegation_grant_types:G().optional(),allow_legacy_ro_grant_types:G().optional(),allow_legacy_tokeninfo_endpoint:G().optional(),change_pwd_flow_v1:G().optional(),client_id_metadata_document_registration:G().optional(),custom_domains_provisioning:G().optional(),dashboard_insights_view:G().optional(),dashboard_log_streams_next:G().optional(),disable_clickjack_protection_headers:G().optional(),disable_fields_map_fix:G().optional(),disable_impersonation:G().optional(),disable_management_api_sms_obfuscation:G().optional(),enable_adfs_waad_email_verification:G().optional(),enable_apis_section:G().optional(),enable_client_connections:G().optional(),enable_custom_domain_in_emails:G().optional(),enable_dynamic_client_registration:G().optional(),dcr_require_initial_access_token:G().optional(),dcr_allowed_grant_types:q(H()).optional(),allow_http_return_to:q(H().refine(e=>{try{let t=new URL(e);return t.protocol===`http:`&&(t.pathname===``||t.pathname===`/`)&&!t.search&&!t.hash&&e===t.origin}catch{return!1}},{message:`must be a fully-qualified http origin (scheme + host + port, no path)`})).optional(),enable_idtoken_api2:G().optional(),enable_legacy_logs_search_v2:G().optional(),enable_legacy_profile:G().optional(),enable_pipeline2:G().optional(),enable_public_signup_user_exists_error:G().optional(),enable_sso:G().optional(),enforce_client_authentication_on_passwordless_start:G().optional(),genai_trial:G().optional(),improved_signup_bot_detection_in_classic:G().optional(),mfa_show_factor_list_on_enrollment:G().optional(),no_disclose_enterprise_connections:G().optional(),remove_alg_from_jwks:G().optional(),revoke_refresh_token_grant:G().optional(),trust_azure_adfs_email_verified_connection_property:G().optional(),use_scope_descriptions_for_consent:G().optional(),inherit_global_permissions_in_organizations:G().optional(),restrict_undefined_scopes:G().optional()}).optional(),sandbox_version:H().optional(),legacy_sandbox_version:H().optional(),sandbox_versions_available:q(H()).optional(),change_password:J({enabled:G().optional(),html:H().optional()}).optional(),guardian_mfa_page:J({enabled:G().optional(),html:H().optional()}).optional(),device_flow:J({charset:X([`base20`,`digits`]).optional(),mask:H().max(20).optional()}).optional(),default_token_quota:J({clients:J({client_credentials:Y(H(),K()).optional()}).optional(),organizations:J({client_credentials:Y(H(),K()).optional()}).optional()}).nullish(),default_audience:H().optional(),default_organization:H().optional(),sessions:J({oidc_logout_prompt_enabled:G().optional()}).optional(),oidc_logout:J({rp_logout_end_session_endpoint_discovery:G().optional()}).optional(),allow_organization_name_in_authentication_api:G().optional(),customize_mfa_in_postlogin_action:G().optional(),acr_values_supported:q(H()).optional(),mtls:J({enable_endpoint_aliases:G().optional()}).nullish(),pushed_authorization_requests_supported:G().optional(),authorization_response_iss_parameter_supported:G().optional(),attack_protection:Cy.optional(),mfa:J({policy:X([`never`,`always`]).default(`never`).optional(),factors:J({sms:G().default(!1),otp:G().default(!1),email:G().default(!1),push_notification:G().default(!1),webauthn_roaming:G().default(!1),webauthn_platform:G().default(!1),recovery_code:G().default(!1),duo:G().default(!1)}).optional(),sms_provider:J({provider:X([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:J({sid:H().optional(),auth_token:H().optional(),from:H().optional(),messaging_service_sid:H().optional()}).optional(),phone_message:J({message:H().optional()}).optional()}).optional()});J({created_at:H().nullable().transform(e=>e??``),updated_at:H().nullable().transform(e=>e??``)}).extend(Ey.shape).extend({id:H(),is_control_plane:G().optional()}),J({access_token:H(),id_token:H().optional(),scope:H().optional(),state:H().optional(),refresh_token:H().optional(),token_type:H(),expires_in:W()}),J({code:H(),state:H().optional()});var Dy=J({button_border_radius:W(),button_border_weight:W(),buttons_style:X([`pill`,`rounded`,`sharp`]),input_border_radius:W(),input_border_weight:W(),inputs_style:X([`pill`,`rounded`,`sharp`]),show_widget_shadow:G(),widget_border_weight:W(),widget_corner_radius:W()}),Oy=J({base_focus_color:H(),base_hover_color:H(),body_text:H(),captcha_widget_theme:X([`auto`,`dark`,`light`]),error:H(),header:H(),icons:H(),input_background:H(),input_border:H(),input_filled_text:H(),input_labels_placeholders:H(),links_focused_components:H(),primary_button:H(),primary_button_label:H(),secondary_button_border:H(),secondary_button_label:H(),success:H(),widget_background:H(),widget_border:H()}),ky=J({bold:G(),size:W()}),Ay=J({body_text:ky,buttons_text:ky,font_url:H(),input_labels:ky,links:ky,links_style:X([`normal`,`underlined`]),reference_text_size:W(),subtitle:ky,title:ky}),jy=J({background_color:H(),background_image_url:H(),page_layout:X([`center`,`left`,`right`]),logo_placement:X([`widget`,`chip`,`none`]).optional()}),My=J({header_text_alignment:X([`center`,`left`,`right`]),logo_height:W(),logo_position:X([`center`,`left`,`none`,`right`]),logo_url:H(),social_buttons_layout:X([`bottom`,`top`])});J({borders:Dy,colors:Oy,displayName:H(),fonts:Ay,page_background:jy,widget:My}).extend({themeId:H()}),J({universal_login_experience:X([`new`,`classic`]).default(`new`),identifier_first:G().default(!0),password_first:G().default(!1),webauthn_platform_first_factor:G()});var Ny=J({hosts:q(H()).optional(),methods:q(H()).optional(),path:H().default(`/*`),headers:Y(H(),H()).optional(),query:Y(H(),H()).optional()}),Py=J({type:H(),options:Y(H(),Eh()).default({})}),Fy=J({custom_domain_id:H(),priority:W().int().default(100),match:Ny,handlers:q(Py).min(1)});Fy.extend({id:H(),tenant_id:H(),created_at:H(),updated_at:H()}),Fy.partial().omit({custom_domain_id:!0}),J({name:H(),enabled:G().optional().default(!0),default_from_address:H().optional(),credentials:Y(H(),Eh()),settings:J({}).optional()}),J({template:X([`verify_email`,`verify_email_by_code`,`reset_email`,`reset_email_by_code`,`welcome_email`,`blocked_account`,`stolen_credentials`,`enrollment_email`,`mfa_oob_code`,`change_password`,`password_reset`,`user_invitation`]),body:H(),from:H(),subject:H(),syntax:Z(`liquid`).default(`liquid`),resultUrl:H().optional(),urlLifetimeInSeconds:W().int().nonnegative().optional(),includeEmailInRedirect:G().default(!1),enabled:G().default(!0)}),J({id:H(),login_id:H(),user_id:H(),client_id:H(),expires_at:H().optional(),idle_expires_at:H().optional(),last_exchanged_at:H().optional(),device:wy,resource_servers:q(J({audience:H(),scopes:H()})),rotating:G(),token_lookup:H().optional(),token_hash:H().optional(),family_id:H().optional(),rotated_to:H().optional(),rotated_at:H().optional()}).extend({created_at:H(),revoked_at:H().optional()}),J({to:H(),message:H()}),J({name:H(),options:J({})});var Iy=J({value:H(),description:H().optional()}),Ly=J({token_dialect:X([`access_token`,`access_token_authz`]).optional(),enforce_policies:G().optional(),allow_skipping_userinfo:G().optional(),skip_userinfo:G().optional(),persist_client_authorization:G().optional(),enable_introspection_endpoint:G().optional(),mtls:J({bound_access_tokens:G().optional()}).optional()});J({id:H().optional(),name:H(),identifier:H(),scopes:q(Iy).optional(),signing_alg:H().optional(),signing_secret:H().optional(),token_lifetime:W().default(86400),token_lifetime_for_web:W().default(7200),skip_consent_for_verifiable_first_party_clients:G().optional(),allow_offline_access:G().optional(),verificationKey:H().optional(),options:Ly.optional(),is_system:G().optional(),metadata:Y(H(),K()).optional()}).extend({created_at:H().optional(),updated_at:H().optional()}),J({role_id:H(),resource_server_identifier:H(),permission_name:H()}).extend({created_at:H()}),J({user_id:H(),resource_server_identifier:H(),permission_name:H(),organization_id:H().optional()}).extend({tenant_id:H(),created_at:H().optional()}),J({user_id:H(),resource_server_identifier:H(),resource_server_name:H(),permission_name:H(),description:H().nullable().optional(),created_at:H().optional(),organization_id:H().optional()}),J({user_id:H(),role_id:H(),organization_id:H().optional()}).extend({tenant_id:H(),created_at:H().optional()}),J({id:H().optional().openapi({description:`The unique identifier of the role. If not provided, one will be generated.`}),name:H().min(1).max(50).openapi({description:`The name of the role. Cannot include '<' or '>'`}),description:H().max(255).optional().openapi({description:`The description of the role`}),is_system:G().optional(),metadata:Y(H(),K()).optional().openapi({description:`Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios.`})}).extend({id:H().openapi({description:`The unique identifier of the role`}),created_at:H().optional(),updated_at:H().optional()});var Ry=J({logo_url:H().optional().openapi({description:`URL of the organization's logo`}),colors:J({primary:H().optional().openapi({description:`Primary color in hex format (e.g., #FF0000)`}),page_background:H().optional().openapi({description:`Page background color in hex format (e.g., #FFFFFF)`})}).optional()}).optional(),zy=J({connection_id:H().openapi({description:`ID of the connection`}),assign_membership_on_login:G().default(!1).openapi({description:`Whether to assign membership to the organization on login`}),show_as_button:G().default(!0).openapi({description:`Whether to show this connection as a button in the login screen`}),is_signup_enabled:G().default(!0).openapi({description:`Whether signup is enabled for this connection`})}),By=J({client_credentials:J({enforce:G().default(!1).openapi({description:`Whether to enforce token quota limits`}),per_day:W().min(0).default(0).openapi({description:`Maximum tokens per day (0 = unlimited)`}),per_hour:W().min(0).default(0).openapi({description:`Maximum tokens per hour (0 = unlimited)`})}).optional()}).optional();J({id:H().optional(),name:H().min(1).regex(/^[a-z0-9_-]+$/,{message:`Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores`}).openapi({description:`The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores.`}),display_name:H().optional().openapi({description:`The display name of the organization`}),branding:Ry,metadata:Y(H(),K()).default({}).optional().openapi({description:`Custom metadata for the organization`}),enabled_connections:q(zy).default([]).optional().openapi({description:`List of enabled connections for the organization`}),token_quota:By}).extend(__.shape).extend({id:H(),name:H().min(1).openapi({description:`The name of the organization`})}),J({connection_id:H().openapi({description:`ID of the tenant-level connection to enable for the org.`}),assign_membership_on_login:G().optional().default(!1),show_as_button:G().optional().default(!0),is_signup_enabled:G().optional().default(!0)}).extend({connection:J({name:H().optional(),strategy:H().optional()}).optional(),created_at:H().optional(),updated_at:H().optional()}),J({user_id:H().openapi({description:`ID of the user`}),organization_id:H().openapi({description:`ID of the organization`})}).extend(__.shape).extend({id:H()}),J({idle_session_lifetime:W().default(72),session_lifetime:W().default(168),session_cookie:J({mode:X([`persistent`,`non-persistent`]).optional()}).optional(),enable_client_connections:G().optional(),default_redirection_uri:H().optional(),enabled_locales:q(H()).optional(),default_directory:H().optional(),error_page:J({html:H().optional(),show_log_link:G().optional(),url:H().optional()}).optional(),flags:J({allow_legacy_delegation_grant_types:G().optional(),allow_legacy_ro_grant_types:G().optional(),allow_legacy_tokeninfo_endpoint:G().optional(),disable_clickjack_protection_headers:G().optional(),enable_apis_section:G().optional(),enable_client_connections:G().optional(),enable_custom_domain_in_emails:G().optional(),enable_dynamic_client_registration:G().optional(),enable_idtoken_api2:G().optional(),enable_legacy_logs_search_v2:G().optional(),enable_legacy_profile:G().optional(),enable_pipeline2:G().optional(),enable_public_signup_user_exists_error:G().optional(),use_scope_descriptions_for_consent:G().optional(),disable_management_api_sms_obfuscation:G().optional(),enable_adfs_waad_email_verification:G().optional(),revoke_refresh_token_grant:G().optional(),dashboard_log_streams_next:G().optional(),dashboard_insights_view:G().optional(),disable_fields_map_fix:G().optional(),mfa_show_factor_list_on_enrollment:G().optional()}).optional(),friendly_name:H().optional(),picture_url:H().optional(),support_email:H().optional(),support_url:H().optional(),sandbox_version:H().optional(),sandbox_versions_available:q(H()).optional(),change_password:J({enabled:G(),html:H()}).optional(),guardian_mfa_page:J({enabled:G(),html:H()}).optional(),default_audience:H().optional(),default_organization:H().optional(),sessions:J({oidc_logout_prompt_enabled:G().optional()}).optional(),mfa:J({policy:X([`never`,`always`]).default(`never`).optional(),factors:J({sms:G().default(!1),otp:G().default(!1),email:G().default(!1),push_notification:G().default(!1),webauthn_roaming:G().default(!1),webauthn_platform:G().default(!1),recovery_code:G().default(!1),duo:G().default(!1)}).optional(),sms_provider:J({provider:X([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:J({sid:H().optional(),auth_token:H().optional(),from:H().optional(),messaging_service_sid:H().optional()}).optional(),phone_message:J({message:H().optional()}).optional()}).optional()}),J({date:H().openapi({description:`Date these events occurred in ISO 8601 format`,example:`2025-12-19`}),logins:W().openapi({description:`Number of logins on this date`,example:150}),signups:W().openapi({description:`Number of signups on this date`,example:25}),leaked_passwords:W().openapi({description:`Number of breached-password detections on this date (subscription required)`,example:0}),updated_at:H().openapi({description:`Date and time this stats entry was last updated in ISO 8601 format`,example:`2025-12-19T10:30:00.000Z`}),created_at:H().openapi({description:`Approximate date and time the first event occurred in ISO 8601 format`,example:`2025-12-19T00:00:00.000Z`})}),W().openapi({description:`Number of active users in the last 30 days`,example:1234}),X([`active-users`,`logins`,`signups`,`refresh-tokens`,`sessions`]),X([`hour`,`day`,`week`,`month`]),X([`time`,`connection`,`client_id`,`user_type`,`event`]),X([`password`,`social`,`passwordless`,`enterprise`]);var Vy=J({name:H(),type:H()}),Hy=J({elapsed:W(),rows_read:W().optional(),bytes_read:W().optional()});J({meta:q(Vy),data:q(Y(H(),K())),rows:W(),rows_before_limit_at_least:W().optional(),statistics:Hy.optional()});var Uy=X(`login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options`.split(`.`)),Wy=Y(H(),Y(H(),H())).openapi({type:`object`,additionalProperties:{type:`object`,additionalProperties:{type:`string`}}});J({prompt:Uy,language:H(),custom_text:Wy});var Gy=X([`phone`,`totp`,`email`,`push`,`webauthn-roaming`,`webauthn-platform`,`passkey`]),Ky=J({user_id:H(),type:Gy,phone_number:H().optional(),totp_secret:H().optional(),credential_id:H().optional(),public_key:H().optional(),sign_count:W().int().nonnegative().optional(),credential_backed_up:G().optional(),transports:q(H()).optional(),friendly_name:H().optional(),confirmed:G().default(!1)});function qy(e,t){e.type===`phone`&&!e.phone_number&&t.addIssue({code:e_.custom,message:`phone_number is required when type is 'phone'`,path:[`phone_number`]}),e.type===`totp`&&!e.totp_secret&&t.addIssue({code:e_.custom,message:`totp_secret is required when type is 'totp'`,path:[`totp_secret`]}),[`webauthn-roaming`,`webauthn-platform`,`passkey`].includes(e.type)&&(e.credential_id||t.addIssue({code:e_.custom,message:`credential_id is required when type is '${e.type}'`,path:[`credential_id`]}),e.public_key||t.addIssue({code:e_.custom,message:`public_key is required when type is '${e.type}'`,path:[`public_key`]}))}Ky.superRefine(qy),Ky.extend({id:H(),created_at:H(),updated_at:H()}).superRefine(qy);function Jy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Yy(e){if(!e)return;let t=JSON.parse(e);return Jy(t)?t:void 0}function Xy(e){return e==null?void 0:new Date(e).toISOString()}function Zy(e){if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t.getTime()}function Qy(e){let t=J_.parse(e.type);return{id:e.id,token_hash:e.token_hash,type:t,client_id:e.client_id??void 0,sub:e.sub??void 0,constraints:Yy(e.constraints),single_use:!!e.single_use,expires_at:Xy(e.expires_at_ts),used_at:Xy(e.used_at_ts),revoked_at:Xy(e.revoked_at_ts),created_at:new Date(e.created_at_ts).toISOString()}}function $y(e){return{async create(t,n){let r=Date.now();return await e.insert(T).values({id:n.id,tenant_id:t,token_hash:n.token_hash,type:n.type,client_id:n.client_id??null,sub:n.sub??null,constraints:n.constraints?JSON.stringify(n.constraints):null,single_use:+!!n.single_use,expires_at_ts:Zy(n.expires_at),created_at_ts:r}),{id:n.id,token_hash:n.token_hash,type:n.type,client_id:n.client_id,sub:n.sub,constraints:n.constraints,single_use:n.single_use,expires_at:n.expires_at,created_at:new Date(r).toISOString()}},async get(t,n){let r=await e.select().from(T).where(h(m(T.tenant_id,t),m(T.id,n))).get();return r?Qy(r):null},async getByHash(t,n){let r=await e.select().from(T).where(h(m(T.tenant_id,t),m(T.token_hash,n))).get();return r?Qy(r):null},async listByClient(t,n){return(await e.select().from(T).where(h(m(T.tenant_id,t),m(T.client_id,n))).orderBy(Be(T.created_at_ts))).map(Qy)},async markUsed(t,n,r){return(await e.update(T).set({used_at_ts:Zy(r)}).where(h(m(T.tenant_id,t),m(T.id,n),Ie(T.used_at_ts))).returning()).length>0},async revoke(t,n,r){return(await e.update(T).set({revoked_at_ts:Zy(r)}).where(h(m(T.tenant_id,t),m(T.id,n),Ie(T.revoked_at_ts))).returning()).length>0},async revokeByClient(t,n,r){return(await e.update(T).set({revoked_at_ts:Zy(r)}).where(h(m(T.tenant_id,t),m(T.client_id,n),Ie(T.revoked_at_ts))).returning()).length},async remove(t,n){return(await e.delete(T).where(h(m(T.tenant_id,t),m(T.id,n))).returning()).length>0}}}function eb(e){let{tenant_id:t,...n}=e;return A(n)}function tb(e){return{async create(t,n){let r={...n,tenant_id:t,created_at:n.created_at||new Date().toISOString(),expires_at:n.expires_at};return await e.insert(Vt).values(r),eb(r)},async get(t,n,r){if(!t)throw Error(`tenant_id is required`);let i=await e.select().from(Vt).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n),m(Vt.code_type,r))).get();return i?eb(i):null},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(Vt).where(m(Vt.tenant_id,t)).$dynamic();if(o?.sort_by){let e=Vt[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(eb);if(!a)return{codes:c};let[l]=await e.select({count:Ve()}).from(Vt).where(m(Vt.tenant_id,t));return{codes:c,start:r*i,limit:i,length:Number(l?.count??0)}},async used(t,n){return(await e.update(Vt).set({used_at:new Date().toISOString()}).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n))).returning()).length>0},async consume(t,n){return(await e.update(Vt).set({used_at:new Date().toISOString()}).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n),Ie(Vt.used_at))).returning()).length>0},async remove(t,n){return(await e.delete(Vt).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n))).returning()).length>0}}}function nb(){let{customAlphabet:e}=(Hn(),s(Ln));return`con_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}function rb(e){let{tenant_id:t,is_system:n,options:r,metadata:i,...a}=e;return A({...a,options:j(r,{}),metadata:j(i),is_system:n?!0:void 0})}function ib(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||nb(),...n,tenant_id:t,options:JSON.stringify(n.options||{}),metadata:n.metadata?JSON.stringify(n.metadata):void 0,is_system:+!!n.is_system,created_at:r,updated_at:r};try{await e.insert(Kt).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`duplicate key`)?new Tn(409,{message:`Connection already exists`}):e}return rb(i)},async get(t,n){let r=await e.select().from(Kt).where(h(m(Kt.tenant_id,t),m(Kt.id,n))).get();return r?rb(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.strategy!==void 0&&(i.strategy=r.strategy),r.options!==void 0&&(i.options=JSON.stringify(r.options)),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),r.display_name!==void 0&&(i.display_name=r.display_name),r.response_type!==void 0&&(i.response_type=r.response_type),r.response_mode!==void 0&&(i.response_mode=r.response_mode),await e.update(Kt).set(i).where(h(m(Kt.tenant_id,t),m(Kt.id,n))),!0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=m(Kt.tenant_id,t);if(s){let e=En(Kt,s,[`name`]);e&&(c=h(c,e))}let l=e.select().from(Kt).where(c).$dynamic();if(o?.sort_by){let e=Kt[o.sort_by];e&&(l=l.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let u=(await l.offset(r*i).limit(i)).map(rb);if(!a)return{connections:u};let[d]=await e.select({count:Ve()}).from(Kt).where(c);return{connections:u,start:r*i,limit:i,length:Number(d?.count??0)}},async remove(t,n){return(await e.delete(Kt).where(h(m(Kt.tenant_id,t),m(Kt.id,n))).returning()).length>0}}}Hn();function ab(e){let{tenant_id:t,domain_metadata:n,...r}=e;return A({...r,primary:!!r.primary,domain_metadata:j(n)})}function ob(e){return{async create(t,n){let r=new Date().toISOString(),i={custom_domain_id:n.custom_domain_id||Vn(),tenant_id:t,domain:n.domain,primary:n.primary??!1,status:n.status||`pending`,type:n.type,origin_domain_name:n.origin_domain_name,verification:n.verification,custom_client_ip_header:n.custom_client_ip_header,tls_policy:n.tls_policy,domain_metadata:n.domain_metadata?JSON.stringify(n.domain_metadata):void 0,created_at:r,updated_at:r};return await e.insert(qt).values(i),ab({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(qt).where(h(m(qt.tenant_id,t),m(qt.custom_domain_id,n))).get();return r?ab(r):null},async getByDomain(t){let n=await e.select().from(qt).where(m(qt.domain,t)).get();return n?{...ab(n),tenant_id:n.tenant_id}:null},async list(t){return(await e.select().from(qt).where(m(qt.tenant_id,t)).all()).map(ab)},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.domain!==void 0&&(i.domain=r.domain),r.primary!==void 0&&(i.primary=r.primary),r.status!==void 0&&(i.status=r.status),r.type!==void 0&&(i.type=r.type),r.origin_domain_name!==void 0&&(i.origin_domain_name=r.origin_domain_name),r.verification!==void 0&&(i.verification=r.verification),r.custom_client_ip_header!==void 0&&(i.custom_client_ip_header=r.custom_client_ip_header),r.tls_policy!==void 0&&(i.tls_policy=r.tls_policy),r.domain_metadata!==void 0&&(i.domain_metadata=JSON.stringify(r.domain_metadata)),(await e.update(qt).set(i).where(h(m(qt.tenant_id,t),m(qt.custom_domain_id,n))).returning()).length>0},async remove(t,n){return(await e.delete(qt).where(h(m(qt.tenant_id,t),m(qt.custom_domain_id,n))).returning()).length>0}}}function sb(e){return{async get(t,n,r){let i=await e.select().from(mn).where(h(m(mn.tenant_id,t),m(mn.prompt,n),m(mn.language,r))).get();if(!i)return null;try{return JSON.parse(i.custom_text)}catch{return null}},async set(t,n,r,i){let a=Date.now(),o=JSON.stringify(i);await e.insert(mn).values({tenant_id:t,prompt:n,language:r,custom_text:o,created_at_ts:a,updated_at_ts:a}).onConflictDoUpdate({target:[mn.tenant_id,mn.prompt,mn.language],set:{custom_text:o,updated_at_ts:a}})},async delete(t,n,r){await e.delete(mn).where(h(m(mn.tenant_id,t),m(mn.prompt,n),m(mn.language,r)))},async list(t){return await e.select({prompt:mn.prompt,language:mn.language}).from(mn).where(m(mn.tenant_id,t)).all()}}}function cb(e){return{async create(t,n){let r=new Date().toISOString();await e.insert(ln).values({tenant_id:t,name:n.name,enabled:n.enabled,default_from_address:n.default_from_address,credentials:JSON.stringify(n.credentials||{}),settings:JSON.stringify(n.settings||{}),created_at:r,updated_at:r})},async get(t){let n=await e.select().from(ln).where(m(ln.tenant_id,t)).get();if(!n)return null;let{tenant_id:r,...i}=n;return A({...i,enabled:!!i.enabled,credentials:j(i.credentials,{}),settings:j(i.settings,{})})},async update(t,n){let r={updated_at:new Date().toISOString()};n.name!==void 0&&(r.name=n.name),n.enabled!==void 0&&(r.enabled=n.enabled),n.default_from_address!==void 0&&(r.default_from_address=n.default_from_address),n.credentials!==void 0&&(r.credentials=JSON.stringify(n.credentials)),n.settings!==void 0&&(r.settings=JSON.stringify(n.settings)),await e.update(ln).set(r).where(m(ln.tenant_id,t))},async remove(t){await e.delete(ln).where(m(ln.tenant_id,t))}}}function lb(e){return A({template:e.template,body:e.body,from:e.from,subject:e.subject,syntax:`liquid`,includeEmailInRedirect:!!e.include_email_in_redirect,enabled:!!e.enabled,resultUrl:e.result_url??void 0,urlLifetimeInSeconds:e.url_lifetime_in_seconds??void 0})}function ub(e){return{async get(t,n){let r=await e.select().from(un).where(h(m(un.tenant_id,t),m(un.template,n))).get();return r?lb(r):null},async list(t){return(await e.select().from(un).where(m(un.tenant_id,t)).all()).map(lb)},async create(t,n){let r=new Date().toISOString();return await e.insert(un).values({tenant_id:t,template:n.template,body:n.body,from:n.from,subject:n.subject,syntax:n.syntax,result_url:n.resultUrl??null,url_lifetime_in_seconds:n.urlLifetimeInSeconds??null,include_email_in_redirect:n.includeEmailInRedirect,enabled:n.enabled,created_at:r,updated_at:r}),n},async update(t,n,r){let i={updated_at:new Date().toISOString()};r.body!==void 0&&(i.body=r.body),r.from!==void 0&&(i.from=r.from),r.subject!==void 0&&(i.subject=r.subject),r.syntax!==void 0&&(i.syntax=r.syntax),r.resultUrl!==void 0&&(i.result_url=r.resultUrl),r.urlLifetimeInSeconds!==void 0&&(i.url_lifetime_in_seconds=r.urlLifetimeInSeconds),r.includeEmailInRedirect!==void 0&&(i.include_email_in_redirect=r.includeEmailInRedirect),r.enabled!==void 0&&(i.enabled=r.enabled);let a=await e.update(un).set(i).where(h(m(un.tenant_id,t),m(un.template,n))).run();return Number(a.changes??0)>0},async remove(t,n){let r=await e.delete(un).where(h(m(un.tenant_id,t),m(un.template,n))).run();return Number(r.changes??0)>0}}}Hn();function db(e){return{async create(t,n){let r=new Date().toISOString(),i=`af_${Vn()}`;return await e.insert(sn).values({id:i,tenant_id:t,name:n.name,actions:JSON.stringify(n.actions||[]),created_at:r,updated_at:r}),{id:i,name:n.name,actions:n.actions||[],created_at:r,updated_at:r}},async get(t,n){let r=await e.select().from(sn).where(h(m(sn.tenant_id,t),m(sn.id,n))).get();if(!r)return null;let{tenant_id:i,actions:a,...o}=r;return A({...o,actions:j(a,[])})},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.actions!==void 0&&(i.actions=JSON.stringify(r.actions)),(await e.update(sn).set(i).where(h(m(sn.tenant_id,t),m(sn.id,n))).returning()).length===0?null:this.get(t,n)},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(sn).where(m(sn.tenant_id,t)).$dynamic();if(o?.sort_by){let e=sn[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(e=>{let{tenant_id:t,actions:n,...r}=e;return A({...r,actions:j(n,[])})});if(!a)return{flows:c};let[l]=await e.select({count:Ve()}).from(sn).where(m(sn.tenant_id,t));return{flows:c,start:r*i,limit:i,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(sn).where(h(m(sn.tenant_id,t),m(sn.id,n))).returning()).length>0}}}Hn();var fb=[`nodes`,`start`,`ending`];function pb(e){return{async create(t,n){let r=new Date().toISOString(),i=Vn(),a={id:i,tenant_id:t,name:n.name,messages:n.messages,languages:n.languages,translations:n.translations,style:n.style,created_at:r,updated_at:r};for(let e of fb)a[e]=JSON.stringify(n[e]||(e===`nodes`?[]:{}));return await e.insert(on).values(a),{id:i,...n,created_at:r,updated_at:r}},async get(t,n){let r=await e.select().from(on).where(h(m(on.tenant_id,t),m(on.id,n))).get();if(!r)return null;let{tenant_id:i,...a}=r,o={...a};for(let e of fb)o[e]=j(a[e]);return A(o)},async update(t,n,r){let i={updated_at:new Date().toISOString()};for(let[e,t]of Object.entries(r))t!==void 0&&(fb.includes(e)?i[e]=JSON.stringify(t):i[e]=t);return(await e.update(on).set(i).where(h(m(on.tenant_id,t),m(on.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(on).where(m(on.tenant_id,t)).$dynamic();if(o?.sort_by){let e=on[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(e=>{let{tenant_id:t,...n}=e,r={...n};for(let e of fb)r[e]=j(n[e]);return A(r)});if(!a)return{forms:c};let[l]=await e.select({count:Ve()}).from(on).where(m(on.tenant_id,t));return{forms:c,start:r*i,limit:i,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(on).where(h(m(on.tenant_id,t),m(on.id,n))).returning()).length>0}}}function mb(e){if(e!=null){if(typeof e==`number`)return new Date(e).toISOString();if(typeof e==`string`){if(e===``)return;let t=parseFloat(e);return!isNaN(t)&&/^\d+(\.\d+)?$/.test(e)?new Date(t).toISOString():e}}}function hb(e,t=new Date(0).toISOString()){return mb(e)??t}function gb(e){if(!e||e===``)return null;let t=new Date(e);return isNaN(t.getTime())?null:t.getTime()}function _b(e,t,n=[]){let r={};for(let n of t){let t=n.replace(/_ts$/,``);r[t]=hb(e[n])}for(let t of n){let n=t.replace(/_ts$/,``);r[n]=mb(e[t])}return r}Hn();var vb=Bn(`0123456789abcdefghijklmnopqrstuvwxyz`,17);function yb(){return`hc_${vb()}`}function bb(e){let{created_at_ts:t,updated_at_ts:n,secrets:r,...i}=e,a=_b({created_at_ts:t,updated_at_ts:n},[`created_at_ts`,`updated_at_ts`]);return{...i,...a,secrets:r?JSON.parse(r):void 0}}function xb(e){return{async create(t,n){let r=Date.now(),i={id:yb(),tenant_id:t,code:n.code,secrets:n.secrets?JSON.stringify(n.secrets):null,created_at_ts:r,updated_at_ts:r};return await e.insert(fn).values(i),bb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(fn).where(h(m(fn.tenant_id,t),m(fn.id,n))).get();return r?bb(r):null},async update(t,n,r){let i={updated_at_ts:Date.now()};return r.code!==void 0&&(i.code=r.code),r.secrets!==void 0&&(i.secrets=JSON.stringify(r.secrets)),(await e.update(fn).set(i).where(h(m(fn.tenant_id,t),m(fn.id,n))).returning()).length>0},async remove(t,n){return(await e.delete(fn).where(h(m(fn.tenant_id,t),m(fn.id,n))).returning()).length>0}}}function Sb(){let{customAlphabet:e}=(Hn(),s(Ln));return`h_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}function Cb(e){if(!(typeof e!=`string`||!e))try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:void 0}catch{return}}function wb(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,metadata:i,...a}=e,o=_b({created_at_ts:n,updated_at_ts:r},[`created_at_ts`,`updated_at_ts`]);return A({...a,enabled:!!a.enabled,synchronous:!!a.synchronous,metadata:Cb(i),...o})}function Tb(e){return{async create(t,n){let r=Date.now(),i={hook_id:n.hook_id||Sb(),tenant_id:t,trigger_id:n.trigger_id,url:n.url,enabled:n.enabled??!0,synchronous:n.synchronous??!1,priority:n.priority,form_id:n.form_id,template_id:n.template_id,code_id:n.code_id,metadata:n.metadata?JSON.stringify(n.metadata):null,created_at_ts:r,updated_at_ts:r};return await e.insert(dn).values(i),wb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(dn).where(h(m(dn.tenant_id,t),m(dn.hook_id,n))).get();return r?wb(r):null},async update(t,n,r){let i={updated_at_ts:Date.now()};return r.trigger_id!==void 0&&(i.trigger_id=r.trigger_id),r.url!==void 0&&(i.url=r.url),r.enabled!==void 0&&(i.enabled=r.enabled),r.synchronous!==void 0&&(i.synchronous=r.synchronous),r.priority!==void 0&&(i.priority=r.priority),r.form_id!==void 0&&(i.form_id=r.form_id),r.template_id!==void 0&&(i.template_id=r.template_id),r.code_id!==void 0&&(i.code_id=r.code_id),r.metadata!==void 0&&(i.metadata=r.metadata===null?null:JSON.stringify(r.metadata)),(await e.update(dn).set(i).where(h(m(dn.tenant_id,t),m(dn.hook_id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=s?En(dn,s,[`url`,`form_id`,`template_id`,`code_id`]):void 0,l=c?h(m(dn.tenant_id,t),c):m(dn.tenant_id,t),u=e.select().from(dn).where(l).$dynamic(),d=o?.sort_by?dn[o.sort_by]:void 0;u=d?u.orderBy(o?.sort_order===`desc`?Be(d):ze(d)):u.orderBy(Be(dn.priority),ze(dn.created_at_ts));let f=(await u.offset(r*i).limit(i)).map(wb);if(!a)return{hooks:f};let[ee]=await e.select({count:Ve()}).from(dn).where(l);return{hooks:f,start:r*i,limit:i,length:Number(ee?.count??0)}},async remove(t,n){return(await e.delete(dn).where(h(m(dn.tenant_id,t),m(dn.hook_id,n))).returning()).length>0}}}function Eb(){let{customAlphabet:e}=(Hn(),s(Ln));return`inv_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}var Db=[`inviter`,`invitee`,`app_metadata`,`user_metadata`,`roles`];function Ob(e){let{tenant_id:t,send_invitation_email:n,...r}=e,i={...r};for(let e of Db)i[e]=j(r[e],e===`roles`?[]:{});return i.send_invitation_email=!!n,A(i)}function kb(e){return{async create(t,n){let r=n.id||Eb(),i=n.ttl_sec||604800,a=new Date,o=new Date(a.getTime()+i*1e3).toISOString(),s={id:r,tenant_id:t,organization_id:n.organization_id,client_id:n.client_id,connection_id:n.connection_id,invitation_url:n.invitation_url,ticket_id:n.ticket_id,ttl_sec:i,send_invitation_email:n.send_invitation_email===!1?0:1,created_at:a.toISOString(),expires_at:o};for(let e of Db)n[e]!==void 0&&(s[e]=JSON.stringify(n[e]));try{await e.insert(Zt).values(s)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`duplicate key`)?new Tn(409,{message:`Invite already exists`}):e}return Ob({...s,tenant_id:t})},async get(t,n){let r=await e.select().from(Zt).where(h(m(Zt.tenant_id,t),m(Zt.id,n))).get();return r?Ob(r):null},async update(t,n,r){let i={};for(let e of Db)r[e]!==void 0&&(i[e]=JSON.stringify(r[e]));return r.connection_id!==void 0&&(i.connection_id=r.connection_id),r.ttl_sec!==void 0&&(i.ttl_sec=r.ttl_sec,i.expires_at=new Date(Date.now()+r.ttl_sec*1e3).toISOString()),(await e.update(Zt).set(i).where(h(m(Zt.tenant_id,t),m(Zt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(Zt).where(m(Zt.tenant_id,t)).$dynamic();if(o?.sort_by){let e=Zt[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(Ob);if(!a)return{invites:c};let[l]=await e.select({count:Ve()}).from(Zt).where(m(Zt.tenant_id,t));return{invites:c,start:r*i,limit:i,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(Zt).where(h(m(Zt.tenant_id,t),m(Zt.id,n))).returning()).length>0}}}function Ab(e){return{async create(t){await e.insert(pn).values({...t,created_at:new Date().toDateString()})},async list(t){let{page:n=0,per_page:r=50,include_totals:i=!1,sort:a}=t||{},o=new Date().toISOString(),s=e.select().from(pn).where(Ae(je(pn.revoked_at,o),Ie(pn.revoked_at))).$dynamic();if(a?.sort_by){let e=pn[a.sort_by];e&&(s=s.orderBy(a.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(n*r).limit(r)).map(e=>{let{created_at:t,...n}=e;return A(n)});if(!i)return{signingKeys:c};let[l]=await e.select({count:Ve()}).from(pn).where(Ae(je(pn.revoked_at,o),Ie(pn.revoked_at)));return{signingKeys:c,start:n*r,limit:r,length:Sn(l?.count??0)}},async update(t,n){return(await e.update(pn).set(n).where(m(pn.kid,t)).returning()).length>0}}}var jb=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,Mb=32;function Nb(){let e=Date.now(),t=``;for(let n=10;n>0;n--)t=jb.charAt(e%Mb)+t,e=Math.floor(e/Mb);let n=new Uint8Array(16);crypto.getRandomValues(n);for(let e=0;e<16;e++)t+=jb.charAt(n[e]%Mb);return t}function Pb(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,expires_at_ts:i,state_data:a,auth_params:o,...s}=e,c=_b({created_at_ts:n,updated_at_ts:r,expires_at_ts:i},[`created_at_ts`,`updated_at_ts`,`expires_at_ts`]),l={};for(let[e,t]of Object.entries(s))t!=null&&(l[e]=t);return A({...xn(l,[`auth_strategy`]),authParams:typeof o==`string`&&o.length>0?JSON.parse(o):{},...c,state_data:j(a)})}function Fb(e){return{async create(t,n){let r=Date.now(),i={id:Nb(),tenant_id:t,session_id:n.session_id,csrf_token:n.csrf_token,auth_params:JSON.stringify(n.authParams||{}),authorization_url:n.authorization_url?n.authorization_url.substring(0,1024):void 0,ip:n.ip,useragent:n.useragent,auth0Client:n.auth0Client,state:n.state||`pending`,state_data:n.state_data?JSON.stringify(n.state_data):void 0,failure_reason:n.failure_reason,user_id:n.user_id,auth_connection:n.auth_connection,auth_strategy_strategy:n.auth_strategy?.strategy,auth_strategy_strategy_type:n.auth_strategy?.strategy_type,authenticated_at:n.authenticated_at,created_at_ts:r,updated_at_ts:r,expires_at_ts:n.expires_at?gb(n.expires_at):r+1e3*60*60*24};return await e.insert(C).values(i),Pb({...i,tenant_id:t})},async get(t,n){let r=t?h(m(C.tenant_id,t),m(C.id,n)):m(C.id,n),i=await e.select().from(C).where(r).get();return i?Pb(i):null},async update(t,n,r){let i={updated_at_ts:Date.now()};if(r.session_id!==void 0&&(i.session_id=r.session_id),r.state!==void 0&&(i.state=r.state),r.state_data!==void 0&&(i.state_data=JSON.stringify(r.state_data)),r.failure_reason!==void 0&&(i.failure_reason=r.failure_reason),r.user_id!==void 0&&(i.user_id=r.user_id),r.auth_connection!==void 0&&(i.auth_connection=r.auth_connection),r.auth_strategy!==void 0&&(i.auth_strategy_strategy=r.auth_strategy?.strategy,i.auth_strategy_strategy_type=r.auth_strategy?.strategy_type),r.authenticated_at!==void 0&&(i.authenticated_at=r.authenticated_at),r.authorization_url!==void 0&&(i.authorization_url=r.authorization_url?.substring(0,1024)),r.expires_at!==void 0&&(i.expires_at_ts=gb(r.expires_at)),r.authParams!==void 0){let a=await e.select({auth_params:C.auth_params}).from(C).where(h(m(C.tenant_id,t),m(C.id,n))).get(),o=a?.auth_params&&typeof a.auth_params==`string`&&a.auth_params.length>0?JSON.parse(a.auth_params):{};i.auth_params=JSON.stringify({...o,...r.authParams})}return await e.update(C).set(i).where(h(m(C.tenant_id,t),m(C.id,n))),!0},async remove(t,n){return(await e.delete(C).where(h(m(C.tenant_id,t),m(C.id,n))).returning()).length>0}}}Hn();function Ib(e){let{tenant_id:t,isMobile:n,auth0_client:r,details:i,country_code:a,city_name:o,latitude:s,longitude:c,time_zone:l,continent_code:u,scope:d,...f}=e,ee={...f,isMobile:!!n,auth0_client:j(r),details:j(i),scope:d?d.split(`,`):void 0};return a&&(ee.location_info=A({country_code:a,city_name:o,latitude:s,longitude:c,time_zone:l,continent_code:u})),A(ee)}function Lb(e){return{async create(t,n){let r={log_id:n.log_id||Vn(),tenant_id:t,type:n.type,date:n.date||new Date().toISOString(),category:n.category,user_id:n.user_id,ip:n.ip,client_id:n.client_id,client_name:n.client_name,user_agent:n.user_agent?.substring(0,256),description:n.description?.substring(0,256),isMobile:+!!n.isMobile,user_name:n.user_name,connection:n.connection,connection_id:n.connection_id,audience:n.audience,scope:Array.isArray(n.scope)?n.scope.join(`,`):n.scope,strategy:n.strategy,strategy_type:n.strategy_type,hostname:n.hostname,session_connection:n.session_connection};return n.auth0_client&&(r.auth0_client=JSON.stringify(n.auth0_client)),n.details&&(r.details=JSON.stringify(n.details).substring(0,8192)),n.location_info&&(r.country_code=n.location_info.country_code,r.city_name=n.location_info.city_name,r.latitude=n.location_info.latitude,r.longitude=n.location_info.longitude,r.time_zone=n.location_info.time_zone,r.continent_code=n.location_info.continent_code),await e.insert(D).values(r),Ib({...r,tenant_id:t})},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s,from_date:c,to_date:l}=n||{},u=[m(D.tenant_id,t)];if(s){let e=En(D,s,[`user_id`,`ip`,`type`,`client_id`]);e&&u.push(e)}typeof c==`number`&&Number.isFinite(c)&&u.push(Me(D.date,new Date(Math.floor(c)*1e3).toISOString())),typeof l==`number`&&Number.isFinite(l)&&u.push(Ne(D.date,new Date((Math.floor(l)+1)*1e3).toISOString()));let d=h(...u),f=e.select().from(D).where(d).$dynamic();if(o?.sort_by){let e=D[o.sort_by];e&&(f=f.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}else f=f.orderBy(Be(D.date));let ee=(await f.offset(r*i).limit(i)).map(Ib);if(!a)return{logs:ee};let[te]=await e.select({count:Ve()}).from(D).where(d);return{logs:ee,start:r*i,limit:i,length:Number(te?.count??0)}},async get(t,n){let r=await e.select().from(D).where(h(m(D.tenant_id,t),m(D.log_id,n))).get();return r?Ib(r):null}}}var Rb=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,zb=32;function Bb(){let e=Date.now(),t=``;for(let n=10;n>0;n--)t=Rb.charAt(e%zb)+t,e=Math.floor(e/zb);let n=new Uint8Array(16);crypto.getRandomValues(n);for(let e=0;e<16;e++)t+=Rb.charAt(n[e]%zb);return t}function Vb(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,credential_backed_up:i,confirmed:a,transports:o,...s}=e;return A({...s,confirmed:!!a,credential_backed_up:i==null?void 0:!!i,transports:j(o),created_at:hb(n),updated_at:hb(r)})}function Hb(e){return{async create(t,n){let r=Date.now(),i={id:n.id||Bb(),tenant_id:t,user_id:n.user_id,type:n.type,phone_number:n.phone_number,totp_secret:n.totp_secret,credential_id:n.credential_id,public_key:n.public_key,sign_count:n.sign_count,credential_backed_up:n.credential_backed_up==null?null:+!!n.credential_backed_up,transports:n.transports?JSON.stringify(n.transports):null,friendly_name:n.friendly_name,confirmed:+!!n.confirmed,created_at_ts:r,updated_at_ts:r};return await e.insert(hn).values(i),Vb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(hn).where(h(m(hn.tenant_id,t),m(hn.id,n))).get();return r?Vb(r):null},async getByCredentialId(t,n){let r=await e.select().from(hn).where(h(m(hn.tenant_id,t),m(hn.credential_id,n))).get();return r?Vb(r):null},async list(t,n){return(await e.select().from(hn).where(h(m(hn.tenant_id,t),m(hn.user_id,n))).all()).map(Vb)},async update(t,n,r){let i={updated_at_ts:Date.now()};r.type!==void 0&&(i.type=r.type),r.phone_number!==void 0&&(i.phone_number=r.phone_number),r.totp_secret!==void 0&&(i.totp_secret=r.totp_secret),r.credential_id!==void 0&&(i.credential_id=r.credential_id),r.public_key!==void 0&&(i.public_key=r.public_key),r.sign_count!==void 0&&(i.sign_count=r.sign_count),r.credential_backed_up!==void 0&&(i.credential_backed_up=+!!r.credential_backed_up),r.transports!==void 0&&(i.transports=JSON.stringify(r.transports)),r.friendly_name!==void 0&&(i.friendly_name=r.friendly_name),r.confirmed!==void 0&&(i.confirmed=+!!r.confirmed),await e.update(hn).set(i).where(h(m(hn.tenant_id,t),m(hn.id,n)));let a=await this.get(t,n);if(!a)throw Error(`Authentication method ${n} not found after update`);return a},async remove(t,n){return(await e.delete(hn).where(h(m(hn.tenant_id,t),m(hn.id,n))).returning()).length>0}}}function Ub(){let{customAlphabet:e}=(Hn(),s(Ln));return`org_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}function Wb(e){let{tenant_id:t,branding:n,metadata:r,enabled_connections:i,token_quota:a,...o}=e;return A({...o,branding:j(n,{}),metadata:j(r,{}),enabled_connections:j(i,[]),token_quota:j(a,{})})}function Gb(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||Ub(),tenant_id:t,name:n.name,display_name:n.display_name,branding:JSON.stringify(n.branding||{}),metadata:JSON.stringify(n.metadata||{}),enabled_connections:JSON.stringify(n.enabled_connections||[]),token_quota:JSON.stringify(n.token_quota||{}),created_at:r,updated_at:r};try{await e.insert(Yt).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`AlreadyExists`)?new Tn(409,{message:`Organization already exists`}):e}return Wb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(Yt).where(h(m(Yt.tenant_id,t),m(Yt.id,n))).get();return r||=await e.select().from(Yt).where(h(m(Yt.tenant_id,t),m(Yt.name,n))).get(),r?Wb(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.display_name!==void 0&&(i.display_name=r.display_name),r.branding!==void 0&&(i.branding=JSON.stringify(r.branding)),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),r.enabled_connections!==void 0&&(i.enabled_connections=JSON.stringify(r.enabled_connections)),r.token_quota!==void 0&&(i.token_quota=JSON.stringify(r.token_quota)),(await e.update(Yt).set(i).where(h(m(Yt.tenant_id,t),m(Yt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=e.select().from(Yt).where(m(Yt.tenant_id,t)).$dynamic();if(s&&(c=c.where(Ae(Re(Yt.name,`%${s}%`),Re(Yt.display_name,`%${s}%`)))),o?.sort_by){let e=Yt[o.sort_by];e&&(c=c.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let l=(await c.offset(r*i).limit(i)).map(Wb);if(!a)return{organizations:l};let u=[m(Yt.tenant_id,t)];s&&u.push(Ae(Re(Yt.name,`%${s}%`),Re(Yt.display_name,`%${s}%`)));let[d]=await e.select({count:Ve()}).from(Yt).where(h(...u));return{organizations:l,start:r*i,limit:i,length:Number(d?.count??0)}},async remove(t,n){return(await e.delete(Yt).where(h(m(Yt.tenant_id,t),m(Yt.id,n))).returning()).length>0}}}Hn();function Kb(e){let{tenant_id:t,is_current:n,...r}=e;return{...r,is_current:!!n}}function qb(e){return{async create(t,n){let r=new Date().toISOString(),i=n.id||Vn();n.is_current!==!1&&await e.update(zt).set({is_current:0}).where(h(m(zt.tenant_id,t),m(zt.user_id,n.user_id)));let a={id:i,tenant_id:t,user_id:n.user_id,password:n.password,algorithm:n.algorithm||`bcrypt`,is_current:n.is_current===!1?0:1,created_at:r,updated_at:r};return await e.insert(zt).values(a),Kb({...a,tenant_id:t})},async get(t,n){let r=await e.select().from(zt).where(h(m(zt.tenant_id,t),m(zt.user_id,n),m(zt.is_current,1))).get();return r?Kb(r):null},async list(t,n,r){let i=e.select().from(zt).where(h(m(zt.tenant_id,t),m(zt.user_id,n))).orderBy(Be(zt.created_at)).$dynamic();return r&&(i=i.limit(r)),(await i).map(Kb)},async update(t,n){let r={updated_at:new Date().toISOString()};return n.password!==void 0&&(r.password=n.password),n.algorithm!==void 0&&(r.algorithm=n.algorithm),n.is_current!==void 0&&(r.is_current=+!!n.is_current),n.id?await e.update(zt).set(r).where(h(m(zt.tenant_id,t),m(zt.id,n.id))):await e.update(zt).set(r).where(h(m(zt.tenant_id,t),m(zt.user_id,n.user_id),m(zt.is_current,1))),!0}}}function Jb(e){return{async get(t){let n=await e.select().from(cn).where(m(cn.tenant_id,t)).get();return n?{universal_login_experience:n.universal_login_experience,identifier_first:!!n.identifier_first,password_first:!!n.password_first,webauthn_platform_first_factor:!!n.webauthn_platform_first_factor}:{universal_login_experience:`new`,identifier_first:!0,password_first:!1,webauthn_platform_first_factor:!1}},async set(t,n){await e.insert(cn).values({tenant_id:t,universal_login_experience:n.universal_login_experience,identifier_first:n.identifier_first,password_first:n.password_first,webauthn_platform_first_factor:n.webauthn_platform_first_factor}).onConflictDoUpdate({target:cn.tenant_id,set:{universal_login_experience:n.universal_login_experience,identifier_first:n.identifier_first,password_first:n.password_first,webauthn_platform_first_factor:n.webauthn_platform_first_factor}})}}}Hn();function Yb(e){if(!e)return{path:`/*`};try{let t=JSON.parse(e),n=Ny.safeParse(t);if(n.success)return n.data}catch{}return{path:`/*`}}function Xb(e){if(!e)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=Py.safeParse(e);t.success&&n.push(t.data)}return n}catch{return[]}}function Zb(e){return{id:e.id,tenant_id:e.tenant_id,custom_domain_id:e.custom_domain_id,priority:e.priority,match:Yb(e.match),handlers:Xb(e.handlers),created_at:e.created_at,updated_at:e.updated_at}}function Qb(e){return{async create(t,n){let r=new Date().toISOString(),i={id:Vn(),tenant_id:t,custom_domain_id:n.custom_domain_id,priority:n.priority,match:n.match,handlers:n.handlers,created_at:r,updated_at:r};return await e.insert(k).values({id:i.id,tenant_id:i.tenant_id,custom_domain_id:i.custom_domain_id,priority:i.priority,match:JSON.stringify(i.match),handlers:JSON.stringify(i.handlers),created_at:i.created_at,updated_at:i.updated_at}),i},async get(t,n){let r=await e.select().from(k).where(h(m(k.tenant_id,t),m(k.id,n))).limit(1);return r[0]?Zb(r[0]):null},async list(t,n={}){let r=n.page??0,i=n.per_page??50,a=[m(k.tenant_id,t)];n.custom_domain_id&&a.push(m(k.custom_domain_id,n.custom_domain_id));let o=await e.select().from(k).where(h(...a)).orderBy(ze(k.priority),ze(k.created_at)).offset(r*i).limit(i);return{proxy_routes:o.map(Zb),start:r*i,limit:i,length:o.length}},async update(t,n,r){let i={updated_at:new Date().toISOString()};r.priority!==void 0&&(i.priority=r.priority),r.match!==void 0&&(i.match=JSON.stringify(r.match)),r.handlers!==void 0&&(i.handlers=JSON.stringify(r.handlers));let a=(await e.update(k).set(i).where(h(m(k.tenant_id,t),m(k.id,n))))?.changes;return typeof a==`number`?a>0:(await e.select({id:k.id}).from(k).where(h(m(k.tenant_id,t),m(k.id,n))).limit(1)).length>0},async remove(t,n){return(await e.select({id:k.id}).from(k).where(h(m(k.tenant_id,t),m(k.id,n))).limit(1)).length===0?!1:(await e.delete(k).where(h(m(k.tenant_id,t),m(k.id,n))),!0)}}}Hn();function $b(e){let{tenant_id:t,created_at_ts:n,expires_at_ts:r,idle_expires_at_ts:i,last_exchanged_at_ts:a,revoked_at_ts:o,rotated_at_ts:s,device:c,resource_servers:l,rotating:u,...d}=e,f=_b({created_at_ts:n,expires_at_ts:r,idle_expires_at_ts:i,last_exchanged_at_ts:a,revoked_at_ts:o,rotated_at_ts:s},[`created_at_ts`],[`expires_at_ts`,`idle_expires_at_ts`,`last_exchanged_at_ts`,`revoked_at_ts`,`rotated_at_ts`]);return A({...d,...f,rotating:!!u,device:j(c,{}),resource_servers:j(l,[])})}function ex(e,t){return Math.max(e??0,t??0)}function tx(e){return{async create(t,n){let r=Date.now(),i={id:n.id||Vn(),tenant_id:t,client_id:n.client_id,login_id:n.login_id,user_id:n.user_id,device:JSON.stringify(n.device||{}),resource_servers:JSON.stringify(n.resource_servers||[]),rotating:n.rotating??!1,token_lookup:n.token_lookup??null,token_hash:n.token_hash??null,family_id:n.family_id??null,rotated_to:n.rotated_to??null,rotated_at_ts:gb(n.rotated_at),created_at_ts:r,expires_at_ts:gb(n.expires_at),idle_expires_at_ts:gb(n.idle_expires_at),last_exchanged_at_ts:gb(n.last_exchanged_at)};await e.run(p`BEGIN`);try{await e.insert(S).values(i);let n=ex(i.expires_at_ts,i.idle_expires_at_ts);n>0&&i.login_id&&await e.update(C).set({expires_at_ts:n,updated_at_ts:r}).where(h(m(C.tenant_id,t),m(C.id,i.login_id),Ne(C.expires_at_ts,n))),await e.run(p`COMMIT`)}catch(t){throw await e.run(p`ROLLBACK`),t}return $b({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(S).where(h(m(S.tenant_id,t),m(S.id,n))).get();return r?$b(r):null},async getByLookup(t,n){let r=await e.select().from(S).where(h(m(S.tenant_id,t),m(S.token_lookup,n))).get();return r?$b(r):null},async update(t,n,r,i){let a={};r.device!==void 0&&(a.device=JSON.stringify(r.device)),r.resource_servers!==void 0&&(a.resource_servers=JSON.stringify(r.resource_servers)),r.rotating!==void 0&&(a.rotating=r.rotating),r.token_lookup!==void 0&&(a.token_lookup=r.token_lookup),r.token_hash!==void 0&&(a.token_hash=r.token_hash),r.family_id!==void 0&&(a.family_id=r.family_id),r.rotated_to!==void 0&&(a.rotated_to=r.rotated_to),r.rotated_at!==void 0&&(a.rotated_at_ts=gb(r.rotated_at)),r.expires_at!==void 0&&(a.expires_at_ts=gb(r.expires_at)),r.idle_expires_at!==void 0&&(a.idle_expires_at_ts=gb(r.idle_expires_at)),r.last_exchanged_at!==void 0&&(a.last_exchanged_at_ts=gb(r.last_exchanged_at)),r.revoked_at!==void 0&&(a.revoked_at_ts=gb(r.revoked_at));let o=i?.loginSessionBump,s=o?gb(o.expires_at):null,c=await e.update(S).set(a).where(h(m(S.tenant_id,t),m(S.id,n))).returning();return o?.login_id&&s&&s>0&&await e.update(C).set({expires_at_ts:s,updated_at_ts:Date.now()}).where(h(m(C.tenant_id,t),m(C.id,o.login_id),Ne(C.expires_at_ts,s))).catch(()=>{}),c.length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=e.select().from(S).where(m(S.tenant_id,t)).$dynamic();if(s){let e=En(S,s,[`user_id`]);e&&(c=c.where(h(m(S.tenant_id,t),e)))}if(o?.sort_by){let e=S[o.sort_by];e&&(c=c.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let l=(await c.offset(r*i).limit(i)).map($b);if(!a)return{refresh_tokens:l};let[u]=await e.select({count:Ve()}).from(S).where(m(S.tenant_id,t));return{refresh_tokens:l,start:r*i,limit:i,length:Number(u?.count??0)}},async remove(t,n){return(await e.delete(S).where(h(m(S.tenant_id,t),m(S.id,n))).returning()).length>0},async revokeByLoginSession(t,n,r){return(await e.update(S).set({revoked_at_ts:gb(r)}).where(h(m(S.tenant_id,t),m(S.login_id,n),Ie(S.revoked_at_ts))).returning()).length},async revokeFamily(t,n,r){return(await e.update(S).set({revoked_at_ts:gb(r)}).where(h(m(S.tenant_id,t),m(S.family_id,n),Ie(S.revoked_at_ts))).returning()).length}}}function nx(){let{customAlphabet:e}=(Hn(),s(Ln));return`api_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}var rx=[`skip_consent_for_verifiable_first_party_clients`,`allow_offline_access`,`is_system`],ix=new Set([`id`,`tenant_id`,`identifier`,`name`,`scopes`,`signing_alg`,`signing_secret`,`token_lifetime`,`token_lifetime_for_web`,`skip_consent_for_verifiable_first_party_clients`,`allow_offline_access`,`verification_key`,`options`,`is_system`,`metadata`,`created_at`,`updated_at`]);function ax(e){let{tenant_id:t,verification_key:n,scopes:r,options:i,metadata:a,...o}=e,s={...o};s.scopes=j(r,[]),s.options=j(i,{}),s.metadata=j(a),n!==void 0&&(s.verificationKey=n);for(let e of rx)o[e]!==void 0&&o[e]!==null&&(s[e]=!!o[e]);return A(s)}function ox(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||nx(),tenant_id:t,identifier:n.identifier,name:n.name,signing_alg:n.signing_alg,signing_secret:n.signing_secret,token_lifetime:n.token_lifetime,token_lifetime_for_web:n.token_lifetime_for_web,scopes:JSON.stringify(n.scopes||[]),options:JSON.stringify(n.options||{}),metadata:n.metadata?JSON.stringify(n.metadata):void 0,verification_key:n.verificationKey||n.verification_key,created_at:r,updated_at:r};for(let e of rx)n[e]!==void 0&&(i[e]=+!!n[e]);return i.is_system===void 0&&(i.is_system=0),await e.insert(E).values(i),ax({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(E).where(h(m(E.tenant_id,t),m(E.id,n))).get();return r?ax(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};r.name!==void 0&&(i.name=r.name),r.identifier!==void 0&&(i.identifier=r.identifier),r.signing_alg!==void 0&&(i.signing_alg=r.signing_alg),r.signing_secret!==void 0&&(i.signing_secret=r.signing_secret),r.token_lifetime!==void 0&&(i.token_lifetime=r.token_lifetime),r.token_lifetime_for_web!==void 0&&(i.token_lifetime_for_web=r.token_lifetime_for_web),r.scopes!==void 0&&(i.scopes=JSON.stringify(r.scopes)),r.options!==void 0&&(i.options=p`json_patch(COALESCE(${E.options}, '{}'), ${JSON.stringify(r.options)})`),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),r.verificationKey!==void 0&&(i.verification_key=r.verificationKey);for(let e of rx)r[e]!==void 0&&(i[e]=+!!r[e]);return(await e.update(E).set(i).where(h(m(E.tenant_id,t),m(E.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=Math.max(0,Math.floor(Number(r)||0)),l=Math.min(Math.max(1,Math.floor(Number(i)||50)),500),u=[m(E.tenant_id,t)];if(s){let e=s.match(/^([^:]+):(.+)$/);if(e){let[,t,n]=e,r=t?.startsWith(`-`),i=r?t?.substring(1):t;if(i&&ix.has(i)&&!r){let e=E[i];u.push(Re(e,`%${n}%`))}}}let d=e.select().from(E).where(h(...u)).$dynamic();if(o?.sort_by&&ix.has(o.sort_by)){let e=E[o.sort_by];d=d.orderBy(o.sort_order===`desc`?Be(e):ze(e))}let f=(await d.offset(c*l).limit(l)).map(ax);if(!a)return{resource_servers:f};let[ee]=await e.select({count:Ve()}).from(E).where(h(...u));return{resource_servers:f,start:c*l,limit:l,length:Number(ee?.count??0)}},async remove(t,n){return(await e.delete(E).where(h(m(E.tenant_id,t),m(E.id,n))).returning()).length>0}}}function sx(e){return{async assign(t,n,r){let i=new Date().toISOString();return await e.insert($t).values(r.map(e=>({tenant_id:t,role_id:n,resource_server_identifier:e.resource_server_identifier,permission_name:e.permission_name,created_at:i}))).onConflictDoNothing(),!0},async list(t,n,r){let i=await e.select({resource_server_identifier:$t.resource_server_identifier,permission_name:$t.permission_name,created_at:$t.created_at}).from($t).where(h(m($t.tenant_id,t),m($t.role_id,n))).all(),a=[...new Set(i.map(e=>e.resource_server_identifier))],o=new Map;if(a.length>0){let n=await e.select({identifier:E.identifier,name:E.name}).from(E).where(h(m(E.tenant_id,t),Fe(E.identifier,a))).all();for(let e of n)o.set(e.identifier,e.name)}return i.map(e=>({...e,resource_server_name:o.get(e.resource_server_identifier)||e.resource_server_identifier}))},async remove(t,n,r){let i=r.map(e=>h(m($t.resource_server_identifier,e.resource_server_identifier),m($t.permission_name,e.permission_name)));return(await e.delete($t).where(h(m($t.tenant_id,t),m($t.role_id,n),Ae(...i))).returning()).length>0}}}function cx(e){return{async create(t,n,r,i){try{await e.insert(en).values({tenant_id:t,user_id:n,resource_server_identifier:r.resource_server_identifier,permission_name:r.permission_name,organization_id:i||``,created_at:new Date().toISOString()})}catch(e){if(e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`SQLITE_CONSTRAINT_PRIMARYKEY`))return!0;throw e}return!0},async list(t,n,r,i){let a=[m(en.tenant_id,t),m(en.user_id,n)];i&&a.push(m(en.organization_id,i));let o=await e.select().from(en).where(h(...a)).all();return await Promise.all(o.map(async n=>{let r=await e.select({name:E.name}).from(E).where(h(m(E.tenant_id,t),m(E.identifier,n.resource_server_identifier))).get();return{resource_server_identifier:n.resource_server_identifier,permission_name:n.permission_name,resource_server_name:r?.name||n.resource_server_identifier,organization_id:n.organization_id===``?void 0:n.organization_id}}))},async remove(t,n,r,i){return(await e.delete(en).where(h(m(en.tenant_id,t),m(en.user_id,n),m(en.resource_server_identifier,r.resource_server_identifier),m(en.permission_name,r.permission_name),m(en.organization_id,i||``))).returning()).length>0}}}Hn();function lx(e){let{tenant_id:t,is_system:n,metadata:r,...i}=e;return A({...i,is_system:n?!0:void 0,metadata:j(r)})}function ux(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||Vn(),tenant_id:t,name:n.name,description:n.description,is_system:+!!n.is_system,metadata:n.metadata?JSON.stringify(n.metadata):void 0,created_at:r,updated_at:r};return await e.insert(Qt).values(i),lx({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(Qt).where(h(m(Qt.tenant_id,t),m(Qt.id,n))).get();return r?lx(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.description!==void 0&&(i.description=r.description),r.is_system!==void 0&&(i.is_system=+!!r.is_system),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),(await e.update(Qt).set(i).where(h(m(Qt.tenant_id,t),m(Qt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=s?En(Qt,s,[`name`]):void 0,l=c?h(m(Qt.tenant_id,t),c):m(Qt.tenant_id,t),u=e.select().from(Qt).where(l).$dynamic();if(o?.sort_by){let e=Qt[o.sort_by];e&&(u=u.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let d=(await u.offset(r*i).limit(i)).map(lx);if(!a)return{roles:d};let[f]=await e.select({count:Ve()}).from(Qt).where(l);return{roles:d,start:r*i,limit:i,length:Number(f?.count??0)}},async remove(t,n){return(await e.delete(Qt).where(h(m(Qt.tenant_id,t),m(Qt.id,n))).returning()).length>0}}}Hn();var dx=[`created_at_ts`,`updated_at_ts`],fx=[`expires_at_ts`,`idle_expires_at_ts`,`authenticated_at_ts`,`last_interaction_at_ts`,`used_at_ts`,`revoked_at_ts`];function px(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,expires_at_ts:i,idle_expires_at_ts:a,authenticated_at_ts:o,last_interaction_at_ts:s,used_at_ts:c,revoked_at_ts:l,device:u,clients:d,...f}=e,ee=_b({created_at_ts:n,updated_at_ts:r,expires_at_ts:i,idle_expires_at_ts:a,authenticated_at_ts:o,last_interaction_at_ts:s,used_at_ts:c,revoked_at_ts:l},[...dx],[...fx]);return A({...f,...ee,device:j(u,{}),clients:j(d,[])})}function mx(e){return{async create(t,n){let r=Date.now(),i={id:n.id||Vn(),tenant_id:t,user_id:n.user_id,login_session_id:n.login_session_id,device:JSON.stringify(n.device||{}),clients:JSON.stringify(n.clients||[]),created_at_ts:r,updated_at_ts:r,expires_at_ts:gb(n.expires_at),idle_expires_at_ts:gb(n.idle_expires_at),authenticated_at_ts:n.authenticated_at?gb(n.authenticated_at):r,last_interaction_at_ts:n.last_interaction_at?gb(n.last_interaction_at):r,used_at_ts:gb(n.used_at),revoked_at_ts:gb(n.revoked_at)};return await e.insert(Bt).values(i),px({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(Bt).where(h(m(Bt.tenant_id,t),m(Bt.id,n))).get();return r?px(r):null},async update(t,n,r){let i={updated_at_ts:Date.now()};return r.user_id!==void 0&&(i.user_id=r.user_id),r.login_session_id!==void 0&&(i.login_session_id=r.login_session_id),r.device!==void 0&&(i.device=JSON.stringify(r.device)),r.clients!==void 0&&(i.clients=JSON.stringify(r.clients)),r.expires_at!==void 0&&(i.expires_at_ts=gb(r.expires_at)),r.idle_expires_at!==void 0&&(i.idle_expires_at_ts=gb(r.idle_expires_at)),r.authenticated_at!==void 0&&(i.authenticated_at_ts=gb(r.authenticated_at)),r.last_interaction_at!==void 0&&(i.last_interaction_at_ts=gb(r.last_interaction_at)),r.used_at!==void 0&&(i.used_at_ts=gb(r.used_at)),r.revoked_at!==void 0&&(i.revoked_at_ts=gb(r.revoked_at)),(await e.update(Bt).set(i).where(h(m(Bt.tenant_id,t),m(Bt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=s?En(Bt,s,[`user_id`]):void 0,l=c?h(m(Bt.tenant_id,t),c):m(Bt.tenant_id,t),u=e.select().from(Bt).where(l).$dynamic();if(o?.sort_by){let e=Bt[o.sort_by];e&&(u=u.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let d=(await u.offset(r*i).limit(i)).map(px);if(!a)return{sessions:d};let[f]=await e.select({count:Ve()}).from(Bt).where(l);return{sessions:d,start:r*i,limit:i,length:Number(f?.count??0)}},async remove(t,n){return(await e.delete(Bt).where(h(m(Bt.tenant_id,t),m(Bt.id,n))).returning()).length>0}}}Hn();var hx=[`session_cookie`,`enabled_locales`,`error_page`,`flags`,`sandbox_versions_available`,`change_password`,`guardian_mfa_page`,`sessions`,`oidc_logout`,`device_flow`,`default_token_quota`,`allowed_logout_urls`,`acr_values_supported`,`mtls`,`mfa`],gx=[`allow_organization_name_in_authentication_api`,`customize_mfa_in_postlogin_action`,`pushed_authorization_requests_supported`,`authorization_response_iss_parameter_supported`];function _x(e){let t={...e};for(let e of hx)typeof t[e]==`string`&&(t[e]=j(t[e]));for(let e of gx)t[e]!==void 0&&t[e]!==null&&(t[e]=t[e]===1);return A(t)}function vx(e){let t={...e};_n(e,hx,t);for(let n of gx)e[n]!==void 0&&(t[n]=+!!e[n]);return yn(t)}function yx(e){return{async create(t){let n={id:t.id||Vn(),created_at:new Date().toISOString(),updated_at:new Date().toISOString(),...t},r=vx(n);try{await e.insert(b).values(r)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`duplicate key`)||e?.code===`SQLITE_CONSTRAINT`?new Tn(409,{message:`Tenant with ID '${n.id}' already exists`}):e}return n},async get(t){let n=await e.select().from(b).where(m(b.id,t)).get();return n?_x(n):null},async list(t){let{page:n=0,per_page:r=50,include_totals:i=!1,sort:a,q:o}=t||{},s=e.select().from(b).$dynamic();if(o){let e=En(b,o,[`friendly_name`]);e&&(s=s.where(e))}if(a?.sort_by){let e=b[a.sort_by];e&&(s=s.orderBy(a.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(n*r).limit(r)).map(_x);if(!i)return{tenants:c};let[l]=await e.select({count:Ve()}).from(b);return{tenants:c,start:n*r,limit:r,length:Number(l?.count??0)}},async update(t,n){let r=vx({...n,id:t,updated_at:new Date().toISOString()});await e.update(b).set(r).where(m(b.id,t))},async remove(t){return(await e.delete(b).where(m(b.id,t)).returning()).length>0}}}Hn();var bx=[`colors`,`borders`,`fonts`,`page_background`,`widget`];function xx(e){let{tenant_id:t,...n}=e,r=xn(n,bx);return r.borders&&(r.borders.show_widget_shadow=!!r.borders.show_widget_shadow),r.fonts&&(r.fonts.links_bold=!!r.fonts.links_bold,r.fonts.subtitle_bold=!!r.fonts.subtitle_bold,r.fonts.title_bold=!!r.fonts.title_bold),A(r)}function Sx(e){return{async create(t,n,r){let i=new Date().toISOString(),a=r||Vn(),o={...bn(n),tenant_id:t,themeId:a,created_at:i,updated_at:i};return await e.insert(an).values(o),xx({...o,tenant_id:t})},async get(t,n){let r=await e.select().from(an).where(h(m(an.tenant_id,t),m(an.themeId,n))).get();return r?xx(r):null},async update(t,n,r){let i=bn(r);return i.updated_at=new Date().toISOString(),await e.update(an).set(i).where(h(m(an.tenant_id,t),m(an.themeId,n))),!0},async remove(t,n){return(await e.delete(an).where(h(m(an.tenant_id,t),m(an.themeId,n))).returning()).length>0}}}function Cx(e){return{async get(t){let n=await e.select({body:rn.body}).from(rn).where(m(rn.tenant_id,t)).get();return n?{body:n.body}:null},async set(t,n){let r=Date.now();await e.insert(rn).values({tenant_id:t,body:n.body,created_at_ts:r,updated_at_ts:r}).onConflictDoUpdate({target:rn.tenant_id,set:{body:n.body,updated_at_ts:r}})},async delete(t){await e.delete(rn).where(m(rn.tenant_id,t))}}}Hn();function wx(e,t){let n={connection:e.connection,provider:e.provider,user_id:e.user_id,isSocial:!!e.is_social};return t?n.isPrimary=!0:n.profileData={email:e.email,email_verified:!!e.email_verified,...typeof e.profileData==`string`?j(e.profileData,{}):{}},n}function Tx(e,t=[]){let{tenant_id:n,app_metadata:r,user_metadata:i,address:a,email_verified:o,phone_verified:s,is_social:c,linked_to:l,profileData:u,...d}=e,f=wx(e,!0),ee=t.map(e=>wx(e,!1));return A({...d,email:e.email||``,email_verified:!!o,phone_verified:s==null?void 0:!!s,is_social:!!c,app_metadata:j(r,{}),user_metadata:j(i,{}),address:j(a),identities:[f,...ee]})}function Ex(e){let t=async(t,n)=>{let r=new Date().toISOString(),i={user_id:n.user_id,tenant_id:t,email:n.email,given_name:n.given_name,family_name:n.family_name,nickname:n.nickname,name:n.name,picture:n.picture,tags:n.tags,phone_number:n.phone_number,phone_verified:n.phone_verified??!1,username:n.username,linked_to:n.linked_to,last_ip:n.last_ip,login_count:n.login_count??0,last_login:n.last_login,provider:n.provider,connection:n.connection,email_verified:n.email_verified??!1,is_social:n.is_social??!1,app_metadata:JSON.stringify(n.app_metadata||{}),user_metadata:JSON.stringify(n.user_metadata||{}),address:n.address?JSON.stringify(n.address):void 0,profileData:n.profileData?JSON.stringify(n.profileData):void 0,locale:n.locale,middle_name:n.middle_name,preferred_username:n.preferred_username,profile:n.profile,website:n.website,gender:n.gender,birthdate:n.birthdate,zoneinfo:n.zoneinfo,created_at:n.created_at||r,updated_at:n.updated_at||r},a=n.password?Vn():void 0;try{if(n.password&&a){await e.run(p`BEGIN`);try{await e.insert(x).values(i),await e.insert(zt).values({id:a,tenant_id:t,user_id:n.user_id,password:n.password.hash||n.password,algorithm:n.password.algorithm||`bcrypt`,is_current:1,created_at:r,updated_at:r}),await e.run(p`COMMIT`)}catch(t){throw await e.run(p`ROLLBACK`),t}}else await e.insert(x).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`AlreadyExists`)?new Tn(409,{message:`User already exists`}):(console.error(`User upsert failed:`,e?.code,e?.message),new Tn(500,{message:`Internal server error`}))}return Tx(i)};return{create:t,rawCreate:t,async get(t,n){let r=await e.select().from(x).where(h(m(x.tenant_id,t),m(x.user_id,n))).get();return r?Tx(r,await e.select().from(x).where(h(m(x.tenant_id,t),m(x.linked_to,n))).all()):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};for(let e of[`email`,`given_name`,`family_name`,`nickname`,`name`,`picture`,`tags`,`phone_number`,`username`,`linked_to`,`last_ip`,`login_count`,`last_login`,`provider`,`connection`,`locale`,`middle_name`,`preferred_username`,`profile`,`website`,`gender`,`birthdate`,`zoneinfo`])r[e]!==void 0&&(i[e]=r[e]);return r.email_verified!==void 0&&(i.email_verified=r.email_verified),r.phone_verified!==void 0&&(i.phone_verified=r.phone_verified),r.is_social!==void 0&&(i.is_social=r.is_social),r.app_metadata!==void 0&&(i.app_metadata=JSON.stringify(r.app_metadata)),r.user_metadata!==void 0&&(i.user_metadata=JSON.stringify(r.user_metadata)),r.address!==void 0&&(i.address=JSON.stringify(r.address)),r.profileData!==void 0&&(i.profileData=JSON.stringify(r.profileData)),(await e.update(x).set(i).where(h(m(x.tenant_id,t),m(x.user_id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=[m(x.tenant_id,t),Ie(x.linked_to)];if(s){let e=En(x,s,[`email`,`name`,`nickname`,`username`]);e&&c.push(e)}let l=h(...c),u=e.select().from(x).where(l).$dynamic();if(o?.sort_by){let e=x[o.sort_by];e&&(u=u.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let d=await u.offset(r*i).limit(i),f=d.map(e=>e.user_id),ee=[];f.length>0&&(ee=await e.select().from(x).where(h(m(x.tenant_id,t),Fe(x.linked_to,f))));let te=d.map(e=>Tx(e,ee.filter(t=>t.linked_to===e.user_id)));if(!a)return{users:te};let[ne]=await e.select({count:Ve()}).from(x).where(l);return{users:te,start:r*i,limit:i,length:Number(ne?.count??0)}},async remove(t,n){await e.run(p`BEGIN`);try{let r=[n,...(await e.select({user_id:x.user_id}).from(x).where(h(m(x.tenant_id,t),m(x.linked_to,n)))).map(e=>e.user_id)];await e.delete(hn).where(h(m(hn.tenant_id,t),Fe(hn.user_id,r))),await e.delete(zt).where(h(m(zt.tenant_id,t),Fe(zt.user_id,r))),await e.delete(x).where(h(m(x.tenant_id,t),m(x.linked_to,n)));let i=await e.delete(x).where(h(m(x.tenant_id,t),m(x.user_id,n))).returning();return await e.run(p`COMMIT`),i.length>0}catch(t){throw await e.run(p`ROLLBACK`),t}},async unlink(t,n,r,i){let a=`${r}|${i}`;return(await e.update(x).set({linked_to:null}).where(h(m(x.tenant_id,t),m(x.user_id,a),m(x.linked_to,n))).returning()).length>0}}}function Dx(e){return{async create(t,n,r,i){try{await e.insert(tn).values({tenant_id:t,user_id:n,role_id:r,organization_id:i||``,created_at:new Date().toISOString()})}catch(e){if(e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`SQLITE_CONSTRAINT_PRIMARYKEY`))return!0;throw e}return!0},async list(t,n,r,i){let a=[m(tn.tenant_id,t),m(tn.user_id,n)];i&&a.push(m(tn.organization_id,i));let o=await e.select({role_id:tn.role_id}).from(tn).where(h(...a)).all();return o.length===0?[]:(await Promise.all(o.map(async n=>{let r=await e.select().from(Qt).where(h(m(Qt.tenant_id,t),m(Qt.id,n.role_id))).get();if(!r)return null;let{tenant_id:i,is_system:a,metadata:o,...s}=r;return A({...s,is_system:a?!0:void 0,metadata:j(o)})}))).filter(Boolean)},async remove(t,n,r,i){return(await e.delete(tn).where(h(m(tn.tenant_id,t),m(tn.user_id,n),m(tn.role_id,r),m(tn.organization_id,i||``))).returning()).length>0}}}Hn();function Ox(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||Vn(),tenant_id:t,user_id:n.user_id,organization_id:n.organization_id,created_at:r,updated_at:r};try{await e.insert(Xt).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`duplicate key`)?new Tn(409,{message:`User organization already exists`}):e}let{tenant_id:a,...o}=i;return o},async get(t,n){let r=await e.select().from(Xt).where(h(m(Xt.tenant_id,t),m(Xt.id,n))).get();if(!r)return null;let{tenant_id:i,...a}=r;return a},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.user_id!==void 0&&(i.user_id=r.user_id),r.organization_id!==void 0&&(i.organization_id=r.organization_id),(await e.update(Xt).set(i).where(h(m(Xt.tenant_id,t),m(Xt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,q:o}=n||{},s=m(Xt.tenant_id,t),c=s;if(o){let e=En(Xt,o,[`user_id`,`organization_id`]);e&&(c=h(s,e))}let l=(await e.select().from(Xt).where(c).offset(r*i).limit(i)).map(e=>{let{tenant_id:t,...n}=e;return n});if(!a)return{userOrganizations:l};let[u]=await e.select({count:Ve()}).from(Xt).where(c);return{userOrganizations:l,start:r*i,limit:i,length:Number(u?.count??0)}},async listUserOrganizations(t,n,r){let{page:i=0,per_page:a=50,include_totals:o=!1}=r||{},s=await e.select().from(Xt).where(h(m(Xt.tenant_id,t),m(Xt.user_id,n))).offset(i*a).limit(a).all(),c=(await Promise.all(s.map(async n=>{let r=await e.select().from(Yt).where(h(m(Yt.tenant_id,t),m(Yt.id,n.organization_id))).get();if(!r)return null;let{tenant_id:i,branding:a,metadata:o,enabled_connections:s,token_quota:c,...l}=r;return A({...l,branding:j(a,{}),metadata:j(o,{}),enabled_connections:j(s,[]),token_quota:j(c,{})})}))).filter(Boolean);if(!o)return{organizations:c};let[l]=await e.select({count:Ve()}).from(Xt).where(h(m(Xt.tenant_id,t),m(Xt.user_id,n)));return{organizations:c,start:i*a,limit:a,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(Xt).where(h(m(Xt.tenant_id,t),m(Xt.id,n))).returning()).length>0}}}var kx=[`s`],Ax=[`pwd_leak`];function jx(e){return/^\d{8}$/.test(e)?`${e.slice(0,4)}-${e.slice(4,6)}-${e.slice(6,8)}`:e}function Mx(e){return{async getDaily(t,n){let r=new Date,i=n?.from?jx(n.from):new Date(r.getTime()-720*60*60*1e3).toISOString().split(`T`)[0],a=n?.to?jx(n.to):r.toISOString().split(`T`)[0];return(await e.select({date:p`substr(${D.date}, 1, 10)`.as(`date`),logins:p`SUM(CASE WHEN ${D.type} IN (${p.join(kx.map(e=>p`${e}`),p`, `)}) THEN 1 ELSE 0 END)`.as(`logins`),signups:p`SUM(CASE WHEN ${D.type} = 'ss' THEN 1 ELSE 0 END)`.as(`signups`),leaked_passwords:p`SUM(CASE WHEN ${D.type} IN (${p.join(Ax.map(e=>p`${e}`),p`, `)}) THEN 1 ELSE 0 END)`.as(`leaked_passwords`)}).from(D).where(h(m(D.tenant_id,t),Me(D.date,i),Pe(D.date,`${a}T23:59:59.999Z`))).groupBy(p`substr(${D.date}, 1, 10)`).orderBy(p`substr(${D.date}, 1, 10)`).all()).map(e=>({date:e.date,logins:Number(e.logins)||0,signups:Number(e.signups)||0,leaked_passwords:Number(e.leaked_passwords)||0,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}))},async getActiveUsers(t){let n=new Date(Date.now()-720*60*60*1e3).toISOString(),[r]=await e.select({count:p`COUNT(DISTINCT ${D.user_id})`.as(`count`)}).from(D).where(h(m(D.tenant_id,t),Me(D.date,n),p`${D.type} IN (${p.join(kx.map(e=>p`${e}`),p`, `)})`));return Number(r?.count)||0}}}var Nx={"active-users":[`s`,`seacft`],logins:[`s`,`f`,`fp`],signups:[`ss`,`fs`],"refresh-tokens":[`seacft`,`fertft`],sessions:[`slo`]},Px={"active-users":{alias:`active_users`,type:`UInt64`,agg:`uniq`},logins:{alias:`logins`,type:`UInt64`,agg:`count`},signups:{alias:`signups`,type:`UInt64`,agg:`count`},"refresh-tokens":{alias:`refresh_tokens`,type:`UInt64`,agg:`count`},sessions:{alias:`sessions`,type:`UInt64`,agg:`count`}};function Fx(e){switch(e){case`hour`:return p`substr(${D.date}, 1, 13)`;case`month`:return p`substr(${D.date}, 1, 7)`;case`day`:return p`substr(${D.date}, 1, 10)`;case`week`:return p`date(substr(${D.date}, 1, 10), '-' || ((cast(strftime('%w', substr(${D.date}, 1, 10)) as integer) + 6) % 7) || ' days')`;default:throw Error(`Unsupported interval '${e}' for SQL analytics adapter`)}}function Ix(e){return`"${e.replace(/"/g,`""`)}"`}function Lx(e){switch(e){case`connection`:return D.connection;case`client_id`:return D.client_id;case`user_type`:return D.strategy_type;case`event`:return D.type;case`time`:throw Error(`time dimension handled separately`)}}function Rx(e){return{async query(t,n,r){let i=Date.now(),a=Nx[n],o=Px[n],s=[m(D.tenant_id,t),Me(D.date,r.from),Ne(D.date,r.to),Fe(D.type,a)];r.filters.connection?.length&&s.push(Fe(D.connection,r.filters.connection)),r.filters.client_id?.length&&s.push(Fe(D.client_id,r.filters.client_id)),r.filters.user_type?.length&&s.push(Fe(D.strategy_type,r.filters.user_type)),r.filters.user_id?.length&&s.push(Fe(D.user_id,r.filters.user_id));let c={},l=[],u=[];for(let e of r.group_by)if(e===`time`){let e=Fx(r.interval);c.time=e,l.push(e),u.push({name:`time`,type:r.interval===`hour`?`DateTime`:`Date`})}else{let t=Lx(e);c[e]=t,l.push(t),u.push({name:e,type:`String`})}c[o.alias]=o.agg===`uniq`?p`COUNT(DISTINCT ${D.user_id})`:p`COUNT(*)`,u.push({name:o.alias,type:o.type});let d=e.select(c).from(D).where(h(...s));l.length>0&&(d=d.groupBy(...l));let f=new Set([...Object.keys(c)]);if(r.order_by){let e=r.order_by.startsWith(`-`),t=e?r.order_by.slice(1):r.order_by;if(!f.has(t))throw Error(`Invalid order_by column '${t}' for analytics query`);let n=Ix(t);d=d.orderBy(p.raw(`${n} ${e?`DESC`:`ASC`}`))}else d=r.group_by[0]===`time`?d.orderBy(p.raw(`${Ix(`time`)} ASC`)):d.orderBy(p.raw(`${Ix(o.alias)} DESC`));d=d.limit(r.limit).offset(r.offset);let ee=(await d.all()).map(e=>{let t={};for(let n of u){let r=e[n.name];t[n.name]=n.type===`UInt64`?Number(r)||0:r??``}return t});return{meta:u,data:ee,rows:ee.length,rows_before_limit_at_least:ee.length,statistics:{elapsed:(Date.now()-i)/1e3}}}}}Hn();function zx(e){return{...e,payload:j(e.payload,{})}}function Bx(e){return{async create(t,n){let r=Vn(),i=new Date().toISOString();return await e.insert(O).values({id:r,tenant_id:t,event_type:n.event_type,log_type:n.log_type,aggregate_type:n.aggregate_type,aggregate_id:n.aggregate_id,payload:JSON.stringify({...n,id:r}),created_at:i,processed_at:null,retry_count:0,next_retry_at:null,error:null,claimed_by:null,claim_expires_at:null}),r},async getByIds(t){return t.length===0?[]:(await e.select().from(O).where(Fe(O.id,t)).all()).map(zx)},async getUnprocessed(t){let n=new Date().toISOString();return(await e.select().from(O).where(h(Ie(O.processed_at),Ae(Ie(O.next_retry_at),Pe(O.next_retry_at,n)),Ae(Ie(O.claimed_by),Pe(O.claim_expires_at,n)))).orderBy(O.created_at,O.id).limit(t).all()).map(zx)},async claimEvents(t,n,r){if(t.length===0)return[];let i=new Date().toISOString(),a=new Date(Date.now()+r).toISOString();return await e.update(O).set({claimed_by:n,claim_expires_at:a}).where(h(Fe(O.id,t),Ie(O.processed_at),Ae(Ie(O.claimed_by),Pe(O.claim_expires_at,i)))),(await e.select({id:O.id}).from(O).where(h(Fe(O.id,t),m(O.claimed_by,n))).all()).map(e=>e.id)},async markProcessed(t){t.length!==0&&await e.update(O).set({processed_at:new Date().toISOString()}).where(Fe(O.id,t))},async markRetry(t,n,r){await e.update(O).set({error:n,next_retry_at:r,retry_count:p`${O.retry_count} + 1`,claimed_by:null,claim_expires_at:null}).where(m(O.id,t))},async cleanup(t){return(await e.delete(O).where(h(p`${O.processed_at} IS NOT NULL`,Pe(O.processed_at,t))).returning()).length},async deadLetter(t,n){let r=new Date().toISOString();await e.update(O).set({processed_at:r,dead_lettered_at:r,final_error:n}).where(m(O.id,t))},async listFailed(t,n={}){let{page:r=0,per_page:i=50,include_totals:a=!1}=n,o=(await e.select().from(O).where(h(m(O.tenant_id,t),Le(O.dead_lettered_at))).orderBy(Be(O.dead_lettered_at),ze(O.id)).offset(r*i).limit(i).all()).map(e=>({...j(e.payload,{}),id:e.id,created_at:e.created_at,processed_at:e.processed_at,retry_count:e.retry_count,next_retry_at:e.next_retry_at,error:e.error,dead_lettered_at:e.dead_lettered_at,final_error:e.final_error})),s=o.length;if(a){let[n]=await e.select({total:Ve()}).from(O).where(h(m(O.tenant_id,t),Le(O.dead_lettered_at)));s=Number(n?.total??o.length)}return{events:o,start:r*i,limit:i,length:s}},async replay(t,n){return(await e.update(O).set({processed_at:null,dead_lettered_at:null,final_error:null,retry_count:0,next_retry_at:null,error:null}).where(h(m(O.id,t),m(O.tenant_id,n),Le(O.dead_lettered_at))).returning()).length>0}}}var Vx=10080*60*1e3;function Hx(e){return async t=>{let n=Date.now()-Vx;try{let r=[Ae(Ne(S.expires_at_ts,n),Ne(S.idle_expires_at_ts,n))];t?.tenant_id&&r.push(m(S.tenant_id,t.tenant_id)),await e.delete(S).where(h(...r)),r=[Ae(Ne(Bt.expires_at_ts,n),Ne(Bt.idle_expires_at_ts,n))],t?.tenant_id&&r.push(m(Bt.tenant_id,t.tenant_id)),t?.user_id&&r.push(m(Bt.user_id,t.user_id)),await e.delete(Bt).where(h(...r)),r=[Ne(C.expires_at_ts,n)],t?.tenant_id&&r.push(m(C.tenant_id,t.tenant_id)),await e.delete(C).where(h(...r))}catch(e){console.error(`Session cleanup error:`,e)}}}function Ux(e,t={useTransactions:!0}){let n={actions:He(),actionExecutions:Ue(),actionVersions:We(),branding:wn(e),clients:Mn(e),clientConnections:Pn(e),clientGrants:Wn(e),clientRegistrationTokens:$y(e),codes:tb(e),connections:ib(e),customDomains:ob(e),customText:sb(e),emailProviders:cb(e),emailTemplates:ub(e),flows:db(e),forms:pb(e),hookCode:xb(e),hooks:Tb(e),invites:kb(e),keys:Ab(e),loginSessions:Fb(e),logs:Lb(e),authenticationMethods:Hb(e),organizations:Gb(e),passwords:qb(e),promptSettings:Jb(e),proxyRoutes:Qb(e),refreshTokens:tx(e),resourceServers:ox(e),rolePermissions:sx(e),userPermissions:cx(e),roles:ux(e),sessions:mx(e),sessionCleanup:Hx(e),tenants:yx(e),themes:Sx(e),universalLoginTemplates:Cx(e),users:Ex(e),userRoles:Dx(e),userOrganizations:Ox(e),stats:Mx(e),analytics:Rx(e),outbox:Bx(e),async transaction(r){if(t.useTransactions===!1)return r(n);await e.run(p`BEGIN`);try{let t=await r(n);return await e.run(p`COMMIT`),t}catch(t){throw await e.run(p`ROLLBACK`),t}}};return n}function Wx(e){if(!e)return{path:`/*`};try{let t=JSON.parse(e),n=Ny.safeParse(t);if(n.success)return n.data}catch{}return{path:`/*`}}function Gx(e){if(!e)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=Py.safeParse(e);t.success&&n.push(t.data)}return n}catch{return[]}}async function Kx(e,t){let n=t.toLowerCase(),r=(await e.select({custom_domain_id:qt.custom_domain_id,tenant_id:qt.tenant_id,domain:qt.domain}).from(qt).where(m(qt.domain,n)).limit(1))[0];if(!r)return null;let i=(await e.select().from(k).where(h(m(k.tenant_id,r.tenant_id),m(k.custom_domain_id,r.custom_domain_id))).orderBy(ze(k.priority),ze(k.created_at))).map(e=>({id:e.id,tenant_id:e.tenant_id,custom_domain_id:e.custom_domain_id,priority:e.priority,match:Wx(e.match),handlers:Gx(e.handlers),created_at:e.created_at,updated_at:e.updated_at}));return{tenant_id:r.tenant_id,custom_domain_id:r.custom_domain_id,domain:r.domain,routes:i}}function qx(e){return{proxyRoutes:Qb(e),resolveHost:t=>Kx(e,t)}}exports.createProxyDataAdapter=qx,exports.createProxyRoutesAdapter=Qb,exports.default=Ux,Object.defineProperty(exports,"sqlite",{enumerable:!0,get:function(){return gn}});
77
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function zf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Hf(t,`input`,e.processors),output:Hf(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Bf(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Bf(r.element,n);if(r.type===`set`)return Bf(r.valueType,n);if(r.type===`lazy`)return Bf(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Bf(r.innerType,n);if(r.type===`intersection`)return Bf(r.left,n)||Bf(r.right,n);if(r.type===`record`||r.type===`map`)return Bf(r.keyType,n)||Bf(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Bf(r.in,n)||Bf(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Bf(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Bf(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Bf(e,n))return!0;return!!(r.rest&&Bf(r.rest,n))}return!1}var Vf=(e,t={})=>n=>{let r=Lf({...n,processors:t});return B(e,r),Rf(r,e),zf(r,e)},Hf=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Lf({...i??{},target:a,io:t,processors:n});return B(e,o),Rf(o,e),zf(o,e)},Uf={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Wf=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Uf[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Gf=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),ee=t.target===`draft-04`||t.target===`openapi-3.0`;d?ee?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?ee?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Kf=(e,t,n,r)=>{n.type=`boolean`},qf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Jf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Yf=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Xf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Zf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Qf=(e,t,n,r)=>{n.not={}},$f=(e,t,n,r)=>{},ep=(e,t,n,r)=>{},tp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},np=(e,t,n,r)=>{let i=e._zod.def,a=vr(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},rp=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ip=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},ap=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},op=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},sp=(e,t,n,r)=>{n.type=`boolean`},cp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},lp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},up=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},dp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},fp=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},pp=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=B(a.element,t,{...r,path:[...r.path,`items`]})},mp=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=B(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=B(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},hp=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>B(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},gp=(e,t,n,r)=>{let i=e._zod.def,a=B(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=B(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},_p=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>B(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?B(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},vp=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=B(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=B(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=B(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},yp=(e,t,n,r)=>{let i=e._zod.def,a=B(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},bp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Sp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Cp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},wp=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;B(o,t,r);let s=t.seen.get(e);s.ref=o},Tp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ep=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Dp=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Op=(e,t,n,r)=>{let i=e._zod.innerType;B(i,t,r);let a=t.seen.get(e);a.ref=i},kp={string:Wf,number:Gf,boolean:Kf,bigint:qf,symbol:Jf,null:Yf,undefined:Xf,void:Zf,never:Qf,any:$f,unknown:ep,date:tp,enum:np,literal:rp,nan:ip,template_literal:ap,file:op,success:sp,custom:cp,function:lp,transform:up,map:dp,set:fp,array:pp,object:mp,union:hp,intersection:gp,tuple:_p,record:vp,nullable:yp,nonoptional:bp,default:xp,prefault:Sp,catch:Cp,pipe:wp,readonly:Tp,promise:Ep,optional:Dp,lazy:Op};function Ap(e,t){if(`_idmap`in e){let n=e,r=Lf({...t,processors:kp}),i={};for(let e of n._idmap.entries()){let[t,n]=e;B(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Rf(r,n),a[t]=zf(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Lf({...t,processors:kp});return B(e,n),Rf(n,e),zf(n,e)}var jp=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=Lf({processors:kp,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return B(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Rf(this.ctx,e);let{"~standard":n,...r}=zf(this.ctx,e);return r}},Mp=a({}),Np=a({$ZodAny:()=>_s,$ZodArray:()=>Cs,$ZodAsyncError:()=>cr,$ZodBase64:()=>ns,$ZodBase64URL:()=>is,$ZodBigInt:()=>fs,$ZodBigIntFormat:()=>ps,$ZodBoolean:()=>ds,$ZodCIDRv4:()=>$o,$ZodCIDRv6:()=>es,$ZodCUID:()=>Vo,$ZodCUID2:()=>Ho,$ZodCatch:()=>oc,$ZodCheck:()=>so,$ZodCheckBigIntFormat:()=>mo,$ZodCheckEndsWith:()=>Do,$ZodCheckGreaterThan:()=>uo,$ZodCheckIncludes:()=>To,$ZodCheckLengthEquals:()=>bo,$ZodCheckLessThan:()=>lo,$ZodCheckLowerCase:()=>Co,$ZodCheckMaxLength:()=>vo,$ZodCheckMaxSize:()=>ho,$ZodCheckMimeType:()=>Ao,$ZodCheckMinLength:()=>yo,$ZodCheckMinSize:()=>go,$ZodCheckMultipleOf:()=>fo,$ZodCheckNumberFormat:()=>po,$ZodCheckOverwrite:()=>jo,$ZodCheckProperty:()=>ko,$ZodCheckRegex:()=>So,$ZodCheckSizeEquals:()=>_o,$ZodCheckStartsWith:()=>Eo,$ZodCheckStringFormat:()=>xo,$ZodCheckUpperCase:()=>wo,$ZodCodec:()=>uc,$ZodCustom:()=>bc,$ZodCustomStringFormat:()=>cs,$ZodDate:()=>xs,$ZodDefault:()=>ec,$ZodDiscriminatedUnion:()=>Ns,$ZodE164:()=>as,$ZodEmail:()=>Lo,$ZodEmoji:()=>zo,$ZodEncodeError:()=>lr,$ZodEnum:()=>Ks,$ZodError:()=>yi,$ZodExactOptional:()=>Qs,$ZodFile:()=>Js,$ZodFunction:()=>_c,$ZodGUID:()=>Fo,$ZodIPv4:()=>Xo,$ZodIPv6:()=>Zo,$ZodISODate:()=>qo,$ZodISODateTime:()=>Ko,$ZodISODuration:()=>Yo,$ZodISOTime:()=>Jo,$ZodIntersection:()=>Ps,$ZodJWT:()=>ss,$ZodKSUID:()=>Go,$ZodLazy:()=>yc,$ZodLiteral:()=>qs,$ZodMAC:()=>Qo,$ZodMap:()=>Hs,$ZodNaN:()=>sc,$ZodNanoID:()=>Bo,$ZodNever:()=>ys,$ZodNonOptional:()=>rc,$ZodNull:()=>gs,$ZodNullable:()=>$s,$ZodNumber:()=>ls,$ZodNumberFormat:()=>us,$ZodObject:()=>Ds,$ZodObjectJIT:()=>Os,$ZodOptional:()=>Zs,$ZodPipe:()=>cc,$ZodPrefault:()=>nc,$ZodPreprocess:()=>pc,$ZodPromise:()=>vc,$ZodReadonly:()=>mc,$ZodRealError:()=>bi,$ZodRecord:()=>Vs,$ZodRegistry:()=>Eu,$ZodSet:()=>Ws,$ZodString:()=>Po,$ZodStringFormat:()=>z,$ZodSuccess:()=>ac,$ZodSymbol:()=>ms,$ZodTemplateLiteral:()=>gc,$ZodTransform:()=>Ys,$ZodTuple:()=>Ls,$ZodType:()=>R,$ZodULID:()=>Uo,$ZodURL:()=>Ro,$ZodUUID:()=>Io,$ZodUndefined:()=>hs,$ZodUnion:()=>As,$ZodUnknown:()=>vs,$ZodVoid:()=>bs,$ZodXID:()=>Wo,$ZodXor:()=>Ms,$brand:()=>sr,$constructor:()=>M,$input:()=>Tu,$output:()=>wu,Doc:()=>Mo,JSONSchema:()=>Mp,JSONSchemaGenerator:()=>jp,NEVER:()=>or,TimePrecision:()=>ed,_any:()=>xd,_array:()=>rf,_base64:()=>Xu,_base64url:()=>Zu,_bigint:()=>md,_boolean:()=>fd,_catch:()=>Cf,_check:()=>Mf,_cidrv4:()=>Ju,_cidrv6:()=>Yu,_coercedBigint:()=>hd,_coercedBoolean:()=>pd,_coercedDate:()=>Ed,_coercedNumber:()=>od,_coercedString:()=>Au,_cuid:()=>Bu,_cuid2:()=>Vu,_custom:()=>kf,_date:()=>Td,_decode:()=>Ii,_decodeAsync:()=>Bi,_default:()=>bf,_discriminatedUnion:()=>sf,_e164:()=>Qu,_email:()=>ju,_emoji:()=>Ru,_encode:()=>Pi,_encodeAsync:()=>Ri,_endsWith:()=>Jd,_enum:()=>pf,_file:()=>gf,_float32:()=>cd,_float64:()=>ld,_gt:()=>Ad,_gte:()=>jd,_guid:()=>Mu,_includes:()=>Kd,_int:()=>sd,_int32:()=>ud,_int64:()=>gd,_intersection:()=>cf,_ipv4:()=>Gu,_ipv6:()=>Ku,_isoDate:()=>nd,_isoDateTime:()=>td,_isoDuration:()=>id,_isoTime:()=>rd,_jwt:()=>$u,_ksuid:()=>Wu,_lazy:()=>Df,_length:()=>Hd,_literal:()=>hf,_lowercase:()=>Wd,_lt:()=>Od,_lte:()=>kd,_mac:()=>qu,_map:()=>df,_max:()=>kd,_maxLength:()=>Bd,_maxSize:()=>Ld,_mime:()=>Xd,_min:()=>jd,_minLength:()=>Vd,_minSize:()=>Rd,_multipleOf:()=>Id,_nan:()=>Dd,_nanoid:()=>zu,_nativeEnum:()=>mf,_negative:()=>Nd,_never:()=>Cd,_nonnegative:()=>Fd,_nonoptional:()=>xf,_nonpositive:()=>Pd,_normalize:()=>Qd,_null:()=>bd,_nullable:()=>yf,_number:()=>ad,_optional:()=>vf,_overwrite:()=>Zd,_parse:()=>Ei,_parseAsync:()=>Oi,_pipe:()=>wf,_positive:()=>Md,_promise:()=>Of,_property:()=>Yd,_readonly:()=>Tf,_record:()=>uf,_refine:()=>Af,_regex:()=>Ud,_safeDecode:()=>Wi,_safeDecodeAsync:()=>Ji,_safeEncode:()=>Hi,_safeEncodeAsync:()=>Ki,_safeParse:()=>Ai,_safeParseAsync:()=>Mi,_set:()=>ff,_size:()=>zd,_slugify:()=>nf,_startsWith:()=>qd,_string:()=>ku,_stringFormat:()=>If,_stringbool:()=>Ff,_success:()=>Sf,_superRefine:()=>jf,_symbol:()=>vd,_templateLiteral:()=>Ef,_toLowerCase:()=>ef,_toUpperCase:()=>tf,_transform:()=>_f,_trim:()=>$d,_tuple:()=>lf,_uint32:()=>dd,_uint64:()=>_d,_ulid:()=>Hu,_undefined:()=>yd,_union:()=>af,_unknown:()=>Sd,_uppercase:()=>Gd,_url:()=>Lu,_uuid:()=>Nu,_uuidv4:()=>Pu,_uuidv6:()=>Fu,_uuidv7:()=>Iu,_void:()=>wd,_xid:()=>Uu,_xor:()=>of,clone:()=>Wr,config:()=>dr,createStandardJSONSchemaMethod:()=>Hf,createToJSONSchemaMethod:()=>Vf,decode:()=>Li,decodeAsync:()=>Vi,describe:()=>Nf,encode:()=>Fi,encodeAsync:()=>zi,extractDefs:()=>Rf,finalize:()=>zf,flattenError:()=>xi,formatError:()=>Si,globalConfig:()=>ur,globalRegistry:()=>Ou,initializeContext:()=>Lf,isValidBase64:()=>ts,isValidBase64URL:()=>rs,isValidJWT:()=>os,locales:()=>Su,meta:()=>Pf,parse:()=>Di,parseAsync:()=>ki,prettifyError:()=>Ti,process:()=>B,regexes:()=>Xi,registry:()=>Du,safeDecode:()=>Gi,safeDecodeAsync:()=>Yi,safeEncode:()=>Ui,safeEncodeAsync:()=>qi,safeParse:()=>ji,safeParseAsync:()=>Ni,toDotPath:()=>wi,toJSONSchema:()=>Ap,treeifyError:()=>Ci,util:()=>fr,version:()=>No}),Pp=a({endsWith:()=>Jd,gt:()=>Ad,gte:()=>jd,includes:()=>Kd,length:()=>Hd,lowercase:()=>Wd,lt:()=>Od,lte:()=>kd,maxLength:()=>Bd,maxSize:()=>Ld,mime:()=>Xd,minLength:()=>Vd,minSize:()=>Rd,multipleOf:()=>Id,negative:()=>Nd,nonnegative:()=>Fd,nonpositive:()=>Pd,normalize:()=>Qd,overwrite:()=>Zd,positive:()=>Md,property:()=>Yd,regex:()=>Ud,size:()=>zd,slugify:()=>nf,startsWith:()=>qd,toLowerCase:()=>ef,toUpperCase:()=>tf,trim:()=>$d,uppercase:()=>Gd}),Fp=a({ZodISODate:()=>Rp,ZodISODateTime:()=>Ip,ZodISODuration:()=>Hp,ZodISOTime:()=>Bp,date:()=>zp,datetime:()=>Lp,duration:()=>Up,time:()=>Vp}),Ip=M(`ZodISODateTime`,(e,t)=>{Ko.init(e,t),U.init(e,t)});function Lp(e){return td(Ip,e)}var Rp=M(`ZodISODate`,(e,t)=>{qo.init(e,t),U.init(e,t)});function zp(e){return nd(Rp,e)}var Bp=M(`ZodISOTime`,(e,t)=>{Jo.init(e,t),U.init(e,t)});function Vp(e){return rd(Bp,e)}var Hp=M(`ZodISODuration`,(e,t)=>{Yo.init(e,t),U.init(e,t)});function Up(e){return id(Hp,e)}var Wp=(e,t)=>{yi.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Si(e,t)},flatten:{value:t=>xi(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,yr,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,yr,2)}},isEmpty:{get(){return e.issues.length===0}}})},Gp=M(`ZodError`,Wp),Kp=M(`ZodError`,Wp,{Parent:Error}),qp=Ei(Kp),Jp=Oi(Kp),Yp=Ai(Kp),Xp=Mi(Kp),Zp=Pi(Kp),Qp=Ii(Kp),$p=Ri(Kp),em=Bi(Kp),tm=Hi(Kp),nm=Wi(Kp),rm=Ki(Kp),im=Ji(Kp),am=a({ZodAny:()=>wh,ZodArray:()=>Nh,ZodBase64:()=>Km,ZodBase64URL:()=>Jm,ZodBigInt:()=>ph,ZodBigIntFormat:()=>hh,ZodBoolean:()=>fh,ZodCIDRv4:()=>Hm,ZodCIDRv6:()=>Wm,ZodCUID:()=>Em,ZodCUID2:()=>Om,ZodCatch:()=>Cg,ZodCodec:()=>kg,ZodCustom:()=>Ug,ZodCustomStringFormat:()=>eh,ZodDate:()=>jh,ZodDefault:()=>hg,ZodDiscriminatedUnion:()=>Hh,ZodE164:()=>Xm,ZodEmail:()=>um,ZodEmoji:()=>Sm,ZodEnum:()=>tg,ZodExactOptional:()=>ug,ZodFile:()=>ig,ZodFunction:()=>Vg,ZodGUID:()=>fm,ZodIPv4:()=>Im,ZodIPv6:()=>Bm,ZodIntersection:()=>Wh,ZodJWT:()=>Qm,ZodKSUID:()=>Pm,ZodLazy:()=>Lg,ZodLiteral:()=>rg,ZodMAC:()=>Rm,ZodMap:()=>Zh,ZodNaN:()=>Tg,ZodNanoID:()=>wm,ZodNever:()=>Dh,ZodNonOptional:()=>yg,ZodNull:()=>Sh,ZodNullable:()=>fg,ZodNumber:()=>ah,ZodNumberFormat:()=>oh,ZodObject:()=>Fh,ZodOptional:()=>cg,ZodPipe:()=>Dg,ZodPrefault:()=>_g,ZodPreprocess:()=>Mg,ZodPromise:()=>zg,ZodReadonly:()=>Ng,ZodRecord:()=>Jh,ZodSet:()=>$h,ZodString:()=>lm,ZodStringFormat:()=>U,ZodSuccess:()=>xg,ZodSymbol:()=>vh,ZodTemplateLiteral:()=>Fg,ZodTransform:()=>og,ZodTuple:()=>Kh,ZodType:()=>V,ZodULID:()=>Am,ZodURL:()=>ym,ZodUUID:()=>mm,ZodUndefined:()=>bh,ZodUnion:()=>Rh,ZodUnknown:()=>Th,ZodVoid:()=>kh,ZodXID:()=>Mm,ZodXor:()=>Bh,_ZodString:()=>cm,_default:()=>gg,_function:()=>Hg,any:()=>K,array:()=>q,base64:()=>qm,base64url:()=>Ym,bigint:()=>mh,boolean:()=>G,catch:()=>wg,check:()=>Wg,cidrv4:()=>Um,cidrv6:()=>Gm,codec:()=>Ag,cuid:()=>Dm,cuid2:()=>km,custom:()=>Gg,date:()=>Mh,describe:()=>Jg,discriminatedUnion:()=>Uh,e164:()=>Zm,email:()=>dm,emoji:()=>Cm,enum:()=>X,exactOptional:()=>dg,file:()=>ag,float32:()=>ch,float64:()=>lh,function:()=>Hg,guid:()=>pm,hash:()=>ih,hex:()=>rh,hostname:()=>nh,httpUrl:()=>xm,instanceof:()=>Xg,int:()=>sh,int32:()=>uh,int64:()=>gh,intersection:()=>Gh,invertCodec:()=>jg,ipv4:()=>Lm,ipv6:()=>Vm,json:()=>Qg,jwt:()=>$m,keyof:()=>Ph,ksuid:()=>Fm,lazy:()=>Rg,literal:()=>Z,looseObject:()=>Lh,looseRecord:()=>Xh,mac:()=>zm,map:()=>Qh,meta:()=>Yg,nan:()=>Eg,nanoid:()=>Tm,nativeEnum:()=>ng,never:()=>Oh,nonoptional:()=>bg,null:()=>Ch,nullable:()=>pg,nullish:()=>mg,number:()=>W,object:()=>J,optional:()=>lg,partialRecord:()=>Yh,pipe:()=>Og,prefault:()=>vg,preprocess:()=>$g,promise:()=>Bg,readonly:()=>Pg,record:()=>Y,refine:()=>Kg,set:()=>eg,strictObject:()=>Ih,string:()=>H,stringFormat:()=>th,stringbool:()=>Zg,success:()=>Sg,superRefine:()=>qg,symbol:()=>yh,templateLiteral:()=>Ig,transform:()=>sg,tuple:()=>qh,uint32:()=>dh,uint64:()=>_h,ulid:()=>jm,undefined:()=>xh,union:()=>zh,unknown:()=>Eh,url:()=>bm,uuid:()=>hm,uuidv4:()=>gm,uuidv6:()=>_m,uuidv7:()=>vm,void:()=>Ah,xid:()=>Nm,xor:()=>Vh}),om=new WeakMap;function sm(e,t,n){let r=Object.getPrototypeOf(e),i=om.get(r);if(i||(i=new Set,om.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var V=M(`ZodType`,(e,t)=>(R.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Hf(e,`input`),output:Hf(e,`output`)}}),e.toJSONSchema=Vf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>qp(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yp(e,t,n),e.parseAsync=async(t,n)=>Jp(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Xp(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Zp(e,t,n),e.decode=(t,n)=>Qp(e,t,n),e.encodeAsync=async(t,n)=>$p(e,t,n),e.decodeAsync=async(t,n)=>em(e,t,n),e.safeEncode=(t,n)=>tm(e,t,n),e.safeDecode=(t,n)=>nm(e,t,n),e.safeEncodeAsync=async(t,n)=>rm(e,t,n),e.safeDecodeAsync=async(t,n)=>im(e,t,n),sm(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Dr(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Wr(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kg(e,t))},superRefine(e,t){return this.check(qg(e,t))},overwrite(e){return this.check(Zd(e))},optional(){return lg(this)},exactOptional(){return dg(this)},nullable(){return pg(this)},nullish(){return lg(pg(this))},nonoptional(e){return bg(this,e)},array(){return q(this)},or(e){return zh([this,e])},and(e){return Gh(this,e)},transform(e){return Og(this,sg(e))},default(e){return gg(this,e)},prefault(e){return vg(this,e)},catch(e){return wg(this,e)},pipe(e){return Og(this,e)},readonly(){return Pg(this)},describe(e){let t=this.clone();return Ou.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ou.get(this);let t=this.clone();return Ou.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Ou.get(e)?.description},configurable:!0}),e)),cm=M(`_ZodString`,(e,t)=>{Po.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wf(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,sm(e,`_ZodString`,{regex(...e){return this.check(Ud(...e))},includes(...e){return this.check(Kd(...e))},startsWith(...e){return this.check(qd(...e))},endsWith(...e){return this.check(Jd(...e))},min(...e){return this.check(Vd(...e))},max(...e){return this.check(Bd(...e))},length(...e){return this.check(Hd(...e))},nonempty(...e){return this.check(Vd(1,...e))},lowercase(e){return this.check(Wd(e))},uppercase(e){return this.check(Gd(e))},trim(){return this.check($d())},normalize(...e){return this.check(Qd(...e))},toLowerCase(){return this.check(ef())},toUpperCase(){return this.check(tf())},slugify(){return this.check(nf())}})}),lm=M(`ZodString`,(e,t)=>{Po.init(e,t),cm.init(e,t),e.email=t=>e.check(ju(um,t)),e.url=t=>e.check(Lu(ym,t)),e.jwt=t=>e.check($u(Qm,t)),e.emoji=t=>e.check(Ru(Sm,t)),e.guid=t=>e.check(Mu(fm,t)),e.uuid=t=>e.check(Nu(mm,t)),e.uuidv4=t=>e.check(Pu(mm,t)),e.uuidv6=t=>e.check(Fu(mm,t)),e.uuidv7=t=>e.check(Iu(mm,t)),e.nanoid=t=>e.check(zu(wm,t)),e.guid=t=>e.check(Mu(fm,t)),e.cuid=t=>e.check(Bu(Em,t)),e.cuid2=t=>e.check(Vu(Om,t)),e.ulid=t=>e.check(Hu(Am,t)),e.base64=t=>e.check(Xu(Km,t)),e.base64url=t=>e.check(Zu(Jm,t)),e.xid=t=>e.check(Uu(Mm,t)),e.ksuid=t=>e.check(Wu(Pm,t)),e.ipv4=t=>e.check(Gu(Im,t)),e.ipv6=t=>e.check(Ku(Bm,t)),e.cidrv4=t=>e.check(Ju(Hm,t)),e.cidrv6=t=>e.check(Yu(Wm,t)),e.e164=t=>e.check(Qu(Xm,t)),e.datetime=t=>e.check(Lp(t)),e.date=t=>e.check(zp(t)),e.time=t=>e.check(Vp(t)),e.duration=t=>e.check(Up(t))});function H(e){return ku(lm,e)}var U=M(`ZodStringFormat`,(e,t)=>{z.init(e,t),cm.init(e,t)}),um=M(`ZodEmail`,(e,t)=>{Lo.init(e,t),U.init(e,t)});function dm(e){return ju(um,e)}var fm=M(`ZodGUID`,(e,t)=>{Fo.init(e,t),U.init(e,t)});function pm(e){return Mu(fm,e)}var mm=M(`ZodUUID`,(e,t)=>{Io.init(e,t),U.init(e,t)});function hm(e){return Nu(mm,e)}function gm(e){return Pu(mm,e)}function _m(e){return Fu(mm,e)}function vm(e){return Iu(mm,e)}var ym=M(`ZodURL`,(e,t)=>{Ro.init(e,t),U.init(e,t)});function bm(e){return Lu(ym,e)}function xm(e){return Lu(ym,{protocol:Da,hostname:Ea,...F(e)})}var Sm=M(`ZodEmoji`,(e,t)=>{zo.init(e,t),U.init(e,t)});function Cm(e){return Ru(Sm,e)}var wm=M(`ZodNanoID`,(e,t)=>{Bo.init(e,t),U.init(e,t)});function Tm(e){return zu(wm,e)}var Em=M(`ZodCUID`,(e,t)=>{Vo.init(e,t),U.init(e,t)});function Dm(e){return Bu(Em,e)}var Om=M(`ZodCUID2`,(e,t)=>{Ho.init(e,t),U.init(e,t)});function km(e){return Vu(Om,e)}var Am=M(`ZodULID`,(e,t)=>{Uo.init(e,t),U.init(e,t)});function jm(e){return Hu(Am,e)}var Mm=M(`ZodXID`,(e,t)=>{Wo.init(e,t),U.init(e,t)});function Nm(e){return Uu(Mm,e)}var Pm=M(`ZodKSUID`,(e,t)=>{Go.init(e,t),U.init(e,t)});function Fm(e){return Wu(Pm,e)}var Im=M(`ZodIPv4`,(e,t)=>{Xo.init(e,t),U.init(e,t)});function Lm(e){return Gu(Im,e)}var Rm=M(`ZodMAC`,(e,t)=>{Qo.init(e,t),U.init(e,t)});function zm(e){return qu(Rm,e)}var Bm=M(`ZodIPv6`,(e,t)=>{Zo.init(e,t),U.init(e,t)});function Vm(e){return Ku(Bm,e)}var Hm=M(`ZodCIDRv4`,(e,t)=>{$o.init(e,t),U.init(e,t)});function Um(e){return Ju(Hm,e)}var Wm=M(`ZodCIDRv6`,(e,t)=>{es.init(e,t),U.init(e,t)});function Gm(e){return Yu(Wm,e)}var Km=M(`ZodBase64`,(e,t)=>{ns.init(e,t),U.init(e,t)});function qm(e){return Xu(Km,e)}var Jm=M(`ZodBase64URL`,(e,t)=>{is.init(e,t),U.init(e,t)});function Ym(e){return Zu(Jm,e)}var Xm=M(`ZodE164`,(e,t)=>{as.init(e,t),U.init(e,t)});function Zm(e){return Qu(Xm,e)}var Qm=M(`ZodJWT`,(e,t)=>{ss.init(e,t),U.init(e,t)});function $m(e){return $u(Qm,e)}var eh=M(`ZodCustomStringFormat`,(e,t)=>{cs.init(e,t),U.init(e,t)});function th(e,t,n={}){return If(eh,e,t,n)}function nh(e){return If(eh,`hostname`,Ta,e)}function rh(e){return If(eh,`hex`,Ua,e)}function ih(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Xi[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return If(eh,n,r,t)}var ah=M(`ZodNumber`,(e,t)=>{ls.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gf(e,t,n,r),sm(e,`ZodNumber`,{gt(e,t){return this.check(Ad(e,t))},gte(e,t){return this.check(jd(e,t))},min(e,t){return this.check(jd(e,t))},lt(e,t){return this.check(Od(e,t))},lte(e,t){return this.check(kd(e,t))},max(e,t){return this.check(kd(e,t))},int(e){return this.check(sh(e))},safe(e){return this.check(sh(e))},positive(e){return this.check(Ad(0,e))},nonnegative(e){return this.check(jd(0,e))},negative(e){return this.check(Od(0,e))},nonpositive(e){return this.check(kd(0,e))},multipleOf(e,t){return this.check(Id(e,t))},step(e,t){return this.check(Id(e,t))},finite(){return this}});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 W(e){return ad(ah,e)}var oh=M(`ZodNumberFormat`,(e,t)=>{us.init(e,t),ah.init(e,t)});function sh(e){return sd(oh,e)}function ch(e){return cd(oh,e)}function lh(e){return ld(oh,e)}function uh(e){return ud(oh,e)}function dh(e){return dd(oh,e)}var fh=M(`ZodBoolean`,(e,t)=>{ds.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kf(e,t,n,r)});function G(e){return fd(fh,e)}var ph=M(`ZodBigInt`,(e,t)=>{fs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qf(e,t,n,r),e.gte=(t,n)=>e.check(jd(t,n)),e.min=(t,n)=>e.check(jd(t,n)),e.gt=(t,n)=>e.check(Ad(t,n)),e.gte=(t,n)=>e.check(jd(t,n)),e.min=(t,n)=>e.check(jd(t,n)),e.lt=(t,n)=>e.check(Od(t,n)),e.lte=(t,n)=>e.check(kd(t,n)),e.max=(t,n)=>e.check(kd(t,n)),e.positive=t=>e.check(Ad(BigInt(0),t)),e.negative=t=>e.check(Od(BigInt(0),t)),e.nonpositive=t=>e.check(kd(BigInt(0),t)),e.nonnegative=t=>e.check(jd(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Id(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function mh(e){return md(ph,e)}var hh=M(`ZodBigIntFormat`,(e,t)=>{ps.init(e,t),ph.init(e,t)});function gh(e){return gd(hh,e)}function _h(e){return _d(hh,e)}var vh=M(`ZodSymbol`,(e,t)=>{ms.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jf(e,t,n,r)});function yh(e){return vd(vh,e)}var bh=M(`ZodUndefined`,(e,t)=>{hs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xf(e,t,n,r)});function xh(e){return yd(bh,e)}var Sh=M(`ZodNull`,(e,t)=>{gs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yf(e,t,n,r)});function Ch(e){return bd(Sh,e)}var wh=M(`ZodAny`,(e,t)=>{_s.init(e,t),V.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function K(){return xd(wh)}var Th=M(`ZodUnknown`,(e,t)=>{vs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Eh(){return Sd(Th)}var Dh=M(`ZodNever`,(e,t)=>{ys.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qf(e,t,n,r)});function Oh(e){return Cd(Dh,e)}var kh=M(`ZodVoid`,(e,t)=>{bs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zf(e,t,n,r)});function Ah(e){return wd(kh,e)}var jh=M(`ZodDate`,(e,t)=>{xs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tp(e,t,n,r),e.min=(t,n)=>e.check(jd(t,n)),e.max=(t,n)=>e.check(kd(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 Mh(e){return Td(jh,e)}var Nh=M(`ZodArray`,(e,t)=>{Cs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pp(e,t,n,r),e.element=t.element,sm(e,`ZodArray`,{min(e,t){return this.check(Vd(e,t))},nonempty(e){return this.check(Vd(1,e))},max(e,t){return this.check(Bd(e,t))},length(e,t){return this.check(Hd(e,t))},unwrap(){return this.element}})});function q(e,t){return rf(Nh,e,t)}function Ph(e){let t=e._zod.def.shape;return X(Object.keys(t))}var Fh=M(`ZodObject`,(e,t)=>{Os.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mp(e,t,n,r),P(e,`shape`,()=>t.shape),sm(e,`ZodObject`,{keyof(){return X(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Eh()})},loose(){return this.clone({...this._zod.def,catchall:Eh()})},strict(){return this.clone({...this._zod.def,catchall:Oh()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Zr(this,e)},safeExtend(e){return Qr(this,e)},merge(e){return $r(this,e)},pick(e){return Yr(this,e)},omit(e){return Xr(this,e)},partial(...e){return ei(cg,this,e[0])},required(...e){return ti(yg,this,e[0])}})});function J(e,t){return new Fh({type:`object`,shape:e??{},...F(t)})}function Ih(e,t){return new Fh({type:`object`,shape:e,catchall:Oh(),...F(t)})}function Lh(e,t){return new Fh({type:`object`,shape:e,catchall:Eh(),...F(t)})}var Rh=M(`ZodUnion`,(e,t)=>{As.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hp(e,t,n,r),e.options=t.options});function zh(e,t){return new Rh({type:`union`,options:e,...F(t)})}var Bh=M(`ZodXor`,(e,t)=>{Rh.init(e,t),Ms.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hp(e,t,n,r),e.options=t.options});function Vh(e,t){return new Bh({type:`union`,options:e,inclusive:!1,...F(t)})}var Hh=M(`ZodDiscriminatedUnion`,(e,t)=>{Rh.init(e,t),Ns.init(e,t)});function Uh(e,t,n){return new Hh({type:`union`,options:t,discriminator:e,...F(n)})}var Wh=M(`ZodIntersection`,(e,t)=>{Ps.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gp(e,t,n,r)});function Gh(e,t){return new Wh({type:`intersection`,left:e,right:t})}var Kh=M(`ZodTuple`,(e,t)=>{Ls.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_p(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function qh(e,t,n){let r=t instanceof R;return new Kh({type:`tuple`,items:e,rest:r?t:null,...F(r?n:t)})}var Jh=M(`ZodRecord`,(e,t)=>{Vs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vp(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Y(e,t,n){return!t||!t._zod?new Jh({type:`record`,keyType:H(),valueType:e,...F(t)}):new Jh({type:`record`,keyType:e,valueType:t,...F(n)})}function Yh(e,t,n){let r=Wr(e);return r._zod.values=void 0,new Jh({type:`record`,keyType:r,valueType:t,...F(n)})}function Xh(e,t,n){return new Jh({type:`record`,keyType:e,valueType:t,mode:`loose`,...F(n)})}var Zh=M(`ZodMap`,(e,t)=>{Hs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dp(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Rd(...t)),e.nonempty=t=>e.check(Rd(1,t)),e.max=(...t)=>e.check(Ld(...t)),e.size=(...t)=>e.check(zd(...t))});function Qh(e,t,n){return new Zh({type:`map`,keyType:e,valueType:t,...F(n)})}var $h=M(`ZodSet`,(e,t)=>{Ws.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fp(e,t,n,r),e.min=(...t)=>e.check(Rd(...t)),e.nonempty=t=>e.check(Rd(1,t)),e.max=(...t)=>e.check(Ld(...t)),e.size=(...t)=>e.check(zd(...t))});function eg(e,t){return new $h({type:`set`,valueType:e,...F(t)})}var tg=M(`ZodEnum`,(e,t)=>{Ks.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>np(e,t,n,r),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 tg({...t,checks:[],...F(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 tg({...t,checks:[],...F(r),entries:i})}});function X(e,t){return new tg({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...F(t)})}function ng(e,t){return new tg({type:`enum`,entries:e,...F(t)})}var rg=M(`ZodLiteral`,(e,t)=>{qs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rp(e,t,n,r),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 Z(e,t){return new rg({type:`literal`,values:Array.isArray(e)?e:[e],...F(t)})}var ig=M(`ZodFile`,(e,t)=>{Js.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>op(e,t,n,r),e.min=(t,n)=>e.check(Rd(t,n)),e.max=(t,n)=>e.check(Ld(t,n)),e.mime=(t,n)=>e.check(Xd(Array.isArray(t)?t:[t],n))});function ag(e){return gf(ig,e)}var og=M(`ZodTransform`,(e,t)=>{Ys.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>up(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new lr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(li(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(li(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function sg(e){return new og({type:`transform`,transform:e})}var cg=M(`ZodOptional`,(e,t)=>{Zs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lg(e){return new cg({type:`optional`,innerType:e})}var ug=M(`ZodExactOptional`,(e,t)=>{Qs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dg(e){return new ug({type:`optional`,innerType:e})}var fg=M(`ZodNullable`,(e,t)=>{$s.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pg(e){return new fg({type:`nullable`,innerType:e})}function mg(e){return lg(pg(e))}var hg=M(`ZodDefault`,(e,t)=>{ec.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gg(e,t){return new hg({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var _g=M(`ZodPrefault`,(e,t)=>{nc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vg(e,t){return new _g({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Rr(t)}})}var yg=M(`ZodNonOptional`,(e,t)=>{rc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bg(e,t){return new yg({type:`nonoptional`,innerType:e,...F(t)})}var xg=M(`ZodSuccess`,(e,t)=>{ac.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sg(e){return new xg({type:`success`,innerType:e})}var Cg=M(`ZodCatch`,(e,t)=>{oc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wg(e,t){return new Cg({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Tg=M(`ZodNaN`,(e,t)=>{sc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ip(e,t,n,r)});function Eg(e){return Dd(Tg,e)}var Dg=M(`ZodPipe`,(e,t)=>{cc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wp(e,t,n,r),e.in=t.in,e.out=t.out});function Og(e,t){return new Dg({type:`pipe`,in:e,out:t})}var kg=M(`ZodCodec`,(e,t)=>{Dg.init(e,t),uc.init(e,t)});function Ag(e,t,n){return new kg({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function jg(e){let t=e._zod.def;return new kg({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Mg=M(`ZodPreprocess`,(e,t)=>{Dg.init(e,t),pc.init(e,t)}),Ng=M(`ZodReadonly`,(e,t)=>{mc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pg(e){return new Ng({type:`readonly`,innerType:e})}var Fg=M(`ZodTemplateLiteral`,(e,t)=>{gc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ap(e,t,n,r)});function Ig(e,t){return new Fg({type:`template_literal`,parts:e,...F(t)})}var Lg=M(`ZodLazy`,(e,t)=>{yc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Op(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Rg(e){return new Lg({type:`lazy`,getter:e})}var zg=M(`ZodPromise`,(e,t)=>{vc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ep(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bg(e){return new zg({type:`promise`,innerType:e})}var Vg=M(`ZodFunction`,(e,t)=>{_c.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lp(e,t,n,r)});function Hg(e){return new Vg({type:`function`,input:Array.isArray(e?.input)?qh(e?.input):e?.input??q(Eh()),output:e?.output??Eh()})}var Ug=M(`ZodCustom`,(e,t)=>{bc.init(e,t),V.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cp(e,t,n,r)});function Wg(e){let t=new so({check:`custom`});return t._zod.check=e,t}function Gg(e,t){return kf(Ug,e??(()=>!0),t)}function Kg(e,t={}){return Af(Ug,e,t)}function qg(e,t){return jf(e,t)}var Jg=Nf,Yg=Pf;function Xg(e,t={}){let n=new Ug({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...F(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Zg=(...e)=>Ff({Codec:kg,Boolean:fh,String:lm},...e);function Qg(e){let t=Rg(()=>zh([H(e),W(),G(),Ch(),q(t),Y(H(),t)]));return t}function $g(e,t){return new Mg({type:`pipe`,in:sg(e),out:t})}var e_={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 t_(e){dr({customError:e})}function n_(){return dr().customError}var r_;r_||={};var Q={...am,...Pp,iso:Fp},i_=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function a_(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function o_(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function s_(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return Q.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Q.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=c_(o_(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return Q.null();if(n.length===0)return Q.never();if(n.length===1)return Q.literal(n[0]);if(n.every(e=>typeof e==`string`))return Q.enum(n);let r=n.map(e=>Q.literal(e));return r.length<2?r[0]:Q.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return Q.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>s_({...e,type:n},t));return r.length===0?Q.never():r.length===1?r[0]:Q.union(r)}if(!n)return Q.any();let r;switch(n){case`string`:{let t=Q.string();if(e.format){let n=e.format;n===`email`?t=t.check(Q.email()):n===`uri`||n===`uri-reference`?t=t.check(Q.url()):n===`uuid`||n===`guid`?t=t.check(Q.uuid()):n===`date-time`?t=t.check(Q.iso.datetime()):n===`date`?t=t.check(Q.iso.date()):n===`time`?t=t.check(Q.iso.time()):n===`duration`?t=t.check(Q.iso.duration()):n===`ipv4`?t=t.check(Q.ipv4()):n===`ipv6`?t=t.check(Q.ipv6()):n===`mac`?t=t.check(Q.mac()):n===`cidr`?t=t.check(Q.cidrv4()):n===`cidr-v6`?t=t.check(Q.cidrv6()):n===`base64`?t=t.check(Q.base64()):n===`base64url`?t=t.check(Q.base64url()):n===`e164`?t=t.check(Q.e164()):n===`jwt`?t=t.check(Q.jwt()):n===`emoji`?t=t.check(Q.emoji()):n===`nanoid`?t=t.check(Q.nanoid()):n===`cuid`?t=t.check(Q.cuid()):n===`cuid2`?t=t.check(Q.cuid2()):n===`ulid`?t=t.check(Q.ulid()):n===`xid`?t=t.check(Q.xid()):n===`ksuid`&&(t=t.check(Q.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?Q.number().int():Q.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=Q.boolean();break;case`null`:r=Q.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=c_(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=c_(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?c_(e.additionalProperties,t):Q.any();if(Object.keys(n).length===0){r=Q.record(i,a);break}let o=Q.object(n).passthrough(),s=Q.looseRecord(i,a);r=Q.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=c_(i[e],t),r=Q.string().regex(new RegExp(e));o.push(Q.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(Q.object(n).passthrough()),s.push(...o),s.length===0)r=Q.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=Q.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=Q.intersection(e,s[t]);r=e}break}let o=Q.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(c_(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>c_(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?c_(i,t):void 0;r=o?Q.tuple(a).rest(o):Q.tuple(a),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>c_(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?c_(e.additionalItems,t):void 0;r=a?Q.tuple(n).rest(a):Q.tuple(n),typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(i!==void 0){let n=c_(i,t),a=Q.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=Q.array(Q.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function c_(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n=s_(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>c_(e,t)),a=Q.union(i);n=r?Q.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>c_(e,t)),a=Q.xor(i);n=r?Q.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:Q.any();else{let i=r?n:c_(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=Q.intersection(i,c_(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=Q.nullable(n)),e.readOnly===!0&&(n=Q.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))i_.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function l_(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:a_(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Ou};return c_(n,r)}var u_=a({bigint:()=>m_,boolean:()=>p_,date:()=>h_,number:()=>f_,string:()=>d_});function d_(e){return Au(lm,e)}function f_(e){return od(ah,e)}function p_(e){return pd(fh,e)}function m_(e){return hd(ph,e)}function h_(e){return Ed(jh,e)}var g_=a({$brand:()=>sr,$input:()=>Tu,$output:()=>wu,NEVER:()=>or,TimePrecision:()=>ed,ZodAny:()=>wh,ZodArray:()=>Nh,ZodBase64:()=>Km,ZodBase64URL:()=>Jm,ZodBigInt:()=>ph,ZodBigIntFormat:()=>hh,ZodBoolean:()=>fh,ZodCIDRv4:()=>Hm,ZodCIDRv6:()=>Wm,ZodCUID:()=>Em,ZodCUID2:()=>Om,ZodCatch:()=>Cg,ZodCodec:()=>kg,ZodCustom:()=>Ug,ZodCustomStringFormat:()=>eh,ZodDate:()=>jh,ZodDefault:()=>hg,ZodDiscriminatedUnion:()=>Hh,ZodE164:()=>Xm,ZodEmail:()=>um,ZodEmoji:()=>Sm,ZodEnum:()=>tg,ZodError:()=>Gp,ZodExactOptional:()=>ug,ZodFile:()=>ig,ZodFirstPartyTypeKind:()=>r_,ZodFunction:()=>Vg,ZodGUID:()=>fm,ZodIPv4:()=>Im,ZodIPv6:()=>Bm,ZodISODate:()=>Rp,ZodISODateTime:()=>Ip,ZodISODuration:()=>Hp,ZodISOTime:()=>Bp,ZodIntersection:()=>Wh,ZodIssueCode:()=>e_,ZodJWT:()=>Qm,ZodKSUID:()=>Pm,ZodLazy:()=>Lg,ZodLiteral:()=>rg,ZodMAC:()=>Rm,ZodMap:()=>Zh,ZodNaN:()=>Tg,ZodNanoID:()=>wm,ZodNever:()=>Dh,ZodNonOptional:()=>yg,ZodNull:()=>Sh,ZodNullable:()=>fg,ZodNumber:()=>ah,ZodNumberFormat:()=>oh,ZodObject:()=>Fh,ZodOptional:()=>cg,ZodPipe:()=>Dg,ZodPrefault:()=>_g,ZodPreprocess:()=>Mg,ZodPromise:()=>zg,ZodReadonly:()=>Ng,ZodRealError:()=>Kp,ZodRecord:()=>Jh,ZodSet:()=>$h,ZodString:()=>lm,ZodStringFormat:()=>U,ZodSuccess:()=>xg,ZodSymbol:()=>vh,ZodTemplateLiteral:()=>Fg,ZodTransform:()=>og,ZodTuple:()=>Kh,ZodType:()=>V,ZodULID:()=>Am,ZodURL:()=>ym,ZodUUID:()=>mm,ZodUndefined:()=>bh,ZodUnion:()=>Rh,ZodUnknown:()=>Th,ZodVoid:()=>kh,ZodXID:()=>Mm,ZodXor:()=>Bh,_ZodString:()=>cm,_default:()=>gg,_function:()=>Hg,any:()=>K,array:()=>q,base64:()=>qm,base64url:()=>Ym,bigint:()=>mh,boolean:()=>G,catch:()=>wg,check:()=>Wg,cidrv4:()=>Um,cidrv6:()=>Gm,clone:()=>Wr,codec:()=>Ag,coerce:()=>u_,config:()=>dr,core:()=>Np,cuid:()=>Dm,cuid2:()=>km,custom:()=>Gg,date:()=>Mh,decode:()=>Qp,decodeAsync:()=>em,describe:()=>Jg,discriminatedUnion:()=>Uh,e164:()=>Zm,email:()=>dm,emoji:()=>Cm,encode:()=>Zp,encodeAsync:()=>$p,endsWith:()=>Jd,enum:()=>X,exactOptional:()=>dg,file:()=>ag,flattenError:()=>xi,float32:()=>ch,float64:()=>lh,formatError:()=>Si,fromJSONSchema:()=>l_,function:()=>Hg,getErrorMap:()=>n_,globalRegistry:()=>Ou,gt:()=>Ad,gte:()=>jd,guid:()=>pm,hash:()=>ih,hex:()=>rh,hostname:()=>nh,httpUrl:()=>xm,includes:()=>Kd,instanceof:()=>Xg,int:()=>sh,int32:()=>uh,int64:()=>gh,intersection:()=>Gh,invertCodec:()=>jg,ipv4:()=>Lm,ipv6:()=>Vm,iso:()=>Fp,json:()=>Qg,jwt:()=>$m,keyof:()=>Ph,ksuid:()=>Fm,lazy:()=>Rg,length:()=>Hd,literal:()=>Z,locales:()=>Su,looseObject:()=>Lh,looseRecord:()=>Xh,lowercase:()=>Wd,lt:()=>Od,lte:()=>kd,mac:()=>zm,map:()=>Qh,maxLength:()=>Bd,maxSize:()=>Ld,meta:()=>Yg,mime:()=>Xd,minLength:()=>Vd,minSize:()=>Rd,multipleOf:()=>Id,nan:()=>Eg,nanoid:()=>Tm,nativeEnum:()=>ng,negative:()=>Nd,never:()=>Oh,nonnegative:()=>Fd,nonoptional:()=>bg,nonpositive:()=>Pd,normalize:()=>Qd,null:()=>Ch,nullable:()=>pg,nullish:()=>mg,number:()=>W,object:()=>J,optional:()=>lg,overwrite:()=>Zd,parse:()=>qp,parseAsync:()=>Jp,partialRecord:()=>Yh,pipe:()=>Og,positive:()=>Md,prefault:()=>vg,preprocess:()=>$g,prettifyError:()=>Ti,promise:()=>Bg,property:()=>Yd,readonly:()=>Pg,record:()=>Y,refine:()=>Kg,regex:()=>Ud,regexes:()=>Xi,registry:()=>Du,safeDecode:()=>nm,safeDecodeAsync:()=>im,safeEncode:()=>tm,safeEncodeAsync:()=>rm,safeParse:()=>Yp,safeParseAsync:()=>Xp,set:()=>eg,setErrorMap:()=>t_,size:()=>zd,slugify:()=>nf,startsWith:()=>qd,strictObject:()=>Ih,string:()=>H,stringFormat:()=>th,stringbool:()=>Zg,success:()=>Sg,superRefine:()=>qg,symbol:()=>yh,templateLiteral:()=>Ig,toJSONSchema:()=>Ap,toLowerCase:()=>ef,toUpperCase:()=>tf,transform:()=>sg,treeifyError:()=>Ci,trim:()=>$d,tuple:()=>qh,uint32:()=>dh,uint64:()=>_h,ulid:()=>jm,undefined:()=>xh,union:()=>zh,unknown:()=>Eh,uppercase:()=>Gd,url:()=>bm,util:()=>fr,uuid:()=>hm,uuidv4:()=>gm,uuidv6:()=>_m,uuidv7:()=>vm,void:()=>Ah,xid:()=>Nm,xor:()=>Vh});dr(Hc()),rr(g_);var __=J({created_at:H(),updated_at:H()}),v_=J({id:H(),version:H().optional()}),y_=J({name:H(),version:H()}),b_=J({name:H(),value:H().optional()}),x_=J({name:H().max(255),code:H().max(1e5),supported_triggers:q(v_).optional(),runtime:H().max(50).optional(),dependencies:q(y_).optional(),secrets:q(b_).optional(),is_system:G().optional(),inherit:G().optional()});x_.partial().extend({status:X([`draft`,`built`]).optional(),deployed_at:H().optional()}),x_.extend({id:H(),tenant_id:H(),status:X([`draft`,`built`]).default(`built`),deployed_at:H().optional(),secrets:q(J({name:H(),value:H().optional()})).optional()}).extend(__.shape);var S_=H(),C_=X([`unspecified`,`pending`,`final`,`partial`,`canceled`,`suspended`]),w_=J({id:H(),msg:H(),url:H().optional()}),T_=J({action_name:H(),error:w_.nullable(),started_at:H(),ended_at:H()}),E_=J({level:X([`log`,`info`,`warn`,`error`,`debug`]),message:H()}),D_=q(J({action_name:H(),lines:q(E_)}));J({id:H(),tenant_id:H(),trigger_id:S_,status:C_,results:q(T_),logs:D_.optional(),created_at:H(),updated_at:H()}).omit({tenant_id:!0,created_at:!0,updated_at:!0}),J({action_id:H(),code:H().max(1e5),runtime:H().max(50).optional(),dependencies:q(y_).optional(),secrets:q(b_).optional(),supported_triggers:q(v_).optional(),deployed:G().default(!0)}).extend({id:H(),tenant_id:H(),number:W().int()}).extend(__.shape);var O_=X([`user_action`,`admin_action`,`system`,`api`]),k_=J({type:X([`user`,`admin`,`system`,`api_key`,`client_credentials`]),id:H().optional(),email:H().optional(),org_id:H().optional(),org_name:H().optional(),scopes:q(H()).optional(),client_id:H().optional()}),A_=J({type:H(),id:H(),before:Y(H(),Eh()).optional(),after:Y(H(),Eh()).optional(),diff:Y(H(),J({old:Eh(),new:Eh()})).optional()}),j_=J({method:H(),path:H(),query:Y(H(),H()).optional(),body:Eh().optional(),ip:H(),user_agent:H().optional(),correlation_id:H().optional()}),M_=J({status_code:W(),body:Eh().optional()}),N_=J({country_code:H(),city_name:H(),latitude:H(),longitude:H(),time_zone:H(),continent_code:H()}),P_=J({name:H(),version:H(),env:Y(H(),H()).optional()});J({tenant_id:H(),event_type:H(),log_type:H(),description:H().optional(),category:O_,actor:k_,target:A_,request:j_,response:M_.optional(),connection:H().optional(),strategy:H().optional(),strategy_type:H().optional(),audience:H().optional(),scope:H().optional(),location:N_.optional(),auth0_client:P_.optional(),hostname:H(),is_mobile:G().optional(),timestamp:H()}).extend({id:H()}),X([`AUTH0`,`EMAIL`,`REDIRECT`]),X([`CREATE_USER`,`GET_USER`,`UPDATE_USER`,`SEND_REQUEST`,`SEND_EMAIL`]),X([`VERIFY_EMAIL`]);var F_=J({require_mx_record:G().optional(),block_aliases:G().optional(),block_free_emails:G().optional(),block_disposable_emails:G().optional(),blocklist:q(H()).optional(),allowlist:q(H()).optional()}),I_=J({id:H(),alias:H().max(100).optional(),type:Z(`AUTH0`),action:Z(`UPDATE_USER`),allow_failure:G().optional(),mask_output:G().optional(),params:J({connection_id:H().optional(),user_id:H(),changes:Y(H(),K())})}),L_=J({id:H(),alias:H().max(100).optional(),type:Z(`EMAIL`),action:Z(`VERIFY_EMAIL`),allow_failure:G().optional(),mask_output:G().optional(),params:J({email:H(),rules:F_.optional()})}),R_=X([`change-email`,`account`,`custom`]),z_=zh([I_,L_,J({id:H(),alias:H().max(100).optional(),type:Z(`REDIRECT`),action:Z(`REDIRECT_USER`),allow_failure:G().optional(),mask_output:G().optional(),params:J({target:R_.openapi({description:`The predefined target to redirect to, or 'custom' for a custom URL`}),custom_url:H().optional().openapi({description:`Custom URL to redirect to when target is 'custom'`})})})]);J({name:H().min(1).max(150).openapi({description:`The name of the flow`}),actions:q(z_).optional().default([]).openapi({description:`The list of actions to execute in sequence`})}).extend(__.shape).extend({id:H().openapi({description:`Unique identifier for the flow`,example:`af_12tMpdJ3iek7svMyZkSh5M`})}),J({page:H().min(0).optional().default(`0`).transform(e=>parseInt(e,10)).openapi({description:`The page number where 0 is the first page`}),per_page:H().min(1).optional().default(`10`).transform(e=>parseInt(e,10)).openapi({description:`The number of items per page`}),include_totals:H().optional().default(`false`).transform(e=>e===`true`).openapi({description:`If the total number of items should be included in the response`}),sort:H().regex(/^.+:(-1|1)$/).optional().openapi({description:`A property that should have the format 'string:-1' or 'string:1'`}),q:H().optional().openapi({description:`A lucene query string used to filter the results`})}),J({start:W(),limit:W(),length:W(),total:W().optional()});var B_=J({email:H().optional(),email_verified:G().optional(),name:H().optional(),username:H().optional(),given_name:H().optional(),phone_number:H().optional(),phone_verified:G().optional(),family_name:H().optional()}).catchall(K()),V_=J({connection:H(),user_id:H(),provider:H(),isSocial:G(),email:H().optional(),email_verified:G().optional(),phone_number:H().optional(),phone_verified:G().optional(),username:H().optional(),access_token:H().optional(),access_token_secret:H().optional(),refresh_token:H().optional(),profileData:B_.optional()}),H_=J({formatted:H().optional(),street_address:H().optional(),locality:H().optional(),region:H().optional(),postal_code:H().optional(),country:H().optional()}).optional(),U_=J({email:H().transform(e=>e.toLowerCase()).optional(),username:H().refine(e=>!e.includes(`@`),{message:`Usernames must not contain "@". Use the email field for email addresses.`}).optional(),phone_number:H().optional(),phone_verified:G().optional(),given_name:H().optional(),family_name:H().optional(),nickname:H().optional(),name:H().optional(),picture:H().optional(),locale:H().optional(),linked_to:H().optional(),profileData:H().optional(),user_id:H().optional(),app_metadata:K().default({}).optional(),user_metadata:K().default({}).optional(),middle_name:H().optional(),preferred_username:H().optional(),profile:H().optional(),website:H().optional(),gender:H().optional(),birthdate:H().optional(),zoneinfo:H().optional(),address:H_});U_.extend({email_verified:G().default(!1),verify_email:G().optional(),last_ip:H().optional(),last_login:H().optional(),user_id:H().optional(),provider:H().optional(),connection:H(),is_social:G().optional(),registration_completed_at:H().optional(),password:J({hash:H(),algorithm:H()}).optional()}).omit({password:!0}).extend(__.shape).extend({user_id:H(),provider:H(),is_social:G(),email:H().optional(),login_count:W().default(0),identities:q(V_).optional()}).omit({registration_completed_at:!0}),U_.extend({login_count:W(),multifactor:q(H()).optional(),last_ip:H().optional(),last_login:H().optional(),user_id:H()}).catchall(K());var W_=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,G_=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=W_[n[e]&63];return t},K_=J({client_id:H().optional().openapi({description:`ID of this client. Generated server-side if omitted (Auth0 behavior).`}),name:H().min(1).openapi({description:`Name of this client (min length: 1 character, does not allow < or >).`}),description:H().max(140).optional().openapi({description:`Free text description of this client (max length: 140 characters).`}),global:G().default(!1).openapi({description:`Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false).`}),client_secret:H().default(()=>G_()).optional().openapi({description:`Client secret (which you must not make public).`}),app_type:X([`native`,`spa`,`regular_web`,`non_interactive`,`resource_server`,`express_configuration`,`rms`,`box`,`cloudbees`,`concur`,`dropbox`,`mscrm`,`echosign`,`egnyte`,`newrelic`,`office365`,`salesforce`,`sentry`,`sharepoint`,`slack`,`springcm`,`zendesk`,`zoom`,`sso_integration`,`oag`]).default(`regular_web`).optional().openapi({description:`The type of application this client represents`}),logo_uri:H().url().optional().openapi({description:`URL of the logo to display for this client. Recommended size is 150x150 pixels.`}),is_first_party:G().default(!1).openapi({description:`Whether this client a first party client (true) or not (false).`}),oidc_conformant:G().default(!0).openapi({description:`Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false).`}),auth0_conformant:G().default(!0).openapi({description:`Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance).`}),callbacks:q(H()).default([]).optional().openapi({description:`Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication.`}),allowed_origins:q(H()).default([]).optional().openapi({description:`Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs.`}),web_origins:q(H()).default([]).optional().openapi({description:`Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.`}),client_aliases:q(H()).default([]).optional().openapi({description:`List of audiences/realms for SAML protocol. Used by the wsfed addon.`}),allowed_clients:q(H()).default([]).optional().openapi({description:`List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed.`}),connections:q(H()).default([]).optional().openapi({description:`List of connection IDs enabled for this client. The order determines the display order on the login page.`}),allowed_logout_urls:q(H()).default([]).optional().openapi({description:`Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.`}),session_transfer:Y(H(),K()).default({}).optional().openapi({description:`Native to Web SSO Configuration`}),oidc_logout:Y(H(),K()).default({}).optional().openapi({description:`Configuration for OIDC backchannel logout`}),grant_types:q(H()).default([]).optional().openapi({description:`List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code.`}),jwt_configuration:Y(H(),K()).default({}).optional().openapi({description:`Configuration related to JWTs for the client.`}),signing_keys:q(Y(H(),K())).default([]).optional().openapi({description:`Signing certificates associated with this client.`}),encryption_key:Y(H(),K()).default({}).optional().openapi({description:`Encryption used for WsFed responses with this client.`}),sso:G().default(!1).openapi({description:`Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false).`}),sso_disabled:G().default(!1).openapi({description:`Whether Single Sign On is disabled for this client. When true, existing SSO sessions will not be reused and users must authenticate every time.`}),cross_origin_authentication:G().default(!1).openapi({description:`Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false).`}),cross_origin_loc:H().url().optional().openapi({description:`URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.`}),custom_login_page_on:G().default(!1).openapi({description:`Whether a custom login page is to be used (true) or the default provided login page (false).`}),custom_login_page:H().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page.`}),custom_login_page_preview:H().optional().openapi({description:`The content (HTML, CSS, JS) of the custom login page. (Used on Previews)`}),form_template:H().optional().openapi({description:`HTML form template to be used for WS-Federation.`}),addons:Y(H(),K()).default({}).optional().openapi({description:`Addons enabled for this client and their associated configurations.`}),token_endpoint_auth_method:X([`none`,`client_secret_post`,`client_secret_basic`,`client_secret_jwt`,`private_key_jwt`]).default(`client_secret_basic`).optional().openapi({description:"Defines the requested authentication method for the token endpoint. `none` (public client), `client_secret_post` / `client_secret_basic` (HTTP POST / Basic), `client_secret_jwt` (RFC 7523 HMAC assertion using client_secret), or `private_key_jwt` (RFC 7523 asymmetric assertion verified against the client's `jwks` / `jwks_uri`)."}),client_metadata:Y(H(),H().max(255)).default({}).optional().openapi({description:`Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?"/()<>@ [Tab][Space]`}),hide_sign_up_disabled_error:G().default(!1).optional().openapi({description:"Enumeration-safe variant of the connection-level `disable_signup` flag. When a signup is blocked by the password connection and this is true, the identifier screen does not reveal that an email is unknown — it advances to the OTP/password challenge as if the account existed and fails at credential check. Mitigates email enumeration at the cost of UX: users without an account see a generic credential failure instead of an explicit signup-disabled message."}),mobile:Y(H(),K()).default({}).optional().openapi({description:`Additional configuration for native mobile apps.`}),initiate_login_uri:H().url().optional().openapi({description:`Initiate login uri, must be https`}),native_social_login:Y(H(),K()).default({}).optional(),refresh_token:J({rotation_type:X([`rotating`,`non-rotating`]).optional().openapi({description:`Whether refresh tokens for this client are rotated on every exchange (Auth0 'rotating' behavior) or kept stable (legacy non-rotating). Defaults to 'non-rotating' when unset.`}),leeway:W().int().min(0).max(600).optional().openapi({description:`Seconds after a parent token's first rotation during which presenting it again still mints a fresh sibling child instead of triggering reuse-detection. Defaults to 30s when unset.`}),expiration_type:X([`expiring`,`non-expiring`]).optional().openapi({description:`Auth0-compatible: whether refresh tokens expire.`}),token_lifetime:W().int().min(0).optional().openapi({description:`Auth0-compatible: refresh-token absolute lifetime in seconds.`}),infinite_token_lifetime:G().optional().openapi({description:`Auth0-compatible: when true, refresh tokens have no absolute expiry.`}),idle_token_lifetime:W().int().min(0).optional().openapi({description:`Auth0-compatible: refresh-token idle (sliding) lifetime in seconds.`}),infinite_idle_token_lifetime:G().optional().openapi({description:`Auth0-compatible: when true, refresh tokens have no idle expiry.`})}).default({}).optional().openapi({description:`Refresh token configuration`}),default_organization:Y(H(),K()).default({}).optional().openapi({description:`Defines the default Organization ID and flows`}),organization_usage:X([`deny`,`allow`,`require`]).default(`deny`).optional().openapi({description:`Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require.`}),organization_require_behavior:X([`no_prompt`,`pre_login_prompt`,`post_login_prompt`]).default(`no_prompt`).optional().openapi({description:`Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true.`}),client_authentication_methods:Y(H(),K()).default({}).optional().openapi({description:`Defines client authentication methods.`}),require_pushed_authorization_requests:G().default(!1).openapi({description:`Makes the use of Pushed Authorization Requests mandatory for this client`}),require_proof_of_possession:G().default(!1).openapi({description:`Makes the use of Proof-of-Possession mandatory for this client`}),signed_request_object:Y(H(),K()).default({}).optional().openapi({description:`JWT-secured Authorization Requests (JAR) settings.`}),compliance_level:X([`none`,`fapi1_adv_pkj_par`,`fapi1_adv_mtls_par`,`fapi2_sp_pkj_mtls`,`fapi2_sp_mtls_mtls`]).optional().openapi({description:`Defines the compliance level for this client, which may restrict it's capabilities`}),par_request_expiry:W().optional().openapi({description:`Specifies how long, in seconds, a Pushed Authorization Request URI remains valid`}),token_quota:Y(H(),K()).default({}).optional(),owner_user_id:H().optional().openapi({description:`User ID of the consenting user when this client was created via IAT-gated Dynamic Client Registration. NULL for clients created via the Management API or open DCR.`}),registration_type:X([`manual`,`open_dcr`,`iat_dcr`]).optional().openapi({description:"Provenance of this client. `manual` = Management API; `open_dcr` = RFC 7591 without IAT; `iat_dcr` = RFC 7591 with an Initial Access Token."}),registration_metadata:Y(H(),K()).default({}).optional().openapi({description:"Arbitrary metadata captured at Dynamic Client Registration time that isn't a first-class client field (e.g. integration_type, domain). Also stores `iat_constraints` for clients created via IAT so RFC 7592 PUT can enforce field immutability."}),user_linking_mode:X([`builtin`,`off`]).optional().openapi({description:"Per-client override for the built-in email-based user-linking path. `builtin` runs the legacy in-process linking at user creation/email update. `off` disables the legacy path; linking only happens if the tenant has enabled the `account-linking` template hook. When unset, the service-level `userLinkingMode` default applies."})});J({created_at:H(),updated_at:H()}).extend(K_.shape).extend({client_id:H()});var q_=J({client_id:H().min(1).openapi({description:`ID of the client.`}),audience:H().min(1).openapi({description:`The audience (API identifier) of this client grant.`}),scope:q(H()).optional().openapi({description:`Scopes allowed for this client grant.`}),organization_usage:X([`deny`,`allow`,`require`]).optional().openapi({description:`Defines whether organizations can be used with client credentials exchanges for this grant.`}),allow_any_organization:G().optional().openapi({description:`If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.`}),is_system:G().optional().openapi({description:`If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.`}),subject_type:X([`client`,`user`]).optional().openapi({description:`The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`}),authorization_details_types:q(H()).optional().openapi({description:`Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement.`})});J({id:H().openapi({description:`ID of the client grant.`})}).extend(q_.shape).extend({created_at:H().optional(),updated_at:H().optional()});var J_=X([`iat`,`rat`]),Y_=J({id:H(),token_hash:H(),type:J_,client_id:H().optional(),sub:H().optional(),constraints:Y(H(),Eh()).optional(),single_use:G().default(!1),expires_at:H().optional()});J({created_at:H(),used_at:H().optional(),revoked_at:H().optional()}).extend(Y_.shape);var X_=J({x:W(),y:W()}),Z_=function(e){return e.RICH_TEXT=`RICH_TEXT`,e.NEXT_BUTTON=`NEXT_BUTTON`,e.BACK_BUTTON=`BACK_BUTTON`,e.SUBMIT_BUTTON=`SUBMIT_BUTTON`,e.DIVIDER=`DIVIDER`,e.TEXT=`TEXT`,e.EMAIL=`EMAIL`,e.PASSWORD=`PASSWORD`,e.NUMBER=`NUMBER`,e.PHONE=`PHONE`,e.DATE=`DATE`,e.CHECKBOX=`CHECKBOX`,e.RADIO=`RADIO`,e.SELECT=`SELECT`,e.HIDDEN=`HIDDEN`,e.LEGAL=`LEGAL`,e}({}),Q_=function(e){return e.BLOCK=`BLOCK`,e.FIELD=`FIELD`,e}({}),$_=J({id:H(),category:ng(Q_),type:ng(Z_)}),ev=zh([$_.extend({category:Z(`BLOCK`),type:Z(`RICH_TEXT`),config:J({content:H()}).passthrough()}),$_.extend({category:Z(`BLOCK`),type:zh([Z(`NEXT_BUTTON`),Z(`BACK_BUTTON`),Z(`SUBMIT_BUTTON`)]),config:J({text:H()}).passthrough()}),$_.extend({category:Z(`FIELD`),type:Z(`LEGAL`),required:G().optional(),sensitive:G().optional(),config:J({text:H()}).passthrough()}),$_.extend({category:Z(`FIELD`),type:zh([Z(`TEXT`),Z(`EMAIL`),Z(`PASSWORD`),Z(`NUMBER`),Z(`PHONE`),Z(`DATE`),Z(`CHECKBOX`),Z(`RADIO`),Z(`SELECT`),Z(`HIDDEN`)]),required:G().optional(),sensitive:G().optional(),config:J({label:H().optional(),placeholder:H().optional()}).passthrough()}),J({id:H(),category:H(),type:H()}).passthrough()]),tv=zh([J({id:H(),type:Z(`STEP`),coordinates:X_,alias:H().optional(),config:J({components:q(ev),next_node:H()}).passthrough()}),J({id:H(),type:Z(`FLOW`),coordinates:X_,alias:H().optional(),config:J({flow_id:H(),next_node:H()})}),J({id:H(),type:Z(`ACTION`),coordinates:X_,alias:H().optional(),config:J({action_type:X([`REDIRECT`]).openapi({description:`The type of action to perform`}),target:X([`change-email`,`account`,`custom`]).openapi({description:`The predefined target to redirect to`}),custom_url:H().optional().openapi({description:`Custom URL when target is 'custom'`}),next_node:H().openapi({description:`The next node to navigate to after action (for non-redirect actions)`})}).passthrough()}),J({id:H(),type:H(),coordinates:X_}).passthrough()]),nv=J({next_node:H(),coordinates:X_}).passthrough(),rv=J({resume_flow:G().optional(),coordinates:X_}).passthrough();J({id:H(),name:H(),languages:J({primary:H()}).passthrough(),nodes:q(tv),start:nv,ending:rv,created_at:H(),updated_at:H(),links:J({sdkSrc:H().optional(),sdk_src:H().optional()}).passthrough()}).passthrough().omit({id:!0,created_at:!0,updated_at:!0});var iv=function(e){return e.TOKEN=`token`,e.ID_TOKEN=`id_token`,e.TOKEN_ID_TOKEN=`id_token token`,e.CODE=`code`,e.CODE_ID_TOKEN=`code id_token`,e.CODE_TOKEN=`code token`,e.CODE_ID_TOKEN_TOKEN=`code id_token token`,e}({}),av=function(e){return e.QUERY=`query`,e.FRAGMENT=`fragment`,e.FORM_POST=`form_post`,e.WEB_MESSAGE=`web_message`,e.SAML_POST=`saml_post`,e}({}),ov=function(e){return e.S256=`S256`,e.Plain=`plain`,e}({}),sv=zh([Ch(),J({essential:G().optional(),value:Eh().optional(),values:q(Eh()).optional()})]).nullable(),cv=J({userinfo:Y(H(),sv).optional(),id_token:Y(H(),sv).optional()}),lv=J({client_id:H(),act_as:H().optional(),response_type:ng(iv).optional(),response_mode:ng(av).optional(),redirect_uri:H().optional(),audience:H().optional(),organization:H().optional(),state:H().optional(),nonce:H().optional(),scope:H().optional(),prompt:H().optional(),code_challenge_method:ng(ov).optional(),code_challenge:H().optional(),username:H().optional(),ui_locales:H().optional(),max_age:W().optional(),acr_values:H().optional(),claims:cv.optional(),vendor_id:H().optional()});J({colors:J({primary:H(),page_background:zh([H(),J({type:H().optional(),start:H().optional(),end:H().optional(),angle_deg:W().optional()})]).optional()}).optional(),logo_url:H().optional(),favicon_url:H().optional(),powered_by_logo_url:H().optional(),font:J({url:H()}).optional(),dark_mode:X([`dark`,`light`,`auto`]).optional()});var uv=X([`password_reset`,`email_verification`,`otp`,`mfa_otp`,`authorization_code`,`oauth2_state`,`ticket`]);J({code_id:H().openapi({description:`The code that will be used in for instance an email verification flow`}),login_id:H().openapi({description:`The id of the login session that the code is connected to`}),connection_id:H().optional().openapi({description:`The connection that the code is connected to`}),code_type:uv,code_verifier:H().optional().openapi({description:`The code verifier used in PKCE in outbound flows`}),code_challenge:H().optional().openapi({description:`The code challenge used in PKCE in outbound flows`}),code_challenge_method:X([`plain`,`S256`]).optional().openapi({description:`The code challenge method used in PKCE in outbound flows`}),redirect_uri:H().optional().openapi({description:`The redirect URI associated with the code`}),otp:H().optional().openapi({description:`The one-time password value for OTP-based flows`}),nonce:H().optional().openapi({description:`The nonce value used for security in OIDC flows`}),state:H().optional().openapi({description:`The state parameter used for CSRF protection in OAuth flows`}),expires_at:H(),used_at:H().optional(),user_id:H().optional()}).extend({created_at:H()});var dv=J({kid:H().optional(),team_id:H().optional(),realms:H().optional(),authentication_method:H().optional(),client_id:H().optional(),client_secret:H().optional(),app_secret:H().optional(),scope:H().optional(),authorization_endpoint:H().optional(),token_endpoint:H().optional(),userinfo_endpoint:H().optional(),jwks_uri:H().optional(),discovery_url:H().optional(),issuer:H().optional(),token_endpoint_auth_method:X([`client_secret_basic`,`client_secret_post`]).optional(),provider:H().optional(),from:H().optional(),twilio_sid:H().optional(),twilio_token:H().optional(),icon_url:H().optional(),domain_aliases:q(H()).optional(),callback_url:H().url().optional(),passwordPolicy:X([`none`,`low`,`fair`,`good`,`excellent`]).optional(),password_complexity_options:J({min_length:W().optional()}).optional(),password_history:J({enable:G().optional(),size:W().optional()}).optional(),password_no_personal_info:J({enable:G().optional()}).optional(),password_dictionary:J({enable:G().optional(),dictionary:q(H()).optional()}).optional(),disable_signup:G().optional(),brute_force_protection:G().optional(),import_mode:G().optional(),configuration:J({token_endpoint:H().optional(),userinfo_endpoint:H().optional(),client_id:H().optional(),client_secret:H().optional(),realm:H().optional()}).optional(),attributes:J({email:J({identifier:J({active:G().optional()}).optional(),signup:J({status:X([`required`,`optional`,`disabled`]).optional(),verification:J({active:G().optional()}).optional()}).optional(),validation:J({allowed:G().optional()}).optional(),unique:G().optional(),profile_required:G().optional(),verification_method:X([`link`,`code`]).optional()}).optional(),username:J({identifier:J({active:G().optional()}).optional(),signup:J({status:X([`required`,`optional`,`disabled`]).optional()}).optional(),validation:J({max_length:W().optional(),min_length:W().optional(),allowed_types:J({email:G().optional(),phone_number:G().optional()}).optional()}).optional(),profile_required:G().optional()}).optional(),phone_number:J({identifier:J({active:G().optional()}).optional(),signup:J({status:X([`required`,`optional`,`disabled`]).optional()}).optional()}).optional()}).optional(),authentication_methods:J({password:J({enabled:G().optional()}).optional(),passkey:J({enabled:G().optional()}).optional()}).optional(),passkey_options:J({challenge_ui:X([`both`,`autofill`,`button`]).optional(),local_enrollment_enabled:G().optional(),progressive_enrollment_enabled:G().optional()}).optional(),requires_username:G().optional(),validation:J({username:J({min:W().optional(),max:W().optional()}).optional()}).optional(),set_user_root_attributes:X([`on_each_login`,`on_first_login`,`never_on_login`]).optional()});function fv(e){if(e!==null){if(Array.isArray(e))return e.filter(e=>e!==null).map(fv);if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))r!==null&&(t[n]=fv(r));return t}return e}}var pv=J({id:H().optional(),name:H(),display_name:H().optional(),strategy:H(),options:$g(e=>e===null?{}:fv(e),dv).default({}),enabled_clients:q(H()).default([]).optional(),response_type:Gg().optional(),response_mode:Gg().optional(),is_domain_connection:G().optional(),show_as_button:G().optional(),metadata:Y(H(),K()).optional(),is_system:G().optional()});J({id:H(),created_at:H().transform(e=>e===null?``:e),updated_at:H().transform(e=>e===null?``:e)}).extend(pv.shape);var mv=J({domain:H(),custom_domain_id:H().optional(),type:X([`auth0_managed_certs`,`self_managed_certs`]),verification_method:X([`txt`]).optional(),tls_policy:X([`recommended`]).optional(),custom_client_ip_header:X([`true-client-ip`,`cf-connecting-ip`,`x-forwarded-for`,`x-azure-clientip`,`null`]).optional(),domain_metadata:Y(H(),H().max(255)).optional()}),hv=Uh(`name`,[J({name:Z(`txt`),record:H(),domain:H()}),J({name:Z(`http`),http_body:H(),http_url:H()})]);mv.extend({custom_domain_id:H(),primary:G(),status:X([`disabled`,`pending`,`pending_verification`,`ready`]),origin_domain_name:H().optional(),verification:J({methods:q(hv)}).optional(),tls_policy:H().optional()}).extend({tenant_id:H()}),J({certificate:H().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/,`must be PEM-encoded; include the full certificate chain in leaf-first order`),private_key:H().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/,`must be a PEM-encoded private key`)});var gv=J({id:H(),order:W().optional(),visible:G().optional().default(!0)}),_v=gv.extend({category:Z(`BLOCK`).optional()}),vv=_v.extend({type:Z(`DIVIDER`),config:J({text:H().optional()}).optional()}),yv=_v.extend({type:Z(`HTML`),config:J({content:H().optional()}).optional()}),bv=_v.extend({type:Z(`IMAGE`),config:J({src:H().optional(),alt:H().optional(),width:W().optional(),height:W().optional()}).optional()}),xv=_v.extend({type:Z(`JUMP_BUTTON`),config:J({text:H().optional(),target_step:H().optional()})}),Sv=_v.extend({type:Z(`RESEND_BUTTON`),config:J({text:H().optional(),resend_action:H().optional()})}),Cv=_v.extend({type:Z(`NEXT_BUTTON`),config:J({text:H().optional()})}),wv=_v.extend({type:Z(`PREVIOUS_BUTTON`),config:J({text:H().optional()})}),Tv=_v.extend({type:Z(`RICH_TEXT`),config:J({content:H().optional()}).optional()}),Ev=gv.extend({category:Z(`WIDGET`).optional(),label:H().min(1).optional(),hint:H().min(1).max(500).optional(),required:G().optional(),sensitive:G().optional()}),Dv=Ev.extend({type:Z(`AUTH0_VERIFIABLE_CREDENTIALS`),config:J({credential_type:H().optional()})}),Ov=Ev.extend({type:Z(`GMAPS_ADDRESS`),config:J({api_key:H().optional()})}),kv=Ev.extend({type:Z(`RECAPTCHA`),config:J({site_key:H().optional()})}),Av=gv.extend({category:Z(`FIELD`).optional(),label:H().min(1).optional(),hint:H().min(1).max(500).optional(),messages:q(J({id:W().optional(),text:H(),type:X([`info`,`error`,`success`,`warning`])})).optional(),required:G().optional(),sensitive:G().optional()}),jv=Av.extend({type:Z(`BOOLEAN`),config:J({default_value:G().optional()}).optional()}),Mv=Av.extend({type:Z(`CARDS`),config:J({options:q(J({value:H(),label:H(),description:H().optional(),image:H().optional()})).optional(),multi_select:G().optional()}).optional()}),Nv=Av.extend({type:Z(`CHOICE`),config:J({options:q(J({value:H(),label:H()})).optional(),display:X([`radio`,`checkbox`]).optional(),multiple:G().optional(),default_value:zh([H(),q(H())]).optional()}).optional()}),Pv=Av.extend({type:Z(`CUSTOM`),config:J({component:H().optional(),props:Y(H(),K()).optional(),schema:Y(H(),K()).optional(),code:H().optional()})}),Fv=Av.extend({type:Z(`DATE`),config:J({format:H().optional(),min:H().optional(),max:H().optional(),default_value:H().optional()}).optional()}),Iv=Av.extend({type:Z(`DROPDOWN`),config:J({options:q(J({value:H(),label:H()})).optional(),placeholder:H().optional(),searchable:G().optional(),multiple:G().optional(),default_value:zh([H(),q(H())]).optional()}).optional()}),Lv=Av.extend({type:Z(`EMAIL`),config:J({placeholder:H().optional(),default_value:H().optional()}).optional()}),Rv=Av.extend({type:Z(`FILE`),config:J({accept:H().optional(),max_size:W().optional(),multiple:G().optional()}).optional()}),zv=Av.extend({type:Z(`LEGAL`),config:J({text:H(),html:G().optional()}).optional()}),Bv=Av.extend({type:Z(`NUMBER`),config:J({placeholder:H().optional(),min:W().optional(),max:W().optional(),step:W().optional(),default_value:H().optional()}).optional()}),Vv=Av.extend({type:Z(`PASSWORD`),config:J({placeholder:H().optional(),min_length:W().optional(),show_toggle:G().optional(),forgot_password_link:H().optional(),default_value:H().optional()}).optional()}),Hv=Av.extend({type:Z(`PAYMENT`),config:J({provider:H().optional(),currency:H().optional()}).optional()}),Uv=Av.extend({type:Z(`SOCIAL`),config:J({providers:q(H()).optional(),provider_details:q(J({name:H(),strategy:H().optional(),display_name:H().optional(),icon_url:H().optional(),href:H().optional()})).optional()}).optional()}),Wv=Av.extend({type:Z(`TEL`),config:J({placeholder:H().optional(),default_country:H().optional(),default_value:H().optional(),allow_email:G().optional()}).optional()}),Gv=Av.extend({type:Z(`TEXT`),config:J({placeholder:H().optional(),multiline:G().optional(),max_length:W().optional(),default_value:H().optional()}).optional()}),Kv=Av.extend({type:Z(`COUNTRY`),config:J({placeholder:H().optional(),default_value:H().optional()}).optional()}),qv=Av.extend({type:Z(`URL`),config:J({placeholder:H().optional(),default_value:H().optional()}).optional()}),Jv=zh([Uh(`type`,[vv,yv,bv,xv,Sv,Cv,wv,Tv]),Uh(`type`,[Dv,Ov,kv]),Uh(`type`,[jv,Mv,Nv,Kv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,qv])]);new Set([`BOOLEAN`,`CARDS`,`CHOICE`,`COUNTRY`,`DATE`,`DROPDOWN`,`EMAIL`,`LEGAL`,`NUMBER`,`PASSWORD`,`TEL`,`TEXT`,`URL`]),J({id:H(),type:Z(`submit`),label:H(),className:H().optional(),disabled:G().optional().default(!1),order:W().optional(),visible:G().optional().default(!0),customizations:Y(H(),K()).optional()});var Yv=J({x:W(),y:W()}),Xv=Uh(`type`,[J({id:H(),type:Z(`FLOW`),coordinates:Yv,alias:H().min(1).max(150).optional(),config:J({flow_id:H().max(30),next_node:H().optional()})}),J({id:H(),type:Z(`ROUTER`),coordinates:Yv,alias:H().min(1).max(150),config:J({rules:q(J({id:H(),alias:H().min(1).max(150).optional(),condition:K(),next_node:H()})),fallback:H()})}),J({id:H(),type:Z(`STEP`),coordinates:Yv,alias:H().min(1).max(150).optional(),config:J({components:q(Jv),next_node:H().optional()})})]),Zv=J({name:H().openapi({description:`The name of the form`}),messages:J({errors:Y(H(),K()).optional(),custom:Y(H(),K()).optional()}).optional(),languages:J({primary:H().optional(),default:H().optional()}).optional(),translations:Y(H(),K()).optional(),nodes:q(Xv).optional(),start:J({hidden_fields:q(J({key:H(),value:H()})).optional(),next_node:H().optional(),coordinates:Yv.optional()}).optional(),ending:J({redirection:J({delay:W().optional(),target:H().optional()}).optional(),after_submit:J({flow_id:H().optional()}).optional(),coordinates:Yv.optional(),resume_flow:G().optional()}).optional(),style:J({css:H().optional()}).optional(),links:J({sdkSrc:H().optional(),sdk_src:H().optional()}).optional()}).openapi({description:`Schema for flow-based forms (matches Auth0 Forms structure)`});__.extend(Zv.shape).extend({id:H()});var Qv=J({id:W().optional(),text:H(),type:X([`info`,`error`,`success`,`warning`])}),$v=J({id:H().optional(),text:H(),href:H(),linkText:H().optional()});J({name:H().optional(),action:H(),method:X([`POST`,`GET`]),title:H().optional(),description:H().optional(),components:q(Jv),messages:q(Qv).optional(),links:q($v).optional(),footer:H().optional()});var ey=X([`pre-user-registration`,`post-user-registration`,`post-user-login`,`post-user-update`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),ty=X([`pre-user-registration`,`post-user-registration`,`post-user-login`,`validate-registration-username`,`pre-user-deletion`,`post-user-deletion`]),ny=X([`post-user-login`,`post-user-registration`,`post-user-update`,`credentials-exchange`]),ry=X([`post-user-login`,`credentials-exchange`,`pre-user-registration`,`post-user-registration`]),iy=X([`ensure-username`,`set-preferred-username`,`account-linking`]),ay={enabled:G().default(!1),synchronous:G().default(!1),priority:W().optional(),hook_id:H().optional(),metadata:Y(H(),Eh()).optional()};zh([J({...ay,trigger_id:ey,url:H()}),J({...ay,trigger_id:ty,form_id:H()}),J({...ay,trigger_id:ny,template_id:iy}),J({...ay,trigger_id:ry,code_id:H()})]),zh([J({...ay,trigger_id:ey}).extend(__.shape).extend({hook_id:H(),url:H()}),J({...ay,trigger_id:ty}).extend(__.shape).extend({hook_id:H(),form_id:H()}),J({...ay,trigger_id:ny}).extend(__.shape).extend({hook_id:H(),template_id:iy}),J({...ay,trigger_id:ry}).extend(__.shape).extend({hook_id:H(),code_id:H()})]),J({code:H().max(1e5),secrets:Y(H(),H()).optional()}).extend({id:H(),tenant_id:H()}).extend(__.shape);var oy=J({name:H().optional()}),sy=J({email:H().optional()}),cy=J({id:H().optional(),organization_id:H().max(50),inviter:oy,invitee:sy,invitation_url:H().url(),client_id:H(),connection_id:H().optional(),app_metadata:Y(H(),K()).default({}).optional(),user_metadata:Y(H(),K()).default({}).optional(),ttl_sec:W().int().max(2592e3).default(604800).optional(),roles:q(H()).default([]).optional(),send_invitation_email:G().default(!0).optional()});J({id:H(),organization_id:H().max(50),created_at:H().datetime(),expires_at:H().datetime(),ticket_id:H().optional()}).extend(cy.omit({id:!0}).shape),J({keys:q(J({alg:X([`RS256`,`RS384`,`RS512`,`ES256`,`ES384`,`ES512`,`HS256`,`HS384`,`HS512`]),kid:H(),kty:X([`RSA`,`EC`,`oct`]),use:X([`sig`,`enc`]).optional(),n:H().optional(),e:H().optional(),crv:H().optional(),x:H().optional(),y:H().optional(),x5t:H().optional(),x5c:q(H()).optional()}).superRefine((e,t)=>{if(e.kty===`RSA`)for(let n of[`n`,`e`])e[n]||t.addIssue({code:e_.custom,path:[n],message:`RSA JWK is missing required member '${n}'`});else if(e.kty===`EC`)for(let n of[`crv`,`x`,`y`])e[n]||t.addIssue({code:e_.custom,path:[n],message:`EC JWK is missing required member '${n}'`})}))}),J({issuer:H(),authorization_endpoint:H(),token_endpoint:H(),userinfo_endpoint:H(),jwks_uri:H(),registration_endpoint:H().optional(),revocation_endpoint:H(),end_session_endpoint:H().optional(),scopes_supported:q(H()),response_types_supported:q(H()),grant_types_supported:q(H()).optional(),code_challenge_methods_supported:q(H()),response_modes_supported:q(H()),subject_types_supported:q(H()),id_token_signing_alg_values_supported:q(H()),token_endpoint_auth_methods_supported:q(H()),claims_supported:q(H()),request_uri_parameter_supported:G(),request_parameter_supported:G(),claims_parameter_supported:G().optional(),request_object_signing_alg_values_supported:q(H()).optional(),token_endpoint_auth_signing_alg_values_supported:q(H()),client_id_metadata_document_supported:G().optional()});var ly=ng(function(e){return e.PENDING=`pending`,e.AUTHENTICATED=`authenticated`,e.AWAITING_EMAIL_VERIFICATION=`awaiting_email_verification`,e.AWAITING_MFA=`awaiting_mfa`,e.AWAITING_HOOK=`awaiting_hook`,e.AWAITING_CONTINUATION=`awaiting_continuation`,e.COMPLETED=`completed`,e.FAILED=`failed`,e.EXPIRED=`expired`,e}({})),uy=J({strategy:H(),strategy_type:H()});J({csrf_token:H(),auth0Client:H().optional(),authParams:lv,expires_at:H(),deleted_at:H().optional(),ip:H().optional(),useragent:H().optional(),session_id:H().optional(),authorization_url:H().optional(),state:ly.optional().default(`pending`),state_data:H().optional(),failure_reason:H().optional(),user_id:H().optional(),auth_connection:H().optional(),auth_strategy:uy.optional(),authenticated_at:H().optional()}).openapi({description:`This represents a login sesion`}).extend({id:H().openapi({description:`This is is used as the state in the universal login`}),created_at:H(),updated_at:H()});var $={ACLS_SUMMARY:`acls_summary`,ACTIONS_EXECUTION_FAILED:`actions_execution_failed`,API_LIMIT:`api_limit`,API_LIMIT_WARNING:`api_limit_warning`,APPI:`appi`,CIBA_EXCHANGE_FAILED:`ciba_exchange_failed`,CIBA_EXCHANGE_SUCCEEDED:`ciba_exchange_succeeded`,CIBA_START_FAILED:`ciba_start_failed`,CIBA_START_SUCCEEDED:`ciba_start_succeeded`,CODE_LINK_SENT:`cls`,CODE_SENT:`cs`,DEPRECATION_NOTICE:`depnote`,FAILED_LOGIN:`f`,FAILED_BY_CONNECTOR:`fc`,FAILED_CHANGE_EMAIL:`fce`,FAILED_BY_CORS:`fco`,FAILED_CROSS_ORIGIN_AUTHENTICATION:`fcoa`,FAILED_CHANGE_PASSWORD:`fcp`,FAILED_POST_CHANGE_PASSWORD_HOOK:`fcph`,FAILED_CHANGE_PHONE_NUMBER:`fcpn`,FAILED_CHANGE_PASSWORD_REQUEST:`fcpr`,FAILED_CONNECTOR_PROVISIONING:`fcpro`,FAILED_CHANGE_USERNAME:`fcu`,FAILED_DELEGATION:`fd`,FAILED_DEVICE_ACTIVATION:`fdeac`,FAILED_DEVICE_AUTHORIZATION_REQUEST:`fdeaz`,USER_CANCELED_DEVICE_CONFIRMATION:`fdecc`,FAILED_USER_DELETION:`fdu`,FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`feacft`,FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`feccft`,FAILED_EXCHANGE_CUSTOM_TOKEN:`fecte`,FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`fede`,FAILED_FEDERATED_LOGOUT:`federated_logout_failed`,FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN:`fens`,FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`feoobft`,FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`feotpft`,FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`fepft`,FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`fepotpft`,FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`fercft`,FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN:`ferrt`,FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`fertft`,FAILED_HOOK:`fh`,FAILED_IMPERSONATION:`fimp`,FAILED_INVITE_ACCEPT:`fi`,FAILED_LOGOUT:`flo`,FLOWS_EXECUTION_COMPLETED:`flows_execution_completed`,FLOWS_EXECUTION_FAILED:`flows_execution_failed`,FAILED_SENDING_NOTIFICATION:`fn`,FORMS_SUBMISSION_FAILED:`forms_submission_failed`,FORMS_SUBMISSION_SUCCEEDED:`forms_submission_succeeded`,FAILED_LOGIN_INCORRECT_PASSWORD:`fp`,FAILED_PUSHED_AUTHORIZATION_REQUEST:`fpar`,FAILED_POST_USER_REGISTRATION_HOOK:`fpurh`,FAILED_SIGNUP:`fs`,FAILED_SILENT_AUTH:`fsa`,FAILED_LOGIN_INVALID_EMAIL_USERNAME:`fu`,FAILED_USERS_IMPORT:`fui`,FAILED_VERIFICATION_EMAIL:`fv`,FAILED_VERIFICATION_EMAIL_REQUEST:`fvr`,EMAIL_VERIFICATION_CONFIRMED:`gd_auth_email_verification`,EMAIL_VERIFICATION_FAILED:`gd_auth_fail_email_verification`,MFA_AUTH_FAILED:`gd_auth_failed`,MFA_AUTH_REJECTED:`gd_auth_rejected`,MFA_AUTH_SUCCESS:`gd_auth_succeed`,MFA_ENROLLMENT_COMPLETE:`gd_enrollment_complete`,TOO_MANY_MFA_FAILURES:`gd_otp_rate_limit_exceed`,MFA_RECOVERY_FAILED:`gd_recovery_failed`,MFA_RECOVERY_RATE_LIMIT_EXCEED:`gd_recovery_rate_limit_exceed`,MFA_RECOVERY_SUCCESS:`gd_recovery_succeed`,MFA_EMAIL_SENT:`gd_send_email`,EMAIL_VERIFICATION_SENT:`gd_send_email_verification`,EMAIL_VERIFICATION_SEND_FAILURE:`gd_send_email_verification_failure`,PUSH_NOTIFICATION_SENT:`gd_send_pn`,ERROR_SENDING_MFA_PUSH_NOTIFICATION:`gd_send_pn_failure`,MFA_SMS_SENT:`gd_send_sms`,ERROR_SENDING_MFA_SMS:`gd_send_sms_failure`,MFA_VOICE_CALL_SUCCESS:`gd_send_voice`,MFA_VOICE_CALL_FAILED:`gd_send_voice_failure`,SECOND_FACTOR_STARTED:`gd_start_auth`,MFA_ENROLL_STARTED:`gd_start_enroll`,MFA_ENROLLMENT_FAILED:`gd_start_enroll_failed`,GUARDIAN_TENANT_UPDATE:`gd_tenant_update`,UNENROLL_DEVICE_ACCOUNT:`gd_unenroll`,UPDATE_DEVICE_ACCOUNT:`gd_update_device_account`,WEBAUTHN_CHALLENGE_FAILED:`gd_webauthn_challenge_failed`,WEBAUTHN_ENROLLMENT_FAILED:`gd_webauthn_enrollment_failed`,FAILED_KMS_API_OPERATION:`kms_key_management_failure`,SUCCESS_KMS_API_OPERATION:`kms_key_management_success`,KMS_KEY_STATE_CHANGED:`kms_key_state_changed`,TOO_MANY_CALLS_TO_DELEGATION:`limit_delegation`,BLOCKED_IP_ADDRESS:`limit_mu`,BLOCKED_ACCOUNT_IP:`limit_sul`,BLOCKED_ACCOUNT_EMAIL:`limit_wc`,INFORMATION:`i`,MFA_REQUIRED:`mfar`,MANAGEMENT_API_READ_OPERATION:`mgmt_api_read`,FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_failed`,SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:`my_account_authentication_method_succeeded`,FAILED_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_failed`,SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT:`oidc_backchannel_logout_succeeded`,ORGANIZATION_MEMBER_ADDED:`organization_member_added`,PASSKEY_CHALLENGE_FAILED:`passkey_challenge_failed`,PASSKEY_CHALLENGE_STARTED:`passkey_challenge_started`,PRE_LOGIN_ASSESSMENT:`pla`,BREACHED_PASSWORD:`pwd_leak`,BREACHED_PASSWORD_ON_RESET:`reset_pwd_leak`,SUCCESS_RESOURCE_CLEANUP:`resource_cleanup`,RICH_CONSENTS_ACCESS_ERROR:`rich_consents_access_error`,SUCCESS_LOGIN:`s`,SUCCESS_API_OPERATION:`sapi`,FAILED_API_OPERATION:`fapi`,SUCCESS_CHANGE_EMAIL:`sce`,SUCCESS_CROSS_ORIGIN_AUTHENTICATION:`scoa`,SUCCESS_CHANGE_PASSWORD:`scp`,SUCCESS_CHANGE_PHONE_NUMBER:`scpn`,SUCCESS_CHANGE_PASSWORD_REQUEST:`scpr`,SUCCESS_CHANGE_USERNAME:`scu`,SUCCESS_CREDENTIAL_VALIDATION:`scv`,SUCCESS_DELEGATION:`sd`,SUCCESS_USER_DELETION:`sdu`,SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:`seacft`,SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:`seccft`,SUCCESS_EXCHANGE_CUSTOM_TOKEN:`secte`,SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:`sede`,SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN:`sens`,SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:`seoobft`,SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:`seotpft`,SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:`sepotpft`,SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:`sepft`,SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN:`sepkoobft`,SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN:`sepkotpft`,SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sepkrcft`,SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:`sercft`,SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:`sertft`,SUCCESS_IMPERSONATION:`simp`,SUCCESSFULLY_ACCEPTED_USER_INVITE:`si`,BREACHED_PASSWORD_ON_SIGNUP:`signup_pwd_leak`,SUCCESS_LOGOUT:`slo`,SUCCESS_HOOK:`sh`,SUCCESS_PASSWORD_MIGRATION:`spm`,SUCCESS_REVOCATION:`srrt`,SUCCESS_SIGNUP:`ss`,FAILED_SS_SSO_OPERATION:`ss_sso_failure`,INFORMATION_FROM_SS_SSO_OPERATION:`ss_sso_info`,SUCCESS_SS_SSO_OPERATION:`ss_sso_success`,SUCCESS_SILENT_AUTH:`ssa`,SUCCESSFUL_SCIM_OPERATION:`sscim`,SUCCESSFULLY_IMPORTED_USERS:`sui`,SUCCESS_VERIFICATION_EMAIL:`sv`,SUCCESS_VERIFICATION_EMAIL_REQUEST:`svr`,MAX_AMOUNT_OF_AUTHENTICATORS:`too_many_records`,USER_LOGIN_BLOCK_RELEASED:`ublkdu`,FAILED_UNIVERSAL_LOGOUT:`universal_logout_failed`,SUCCESSFUL_UNIVERSAL_LOGOUT:`universal_logout_succeeded`,WARNING_DURING_LOGIN:`w`,WARNING_SENDING_NOTIFICATION:`wn`,WARNING_USER_MANAGEMENT:`wum`},dy=H().refine(e=>Object.values($).includes(e),{message:`Invalid log type`});$.ACLS_SUMMARY,$.ACTIONS_EXECUTION_FAILED,$.API_LIMIT,$.API_LIMIT_WARNING,$.APPI,$.CIBA_EXCHANGE_FAILED,$.CIBA_EXCHANGE_SUCCEEDED,$.CIBA_START_FAILED,$.CIBA_START_SUCCEEDED,$.CODE_LINK_SENT,$.CODE_SENT,$.DEPRECATION_NOTICE,$.FAILED_LOGIN,$.FAILED_BY_CONNECTOR,$.FAILED_CHANGE_EMAIL,$.FAILED_BY_CORS,$.FAILED_CROSS_ORIGIN_AUTHENTICATION,$.FAILED_CHANGE_PASSWORD,$.FAILED_POST_CHANGE_PASSWORD_HOOK,$.FAILED_CHANGE_PHONE_NUMBER,$.FAILED_CHANGE_PASSWORD_REQUEST,$.FAILED_CONNECTOR_PROVISIONING,$.FAILED_CHANGE_USERNAME,$.FAILED_DELEGATION,$.FAILED_DEVICE_ACTIVATION,$.FAILED_DEVICE_AUTHORIZATION_REQUEST,$.USER_CANCELED_DEVICE_CONFIRMATION,$.FAILED_USER_DELETION,$.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,$.FAILED_EXCHANGE_CUSTOM_TOKEN,$.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,$.FAILED_FEDERATED_LOGOUT,$.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN,$.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,$.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN,$.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,$.FAILED_HOOK,$.FAILED_IMPERSONATION,$.FAILED_INVITE_ACCEPT,$.FAILED_LOGOUT,$.FLOWS_EXECUTION_COMPLETED,$.FLOWS_EXECUTION_FAILED,$.FAILED_SENDING_NOTIFICATION,$.FORMS_SUBMISSION_FAILED,$.FORMS_SUBMISSION_SUCCEEDED,$.FAILED_LOGIN_INCORRECT_PASSWORD,$.FAILED_PUSHED_AUTHORIZATION_REQUEST,$.FAILED_POST_USER_REGISTRATION_HOOK,$.FAILED_SIGNUP,$.FAILED_SILENT_AUTH,$.FAILED_LOGIN_INVALID_EMAIL_USERNAME,$.FAILED_USERS_IMPORT,$.FAILED_VERIFICATION_EMAIL,$.FAILED_VERIFICATION_EMAIL_REQUEST,$.EMAIL_VERIFICATION_CONFIRMED,$.EMAIL_VERIFICATION_FAILED,$.MFA_AUTH_FAILED,$.MFA_AUTH_REJECTED,$.MFA_AUTH_SUCCESS,$.MFA_ENROLLMENT_COMPLETE,$.TOO_MANY_MFA_FAILURES,$.MFA_RECOVERY_FAILED,$.MFA_RECOVERY_RATE_LIMIT_EXCEED,$.MFA_RECOVERY_SUCCESS,$.MFA_EMAIL_SENT,$.EMAIL_VERIFICATION_SENT,$.EMAIL_VERIFICATION_SEND_FAILURE,$.PUSH_NOTIFICATION_SENT,$.ERROR_SENDING_MFA_PUSH_NOTIFICATION,$.MFA_SMS_SENT,$.ERROR_SENDING_MFA_SMS,$.MFA_VOICE_CALL_SUCCESS,$.MFA_VOICE_CALL_FAILED,$.SECOND_FACTOR_STARTED,$.MFA_ENROLL_STARTED,$.MFA_ENROLLMENT_FAILED,$.GUARDIAN_TENANT_UPDATE,$.UNENROLL_DEVICE_ACCOUNT,$.UPDATE_DEVICE_ACCOUNT,$.WEBAUTHN_CHALLENGE_FAILED,$.WEBAUTHN_ENROLLMENT_FAILED,$.FAILED_KMS_API_OPERATION,$.SUCCESS_KMS_API_OPERATION,$.KMS_KEY_STATE_CHANGED,$.TOO_MANY_CALLS_TO_DELEGATION,$.BLOCKED_IP_ADDRESS,$.BLOCKED_ACCOUNT_IP,$.BLOCKED_ACCOUNT_EMAIL,$.INFORMATION,$.MFA_REQUIRED,$.MANAGEMENT_API_READ_OPERATION,$.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,$.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT,$.FAILED_OIDC_BACKCHANNEL_LOGOUT,$.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT,$.ORGANIZATION_MEMBER_ADDED,$.PASSKEY_CHALLENGE_FAILED,$.PASSKEY_CHALLENGE_STARTED,$.PRE_LOGIN_ASSESSMENT,$.BREACHED_PASSWORD,$.BREACHED_PASSWORD_ON_RESET,$.SUCCESS_RESOURCE_CLEANUP,$.RICH_CONSENTS_ACCESS_ERROR,$.SUCCESS_LOGIN,$.SUCCESS_API_OPERATION,$.FAILED_API_OPERATION,$.SUCCESS_CHANGE_EMAIL,$.SUCCESS_CROSS_ORIGIN_AUTHENTICATION,$.SUCCESS_CHANGE_PASSWORD,$.SUCCESS_CHANGE_PHONE_NUMBER,$.SUCCESS_CHANGE_PASSWORD_REQUEST,$.SUCCESS_CHANGE_USERNAME,$.SUCCESS_CREDENTIAL_VALIDATION,$.SUCCESS_DELEGATION,$.SUCCESS_USER_DELETION,$.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS,$.SUCCESS_EXCHANGE_CUSTOM_TOKEN,$.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN,$.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN,$.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN,$.SUCCESS_IMPERSONATION,$.SUCCESSFULLY_ACCEPTED_USER_INVITE,$.BREACHED_PASSWORD_ON_SIGNUP,$.SUCCESS_LOGOUT,$.SUCCESS_HOOK,$.SUCCESS_PASSWORD_MIGRATION,$.SUCCESS_REVOCATION,$.SUCCESS_SIGNUP,$.FAILED_SS_SSO_OPERATION,$.INFORMATION_FROM_SS_SSO_OPERATION,$.SUCCESS_SS_SSO_OPERATION,$.SUCCESS_SILENT_AUTH,$.SUCCESSFUL_SCIM_OPERATION,$.SUCCESSFULLY_IMPORTED_USERS,$.SUCCESS_VERIFICATION_EMAIL,$.SUCCESS_VERIFICATION_EMAIL_REQUEST,$.MAX_AMOUNT_OF_AUTHENTICATORS,$.USER_LOGIN_BLOCK_RELEASED,$.FAILED_UNIVERSAL_LOGOUT,$.SUCCESSFUL_UNIVERSAL_LOGOUT,$.WARNING_DURING_LOGIN,$.WARNING_SENDING_NOTIFICATION,$.WARNING_USER_MANAGEMENT,(()=>{let e={};for(let[t,n]of Object.entries($))t.startsWith(`SUCCESS_`)||t.startsWith(`SUCCESSFUL_`)||t.startsWith(`SUCCESSFULLY_`)||t.endsWith(`_SUCCEEDED`)||t.endsWith(`_COMPLETED`)?e[n]=`success`:t.startsWith(`FAILED_`)||t.startsWith(`ERROR_`)||t.startsWith(`BREACHED_`)||t.startsWith(`BLOCKED_`)||t===`MFA_AUTH_FAILED`||t===`MFA_AUTH_REJECTED`||t===`MFA_RECOVERY_FAILED`||t===`MFA_ENROLLMENT_FAILED`||t===`EMAIL_VERIFICATION_FAILED`||t===`WEBAUTHN_CHALLENGE_FAILED`||t===`WEBAUTHN_ENROLLMENT_FAILED`||t===`PASSKEY_CHALLENGE_FAILED`||t===`FLOWS_EXECUTION_FAILED`||t===`FORMS_SUBMISSION_FAILED`||t===`CIBA_EXCHANGE_FAILED`||t===`CIBA_START_FAILED`||t===`ACTIONS_EXECUTION_FAILED`||t===`RICH_CONSENTS_ACCESS_ERROR`||t===`USER_CANCELED_DEVICE_CONFIRMATION`||t===`TOO_MANY_MFA_FAILURES`||t===`MFA_RECOVERY_RATE_LIMIT_EXCEED`||t===`API_LIMIT`||t===`MAX_AMOUNT_OF_AUTHENTICATORS`?e[n]=`failure`:t.startsWith(`WARNING_`)||t===`API_LIMIT_WARNING`||t===`DEPRECATION_NOTICE`||t===`PRE_LOGIN_ASSESSMENT`?e[n]=`warning`:t===`CODE_SENT`||t===`CODE_LINK_SENT`||t===`MFA_EMAIL_SENT`||t===`MFA_SMS_SENT`||t===`EMAIL_VERIFICATION_SENT`||t===`PUSH_NOTIFICATION_SENT`?e[n]=`code_sent`:t===`INFORMATION`||t===`INFORMATION_FROM_SS_SSO_OPERATION`||t===`MANAGEMENT_API_READ_OPERATION`||t===`APPI`||t===`ACLS_SUMMARY`||t===`ORGANIZATION_MEMBER_ADDED`?e[n]=`info`:e[n]=`other`;return e})();var fy=J({name:H(),version:H(),env:J({node:H().optional()}).optional()}),py=J({country_code:H().length(2),city_name:H(),latitude:H(),longitude:H(),time_zone:H(),continent_code:H()});J({type:dy,date:H(),description:H().optional(),ip:H().optional(),user_agent:H().optional(),details:K().optional(),isMobile:G(),user_id:H().optional(),user_name:H().optional(),connection:H().optional(),connection_id:H().optional(),client_id:H().optional(),client_name:H().optional(),audience:H().optional(),scope:H().optional(),strategy:H().optional(),strategy_type:H().optional(),hostname:H().optional(),auth0_client:fy.optional(),log_id:H().optional(),location_info:py.optional()}).extend({log_id:H()});var my=X([`http`,`eventbridge`,`eventgrid`,`splunk`,`datadog`,`sumo`]),hy=X([`active`,`paused`,`suspended`]),gy=J({type:H(),name:H()});J({name:H(),type:my,status:hy.optional(),sink:Y(H(),Eh()),filters:q(gy).optional(),isPriority:G().optional()}).extend({id:H(),status:hy,created_at:H().optional(),updated_at:H().optional()});var _y=X([`auth0`,`cognito`,`okta`,`oidc`]),vy=J({domain:H(),client_id:H(),client_secret:H(),audience:H().optional(),scope:H().optional()}),yy=J({id:H().optional(),name:H(),provider:_y,connection:H(),enabled:G().default(!0),credentials:vy});J({id:H(),created_at:H(),updated_at:H()}).extend(yy.shape);var by=J({enabled:G().optional(),shields:q(H()).optional(),admin_notification_frequency:q(H()).optional(),method:H().optional(),stage:J({"pre-user-registration":J({shields:q(H()).optional()}).optional(),"pre-change-password":J({shields:q(H()).optional()}).optional()}).optional()}),xy=J({enabled:G().optional(),shields:q(H()).optional(),allowlist:q(H()).optional(),mode:H().optional(),max_attempts:W().optional()}),Sy=J({enabled:G().optional(),shields:q(H()).optional(),allowlist:q(H()).optional(),stage:J({"pre-login":J({max_attempts:W().optional(),rate:W().optional()}).optional(),"pre-user-registration":J({max_attempts:W().optional(),rate:W().optional()}).optional()}).optional()}),Cy=J({breached_password_detection:by.optional(),brute_force_protection:xy.optional(),suspicious_ip_throttling:Sy.optional()});J({id:H().optional(),user_id:H(),password:H(),algorithm:X([`bcrypt`,`argon2id`]).default(`argon2id`),is_current:G().default(!0)}).extend({id:H(),created_at:H(),updated_at:H()});var wy=J({initial_user_agent:H().describe(`First user agent of the device from which this user logged in`),initial_ip:H().describe(`First IP address associated with this session`),initial_asn:H().describe(`First autonomous system number associated with this session`),last_user_agent:H().describe(`Last user agent of the device from which this user logged in`),last_ip:H().describe(`Last IP address from which this user logged in`),last_asn:H().describe(`Last autonomous system number from which this user logged in`)}),Ty=J({id:H(),revoked_at:H().optional(),used_at:H().optional(),user_id:H().describe(`The user ID associated with the session`),expires_at:H().optional(),login_session_id:H(),idle_expires_at:H().optional(),device:wy.describe(`Metadata related to the device used in the session`),clients:q(H()).describe(`List of client details for the session`)});J({created_at:H(),updated_at:H(),authenticated_at:H(),last_interaction_at:H()}).extend(Ty.shape),J({kid:H().openapi({description:`The key id of the signing key`}),tenant_id:H().optional().openapi({description:`The tenant the key belongs to. Omitted means the key is shared / control-plane scoped.`}),cert:H().openapi({description:`The public certificate of the signing key`}),fingerprint:H().openapi({description:`The cert fingerprint`}),thumbprint:H().openapi({description:`The cert thumbprint`}),pkcs7:H().optional().openapi({description:`The private key in pkcs7 format`}),current:G().optional().openapi({description:`True if the key is the current key`}),next:G().optional().openapi({description:`True if the key is the next key`}),previous:G().optional().openapi({description:`True if the key is the previous key`}),current_since:H().optional().openapi({description:`The date and time when the key became the current key`}),current_until:H().optional().openapi({description:`The date and time when the current key was rotated`}),revoked:G().optional().openapi({description:`True if the key is revoked`}),revoked_at:H().optional().openapi({description:`The date and time when the key was revoked`}),connection:H().optional().openapi({description:`The connection identifier associated with the key`}),type:X([`jwt_signing`,`saml_encryption`]).openapi({description:`The type of the signing key`})});var Ey=J({id:H().optional(),audience:H(),friendly_name:H(),picture_url:H().optional(),support_email:H().optional(),support_url:H().optional(),sender_email:H().email(),sender_name:H(),session_lifetime:W().optional(),idle_session_lifetime:W().optional(),ephemeral_session_lifetime:W().optional(),idle_ephemeral_session_lifetime:W().optional(),session_cookie:J({mode:X([`persistent`,`non-persistent`]).optional()}).optional(),allowed_logout_urls:q(H()).optional(),default_redirection_uri:H().optional(),default_client_id:H().optional(),enabled_locales:q(H()).optional(),default_directory:H().optional(),error_page:J({html:H().optional(),show_log_link:G().optional(),url:H().optional()}).nullish(),flags:J({allow_changing_enable_sso:G().optional(),allow_legacy_delegation_grant_types:G().optional(),allow_legacy_ro_grant_types:G().optional(),allow_legacy_tokeninfo_endpoint:G().optional(),change_pwd_flow_v1:G().optional(),client_id_metadata_document_registration:G().optional(),custom_domains_provisioning:G().optional(),dashboard_insights_view:G().optional(),dashboard_log_streams_next:G().optional(),disable_clickjack_protection_headers:G().optional(),disable_fields_map_fix:G().optional(),disable_impersonation:G().optional(),disable_management_api_sms_obfuscation:G().optional(),enable_adfs_waad_email_verification:G().optional(),enable_apis_section:G().optional(),enable_client_connections:G().optional(),enable_custom_domain_in_emails:G().optional(),enable_dynamic_client_registration:G().optional(),dcr_require_initial_access_token:G().optional(),dcr_allowed_grant_types:q(H()).optional(),allow_http_return_to:q(H().refine(e=>{try{let t=new URL(e);return t.protocol===`http:`&&(t.pathname===``||t.pathname===`/`)&&!t.search&&!t.hash&&e===t.origin}catch{return!1}},{message:`must be a fully-qualified http origin (scheme + host + port, no path)`})).optional(),enable_idtoken_api2:G().optional(),enable_legacy_logs_search_v2:G().optional(),enable_legacy_profile:G().optional(),enable_pipeline2:G().optional(),enable_public_signup_user_exists_error:G().optional(),enable_sso:G().optional(),enforce_client_authentication_on_passwordless_start:G().optional(),genai_trial:G().optional(),improved_signup_bot_detection_in_classic:G().optional(),mfa_show_factor_list_on_enrollment:G().optional(),no_disclose_enterprise_connections:G().optional(),remove_alg_from_jwks:G().optional(),revoke_refresh_token_grant:G().optional(),trust_azure_adfs_email_verified_connection_property:G().optional(),use_scope_descriptions_for_consent:G().optional(),inherit_global_permissions_in_organizations:G().optional(),restrict_undefined_scopes:G().optional()}).optional(),sandbox_version:H().optional(),legacy_sandbox_version:H().optional(),sandbox_versions_available:q(H()).optional(),change_password:J({enabled:G().optional(),html:H().optional()}).optional(),guardian_mfa_page:J({enabled:G().optional(),html:H().optional()}).optional(),device_flow:J({charset:X([`base20`,`digits`]).optional(),mask:H().max(20).optional()}).optional(),default_token_quota:J({clients:J({client_credentials:Y(H(),K()).optional()}).optional(),organizations:J({client_credentials:Y(H(),K()).optional()}).optional()}).nullish(),default_audience:H().optional(),default_organization:H().optional(),sessions:J({oidc_logout_prompt_enabled:G().optional()}).optional(),oidc_logout:J({rp_logout_end_session_endpoint_discovery:G().optional()}).optional(),allow_organization_name_in_authentication_api:G().optional(),customize_mfa_in_postlogin_action:G().optional(),acr_values_supported:q(H()).optional(),mtls:J({enable_endpoint_aliases:G().optional()}).nullish(),pushed_authorization_requests_supported:G().optional(),authorization_response_iss_parameter_supported:G().optional(),attack_protection:Cy.optional(),mfa:J({policy:X([`never`,`always`]).default(`never`).optional(),factors:J({sms:G().default(!1),otp:G().default(!1),email:G().default(!1),push_notification:G().default(!1),webauthn_roaming:G().default(!1),webauthn_platform:G().default(!1),recovery_code:G().default(!1),duo:G().default(!1)}).optional(),sms_provider:J({provider:X([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:J({sid:H().optional(),auth_token:H().optional(),from:H().optional(),messaging_service_sid:H().optional()}).optional(),phone_message:J({message:H().optional()}).optional()}).optional()});J({created_at:H().nullable().transform(e=>e??``),updated_at:H().nullable().transform(e=>e??``)}).extend(Ey.shape).extend({id:H(),is_control_plane:G().optional()}),J({access_token:H(),id_token:H().optional(),scope:H().optional(),state:H().optional(),refresh_token:H().optional(),token_type:H(),expires_in:W()}),J({code:H(),state:H().optional()});var Dy=J({button_border_radius:W(),button_border_weight:W(),buttons_style:X([`pill`,`rounded`,`sharp`]),input_border_radius:W(),input_border_weight:W(),inputs_style:X([`pill`,`rounded`,`sharp`]),show_widget_shadow:G(),widget_border_weight:W(),widget_corner_radius:W()}),Oy=J({base_focus_color:H(),base_hover_color:H(),body_text:H(),captcha_widget_theme:X([`auto`,`dark`,`light`]),error:H(),header:H(),icons:H(),input_background:H(),input_border:H(),input_filled_text:H(),input_labels_placeholders:H(),links_focused_components:H(),primary_button:H(),primary_button_label:H(),secondary_button_border:H(),secondary_button_label:H(),success:H(),widget_background:H(),widget_border:H()}),ky=J({bold:G(),size:W()}),Ay=J({body_text:ky,buttons_text:ky,font_url:H(),input_labels:ky,links:ky,links_style:X([`normal`,`underlined`]),reference_text_size:W(),subtitle:ky,title:ky}),jy=J({background_color:H(),background_image_url:H(),page_layout:X([`center`,`left`,`right`]),logo_placement:X([`widget`,`chip`,`none`]).optional()}),My=J({header_text_alignment:X([`center`,`left`,`right`]),logo_height:W(),logo_position:X([`center`,`left`,`none`,`right`]),logo_url:H(),social_buttons_layout:X([`bottom`,`top`])});J({borders:Dy,colors:Oy,displayName:H(),fonts:Ay,page_background:jy,widget:My}).extend({themeId:H()}),J({universal_login_experience:X([`new`,`classic`]).default(`new`),identifier_first:G().default(!0),password_first:G().default(!1),webauthn_platform_first_factor:G()});var Ny=J({hosts:q(H()).optional(),methods:q(H()).optional(),path:H().default(`/*`),headers:Y(H(),H()).optional(),query:Y(H(),H()).optional()}),Py=J({type:H(),options:Y(H(),Eh()).default({})}),Fy=J({custom_domain_id:H(),priority:W().int().default(100),match:Ny,handlers:q(Py).min(1)});Fy.extend({id:H(),tenant_id:H(),created_at:H(),updated_at:H()}),Fy.partial().omit({custom_domain_id:!0}),J({name:H(),enabled:G().optional().default(!0),default_from_address:H().optional(),credentials:Y(H(),Eh()),settings:J({}).optional()}),J({template:X([`verify_email`,`verify_email_by_code`,`reset_email`,`reset_email_by_code`,`welcome_email`,`blocked_account`,`stolen_credentials`,`enrollment_email`,`mfa_oob_code`,`change_password`,`password_reset`,`user_invitation`]),body:H(),from:H(),subject:H(),syntax:Z(`liquid`).default(`liquid`),resultUrl:H().optional(),urlLifetimeInSeconds:W().int().nonnegative().optional(),includeEmailInRedirect:G().default(!1),enabled:G().default(!0)}),J({id:H(),login_id:H(),user_id:H(),client_id:H(),expires_at:H().optional(),idle_expires_at:H().optional(),last_exchanged_at:H().optional(),device:wy,resource_servers:q(J({audience:H(),scopes:H()})),rotating:G(),token_lookup:H().optional(),token_hash:H().optional(),family_id:H().optional(),rotated_to:H().optional(),rotated_at:H().optional()}).extend({created_at:H(),revoked_at:H().optional()}),J({to:H(),message:H()}),J({name:H(),options:J({})});var Iy=J({value:H(),description:H().optional()}),Ly=J({token_dialect:X([`access_token`,`access_token_authz`]).optional(),enforce_policies:G().optional(),allow_skipping_userinfo:G().optional(),skip_userinfo:G().optional(),persist_client_authorization:G().optional(),enable_introspection_endpoint:G().optional(),mtls:J({bound_access_tokens:G().optional()}).optional()});J({id:H().optional(),name:H(),identifier:H(),scopes:q(Iy).optional(),signing_alg:H().optional(),signing_secret:H().optional(),token_lifetime:W().default(86400),token_lifetime_for_web:W().default(7200),skip_consent_for_verifiable_first_party_clients:G().optional(),allow_offline_access:G().optional(),verificationKey:H().optional(),options:Ly.optional(),is_system:G().optional(),metadata:Y(H(),K()).optional()}).extend({created_at:H().optional(),updated_at:H().optional()}),J({role_id:H(),resource_server_identifier:H(),permission_name:H()}).extend({created_at:H()}),J({user_id:H(),resource_server_identifier:H(),permission_name:H(),organization_id:H().optional()}).extend({tenant_id:H(),created_at:H().optional()}),J({user_id:H(),resource_server_identifier:H(),resource_server_name:H(),permission_name:H(),description:H().nullable().optional(),created_at:H().optional(),organization_id:H().optional()}),J({user_id:H(),role_id:H(),organization_id:H().optional()}).extend({tenant_id:H(),created_at:H().optional()}),J({id:H().optional().openapi({description:`The unique identifier of the role. If not provided, one will be generated.`}),name:H().min(1).max(50).openapi({description:`The name of the role. Cannot include '<' or '>'`}),description:H().max(255).optional().openapi({description:`The description of the role`}),is_system:G().optional(),metadata:Y(H(),K()).optional().openapi({description:`Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios.`})}).extend({id:H().openapi({description:`The unique identifier of the role`}),created_at:H().optional(),updated_at:H().optional()});var Ry=J({logo_url:H().optional().openapi({description:`URL of the organization's logo`}),colors:J({primary:H().optional().openapi({description:`Primary color in hex format (e.g., #FF0000)`}),page_background:H().optional().openapi({description:`Page background color in hex format (e.g., #FFFFFF)`})}).optional()}).optional(),zy=J({connection_id:H().openapi({description:`ID of the connection`}),assign_membership_on_login:G().default(!1).openapi({description:`Whether to assign membership to the organization on login`}),show_as_button:G().default(!0).openapi({description:`Whether to show this connection as a button in the login screen`}),is_signup_enabled:G().default(!0).openapi({description:`Whether signup is enabled for this connection`})}),By=J({client_credentials:J({enforce:G().default(!1).openapi({description:`Whether to enforce token quota limits`}),per_day:W().min(0).default(0).openapi({description:`Maximum tokens per day (0 = unlimited)`}),per_hour:W().min(0).default(0).openapi({description:`Maximum tokens per hour (0 = unlimited)`})}).optional()}).optional();J({id:H().optional(),name:H().min(1).regex(/^[a-z0-9_-]+$/,{message:`Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores`}).openapi({description:`The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores.`}),display_name:H().optional().openapi({description:`The display name of the organization`}),branding:Ry,metadata:Y(H(),K()).default({}).optional().openapi({description:`Custom metadata for the organization`}),enabled_connections:q(zy).default([]).optional().openapi({description:`List of enabled connections for the organization`}),token_quota:By}).extend(__.shape).extend({id:H(),name:H().min(1).openapi({description:`The name of the organization`})}),J({connection_id:H().openapi({description:`ID of the tenant-level connection to enable for the org.`}),assign_membership_on_login:G().optional().default(!1),show_as_button:G().optional().default(!0),is_signup_enabled:G().optional().default(!0)}).extend({connection:J({name:H().optional(),strategy:H().optional()}).optional(),created_at:H().optional(),updated_at:H().optional()}),J({user_id:H().openapi({description:`ID of the user`}),organization_id:H().openapi({description:`ID of the organization`})}).extend(__.shape).extend({id:H()}),J({idle_session_lifetime:W().default(72),session_lifetime:W().default(168),session_cookie:J({mode:X([`persistent`,`non-persistent`]).optional()}).optional(),enable_client_connections:G().optional(),default_redirection_uri:H().optional(),enabled_locales:q(H()).optional(),default_directory:H().optional(),error_page:J({html:H().optional(),show_log_link:G().optional(),url:H().optional()}).optional(),flags:J({allow_legacy_delegation_grant_types:G().optional(),allow_legacy_ro_grant_types:G().optional(),allow_legacy_tokeninfo_endpoint:G().optional(),disable_clickjack_protection_headers:G().optional(),enable_apis_section:G().optional(),enable_client_connections:G().optional(),enable_custom_domain_in_emails:G().optional(),enable_dynamic_client_registration:G().optional(),enable_idtoken_api2:G().optional(),enable_legacy_logs_search_v2:G().optional(),enable_legacy_profile:G().optional(),enable_pipeline2:G().optional(),enable_public_signup_user_exists_error:G().optional(),use_scope_descriptions_for_consent:G().optional(),disable_management_api_sms_obfuscation:G().optional(),enable_adfs_waad_email_verification:G().optional(),revoke_refresh_token_grant:G().optional(),dashboard_log_streams_next:G().optional(),dashboard_insights_view:G().optional(),disable_fields_map_fix:G().optional(),mfa_show_factor_list_on_enrollment:G().optional()}).optional(),friendly_name:H().optional(),picture_url:H().optional(),support_email:H().optional(),support_url:H().optional(),sandbox_version:H().optional(),sandbox_versions_available:q(H()).optional(),change_password:J({enabled:G(),html:H()}).optional(),guardian_mfa_page:J({enabled:G(),html:H()}).optional(),default_audience:H().optional(),default_organization:H().optional(),sessions:J({oidc_logout_prompt_enabled:G().optional()}).optional(),mfa:J({policy:X([`never`,`always`]).default(`never`).optional(),factors:J({sms:G().default(!1),otp:G().default(!1),email:G().default(!1),push_notification:G().default(!1),webauthn_roaming:G().default(!1),webauthn_platform:G().default(!1),recovery_code:G().default(!1),duo:G().default(!1)}).optional(),sms_provider:J({provider:X([`twilio`,`vonage`,`aws_sns`,`phone_message_hook`]).optional()}).optional(),twilio:J({sid:H().optional(),auth_token:H().optional(),from:H().optional(),messaging_service_sid:H().optional()}).optional(),phone_message:J({message:H().optional()}).optional()}).optional()}),J({date:H().openapi({description:`Date these events occurred in ISO 8601 format`,example:`2025-12-19`}),logins:W().openapi({description:`Number of logins on this date`,example:150}),signups:W().openapi({description:`Number of signups on this date`,example:25}),leaked_passwords:W().openapi({description:`Number of breached-password detections on this date (subscription required)`,example:0}),updated_at:H().openapi({description:`Date and time this stats entry was last updated in ISO 8601 format`,example:`2025-12-19T10:30:00.000Z`}),created_at:H().openapi({description:`Approximate date and time the first event occurred in ISO 8601 format`,example:`2025-12-19T00:00:00.000Z`})}),W().openapi({description:`Number of active users in the last 30 days`,example:1234}),X([`active-users`,`logins`,`signups`,`refresh-tokens`,`sessions`]),X([`hour`,`day`,`week`,`month`]),X([`time`,`connection`,`client_id`,`user_type`,`event`]),X([`password`,`social`,`passwordless`,`enterprise`]);var Vy=J({name:H(),type:H()}),Hy=J({elapsed:W(),rows_read:W().optional(),bytes_read:W().optional()});J({meta:q(Vy),data:q(Y(H(),K())),rows:W(),rows_before_limit_at_least:W().optional(),statistics:Hy.optional()});var Uy=X(`login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options`.split(`.`)),Wy=Y(H(),Y(H(),H())).openapi({type:`object`,additionalProperties:{type:`object`,additionalProperties:{type:`string`}}});J({prompt:Uy,language:H(),custom_text:Wy});var Gy=X([`phone`,`totp`,`email`,`push`,`webauthn-roaming`,`webauthn-platform`,`passkey`]),Ky=J({user_id:H(),type:Gy,phone_number:H().optional(),totp_secret:H().optional(),credential_id:H().optional(),public_key:H().optional(),sign_count:W().int().nonnegative().optional(),credential_backed_up:G().optional(),transports:q(H()).optional(),friendly_name:H().optional(),confirmed:G().default(!1)});function qy(e,t){e.type===`phone`&&!e.phone_number&&t.addIssue({code:e_.custom,message:`phone_number is required when type is 'phone'`,path:[`phone_number`]}),e.type===`totp`&&!e.totp_secret&&t.addIssue({code:e_.custom,message:`totp_secret is required when type is 'totp'`,path:[`totp_secret`]}),[`webauthn-roaming`,`webauthn-platform`,`passkey`].includes(e.type)&&(e.credential_id||t.addIssue({code:e_.custom,message:`credential_id is required when type is '${e.type}'`,path:[`credential_id`]}),e.public_key||t.addIssue({code:e_.custom,message:`public_key is required when type is '${e.type}'`,path:[`public_key`]}))}Ky.superRefine(qy),Ky.extend({id:H(),created_at:H(),updated_at:H()}).superRefine(qy);function Jy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Yy(e){if(!e)return;let t=JSON.parse(e);return Jy(t)?t:void 0}function Xy(e){return e==null?void 0:new Date(e).toISOString()}function Zy(e){if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t.getTime()}function Qy(e){let t=J_.parse(e.type);return{id:e.id,token_hash:e.token_hash,type:t,client_id:e.client_id??void 0,sub:e.sub??void 0,constraints:Yy(e.constraints),single_use:!!e.single_use,expires_at:Xy(e.expires_at_ts),used_at:Xy(e.used_at_ts),revoked_at:Xy(e.revoked_at_ts),created_at:new Date(e.created_at_ts).toISOString()}}function $y(e){return{async create(t,n){let r=Date.now();return await e.insert(T).values({id:n.id,tenant_id:t,token_hash:n.token_hash,type:n.type,client_id:n.client_id??null,sub:n.sub??null,constraints:n.constraints?JSON.stringify(n.constraints):null,single_use:+!!n.single_use,expires_at_ts:Zy(n.expires_at),created_at_ts:r}),{id:n.id,token_hash:n.token_hash,type:n.type,client_id:n.client_id,sub:n.sub,constraints:n.constraints,single_use:n.single_use,expires_at:n.expires_at,created_at:new Date(r).toISOString()}},async get(t,n){let r=await e.select().from(T).where(h(m(T.tenant_id,t),m(T.id,n))).get();return r?Qy(r):null},async getByHash(t,n){let r=await e.select().from(T).where(h(m(T.tenant_id,t),m(T.token_hash,n))).get();return r?Qy(r):null},async listByClient(t,n){return(await e.select().from(T).where(h(m(T.tenant_id,t),m(T.client_id,n))).orderBy(Be(T.created_at_ts))).map(Qy)},async markUsed(t,n,r){return(await e.update(T).set({used_at_ts:Zy(r)}).where(h(m(T.tenant_id,t),m(T.id,n),Ie(T.used_at_ts))).returning()).length>0},async revoke(t,n,r){return(await e.update(T).set({revoked_at_ts:Zy(r)}).where(h(m(T.tenant_id,t),m(T.id,n),Ie(T.revoked_at_ts))).returning()).length>0},async revokeByClient(t,n,r){return(await e.update(T).set({revoked_at_ts:Zy(r)}).where(h(m(T.tenant_id,t),m(T.client_id,n),Ie(T.revoked_at_ts))).returning()).length},async remove(t,n){return(await e.delete(T).where(h(m(T.tenant_id,t),m(T.id,n))).returning()).length>0}}}function eb(e){let{tenant_id:t,...n}=e;return A(n)}function tb(e){return{async create(t,n){let r={...n,tenant_id:t,created_at:n.created_at||new Date().toISOString(),expires_at:n.expires_at};return await e.insert(Vt).values(r),eb(r)},async get(t,n,r){if(!t)throw Error(`tenant_id is required`);let i=await e.select().from(Vt).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n),m(Vt.code_type,r))).get();return i?eb(i):null},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(Vt).where(m(Vt.tenant_id,t)).$dynamic();if(o?.sort_by){let e=Vt[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(eb);if(!a)return{codes:c};let[l]=await e.select({count:Ve()}).from(Vt).where(m(Vt.tenant_id,t));return{codes:c,start:r*i,limit:i,length:Number(l?.count??0)}},async used(t,n){return(await e.update(Vt).set({used_at:new Date().toISOString()}).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n))).returning()).length>0},async consume(t,n){return(await e.update(Vt).set({used_at:new Date().toISOString()}).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n),Ie(Vt.used_at))).returning()).length>0},async remove(t,n){return(await e.delete(Vt).where(h(m(Vt.tenant_id,t),m(Vt.code_id,n))).returning()).length>0}}}function nb(){let{customAlphabet:e}=(Hn(),s(Ln));return`con_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}function rb(e){let{tenant_id:t,is_system:n,options:r,metadata:i,...a}=e;return A({...a,options:j(r,{}),metadata:j(i),is_system:n?!0:void 0})}function ib(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||nb(),...n,tenant_id:t,options:JSON.stringify(n.options||{}),metadata:n.metadata?JSON.stringify(n.metadata):void 0,is_system:+!!n.is_system,created_at:r,updated_at:r};try{await e.insert(Kt).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`duplicate key`)?new Tn(409,{message:`Connection already exists`}):e}return rb(i)},async get(t,n){let r=await e.select().from(Kt).where(h(m(Kt.tenant_id,t),m(Kt.id,n))).get();return r?rb(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.strategy!==void 0&&(i.strategy=r.strategy),r.options!==void 0&&(i.options=JSON.stringify(r.options)),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),r.display_name!==void 0&&(i.display_name=r.display_name),r.response_type!==void 0&&(i.response_type=r.response_type),r.response_mode!==void 0&&(i.response_mode=r.response_mode),await e.update(Kt).set(i).where(h(m(Kt.tenant_id,t),m(Kt.id,n))),!0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=m(Kt.tenant_id,t);if(s){let e=En(Kt,s,[`name`]);e&&(c=h(c,e))}let l=e.select().from(Kt).where(c).$dynamic();if(o?.sort_by){let e=Kt[o.sort_by];e&&(l=l.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let u=(await l.offset(r*i).limit(i)).map(rb);if(!a)return{connections:u};let[d]=await e.select({count:Ve()}).from(Kt).where(c);return{connections:u,start:r*i,limit:i,length:Number(d?.count??0)}},async remove(t,n){return(await e.delete(Kt).where(h(m(Kt.tenant_id,t),m(Kt.id,n))).returning()).length>0}}}Hn();function ab(e){let{tenant_id:t,domain_metadata:n,...r}=e;return A({...r,primary:!!r.primary,domain_metadata:j(n)})}function ob(e){return{async create(t,n){let r=new Date().toISOString(),i={custom_domain_id:n.custom_domain_id||Vn(),tenant_id:t,domain:n.domain,primary:n.primary??!1,status:n.status||`pending`,type:n.type,origin_domain_name:n.origin_domain_name,verification:n.verification,custom_client_ip_header:n.custom_client_ip_header,tls_policy:n.tls_policy,domain_metadata:n.domain_metadata?JSON.stringify(n.domain_metadata):void 0,created_at:r,updated_at:r};return await e.insert(qt).values(i),ab({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(qt).where(h(m(qt.tenant_id,t),m(qt.custom_domain_id,n))).get();return r?ab(r):null},async getByDomain(t){let n=await e.select().from(qt).where(m(qt.domain,t)).get();return n?{...ab(n),tenant_id:n.tenant_id}:null},async list(t){return(await e.select().from(qt).where(m(qt.tenant_id,t)).all()).map(ab)},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.domain!==void 0&&(i.domain=r.domain),r.primary!==void 0&&(i.primary=r.primary),r.status!==void 0&&(i.status=r.status),r.type!==void 0&&(i.type=r.type),r.origin_domain_name!==void 0&&(i.origin_domain_name=r.origin_domain_name),r.verification!==void 0&&(i.verification=r.verification),r.custom_client_ip_header!==void 0&&(i.custom_client_ip_header=r.custom_client_ip_header),r.tls_policy!==void 0&&(i.tls_policy=r.tls_policy),r.domain_metadata!==void 0&&(i.domain_metadata=JSON.stringify(r.domain_metadata)),(await e.update(qt).set(i).where(h(m(qt.tenant_id,t),m(qt.custom_domain_id,n))).returning()).length>0},async remove(t,n){return(await e.delete(qt).where(h(m(qt.tenant_id,t),m(qt.custom_domain_id,n))).returning()).length>0}}}function sb(e){return{async get(t,n,r){let i=await e.select().from(mn).where(h(m(mn.tenant_id,t),m(mn.prompt,n),m(mn.language,r))).get();if(!i)return null;try{return JSON.parse(i.custom_text)}catch{return null}},async set(t,n,r,i){let a=Date.now(),o=JSON.stringify(i);await e.insert(mn).values({tenant_id:t,prompt:n,language:r,custom_text:o,created_at_ts:a,updated_at_ts:a}).onConflictDoUpdate({target:[mn.tenant_id,mn.prompt,mn.language],set:{custom_text:o,updated_at_ts:a}})},async delete(t,n,r){await e.delete(mn).where(h(m(mn.tenant_id,t),m(mn.prompt,n),m(mn.language,r)))},async list(t){return await e.select({prompt:mn.prompt,language:mn.language}).from(mn).where(m(mn.tenant_id,t)).all()}}}function cb(e){return{async create(t,n){let r=new Date().toISOString();await e.insert(ln).values({tenant_id:t,name:n.name,enabled:n.enabled,default_from_address:n.default_from_address,credentials:JSON.stringify(n.credentials||{}),settings:JSON.stringify(n.settings||{}),created_at:r,updated_at:r})},async get(t){let n=await e.select().from(ln).where(m(ln.tenant_id,t)).get();if(!n)return null;let{tenant_id:r,...i}=n;return A({...i,enabled:!!i.enabled,credentials:j(i.credentials,{}),settings:j(i.settings,{})})},async update(t,n){let r={updated_at:new Date().toISOString()};n.name!==void 0&&(r.name=n.name),n.enabled!==void 0&&(r.enabled=n.enabled),n.default_from_address!==void 0&&(r.default_from_address=n.default_from_address),n.credentials!==void 0&&(r.credentials=JSON.stringify(n.credentials)),n.settings!==void 0&&(r.settings=JSON.stringify(n.settings)),await e.update(ln).set(r).where(m(ln.tenant_id,t))},async remove(t){await e.delete(ln).where(m(ln.tenant_id,t))}}}function lb(e){return A({template:e.template,body:e.body,from:e.from,subject:e.subject,syntax:`liquid`,includeEmailInRedirect:!!e.include_email_in_redirect,enabled:!!e.enabled,resultUrl:e.result_url??void 0,urlLifetimeInSeconds:e.url_lifetime_in_seconds??void 0})}function ub(e){return{async get(t,n){let r=await e.select().from(un).where(h(m(un.tenant_id,t),m(un.template,n))).get();return r?lb(r):null},async list(t){return(await e.select().from(un).where(m(un.tenant_id,t)).all()).map(lb)},async create(t,n){let r=new Date().toISOString();return await e.insert(un).values({tenant_id:t,template:n.template,body:n.body,from:n.from,subject:n.subject,syntax:n.syntax,result_url:n.resultUrl??null,url_lifetime_in_seconds:n.urlLifetimeInSeconds??null,include_email_in_redirect:n.includeEmailInRedirect,enabled:n.enabled,created_at:r,updated_at:r}),n},async update(t,n,r){let i={updated_at:new Date().toISOString()};r.body!==void 0&&(i.body=r.body),r.from!==void 0&&(i.from=r.from),r.subject!==void 0&&(i.subject=r.subject),r.syntax!==void 0&&(i.syntax=r.syntax),r.resultUrl!==void 0&&(i.result_url=r.resultUrl),r.urlLifetimeInSeconds!==void 0&&(i.url_lifetime_in_seconds=r.urlLifetimeInSeconds),r.includeEmailInRedirect!==void 0&&(i.include_email_in_redirect=r.includeEmailInRedirect),r.enabled!==void 0&&(i.enabled=r.enabled);let a=await e.update(un).set(i).where(h(m(un.tenant_id,t),m(un.template,n))).run();return Number(a.changes??0)>0},async remove(t,n){let r=await e.delete(un).where(h(m(un.tenant_id,t),m(un.template,n))).run();return Number(r.changes??0)>0}}}Hn();function db(e){return{async create(t,n){let r=new Date().toISOString(),i=`af_${Vn()}`;return await e.insert(sn).values({id:i,tenant_id:t,name:n.name,actions:JSON.stringify(n.actions||[]),created_at:r,updated_at:r}),{id:i,name:n.name,actions:n.actions||[],created_at:r,updated_at:r}},async get(t,n){let r=await e.select().from(sn).where(h(m(sn.tenant_id,t),m(sn.id,n))).get();if(!r)return null;let{tenant_id:i,actions:a,...o}=r;return A({...o,actions:j(a,[])})},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.actions!==void 0&&(i.actions=JSON.stringify(r.actions)),(await e.update(sn).set(i).where(h(m(sn.tenant_id,t),m(sn.id,n))).returning()).length===0?null:this.get(t,n)},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(sn).where(m(sn.tenant_id,t)).$dynamic();if(o?.sort_by){let e=sn[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(e=>{let{tenant_id:t,actions:n,...r}=e;return A({...r,actions:j(n,[])})});if(!a)return{flows:c};let[l]=await e.select({count:Ve()}).from(sn).where(m(sn.tenant_id,t));return{flows:c,start:r*i,limit:i,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(sn).where(h(m(sn.tenant_id,t),m(sn.id,n))).returning()).length>0}}}Hn();var fb=[`nodes`,`start`,`ending`];function pb(e){return{async create(t,n){let r=new Date().toISOString(),i=Vn(),a={id:i,tenant_id:t,name:n.name,messages:n.messages,languages:n.languages,translations:n.translations,style:n.style,created_at:r,updated_at:r};for(let e of fb)a[e]=JSON.stringify(n[e]||(e===`nodes`?[]:{}));return await e.insert(on).values(a),{id:i,...n,created_at:r,updated_at:r}},async get(t,n){let r=await e.select().from(on).where(h(m(on.tenant_id,t),m(on.id,n))).get();if(!r)return null;let{tenant_id:i,...a}=r,o={...a};for(let e of fb)o[e]=j(a[e]);return A(o)},async update(t,n,r){let i={updated_at:new Date().toISOString()};for(let[e,t]of Object.entries(r))t!==void 0&&(fb.includes(e)?i[e]=JSON.stringify(t):i[e]=t);return(await e.update(on).set(i).where(h(m(on.tenant_id,t),m(on.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(on).where(m(on.tenant_id,t)).$dynamic();if(o?.sort_by){let e=on[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(e=>{let{tenant_id:t,...n}=e,r={...n};for(let e of fb)r[e]=j(n[e]);return A(r)});if(!a)return{forms:c};let[l]=await e.select({count:Ve()}).from(on).where(m(on.tenant_id,t));return{forms:c,start:r*i,limit:i,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(on).where(h(m(on.tenant_id,t),m(on.id,n))).returning()).length>0}}}function mb(e){if(e!=null){if(typeof e==`number`)return new Date(e).toISOString();if(typeof e==`string`){if(e===``)return;let t=parseFloat(e);return!isNaN(t)&&/^\d+(\.\d+)?$/.test(e)?new Date(t).toISOString():e}}}function hb(e,t=new Date(0).toISOString()){return mb(e)??t}function gb(e){if(!e||e===``)return null;let t=new Date(e);return isNaN(t.getTime())?null:t.getTime()}function _b(e,t,n=[]){let r={};for(let n of t){let t=n.replace(/_ts$/,``);r[t]=hb(e[n])}for(let t of n){let n=t.replace(/_ts$/,``);r[n]=mb(e[t])}return r}Hn();var vb=Bn(`0123456789abcdefghijklmnopqrstuvwxyz`,17);function yb(){return`hc_${vb()}`}function bb(e){let{created_at_ts:t,updated_at_ts:n,secrets:r,...i}=e,a=_b({created_at_ts:t,updated_at_ts:n},[`created_at_ts`,`updated_at_ts`]);return{...i,...a,secrets:r?JSON.parse(r):void 0}}function xb(e){return{async create(t,n){let r=Date.now(),i={id:yb(),tenant_id:t,code:n.code,secrets:n.secrets?JSON.stringify(n.secrets):null,created_at_ts:r,updated_at_ts:r};return await e.insert(fn).values(i),bb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(fn).where(h(m(fn.tenant_id,t),m(fn.id,n))).get();return r?bb(r):null},async update(t,n,r){let i={updated_at_ts:Date.now()};return r.code!==void 0&&(i.code=r.code),r.secrets!==void 0&&(i.secrets=JSON.stringify(r.secrets)),(await e.update(fn).set(i).where(h(m(fn.tenant_id,t),m(fn.id,n))).returning()).length>0},async remove(t,n){return(await e.delete(fn).where(h(m(fn.tenant_id,t),m(fn.id,n))).returning()).length>0}}}function Sb(){let{customAlphabet:e}=(Hn(),s(Ln));return`h_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}function Cb(e){if(!(typeof e!=`string`||!e))try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:void 0}catch{return}}function wb(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,metadata:i,...a}=e,o=_b({created_at_ts:n,updated_at_ts:r},[`created_at_ts`,`updated_at_ts`]);return A({...a,enabled:!!a.enabled,synchronous:!!a.synchronous,metadata:Cb(i),...o})}function Tb(e){return{async create(t,n){let r=Date.now(),i={hook_id:n.hook_id||Sb(),tenant_id:t,trigger_id:n.trigger_id,url:n.url,enabled:n.enabled??!0,synchronous:n.synchronous??!1,priority:n.priority,form_id:n.form_id,template_id:n.template_id,code_id:n.code_id,metadata:n.metadata?JSON.stringify(n.metadata):null,created_at_ts:r,updated_at_ts:r};return await e.insert(dn).values(i),wb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(dn).where(h(m(dn.tenant_id,t),m(dn.hook_id,n))).get();return r?wb(r):null},async update(t,n,r){let i={updated_at_ts:Date.now()};return r.trigger_id!==void 0&&(i.trigger_id=r.trigger_id),r.url!==void 0&&(i.url=r.url),r.enabled!==void 0&&(i.enabled=r.enabled),r.synchronous!==void 0&&(i.synchronous=r.synchronous),r.priority!==void 0&&(i.priority=r.priority),r.form_id!==void 0&&(i.form_id=r.form_id),r.template_id!==void 0&&(i.template_id=r.template_id),r.code_id!==void 0&&(i.code_id=r.code_id),r.metadata!==void 0&&(i.metadata=r.metadata===null?null:JSON.stringify(r.metadata)),(await e.update(dn).set(i).where(h(m(dn.tenant_id,t),m(dn.hook_id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=s?En(dn,s,[`url`,`form_id`,`template_id`,`code_id`]):void 0,l=c?h(m(dn.tenant_id,t),c):m(dn.tenant_id,t),u=e.select().from(dn).where(l).$dynamic(),d=o?.sort_by?dn[o.sort_by]:void 0;u=d?u.orderBy(o?.sort_order===`desc`?Be(d):ze(d)):u.orderBy(Be(dn.priority),ze(dn.created_at_ts));let f=(await u.offset(r*i).limit(i)).map(wb);if(!a)return{hooks:f};let[ee]=await e.select({count:Ve()}).from(dn).where(l);return{hooks:f,start:r*i,limit:i,length:Number(ee?.count??0)}},async remove(t,n){return(await e.delete(dn).where(h(m(dn.tenant_id,t),m(dn.hook_id,n))).returning()).length>0}}}function Eb(){let{customAlphabet:e}=(Hn(),s(Ln));return`inv_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}var Db=[`inviter`,`invitee`,`app_metadata`,`user_metadata`,`roles`];function Ob(e){let{tenant_id:t,send_invitation_email:n,...r}=e,i={...r};for(let e of Db)i[e]=j(r[e],e===`roles`?[]:{});return i.send_invitation_email=!!n,A(i)}function kb(e){return{async create(t,n){let r=n.id||Eb(),i=n.ttl_sec||604800,a=new Date,o=new Date(a.getTime()+i*1e3).toISOString(),s={id:r,tenant_id:t,organization_id:n.organization_id,client_id:n.client_id,connection_id:n.connection_id,invitation_url:n.invitation_url,ticket_id:n.ticket_id,ttl_sec:i,send_invitation_email:n.send_invitation_email===!1?0:1,created_at:a.toISOString(),expires_at:o};for(let e of Db)n[e]!==void 0&&(s[e]=JSON.stringify(n[e]));try{await e.insert(Zt).values(s)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`duplicate key`)?new Tn(409,{message:`Invite already exists`}):e}return Ob({...s,tenant_id:t})},async get(t,n){let r=await e.select().from(Zt).where(h(m(Zt.tenant_id,t),m(Zt.id,n))).get();return r?Ob(r):null},async update(t,n,r){let i={};for(let e of Db)r[e]!==void 0&&(i[e]=JSON.stringify(r[e]));return r.connection_id!==void 0&&(i.connection_id=r.connection_id),r.ttl_sec!==void 0&&(i.ttl_sec=r.ttl_sec,i.expires_at=new Date(Date.now()+r.ttl_sec*1e3).toISOString()),(await e.update(Zt).set(i).where(h(m(Zt.tenant_id,t),m(Zt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o}=n||{},s=e.select().from(Zt).where(m(Zt.tenant_id,t)).$dynamic();if(o?.sort_by){let e=Zt[o.sort_by];e&&(s=s.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(r*i).limit(i)).map(Ob);if(!a)return{invites:c};let[l]=await e.select({count:Ve()}).from(Zt).where(m(Zt.tenant_id,t));return{invites:c,start:r*i,limit:i,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(Zt).where(h(m(Zt.tenant_id,t),m(Zt.id,n))).returning()).length>0}}}function Ab(e){return{async create(t){await e.insert(pn).values({...t,created_at:new Date().toDateString()})},async list(t){let{page:n=0,per_page:r=50,include_totals:i=!1,sort:a}=t||{},o=new Date().toISOString(),s=e.select().from(pn).where(Ae(je(pn.revoked_at,o),Ie(pn.revoked_at))).$dynamic();if(a?.sort_by){let e=pn[a.sort_by];e&&(s=s.orderBy(a.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(n*r).limit(r)).map(e=>{let{created_at:t,...n}=e;return A(n)});if(!i)return{signingKeys:c};let[l]=await e.select({count:Ve()}).from(pn).where(Ae(je(pn.revoked_at,o),Ie(pn.revoked_at)));return{signingKeys:c,start:n*r,limit:r,length:Sn(l?.count??0)}},async update(t,n){return(await e.update(pn).set(n).where(m(pn.kid,t)).returning()).length>0}}}var jb=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,Mb=32;function Nb(){let e=Date.now(),t=``;for(let n=10;n>0;n--)t=jb.charAt(e%Mb)+t,e=Math.floor(e/Mb);let n=new Uint8Array(16);crypto.getRandomValues(n);for(let e=0;e<16;e++)t+=jb.charAt(n[e]%Mb);return t}function Pb(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,expires_at_ts:i,state_data:a,auth_params:o,...s}=e,c=_b({created_at_ts:n,updated_at_ts:r,expires_at_ts:i},[`created_at_ts`,`updated_at_ts`,`expires_at_ts`]),l={};for(let[e,t]of Object.entries(s))t!=null&&(l[e]=t);return A({...xn(l,[`auth_strategy`]),authParams:typeof o==`string`&&o.length>0?JSON.parse(o):{},...c,state_data:j(a)})}function Fb(e){return{async create(t,n){let r=Date.now(),i={id:Nb(),tenant_id:t,session_id:n.session_id,csrf_token:n.csrf_token,auth_params:JSON.stringify(n.authParams||{}),authorization_url:n.authorization_url?n.authorization_url.substring(0,1024):void 0,ip:n.ip,useragent:n.useragent,auth0Client:n.auth0Client,state:n.state||`pending`,state_data:n.state_data?JSON.stringify(n.state_data):void 0,failure_reason:n.failure_reason,user_id:n.user_id,auth_connection:n.auth_connection,auth_strategy_strategy:n.auth_strategy?.strategy,auth_strategy_strategy_type:n.auth_strategy?.strategy_type,authenticated_at:n.authenticated_at,created_at_ts:r,updated_at_ts:r,expires_at_ts:n.expires_at?gb(n.expires_at):r+1e3*60*60*24};return await e.insert(C).values(i),Pb({...i,tenant_id:t})},async get(t,n){let r=t?h(m(C.tenant_id,t),m(C.id,n)):m(C.id,n),i=await e.select().from(C).where(r).get();return i?Pb(i):null},async update(t,n,r){let i={updated_at_ts:Date.now()};if(r.session_id!==void 0&&(i.session_id=r.session_id),r.state!==void 0&&(i.state=r.state),r.state_data!==void 0&&(i.state_data=JSON.stringify(r.state_data)),r.failure_reason!==void 0&&(i.failure_reason=r.failure_reason),r.user_id!==void 0&&(i.user_id=r.user_id),r.auth_connection!==void 0&&(i.auth_connection=r.auth_connection),r.auth_strategy!==void 0&&(i.auth_strategy_strategy=r.auth_strategy?.strategy,i.auth_strategy_strategy_type=r.auth_strategy?.strategy_type),r.authenticated_at!==void 0&&(i.authenticated_at=r.authenticated_at),r.authorization_url!==void 0&&(i.authorization_url=r.authorization_url?.substring(0,1024)),r.expires_at!==void 0&&(i.expires_at_ts=gb(r.expires_at)),r.authParams!==void 0){let a=await e.select({auth_params:C.auth_params}).from(C).where(h(m(C.tenant_id,t),m(C.id,n))).get(),o=a?.auth_params&&typeof a.auth_params==`string`&&a.auth_params.length>0?JSON.parse(a.auth_params):{};i.auth_params=JSON.stringify({...o,...r.authParams})}return await e.update(C).set(i).where(h(m(C.tenant_id,t),m(C.id,n))),!0},async remove(t,n){return(await e.delete(C).where(h(m(C.tenant_id,t),m(C.id,n))).returning()).length>0}}}Hn();function Ib(e){let{tenant_id:t,isMobile:n,auth0_client:r,details:i,country_code:a,city_name:o,latitude:s,longitude:c,time_zone:l,continent_code:u,scope:d,...f}=e,ee={...f,isMobile:!!n,auth0_client:j(r),details:j(i),scope:d?d.split(`,`):void 0};return a&&(ee.location_info=A({country_code:a,city_name:o,latitude:s,longitude:c,time_zone:l,continent_code:u})),A(ee)}function Lb(e){return{async create(t,n){let r={log_id:n.log_id||Vn(),tenant_id:t,type:n.type,date:n.date||new Date().toISOString(),category:n.category,user_id:n.user_id,ip:n.ip,client_id:n.client_id,client_name:n.client_name,user_agent:n.user_agent?.substring(0,256),description:n.description?.substring(0,256),isMobile:+!!n.isMobile,user_name:n.user_name,connection:n.connection,connection_id:n.connection_id,audience:n.audience,scope:Array.isArray(n.scope)?n.scope.join(`,`):n.scope,strategy:n.strategy,strategy_type:n.strategy_type,hostname:n.hostname,session_connection:n.session_connection};return n.auth0_client&&(r.auth0_client=JSON.stringify(n.auth0_client)),n.details&&(r.details=JSON.stringify(n.details).substring(0,8192)),n.location_info&&(r.country_code=n.location_info.country_code,r.city_name=n.location_info.city_name,r.latitude=n.location_info.latitude,r.longitude=n.location_info.longitude,r.time_zone=n.location_info.time_zone,r.continent_code=n.location_info.continent_code),await e.insert(D).values(r),Ib({...r,tenant_id:t})},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s,from_date:c,to_date:l}=n||{},u=[m(D.tenant_id,t)];if(s){let e=En(D,s,[`user_id`,`ip`,`type`,`client_id`]);e&&u.push(e)}typeof c==`number`&&Number.isFinite(c)&&u.push(Me(D.date,new Date(Math.floor(c)*1e3).toISOString())),typeof l==`number`&&Number.isFinite(l)&&u.push(Ne(D.date,new Date((Math.floor(l)+1)*1e3).toISOString()));let d=h(...u),f=e.select().from(D).where(d).$dynamic();if(o?.sort_by){let e=D[o.sort_by];e&&(f=f.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}else f=f.orderBy(Be(D.date));let ee=(await f.offset(r*i).limit(i)).map(Ib);if(!a)return{logs:ee};let[te]=await e.select({count:Ve()}).from(D).where(d);return{logs:ee,start:r*i,limit:i,length:Number(te?.count??0)}},async get(t,n){let r=await e.select().from(D).where(h(m(D.tenant_id,t),m(D.log_id,n))).get();return r?Ib(r):null}}}var Rb=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,zb=32;function Bb(){let e=Date.now(),t=``;for(let n=10;n>0;n--)t=Rb.charAt(e%zb)+t,e=Math.floor(e/zb);let n=new Uint8Array(16);crypto.getRandomValues(n);for(let e=0;e<16;e++)t+=Rb.charAt(n[e]%zb);return t}function Vb(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,credential_backed_up:i,confirmed:a,transports:o,...s}=e;return A({...s,confirmed:!!a,credential_backed_up:i==null?void 0:!!i,transports:j(o),created_at:hb(n),updated_at:hb(r)})}function Hb(e){return{async create(t,n){let r=Date.now(),i={id:n.id||Bb(),tenant_id:t,user_id:n.user_id,type:n.type,phone_number:n.phone_number,totp_secret:n.totp_secret,credential_id:n.credential_id,public_key:n.public_key,sign_count:n.sign_count,credential_backed_up:n.credential_backed_up==null?null:+!!n.credential_backed_up,transports:n.transports?JSON.stringify(n.transports):null,friendly_name:n.friendly_name,confirmed:+!!n.confirmed,created_at_ts:r,updated_at_ts:r};return await e.insert(hn).values(i),Vb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(hn).where(h(m(hn.tenant_id,t),m(hn.id,n))).get();return r?Vb(r):null},async getByCredentialId(t,n){let r=await e.select().from(hn).where(h(m(hn.tenant_id,t),m(hn.credential_id,n))).get();return r?Vb(r):null},async list(t,n){return(await e.select().from(hn).where(h(m(hn.tenant_id,t),m(hn.user_id,n))).all()).map(Vb)},async update(t,n,r){let i={updated_at_ts:Date.now()};r.type!==void 0&&(i.type=r.type),r.phone_number!==void 0&&(i.phone_number=r.phone_number),r.totp_secret!==void 0&&(i.totp_secret=r.totp_secret),r.credential_id!==void 0&&(i.credential_id=r.credential_id),r.public_key!==void 0&&(i.public_key=r.public_key),r.sign_count!==void 0&&(i.sign_count=r.sign_count),r.credential_backed_up!==void 0&&(i.credential_backed_up=+!!r.credential_backed_up),r.transports!==void 0&&(i.transports=JSON.stringify(r.transports)),r.friendly_name!==void 0&&(i.friendly_name=r.friendly_name),r.confirmed!==void 0&&(i.confirmed=+!!r.confirmed),await e.update(hn).set(i).where(h(m(hn.tenant_id,t),m(hn.id,n)));let a=await this.get(t,n);if(!a)throw Error(`Authentication method ${n} not found after update`);return a},async remove(t,n){return(await e.delete(hn).where(h(m(hn.tenant_id,t),m(hn.id,n))).returning()).length>0}}}function Ub(){let{customAlphabet:e}=(Hn(),s(Ln));return`org_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}function Wb(e){let{tenant_id:t,branding:n,metadata:r,enabled_connections:i,token_quota:a,...o}=e;return A({...o,branding:j(n,{}),metadata:j(r,{}),enabled_connections:j(i,[]),token_quota:j(a,{})})}function Gb(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||Ub(),tenant_id:t,name:n.name,display_name:n.display_name,branding:JSON.stringify(n.branding||{}),metadata:JSON.stringify(n.metadata||{}),enabled_connections:JSON.stringify(n.enabled_connections||[]),token_quota:JSON.stringify(n.token_quota||{}),created_at:r,updated_at:r};try{await e.insert(Yt).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`AlreadyExists`)?new Tn(409,{message:`Organization already exists`}):e}return Wb({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(Yt).where(h(m(Yt.tenant_id,t),m(Yt.id,n))).get();return r||=await e.select().from(Yt).where(h(m(Yt.tenant_id,t),m(Yt.name,n))).get(),r?Wb(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.display_name!==void 0&&(i.display_name=r.display_name),r.branding!==void 0&&(i.branding=JSON.stringify(r.branding)),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),r.enabled_connections!==void 0&&(i.enabled_connections=JSON.stringify(r.enabled_connections)),r.token_quota!==void 0&&(i.token_quota=JSON.stringify(r.token_quota)),(await e.update(Yt).set(i).where(h(m(Yt.tenant_id,t),m(Yt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=e.select().from(Yt).where(m(Yt.tenant_id,t)).$dynamic();if(s&&(c=c.where(Ae(Re(Yt.name,`%${s}%`),Re(Yt.display_name,`%${s}%`)))),o?.sort_by){let e=Yt[o.sort_by];e&&(c=c.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let l=(await c.offset(r*i).limit(i)).map(Wb);if(!a)return{organizations:l};let u=[m(Yt.tenant_id,t)];s&&u.push(Ae(Re(Yt.name,`%${s}%`),Re(Yt.display_name,`%${s}%`)));let[d]=await e.select({count:Ve()}).from(Yt).where(h(...u));return{organizations:l,start:r*i,limit:i,length:Number(d?.count??0)}},async remove(t,n){return(await e.delete(Yt).where(h(m(Yt.tenant_id,t),m(Yt.id,n))).returning()).length>0}}}Hn();function Kb(e){let{tenant_id:t,is_current:n,...r}=e;return{...r,is_current:!!n}}function qb(e){return{async create(t,n){let r=new Date().toISOString(),i=n.id||Vn();n.is_current!==!1&&await e.update(zt).set({is_current:0}).where(h(m(zt.tenant_id,t),m(zt.user_id,n.user_id)));let a={id:i,tenant_id:t,user_id:n.user_id,password:n.password,algorithm:n.algorithm||`bcrypt`,is_current:n.is_current===!1?0:1,created_at:r,updated_at:r};return await e.insert(zt).values(a),Kb({...a,tenant_id:t})},async get(t,n){let r=await e.select().from(zt).where(h(m(zt.tenant_id,t),m(zt.user_id,n),m(zt.is_current,1))).get();return r?Kb(r):null},async list(t,n,r){let i=e.select().from(zt).where(h(m(zt.tenant_id,t),m(zt.user_id,n))).orderBy(Be(zt.created_at)).$dynamic();return r&&(i=i.limit(r)),(await i).map(Kb)},async update(t,n){let r={updated_at:new Date().toISOString()};return n.password!==void 0&&(r.password=n.password),n.algorithm!==void 0&&(r.algorithm=n.algorithm),n.is_current!==void 0&&(r.is_current=+!!n.is_current),n.id?await e.update(zt).set(r).where(h(m(zt.tenant_id,t),m(zt.id,n.id))):await e.update(zt).set(r).where(h(m(zt.tenant_id,t),m(zt.user_id,n.user_id),m(zt.is_current,1))),!0}}}function Jb(e){return{async get(t){let n=await e.select().from(cn).where(m(cn.tenant_id,t)).get();return n?{universal_login_experience:n.universal_login_experience,identifier_first:!!n.identifier_first,password_first:!!n.password_first,webauthn_platform_first_factor:!!n.webauthn_platform_first_factor}:{universal_login_experience:`new`,identifier_first:!0,password_first:!1,webauthn_platform_first_factor:!1}},async set(t,n){await e.insert(cn).values({tenant_id:t,universal_login_experience:n.universal_login_experience,identifier_first:n.identifier_first,password_first:n.password_first,webauthn_platform_first_factor:n.webauthn_platform_first_factor}).onConflictDoUpdate({target:cn.tenant_id,set:{universal_login_experience:n.universal_login_experience,identifier_first:n.identifier_first,password_first:n.password_first,webauthn_platform_first_factor:n.webauthn_platform_first_factor}})}}}Hn();function Yb(e){if(!e)return{path:`/*`};try{let t=JSON.parse(e),n=Ny.safeParse(t);if(n.success)return n.data}catch{}return{path:`/*`}}function Xb(e){if(!e)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=Py.safeParse(e);t.success&&n.push(t.data)}return n}catch{return[]}}function Zb(e){return{id:e.id,tenant_id:e.tenant_id,custom_domain_id:e.custom_domain_id,priority:e.priority,match:Yb(e.match),handlers:Xb(e.handlers),created_at:e.created_at,updated_at:e.updated_at}}function Qb(e){return{async create(t,n){let r=new Date().toISOString(),i={id:Vn(),tenant_id:t,custom_domain_id:n.custom_domain_id,priority:n.priority,match:n.match,handlers:n.handlers,created_at:r,updated_at:r};return await e.insert(k).values({id:i.id,tenant_id:i.tenant_id,custom_domain_id:i.custom_domain_id,priority:i.priority,match:JSON.stringify(i.match),handlers:JSON.stringify(i.handlers),created_at:i.created_at,updated_at:i.updated_at}),i},async get(t,n){let r=await e.select().from(k).where(h(m(k.tenant_id,t),m(k.id,n))).limit(1);return r[0]?Zb(r[0]):null},async list(t,n={}){let r=n.page??0,i=n.per_page??50,a=[m(k.tenant_id,t)];n.custom_domain_id&&a.push(m(k.custom_domain_id,n.custom_domain_id));let o=await e.select().from(k).where(h(...a)).orderBy(ze(k.priority),ze(k.created_at)).offset(r*i).limit(i);return{proxy_routes:o.map(Zb),start:r*i,limit:i,length:o.length}},async update(t,n,r){let i={updated_at:new Date().toISOString()};r.priority!==void 0&&(i.priority=r.priority),r.match!==void 0&&(i.match=JSON.stringify(r.match)),r.handlers!==void 0&&(i.handlers=JSON.stringify(r.handlers));let a=(await e.update(k).set(i).where(h(m(k.tenant_id,t),m(k.id,n))))?.changes;return typeof a==`number`?a>0:(await e.select({id:k.id}).from(k).where(h(m(k.tenant_id,t),m(k.id,n))).limit(1)).length>0},async remove(t,n){return(await e.select({id:k.id}).from(k).where(h(m(k.tenant_id,t),m(k.id,n))).limit(1)).length===0?!1:(await e.delete(k).where(h(m(k.tenant_id,t),m(k.id,n))),!0)}}}Hn();function $b(e){let{tenant_id:t,created_at_ts:n,expires_at_ts:r,idle_expires_at_ts:i,last_exchanged_at_ts:a,revoked_at_ts:o,rotated_at_ts:s,device:c,resource_servers:l,rotating:u,...d}=e,f=_b({created_at_ts:n,expires_at_ts:r,idle_expires_at_ts:i,last_exchanged_at_ts:a,revoked_at_ts:o,rotated_at_ts:s},[`created_at_ts`],[`expires_at_ts`,`idle_expires_at_ts`,`last_exchanged_at_ts`,`revoked_at_ts`,`rotated_at_ts`]);return A({...d,...f,rotating:!!u,device:j(c,{}),resource_servers:j(l,[])})}function ex(e,t){return Math.max(e??0,t??0)}function tx(e){return{async create(t,n){let r=Date.now(),i={id:n.id||Vn(),tenant_id:t,client_id:n.client_id,login_id:n.login_id,user_id:n.user_id,device:JSON.stringify(n.device||{}),resource_servers:JSON.stringify(n.resource_servers||[]),rotating:n.rotating??!1,token_lookup:n.token_lookup??null,token_hash:n.token_hash??null,family_id:n.family_id??null,rotated_to:n.rotated_to??null,rotated_at_ts:gb(n.rotated_at),created_at_ts:r,expires_at_ts:gb(n.expires_at),idle_expires_at_ts:gb(n.idle_expires_at),last_exchanged_at_ts:gb(n.last_exchanged_at)};await e.run(p`BEGIN`);try{await e.insert(S).values(i);let n=ex(i.expires_at_ts,i.idle_expires_at_ts);n>0&&i.login_id&&await e.update(C).set({expires_at_ts:n,updated_at_ts:r}).where(h(m(C.tenant_id,t),m(C.id,i.login_id),Ne(C.expires_at_ts,n))),await e.run(p`COMMIT`)}catch(t){throw await e.run(p`ROLLBACK`),t}return $b({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(S).where(h(m(S.tenant_id,t),m(S.id,n))).get();return r?$b(r):null},async getByLookup(t,n){let r=await e.select().from(S).where(h(m(S.tenant_id,t),m(S.token_lookup,n))).get();return r?$b(r):null},async update(t,n,r,i){let a={};r.device!==void 0&&(a.device=JSON.stringify(r.device)),r.resource_servers!==void 0&&(a.resource_servers=JSON.stringify(r.resource_servers)),r.rotating!==void 0&&(a.rotating=r.rotating),r.token_lookup!==void 0&&(a.token_lookup=r.token_lookup),r.token_hash!==void 0&&(a.token_hash=r.token_hash),r.family_id!==void 0&&(a.family_id=r.family_id),r.rotated_to!==void 0&&(a.rotated_to=r.rotated_to),r.rotated_at!==void 0&&(a.rotated_at_ts=gb(r.rotated_at)),r.expires_at!==void 0&&(a.expires_at_ts=gb(r.expires_at)),r.idle_expires_at!==void 0&&(a.idle_expires_at_ts=gb(r.idle_expires_at)),r.last_exchanged_at!==void 0&&(a.last_exchanged_at_ts=gb(r.last_exchanged_at)),r.revoked_at!==void 0&&(a.revoked_at_ts=gb(r.revoked_at));let o=i?.loginSessionBump,s=o?gb(o.expires_at):null,c=await e.update(S).set(a).where(h(m(S.tenant_id,t),m(S.id,n))).returning();return o?.login_id&&s&&s>0&&await e.update(C).set({expires_at_ts:s,updated_at_ts:Date.now()}).where(h(m(C.tenant_id,t),m(C.id,o.login_id),Ne(C.expires_at_ts,s))).catch(()=>{}),c.length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=e.select().from(S).where(m(S.tenant_id,t)).$dynamic();if(s){let e=En(S,s,[`user_id`]);e&&(c=c.where(h(m(S.tenant_id,t),e)))}if(o?.sort_by){let e=S[o.sort_by];e&&(c=c.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let l=(await c.offset(r*i).limit(i)).map($b);if(!a)return{refresh_tokens:l};let[u]=await e.select({count:Ve()}).from(S).where(m(S.tenant_id,t));return{refresh_tokens:l,start:r*i,limit:i,length:Number(u?.count??0)}},async remove(t,n){return(await e.delete(S).where(h(m(S.tenant_id,t),m(S.id,n))).returning()).length>0},async revokeByLoginSession(t,n,r){return(await e.update(S).set({revoked_at_ts:gb(r)}).where(h(m(S.tenant_id,t),m(S.login_id,n),Ie(S.revoked_at_ts))).returning()).length},async revokeFamily(t,n,r){return(await e.update(S).set({revoked_at_ts:gb(r)}).where(h(m(S.tenant_id,t),m(S.family_id,n),Ie(S.revoked_at_ts))).returning()).length}}}function nx(){let{customAlphabet:e}=(Hn(),s(Ln));return`api_${e(`0123456789abcdefghijklmnopqrstuvwxyz`,17)()}`}var rx=[`skip_consent_for_verifiable_first_party_clients`,`allow_offline_access`,`is_system`],ix=new Set([`id`,`tenant_id`,`identifier`,`name`,`scopes`,`signing_alg`,`signing_secret`,`token_lifetime`,`token_lifetime_for_web`,`skip_consent_for_verifiable_first_party_clients`,`allow_offline_access`,`verification_key`,`options`,`is_system`,`metadata`,`created_at`,`updated_at`]);function ax(e){let{tenant_id:t,verification_key:n,scopes:r,options:i,metadata:a,...o}=e,s={...o};s.scopes=j(r,[]),s.options=j(i,{}),s.metadata=j(a),n!==void 0&&(s.verificationKey=n);for(let e of rx)o[e]!==void 0&&o[e]!==null&&(s[e]=!!o[e]);return A(s)}function ox(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||nx(),tenant_id:t,identifier:n.identifier,name:n.name,signing_alg:n.signing_alg,signing_secret:n.signing_secret,token_lifetime:n.token_lifetime,token_lifetime_for_web:n.token_lifetime_for_web,scopes:JSON.stringify(n.scopes||[]),options:JSON.stringify(n.options||{}),metadata:n.metadata?JSON.stringify(n.metadata):void 0,verification_key:n.verificationKey||n.verification_key,created_at:r,updated_at:r};for(let e of rx)n[e]!==void 0&&(i[e]=+!!n[e]);return i.is_system===void 0&&(i.is_system=0),await e.insert(E).values(i),ax({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(E).where(h(m(E.tenant_id,t),m(E.id,n))).get();return r?ax(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};r.name!==void 0&&(i.name=r.name),r.identifier!==void 0&&(i.identifier=r.identifier),r.signing_alg!==void 0&&(i.signing_alg=r.signing_alg),r.signing_secret!==void 0&&(i.signing_secret=r.signing_secret),r.token_lifetime!==void 0&&(i.token_lifetime=r.token_lifetime),r.token_lifetime_for_web!==void 0&&(i.token_lifetime_for_web=r.token_lifetime_for_web),r.scopes!==void 0&&(i.scopes=JSON.stringify(r.scopes)),r.options!==void 0&&(i.options=p`json_patch(COALESCE(${E.options}, '{}'), ${JSON.stringify(r.options)})`),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),r.verificationKey!==void 0&&(i.verification_key=r.verificationKey);for(let e of rx)r[e]!==void 0&&(i[e]=+!!r[e]);return(await e.update(E).set(i).where(h(m(E.tenant_id,t),m(E.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=Math.max(0,Math.floor(Number(r)||0)),l=Math.min(Math.max(1,Math.floor(Number(i)||50)),500),u=[m(E.tenant_id,t)];if(s){let e=s.match(/^([^:]+):(.+)$/);if(e){let[,t,n]=e,r=t?.startsWith(`-`),i=r?t?.substring(1):t;if(i&&ix.has(i)&&!r){let e=E[i];u.push(Re(e,`%${n}%`))}}}let d=e.select().from(E).where(h(...u)).$dynamic();if(o?.sort_by&&ix.has(o.sort_by)){let e=E[o.sort_by];d=d.orderBy(o.sort_order===`desc`?Be(e):ze(e))}let f=(await d.offset(c*l).limit(l)).map(ax);if(!a)return{resource_servers:f};let[ee]=await e.select({count:Ve()}).from(E).where(h(...u));return{resource_servers:f,start:c*l,limit:l,length:Number(ee?.count??0)}},async remove(t,n){return(await e.delete(E).where(h(m(E.tenant_id,t),m(E.id,n))).returning()).length>0}}}function sx(e){return{async assign(t,n,r){let i=new Date().toISOString();return await e.insert($t).values(r.map(e=>({tenant_id:t,role_id:n,resource_server_identifier:e.resource_server_identifier,permission_name:e.permission_name,created_at:i}))).onConflictDoNothing(),!0},async list(t,n,r){let i=await e.select({resource_server_identifier:$t.resource_server_identifier,permission_name:$t.permission_name,created_at:$t.created_at}).from($t).where(h(m($t.tenant_id,t),m($t.role_id,n))).all(),a=[...new Set(i.map(e=>e.resource_server_identifier))],o=new Map;if(a.length>0){let n=await e.select({identifier:E.identifier,name:E.name}).from(E).where(h(m(E.tenant_id,t),Fe(E.identifier,a))).all();for(let e of n)o.set(e.identifier,e.name)}return i.map(e=>({...e,resource_server_name:o.get(e.resource_server_identifier)||e.resource_server_identifier}))},async remove(t,n,r){let i=r.map(e=>h(m($t.resource_server_identifier,e.resource_server_identifier),m($t.permission_name,e.permission_name)));return(await e.delete($t).where(h(m($t.tenant_id,t),m($t.role_id,n),Ae(...i))).returning()).length>0}}}function cx(e){return{async create(t,n,r,i){try{await e.insert(en).values({tenant_id:t,user_id:n,resource_server_identifier:r.resource_server_identifier,permission_name:r.permission_name,organization_id:i||``,created_at:new Date().toISOString()})}catch(e){if(e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`SQLITE_CONSTRAINT_PRIMARYKEY`))return!0;throw e}return!0},async list(t,n,r,i){let a=[m(en.tenant_id,t),m(en.user_id,n)];i&&a.push(m(en.organization_id,i));let o=await e.select().from(en).where(h(...a)).all();return await Promise.all(o.map(async n=>{let r=await e.select({name:E.name}).from(E).where(h(m(E.tenant_id,t),m(E.identifier,n.resource_server_identifier))).get();return{resource_server_identifier:n.resource_server_identifier,permission_name:n.permission_name,resource_server_name:r?.name||n.resource_server_identifier,organization_id:n.organization_id===``?void 0:n.organization_id}}))},async remove(t,n,r,i){return(await e.delete(en).where(h(m(en.tenant_id,t),m(en.user_id,n),m(en.resource_server_identifier,r.resource_server_identifier),m(en.permission_name,r.permission_name),m(en.organization_id,i||``))).returning()).length>0}}}Hn();function lx(e){let{tenant_id:t,is_system:n,metadata:r,...i}=e;return A({...i,is_system:n?!0:void 0,metadata:j(r)})}function ux(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||Vn(),tenant_id:t,name:n.name,description:n.description,is_system:+!!n.is_system,metadata:n.metadata?JSON.stringify(n.metadata):void 0,created_at:r,updated_at:r};return await e.insert(Qt).values(i),lx({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(Qt).where(h(m(Qt.tenant_id,t),m(Qt.id,n))).get();return r?lx(r):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.name!==void 0&&(i.name=r.name),r.description!==void 0&&(i.description=r.description),r.is_system!==void 0&&(i.is_system=+!!r.is_system),r.metadata!==void 0&&(i.metadata=JSON.stringify(r.metadata)),(await e.update(Qt).set(i).where(h(m(Qt.tenant_id,t),m(Qt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=s?En(Qt,s,[`name`]):void 0,l=c?h(m(Qt.tenant_id,t),c):m(Qt.tenant_id,t),u=e.select().from(Qt).where(l).$dynamic();if(o?.sort_by){let e=Qt[o.sort_by];e&&(u=u.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let d=(await u.offset(r*i).limit(i)).map(lx);if(!a)return{roles:d};let[f]=await e.select({count:Ve()}).from(Qt).where(l);return{roles:d,start:r*i,limit:i,length:Number(f?.count??0)}},async remove(t,n){return(await e.delete(Qt).where(h(m(Qt.tenant_id,t),m(Qt.id,n))).returning()).length>0}}}Hn();var dx=[`created_at_ts`,`updated_at_ts`],fx=[`expires_at_ts`,`idle_expires_at_ts`,`authenticated_at_ts`,`last_interaction_at_ts`,`used_at_ts`,`revoked_at_ts`];function px(e){let{tenant_id:t,created_at_ts:n,updated_at_ts:r,expires_at_ts:i,idle_expires_at_ts:a,authenticated_at_ts:o,last_interaction_at_ts:s,used_at_ts:c,revoked_at_ts:l,device:u,clients:d,...f}=e,ee=_b({created_at_ts:n,updated_at_ts:r,expires_at_ts:i,idle_expires_at_ts:a,authenticated_at_ts:o,last_interaction_at_ts:s,used_at_ts:c,revoked_at_ts:l},[...dx],[...fx]);return A({...f,...ee,device:j(u,{}),clients:j(d,[])})}function mx(e){return{async create(t,n){let r=Date.now(),i={id:n.id||Vn(),tenant_id:t,user_id:n.user_id,login_session_id:n.login_session_id,device:JSON.stringify(n.device||{}),clients:JSON.stringify(n.clients||[]),created_at_ts:r,updated_at_ts:r,expires_at_ts:gb(n.expires_at),idle_expires_at_ts:gb(n.idle_expires_at),authenticated_at_ts:n.authenticated_at?gb(n.authenticated_at):r,last_interaction_at_ts:n.last_interaction_at?gb(n.last_interaction_at):r,used_at_ts:gb(n.used_at),revoked_at_ts:gb(n.revoked_at)};return await e.insert(Bt).values(i),px({...i,tenant_id:t})},async get(t,n){let r=await e.select().from(Bt).where(h(m(Bt.tenant_id,t),m(Bt.id,n))).get();return r?px(r):null},async update(t,n,r){let i={updated_at_ts:Date.now()};return r.user_id!==void 0&&(i.user_id=r.user_id),r.login_session_id!==void 0&&(i.login_session_id=r.login_session_id),r.device!==void 0&&(i.device=JSON.stringify(r.device)),r.clients!==void 0&&(i.clients=JSON.stringify(r.clients)),r.expires_at!==void 0&&(i.expires_at_ts=gb(r.expires_at)),r.idle_expires_at!==void 0&&(i.idle_expires_at_ts=gb(r.idle_expires_at)),r.authenticated_at!==void 0&&(i.authenticated_at_ts=gb(r.authenticated_at)),r.last_interaction_at!==void 0&&(i.last_interaction_at_ts=gb(r.last_interaction_at)),r.used_at!==void 0&&(i.used_at_ts=gb(r.used_at)),r.revoked_at!==void 0&&(i.revoked_at_ts=gb(r.revoked_at)),(await e.update(Bt).set(i).where(h(m(Bt.tenant_id,t),m(Bt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=s?En(Bt,s,[`user_id`]):void 0,l=c?h(m(Bt.tenant_id,t),c):m(Bt.tenant_id,t),u=e.select().from(Bt).where(l).$dynamic();if(o?.sort_by){let e=Bt[o.sort_by];e&&(u=u.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let d=(await u.offset(r*i).limit(i)).map(px);if(!a)return{sessions:d};let[f]=await e.select({count:Ve()}).from(Bt).where(l);return{sessions:d,start:r*i,limit:i,length:Number(f?.count??0)}},async remove(t,n){return(await e.delete(Bt).where(h(m(Bt.tenant_id,t),m(Bt.id,n))).returning()).length>0}}}Hn();var hx=[`session_cookie`,`enabled_locales`,`error_page`,`flags`,`sandbox_versions_available`,`change_password`,`guardian_mfa_page`,`sessions`,`oidc_logout`,`device_flow`,`default_token_quota`,`allowed_logout_urls`,`acr_values_supported`,`mtls`,`mfa`],gx=[`allow_organization_name_in_authentication_api`,`customize_mfa_in_postlogin_action`,`pushed_authorization_requests_supported`,`authorization_response_iss_parameter_supported`];function _x(e){let t={...e};for(let e of hx)typeof t[e]==`string`&&(t[e]=j(t[e]));for(let e of gx)t[e]!==void 0&&t[e]!==null&&(t[e]=t[e]===1);return A(t)}function vx(e){let t={...e};_n(e,hx,t);for(let n of gx)e[n]!==void 0&&(t[n]=+!!e[n]);return yn(t)}function yx(e){return{async create(t){let n={id:t.id||Vn(),created_at:new Date().toISOString(),updated_at:new Date().toISOString(),...t},r=vx(n);try{await e.insert(b).values(r)}catch(e){throw e?.message?.includes(`UNIQUE constraint failed`)||e?.message?.includes(`duplicate key`)||e?.code===`SQLITE_CONSTRAINT`?new Tn(409,{message:`Tenant with ID '${n.id}' already exists`}):e}return n},async get(t){let n=await e.select().from(b).where(m(b.id,t)).get();return n?_x(n):null},async list(t){let{page:n=0,per_page:r=50,include_totals:i=!1,sort:a,q:o}=t||{},s=e.select().from(b).$dynamic();if(o){let e=En(b,o,[`friendly_name`]);e&&(s=s.where(e))}if(a?.sort_by){let e=b[a.sort_by];e&&(s=s.orderBy(a.sort_order===`desc`?Be(e):ze(e)))}let c=(await s.offset(n*r).limit(r)).map(_x);if(!i)return{tenants:c};let[l]=await e.select({count:Ve()}).from(b);return{tenants:c,start:n*r,limit:r,length:Number(l?.count??0)}},async update(t,n){let r=vx({...n,id:t,updated_at:new Date().toISOString()});await e.update(b).set(r).where(m(b.id,t))},async remove(t){return(await e.delete(b).where(m(b.id,t)).returning()).length>0}}}Hn();var bx=[`colors`,`borders`,`fonts`,`page_background`,`widget`];function xx(e){let{tenant_id:t,...n}=e,r=xn(n,bx);return r.borders&&(r.borders.show_widget_shadow=!!r.borders.show_widget_shadow),r.fonts&&(r.fonts.links_bold=!!r.fonts.links_bold,r.fonts.subtitle_bold=!!r.fonts.subtitle_bold,r.fonts.title_bold=!!r.fonts.title_bold),A(r)}function Sx(e){return{async create(t,n,r){let i=new Date().toISOString(),a=r||Vn(),o={...bn(n),tenant_id:t,themeId:a,created_at:i,updated_at:i};return await e.insert(an).values(o),xx({...o,tenant_id:t})},async get(t,n){let r=await e.select().from(an).where(h(m(an.tenant_id,t),m(an.themeId,n))).get();return r?xx(r):null},async update(t,n,r){let i=bn(r);return i.updated_at=new Date().toISOString(),await e.update(an).set(i).where(h(m(an.tenant_id,t),m(an.themeId,n))),!0},async remove(t,n){return(await e.delete(an).where(h(m(an.tenant_id,t),m(an.themeId,n))).returning()).length>0}}}function Cx(e){return{async get(t){let n=await e.select({body:rn.body}).from(rn).where(m(rn.tenant_id,t)).get();return n?{body:n.body}:null},async set(t,n){let r=Date.now();await e.insert(rn).values({tenant_id:t,body:n.body,created_at_ts:r,updated_at_ts:r}).onConflictDoUpdate({target:rn.tenant_id,set:{body:n.body,updated_at_ts:r}})},async delete(t){await e.delete(rn).where(m(rn.tenant_id,t))}}}Hn();function wx(e,t){let n={connection:e.connection,provider:e.provider,user_id:e.user_id,isSocial:!!e.is_social};return t?n.isPrimary=!0:n.profileData={email:e.email,email_verified:!!e.email_verified,...typeof e.profileData==`string`?j(e.profileData,{}):{}},n}function Tx(e,t=[]){let{tenant_id:n,app_metadata:r,user_metadata:i,address:a,email_verified:o,phone_verified:s,is_social:c,linked_to:l,profileData:u,...d}=e,f=wx(e,!0),ee=t.map(e=>wx(e,!1));return A({...d,email:e.email||``,email_verified:!!o,phone_verified:s==null?void 0:!!s,is_social:!!c,app_metadata:j(r,{}),user_metadata:j(i,{}),address:j(a),identities:[f,...ee]})}function Ex(e){let t=async(t,n)=>{let r=new Date().toISOString(),i={user_id:n.user_id,tenant_id:t,email:n.email,given_name:n.given_name,family_name:n.family_name,nickname:n.nickname,name:n.name,picture:n.picture,tags:n.tags,phone_number:n.phone_number,phone_verified:n.phone_verified??!1,username:n.username,linked_to:n.linked_to,last_ip:n.last_ip,login_count:n.login_count??0,last_login:n.last_login,provider:n.provider,connection:n.connection,email_verified:n.email_verified??!1,is_social:n.is_social??!1,app_metadata:JSON.stringify(n.app_metadata||{}),user_metadata:JSON.stringify(n.user_metadata||{}),address:n.address?JSON.stringify(n.address):void 0,profileData:n.profileData?JSON.stringify(n.profileData):void 0,locale:n.locale,middle_name:n.middle_name,preferred_username:n.preferred_username,profile:n.profile,website:n.website,gender:n.gender,birthdate:n.birthdate,zoneinfo:n.zoneinfo,created_at:n.created_at||r,updated_at:n.updated_at||r},a=n.password?Vn():void 0;try{if(n.password&&a){await e.run(p`BEGIN`);try{await e.insert(x).values(i),await e.insert(zt).values({id:a,tenant_id:t,user_id:n.user_id,password:n.password.hash||n.password,algorithm:n.password.algorithm||`bcrypt`,is_current:1,created_at:r,updated_at:r}),await e.run(p`COMMIT`)}catch(t){throw await e.run(p`ROLLBACK`),t}}else await e.insert(x).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`AlreadyExists`)?new Tn(409,{message:`User already exists`}):(console.error(`User upsert failed:`,e?.code,e?.message),new Tn(500,{message:`Internal server error`}))}return Tx(i)};return{create:t,rawCreate:t,async get(t,n){let r=await e.select().from(x).where(h(m(x.tenant_id,t),m(x.user_id,n))).get();return r?Tx(r,await e.select().from(x).where(h(m(x.tenant_id,t),m(x.linked_to,n))).all()):null},async update(t,n,r){let i={updated_at:new Date().toISOString()};for(let e of[`email`,`given_name`,`family_name`,`nickname`,`name`,`picture`,`tags`,`phone_number`,`username`,`linked_to`,`last_ip`,`login_count`,`last_login`,`provider`,`connection`,`locale`,`middle_name`,`preferred_username`,`profile`,`website`,`gender`,`birthdate`,`zoneinfo`])r[e]!==void 0&&(i[e]=r[e]);return r.email_verified!==void 0&&(i.email_verified=r.email_verified),r.phone_verified!==void 0&&(i.phone_verified=r.phone_verified),r.is_social!==void 0&&(i.is_social=r.is_social),r.app_metadata!==void 0&&(i.app_metadata=JSON.stringify(r.app_metadata)),r.user_metadata!==void 0&&(i.user_metadata=JSON.stringify(r.user_metadata)),r.address!==void 0&&(i.address=JSON.stringify(r.address)),r.profileData!==void 0&&(i.profileData=JSON.stringify(r.profileData)),(await e.update(x).set(i).where(h(m(x.tenant_id,t),m(x.user_id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,sort:o,q:s}=n||{},c=[m(x.tenant_id,t),Ie(x.linked_to)];if(s){let e=En(x,s,[`email`,`name`,`nickname`,`username`]);e&&c.push(e)}let l=h(...c),u=e.select().from(x).where(l).$dynamic();if(o?.sort_by){let e=x[o.sort_by];e&&(u=u.orderBy(o.sort_order===`desc`?Be(e):ze(e)))}let d=await u.offset(r*i).limit(i),f=d.map(e=>e.user_id),ee=[];f.length>0&&(ee=await e.select().from(x).where(h(m(x.tenant_id,t),Fe(x.linked_to,f))));let te=d.map(e=>Tx(e,ee.filter(t=>t.linked_to===e.user_id)));if(!a)return{users:te};let[ne]=await e.select({count:Ve()}).from(x).where(l);return{users:te,start:r*i,limit:i,length:Number(ne?.count??0)}},async remove(t,n){await e.run(p`BEGIN`);try{let r=[n,...(await e.select({user_id:x.user_id}).from(x).where(h(m(x.tenant_id,t),m(x.linked_to,n)))).map(e=>e.user_id)];await e.delete(hn).where(h(m(hn.tenant_id,t),Fe(hn.user_id,r))),await e.delete(zt).where(h(m(zt.tenant_id,t),Fe(zt.user_id,r))),await e.delete(x).where(h(m(x.tenant_id,t),m(x.linked_to,n)));let i=await e.delete(x).where(h(m(x.tenant_id,t),m(x.user_id,n))).returning();return await e.run(p`COMMIT`),i.length>0}catch(t){throw await e.run(p`ROLLBACK`),t}},async unlink(t,n,r,i){let a=`${r}|${i}`;return(await e.update(x).set({linked_to:null}).where(h(m(x.tenant_id,t),m(x.user_id,a),m(x.linked_to,n))).returning()).length>0}}}function Dx(e){return{async create(t,n,r,i){try{await e.insert(tn).values({tenant_id:t,user_id:n,role_id:r,organization_id:i||``,created_at:new Date().toISOString()})}catch(e){if(e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`SQLITE_CONSTRAINT_PRIMARYKEY`))return!0;throw e}return!0},async list(t,n,r,i){let a=[m(tn.tenant_id,t),m(tn.user_id,n)];i&&a.push(m(tn.organization_id,i));let o=await e.select({role_id:tn.role_id}).from(tn).where(h(...a)).all();return o.length===0?[]:(await Promise.all(o.map(async n=>{let r=await e.select().from(Qt).where(h(m(Qt.tenant_id,t),m(Qt.id,n.role_id))).get();if(!r)return null;let{tenant_id:i,is_system:a,metadata:o,...s}=r;return A({...s,is_system:a?!0:void 0,metadata:j(o)})}))).filter(Boolean)},async remove(t,n,r,i){return(await e.delete(tn).where(h(m(tn.tenant_id,t),m(tn.user_id,n),m(tn.role_id,r),m(tn.organization_id,i||``))).returning()).length>0}}}Hn();function Ox(e){return{async create(t,n){let r=new Date().toISOString(),i={id:n.id||Vn(),tenant_id:t,user_id:n.user_id,organization_id:n.organization_id,created_at:r,updated_at:r};try{await e.insert(Xt).values(i)}catch(e){throw e?.message?.includes(`UNIQUE constraint`)||e?.message?.includes(`duplicate key`)?new Tn(409,{message:`User organization already exists`}):e}let{tenant_id:a,...o}=i;return o},async get(t,n){let r=await e.select().from(Xt).where(h(m(Xt.tenant_id,t),m(Xt.id,n))).get();if(!r)return null;let{tenant_id:i,...a}=r;return a},async update(t,n,r){let i={updated_at:new Date().toISOString()};return r.user_id!==void 0&&(i.user_id=r.user_id),r.organization_id!==void 0&&(i.organization_id=r.organization_id),(await e.update(Xt).set(i).where(h(m(Xt.tenant_id,t),m(Xt.id,n))).returning()).length>0},async list(t,n){let{page:r=0,per_page:i=50,include_totals:a=!1,q:o}=n||{},s=m(Xt.tenant_id,t),c=s;if(o){let e=En(Xt,o,[`user_id`,`organization_id`]);e&&(c=h(s,e))}let l=(await e.select().from(Xt).where(c).offset(r*i).limit(i)).map(e=>{let{tenant_id:t,...n}=e;return n});if(!a)return{userOrganizations:l};let[u]=await e.select({count:Ve()}).from(Xt).where(c);return{userOrganizations:l,start:r*i,limit:i,length:Number(u?.count??0)}},async listUserOrganizations(t,n,r){let{page:i=0,per_page:a=50,include_totals:o=!1}=r||{},s=await e.select().from(Xt).where(h(m(Xt.tenant_id,t),m(Xt.user_id,n))).offset(i*a).limit(a).all(),c=(await Promise.all(s.map(async n=>{let r=await e.select().from(Yt).where(h(m(Yt.tenant_id,t),m(Yt.id,n.organization_id))).get();if(!r)return null;let{tenant_id:i,branding:a,metadata:o,enabled_connections:s,token_quota:c,...l}=r;return A({...l,branding:j(a,{}),metadata:j(o,{}),enabled_connections:j(s,[]),token_quota:j(c,{})})}))).filter(Boolean);if(!o)return{organizations:c};let[l]=await e.select({count:Ve()}).from(Xt).where(h(m(Xt.tenant_id,t),m(Xt.user_id,n)));return{organizations:c,start:i*a,limit:a,length:Number(l?.count??0)}},async remove(t,n){return(await e.delete(Xt).where(h(m(Xt.tenant_id,t),m(Xt.id,n))).returning()).length>0}}}var kx=[`s`],Ax=[`pwd_leak`];function jx(e){return/^\d{8}$/.test(e)?`${e.slice(0,4)}-${e.slice(4,6)}-${e.slice(6,8)}`:e}function Mx(e){return{async getDaily(t,n){let r=new Date,i=n?.from?jx(n.from):new Date(r.getTime()-720*60*60*1e3).toISOString().split(`T`)[0],a=n?.to?jx(n.to):r.toISOString().split(`T`)[0];return(await e.select({date:p`substr(${D.date}, 1, 10)`.as(`date`),logins:p`SUM(CASE WHEN ${D.type} IN (${p.join(kx.map(e=>p`${e}`),p`, `)}) THEN 1 ELSE 0 END)`.as(`logins`),signups:p`SUM(CASE WHEN ${D.type} = 'ss' THEN 1 ELSE 0 END)`.as(`signups`),leaked_passwords:p`SUM(CASE WHEN ${D.type} IN (${p.join(Ax.map(e=>p`${e}`),p`, `)}) THEN 1 ELSE 0 END)`.as(`leaked_passwords`)}).from(D).where(h(m(D.tenant_id,t),Me(D.date,i),Pe(D.date,`${a}T23:59:59.999Z`))).groupBy(p`substr(${D.date}, 1, 10)`).orderBy(p`substr(${D.date}, 1, 10)`).all()).map(e=>({date:e.date,logins:Number(e.logins)||0,signups:Number(e.signups)||0,leaked_passwords:Number(e.leaked_passwords)||0,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}))},async getActiveUsers(t){let n=new Date(Date.now()-720*60*60*1e3).toISOString(),[r]=await e.select({count:p`COUNT(DISTINCT ${D.user_id})`.as(`count`)}).from(D).where(h(m(D.tenant_id,t),Me(D.date,n),p`${D.type} IN (${p.join(kx.map(e=>p`${e}`),p`, `)})`));return Number(r?.count)||0}}}var Nx={"active-users":[`s`,`seacft`],logins:[`s`,`f`,`fp`],signups:[`ss`,`fs`],"refresh-tokens":[`seacft`,`fertft`],sessions:[`slo`]},Px={"active-users":{alias:`active_users`,type:`UInt64`,agg:`uniq`},logins:{alias:`logins`,type:`UInt64`,agg:`count`},signups:{alias:`signups`,type:`UInt64`,agg:`count`},"refresh-tokens":{alias:`refresh_tokens`,type:`UInt64`,agg:`count`},sessions:{alias:`sessions`,type:`UInt64`,agg:`count`}};function Fx(e){switch(e){case`hour`:return p`substr(${D.date}, 1, 13)`;case`month`:return p`substr(${D.date}, 1, 7)`;case`day`:return p`substr(${D.date}, 1, 10)`;case`week`:return p`date(substr(${D.date}, 1, 10), '-' || ((cast(strftime('%w', substr(${D.date}, 1, 10)) as integer) + 6) % 7) || ' days')`;default:throw Error(`Unsupported interval '${e}' for SQL analytics adapter`)}}function Ix(e){return`"${e.replace(/"/g,`""`)}"`}function Lx(e){switch(e){case`connection`:return D.connection;case`client_id`:return D.client_id;case`user_type`:return D.strategy_type;case`event`:return D.type;case`time`:throw Error(`time dimension handled separately`)}}function Rx(e){return{async query(t,n,r){let i=Date.now(),a=Nx[n],o=Px[n],s=[m(D.tenant_id,t),Me(D.date,r.from),Ne(D.date,r.to),Fe(D.type,a)];r.filters.connection?.length&&s.push(Fe(D.connection,r.filters.connection)),r.filters.client_id?.length&&s.push(Fe(D.client_id,r.filters.client_id)),r.filters.user_type?.length&&s.push(Fe(D.strategy_type,r.filters.user_type)),r.filters.user_id?.length&&s.push(Fe(D.user_id,r.filters.user_id));let c={},l=[],u=[];for(let e of r.group_by)if(e===`time`){let e=Fx(r.interval);c.time=e,l.push(e),u.push({name:`time`,type:r.interval===`hour`?`DateTime`:`Date`})}else{let t=Lx(e);c[e]=t,l.push(t),u.push({name:e,type:`String`})}c[o.alias]=o.agg===`uniq`?p`COUNT(DISTINCT ${D.user_id})`:p`COUNT(*)`,u.push({name:o.alias,type:o.type});let d=e.select(c).from(D).where(h(...s));l.length>0&&(d=d.groupBy(...l));let f=new Set([...Object.keys(c)]);if(r.order_by){let e=r.order_by.startsWith(`-`),t=e?r.order_by.slice(1):r.order_by;if(!f.has(t))throw Error(`Invalid order_by column '${t}' for analytics query`);let n=Ix(t);d=d.orderBy(p.raw(`${n} ${e?`DESC`:`ASC`}`))}else d=r.group_by[0]===`time`?d.orderBy(p.raw(`${Ix(`time`)} ASC`)):d.orderBy(p.raw(`${Ix(o.alias)} DESC`));d=d.limit(r.limit).offset(r.offset);let ee=(await d.all()).map(e=>{let t={};for(let n of u){let r=e[n.name];t[n.name]=n.type===`UInt64`?Number(r)||0:r??``}return t});return{meta:u,data:ee,rows:ee.length,rows_before_limit_at_least:ee.length,statistics:{elapsed:(Date.now()-i)/1e3}}}}}Hn();function zx(e){return{...e,payload:j(e.payload,{})}}function Bx(e){return{async create(t,n){let r=Vn(),i=new Date().toISOString();return await e.insert(O).values({id:r,tenant_id:t,event_type:n.event_type,log_type:n.log_type,aggregate_type:n.aggregate_type,aggregate_id:n.aggregate_id,payload:JSON.stringify({...n,id:r}),created_at:i,processed_at:null,retry_count:0,next_retry_at:null,error:null,claimed_by:null,claim_expires_at:null}),r},async getByIds(t){return t.length===0?[]:(await e.select().from(O).where(Fe(O.id,t)).all()).map(zx)},async getUnprocessed(t){let n=new Date().toISOString();return(await e.select().from(O).where(h(Ie(O.processed_at),Ae(Ie(O.next_retry_at),Pe(O.next_retry_at,n)),Ae(Ie(O.claimed_by),Pe(O.claim_expires_at,n)))).orderBy(O.created_at,O.id).limit(t).all()).map(zx)},async claimEvents(t,n,r){if(t.length===0)return[];let i=new Date().toISOString(),a=new Date(Date.now()+r).toISOString();return await e.update(O).set({claimed_by:n,claim_expires_at:a}).where(h(Fe(O.id,t),Ie(O.processed_at),Ae(Ie(O.claimed_by),Pe(O.claim_expires_at,i)))),(await e.select({id:O.id}).from(O).where(h(Fe(O.id,t),m(O.claimed_by,n))).all()).map(e=>e.id)},async markProcessed(t){t.length!==0&&await e.update(O).set({processed_at:new Date().toISOString()}).where(Fe(O.id,t))},async markRetry(t,n,r){await e.update(O).set({error:n,next_retry_at:r,retry_count:p`${O.retry_count} + 1`,claimed_by:null,claim_expires_at:null}).where(m(O.id,t))},async cleanup(t){return(await e.delete(O).where(h(p`${O.processed_at} IS NOT NULL`,Pe(O.processed_at,t))).returning()).length},async deadLetter(t,n){let r=new Date().toISOString();await e.update(O).set({processed_at:r,dead_lettered_at:r,final_error:n}).where(m(O.id,t))},async listFailed(t,n={}){let{page:r=0,per_page:i=50,include_totals:a=!1}=n,o=(await e.select().from(O).where(h(m(O.tenant_id,t),Le(O.dead_lettered_at))).orderBy(Be(O.dead_lettered_at),ze(O.id)).offset(r*i).limit(i).all()).map(e=>({...j(e.payload,{}),id:e.id,created_at:e.created_at,processed_at:e.processed_at,retry_count:e.retry_count,next_retry_at:e.next_retry_at,error:e.error,dead_lettered_at:e.dead_lettered_at,final_error:e.final_error})),s=o.length;if(a){let[n]=await e.select({total:Ve()}).from(O).where(h(m(O.tenant_id,t),Le(O.dead_lettered_at)));s=Number(n?.total??o.length)}return{events:o,start:r*i,limit:i,length:s}},async replay(t,n){return(await e.update(O).set({processed_at:null,dead_lettered_at:null,final_error:null,retry_count:0,next_retry_at:null,error:null}).where(h(m(O.id,t),m(O.tenant_id,n),Le(O.dead_lettered_at))).returning()).length>0}}}var Vx=10080*60*1e3;function Hx(e){return async t=>{let n=Date.now()-Vx;try{let r=[Ae(Ne(S.expires_at_ts,n),Ne(S.idle_expires_at_ts,n))];t?.tenant_id&&r.push(m(S.tenant_id,t.tenant_id)),await e.delete(S).where(h(...r)),r=[Ae(Ne(Bt.expires_at_ts,n),Ne(Bt.idle_expires_at_ts,n))],t?.tenant_id&&r.push(m(Bt.tenant_id,t.tenant_id)),t?.user_id&&r.push(m(Bt.user_id,t.user_id)),await e.delete(Bt).where(h(...r)),r=[Ne(C.expires_at_ts,n)],t?.tenant_id&&r.push(m(C.tenant_id,t.tenant_id)),await e.delete(C).where(h(...r))}catch(e){console.error(`Session cleanup error:`,e)}}}function Ux(e,t={useTransactions:!0}){let n={actions:He(),actionExecutions:Ue(),actionVersions:We(),branding:wn(e),clients:Mn(e),clientConnections:Pn(e),clientGrants:Wn(e),clientRegistrationTokens:$y(e),codes:tb(e),connections:ib(e),customDomains:ob(e),customText:sb(e),emailProviders:cb(e),emailTemplates:ub(e),flows:db(e),forms:pb(e),hookCode:xb(e),hooks:Tb(e),invites:kb(e),keys:Ab(e),loginSessions:Fb(e),logs:Lb(e),authenticationMethods:Hb(e),organizations:Gb(e),passwords:qb(e),promptSettings:Jb(e),proxyRoutes:Qb(e),refreshTokens:tx(e),resourceServers:ox(e),rolePermissions:sx(e),userPermissions:cx(e),roles:ux(e),sessions:mx(e),sessionCleanup:Hx(e),tenants:yx(e),themes:Sx(e),universalLoginTemplates:Cx(e),users:Ex(e),userRoles:Dx(e),userOrganizations:Ox(e),stats:Mx(e),analytics:Rx(e),outbox:Bx(e),async transaction(r){if(t.useTransactions===!1)return r(n);await e.run(p`BEGIN`);try{let t=await r(n);return await e.run(p`COMMIT`),t}catch(t){throw await e.run(p`ROLLBACK`),t}}};return n}function Wx(e){if(!e)return{path:`/*`};try{let t=JSON.parse(e),n=Ny.safeParse(t);if(n.success)return n.data}catch{}return{path:`/*`}}function Gx(e){if(!e)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=[];for(let e of t){let t=Py.safeParse(e);t.success&&n.push(t.data)}return n}catch{return[]}}async function Kx(e,t){let n=t.toLowerCase(),r=(await e.select({custom_domain_id:qt.custom_domain_id,tenant_id:qt.tenant_id,domain:qt.domain}).from(qt).where(m(qt.domain,n)).limit(1))[0];if(!r)return null;let i=(await e.select().from(k).where(h(m(k.tenant_id,r.tenant_id),m(k.custom_domain_id,r.custom_domain_id))).orderBy(ze(k.priority),ze(k.created_at))).map(e=>({id:e.id,tenant_id:e.tenant_id,custom_domain_id:e.custom_domain_id,priority:e.priority,match:Wx(e.match),handlers:Gx(e.handlers),created_at:e.created_at,updated_at:e.updated_at}));return{tenant_id:r.tenant_id,custom_domain_id:r.custom_domain_id,domain:r.domain,routes:i}}function qx(e){return{proxyRoutes:Qb(e),resolveHost:t=>Kx(e,t)}}exports.createProxyDataAdapter=qx,exports.createProxyRoutesAdapter=Qb,exports.default=Ux,Object.defineProperty(exports,"sqlite",{enumerable:!0,get:function(){return gn}});