@authhero/widget 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authhero-widget/authhero-widget.esm.js +1 -1
- package/dist/authhero-widget/index.esm.js +1 -1
- package/dist/authhero-widget/{p-7ee9b91f.entry.js → p-29e844e0.entry.js} +1 -1
- package/dist/authhero-widget/p-553c2cbe.entry.js +1 -0
- package/dist/cjs/authhero-node.cjs.entry.js +2 -2
- package/dist/cjs/authhero-widget.cjs.entry.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/authhero-node/authhero-node.css +45 -7
- package/dist/collection/components/authhero-node/authhero-node.js +1 -1
- package/dist/collection/components/authhero-widget/authhero-widget.css +37 -4
- package/dist/components/authhero-node.js +1 -1
- package/dist/components/authhero-widget.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-03Jc7wx1.js → p-uGYnrdy5.js} +1 -1
- package/dist/esm/authhero-node.entry.js +2 -2
- package/dist/esm/authhero-widget.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/hydrate/index.js +3 -3
- package/hydrate/index.mjs +3 -3
- package/package.json +2 -2
- package/dist/authhero-widget/p-21535878.entry.js +0 -1
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-JzMtjMQb.js";function e(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),i}var t={};function i(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i}function n(e,t){var i;return(null===(i=null==e?void 0:e._def)||void 0===i?void 0:i.typeName)===t}function o(e,t){const i=e.ZodType.prototype[t];e.ZodType.prototype[t]=function(...e){const t=i.apply(this,e);return t._def.openapi=this._def.openapi,t}}function c(e){if(void 0!==e.ZodType.prototype.openapi)return;e.ZodType.prototype.openapi=function(e,t){var s,r,o,a,c,u;const d="string"==typeof e?t:e,l=null!=d?d:{},{param:h}=l,_=i(l,["param"]),p=Object.assign(Object.assign({},null===(s=this._def.openapi)||void 0===s?void 0:s._internal),"string"==typeof e?{refId:e}:void 0),f=Object.assign(Object.assign(Object.assign({},null===(r=this._def.openapi)||void 0===r?void 0:r.metadata),_),(null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.param)||h?{param:Object.assign(Object.assign({},null===(u=null===(c=this._def.openapi)||void 0===c?void 0:c.metadata)||void 0===u?void 0:u.param),h)}:void 0),m=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(p).length>0?{_internal:p}:void 0),Object.keys(f).length>0?{metadata:f}:void 0)}));if(n(this,"ZodObject")){const e=this.extend;m.extend=function(...t){var i,n,s,r,o,a,c;const u=e.apply(this,t);return u._def.openapi={_internal:{extendedFrom:(null===(n=null===(i=this._def.openapi)||void 0===i?void 0:i._internal)||void 0===n?void 0:n.refId)?{refId:null===(r=null===(s=this._def.openapi)||void 0===s?void 0:s._internal)||void 0===r?void 0:r.refId,schema:this}:null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o._internal)||void 0===a?void 0:a.extendedFrom},metadata:null===(c=u._def.openapi)||void 0===c?void 0:c.metadata},u}}return m},o(e,"optional"),o(e,"nullable"),o(e,"default"),o(e,"transform"),o(e,"refine");const t=e.ZodObject.prototype.deepPartial;e.ZodObject.prototype.deepPartial=function(){const e=this._def.shape(),i=t.apply(this),n=i._def.shape();return Object.entries(n).forEach((([t,i])=>{var n,s;i._def.openapi=null===(s=null===(n=e[t])||void 0===n?void 0:n._def)||void 0===s?void 0:s.openapi})),i._def.openapi=void 0,i};const s=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...e){const t=s.apply(this,e);return t._def.openapi=void 0,t};const r=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...e){const t=r.apply(this,e);return t._def.openapi=void 0,t}}function u(e,t){if(null==e||null==t)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1}if(!(e instanceof Object&&t instanceof Object))return!1;const i=Object.keys(e);return Object.keys(t).every((e=>-1!==i.indexOf(e)))&&i.every((i=>u(e[i],t[i])))}"function"==typeof SuppressedError&&SuppressedError;class d{constructor(){this.buckets=new Map}put(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);i?i.some((t=>u(t,e)))||i.push(e):this.buckets.set(t,[e])}contains(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);return!!i&&i.some((t=>u(t,e)))}values(){return[...this.buckets.values()].flat()}stats(){let e=0,t=0,i=0;for(const n of this.buckets.values())e+=1,t+=n.length,n.length>1&&(i+=1);return{totalBuckets:e,collisions:i,totalValues:t,hashEffectiveness:e/t}}hashCodeOf(e){let t=0;if(Array.isArray(e)){for(let i=0;i<e.length;i++)t^=this.hashCodeOf(e[i])*i;return t}if("string"==typeof e){for(let i=0;i<e.length;i++)t^=e.charCodeAt(i)*i;return t}if("number"==typeof e)return e;if("object"==typeof e)for(const[i,n]of Object.entries(e))t^=this.hashCodeOf(i)+this.hashCodeOf(null!=n?n:"");return t}}function l(e){return void 0===e}function h(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{i[e]=t(n)})),i}function _(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t(n,e)||(i[e]=n)})),i}function p(e){return e.filter((e=>!l(e)))}const f=u;function m(e){return"string"==typeof e}class y{constructor(e){this.parents=e,this._definitions=[]}get definitions(){var e,t;return[...null!==(t=null===(e=this.parents)||void 0===e?void 0:e.flatMap((e=>e.definitions)))&&void 0!==t?t:[],...this._definitions]}register(e,t){const i=this.schemaWithRefId(e,t);return this._definitions.push({type:"schema",schema:i}),i}registerParameter(e,t){var i,n,s;const r=this.schemaWithRefId(e,t),o=null===(i=r._def.openapi)||void 0===i?void 0:i.metadata,a=r.openapi(Object.assign(Object.assign({},o),{param:Object.assign(Object.assign({},null==o?void 0:o.param),{name:null!==(s=null===(n=null==o?void 0:o.param)||void 0===n?void 0:n.name)&&void 0!==s?s:e})}));return this._definitions.push({type:"parameter",schema:a}),a}registerPath(e){this._definitions.push({type:"route",route:e})}registerWebhook(e){this._definitions.push({type:"webhook",webhook:e})}registerComponent(e,t,i){return this._definitions.push({type:"component",componentType:e,name:t,component:i}),{name:t,ref:{$ref:`#/components/${e}/${t}`}}}schemaWithRefId(e,t){return t.openapi(e)}}class E{constructor(e){this.message=e}}class v extends E{constructor(e,t){super(e),this.data=t}}class O extends E{constructor(e){super(`Missing parameter data, please specify \`${e.missingField}\` and other OpenAPI parameter props using the \`param\` field of \`ZodSchema.openapi\``),this.data=e}}function w(e,t){try{return e()}catch(e){if(e instanceof O)throw new O(Object.assign(Object.assign({},e.data),t));throw e}}class A extends E{constructor(e){super("Unknown zod object type, please specify `type` and other OpenAPI props using `ZodSchema.openapi`."),this.data=e}}class S{static getMetadata(e){var t;const i=this.unwrapChained(e),n=e._def.openapi?e._def.openapi:i._def.openapi,s=null!==(t=e.description)&&void 0!==t?t:i.description;return{_internal:null==n?void 0:n._internal,metadata:Object.assign({description:s},null==n?void 0:n.metadata)}}static getInternalMetadata(e){const t=this.unwrapChained(e),i=e._def.openapi?e._def.openapi:t._def.openapi;return null==i?void 0:i._internal}static getParamMetadata(e){var t,i;const n=this.unwrapChained(e),s=e._def.openapi?e._def.openapi:n._def.openapi,r=null!==(t=e.description)&&void 0!==t?t:n.description;return{_internal:null==s?void 0:s._internal,metadata:Object.assign(Object.assign({},null==s?void 0:s.metadata),{param:Object.assign({description:r},null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param)})}}static buildSchemaMetadata(e){return _(function(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t.some((t=>t===e))||(i[e]=n)})),i}(e,["param"]),l)}static buildParameterMetadata(e){return _(e,l)}static applySchemaMetadata(e,t){return _(Object.assign(Object.assign({},e),this.buildSchemaMetadata(t)),l)}static getRefId(e){var t;return null===(t=this.getInternalMetadata(e))||void 0===t?void 0:t.refId}static unwrapChained(e){return this.unwrapUntil(e)}static getDefaultValue(e){const t=this.unwrapUntil(e,"ZodDefault");return null==t?void 0:t._def.defaultValue()}static unwrapUntil(e,t){return t&&n(e,t)?e:n(e,"ZodOptional")||n(e,"ZodNullable")||n(e,"ZodBranded")?this.unwrapUntil(e.unwrap(),t):n(e,"ZodDefault")||n(e,"ZodReadonly")?this.unwrapUntil(e._def.innerType,t):n(e,"ZodEffects")?this.unwrapUntil(e._def.schema,t):n(e,"ZodPipeline")?this.unwrapUntil(e._def.in,t):t?void 0:e}static isOptionalSchema(e){return e.isOptional()}}class I{transform(e,t,i){var n,s;const r=e._def.type;return Object.assign(Object.assign({},t("array")),{items:i(r),minItems:null===(n=e._def.minLength)||void 0===n?void 0:n.value,maxItems:null===(s=e._def.maxLength)||void 0===s?void 0:s.value})}}class N{transform(e){return Object.assign(Object.assign({},e("string")),{pattern:"^d+$"})}}class C{transform(e,t,i,n,s){const r=[...e.options.values()],o=r.map(n);return t?{oneOf:i(o,t)}:{oneOf:o,discriminator:this.mapDiscriminator(r,e.discriminator,s)}}mapDiscriminator(e,t,i){if(e.some((e=>void 0===S.getRefId(e))))return;const s={};return e.forEach((e=>{var r;const o=S.getRefId(e),a=null===(r=e.shape)||void 0===r?void 0:r[t];if(n(a,"ZodEnum")||n(a,"ZodNativeEnum"))return void Object.values(a.enum).filter(m).forEach((e=>{s[e]=i(o)}));const c=null==a?void 0:a._def.value;if("string"!=typeof c)throw Error(`Discriminator ${t} could not be found in one of the values of a discriminated union`);s[c]=i(o)})),{propertyName:t,mapping:s}}}class T{transform(e,t){return Object.assign(Object.assign({},t("string")),{enum:e._def.values})}}class x{transform(e,t,i,n){const s={allOf:this.flattenIntersectionTypes(e).map(n)};return t?{anyOf:i([s],t)}:s}flattenIntersectionTypes(e){return n(e,"ZodIntersection")?[...this.flattenIntersectionTypes(e._def.left),...this.flattenIntersectionTypes(e._def.right)]:[e]}}class R{transform(e,t){return Object.assign(Object.assign({},t(typeof e._def.value)),{enum:[e._def.value]})}}class k{transform(e,t){const{type:i,values:n}=function(e){const t=Object.keys(e).filter((t=>"number"!=typeof e[e[t]])).map((t=>e[t])),i=t.filter((e=>"number"==typeof e)).length;return{values:t,type:0===i?"string":i===t.length?"numeric":"mixed"}}(e._def.values);if("mixed"===i)throw new E("Enum has mixed string and number values, please specify the OpenAPI type manually");return Object.assign(Object.assign({},t("numeric"===i?"integer":"string")),{enum:n})}}class D{transform(e,t,i){return Object.assign(Object.assign({},t(e.isInt?"integer":"number")),i(e._def.checks))}}class L{transform(e,t,i,n){var s;const r=null===(s=S.getInternalMetadata(e))||void 0===s?void 0:s.extendedFrom,o=this.requiredKeysOf(e),a=h(e._def.shape(),n);if(!r)return Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{properties:a,default:t}),o.length>0?{required:o}:{}),this.generateAdditionalProperties(e,n));const c=r.schema;n(c);const u=this.requiredKeysOf(c),d=h(null==c?void 0:c._def.shape(),n),l=Object.fromEntries(Object.entries(a).filter((([e,t])=>!f(d[e],t)))),_=o.filter((e=>!u.includes(e))),p=Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{default:t,properties:l}),_.length>0?{required:_}:{}),this.generateAdditionalProperties(e,n));return{allOf:[{$ref:"#/components/schemas/"+r.refId},p]}}generateAdditionalProperties(e,t){const i=e._def.unknownKeys,s=e._def.catchall;return n(s,"ZodNever")?"strict"===i?{additionalProperties:!1}:{}:{additionalProperties:t(s)}}requiredKeysOf(e){return Object.entries(e._def.shape()).filter((([e,t])=>!S.isOptionalSchema(t))).map((([e,t])=>e))}}class j{transform(e,t,i){const s=e._def.keyType,r=i(e._def.valueType);if(n(s,"ZodEnum")||n(s,"ZodNativeEnum")){const e=Object.values(s.enum).filter(m).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:r})),{});return Object.assign(Object.assign({},t("object")),{properties:e})}return Object.assign(Object.assign({},t("object")),{additionalProperties:r})}}class F{transform(e,t){var i,n,s;const r=this.getZodStringCheck(e,"regex"),o=null===(i=this.getZodStringCheck(e,"length"))||void 0===i?void 0:i.value,a=Number.isFinite(e.minLength)&&null!==(n=e.minLength)&&void 0!==n?n:void 0,c=Number.isFinite(e.maxLength)&&null!==(s=e.maxLength)&&void 0!==s?s:void 0;return Object.assign(Object.assign({},t("string")),{minLength:null!=o?o:a,maxLength:null!=o?o:c,format:this.mapStringFormat(e),pattern:null==r?void 0:r.regex.source})}mapStringFormat(e){return e.isUUID?"uuid":e.isEmail?"email":e.isURL?"uri":e.isDate?"date":e.isDatetime?"date-time":e.isCUID?"cuid":e.isCUID2?"cuid2":e.isULID?"ulid":e.isIP?"ip":e.isEmoji?"emoji":void 0}getZodStringCheck(e,t){return e._def.checks.find((e=>e.kind===t))}}class U{constructor(e){this.versionSpecifics=e}transform(e,t,i){const{items:n}=e._def,s=n.map(i);return Object.assign(Object.assign({},t("array")),this.versionSpecifics.mapTupleItems(s))}}class P{transform(e,t,i){return{anyOf:t(this.flattenUnionTypes(e).map((e=>{const t=this.unwrapNullable(e);return i(t)})))}}flattenUnionTypes(e){return n(e,"ZodUnion")?e._def.options.flatMap((e=>this.flattenUnionTypes(e))):[e]}unwrapNullable(e){return n(e,"ZodNullable")?this.unwrapNullable(e.unwrap()):e}}class M{constructor(e){this.versionSpecifics=e,this.objectTransformer=new L,this.stringTransformer=new F,this.numberTransformer=new D,this.bigIntTransformer=new N,this.literalTransformer=new R,this.enumTransformer=new T,this.nativeEnumTransformer=new k,this.arrayTransformer=new I,this.unionTransformer=new P,this.discriminatedUnionTransformer=new C,this.intersectionTransformer=new x,this.recordTransformer=new j,this.tupleTransformer=new U(e)}transform(e,t,i,s,r){if(n(e,"ZodNull"))return this.versionSpecifics.nullType;if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodObject"))return this.objectTransformer.transform(e,r,(e=>this.versionSpecifics.mapNullableType(e,t)),i);const o=this.transformSchemaWithoutDefault(e,t,i,s);return Object.assign(Object.assign({},o),{default:r})}transformSchemaWithoutDefault(e,t,i,s){if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodString"))return this.stringTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNumber"))return this.numberTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),(e=>this.versionSpecifics.getNumberChecks(e)));if(n(e,"ZodBigInt"))return this.bigIntTransformer.transform((e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodBoolean"))return this.versionSpecifics.mapNullableType("boolean",t);if(n(e,"ZodLiteral"))return this.literalTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodEnum"))return this.enumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNativeEnum"))return this.nativeEnumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodArray"))return this.arrayTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodTuple"))return this.tupleTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodUnion"))return this.unionTransformer.transform(e,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodDiscriminatedUnion"))return this.discriminatedUnionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i,s);if(n(e,"ZodIntersection"))return this.intersectionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodRecord"))return this.recordTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodDate"))return this.versionSpecifics.mapNullableType("string",t);const r=S.getRefId(e);throw new A({currentSchema:e._def,schemaName:r})}}class Z{constructor(e,t){this.definitions=e,this.versionSpecifics=t,this.schemaRefs={},this.paramRefs={},this.pathRefs={},this.rawComponents=[],this.openApiTransformer=new M(t),this.sortDefinitions()}generateDocumentData(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents(),paths:this.pathRefs}}generateComponents(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents()}}buildComponents(){var e,t;const i={};return this.rawComponents.forEach((({componentType:e,name:t,component:n})=>{var s;null!==(s=i[e])&&void 0!==s||(i[e]={}),i[e][t]=n})),Object.assign(Object.assign({},i),{schemas:Object.assign(Object.assign({},null!==(e=i.schemas)&&void 0!==e?e:{}),this.schemaRefs),parameters:Object.assign(Object.assign({},null!==(t=i.parameters)&&void 0!==t?t:{}),this.paramRefs)})}sortDefinitions(){const e=["schema","parameter","component","route"];this.definitions.sort(((t,i)=>"type"in t?"type"in i?e.findIndex((e=>e===t.type))-e.findIndex((e=>e===i.type)):1:"type"in i?-1:0))}generateSingle(e){if("type"in e)switch(e.type){case"parameter":return void this.generateParameterDefinition(e.schema);case"schema":return void this.generateSchemaWithRef(e.schema);case"route":return void this.generateSingleRoute(e.route);case"component":return void this.rawComponents.push(e)}else this.generateSchemaWithRef(e)}generateParameterDefinition(e){const t=S.getRefId(e),i=this.generateParameter(e);return t&&(this.paramRefs[t]=i),i}getParameterRef(e,t){var i,n,s,r,o;const a=null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.param,c=(null===(n=null==e?void 0:e._internal)||void 0===n?void 0:n.refId)?this.paramRefs[null===(s=e._internal)||void 0===s?void 0:s.refId]:void 0;if((null===(r=null==e?void 0:e._internal)||void 0===r?void 0:r.refId)&&c){if(a&&c.in!==a.in||(null==t?void 0:t.in)&&c.in!==t.in)throw new v("Conflicting location for parameter "+c.name,{key:"in",values:p([c.in,null==t?void 0:t.in,null==a?void 0:a.in])});if(a&&c.name!==a.name||(null==t?void 0:t.name)&&c.name!==(null==t?void 0:t.name))throw new v("Conflicting names for parameter",{key:"name",values:p([c.name,null==t?void 0:t.name,null==a?void 0:a.name])});return{$ref:"#/components/parameters/"+(null===(o=e._internal)||void 0===o?void 0:o.refId)}}}generateInlineParameters(e,t){var i;const s=S.getMetadata(e),r=null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param,o=this.getParameterRef(s,{in:t});if(o)return[o];if(n(e,"ZodObject")){const i=e._def.shape(),n=Object.entries(i).map((([e,i])=>{var n,s;const r=S.getMetadata(i),o=this.getParameterRef(r,{in:t,name:e});if(o)return o;const a=null===(n=null==r?void 0:r.metadata)||void 0===n?void 0:n.param;if((null==a?void 0:a.name)&&a.name!==e)throw new v("Conflicting names for parameter",{key:"name",values:[e,a.name]});if((null==a?void 0:a.in)&&a.in!==t)throw new v("Conflicting location for parameter "+(null!==(s=a.name)&&void 0!==s?s:e),{key:"in",values:[t,a.in]});return this.generateParameter(i.openapi({param:{name:e,in:t}}))}));return n}if((null==r?void 0:r.in)&&r.in!==t)throw new v("Conflicting location for parameter "+r.name,{key:"in",values:[t,r.in]});return[this.generateParameter(e.openapi({param:{in:t}}))]}generateSimpleParameter(e){var t;const i=S.getParamMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=!S.isOptionalSchema(e)&&!e.isNullable(),r=this.generateSchemaWithRef(e);return Object.assign({schema:r,required:s},n?S.buildParameterMetadata(n):{})}generateParameter(e){var t;const i=S.getMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=null==n?void 0:n.name,r=null==n?void 0:n.in;if(!s)throw new O({missingField:"name"});if(!r)throw new O({missingField:"in",paramName:s});const o=this.generateSimpleParameter(e);return Object.assign(Object.assign({},o),{in:r,name:s})}generateSchemaWithMetadata(e){var t;const i=S.unwrapChained(e),n=S.getMetadata(e),s=S.getDefaultValue(e),r=(null===(t=null==n?void 0:n.metadata)||void 0===t?void 0:t.type)?{type:null==n?void 0:n.metadata.type}:this.toOpenAPISchema(i,e.isNullable(),s);return(null==n?void 0:n.metadata)?S.applySchemaMetadata(r,n.metadata):_(r,l)}constructReferencedOpenAPISchema(e){var t;const i=S.getMetadata(e),n=S.unwrapChained(e),s=S.getDefaultValue(e),r=e.isNullable();return(null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.type)?this.versionSpecifics.mapNullableType(i.metadata.type,r):this.toOpenAPISchema(n,r,s)}generateSimpleSchema(e){var t;const i=S.getMetadata(e),n=S.getRefId(e);if(!n||!this.schemaRefs[n])return this.generateSchemaWithMetadata(e);const s=this.schemaRefs[n],r={$ref:this.generateSchemaRef(n)},o=_(S.buildSchemaMetadata(null!==(t=null==i?void 0:i.metadata)&&void 0!==t?t:{}),((e,t)=>void 0===e||f(e,s[t])));if(o.type)return{allOf:[r,o]};const a=_(this.constructReferencedOpenAPISchema(e),((e,t)=>void 0===e||f(e,s[t]))),c=S.applySchemaMetadata(a,o);return Object.keys(c).length>0?{allOf:[r,c]}:r}generateSchemaWithRef(e){const t=S.getRefId(e),i=this.generateSimpleSchema(e);return t&&void 0===this.schemaRefs[t]?(this.schemaRefs[t]=i,{$ref:this.generateSchemaRef(t)}):i}generateSchemaRef(e){return"#/components/schemas/"+e}getRequestBody(e){if(!e)return;const{content:t}=e,n=i(e,["content"]),s=this.getBodyContent(t);return Object.assign(Object.assign({},n),{content:s})}getParameters(e){if(!e)return[];const{headers:t}=e,i=this.cleanParameter(e.query),n=this.cleanParameter(e.params),s=this.cleanParameter(e.cookies),r=w((()=>i?this.generateInlineParameters(i,"query"):[]),{location:"query"}),o=w((()=>n?this.generateInlineParameters(n,"path"):[]),{location:"path"}),a=w((()=>s?this.generateInlineParameters(s,"cookie"):[]),{location:"cookie"});return[...o,...r,...w((()=>{if(Array.isArray(t))return t.flatMap((e=>this.generateInlineParameters(e,"header")));const e=this.cleanParameter(t);return e?this.generateInlineParameters(e,"header"):[]}),{location:"header"}),...a]}cleanParameter(e){if(e)return n(e,"ZodEffects")?this.cleanParameter(e._def.schema):e}generatePath(e){const{method:t,path:n,request:s,responses:r}=e,o=i(e,["method","path","request","responses"]),a=h(r,(e=>this.getResponse(e))),c=w((()=>this.getParameters(s)),{route:`${t} ${n}`}),u=this.getRequestBody(null==s?void 0:s.body);return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},o),c.length>0?{parameters:[...o.parameters||[],...c]}:{}),u?{requestBody:u}:{}),{responses:a})}}generateSingleRoute(e){const t=this.generatePath(e);return this.pathRefs[e.path]=Object.assign(Object.assign({},this.pathRefs[e.path]),t),t}getResponse(e){if(this.isReferenceObject(e))return e;const{content:t,headers:s}=e,r=i(e,["content","headers"]),o=t?{content:this.getBodyContent(t)}:{};if(!s)return Object.assign(Object.assign({},r),o);const a=n(s,"ZodObject")?this.getResponseHeaders(s):s;return Object.assign(Object.assign(Object.assign({},r),{headers:a}),o)}isReferenceObject(e){return"$ref"in e}getResponseHeaders(e){return h(e._def.shape(),(e=>this.generateSimpleParameter(e)))}getBodyContent(e){return h(e,(e=>{if(!e||!function(e){return"_def"in e}(e.schema))return e;const{schema:t}=e,n=i(e,["schema"]),s=this.generateSchemaWithRef(t);return Object.assign({schema:s},n)}))}toOpenAPISchema(e,t,i){return this.openApiTransformer.transform(e,t,(e=>this.generateSchemaWithRef(e)),(e=>this.generateSchemaRef(e)),i)}}class ${get nullType(){return{nullable:!0}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return Object.assign(Object.assign({},e?{type:e}:void 0),t?this.nullType:void 0)}mapTupleItems(e){const t=function(e){const t=new d;return e.forEach((e=>t.put(e))),[...t.values()]}(e);return{items:1===t.length?t[0]:{anyOf:t},minItems:e.length,maxItems:e.length}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{minimum:Number(e.value),exclusiveMinimum:!0};case"max":return e.inclusive?{maximum:Number(e.value)}:{maximum:Number(e.value),exclusiveMaximum:!0};default:return{}}})))}}class H{constructor(e){const t=new $;this.generator=new Z(e,t)}generateDocument(e){const t=this.generator.generateDocumentData();return Object.assign(Object.assign({},e),t)}generateComponents(){return this.generator.generateComponents()}}class z{get nullType(){return{type:"null"}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return e?t?{type:Array.isArray(e)?[...e,"null"]:[e,"null"]}:{type:e}:{}}mapTupleItems(e){return{prefixItems:e}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{exclusiveMinimum:Number(e.value)};case"max":return e.inclusive?{maximum:Number(e.value)}:{exclusiveMaximum:Number(e.value)};default:return{}}})))}}function G(e){return"type"in e&&"webhook"===e.type}class B{constructor(e){this.definitions=e,this.webhookRefs={};const t=new z;this.generator=new Z(this.definitions,t)}generateDocument(e){const t=this.generator.generateDocumentData();return this.definitions.filter(G).forEach((e=>this.generateSingleWebhook(e.webhook))),Object.assign(Object.assign(Object.assign({},e),t),{webhooks:this.webhookRefs})}generateComponents(){return this.generator.generateComponents()}generateSingleWebhook(e){const t=this.generator.generatePath(e);return this.webhookRefs[e.path]=Object.assign(Object.assign({},this.webhookRefs[e.path]),t),t}}var q=e=>{const t=e.split("/");return""===t[0]&&t.shift(),t},K={},W=(e,t)=>{if("*"===e)return"*";const i=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(i){const n=`${e}#${t}`;return K[n]||(K[n]=i[2]?t&&":"!==t[0]&&"*"!==t[0]?[n,i[1],RegExp(`^${i[2]}(?=/${t})`)]:[e,i[1],RegExp(`^${i[2]}$`)]:[e,i[1],!0]),K[n]}return null},V=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,(e=>{try{return t(e)}catch{return e}}))}},X=e=>V(e,decodeURI),Y=e=>{const t=e.url,i=t.indexOf("/",t.indexOf(":")+4);let n=i;for(;n<t.length;n++){const e=t.charCodeAt(n);if(37===e){const e=t.indexOf("?",n),s=t.slice(i,-1===e?void 0:e);return X(s.includes("%25")?s.replace(/%25/g,"%2525"):s)}if(63===e)break}return t.slice(i,n)},J=e=>{const t=Y(e);return t.length>1&&"/"===t.at(-1)?t.slice(0,-1):t},Q=(e,t,...i)=>(i.length&&(t=Q(t,...i)),`${"/"===e?.[0]?"":"/"}${e}${"/"===t?"":`${"/"===e?.at(-1)?"":"/"}${"/"===t?.[0]?t.slice(1):t}`}`),ee=e=>{if(63!==e.charCodeAt(e.length-1)||!e.includes(":"))return null;const t=e.split("/"),i=[];let n="";return t.forEach((e=>{if(""===e||/\:/.test(e)){if(/\:/.test(e))if(/\?/.test(e)){i.push(0===i.length&&""===n?"/":n);const t=e.replace("?","");n+="/"+t,i.push(n)}else n+="/"+e}else n+="/"+e})),i.filter(((e,t,i)=>i.indexOf(e)===t))},te=e=>/[%+]/.test(e)?(-1!==e.indexOf("+")&&(e=e.replace(/\+/g," ")),-1!==e.indexOf("%")?V(e,se):e):e,ie=(e,t,i)=>{let n;if(!i&&t&&!/[%+]/.test(t)){let i=e.indexOf("?",8);if(-1===i)return;for(e.startsWith(t,i+1)||(i=e.indexOf("&"+t,i+1));-1!==i;){const n=e.charCodeAt(i+t.length+1);if(61===n){const n=i+t.length+2,s=e.indexOf("&",n);return te(e.slice(n,-1===s?void 0:s))}if(38==n||isNaN(n))return"";i=e.indexOf("&"+t,i+1)}if(n=/[%+]/.test(e),!n)return}const s={};n??=/[%+]/.test(e);let r=e.indexOf("?",8);for(;-1!==r;){const t=e.indexOf("&",r+1);let o=e.indexOf("=",r);o>t&&-1!==t&&(o=-1);let a,c=e.slice(r+1,-1===o?-1===t?void 0:t:o);n&&(c=te(c)),r=t,""!==c&&(-1===o?a="":(a=e.slice(o+1,-1===t?void 0:t),n&&(a=te(a))),i?(s[c]&&Array.isArray(s[c])||(s[c]=[]),s[c].push(a)):s[c]??=a)}return t?s[t]:s},ne=ie,se=decodeURIComponent,re=/^[\w!#$%&'*.^`|~+-]+$/,oe=/^[ !#-:<-[\]-~]*$/,ae=class extends Error{res;status;constructor(e=500,t){super(t?.message,{cause:t?.cause}),this.res=t?.res,this.status=e}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}},ce=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,ue=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/,de=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,le=(e,t)=>async(i,n)=>{let s={};const r=i.req.header("Content-Type");switch(e){case"json":if(!r||!ce.test(r))break;try{s=await i.req.json()}catch{throw new ae(400,{message:"Malformed JSON in request body"})}break;case"form":{if(!r||!ue.test(r)&&!de.test(r))break;let e;if(i.req.bodyCache.formData)e=await i.req.bodyCache.formData;else try{const t=await i.req.arrayBuffer();e=await((e,t)=>new Response(e,{headers:{"Content-Type":t}}).formData())(t,r),i.req.bodyCache.formData=e}catch(e){let t="Malformed FormData request.";throw t+=e instanceof Error?" "+e.message:" "+e,new ae(400,{message:t})}const t={};e.forEach(((e,i)=>{i.endsWith("[]")?(t[i]??=[]).push(e):Array.isArray(t[i])?t[i].push(e):t[i]=i in t?[t[i],e]:e})),s=t;break}case"query":s=Object.fromEntries(Object.entries(i.req.queries()).map((([e,t])=>1===t.length?[e,t[0]]:[e,t])));break;case"param":s=i.req.param();break;case"header":s=i.req.header();break;case"cookie":s=(e=>{const t=e.req.raw.headers.get("Cookie");if(!t)return{};return(e=>{const t=e.trim().split(";"),i={};for(let e of t){e=e.trim();const t=e.indexOf("=");if(-1===t)continue;const n=e.substring(0,t).trim();if(!re.test(n))continue;let s=e.substring(t+1).trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.slice(1,-1)),oe.test(s)&&(i[n]=-1!==s.indexOf("%")?V(s,se):s)}return i})(t)})(i)}const o=await t(s,i);return o instanceof Response?o:(i.req.addValidatedData(e,o),await n())};const he=function(e,t,i,n){return le(e,(async(s,r)=>{let o=s;if("header"===e&&"_def"in t||"header"===e&&"_zod"in t){const e=Object.fromEntries(Object.keys("in"in t?t.in.shape:t.shape).map((e=>[e.toLowerCase(),e])));o=Object.fromEntries(Object.entries(s).map((([t,i])=>[e[t]||t,i])))}const a=n&&n.validationFunction?await n.validationFunction(t,o):await t.safeParseAsync(o);if(i){const t=await i({data:o,...a,target:e},r);if(t){if(t instanceof Response)return t;if("response"in t)return t.response}}return a.success?a.data:r.json(a,400)}))};var _e=(e,t,i)=>(n,s)=>{let r=-1;return async function o(a){if(a<=r)throw Error("next() called multiple times");let c;r=a;let u,d=!1;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&s||void 0,u)try{c=await u(n,(()=>o(a+1)))}catch(e){if(!(e instanceof Error&&t))throw e;n.error=e,c=await t(e,n),d=!0}else!1===n.finalized&&i&&(c=await i(n));return c&&(!1===n.finalized||d)&&(n.res=c),n}(0)},pe=Symbol(),fe=(e,t,i)=>{void 0!==e[t]?Array.isArray(e[t])?e[t].push(i):e[t]=[e[t],i]:e[t]=t.endsWith("[]")?[i]:i},me=(e,t,i)=>{let n=e;const s=t.split(".");s.forEach(((e,t)=>{t===s.length-1?n[e]=i:((!n[e]||"object"!=typeof n[e]||Array.isArray(n[e])||n[e]instanceof File)&&(n[e]=Object.create(null)),n=n[e])}))},ge=e=>V(e,se),ye=class{raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(e,t="/",i=[[]]){this.raw=e,this.path=t,this.#t=i,this.#e={}}param(e){return e?this.#i(e):this.#n()}#i(e){const t=this.#t[0][this.routeIndex][1][e],i=this.#s(t);return i&&/\%/.test(i)?ge(i):i}#n(){const e={},t=Object.keys(this.#t[0][this.routeIndex][1]);for(const i of t){const t=this.#s(this.#t[0][this.routeIndex][1][i]);void 0!==t&&(e[i]=/\%/.test(t)?ge(t):t)}return e}#s(e){return this.#t[1]?this.#t[1][e]:e}query(e){return ne(this.url,e)}queries(e){return((e,t)=>ie(this.url,t,!0))(0,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;const t={};return this.raw.headers.forEach(((e,i)=>{t[i]=e})),t}async parseBody(e){return this.bodyCache.parsedBody??=await(async(e,t=Object.create(null))=>{const{all:i=!1,dot:n=!1}=t,s=(e instanceof ye?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?async function(e,t){const i=await e.formData();return i?function(e,t){const i=Object.create(null);return e.forEach(((e,n)=>{t.all||n.endsWith("[]")?fe(i,n,e):i[n]=e})),t.dot&&Object.entries(i).forEach((([e,t])=>{e.includes(".")&&(me(i,e,t),delete i[e])})),i}(i,t):{}}(e,{all:i,dot:n}):{}})(this,e)}#r=e=>{const{bodyCache:t,raw:i}=this,n=t[e];if(n)return n;const s=Object.keys(t)[0];return s?t[s].then((t=>("json"===s&&(t=JSON.stringify(t)),new Response(t)[e]()))):t[e]=i[e]()};json(){return this.#r("text").then((e=>JSON.parse(e)))}text(){return this.#r("text")}arrayBuffer(){return this.#r("arrayBuffer")}blob(){return this.#r("blob")}formData(){return this.#r("formData")}addValidatedData(e,t){this.#e[e]=t}valid(e){return this.#e[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[pe](){return this.#t}get matchedRoutes(){return this.#t[0].map((([[,e]])=>e))}get routePath(){return this.#t[0].map((([[,e]])=>e))[this.routeIndex].path}},Ee=async(e,t,i,n,s)=>{"object"!=typeof e||e instanceof String||(e instanceof Promise||(e=""+e),e instanceof Promise&&(e=await e));const r=e.callbacks;return r?.length?(s?s[0]+=e:s=[e],Promise.all(r.map((e=>e({phase:t,buffer:s,context:n})))).then((e=>Promise.all(e.filter(Boolean).map((e=>Ee(e,t,!1,n,s)))).then((()=>s[0]))))):Promise.resolve(e)},be=(e,t)=>({"Content-Type":e,...t}),ve=class{#o;#a;env={};#c;finalized=!1;error;#u;#d;#l;#h;#_;#p;#f;#t;#m;constructor(e,t){this.#o=e,t&&(this.#d=t.executionCtx,this.env=t.env,this.#p=t.notFoundHandler,this.#m=t.path,this.#t=t.matchResult)}get req(){return this.#a??=new ye(this.#o,this.#m,this.#t),this.#a}get event(){if(this.#d&&"respondWith"in this.#d)return this.#d;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#d)return this.#d;throw Error("This context has no ExecutionContext")}get res(){return this.#l||=new Response(null,{headers:this.#f??=new Headers})}set res(e){if(this.#l&&e){e=new Response(e.body,e);for(const[t,i]of this.#l.headers.entries())if("content-type"!==t)if("set-cookie"===t){const t=this.#l.headers.getSetCookie();e.headers.delete("set-cookie");for(const i of t)e.headers.append("set-cookie",i)}else e.headers.set(t,i)}this.#l=e,this.finalized=!0}render=(...e)=>(this.#_??=e=>this.html(e),this.#_(...e));setLayout=e=>this.#h=e;getLayout=()=>this.#h;setRenderer=e=>{this.#_=e};header=(e,t,i)=>{this.finalized&&(this.#l=new Response(this.#l.body,this.#l));const n=this.#l?this.#l.headers:this.#f??=new Headers;void 0===t?n.delete(e):i?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#u=e};set=(e,t)=>{this.#c??=new Map,this.#c.set(e,t)};get=e=>this.#c?this.#c.get(e):void 0;get var(){return this.#c?Object.fromEntries(this.#c):{}}#g(e,t,i){const n=this.#l?new Headers(this.#l.headers):this.#f??new Headers;if("object"==typeof t&&"headers"in t){const e=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(const[t,i]of e)"set-cookie"===t.toLowerCase()?n.append(t,i):n.set(t,i)}if(i)for(const[e,t]of Object.entries(i))if("string"==typeof t)n.set(e,t);else{n.delete(e);for(const i of t)n.append(e,i)}const s="number"==typeof t?t:t?.status??this.#u;return new Response(e,{status:s,headers:n})}newResponse=(...e)=>this.#g(...e);body=(e,t,i)=>this.#g(e,t,i);text=(e,t,i)=>this.#f||this.#u||t||i||this.finalized?this.#g(e,t,be("text/plain; charset=UTF-8",i)):new Response(e);json=(e,t,i)=>this.#g(JSON.stringify(e),t,be("application/json",i));html=(e,t,i)=>{const n=e=>this.#g(e,t,be("text/html; charset=UTF-8",i));return"object"==typeof e?Ee(e,1,!1,{}).then(n):n(e)};redirect=(e,t)=>{const i=e+"";return this.header("Location",/[^\x00-\xFF]/.test(i)?encodeURI(i):i),this.newResponse(null,t??302)};notFound=()=>(this.#p??=()=>new Response,this.#p(this))},Oe="ALL",we=["get","post","put","delete","options","patch"],Ae="Can not add a route since the matcher is already built.",Se=class extends Error{},Ie=e=>e.text("404 Not Found",404),Ne=(e,t)=>{if("getResponse"in e){const i=e.getResponse();return t.newResponse(i.body,i)}return console.error(e),t.text("Internal Server Error",500)},Ce=class e{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#m="/";routes=[];constructor(e={}){[...we,"all"].forEach((e=>{this[e]=(t,...i)=>("string"==typeof t?this.#m=t:this.#y(e,this.#m,t),i.forEach((t=>{this.#y(e,this.#m,t)})),this)})),this.on=(e,t,...i)=>{for(const n of[t].flat()){this.#m=n;for(const t of[e].flat())i.map((e=>{this.#y(t.toUpperCase(),this.#m,e)}))}return this},this.use=(e,...t)=>("string"==typeof e?this.#m=e:(this.#m="*",t.unshift(e)),t.forEach((e=>{this.#y(Oe,this.#m,e)})),this);const{strict:t,...i}=e;Object.assign(this,i),this.getPath=t??1?e.getPath??Y:J}#E(){const t=new e({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#p=this.#p,t.routes=this.routes,t}#p=Ie;errorHandler=Ne;route(e,t){const i=this.basePath(e);return t.routes.map((e=>{let n;t.errorHandler===Ne?n=e.handler:(n=async(i,n)=>(await _e([],t.errorHandler)(i,(()=>e.handler(i,n)))).res,n.__COMPOSED_HANDLER=e.handler),i.#y(e.method,e.path,n)})),this}basePath(e){const t=this.#E();return t._basePath=Q(this._basePath,e),t}onError=e=>(this.errorHandler=e,this);notFound=e=>(this.#p=e,this);mount(e,t,i){let n,s;i&&("function"==typeof i?s=i:(s=i.optionHandler,n=!1===i.replaceRequest?e=>e:i.replaceRequest));const r=s?e=>{const t=s(e);return Array.isArray(t)?t:[t]}:e=>{let t;try{t=e.executionCtx}catch{}return[e.env,t]};return n||=(()=>{const t=Q(this._basePath,e),i="/"===t?0:t.length;return e=>{const t=new URL(e.url);return t.pathname=t.pathname.slice(i)||"/",new Request(t,e)}})(),this.#y(Oe,Q(e,"*"),(async(e,i)=>{const s=await t(n(e.req.raw),...r(e));if(s)return s;await i()})),this}#y(e,t,i){e=e.toUpperCase(),t=Q(this._basePath,t);const n={basePath:this._basePath,path:t,method:e,handler:i};this.router.add(e,t,[i,n]),this.routes.push(n)}#b(e,t){if(e instanceof Error)return this.errorHandler(e,t);throw e}#v(e,t,i,n){if("HEAD"===n)return(async()=>new Response(null,await this.#v(e,t,i,"GET")))();const s=this.getPath(e,{env:i}),r=this.router.match(n,s),o=new ve(e,{path:s,matchResult:r,env:i,executionCtx:t,notFoundHandler:this.#p});if(1===r[0].length){let e;try{e=r[0][0][0][0](o,(async()=>{o.res=await this.#p(o)}))}catch(e){return this.#b(e,o)}return e instanceof Promise?e.then((e=>e||(o.finalized?o.res:this.#p(o)))).catch((e=>this.#b(e,o))):e??this.#p(o)}const a=_e(r[0],this.errorHandler,this.#p);return(async()=>{try{const e=await a(o);if(!e.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return e.res}catch(e){return this.#b(e,o)}})()}fetch=(e,...t)=>this.#v(e,t[1],t[0],e.method);request=(e,t,i,n)=>e instanceof Request?this.fetch(t?new Request(e,t):e,i,n):(e=""+e,this.fetch(new Request(/^https?:\/\//.test(e)?e:"http://localhost"+Q("/",e),t),i,n));fire=()=>{addEventListener("fetch",(e=>{e.respondWith(this.#v(e.request,e,void 0,e.request.method))}))}},Te=[];function xe(e,t){const i=this.buildAllMatchers(),n=(e,t)=>{const n=i[e]||i[Oe],s=n[2][t];if(s)return s;const r=t.match(n[0]);if(!r)return[[],Te];const o=r.indexOf("",1);return[n[1][o],r]};return this.match=n,n(e,t)}var Re="[^/]+",ke=".*",De="(?:|/.*)",Le=Symbol(),je=new Set(".\\+*[^]$()");function Fe(e,t){return 1===e.length?1===t.length?e<t?-1:1:-1:1===t.length||e===ke||e===De?1:t===ke||t===De?-1:e===Re?1:t===Re?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Ue=class e{#O;#w;#A=Object.create(null);insert(t,i,n,s,r){if(0===t.length){if(void 0!==this.#O)throw Le;if(r)return;return void(this.#O=i)}const[o,...a]=t,c="*"===o?0===a.length?["","",ke]:["","",Re]:"/*"===o?["","",De]:o.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);let u;if(c){const t=c[1];let i=c[2]||Re;if(t&&c[2]){if(".*"===i)throw Le;if(i=i.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(i))throw Le}if(u=this.#A[i],!u){if(Object.keys(this.#A).some((e=>e!==ke&&e!==De)))throw Le;if(r)return;u=this.#A[i]=new e,""!==t&&(u.#w=s.varIndex++)}r||""===t||n.push([t,u.#w])}else if(u=this.#A[o],!u){if(Object.keys(this.#A).some((e=>e.length>1&&e!==ke&&e!==De)))throw Le;if(r)return;u=this.#A[o]=new e}u.insert(a,i,n,s,r)}buildRegExpStr(){const e=Object.keys(this.#A).sort(Fe).map((e=>{const t=this.#A[e];return("number"==typeof t.#w?`(${e})@${t.#w}`:je.has(e)?"\\"+e:e)+t.buildRegExpStr()}));return"number"==typeof this.#O&&e.unshift("#"+this.#O),0===e.length?"":1===e.length?e[0]:"(?:"+e.join("|")+")"}},Pe=class{#S={varIndex:0};#I=new Ue;insert(e,t,i){const n=[],s=[];for(let t=0;;){let i=!1;if(e=e.replace(/\{[^}]+\}/g,(e=>{const n="@\\"+t;return s[t]=[n,e],t++,i=!0,n})),!i)break}const r=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let e=s.length-1;e>=0;e--){const[t]=s[e];for(let i=r.length-1;i>=0;i--)if(-1!==r[i].indexOf(t)){r[i]=r[i].replace(t,s[e][1]);break}}return this.#I.insert(r,t,n,this.#S,i),n}buildRegExp(){let e=this.#I.buildRegExpStr();if(""===e)return[/^$/,[],[]];let t=0;const i=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,((e,s,r)=>void 0!==s?(i[++t]=Number(s),"$()"):void 0!==r?(n[Number(r)]=++t,""):"")),[RegExp("^"+e),i,n]}},Me=[/^$/,[],Object.create(null)],Ze=Object.create(null);function $e(e){return Ze[e]??=RegExp("*"===e?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,((e,t)=>t?"\\"+t:"(?:|/.*)"))}$`)}function He(e,t){if(e)for(const i of Object.keys(e).sort(((e,t)=>t.length-e.length)))if($e(i).test(t))return[...e[i]]}var ze,Ge,Be=class{name="RegExpRouter";#N;#C;constructor(){this.#N={[Oe]:Object.create(null)},this.#C={[Oe]:Object.create(null)}}add(e,t,i){const n=this.#N,s=this.#C;if(!n||!s)throw Error(Ae);n[e]||[n,s].forEach((t=>{t[e]=Object.create(null),Object.keys(t[Oe]).forEach((i=>{t[e][i]=[...t[Oe][i]]}))})),"/*"===t&&(t="*");const r=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){const o=$e(t);return e===Oe?Object.keys(n).forEach((e=>{n[e][t]||=He(n[e],t)||He(n[Oe],t)||[]})):n[e][t]||=He(n[e],t)||He(n[Oe],t)||[],Object.keys(n).forEach((t=>{e!==Oe&&e!==t||Object.keys(n[t]).forEach((e=>{o.test(e)&&n[t][e].push([i,r])}))})),void Object.keys(s).forEach((t=>{e!==Oe&&e!==t||Object.keys(s[t]).forEach((e=>o.test(e)&&s[t][e].push([i,r])))}))}const o=ee(t)||[t];for(let t=0,a=o.length;t<a;t++){const c=o[t];Object.keys(s).forEach((o=>{e!==Oe&&e!==o||(s[o][c]||=[...He(n[o],c)||He(n[Oe],c)||[]],s[o][c].push([i,r-a+t+1]))}))}}match=xe;buildAllMatchers(){const e=Object.create(null);return Object.keys(this.#C).concat(Object.keys(this.#N)).forEach((t=>{e[t]||=this.#T(t)})),this.#N=this.#C=void 0,Ze=Object.create(null),e}#T(e){const t=[];let i=e===Oe;return[this.#N,this.#C].forEach((n=>{const s=n[e]?Object.keys(n[e]).map((t=>[t,n[e][t]])):[];0!==s.length?(i||=!0,t.push(...s)):e!==Oe&&t.push(...Object.keys(n[Oe]).map((e=>[e,n[Oe][e]])))})),i?function(e){const t=new Pe,i=[];if(0===e.length)return Me;const n=e.map((e=>[!/\*|\/:/.test(e[0]),...e])).sort((([e,t],[i,n])=>e?1:i?-1:t.length-n.length)),s=Object.create(null);for(let e=0,r=-1,o=n.length;e<o;e++){const[o,a,c]=n[e];let u;o?s[a]=[c.map((([e])=>[e,Object.create(null)])),Te]:r++;try{u=t.insert(a,r,o)}catch(e){throw e===Le?new Se(a):e}o||(i[r]=c.map((([e,t])=>{const i=Object.create(null);for(t-=1;t>=0;t--){const[e,n]=u[t];i[e]=n}return[e,i]})))}const[r,o,a]=t.buildRegExp();for(let e=0,t=i.length;e<t;e++)for(let t=0,n=i[e].length;t<n;t++){const n=i[e][t]?.[1];if(!n)continue;const s=Object.keys(n);for(let e=0,t=s.length;e<t;e++)n[s[e]]=a[n[s[e]]]}const c=[];for(const e in o)c[e]=i[o[e]];return[r,c,s]}(t):null}},qe=class{name="SmartRouter";#x=[];#C=[];constructor(e){this.#x=e.routers}add(e,t,i){if(!this.#C)throw Error(Ae);this.#C.push([e,t,i])}match(e,t){if(!this.#C)throw Error("Fatal error");const i=this.#x,n=this.#C,s=i.length;let r,o=0;for(;o<s;o++){const s=i[o];try{for(let e=0,t=n.length;e<t;e++)s.add(...n[e]);r=s.match(e,t)}catch(e){if(e instanceof Se)continue;throw e}this.match=s.match.bind(s),this.#x=[s],this.#C=void 0;break}if(o===s)throw Error("Fatal error");return this.name="SmartRouter + "+this.activeRouter.name,r}get activeRouter(){if(this.#C||1!==this.#x.length)throw Error("No active router has been determined yet.");return this.#x[0]}},Ke=Object.create(null),We=class e{#R;#A;#k;#D=0;#L=Ke;constructor(e,t,i){if(this.#A=i||Object.create(null),this.#R=[],e&&t){const i=Object.create(null);i[e]={handler:t,possibleKeys:[],score:0},this.#R=[i]}this.#k=[]}insert(t,i,n){this.#D=++this.#D;let s=this;const r=(e=>{const{groups:t,path:i}=(e=>{const t=[];return e=e.replace(/\{[^}]+\}/g,((e,i)=>{const n="@"+i;return t.push([n,e]),n})),{groups:t,path:e}})(e);return((e,t)=>{for(let i=t.length-1;i>=0;i--){const[n]=t[i];for(let s=e.length-1;s>=0;s--)if(e[s].includes(n)){e[s]=e[s].replace(n,t[i][1]);break}}return e})(q(i),t)})(i),o=[];for(let t=0,i=r.length;t<i;t++){const i=r[t],n=W(i,r[t+1]),a=Array.isArray(n)?n[0]:i;a in s.#A?(s=s.#A[a],n&&o.push(n[1])):(s.#A[a]=new e,n&&(s.#k.push(n),o.push(n[1])),s=s.#A[a])}return s.#R.push({[t]:{handler:n,possibleKeys:o.filter(((e,t,i)=>i.indexOf(e)===t)),score:this.#D}}),s}#j(e,t,i,n){const s=[];for(let r=0,o=e.#R.length;r<o;r++){const o=e.#R[r],a=o[t]||o[Oe],c={};if(void 0!==a&&(a.params=Object.create(null),s.push(a),i!==Ke||n&&n!==Ke))for(let e=0,t=a.possibleKeys.length;e<t;e++){const t=a.possibleKeys[e],s=c[a.score];a.params[t]=n?.[t]&&!s?n[t]:i[t]??n?.[t],c[a.score]=!0}}return s}search(e,t){const i=[];this.#L=Ke;let n=[this];const s=q(t),r=[];for(let t=0,o=s.length;t<o;t++){const a=s[t],c=t===o-1,u=[];for(let o=0,d=n.length;o<d;o++){const d=n[o],l=d.#A[a];l&&(l.#L=d.#L,c?(l.#A["*"]&&i.push(...this.#j(l.#A["*"],e,d.#L)),i.push(...this.#j(l,e,d.#L))):u.push(l));for(let n=0,o=d.#k.length;n<o;n++){const o=d.#k[n],l=d.#L===Ke?{}:{...d.#L};if("*"===o){const t=d.#A["*"];t&&(i.push(...this.#j(t,e,d.#L)),t.#L=l,u.push(t));continue}const[h,_,p]=o;if(!(a||p instanceof RegExp))continue;const f=d.#A[h],m=s.slice(t).join("/");if(p instanceof RegExp){const t=p.exec(m);if(t){if(l[_]=t[0],i.push(...this.#j(f,e,d.#L,l)),Object.keys(f.#A).length){f.#L=l;const e=t[0].match(/\//)?.length??0;(r[e]||=[]).push(f)}continue}}(!0===p||p.test(a))&&(l[_]=a,c?(i.push(...this.#j(f,e,l,d.#L)),f.#A["*"]&&i.push(...this.#j(f.#A["*"],e,l,d.#L))):(f.#L=l,u.push(f)))}}n=u.concat(r.shift()??[])}return i.length>1&&i.sort(((e,t)=>e.score-t.score)),[i.map((({handler:e,params:t})=>[e,t]))]}},Ve=class{name="TrieRouter";#F;constructor(){this.#F=new We}add(e,t,i){const n=ee(t);if(n)for(let t=0,s=n.length;t<s;t++)this.#F.insert(e,n[t],i);else this.#F.insert(e,t,i)}match(e,t){return this.#F.search(e,t)}},Xe=class extends Ce{constructor(e={}){super(e),this.router=e.router??new qe({routers:[new Be,new Ve]})}};!function(e){e.assertEqual=()=>{},e.assertIs=function(){},e.assertNever=function(){throw Error()},e.arrayToEnum=e=>{const t={};for(const i of e)t[i]=i;return t},e.getValidEnumValues=t=>{const i=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of i)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},e.find=(e,t)=>{for(const i of e)if(t(i))return i},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?""+t:t}(ze||(ze={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Ge||(Ge={}));const Ye=ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Je=e=>{switch(typeof e){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(e)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(e)?Ye.array:null===e?Ye.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Ye.promise:"undefined"!=typeof Map&&e instanceof Map?Ye.map:"undefined"!=typeof Set&&e instanceof Set?Ye.set:void 0!==Date&&e instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Qe=ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class et extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},i={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)i._errors.push(t(s));else{let e=i,n=0;for(;n<s.path.length;){const i=s.path[n];n===s.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(t(s))):e[i]=e[i]||{_errors:[]},e=e[i],n++}}};return n(this),i}static assert(e){if(!(e instanceof et))throw Error("Not a ZodError: "+e)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},i=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}et.create=e=>new et(e);const tt=(e,t)=>{let i;switch(e.code){case Qe.invalid_type:i=e.received===Ye.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Qe.invalid_literal:i="Invalid literal value, expected "+JSON.stringify(e.expected,ze.jsonStringifyReplacer);break;case Qe.unrecognized_keys:i="Unrecognized key(s) in object: "+ze.joinValues(e.keys,", ");break;case Qe.invalid_union:i="Invalid input";break;case Qe.invalid_union_discriminator:i="Invalid discriminator value. Expected "+ze.joinValues(e.options);break;case Qe.invalid_enum_value:i=`Invalid enum value. Expected ${ze.joinValues(e.options)}, received '${e.received}'`;break;case Qe.invalid_arguments:i="Invalid function arguments";break;case Qe.invalid_return_type:i="Invalid function return type";break;case Qe.invalid_date:i="Invalid date";break;case Qe.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:ze.assertNever(e.validation):i="regex"!==e.validation?"Invalid "+e.validation:"Invalid";break;case Qe.too_small:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Qe.too_big:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Qe.custom:i="Invalid input";break;case Qe.invalid_intersection_types:i="Intersection results could not be merged";break;case Qe.not_multiple_of:i="Number must be a multiple of "+e.multipleOf;break;case Qe.not_finite:i="Number must be finite";break;default:i=t.defaultError,ze.assertNever(e)}return{message:i}};let it=tt;function nt(){return it}const st=e=>{const{data:t,path:i,errorMaps:n,issueData:s}=e,r=[...i,...s.path||[]],o={...s,path:r};if(void 0!==s.message)return{...s,path:r,message:s.message};let a="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)a=e(o,{data:t,defaultError:a}).message;return{...s,path:r,message:a}};function rt(e,t){const i=nt(),n=st({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===tt?void 0:tt].filter((e=>!!e))});e.common.issues.push(n)}class ot{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const n of t){if("aborted"===n.status)return at;"dirty"===n.status&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const e of t){const t=await e.key,n=await e.value;i.push({key:t,value:n})}return ot.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return at;if("aborted"===s.status)return at;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(i[t.value]=s.value)}return{status:e.value,value:i}}}const at=Object.freeze({status:"aborted"}),ct=e=>({status:"dirty",value:e}),ut=e=>({status:"valid",value:e}),dt=e=>"aborted"===e.status,lt=e=>"dirty"===e.status,ht=e=>"valid"===e.status,_t=e=>"undefined"!=typeof Promise&&e instanceof Promise;var pt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(pt||(pt={}));class ft{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const mt=(e,t)=>{if(ht(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new et(e.common.issues);return this._error=t,this._error}}};function gt(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:n,description:s}=e;if(t&&(i||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??s.defaultError}:void 0===s.data?{message:r??n??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:r??i??s.defaultError}},description:s}}class yt{get description(){return this._def.description}_getType(e){return Je(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Je(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ot,ctx:{common:e.parent.common,data:e.data,parsedType:Je(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(_t(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){const i={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Je(e)},n=this._parseSync({data:e,path:i.path,parent:i});return mt(i,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Je(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return ht(i)?{value:i.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>ht(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Je(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(_t(n)?n:Promise.resolve(n));return mt(i,s)}refine(e,t){const i=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),r=()=>n.addIssue({code:Qe.custom,...i(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(r(),!1))):!!s||(r(),!1)}))}refinement(e,t){return this._refinement(((i,n)=>!!e(i)||(n.addIssue("function"==typeof t?t(i,n):t),!1)))}_refinement(e){return new bi({schema:this,typeName:Di.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return vi.create(this,this._def)}nullable(){return Oi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ti.create(this)}promise(){return Ei.create(this,this._def)}or(e){return si.create([this,e],this._def)}and(e){return ci.create(this,e,this._def)}transform(e){return new bi({...gt(this._def),schema:this,typeName:Di.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new wi({...gt(this._def),innerType:this,defaultValue:t,typeName:Di.ZodDefault})}brand(){return new Ni({typeName:Di.ZodBranded,type:this,...gt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ai({...gt(this._def),innerType:this,catchValue:t,typeName:Di.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ci.create(this,e)}readonly(){return Ti.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Et=/^c[^\s-]{8,}$/i,bt=/^[0-9a-z]+$/,vt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ot=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wt=/^[a-z0-9_-]{21}$/i,At=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,St=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,It=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Nt;const Ct=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Rt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Lt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",jt=RegExp(`^${Lt}$`);function Ft(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t+="(\\.\\d+)?"),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function Ut(e){return RegExp(`^${Ft(e)}$`)}function Pt(e){let t=`${Lt}T${Ft(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,RegExp(`^${t}$`)}function Mt(e,t){return!("v4"!==t&&t||!Ct.test(e))||!("v6"!==t&&t||!xt.test(e))}function Zt(e,t){if(!At.test(e))return!1;try{const[i]=e.split(".");if(!i)return!1;const n=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),s=JSON.parse(atob(n));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function $t(e,t){return!("v4"!==t&&t||!Tt.test(e))||!("v6"!==t&&t||!Rt.test(e))}class Ht extends yt{_parse(e){if(this._def.coerce&&(e.data=e.data+""),this._getType(e)!==Ye.string){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.string,received:t.parsedType}),at}const t=new ot;let i;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const s=e.data.length>n.value,r=e.data.length<n.value;(s||r)&&(i=this._getOrReturnCtx(e,i),s?rt(i,{code:Qe.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&rt(i,{code:Qe.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)It.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"email",code:Qe.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)Nt||(Nt=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Nt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"emoji",code:Qe.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)Ot.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"uuid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)wt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"nanoid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)Et.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"cuid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)bt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"cuid2",code:Qe.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)vt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"ulid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),rt(i,{validation:"url",code:Qe.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"regex",code:Qe.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?Pt(n).test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?jt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?Ut(n).test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?St.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"duration",code:Qe.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?Mt(e.data,n.version)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"ip",code:Qe.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?Zt(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"jwt",code:Qe.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?$t(e.data,n.version)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"cidr",code:Qe.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?kt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"base64",code:Qe.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?Dt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"base64url",code:Qe.invalid_string,message:n.message}),t.dirty()):ze.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,i){return this.refinement((t=>e.test(t)),{validation:t,code:Qe.invalid_string,...pt.errToObj(i)})}_addCheck(e){return new Ht({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...pt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...pt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...pt.errToObj(e)})}datetime(e){return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,local:!1,message:e}:{kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...pt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return this._addCheck("string"==typeof e?{kind:"time",precision:null,message:e}:{kind:"time",precision:void 0===e?.precision?null:e?.precision,...pt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...pt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...pt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...pt.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...pt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...pt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...pt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...pt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...pt.errToObj(t)})}nonempty(e){return this.min(1,pt.errToObj(e))}trim(){return new Ht({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ht({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ht({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function zt(e,t){const i=((""+e).split(".")[1]||"").length,n=((""+t).split(".")[1]||"").length,s=i>n?i:n;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}Ht.create=e=>new Ht({checks:[],typeName:Di.ZodString,coerce:e?.coerce??!1,...gt(e)});class Gt extends yt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ye.number){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.number,received:t.parsedType}),at}let t;const i=new ot;for(const n of this._def.checks)"int"===n.kind?ze.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"multipleOf"===n.kind?0!==zt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.not_finite,message:n.message}),i.dirty()):ze.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,pt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pt.toString(t))}setLimit(e,t,i,n){return new Gt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:pt.toString(n)}]})}_addCheck(e){return new Gt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:pt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&ze.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Gt.create=e=>new Gt({checks:[],typeName:Di.ZodNumber,coerce:e?.coerce||!1,...gt(e)});class Bt extends yt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ye.bigint)return this._getInvalidInput(e);let t;const i=new ot;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):ze.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.bigint,received:t.parsedType}),at}gte(e,t){return this.setLimit("min",e,!0,pt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pt.toString(t))}setLimit(e,t,i,n){return new Bt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:pt.toString(n)}]})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Bt.create=e=>new Bt({checks:[],typeName:Di.ZodBigInt,coerce:e?.coerce??!1,...gt(e)});class qt extends yt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ye.boolean){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.boolean,received:t.parsedType}),at}return ut(e.data)}}qt.create=e=>new qt({typeName:Di.ZodBoolean,coerce:e?.coerce||!1,...gt(e)});class Kt extends yt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ye.date){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.date,received:t.parsedType}),at}if(Number.isNaN(e.data.getTime()))return rt(this._getOrReturnCtx(e),{code:Qe.invalid_date}),at;const t=new ot;let i;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):ze.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Kt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:pt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:pt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Kt.create=e=>new Kt({checks:[],coerce:e?.coerce||!1,typeName:Di.ZodDate,...gt(e)});class Wt extends yt{_parse(e){if(this._getType(e)!==Ye.symbol){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.symbol,received:t.parsedType}),at}return ut(e.data)}}Wt.create=e=>new Wt({typeName:Di.ZodSymbol,...gt(e)});class Vt extends yt{_parse(e){if(this._getType(e)!==Ye.undefined){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.undefined,received:t.parsedType}),at}return ut(e.data)}}Vt.create=e=>new Vt({typeName:Di.ZodUndefined,...gt(e)});class Xt extends yt{_parse(e){if(this._getType(e)!==Ye.null){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.null,received:t.parsedType}),at}return ut(e.data)}}Xt.create=e=>new Xt({typeName:Di.ZodNull,...gt(e)});class Yt extends yt{constructor(){super(...arguments),this._any=!0}_parse(e){return ut(e.data)}}Yt.create=e=>new Yt({typeName:Di.ZodAny,...gt(e)});class Jt extends yt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ut(e.data)}}Jt.create=e=>new Jt({typeName:Di.ZodUnknown,...gt(e)});class Qt extends yt{_parse(e){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.never,received:t.parsedType}),at}}Qt.create=e=>new Qt({typeName:Di.ZodNever,...gt(e)});class ei extends yt{_parse(e){if(this._getType(e)!==Ye.undefined){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.void,received:t.parsedType}),at}return ut(e.data)}}ei.create=e=>new ei({typeName:Di.ZodVoid,...gt(e)});class ti extends yt{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==Ye.array)return rt(t,{code:Qe.invalid_type,expected:Ye.array,received:t.parsedType}),at;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(rt(t,{code:e?Qe.too_big:Qe.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(rt(t,{code:Qe.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(rt(t,{code:Qe.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map(((e,i)=>n.type._parseAsync(new ft(t,e,t.path,i))))).then((e=>ot.mergeArray(i,e)));const s=[...t.data].map(((e,i)=>n.type._parseSync(new ft(t,e,t.path,i))));return ot.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new ti({...this._def,minLength:{value:e,message:pt.toString(t)}})}max(e,t){return new ti({...this._def,maxLength:{value:e,message:pt.toString(t)}})}length(e,t){return new ti({...this._def,exactLength:{value:e,message:pt.toString(t)}})}nonempty(e){return this.min(1,e)}}function ii(e){if(e instanceof ni){const t={};for(const i in e.shape)t[i]=vi.create(ii(e.shape[i]));return new ni({...e._def,shape:()=>t})}return e instanceof ti?new ti({...e._def,type:ii(e.element)}):e instanceof vi?vi.create(ii(e.unwrap())):e instanceof Oi?Oi.create(ii(e.unwrap())):e instanceof ui?ui.create(e.items.map((e=>ii(e)))):e}ti.create=(e,t)=>new ti({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Di.ZodArray,...gt(t)});class ni extends yt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=ze.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Ye.object){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.object,received:t.parsedType}),at}const{status:t,ctx:i}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),r=[];if(!(this._def.catchall instanceof Qt&&"strip"===this._def.unknownKeys))for(const e in i.data)s.includes(e)||r.push(e);const o=[];for(const e of s)o.push({key:{status:"valid",value:e},value:n[e]._parse(new ft(i,i.data[e],i.path,e)),alwaysSet:e in i.data});if(this._def.catchall instanceof Qt){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)o.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)r.length>0&&(rt(i,{code:Qe.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r)o.push({key:{status:"valid",value:t},value:e._parse(new ft(i,i.data[t],i.path,t)),alwaysSet:t in i.data})}return i.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const i=await t.key,n=await t.value;e.push({key:i,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>ot.mergeObjectSync(t,e))):ot.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return new ni({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{const n=this._def.errorMap?.(t,i).message??i.defaultError;return"unrecognized_keys"===t.code?{message:pt.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new ni({...this._def,unknownKeys:"strip"})}passthrough(){return new ni({...this._def,unknownKeys:"passthrough"})}extend(e){return new ni({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ni({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Di.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ni({...this._def,catchall:e})}pick(e){const t={};for(const i of ze.objectKeys(e))e[i]&&this.shape[i]&&(t[i]=this.shape[i]);return new ni({...this._def,shape:()=>t})}omit(e){const t={};for(const i of ze.objectKeys(this.shape))e[i]||(t[i]=this.shape[i]);return new ni({...this._def,shape:()=>t})}deepPartial(){return ii(this)}partial(e){const t={};for(const i of ze.objectKeys(this.shape)){const n=this.shape[i];t[i]=e&&!e[i]?n:n.optional()}return new ni({...this._def,shape:()=>t})}required(e){const t={};for(const i of ze.objectKeys(this.shape))if(e&&!e[i])t[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof vi;)e=e._def.innerType;t[i]=e}return new ni({...this._def,shape:()=>t})}keyof(){return mi(ze.objectKeys(this.shape))}}ni.create=(e,t)=>new ni({shape:()=>e,unknownKeys:"strip",catchall:Qt.create(),typeName:Di.ZodObject,...gt(t)}),ni.strictCreate=(e,t)=>new ni({shape:()=>e,unknownKeys:"strict",catchall:Qt.create(),typeName:Di.ZodObject,...gt(t)}),ni.lazycreate=(e,t)=>new ni({shape:e,unknownKeys:"strip",catchall:Qt.create(),typeName:Di.ZodObject,...gt(t)});class si extends yt{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map((async e=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;const i=e.map((e=>new et(e.ctx.common.issues)));return rt(t,{code:Qe.invalid_union,unionErrors:i}),at}));{let e;const n=[];for(const s of i){const i={...t,common:{...t.common,issues:[]},parent:null},r=s._parseSync({data:t.data,path:t.path,parent:i});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:i}),i.common.issues.length&&n.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new et(e)));return rt(t,{code:Qe.invalid_union,unionErrors:s}),at}}get options(){return this._def.options}}si.create=(e,t)=>new si({options:e,typeName:Di.ZodUnion,...gt(t)});const ri=e=>e instanceof pi?ri(e.schema):e instanceof bi?ri(e.innerType()):e instanceof fi?[e.value]:e instanceof gi?e.options:e instanceof yi?ze.objectValues(e.enum):e instanceof wi?ri(e._def.innerType):e instanceof Vt?[void 0]:e instanceof Xt?[null]:e instanceof vi?[void 0,...ri(e.unwrap())]:e instanceof Oi?[null,...ri(e.unwrap())]:e instanceof Ni||e instanceof Ti?ri(e.unwrap()):e instanceof Ai?ri(e._def.innerType):[];class oi extends yt{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ye.object)return rt(t,{code:Qe.invalid_type,expected:Ye.object,received:t.parsedType}),at;const i=this.discriminator,n=this.optionsMap.get(t.data[i]);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(rt(t,{code:Qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),at)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const n=new Map;for(const i of t){const t=ri(i.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw Error(`Discriminator property ${e+""} has duplicate value ${s+""}`);n.set(s,i)}}return new oi({typeName:Di.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...gt(i)})}}function ai(e,t){const i=Je(e),n=Je(t);if(e===t)return{valid:!0,data:e};if(i===Ye.object&&n===Ye.object){const i=ze.objectKeys(t),n=ze.objectKeys(e).filter((e=>-1!==i.indexOf(e))),s={...e,...t};for(const i of n){const n=ai(e[i],t[i]);if(!n.valid)return{valid:!1};s[i]=n.data}return{valid:!0,data:s}}if(i===Ye.array&&n===Ye.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let n=0;n<e.length;n++){const s=ai(e[n],t[n]);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}return i===Ye.date&&n===Ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ci extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=(e,n)=>{if(dt(e)||dt(n))return at;const s=ai(e.value,n.value);return s.valid?((lt(e)||lt(n))&&t.dirty(),{status:t.value,value:s.data}):(rt(i,{code:Qe.invalid_intersection_types}),at)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}ci.create=(e,t,i)=>new ci({left:e,right:t,typeName:Di.ZodIntersection,...gt(i)});class ui extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.array)return rt(i,{code:Qe.invalid_type,expected:Ye.array,received:i.parsedType}),at;if(i.data.length<this._def.items.length)return rt(i,{code:Qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),at;!this._def.rest&&i.data.length>this._def.items.length&&(rt(i,{code:Qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...i.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new ft(i,e,i.path,t)):null})).filter((e=>!!e));return i.common.async?Promise.all(n).then((e=>ot.mergeArray(t,e))):ot.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ui({...this._def,rest:e})}}ui.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ui({items:e,typeName:Di.ZodTuple,rest:null,...gt(t)})};class di extends yt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.object)return rt(i,{code:Qe.invalid_type,expected:Ye.object,received:i.parsedType}),at;const n=[],s=this._def.keyType,r=this._def.valueType;for(const e in i.data)n.push({key:s._parse(new ft(i,e,i.path,e)),value:r._parse(new ft(i,i.data[e],i.path,e)),alwaysSet:e in i.data});return i.common.async?ot.mergeObjectAsync(t,n):ot.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,i){return new di(t instanceof yt?{keyType:e,valueType:t,typeName:Di.ZodRecord,...gt(i)}:{keyType:Ht.create(),valueType:e,typeName:Di.ZodRecord,...gt(t)})}}class li extends yt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.map)return rt(i,{code:Qe.invalid_type,expected:Ye.map,received:i.parsedType}),at;const n=this._def.keyType,s=this._def.valueType,r=[...i.data.entries()].map((([e,t],r)=>({key:n._parse(new ft(i,e,i.path,[r,"key"])),value:s._parse(new ft(i,t,i.path,[r,"value"]))})));if(i.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const i of r){const n=await i.key,s=await i.value;if("aborted"===n.status||"aborted"===s.status)return at;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const i of r){const n=i.key,s=i.value;if("aborted"===n.status||"aborted"===s.status)return at;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}li.create=(e,t,i)=>new li({valueType:t,keyType:e,typeName:Di.ZodMap,...gt(i)});class hi extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.set)return rt(i,{code:Qe.invalid_type,expected:Ye.set,received:i.parsedType}),at;const n=this._def;null!==n.minSize&&i.data.size<n.minSize.value&&(rt(i,{code:Qe.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&i.data.size>n.maxSize.value&&(rt(i,{code:Qe.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function r(e){const i=new Set;for(const n of e){if("aborted"===n.status)return at;"dirty"===n.status&&t.dirty(),i.add(n.value)}return{status:t.value,value:i}}const o=[...i.data.values()].map(((e,t)=>s._parse(new ft(i,e,i.path,t))));return i.common.async?Promise.all(o).then((e=>r(e))):r(o)}min(e,t){return new hi({...this._def,minSize:{value:e,message:pt.toString(t)}})}max(e,t){return new hi({...this._def,maxSize:{value:e,message:pt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}hi.create=(e,t)=>new hi({valueType:e,minSize:null,maxSize:null,typeName:Di.ZodSet,...gt(t)});class _i extends yt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ye.function)return rt(t,{code:Qe.invalid_type,expected:Ye.function,received:t.parsedType}),at;function i(e,i){return st({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nt(),tt].filter((e=>!!e)),issueData:{code:Qe.invalid_arguments,argumentsError:i}})}function n(e,i){return st({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nt(),tt].filter((e=>!!e)),issueData:{code:Qe.invalid_return_type,returnTypeError:i}})}const s={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Ei){const e=this;return ut((async function(...t){const o=new et([]),a=await e._def.args.parseAsync(t,s).catch((e=>{throw o.addIssue(i(t,e)),o})),c=await Reflect.apply(r,this,a);return await e._def.returns._def.type.parseAsync(c,s).catch((e=>{throw o.addIssue(n(c,e)),o}))}))}{const e=this;return ut((function(...t){const o=e._def.args.safeParse(t,s);if(!o.success)throw new et([i(t,o.error)]);const a=Reflect.apply(r,this,o.data),c=e._def.returns.safeParse(a,s);if(!c.success)throw new et([n(a,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new _i({...this._def,args:ui.create(e).rest(Jt.create())})}returns(e){return new _i({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new _i({args:e||ui.create([]).rest(Jt.create()),returns:t||Jt.create(),typeName:Di.ZodFunction,...gt(i)})}}class pi extends yt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}pi.create=(e,t)=>new pi({getter:e,typeName:Di.ZodLazy,...gt(t)});class fi extends yt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return rt(t,{received:t.data,code:Qe.invalid_literal,expected:this._def.value}),at}return{status:"valid",value:e.data}}get value(){return this._def.value}}function mi(e,t){return new gi({values:e,typeName:Di.ZodEnum,...gt(t)})}fi.create=(e,t)=>new fi({value:e,typeName:Di.ZodLiteral,...gt(t)});class gi extends yt{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return rt(t,{expected:ze.joinValues(this._def.values),received:t.parsedType,code:Qe.invalid_type}),at}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e);return rt(t,{received:t.data,code:Qe.invalid_enum_value,options:this._def.values}),at}return ut(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return gi.create(e,{...this._def,...t})}exclude(e,t=this._def){return gi.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}gi.create=mi;class yi extends yt{_parse(e){const t=ze.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==Ye.string&&i.parsedType!==Ye.number){const e=ze.objectValues(t);return rt(i,{expected:ze.joinValues(e),received:i.parsedType,code:Qe.invalid_type}),at}if(this._cache||(this._cache=new Set(ze.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=ze.objectValues(t);return rt(i,{received:i.data,code:Qe.invalid_enum_value,options:e}),at}return ut(e.data)}get enum(){return this._def.values}}yi.create=(e,t)=>new yi({values:e,typeName:Di.ZodNativeEnum,...gt(t)});class Ei extends yt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ye.promise&&!1===t.common.async)return rt(t,{code:Qe.invalid_type,expected:Ye.promise,received:t.parsedType}),at;const i=t.parsedType===Ye.promise?t.data:Promise.resolve(t.data);return ut(i.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ei.create=(e,t)=>new Ei({type:e,typeName:Di.ZodPromise,...gt(t)});class bi extends yt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Di.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{rt(i,e),e.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(i.data,s);if(i.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return at;const n=await this._def.schema._parseAsync({data:e,path:i.path,parent:i});return"aborted"===n.status?at:"dirty"===n.status||"dirty"===t.value?ct(n.value):n}));{if("aborted"===t.value)return at;const n=this._def.schema._parseSync({data:e,path:i.path,parent:i});return"aborted"===n.status?at:"dirty"===n.status||"dirty"===t.value?ct(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===i.common.async){const n=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===n.status?at:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((i=>"aborted"===i.status?at:("dirty"===i.status&&t.dirty(),e(i.value).then((()=>({status:t.value,value:i.value}))))))}if("transform"===n.type){if(!1===i.common.async){const e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ht(e))return at;const r=n.transform(e.value,s);if(r instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((e=>ht(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):at))}ze.assertNever(n)}}bi.create=(e,t,i)=>new bi({schema:e,typeName:Di.ZodEffects,effect:t,...gt(i)}),bi.createWithPreprocess=(e,t,i)=>new bi({schema:t,effect:{type:"preprocess",transform:e},typeName:Di.ZodEffects,...gt(i)});class vi extends yt{_parse(e){return this._getType(e)===Ye.undefined?ut(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vi.create=(e,t)=>new vi({innerType:e,typeName:Di.ZodOptional,...gt(t)});class Oi extends yt{_parse(e){return this._getType(e)===Ye.null?ut(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oi.create=(e,t)=>new Oi({innerType:e,typeName:Di.ZodNullable,...gt(t)});class wi extends yt{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===Ye.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}wi.create=(e,t)=>new wi({innerType:e,typeName:Di.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...gt(t)});class Ai extends yt{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return _t(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new et(i.common.issues)},input:i.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new et(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Ai.create=(e,t)=>new Ai({innerType:e,typeName:Di.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...gt(t)});class Si extends yt{_parse(e){if(this._getType(e)!==Ye.nan){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.nan,received:t.parsedType}),at}return{status:"valid",value:e.data}}}Si.create=e=>new Si({typeName:Di.ZodNaN,...gt(e)});const Ii=Symbol("zod_brand");class Ni extends yt{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ci extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?at:"dirty"===e.status?(t.dirty(),ct(e.value)):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})();{const e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?at:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new Ci({in:e,out:t,typeName:Di.ZodPipeline})}}class Ti extends yt{_parse(e){const t=this._def.innerType._parse(e),i=e=>(ht(e)&&(e.value=Object.freeze(e.value)),e);return _t(t)?t.then((e=>i(e))):i(t)}unwrap(){return this._def.innerType}}function xi(e,t){const i="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof i?{message:i}:i}function Ri(e,t={},i){return e?Yt.create().superRefine(((n,s)=>{const r=e(n);if(r instanceof Promise)return r.then((e=>{if(!e){const e=xi(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}}));if(!r){const e=xi(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}})):Yt.create()}Ti.create=(e,t)=>new Ti({innerType:e,typeName:Di.ZodReadonly,...gt(t)});const ki={object:ni.lazycreate};var Di;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Di||(Di={}));const Li=Ht.create,ji=Gt.create,Fi=Si.create,Ui=Bt.create,Pi=qt.create,Mi=Kt.create,Zi=Wt.create,$i=Vt.create,Hi=Xt.create,zi=Yt.create,Gi=Jt.create,Bi=Qt.create,qi=ei.create,Ki=ti.create,Wi=ni.create,Vi=ni.strictCreate,Xi=si.create,Yi=oi.create,Ji=ci.create,Qi=ui.create,en=di.create,tn=li.create,nn=hi.create,sn=_i.create,rn=pi.create,on=fi.create,an=gi.create,cn=yi.create,un=Ei.create,dn=bi.create,ln=vi.create,hn=Oi.create,_n=bi.createWithPreprocess,pn=Ci.create,fn={string:e=>Ht.create({...e,coerce:!0}),number:e=>Gt.create({...e,coerce:!0}),boolean:e=>qt.create({...e,coerce:!0}),bigint:e=>Bt.create({...e,coerce:!0}),date:e=>Kt.create({...e,coerce:!0})};var mn=Object.freeze({__proto__:null,BRAND:Ii,DIRTY:ct,EMPTY_PATH:[],INVALID:at,NEVER:at,OK:ut,ParseStatus:ot,Schema:yt,ZodAny:Yt,ZodArray:ti,ZodBigInt:Bt,ZodBoolean:qt,ZodBranded:Ni,ZodCatch:Ai,ZodDate:Kt,ZodDefault:wi,ZodDiscriminatedUnion:oi,ZodEffects:bi,ZodEnum:gi,ZodError:et,get ZodFirstPartyTypeKind(){return Di},ZodFunction:_i,ZodIntersection:ci,ZodIssueCode:Qe,ZodLazy:pi,ZodLiteral:fi,ZodMap:li,ZodNaN:Si,ZodNativeEnum:yi,ZodNever:Qt,ZodNull:Xt,ZodNullable:Oi,ZodNumber:Gt,ZodObject:ni,ZodOptional:vi,ZodParsedType:Ye,ZodPipeline:Ci,ZodPromise:Ei,ZodReadonly:Ti,ZodRecord:di,ZodSchema:yt,ZodSet:hi,ZodString:Ht,ZodSymbol:Wt,ZodTransformer:bi,ZodTuple:ui,ZodType:yt,ZodUndefined:Vt,ZodUnion:si,ZodUnknown:Jt,ZodVoid:ei,addIssueToContext:rt,any:zi,array:Ki,bigint:Ui,boolean:Pi,coerce:fn,custom:Ri,date:Mi,datetimeRegex:Pt,defaultErrorMap:tt,discriminatedUnion:Yi,effect:dn,enum:an,function:sn,getErrorMap:nt,getParsedType:Je,instanceof:(e,t={message:"Input not instance of "+e.name})=>Ri((t=>t instanceof e),t),intersection:Ji,isAborted:dt,isAsync:_t,isDirty:lt,isValid:ht,late:ki,lazy:rn,literal:on,makeIssue:st,map:tn,nan:Fi,nativeEnum:cn,never:Bi,null:Hi,nullable:hn,number:ji,object:Wi,get objectUtil(){return Ge},oboolean:()=>Pi().optional(),onumber:()=>ji().optional(),optional:ln,ostring:()=>Li().optional(),pipeline:pn,preprocess:_n,promise:un,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:en,set:nn,setErrorMap:function(e){it=e},strictObject:Vi,string:Li,symbol:Zi,transformer:dn,tuple:Qi,undefined:$i,union:Xi,unknown:Gi,get util(){return ze},void:qi});function gn(e,t){const i={};return Object.keys(e.paths).forEach((n=>{i[Q(t.replaceAll(/:([^\/]+)/g,"{$1}"),n)]=e.paths[n]})),{...e,paths:i}}function yn(e){return/^application\/([a-z-\.]+\+)?json/.test(e)}function En(e){return e.startsWith("multipart/form-data")||e.startsWith("application/x-www-form-urlencoded")}c(mn);var bn,vn=Object.freeze({__proto__:null,OpenAPIHono:class e extends Xe{openAPIRegistry;defaultHook;constructor(e){super(e),this.openAPIRegistry=new y,this.defaultHook=e?.defaultHook}openapi=({middleware:e,hide:t,...i},n,s=this.defaultHook)=>{t||this.openAPIRegistry.registerPath(i);const r=[];if(i.request?.query){const e=he("query",i.request.query,s);r.push(e)}if(i.request?.params){const e=he("param",i.request.params,s);r.push(e)}if(i.request?.headers){const e=he("header",i.request.headers,s);r.push(e)}if(i.request?.cookies){const e=he("cookie",i.request.cookies,s);r.push(e)}const o=i.request?.body?.content;if(o)for(const e of Object.keys(o)){if(!o[e])continue;const t=o[e].schema;if(t instanceof yt){if(yn(e)){const e=he("json",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&yn(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("json",{}),await i()})}if(En(e)){const e=he("form",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&En(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("form",{}),await i()})}}}const a=e?Array.isArray(e)?e:[e]:[];return this.on([i.method],i.path.replaceAll(/\/{(.+?)}/g,"/:$1"),...a,...r,n),this};getOpenAPIDocument=e=>{const t=new H(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?gn(t,this._basePath):t};getOpenAPI31Document=e=>{const t=new B(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?gn(t,this._basePath):t};doc=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPIDocument(i);return e.json(t)}catch(t){return e.json(t,500)}}));doc31=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPI31Document(i);return e.json(t)}catch(t){return e.json(t,500)}}));route(t,i){const n=t.replaceAll(/:([^\/]+)/g,"{$1}");return super.route(t,i),i instanceof e?(i.openAPIRegistry.definitions.forEach((e=>{switch(e.type){case"component":return this.openAPIRegistry.registerComponent(e.componentType,e.name,e.component);case"route":return void this.openAPIRegistry.registerPath({...e.route,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.route.path)});case"webhook":return void this.openAPIRegistry.registerWebhook({...e.webhook,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.webhook.path)});case"schema":return this.openAPIRegistry.register(e.schema._def.openapi._internal.refId,e.schema);case"parameter":return this.openAPIRegistry.registerParameter(e.schema._def.openapi._internal.refId,e.schema);default:throw Error("Unknown registry type: "+e)}})),this):this}basePath(t){return new e({...super.basePath(t),defaultHook:this.defaultHook})}},createRoute:e=>{const t={...e,getRoutingPath:()=>e.path.replaceAll(/\/{(.+?)}/g,"/:$1")};return Object.defineProperty(t,"getRoutingPath",{enumerable:!1})},extendZodWithOpenApi:c,z:mn}),On=e(vn),wn=(bn||(bn=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=On,i=t.z.object({created_at:t.z.string(),updated_at:t.z.string()}),n=t.z.enum(["AUTH0","EMAIL","REDIRECT"]),s=t.z.enum(["CREATE_USER","GET_USER","UPDATE_USER","SEND_REQUEST","SEND_EMAIL"]),r=t.z.enum(["VERIFY_EMAIL"]),o=t.z.object({require_mx_record:t.z.boolean().optional(),block_aliases:t.z.boolean().optional(),block_free_emails:t.z.boolean().optional(),block_disposable_emails:t.z.boolean().optional(),blocklist:t.z.array(t.z.string()).optional(),allowlist:t.z.array(t.z.string()).optional()}),a=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("AUTH0"),action:t.z.literal("UPDATE_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({connection_id:t.z.string().optional(),user_id:t.z.string(),changes:t.z.record(t.z.string(),t.z.any())})}),c=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("EMAIL"),action:t.z.literal("VERIFY_EMAIL"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({email:t.z.string(),rules:o.optional()})}),u=t.z.enum(["change-email","account","custom"]),d=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("REDIRECT"),action:t.z.literal("REDIRECT_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({target:u.openapi({description:"The predefined target to redirect to, or 'custom' for a custom URL"}),custom_url:t.z.string().optional().openapi({description:"Custom URL to redirect to when target is 'custom'"})})}),l=t.z.union([a,c,d]),h=t.z.object({name:t.z.string().min(1).max(150).openapi({description:"The name of the flow"}),actions:t.z.array(l).optional().default([]).openapi({description:"The list of actions to execute in sequence"})}),_=h.extend({...i.shape,id:t.z.string().openapi({description:"Unique identifier for the flow",example:"af_12tMpdJ3iek7svMyZkSh5M"})}),p=t.z.object({page:t.z.string().min(0).optional().default("0").transform((e=>parseInt(e,10))).openapi({description:"The page number where 0 is the first page"}),per_page:t.z.string().min(1).optional().default("10").transform((e=>parseInt(e,10))).openapi({description:"The number of items per page"}),include_totals:t.z.string().optional().default("false").transform((e=>"true"===e)).openapi({description:"If the total number of items should be included in the response"}),sort:t.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:"A property that should have the format 'string:-1' or 'string:1'"}),q:t.z.string().optional().openapi({description:"A lucene query string used to filter the results"})}),f=t.z.object({start:t.z.number(),limit:t.z.number(),length:t.z.number(),total:t.z.number().optional()}),m=t.z.object({email:t.z.string().optional(),email_verified:t.z.boolean().optional(),name:t.z.string().optional(),username:t.z.string().optional(),given_name:t.z.string().optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),family_name:t.z.string().optional()}).catchall(t.z.any()),g=t.z.object({connection:t.z.string(),user_id:t.z.string(),provider:t.z.string(),isSocial:t.z.boolean(),access_token:t.z.string().optional(),access_token_secret:t.z.string().optional(),refresh_token:t.z.string().optional(),profileData:m.optional()}),y=t.z.object({email:t.z.string().optional().transform((e=>e&&e.toLowerCase())),username:t.z.string().optional(),phone_number:t.z.string().optional(),given_name:t.z.string().optional(),family_name:t.z.string().optional(),nickname:t.z.string().optional(),name:t.z.string().optional(),picture:t.z.string().optional(),locale:t.z.string().optional(),linked_to:t.z.string().optional(),profileData:t.z.string().optional(),user_id:t.z.string().optional(),app_metadata:t.z.any().default({}).optional(),user_metadata:t.z.any().default({}).optional()}),E=y.extend({email_verified:t.z.boolean().default(!1),verify_email:t.z.boolean().optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string().optional(),provider:t.z.string().optional(),connection:t.z.string(),is_social:t.z.boolean().optional()}),b=t.z.object({...E.shape,...i.shape,user_id:t.z.string(),provider:t.z.string(),is_social:t.z.boolean(),email:t.z.string().optional(),login_count:t.z.number().default(0),identities:t.z.array(g).optional()}),v=b,O=y.extend({login_count:t.z.number(),multifactor:t.z.array(t.z.string()).optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string()}).catchall(t.z.any()),w=t.z.object({client_id:t.z.string().openapi({description:"ID of this client."}),name:t.z.string().min(1).openapi({description:"Name of this client (min length: 1 character, does not allow < or >)."}),description:t.z.string().max(140).optional().openapi({description:"Free text description of this client (max length: 140 characters)."}),global:t.z.boolean().default(!1).openapi({description:"Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false)."}),client_secret:t.z.string().default((()=>((e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[e]];return t})())).optional().openapi({description:"Client secret (which you must not make public)."}),app_type:t.z.enum(["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:t.z.string().url().optional().openapi({description:"URL of the logo to display for this client. Recommended size is 150x150 pixels."}),is_first_party:t.z.boolean().default(!1).openapi({description:"Whether this client a first party client (true) or not (false)."}),oidc_conformant:t.z.boolean().default(!0).openapi({description:"Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false)."}),callbacks:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication."}),allowed_origins:t.z.array(t.z.string()).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:t.z.array(t.z.string()).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:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of audiences/realms for SAML protocol. Used by the wsfed addon."}),allowed_clients:t.z.array(t.z.string()).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:t.z.array(t.z.string()).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:t.z.array(t.z.string()).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:t.z.record(t.z.any()).default({}).optional().openapi({description:"Native to Web SSO Configuration"}),oidc_logout:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration for OIDC backchannel logout"}),grant_types:t.z.array(t.z.string()).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:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration related to JWTs for the client."}),signing_keys:t.z.array(t.z.record(t.z.any())).default([]).optional().openapi({description:"Signing certificates associated with this client."}),encryption_key:t.z.record(t.z.any()).default({}).optional().openapi({description:"Encryption used for WsFed responses with this client."}),sso:t.z.boolean().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:t.z.boolean().default(!0).openapi({description:"Whether Single Sign On is disabled (true) or enabled (true). Defaults to true."}),cross_origin_authentication:t.z.boolean().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:t.z.string().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:t.z.boolean().default(!1).openapi({description:"Whether a custom login page is to be used (true) or the default provided login page (false)."}),custom_login_page:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page."}),custom_login_page_preview:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page. (Used on Previews)"}),form_template:t.z.string().optional().openapi({description:"HTML form template to be used for WS-Federation."}),addons:t.z.record(t.z.any()).default({}).optional().openapi({description:"Addons enabled for this client and their associated configurations."}),token_endpoint_auth_method:t.z.enum(["none","client_secret_post","client_secret_basic"]).default("client_secret_basic").optional().openapi({description:"Defines the requested authentication method for the token endpoint. Can be none (public client without a client secret), client_secret_post (client uses HTTP POST parameters), or client_secret_basic (client uses HTTP Basic)."}),client_metadata:t.z.record(t.z.string().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]'}),mobile:t.z.record(t.z.any()).default({}).optional().openapi({description:"Additional configuration for native mobile apps."}),initiate_login_uri:t.z.string().url().optional().openapi({description:"Initiate login uri, must be https"}),native_social_login:t.z.record(t.z.any()).default({}).optional(),refresh_token:t.z.record(t.z.any()).default({}).optional().openapi({description:"Refresh token configuration"}),default_organization:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines the default Organization ID and flows"}),organization_usage:t.z.enum(["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:t.z.enum(["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:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines client authentication methods."}),require_pushed_authorization_requests:t.z.boolean().default(!1).openapi({description:"Makes the use of Pushed Authorization Requests mandatory for this client"}),require_proof_of_possession:t.z.boolean().default(!1).openapi({description:"Makes the use of Proof-of-Possession mandatory for this client"}),signed_request_object:t.z.record(t.z.any()).default({}).optional().openapi({description:"JWT-secured Authorization Requests (JAR) settings."}),compliance_level:t.z.enum(["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:t.z.number().optional().openapi({description:"Specifies how long, in seconds, a Pushed Authorization Request URI remains valid"}),token_quota:t.z.record(t.z.any()).default({}).optional()}),A=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),...w.shape}),S=t.z.object({client_id:t.z.string().min(1).openapi({description:"ID of the client."}),audience:t.z.string().min(1).openapi({description:"The audience (API identifier) of this client grant."}),scope:t.z.array(t.z.string()).optional().openapi({description:"Scopes allowed for this client grant."}),organization_usage:t.z.enum(["deny","allow","require"]).optional().openapi({description:"Defines whether organizations can be used with client credentials exchanges for this grant."}),allow_any_organization:t.z.boolean().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:t.z.boolean().optional().openapi({description:"If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly."}),subject_type:t.z.enum(["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:t.z.array(t.z.string()).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."})}),I=t.z.object({id:t.z.string().openapi({description:"ID of the client grant."}),...S.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),N=t.z.array(I),C=t.z.object({x:t.z.number(),y:t.z.number()});var T=(e=>(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))(T||{}),x=(e=>(e.BLOCK="BLOCK",e.FIELD="FIELD",e))(x||{});const R=t.z.object({id:t.z.string(),category:t.z.nativeEnum(x),type:t.z.nativeEnum(T)}),k=R.extend({category:t.z.literal("BLOCK"),type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string()}).passthrough()}),D=R.extend({category:t.z.literal("BLOCK"),type:t.z.union([t.z.literal("NEXT_BUTTON"),t.z.literal("BACK_BUTTON"),t.z.literal("SUBMIT_BUTTON")]),config:t.z.object({text:t.z.string()}).passthrough()}),L=R.extend({category:t.z.literal("FIELD"),type:t.z.literal("LEGAL"),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({text:t.z.string()}).passthrough()}),j=R.extend({category:t.z.literal("FIELD"),type:t.z.union([t.z.literal("TEXT"),t.z.literal("EMAIL"),t.z.literal("PASSWORD"),t.z.literal("NUMBER"),t.z.literal("PHONE"),t.z.literal("DATE"),t.z.literal("CHECKBOX"),t.z.literal("RADIO"),t.z.literal("SELECT"),t.z.literal("HIDDEN")]),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({label:t.z.string().optional(),placeholder:t.z.string().optional()}).passthrough()}),F=t.z.object({id:t.z.string(),category:t.z.string(),type:t.z.string()}).passthrough(),U=t.z.union([k,D,L,j,F]);var P=(e=>(e.STEP="STEP",e.FLOW="FLOW",e.CONDITION="CONDITION",e.ACTION="ACTION",e))(P||{});const M=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:C,alias:t.z.string().optional(),config:t.z.object({components:t.z.array(U),next_node:t.z.string()}).passthrough()}),Z=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:C,alias:t.z.string().optional(),config:t.z.object({flow_id:t.z.string(),next_node:t.z.string()})}),$=t.z.object({id:t.z.string(),type:t.z.literal("ACTION"),coordinates:C,alias:t.z.string().optional(),config:t.z.object({action_type:t.z.enum(["REDIRECT"]).openapi({description:"The type of action to perform"}),target:t.z.enum(["change-email","account","custom"]).openapi({description:"The predefined target to redirect to"}),custom_url:t.z.string().optional().openapi({description:"Custom URL when target is 'custom'"}),next_node:t.z.string().openapi({description:"The next node to navigate to after action (for non-redirect actions)"})}).passthrough()}),H=t.z.object({id:t.z.string(),type:t.z.string(),coordinates:C}).passthrough(),z=t.z.union([M,Z,$,H]),G=t.z.object({next_node:t.z.string(),coordinates:C}).passthrough(),B=t.z.object({resume_flow:t.z.boolean().optional(),coordinates:C}).passthrough(),q=t.z.object({id:t.z.string(),name:t.z.string(),languages:t.z.object({primary:t.z.string()}).passthrough(),nodes:t.z.array(z),start:G,ending:B,created_at:t.z.string(),updated_at:t.z.string(),links:t.z.object({sdkSrc:t.z.string().optional(),sdk_src:t.z.string().optional()}).passthrough()}).passthrough(),K=q.omit({id:!0,created_at:!0,updated_at:!0});var W=(e=>(e.TOKEN="token",e.TOKEN_ID_TOKEN="token id_token",e.CODE="code",e))(W||{}),V=(e=>(e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post",e.WEB_MESSAGE="web_message",e.SAML_POST="saml_post",e))(V||{}),X=(e=>(e.S256="S256",e.Plain="plain",e))(X||{});const Y=t.z.object({client_id:t.z.string(),act_as:t.z.string().optional(),response_type:t.z.nativeEnum(W).optional(),response_mode:t.z.nativeEnum(V).optional(),redirect_uri:t.z.string().optional(),audience:t.z.string().optional(),organization:t.z.string().optional(),state:t.z.string().optional(),nonce:t.z.string().optional(),scope:t.z.string().optional(),prompt:t.z.string().optional(),code_challenge_method:t.z.nativeEnum(X).optional(),code_challenge:t.z.string().optional(),username:t.z.string().optional(),ui_locales:t.z.string().optional(),vendor_id:t.z.string().optional()}),J=t.z.object({colors:t.z.object({primary:t.z.string(),page_background:t.z.object({type:t.z.string().optional(),start:t.z.string().optional(),end:t.z.string().optional(),angle_deg:t.z.number().optional()}).optional()}).optional(),logo_url:t.z.string().optional(),favicon_url:t.z.string().optional(),powered_by_logo_url:t.z.string().optional(),font:t.z.object({url:t.z.string()}).optional()}),Q=t.z.object({kid:t.z.string().optional(),team_id:t.z.string().optional(),realms:t.z.string().optional(),authentication_method:t.z.string().optional(),client_id:t.z.string().optional(),client_secret:t.z.string().optional(),app_secret:t.z.string().optional(),scope:t.z.string().optional(),authorization_endpoint:t.z.string().optional(),token_endpoint:t.z.string().optional(),userinfo_endpoint:t.z.string().optional(),jwks_uri:t.z.string().optional(),discovery_url:t.z.string().optional(),issuer:t.z.string().optional(),provider:t.z.string().optional(),from:t.z.string().optional(),twilio_sid:t.z.string().optional(),twilio_token:t.z.string().optional(),icon_url:t.z.string().optional()}),ee=t.z.object({id:t.z.string().optional(),name:t.z.string(),display_name:t.z.string().optional(),strategy:t.z.string(),options:Q.default({}),enabled_clients:t.z.array(t.z.string()).default([]).optional(),response_type:t.z.custom().optional(),response_mode:t.z.custom().optional(),is_domain_connection:t.z.boolean().optional(),show_as_button:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional(),is_system:t.z.boolean().optional()}),te=t.z.object({id:t.z.string(),created_at:t.z.string().transform((e=>null===e?"":e)),updated_at:t.z.string().transform((e=>null===e?"":e))}).extend(ee.shape),ie=t.z.object({id:t.z.string().optional(),audience:t.z.string(),friendly_name:t.z.string(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sender_email:t.z.string().email(),sender_name:t.z.string(),session_lifetime:t.z.number().optional(),idle_session_lifetime:t.z.number().optional(),ephemeral_session_lifetime:t.z.number().optional(),idle_ephemeral_session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),allowed_logout_urls:t.z.array(t.z.string()).optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_changing_enable_sso:t.z.boolean().optional(),allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),change_pwd_flow_v1:t.z.boolean().optional(),custom_domains_provisioning:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),disable_impersonation:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),enable_sso:t.z.boolean().optional(),enforce_client_authentication_on_passwordless_start:t.z.boolean().optional(),genai_trial:t.z.boolean().optional(),improved_signup_bot_detection_in_classic:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional(),no_disclose_enterprise_connections:t.z.boolean().optional(),remove_alg_from_jwks:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),trust_azure_adfs_email_verified_connection_property:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),inherit_global_permissions_in_organizations:t.z.boolean().optional()}).optional(),sandbox_version:t.z.string().optional(),legacy_sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),device_flow:t.z.object({charset:t.z.enum(["base20","digits"]).optional(),mask:t.z.string().max(20).optional()}).optional(),default_token_quota:t.z.object({clients:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional(),organizations:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional(),oidc_logout:t.z.object({rp_logout_end_session_endpoint_discovery:t.z.boolean().optional()}).optional(),allow_organization_name_in_authentication_api:t.z.boolean().optional(),customize_mfa_in_postlogin_action:t.z.boolean().optional(),acr_values_supported:t.z.array(t.z.string()).optional(),mtls:t.z.object({enable_endpoint_aliases:t.z.boolean().optional()}).optional(),pushed_authorization_requests_supported:t.z.boolean().optional(),authorization_response_iss_parameter_supported:t.z.boolean().optional()}),ne=t.z.object({created_at:t.z.string().nullable().transform((e=>e??"")),updated_at:t.z.string().nullable().transform((e=>e??"")),...ie.shape,id:t.z.string()}),se=t.z.object({...A.shape,tenant:ne,connections:t.z.array(te)}),re=t.z.enum(["password_reset","email_verification","otp","authorization_code","oauth2_state","ticket"]),oe=t.z.object({code_id:t.z.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:t.z.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:t.z.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:re,code_verifier:t.z.string().optional().openapi({description:"The code verifier used in PKCE in outbound flows"}),code_challenge:t.z.string().optional().openapi({description:"The code challenge used in PKCE in outbound flows"}),code_challenge_method:t.z.enum(["plain","S256"]).optional().openapi({description:"The code challenge method used in PKCE in outbound flows"}),redirect_uri:t.z.string().optional().openapi({description:"The redirect URI associated with the code"}),nonce:t.z.string().optional().openapi({description:"The nonce value used for security in OIDC flows"}),state:t.z.string().optional().openapi({description:"The state parameter used for CSRF protection in OAuth flows"}),expires_at:t.z.string(),used_at:t.z.string().optional(),user_id:t.z.string().optional()}),ae=t.z.object({...oe.shape,created_at:t.z.string()}),ce=t.z.object({domain:t.z.string(),custom_domain_id:t.z.string().optional(),type:t.z.enum(["auth0_managed_certs","self_managed_certs"]),verification_method:t.z.enum(["txt"]).optional(),tls_policy:t.z.enum(["recommended"]).optional(),custom_client_ip_header:t.z.enum(["true-client-ip","cf-connecting-ip","x-forwarded-for","x-azure-clientip","null"]).optional(),domain_metadata:t.z.record(t.z.string().max(255)).optional()}),ue=t.z.object({name:t.z.literal("txt"),record:t.z.string(),domain:t.z.string()}),de=t.z.object({...ce.shape,custom_domain_id:t.z.string(),primary:t.z.boolean(),status:t.z.enum(["disabled","pending","pending_verification","ready"]),origin_domain_name:t.z.string().optional(),verification:t.z.object({methods:t.z.array(ue)}).optional(),tls_policy:t.z.string().optional()}),le=de.extend({tenant_id:t.z.string()}),he=t.z.object({id:t.z.string(),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0)}),_e=he.extend({category:t.z.literal("BLOCK").optional()}),pe=_e.extend({type:t.z.literal("DIVIDER"),config:t.z.object({}).optional()}),fe=_e.extend({type:t.z.literal("HTML"),config:t.z.object({content:t.z.string().optional()}).optional()}),me=_e.extend({type:t.z.literal("IMAGE"),config:t.z.object({src:t.z.string().optional(),alt:t.z.string().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional()}),ge=_e.extend({type:t.z.literal("JUMP_BUTTON"),config:t.z.object({text:t.z.string().optional(),target_step:t.z.string().optional()})}),ye=_e.extend({type:t.z.literal("RESEND_BUTTON"),config:t.z.object({text:t.z.string().optional(),resend_action:t.z.string().optional()})}),Ee=_e.extend({type:t.z.literal("NEXT_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),be=_e.extend({type:t.z.literal("PREVIOUS_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),ve=_e.extend({type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string().optional()}).optional()}),Oe=he.extend({category:t.z.literal("WIDGET").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),we=Oe.extend({type:t.z.literal("AUTH0_VERIFIABLE_CREDENTIALS"),config:t.z.object({credential_type:t.z.string().optional()})}),Ae=Oe.extend({type:t.z.literal("GMAPS_ADDRESS"),config:t.z.object({api_key:t.z.string().optional()})}),Se=Oe.extend({type:t.z.literal("RECAPTCHA"),config:t.z.object({site_key:t.z.string().optional()})}),Ie=he.extend({category:t.z.literal("FIELD").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),Ne=Ie.extend({type:t.z.literal("BOOLEAN"),config:t.z.object({default_value:t.z.boolean().optional()}).optional()}),Ce=Ie.extend({type:t.z.literal("CARDS"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string(),description:t.z.string().optional(),image:t.z.string().optional()})).optional(),multi_select:t.z.boolean().optional()}).optional()}),Te=Ie.extend({type:t.z.literal("CHOICE"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),display:t.z.enum(["radio","checkbox"]).optional()}).optional()}),xe=Ie.extend({type:t.z.literal("CUSTOM"),config:t.z.object({component:t.z.string().optional(),props:t.z.record(t.z.any()).optional()})}),Re=Ie.extend({type:t.z.literal("DATE"),config:t.z.object({format:t.z.string().optional(),min:t.z.string().optional(),max:t.z.string().optional()}).optional()}),ke=Ie.extend({type:t.z.literal("DROPDOWN"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),placeholder:t.z.string().optional(),searchable:t.z.boolean().optional()}).optional()}),De=Ie.extend({type:t.z.literal("EMAIL"),config:t.z.object({placeholder:t.z.string().optional()}).optional()}),Le=Ie.extend({type:t.z.literal("FILE"),config:t.z.object({accept:t.z.string().optional(),max_size:t.z.number().optional(),multiple:t.z.boolean().optional()}).optional()}),je=Ie.extend({type:t.z.literal("LEGAL"),config:t.z.object({text:t.z.string(),html:t.z.boolean().optional()}).optional()}),Fe=Ie.extend({type:t.z.literal("NUMBER"),config:t.z.object({placeholder:t.z.string().optional(),min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional()}).optional()}),Ue=Ie.extend({type:t.z.literal("PASSWORD"),config:t.z.object({placeholder:t.z.string().optional(),min_length:t.z.number().optional(),show_toggle:t.z.boolean().optional(),forgot_password_link:t.z.string().optional()}).optional()}),Pe=Ie.extend({type:t.z.literal("PAYMENT"),config:t.z.object({provider:t.z.string().optional(),currency:t.z.string().optional()}).optional()}),Me=Ie.extend({type:t.z.literal("SOCIAL"),config:t.z.object({providers:t.z.array(t.z.string()).optional()}).optional()}),Ze=Ie.extend({type:t.z.literal("TEL"),config:t.z.object({placeholder:t.z.string().optional(),default_country:t.z.string().optional()}).optional()}),$e=Ie.extend({type:t.z.literal("TEXT"),config:t.z.object({placeholder:t.z.string().optional(),multiline:t.z.boolean().optional(),max_length:t.z.number().optional()}).optional()}),He=Ie.extend({type:t.z.literal("URL"),config:t.z.object({placeholder:t.z.string().optional()}).optional()}),ze=t.z.discriminatedUnion("type",[pe,fe,me,ge,ye,Ee,be,ve]),Ge=t.z.discriminatedUnion("type",[we,Ae,Se]),Be=t.z.discriminatedUnion("type",[Ne,Ce,Te,xe,Re,ke,De,Le,je,Fe,Ue,Pe,Me,Ze,$e,He]),qe=t.z.union([ze,Ge,Be]),Ke=t.z.object({id:t.z.string(),type:t.z.literal("submit"),label:t.z.string(),className:t.z.string().optional(),disabled:t.z.boolean().optional().default(!1),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0),customizations:t.z.record(t.z.string(),t.z.any()).optional()}),We=t.z.object({x:t.z.number(),y:t.z.number()}),Ve=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:We,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({flow_id:t.z.string().max(30),next_node:t.z.string().optional()})}),Xe=t.z.object({id:t.z.string(),type:t.z.literal("ROUTER"),coordinates:We,alias:t.z.string().min(1).max(150),config:t.z.object({rules:t.z.array(t.z.object({id:t.z.string(),alias:t.z.string().min(1).max(150).optional(),condition:t.z.any(),next_node:t.z.string()})),fallback:t.z.string()})}),Ye=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:We,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({components:t.z.array(qe),next_node:t.z.string().optional()})}),Je=t.z.discriminatedUnion("type",[Ve,Xe,Ye]),Qe=t.z.object({name:t.z.string().openapi({description:"The name of the form"}),messages:t.z.object({errors:t.z.record(t.z.string(),t.z.any()).optional(),custom:t.z.record(t.z.string(),t.z.any()).optional()}).optional(),languages:t.z.object({primary:t.z.string().optional(),default:t.z.string().optional()}).optional(),translations:t.z.record(t.z.string(),t.z.any()).optional(),nodes:t.z.array(Je).optional(),start:t.z.object({hidden_fields:t.z.array(t.z.object({key:t.z.string(),value:t.z.string()})).optional(),next_node:t.z.string().optional(),coordinates:We.optional()}).optional(),ending:t.z.object({redirection:t.z.object({delay:t.z.number().optional(),target:t.z.string().optional()}).optional(),after_submit:t.z.object({flow_id:t.z.string().optional()}).optional(),coordinates:We.optional(),resume_flow:t.z.boolean().optional()}).optional(),style:t.z.object({css:t.z.string().optional()}).optional()}).openapi({description:"Schema for flow-based forms (matches Auth0 Forms structure)"}),et=t.z.object({...i.shape,...Qe.shape,id:t.z.string()}),tt=t.z.object({id:t.z.number().optional(),text:t.z.string(),type:t.z.enum(["info","error","success","warning"])}),it=t.z.object({id:t.z.string().optional(),text:t.z.string(),href:t.z.string(),linkText:t.z.string().optional()}),nt=t.z.object({action:t.z.string(),method:t.z.enum(["POST","GET"]),title:t.z.string().optional(),description:t.z.string().optional(),components:t.z.array(qe),messages:t.z.array(tt).optional(),links:t.z.array(it).optional()}),st=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),rt=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),ot={enabled:t.z.boolean().default(!1),synchronous:t.z.boolean().default(!1),priority:t.z.number().optional(),hook_id:t.z.string().optional()},at=t.z.object({...ot,trigger_id:st,url:t.z.string()}),ct=t.z.object({...ot,trigger_id:rt,form_id:t.z.string()}),ut=t.z.union([at,ct]),dt=t.z.object({...ot,trigger_id:st,...i.shape,hook_id:t.z.string(),url:t.z.string()}),lt=t.z.object({...ot,trigger_id:rt,...i.shape,hook_id:t.z.string(),form_id:t.z.string()}),ht=t.z.union([dt,lt]),_t=t.z.object({name:t.z.string().optional()}),pt=t.z.object({email:t.z.string().optional()}),ft=t.z.object({organization_id:t.z.string().max(50),inviter:_t,invitee:pt,invitation_url:t.z.string().url(),client_id:t.z.string(),connection_id:t.z.string().optional(),app_metadata:t.z.record(t.z.any()).default({}).optional(),user_metadata:t.z.record(t.z.any()).default({}).optional(),ttl_sec:t.z.number().int().max(2592e3).default(604800).optional(),roles:t.z.array(t.z.string()).default([]).optional(),send_invitation_email:t.z.boolean().default(!0).optional()}),mt=t.z.object({id:t.z.string(),organization_id:t.z.string().max(50),created_at:t.z.string().datetime(),expires_at:t.z.string().datetime(),ticket_id:t.z.string().optional()}).extend(ft.shape),gt=t.z.object({alg:t.z.enum(["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512"]),e:t.z.string(),kid:t.z.string(),kty:t.z.enum(["RSA","EC","oct"]),n:t.z.string(),x5t:t.z.string().optional(),x5c:t.z.array(t.z.string()).optional(),use:t.z.enum(["sig","enc"]).optional()}),yt=t.z.object({keys:t.z.array(gt)}),Et=t.z.object({issuer:t.z.string(),authorization_endpoint:t.z.string(),token_endpoint:t.z.string(),device_authorization_endpoint:t.z.string(),userinfo_endpoint:t.z.string(),mfa_challenge_endpoint:t.z.string(),jwks_uri:t.z.string(),registration_endpoint:t.z.string(),revocation_endpoint:t.z.string(),scopes_supported:t.z.array(t.z.string()),response_types_supported:t.z.array(t.z.string()),code_challenge_methods_supported:t.z.array(t.z.string()),response_modes_supported:t.z.array(t.z.string()),subject_types_supported:t.z.array(t.z.string()),id_token_signing_alg_values_supported:t.z.array(t.z.string()),token_endpoint_auth_methods_supported:t.z.array(t.z.string()),claims_supported:t.z.array(t.z.string()),request_uri_parameter_supported:t.z.boolean(),request_parameter_supported:t.z.boolean(),token_endpoint_auth_signing_alg_values_supported:t.z.array(t.z.string())});var bt=(e=>(e.PENDING="pending",e.AUTHENTICATED="authenticated",e.AWAITING_EMAIL_VERIFICATION="awaiting_email_verification",e.AWAITING_HOOK="awaiting_hook",e.AWAITING_CONTINUATION="awaiting_continuation",e.COMPLETED="completed",e.FAILED="failed",e.EXPIRED="expired",e))(bt||{});const vt=t.z.nativeEnum(bt),Ot=t.z.object({csrf_token:t.z.string(),auth0Client:t.z.string().optional(),authParams:Y,expires_at:t.z.string(),deleted_at:t.z.string().optional(),ip:t.z.string().optional(),useragent:t.z.string().optional(),session_id:t.z.string().optional(),authorization_url:t.z.string().optional(),state:vt.optional().default("pending"),state_data:t.z.string().optional(),failure_reason:t.z.string().optional(),user_id:t.z.string().optional()}).openapi({description:"This represents a login sesion"}),wt=t.z.object({...Ot.shape,id:t.z.string().openapi({description:"This is is used as the state in the universal login"}),created_at:t.z.string(),updated_at:t.z.string()}),At={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",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",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_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_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"},St=t.z.string().refine((e=>Object.values(At).includes(e)),{message:"Invalid log type"}),It=t.z.object({name:t.z.string(),version:t.z.string(),env:t.z.object({node:t.z.string().optional()}).optional()}),Nt=t.z.object({country_code:t.z.string().length(2),city_name:t.z.string(),latitude:t.z.string(),longitude:t.z.string(),time_zone:t.z.string(),continent_code:t.z.string()}),Ct=t.z.object({type:St,date:t.z.string(),description:t.z.string().optional(),ip:t.z.string().optional(),user_agent:t.z.string().optional(),details:t.z.any().optional(),isMobile:t.z.boolean(),user_id:t.z.string().optional(),user_name:t.z.string().optional(),connection:t.z.string().optional(),connection_id:t.z.string().optional(),client_id:t.z.string().optional(),client_name:t.z.string().optional(),audience:t.z.string().optional(),scope:t.z.string().optional(),strategy:t.z.string().optional(),strategy_type:t.z.string().optional(),hostname:t.z.string().optional(),auth0_client:It.optional(),log_id:t.z.string().optional(),location_info:Nt.optional()}),Tt=t.z.object({...Ct.shape,log_id:t.z.string()}),xt=t.z.object({id:t.z.string().optional(),user_id:t.z.string(),password:t.z.string(),algorithm:t.z.enum(["bcrypt","argon2id"]).default("argon2id"),is_current:t.z.boolean().default(!0)}),Rt=xt.extend({id:t.z.string(),created_at:t.z.string(),updated_at:t.z.string()}),kt=t.z.object({initial_user_agent:t.z.string().describe("First user agent of the device from which this user logged in"),initial_ip:t.z.string().describe("First IP address associated with this session"),initial_asn:t.z.string().describe("First autonomous system number associated with this session"),last_user_agent:t.z.string().describe("Last user agent of the device from which this user logged in"),last_ip:t.z.string().describe("Last IP address from which this user logged in"),last_asn:t.z.string().describe("Last autonomous system number from which this user logged in")}),Dt=t.z.object({id:t.z.string(),revoked_at:t.z.string().optional(),used_at:t.z.string().optional(),user_id:t.z.string().describe("The user ID associated with the session"),expires_at:t.z.string().optional(),login_session_id:t.z.string(),idle_expires_at:t.z.string().optional(),device:kt.describe("Metadata related to the device used in the session"),clients:t.z.array(t.z.string()).describe("List of client details for the session")}),Lt=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),authenticated_at:t.z.string(),last_interaction_at:t.z.string(),...Dt.shape}),jt=t.z.object({kid:t.z.string().openapi({description:"The key id of the signing key"}),cert:t.z.string().openapi({description:"The public certificate of the signing key"}),fingerprint:t.z.string().openapi({description:"The cert fingerprint"}),thumbprint:t.z.string().openapi({description:"The cert thumbprint"}),pkcs7:t.z.string().optional().openapi({description:"The private key in pkcs7 format"}),current:t.z.boolean().optional().openapi({description:"True if the key is the current key"}),next:t.z.boolean().optional().openapi({description:"True if the key is the next key"}),previous:t.z.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:t.z.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:t.z.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:t.z.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:t.z.string().optional().openapi({description:"The date and time when the key was revoked"}),connection:t.z.string().optional().openapi({description:"The connection identifier associated with the key"}),type:t.z.enum(["jwt_signing","saml_encryption"]).openapi({description:"The type of the signing key"})});var Ft=(e=>(e.RefreshToken="refresh_token",e.AuthorizationCode="authorization_code",e.ClientCredential="client_credentials",e.Passwordless="passwordless",e.Password="password",e.OTP="http://auth0.com/oauth/grant-type/passwordless/otp",e))(Ft||{});const Ut=t.z.object({access_token:t.z.string(),id_token:t.z.string().optional(),scope:t.z.string().optional(),state:t.z.string().optional(),refresh_token:t.z.string().optional(),token_type:t.z.string(),expires_in:t.z.number()});t.z.object({code:t.z.string(),state:t.z.string().optional()});const Pt=t.z.object({button_border_radius:t.z.number(),button_border_weight:t.z.number(),buttons_style:t.z.enum(["pill","rounded","sharp"]),input_border_radius:t.z.number(),input_border_weight:t.z.number(),inputs_style:t.z.enum(["pill","rounded","sharp"]),show_widget_shadow:t.z.boolean(),widget_border_weight:t.z.number(),widget_corner_radius:t.z.number()}),Mt=t.z.object({base_focus_color:t.z.string(),base_hover_color:t.z.string(),body_text:t.z.string(),captcha_widget_theme:t.z.enum(["auto","dark","light"]),error:t.z.string(),header:t.z.string(),icons:t.z.string(),input_background:t.z.string(),input_border:t.z.string(),input_filled_text:t.z.string(),input_labels_placeholders:t.z.string(),links_focused_components:t.z.string(),primary_button:t.z.string(),primary_button_label:t.z.string(),secondary_button_border:t.z.string(),secondary_button_label:t.z.string(),success:t.z.string(),widget_background:t.z.string(),widget_border:t.z.string()}),Zt=t.z.object({bold:t.z.boolean(),size:t.z.number()}),$t=t.z.object({body_text:Zt,buttons_text:Zt,font_url:t.z.string(),input_labels:Zt,links:Zt,links_style:t.z.enum(["normal","underlined"]),reference_text_size:t.z.number(),subtitle:Zt,title:Zt}),Ht=t.z.object({background_color:t.z.string(),background_image_url:t.z.string(),page_layout:t.z.enum(["center","left","right"])}),zt=t.z.object({header_text_alignment:t.z.enum(["center","left","right"]),logo_height:t.z.number(),logo_position:t.z.enum(["center","left","none","right"]),logo_url:t.z.string(),social_buttons_layout:t.z.enum(["bottom","top"])}),Gt=t.z.object({borders:Pt,colors:Mt,displayName:t.z.string(),fonts:$t,page_background:Ht,widget:zt}),Bt=Gt.extend({themeId:t.z.string()}),qt=t.z.object({universal_login_experience:t.z.enum(["new","classic"]).default("new"),identifier_first:t.z.boolean().default(!0),password_first:t.z.boolean().default(!1),webauthn_platform_first_factor:t.z.boolean()}),Kt=t.z.object({name:t.z.string(),enabled:t.z.boolean().optional().default(!0),default_from_address:t.z.string().optional(),credentials:t.z.union([t.z.object({accessKeyId:t.z.string(),secretAccessKey:t.z.string(),region:t.z.string()}),t.z.object({smtp_host:t.z.array(t.z.string()),smtp_port:t.z.number(),smtp_user:t.z.string(),smtp_pass:t.z.string()}),t.z.object({api_key:t.z.string(),domain:t.z.string().optional()}),t.z.object({connectionString:t.z.string()}),t.z.object({tenantId:t.z.string(),clientId:t.z.string(),clientSecret:t.z.string()})]),settings:t.z.object({}).optional()}),Wt=t.z.object({id:t.z.string(),session_id:t.z.string(),user_id:t.z.string(),client_id:t.z.string(),expires_at:t.z.string().optional(),idle_expires_at:t.z.string().optional(),last_exchanged_at:t.z.string().optional(),device:kt,resource_servers:t.z.array(t.z.object({audience:t.z.string(),scopes:t.z.string()})),rotating:t.z.boolean()}),Vt=t.z.object({created_at:t.z.string(),...Wt.shape}),Xt=t.z.object({to:t.z.string(),message:t.z.string()}),Yt=t.z.object({name:t.z.string(),options:t.z.object({})}),Jt=t.z.object({value:t.z.string(),description:t.z.string().optional()}),Qt=t.z.object({token_dialect:t.z.enum(["access_token","access_token_authz"]).optional(),enforce_policies:t.z.boolean().optional(),allow_skipping_userinfo:t.z.boolean().optional(),skip_userinfo:t.z.boolean().optional(),persist_client_authorization:t.z.boolean().optional(),enable_introspection_endpoint:t.z.boolean().optional(),mtls:t.z.object({bound_access_tokens:t.z.boolean().optional()}).optional()}),ei=t.z.object({id:t.z.string().optional(),name:t.z.string(),identifier:t.z.string(),scopes:t.z.array(Jt).optional(),signing_alg:t.z.string().optional(),signing_secret:t.z.string().optional(),token_lifetime:t.z.number().optional(),token_lifetime_for_web:t.z.number().optional(),skip_consent_for_verifiable_first_party_clients:t.z.boolean().optional(),allow_offline_access:t.z.boolean().optional(),verificationKey:t.z.string().optional(),options:Qt.optional(),is_system:t.z.boolean().optional()}),ti=t.z.object({...ei.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),ii=t.z.array(ti),ni=t.z.object({role_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string()}),si=t.z.object({...ni.shape,created_at:t.z.string()}),ri=t.z.array(si),oi=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string(),organization_id:t.z.string().optional()}),ai=t.z.object({...oi.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),ci=t.z.array(ai),ui=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),resource_server_name:t.z.string(),permission_name:t.z.string(),description:t.z.string().nullable().optional(),created_at:t.z.string().optional(),organization_id:t.z.string().optional()}),di=t.z.array(ui),li=t.z.object({user_id:t.z.string(),role_id:t.z.string(),organization_id:t.z.string().optional()}),hi=t.z.object({...li.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),_i=t.z.array(hi),pi=t.z.object({id:t.z.string().optional().openapi({description:"The unique identifier of the role. If not provided, one will be generated."}),name:t.z.string().min(1).max(50).openapi({description:"The name of the role. Cannot include '<' or '>'"}),description:t.z.string().max(255).optional().openapi({description:"The description of the role"}),is_system:t.z.boolean().optional()}),fi=pi.extend({id:t.z.string().openapi({description:"The unique identifier of the role"}),created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),mi=t.z.array(fi),gi=t.z.object({logo_url:t.z.string().optional().openapi({description:"URL of the organization's logo"}),colors:t.z.object({primary:t.z.string().optional().openapi({description:"Primary color in hex format (e.g., #FF0000)"}),page_background:t.z.string().optional().openapi({description:"Page background color in hex format (e.g., #FFFFFF)"})}).optional()}).optional(),yi=t.z.object({connection_id:t.z.string().openapi({description:"ID of the connection"}),assign_membership_on_login:t.z.boolean().default(!1).openapi({description:"Whether to assign membership to the organization on login"}),show_as_button:t.z.boolean().default(!0).openapi({description:"Whether to show this connection as a button in the login screen"}),is_signup_enabled:t.z.boolean().default(!0).openapi({description:"Whether signup is enabled for this connection"})}),Ei=t.z.object({client_credentials:t.z.object({enforce:t.z.boolean().default(!1).openapi({description:"Whether to enforce token quota limits"}),per_day:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per day (0 = unlimited)"}),per_hour:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per hour (0 = unlimited)"})}).optional()}).optional(),bi=t.z.object({id:t.z.string().optional(),name:t.z.string().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:t.z.string().optional().openapi({description:"The display name of the organization"}),branding:gi,metadata:t.z.record(t.z.any()).default({}).optional().openapi({description:"Custom metadata for the organization"}),enabled_connections:t.z.array(yi).default([]).optional().openapi({description:"List of enabled connections for the organization"}),token_quota:Ei}),vi=t.z.object({...bi.shape,...i.shape,id:t.z.string(),name:t.z.string().min(1).openapi({description:"The name of the organization"})}),Oi=t.z.object({user_id:t.z.string().openapi({description:"ID of the user"}),organization_id:t.z.string().openapi({description:"ID of the organization"})}),wi=t.z.object({...Oi.shape,...i.shape,id:t.z.string()}),Ai=t.z.object({idle_session_lifetime:t.z.number().optional(),session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),enable_client_connections:t.z.boolean().optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional()}).optional(),friendly_name:t.z.string().optional(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional()}),Si=t.z.object({date:t.z.string().openapi({description:"Date these events occurred in ISO 8601 format",example:"2025-12-19"}),logins:t.z.number().openapi({description:"Number of logins on this date",example:150}),signups:t.z.number().openapi({description:"Number of signups on this date",example:25}),leaked_passwords:t.z.number().openapi({description:"Number of breached-password detections on this date (subscription required)",example:0}),updated_at:t.z.string().openapi({description:"Date and time this stats entry was last updated in ISO 8601 format",example:"2025-12-19T10:30:00.000Z"}),created_at:t.z.string().openapi({description:"Approximate date and time the first event occurred in ISO 8601 format",example:"2025-12-19T00:00:00.000Z"})}),Ii=t.z.number().openapi({description:"Number of active users in the last 30 days",example:1234});e.Auth0ActionEnum=s,e.Auth0Client=It,e.AuthorizationResponseMode=V,e.AuthorizationResponseType=W,e.CodeChallengeMethod=X,e.ComponentCategory=x,e.ComponentType=T,e.EmailActionEnum=r,e.FlowActionTypeEnum=n,e.GrantType=Ft,e.LocationInfo=Nt,e.LogTypes=At,e.LoginSessionState=bt,e.NodeType=P,e.RedirectTargetEnum=u,e.actionNodeSchema=$,e.activeUsersResponseSchema=Ii,e.auth0FlowInsertSchema=K,e.auth0FlowSchema=q,e.auth0QuerySchema=p,e.auth0UpdateUserActionSchema=a,e.auth0UserResponseSchema=v,e.authParamsSchema=Y,e.baseUserSchema=y,e.blockComponentSchema=ze,e.bordersSchema=Pt,e.brandingSchema=J,e.buttonComponentSchema=D,e.clientGrantInsertSchema=S,e.clientGrantListSchema=N,e.clientGrantSchema=I,e.clientInsertSchema=w,e.clientSchema=A,e.codeInsertSchema=oe,e.codeSchema=ae,e.codeTypeSchema=re,e.colorsSchema=Mt,e.componentMessageSchema=tt,e.componentSchema=U,e.connectionInsertSchema=ee,e.connectionOptionsSchema=Q,e.connectionSchema=te,e.coordinatesSchema=C,e.createPassthroughAdapter=function(e){const{primary:t,secondaries:i,syncMethods:n=["create","update","remove","delete","set"]}=e,s={get(e,t){if("symbol"==typeof t)return e[t];const s=e[t];return"function"!=typeof s?s:n.includes(t)?async(...n)=>{const r=await s.apply(e,n),o=[];for(const e of i){const i=e.adapter[t];if("function"!=typeof i)continue;const s=(async()=>{try{await i.apply(e.adapter,n)}catch(i){try{e.onError?e.onError(i,t,n):console.error(`Passthrough adapter: secondary write failed for ${t}:`,i)}catch(e){console.error(`Passthrough adapter: onError handler threw for ${t}:`,e)}}})();e.blocking&&o.push(s)}return o.length>0&&await Promise.all(o),r}:s.bind(e)}};return new Proxy(t,s)},e.createWriteOnlyAdapter=function(e){return e},e.customDomainInsertSchema=ce,e.customDomainSchema=de,e.customDomainWithTenantIdSchema=le,e.dailyStatsSchema=Si,e.emailProviderSchema=Kt,e.emailVerificationRulesSchema=o,e.emailVerifyActionSchema=c,e.endingSchema=B,e.fieldComponentSchema=Be,e.flowActionStepSchema=l,e.flowInsertSchema=h,e.flowSchema=_,e.flowsFieldComponentSchema=j,e.flowsFlowNodeSchema=Z,e.flowsStepNodeSchema=M,e.fontDetailsSchema=Zt,e.fontsSchema=$t,e.formControlSchema=Ke,e.formInsertSchema=Qe,e.formNodeComponentDefinition=qe,e.formNodeSchema=Je,e.formSchema=et,e.genericComponentSchema=F,e.genericNodeSchema=H,e.hookInsertSchema=ut,e.hookSchema=ht,e.identitySchema=g,e.inviteInsertSchema=ft,e.inviteSchema=mt,e.inviteeSchema=pt,e.inviterSchema=_t,e.isBlockComponent=function(e){return"BLOCK"===e.category},e.isFieldComponent=function(e){return"FIELD"===e.category},e.isWidgetComponent=function(e){return"WIDGET"===e.category},e.jwksKeySchema=yt,e.jwksSchema=gt,e.legacyClientSchema=se,e.legalComponentSchema=L,e.logInsertSchema=Ct,e.logSchema=Tt,e.loginSessionInsertSchema=Ot,e.loginSessionSchema=wt,e.loginSessionStateSchema=vt,e.nodeSchema=z,e.openIDConfigurationSchema=Et,e.organizationBrandingSchema=gi,e.organizationEnabledConnectionSchema=yi,e.organizationInsertSchema=bi,e.organizationSchema=vi,e.organizationTokenQuotaSchema=Ei,e.pageBackgroundSchema=Ht,e.parseUserId=function(e){const[t,i]=e.split("|");if(!t||!i)throw Error("Invalid user_id: "+e);return{connection:t,id:i}},e.passwordInsertSchema=xt,e.passwordSchema=Rt,e.profileDataSchema=m,e.promptSettingSchema=qt,e.redirectActionSchema=d,e.refreshTokenInsertSchema=Wt,e.refreshTokenSchema=Vt,e.resourceServerInsertSchema=ei,e.resourceServerListSchema=ii,e.resourceServerOptionsSchema=Qt,e.resourceServerSchema=ti,e.resourceServerScopeSchema=Jt,e.richTextComponentSchema=k,e.roleInsertSchema=pi,e.roleListSchema=mi,e.rolePermissionInsertSchema=ni,e.rolePermissionListSchema=ri,e.rolePermissionSchema=si,e.roleSchema=fi,e.screenLinkSchema=it,e.sessionInsertSchema=Dt,e.sessionSchema=Lt,e.signingKeySchema=jt,e.smsProviderSchema=Yt,e.smsSendParamsSchema=Xt,e.startSchema=G,e.tenantInsertSchema=ie,e.tenantSchema=ne,e.tenantSettingsSchema=Ai,e.themeInsertSchema=Gt,e.themeSchema=Bt,e.tokenResponseSchema=Ut,e.totalsSchema=f,e.uiScreenSchema=nt,e.userInsertSchema=E,e.userOrganizationInsertSchema=Oi,e.userOrganizationSchema=wi,e.userPermissionInsertSchema=oi,e.userPermissionListSchema=ci,e.userPermissionSchema=ai,e.userPermissionWithDetailsListSchema=di,e.userPermissionWithDetailsSchema=ui,e.userResponseSchema=O,e.userRoleInsertSchema=li,e.userRoleListSchema=_i,e.userRoleSchema=hi,e.userSchema=b,e.verificationMethodsSchema=ue,e.widgetComponentSchema=Ge,e.widgetSchema=zt}(t)),t),An=wn.isBlockComponent,Sn=wn.isFieldComponent,In=wn.isWidgetComponent;export{An as isBlockComponent,Sn as isFieldComponent,In as isWidgetComponent}
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-JzMtjMQb.js";function e(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),i}var t={};function i(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i}function n(e,t){var i;return(null===(i=null==e?void 0:e._def)||void 0===i?void 0:i.typeName)===t}function o(e,t){const i=e.ZodType.prototype[t];e.ZodType.prototype[t]=function(...e){const t=i.apply(this,e);return t._def.openapi=this._def.openapi,t}}function c(e){if(void 0!==e.ZodType.prototype.openapi)return;e.ZodType.prototype.openapi=function(e,t){var s,r,o,a,c,u;const d="string"==typeof e?t:e,l=null!=d?d:{},{param:h}=l,_=i(l,["param"]),p=Object.assign(Object.assign({},null===(s=this._def.openapi)||void 0===s?void 0:s._internal),"string"==typeof e?{refId:e}:void 0),f=Object.assign(Object.assign(Object.assign({},null===(r=this._def.openapi)||void 0===r?void 0:r.metadata),_),(null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.param)||h?{param:Object.assign(Object.assign({},null===(u=null===(c=this._def.openapi)||void 0===c?void 0:c.metadata)||void 0===u?void 0:u.param),h)}:void 0),m=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(p).length>0?{_internal:p}:void 0),Object.keys(f).length>0?{metadata:f}:void 0)}));if(n(this,"ZodObject")){const e=this.extend;m.extend=function(...t){var i,n,s,r,o,a,c;const u=e.apply(this,t);return u._def.openapi={_internal:{extendedFrom:(null===(n=null===(i=this._def.openapi)||void 0===i?void 0:i._internal)||void 0===n?void 0:n.refId)?{refId:null===(r=null===(s=this._def.openapi)||void 0===s?void 0:s._internal)||void 0===r?void 0:r.refId,schema:this}:null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o._internal)||void 0===a?void 0:a.extendedFrom},metadata:null===(c=u._def.openapi)||void 0===c?void 0:c.metadata},u}}return m},o(e,"optional"),o(e,"nullable"),o(e,"default"),o(e,"transform"),o(e,"refine");const t=e.ZodObject.prototype.deepPartial;e.ZodObject.prototype.deepPartial=function(){const e=this._def.shape(),i=t.apply(this),n=i._def.shape();return Object.entries(n).forEach((([t,i])=>{var n,s;i._def.openapi=null===(s=null===(n=e[t])||void 0===n?void 0:n._def)||void 0===s?void 0:s.openapi})),i._def.openapi=void 0,i};const s=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...e){const t=s.apply(this,e);return t._def.openapi=void 0,t};const r=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...e){const t=r.apply(this,e);return t._def.openapi=void 0,t}}function u(e,t){if(null==e||null==t)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1}if(!(e instanceof Object&&t instanceof Object))return!1;const i=Object.keys(e);return Object.keys(t).every((e=>-1!==i.indexOf(e)))&&i.every((i=>u(e[i],t[i])))}"function"==typeof SuppressedError&&SuppressedError;class d{constructor(){this.buckets=new Map}put(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);i?i.some((t=>u(t,e)))||i.push(e):this.buckets.set(t,[e])}contains(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);return!!i&&i.some((t=>u(t,e)))}values(){return[...this.buckets.values()].flat()}stats(){let e=0,t=0,i=0;for(const n of this.buckets.values())e+=1,t+=n.length,n.length>1&&(i+=1);return{totalBuckets:e,collisions:i,totalValues:t,hashEffectiveness:e/t}}hashCodeOf(e){let t=0;if(Array.isArray(e)){for(let i=0;i<e.length;i++)t^=this.hashCodeOf(e[i])*i;return t}if("string"==typeof e){for(let i=0;i<e.length;i++)t^=e.charCodeAt(i)*i;return t}if("number"==typeof e)return e;if("object"==typeof e)for(const[i,n]of Object.entries(e))t^=this.hashCodeOf(i)+this.hashCodeOf(null!=n?n:"");return t}}function l(e){return void 0===e}function h(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{i[e]=t(n)})),i}function _(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t(n,e)||(i[e]=n)})),i}function p(e){return e.filter((e=>!l(e)))}const f=u;function m(e){return"string"==typeof e}class y{constructor(e){this.parents=e,this._definitions=[]}get definitions(){var e,t;return[...null!==(t=null===(e=this.parents)||void 0===e?void 0:e.flatMap((e=>e.definitions)))&&void 0!==t?t:[],...this._definitions]}register(e,t){const i=this.schemaWithRefId(e,t);return this._definitions.push({type:"schema",schema:i}),i}registerParameter(e,t){var i,n,s;const r=this.schemaWithRefId(e,t),o=null===(i=r._def.openapi)||void 0===i?void 0:i.metadata,a=r.openapi(Object.assign(Object.assign({},o),{param:Object.assign(Object.assign({},null==o?void 0:o.param),{name:null!==(s=null===(n=null==o?void 0:o.param)||void 0===n?void 0:n.name)&&void 0!==s?s:e})}));return this._definitions.push({type:"parameter",schema:a}),a}registerPath(e){this._definitions.push({type:"route",route:e})}registerWebhook(e){this._definitions.push({type:"webhook",webhook:e})}registerComponent(e,t,i){return this._definitions.push({type:"component",componentType:e,name:t,component:i}),{name:t,ref:{$ref:`#/components/${e}/${t}`}}}schemaWithRefId(e,t){return t.openapi(e)}}class E{constructor(e){this.message=e}}class v extends E{constructor(e,t){super(e),this.data=t}}class O extends E{constructor(e){super(`Missing parameter data, please specify \`${e.missingField}\` and other OpenAPI parameter props using the \`param\` field of \`ZodSchema.openapi\``),this.data=e}}function w(e,t){try{return e()}catch(e){if(e instanceof O)throw new O(Object.assign(Object.assign({},e.data),t));throw e}}class A extends E{constructor(e){super("Unknown zod object type, please specify `type` and other OpenAPI props using `ZodSchema.openapi`."),this.data=e}}class S{static getMetadata(e){var t;const i=this.unwrapChained(e),n=e._def.openapi?e._def.openapi:i._def.openapi,s=null!==(t=e.description)&&void 0!==t?t:i.description;return{_internal:null==n?void 0:n._internal,metadata:Object.assign({description:s},null==n?void 0:n.metadata)}}static getInternalMetadata(e){const t=this.unwrapChained(e),i=e._def.openapi?e._def.openapi:t._def.openapi;return null==i?void 0:i._internal}static getParamMetadata(e){var t,i;const n=this.unwrapChained(e),s=e._def.openapi?e._def.openapi:n._def.openapi,r=null!==(t=e.description)&&void 0!==t?t:n.description;return{_internal:null==s?void 0:s._internal,metadata:Object.assign(Object.assign({},null==s?void 0:s.metadata),{param:Object.assign({description:r},null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param)})}}static buildSchemaMetadata(e){return _(function(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t.some((t=>t===e))||(i[e]=n)})),i}(e,["param"]),l)}static buildParameterMetadata(e){return _(e,l)}static applySchemaMetadata(e,t){return _(Object.assign(Object.assign({},e),this.buildSchemaMetadata(t)),l)}static getRefId(e){var t;return null===(t=this.getInternalMetadata(e))||void 0===t?void 0:t.refId}static unwrapChained(e){return this.unwrapUntil(e)}static getDefaultValue(e){const t=this.unwrapUntil(e,"ZodDefault");return null==t?void 0:t._def.defaultValue()}static unwrapUntil(e,t){return t&&n(e,t)?e:n(e,"ZodOptional")||n(e,"ZodNullable")||n(e,"ZodBranded")?this.unwrapUntil(e.unwrap(),t):n(e,"ZodDefault")||n(e,"ZodReadonly")?this.unwrapUntil(e._def.innerType,t):n(e,"ZodEffects")?this.unwrapUntil(e._def.schema,t):n(e,"ZodPipeline")?this.unwrapUntil(e._def.in,t):t?void 0:e}static isOptionalSchema(e){return e.isOptional()}}class I{transform(e,t,i){var n,s;const r=e._def.type;return Object.assign(Object.assign({},t("array")),{items:i(r),minItems:null===(n=e._def.minLength)||void 0===n?void 0:n.value,maxItems:null===(s=e._def.maxLength)||void 0===s?void 0:s.value})}}class N{transform(e){return Object.assign(Object.assign({},e("string")),{pattern:"^d+$"})}}class C{transform(e,t,i,n,s){const r=[...e.options.values()],o=r.map(n);return t?{oneOf:i(o,t)}:{oneOf:o,discriminator:this.mapDiscriminator(r,e.discriminator,s)}}mapDiscriminator(e,t,i){if(e.some((e=>void 0===S.getRefId(e))))return;const s={};return e.forEach((e=>{var r;const o=S.getRefId(e),a=null===(r=e.shape)||void 0===r?void 0:r[t];if(n(a,"ZodEnum")||n(a,"ZodNativeEnum"))return void Object.values(a.enum).filter(m).forEach((e=>{s[e]=i(o)}));const c=null==a?void 0:a._def.value;if("string"!=typeof c)throw Error(`Discriminator ${t} could not be found in one of the values of a discriminated union`);s[c]=i(o)})),{propertyName:t,mapping:s}}}class T{transform(e,t){return Object.assign(Object.assign({},t("string")),{enum:e._def.values})}}class x{transform(e,t,i,n){const s={allOf:this.flattenIntersectionTypes(e).map(n)};return t?{anyOf:i([s],t)}:s}flattenIntersectionTypes(e){return n(e,"ZodIntersection")?[...this.flattenIntersectionTypes(e._def.left),...this.flattenIntersectionTypes(e._def.right)]:[e]}}class R{transform(e,t){return Object.assign(Object.assign({},t(typeof e._def.value)),{enum:[e._def.value]})}}class k{transform(e,t){const{type:i,values:n}=function(e){const t=Object.keys(e).filter((t=>"number"!=typeof e[e[t]])).map((t=>e[t])),i=t.filter((e=>"number"==typeof e)).length;return{values:t,type:0===i?"string":i===t.length?"numeric":"mixed"}}(e._def.values);if("mixed"===i)throw new E("Enum has mixed string and number values, please specify the OpenAPI type manually");return Object.assign(Object.assign({},t("numeric"===i?"integer":"string")),{enum:n})}}class D{transform(e,t,i){return Object.assign(Object.assign({},t(e.isInt?"integer":"number")),i(e._def.checks))}}class L{transform(e,t,i,n){var s;const r=null===(s=S.getInternalMetadata(e))||void 0===s?void 0:s.extendedFrom,o=this.requiredKeysOf(e),a=h(e._def.shape(),n);if(!r)return Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{properties:a,default:t}),o.length>0?{required:o}:{}),this.generateAdditionalProperties(e,n));const c=r.schema;n(c);const u=this.requiredKeysOf(c),d=h(null==c?void 0:c._def.shape(),n),l=Object.fromEntries(Object.entries(a).filter((([e,t])=>!f(d[e],t)))),_=o.filter((e=>!u.includes(e))),p=Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{default:t,properties:l}),_.length>0?{required:_}:{}),this.generateAdditionalProperties(e,n));return{allOf:[{$ref:"#/components/schemas/"+r.refId},p]}}generateAdditionalProperties(e,t){const i=e._def.unknownKeys,s=e._def.catchall;return n(s,"ZodNever")?"strict"===i?{additionalProperties:!1}:{}:{additionalProperties:t(s)}}requiredKeysOf(e){return Object.entries(e._def.shape()).filter((([e,t])=>!S.isOptionalSchema(t))).map((([e,t])=>e))}}class j{transform(e,t,i){const s=e._def.keyType,r=i(e._def.valueType);if(n(s,"ZodEnum")||n(s,"ZodNativeEnum")){const e=Object.values(s.enum).filter(m).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:r})),{});return Object.assign(Object.assign({},t("object")),{properties:e})}return Object.assign(Object.assign({},t("object")),{additionalProperties:r})}}class F{transform(e,t){var i,n,s;const r=this.getZodStringCheck(e,"regex"),o=null===(i=this.getZodStringCheck(e,"length"))||void 0===i?void 0:i.value,a=Number.isFinite(e.minLength)&&null!==(n=e.minLength)&&void 0!==n?n:void 0,c=Number.isFinite(e.maxLength)&&null!==(s=e.maxLength)&&void 0!==s?s:void 0;return Object.assign(Object.assign({},t("string")),{minLength:null!=o?o:a,maxLength:null!=o?o:c,format:this.mapStringFormat(e),pattern:null==r?void 0:r.regex.source})}mapStringFormat(e){return e.isUUID?"uuid":e.isEmail?"email":e.isURL?"uri":e.isDate?"date":e.isDatetime?"date-time":e.isCUID?"cuid":e.isCUID2?"cuid2":e.isULID?"ulid":e.isIP?"ip":e.isEmoji?"emoji":void 0}getZodStringCheck(e,t){return e._def.checks.find((e=>e.kind===t))}}class U{constructor(e){this.versionSpecifics=e}transform(e,t,i){const{items:n}=e._def,s=n.map(i);return Object.assign(Object.assign({},t("array")),this.versionSpecifics.mapTupleItems(s))}}class P{transform(e,t,i){return{anyOf:t(this.flattenUnionTypes(e).map((e=>{const t=this.unwrapNullable(e);return i(t)})))}}flattenUnionTypes(e){return n(e,"ZodUnion")?e._def.options.flatMap((e=>this.flattenUnionTypes(e))):[e]}unwrapNullable(e){return n(e,"ZodNullable")?this.unwrapNullable(e.unwrap()):e}}class M{constructor(e){this.versionSpecifics=e,this.objectTransformer=new L,this.stringTransformer=new F,this.numberTransformer=new D,this.bigIntTransformer=new N,this.literalTransformer=new R,this.enumTransformer=new T,this.nativeEnumTransformer=new k,this.arrayTransformer=new I,this.unionTransformer=new P,this.discriminatedUnionTransformer=new C,this.intersectionTransformer=new x,this.recordTransformer=new j,this.tupleTransformer=new U(e)}transform(e,t,i,s,r){if(n(e,"ZodNull"))return this.versionSpecifics.nullType;if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodObject"))return this.objectTransformer.transform(e,r,(e=>this.versionSpecifics.mapNullableType(e,t)),i);const o=this.transformSchemaWithoutDefault(e,t,i,s);return Object.assign(Object.assign({},o),{default:r})}transformSchemaWithoutDefault(e,t,i,s){if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodString"))return this.stringTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNumber"))return this.numberTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),(e=>this.versionSpecifics.getNumberChecks(e)));if(n(e,"ZodBigInt"))return this.bigIntTransformer.transform((e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodBoolean"))return this.versionSpecifics.mapNullableType("boolean",t);if(n(e,"ZodLiteral"))return this.literalTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodEnum"))return this.enumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNativeEnum"))return this.nativeEnumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodArray"))return this.arrayTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodTuple"))return this.tupleTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodUnion"))return this.unionTransformer.transform(e,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodDiscriminatedUnion"))return this.discriminatedUnionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i,s);if(n(e,"ZodIntersection"))return this.intersectionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodRecord"))return this.recordTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodDate"))return this.versionSpecifics.mapNullableType("string",t);const r=S.getRefId(e);throw new A({currentSchema:e._def,schemaName:r})}}class Z{constructor(e,t){this.definitions=e,this.versionSpecifics=t,this.schemaRefs={},this.paramRefs={},this.pathRefs={},this.rawComponents=[],this.openApiTransformer=new M(t),this.sortDefinitions()}generateDocumentData(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents(),paths:this.pathRefs}}generateComponents(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents()}}buildComponents(){var e,t;const i={};return this.rawComponents.forEach((({componentType:e,name:t,component:n})=>{var s;null!==(s=i[e])&&void 0!==s||(i[e]={}),i[e][t]=n})),Object.assign(Object.assign({},i),{schemas:Object.assign(Object.assign({},null!==(e=i.schemas)&&void 0!==e?e:{}),this.schemaRefs),parameters:Object.assign(Object.assign({},null!==(t=i.parameters)&&void 0!==t?t:{}),this.paramRefs)})}sortDefinitions(){const e=["schema","parameter","component","route"];this.definitions.sort(((t,i)=>"type"in t?"type"in i?e.findIndex((e=>e===t.type))-e.findIndex((e=>e===i.type)):1:"type"in i?-1:0))}generateSingle(e){if("type"in e)switch(e.type){case"parameter":return void this.generateParameterDefinition(e.schema);case"schema":return void this.generateSchemaWithRef(e.schema);case"route":return void this.generateSingleRoute(e.route);case"component":return void this.rawComponents.push(e)}else this.generateSchemaWithRef(e)}generateParameterDefinition(e){const t=S.getRefId(e),i=this.generateParameter(e);return t&&(this.paramRefs[t]=i),i}getParameterRef(e,t){var i,n,s,r,o;const a=null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.param,c=(null===(n=null==e?void 0:e._internal)||void 0===n?void 0:n.refId)?this.paramRefs[null===(s=e._internal)||void 0===s?void 0:s.refId]:void 0;if((null===(r=null==e?void 0:e._internal)||void 0===r?void 0:r.refId)&&c){if(a&&c.in!==a.in||(null==t?void 0:t.in)&&c.in!==t.in)throw new v("Conflicting location for parameter "+c.name,{key:"in",values:p([c.in,null==t?void 0:t.in,null==a?void 0:a.in])});if(a&&c.name!==a.name||(null==t?void 0:t.name)&&c.name!==(null==t?void 0:t.name))throw new v("Conflicting names for parameter",{key:"name",values:p([c.name,null==t?void 0:t.name,null==a?void 0:a.name])});return{$ref:"#/components/parameters/"+(null===(o=e._internal)||void 0===o?void 0:o.refId)}}}generateInlineParameters(e,t){var i;const s=S.getMetadata(e),r=null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param,o=this.getParameterRef(s,{in:t});if(o)return[o];if(n(e,"ZodObject")){const i=e._def.shape(),n=Object.entries(i).map((([e,i])=>{var n,s;const r=S.getMetadata(i),o=this.getParameterRef(r,{in:t,name:e});if(o)return o;const a=null===(n=null==r?void 0:r.metadata)||void 0===n?void 0:n.param;if((null==a?void 0:a.name)&&a.name!==e)throw new v("Conflicting names for parameter",{key:"name",values:[e,a.name]});if((null==a?void 0:a.in)&&a.in!==t)throw new v("Conflicting location for parameter "+(null!==(s=a.name)&&void 0!==s?s:e),{key:"in",values:[t,a.in]});return this.generateParameter(i.openapi({param:{name:e,in:t}}))}));return n}if((null==r?void 0:r.in)&&r.in!==t)throw new v("Conflicting location for parameter "+r.name,{key:"in",values:[t,r.in]});return[this.generateParameter(e.openapi({param:{in:t}}))]}generateSimpleParameter(e){var t;const i=S.getParamMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=!S.isOptionalSchema(e)&&!e.isNullable(),r=this.generateSchemaWithRef(e);return Object.assign({schema:r,required:s},n?S.buildParameterMetadata(n):{})}generateParameter(e){var t;const i=S.getMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=null==n?void 0:n.name,r=null==n?void 0:n.in;if(!s)throw new O({missingField:"name"});if(!r)throw new O({missingField:"in",paramName:s});const o=this.generateSimpleParameter(e);return Object.assign(Object.assign({},o),{in:r,name:s})}generateSchemaWithMetadata(e){var t;const i=S.unwrapChained(e),n=S.getMetadata(e),s=S.getDefaultValue(e),r=(null===(t=null==n?void 0:n.metadata)||void 0===t?void 0:t.type)?{type:null==n?void 0:n.metadata.type}:this.toOpenAPISchema(i,e.isNullable(),s);return(null==n?void 0:n.metadata)?S.applySchemaMetadata(r,n.metadata):_(r,l)}constructReferencedOpenAPISchema(e){var t;const i=S.getMetadata(e),n=S.unwrapChained(e),s=S.getDefaultValue(e),r=e.isNullable();return(null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.type)?this.versionSpecifics.mapNullableType(i.metadata.type,r):this.toOpenAPISchema(n,r,s)}generateSimpleSchema(e){var t;const i=S.getMetadata(e),n=S.getRefId(e);if(!n||!this.schemaRefs[n])return this.generateSchemaWithMetadata(e);const s=this.schemaRefs[n],r={$ref:this.generateSchemaRef(n)},o=_(S.buildSchemaMetadata(null!==(t=null==i?void 0:i.metadata)&&void 0!==t?t:{}),((e,t)=>void 0===e||f(e,s[t])));if(o.type)return{allOf:[r,o]};const a=_(this.constructReferencedOpenAPISchema(e),((e,t)=>void 0===e||f(e,s[t]))),c=S.applySchemaMetadata(a,o);return Object.keys(c).length>0?{allOf:[r,c]}:r}generateSchemaWithRef(e){const t=S.getRefId(e),i=this.generateSimpleSchema(e);return t&&void 0===this.schemaRefs[t]?(this.schemaRefs[t]=i,{$ref:this.generateSchemaRef(t)}):i}generateSchemaRef(e){return"#/components/schemas/"+e}getRequestBody(e){if(!e)return;const{content:t}=e,n=i(e,["content"]),s=this.getBodyContent(t);return Object.assign(Object.assign({},n),{content:s})}getParameters(e){if(!e)return[];const{headers:t}=e,i=this.cleanParameter(e.query),n=this.cleanParameter(e.params),s=this.cleanParameter(e.cookies),r=w((()=>i?this.generateInlineParameters(i,"query"):[]),{location:"query"}),o=w((()=>n?this.generateInlineParameters(n,"path"):[]),{location:"path"}),a=w((()=>s?this.generateInlineParameters(s,"cookie"):[]),{location:"cookie"});return[...o,...r,...w((()=>{if(Array.isArray(t))return t.flatMap((e=>this.generateInlineParameters(e,"header")));const e=this.cleanParameter(t);return e?this.generateInlineParameters(e,"header"):[]}),{location:"header"}),...a]}cleanParameter(e){if(e)return n(e,"ZodEffects")?this.cleanParameter(e._def.schema):e}generatePath(e){const{method:t,path:n,request:s,responses:r}=e,o=i(e,["method","path","request","responses"]),a=h(r,(e=>this.getResponse(e))),c=w((()=>this.getParameters(s)),{route:`${t} ${n}`}),u=this.getRequestBody(null==s?void 0:s.body);return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},o),c.length>0?{parameters:[...o.parameters||[],...c]}:{}),u?{requestBody:u}:{}),{responses:a})}}generateSingleRoute(e){const t=this.generatePath(e);return this.pathRefs[e.path]=Object.assign(Object.assign({},this.pathRefs[e.path]),t),t}getResponse(e){if(this.isReferenceObject(e))return e;const{content:t,headers:s}=e,r=i(e,["content","headers"]),o=t?{content:this.getBodyContent(t)}:{};if(!s)return Object.assign(Object.assign({},r),o);const a=n(s,"ZodObject")?this.getResponseHeaders(s):s;return Object.assign(Object.assign(Object.assign({},r),{headers:a}),o)}isReferenceObject(e){return"$ref"in e}getResponseHeaders(e){return h(e._def.shape(),(e=>this.generateSimpleParameter(e)))}getBodyContent(e){return h(e,(e=>{if(!e||!function(e){return"_def"in e}(e.schema))return e;const{schema:t}=e,n=i(e,["schema"]),s=this.generateSchemaWithRef(t);return Object.assign({schema:s},n)}))}toOpenAPISchema(e,t,i){return this.openApiTransformer.transform(e,t,(e=>this.generateSchemaWithRef(e)),(e=>this.generateSchemaRef(e)),i)}}class ${get nullType(){return{nullable:!0}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return Object.assign(Object.assign({},e?{type:e}:void 0),t?this.nullType:void 0)}mapTupleItems(e){const t=function(e){const t=new d;return e.forEach((e=>t.put(e))),[...t.values()]}(e);return{items:1===t.length?t[0]:{anyOf:t},minItems:e.length,maxItems:e.length}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{minimum:Number(e.value),exclusiveMinimum:!0};case"max":return e.inclusive?{maximum:Number(e.value)}:{maximum:Number(e.value),exclusiveMaximum:!0};default:return{}}})))}}class H{constructor(e){const t=new $;this.generator=new Z(e,t)}generateDocument(e){const t=this.generator.generateDocumentData();return Object.assign(Object.assign({},e),t)}generateComponents(){return this.generator.generateComponents()}}class z{get nullType(){return{type:"null"}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return e?t?{type:Array.isArray(e)?[...e,"null"]:[e,"null"]}:{type:e}:{}}mapTupleItems(e){return{prefixItems:e}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{exclusiveMinimum:Number(e.value)};case"max":return e.inclusive?{maximum:Number(e.value)}:{exclusiveMaximum:Number(e.value)};default:return{}}})))}}function G(e){return"type"in e&&"webhook"===e.type}class B{constructor(e){this.definitions=e,this.webhookRefs={};const t=new z;this.generator=new Z(this.definitions,t)}generateDocument(e){const t=this.generator.generateDocumentData();return this.definitions.filter(G).forEach((e=>this.generateSingleWebhook(e.webhook))),Object.assign(Object.assign(Object.assign({},e),t),{webhooks:this.webhookRefs})}generateComponents(){return this.generator.generateComponents()}generateSingleWebhook(e){const t=this.generator.generatePath(e);return this.webhookRefs[e.path]=Object.assign(Object.assign({},this.webhookRefs[e.path]),t),t}}var q=e=>{const t=e.split("/");return""===t[0]&&t.shift(),t},K={},W=(e,t)=>{if("*"===e)return"*";const i=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(i){const n=`${e}#${t}`;return K[n]||(K[n]=i[2]?t&&":"!==t[0]&&"*"!==t[0]?[n,i[1],RegExp(`^${i[2]}(?=/${t})`)]:[e,i[1],RegExp(`^${i[2]}$`)]:[e,i[1],!0]),K[n]}return null},V=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,(e=>{try{return t(e)}catch{return e}}))}},X=e=>V(e,decodeURI),Y=e=>{const t=e.url,i=t.indexOf("/",t.indexOf(":")+4);let n=i;for(;n<t.length;n++){const e=t.charCodeAt(n);if(37===e){const e=t.indexOf("?",n),s=t.slice(i,-1===e?void 0:e);return X(s.includes("%25")?s.replace(/%25/g,"%2525"):s)}if(63===e)break}return t.slice(i,n)},J=e=>{const t=Y(e);return t.length>1&&"/"===t.at(-1)?t.slice(0,-1):t},Q=(e,t,...i)=>(i.length&&(t=Q(t,...i)),`${"/"===e?.[0]?"":"/"}${e}${"/"===t?"":`${"/"===e?.at(-1)?"":"/"}${"/"===t?.[0]?t.slice(1):t}`}`),ee=e=>{if(63!==e.charCodeAt(e.length-1)||!e.includes(":"))return null;const t=e.split("/"),i=[];let n="";return t.forEach((e=>{if(""===e||/\:/.test(e)){if(/\:/.test(e))if(/\?/.test(e)){i.push(0===i.length&&""===n?"/":n);const t=e.replace("?","");n+="/"+t,i.push(n)}else n+="/"+e}else n+="/"+e})),i.filter(((e,t,i)=>i.indexOf(e)===t))},te=e=>/[%+]/.test(e)?(-1!==e.indexOf("+")&&(e=e.replace(/\+/g," ")),-1!==e.indexOf("%")?V(e,se):e):e,ie=(e,t,i)=>{let n;if(!i&&t&&!/[%+]/.test(t)){let i=e.indexOf("?",8);if(-1===i)return;for(e.startsWith(t,i+1)||(i=e.indexOf("&"+t,i+1));-1!==i;){const n=e.charCodeAt(i+t.length+1);if(61===n){const n=i+t.length+2,s=e.indexOf("&",n);return te(e.slice(n,-1===s?void 0:s))}if(38==n||isNaN(n))return"";i=e.indexOf("&"+t,i+1)}if(n=/[%+]/.test(e),!n)return}const s={};n??=/[%+]/.test(e);let r=e.indexOf("?",8);for(;-1!==r;){const t=e.indexOf("&",r+1);let o=e.indexOf("=",r);o>t&&-1!==t&&(o=-1);let a,c=e.slice(r+1,-1===o?-1===t?void 0:t:o);n&&(c=te(c)),r=t,""!==c&&(-1===o?a="":(a=e.slice(o+1,-1===t?void 0:t),n&&(a=te(a))),i?(s[c]&&Array.isArray(s[c])||(s[c]=[]),s[c].push(a)):s[c]??=a)}return t?s[t]:s},ne=ie,se=decodeURIComponent,re=/^[\w!#$%&'*.^`|~+-]+$/,oe=/^[ !#-:<-[\]-~]*$/,ae=class extends Error{res;status;constructor(e=500,t){super(t?.message,{cause:t?.cause}),this.res=t?.res,this.status=e}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}},ce=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,ue=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/,de=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,le=(e,t)=>async(i,n)=>{let s={};const r=i.req.header("Content-Type");switch(e){case"json":if(!r||!ce.test(r))break;try{s=await i.req.json()}catch{throw new ae(400,{message:"Malformed JSON in request body"})}break;case"form":{if(!r||!ue.test(r)&&!de.test(r))break;let e;if(i.req.bodyCache.formData)e=await i.req.bodyCache.formData;else try{const t=await i.req.arrayBuffer();e=await((e,t)=>new Response(e,{headers:{"Content-Type":t}}).formData())(t,r),i.req.bodyCache.formData=e}catch(e){let t="Malformed FormData request.";throw t+=e instanceof Error?" "+e.message:" "+e,new ae(400,{message:t})}const t={};e.forEach(((e,i)=>{i.endsWith("[]")?(t[i]??=[]).push(e):Array.isArray(t[i])?t[i].push(e):t[i]=i in t?[t[i],e]:e})),s=t;break}case"query":s=Object.fromEntries(Object.entries(i.req.queries()).map((([e,t])=>1===t.length?[e,t[0]]:[e,t])));break;case"param":s=i.req.param();break;case"header":s=i.req.header();break;case"cookie":s=(e=>{const t=e.req.raw.headers.get("Cookie");if(!t)return{};return(e=>{const t=e.trim().split(";"),i={};for(let e of t){e=e.trim();const t=e.indexOf("=");if(-1===t)continue;const n=e.substring(0,t).trim();if(!re.test(n))continue;let s=e.substring(t+1).trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.slice(1,-1)),oe.test(s)&&(i[n]=-1!==s.indexOf("%")?V(s,se):s)}return i})(t)})(i)}const o=await t(s,i);return o instanceof Response?o:(i.req.addValidatedData(e,o),await n())};const he=function(e,t,i,n){return le(e,(async(s,r)=>{let o=s;if("header"===e&&"_def"in t||"header"===e&&"_zod"in t){const e=Object.fromEntries(Object.keys("in"in t?t.in.shape:t.shape).map((e=>[e.toLowerCase(),e])));o=Object.fromEntries(Object.entries(s).map((([t,i])=>[e[t]||t,i])))}const a=n&&n.validationFunction?await n.validationFunction(t,o):await t.safeParseAsync(o);if(i){const t=await i({data:o,...a,target:e},r);if(t){if(t instanceof Response)return t;if("response"in t)return t.response}}return a.success?a.data:r.json(a,400)}))};var _e=(e,t,i)=>(n,s)=>{let r=-1;return async function o(a){if(a<=r)throw Error("next() called multiple times");let c;r=a;let u,d=!1;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&s||void 0,u)try{c=await u(n,(()=>o(a+1)))}catch(e){if(!(e instanceof Error&&t))throw e;n.error=e,c=await t(e,n),d=!0}else!1===n.finalized&&i&&(c=await i(n));return c&&(!1===n.finalized||d)&&(n.res=c),n}(0)},pe=Symbol(),fe=(e,t,i)=>{void 0!==e[t]?Array.isArray(e[t])?e[t].push(i):e[t]=[e[t],i]:e[t]=t.endsWith("[]")?[i]:i},me=(e,t,i)=>{let n=e;const s=t.split(".");s.forEach(((e,t)=>{t===s.length-1?n[e]=i:((!n[e]||"object"!=typeof n[e]||Array.isArray(n[e])||n[e]instanceof File)&&(n[e]=Object.create(null)),n=n[e])}))},ge=e=>V(e,se),ye=class{raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(e,t="/",i=[[]]){this.raw=e,this.path=t,this.#t=i,this.#e={}}param(e){return e?this.#i(e):this.#n()}#i(e){const t=this.#t[0][this.routeIndex][1][e],i=this.#s(t);return i&&/\%/.test(i)?ge(i):i}#n(){const e={},t=Object.keys(this.#t[0][this.routeIndex][1]);for(const i of t){const t=this.#s(this.#t[0][this.routeIndex][1][i]);void 0!==t&&(e[i]=/\%/.test(t)?ge(t):t)}return e}#s(e){return this.#t[1]?this.#t[1][e]:e}query(e){return ne(this.url,e)}queries(e){return((e,t)=>ie(this.url,t,!0))(0,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;const t={};return this.raw.headers.forEach(((e,i)=>{t[i]=e})),t}async parseBody(e){return this.bodyCache.parsedBody??=await(async(e,t=Object.create(null))=>{const{all:i=!1,dot:n=!1}=t,s=(e instanceof ye?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?async function(e,t){const i=await e.formData();return i?function(e,t){const i=Object.create(null);return e.forEach(((e,n)=>{t.all||n.endsWith("[]")?fe(i,n,e):i[n]=e})),t.dot&&Object.entries(i).forEach((([e,t])=>{e.includes(".")&&(me(i,e,t),delete i[e])})),i}(i,t):{}}(e,{all:i,dot:n}):{}})(this,e)}#r=e=>{const{bodyCache:t,raw:i}=this,n=t[e];if(n)return n;const s=Object.keys(t)[0];return s?t[s].then((t=>("json"===s&&(t=JSON.stringify(t)),new Response(t)[e]()))):t[e]=i[e]()};json(){return this.#r("text").then((e=>JSON.parse(e)))}text(){return this.#r("text")}arrayBuffer(){return this.#r("arrayBuffer")}blob(){return this.#r("blob")}formData(){return this.#r("formData")}addValidatedData(e,t){this.#e[e]=t}valid(e){return this.#e[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[pe](){return this.#t}get matchedRoutes(){return this.#t[0].map((([[,e]])=>e))}get routePath(){return this.#t[0].map((([[,e]])=>e))[this.routeIndex].path}},Ee=async(e,t,i,n,s)=>{"object"!=typeof e||e instanceof String||(e instanceof Promise||(e=""+e),e instanceof Promise&&(e=await e));const r=e.callbacks;return r?.length?(s?s[0]+=e:s=[e],Promise.all(r.map((e=>e({phase:t,buffer:s,context:n})))).then((e=>Promise.all(e.filter(Boolean).map((e=>Ee(e,t,!1,n,s)))).then((()=>s[0]))))):Promise.resolve(e)},be=(e,t)=>({"Content-Type":e,...t}),ve=class{#o;#a;env={};#c;finalized=!1;error;#u;#d;#l;#h;#_;#p;#f;#t;#m;constructor(e,t){this.#o=e,t&&(this.#d=t.executionCtx,this.env=t.env,this.#p=t.notFoundHandler,this.#m=t.path,this.#t=t.matchResult)}get req(){return this.#a??=new ye(this.#o,this.#m,this.#t),this.#a}get event(){if(this.#d&&"respondWith"in this.#d)return this.#d;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#d)return this.#d;throw Error("This context has no ExecutionContext")}get res(){return this.#l||=new Response(null,{headers:this.#f??=new Headers})}set res(e){if(this.#l&&e){e=new Response(e.body,e);for(const[t,i]of this.#l.headers.entries())if("content-type"!==t)if("set-cookie"===t){const t=this.#l.headers.getSetCookie();e.headers.delete("set-cookie");for(const i of t)e.headers.append("set-cookie",i)}else e.headers.set(t,i)}this.#l=e,this.finalized=!0}render=(...e)=>(this.#_??=e=>this.html(e),this.#_(...e));setLayout=e=>this.#h=e;getLayout=()=>this.#h;setRenderer=e=>{this.#_=e};header=(e,t,i)=>{this.finalized&&(this.#l=new Response(this.#l.body,this.#l));const n=this.#l?this.#l.headers:this.#f??=new Headers;void 0===t?n.delete(e):i?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#u=e};set=(e,t)=>{this.#c??=new Map,this.#c.set(e,t)};get=e=>this.#c?this.#c.get(e):void 0;get var(){return this.#c?Object.fromEntries(this.#c):{}}#g(e,t,i){const n=this.#l?new Headers(this.#l.headers):this.#f??new Headers;if("object"==typeof t&&"headers"in t){const e=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(const[t,i]of e)"set-cookie"===t.toLowerCase()?n.append(t,i):n.set(t,i)}if(i)for(const[e,t]of Object.entries(i))if("string"==typeof t)n.set(e,t);else{n.delete(e);for(const i of t)n.append(e,i)}const s="number"==typeof t?t:t?.status??this.#u;return new Response(e,{status:s,headers:n})}newResponse=(...e)=>this.#g(...e);body=(e,t,i)=>this.#g(e,t,i);text=(e,t,i)=>this.#f||this.#u||t||i||this.finalized?this.#g(e,t,be("text/plain; charset=UTF-8",i)):new Response(e);json=(e,t,i)=>this.#g(JSON.stringify(e),t,be("application/json",i));html=(e,t,i)=>{const n=e=>this.#g(e,t,be("text/html; charset=UTF-8",i));return"object"==typeof e?Ee(e,1,!1,{}).then(n):n(e)};redirect=(e,t)=>{const i=e+"";return this.header("Location",/[^\x00-\xFF]/.test(i)?encodeURI(i):i),this.newResponse(null,t??302)};notFound=()=>(this.#p??=()=>new Response,this.#p(this))},Oe="ALL",we=["get","post","put","delete","options","patch"],Ae="Can not add a route since the matcher is already built.",Se=class extends Error{},Ie=e=>e.text("404 Not Found",404),Ne=(e,t)=>{if("getResponse"in e){const i=e.getResponse();return t.newResponse(i.body,i)}return console.error(e),t.text("Internal Server Error",500)},Ce=class e{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#m="/";routes=[];constructor(e={}){[...we,"all"].forEach((e=>{this[e]=(t,...i)=>("string"==typeof t?this.#m=t:this.#y(e,this.#m,t),i.forEach((t=>{this.#y(e,this.#m,t)})),this)})),this.on=(e,t,...i)=>{for(const n of[t].flat()){this.#m=n;for(const t of[e].flat())i.map((e=>{this.#y(t.toUpperCase(),this.#m,e)}))}return this},this.use=(e,...t)=>("string"==typeof e?this.#m=e:(this.#m="*",t.unshift(e)),t.forEach((e=>{this.#y(Oe,this.#m,e)})),this);const{strict:t,...i}=e;Object.assign(this,i),this.getPath=t??1?e.getPath??Y:J}#E(){const t=new e({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#p=this.#p,t.routes=this.routes,t}#p=Ie;errorHandler=Ne;route(e,t){const i=this.basePath(e);return t.routes.map((e=>{let n;t.errorHandler===Ne?n=e.handler:(n=async(i,n)=>(await _e([],t.errorHandler)(i,(()=>e.handler(i,n)))).res,n.__COMPOSED_HANDLER=e.handler),i.#y(e.method,e.path,n)})),this}basePath(e){const t=this.#E();return t._basePath=Q(this._basePath,e),t}onError=e=>(this.errorHandler=e,this);notFound=e=>(this.#p=e,this);mount(e,t,i){let n,s;i&&("function"==typeof i?s=i:(s=i.optionHandler,n=!1===i.replaceRequest?e=>e:i.replaceRequest));const r=s?e=>{const t=s(e);return Array.isArray(t)?t:[t]}:e=>{let t;try{t=e.executionCtx}catch{}return[e.env,t]};return n||=(()=>{const t=Q(this._basePath,e),i="/"===t?0:t.length;return e=>{const t=new URL(e.url);return t.pathname=t.pathname.slice(i)||"/",new Request(t,e)}})(),this.#y(Oe,Q(e,"*"),(async(e,i)=>{const s=await t(n(e.req.raw),...r(e));if(s)return s;await i()})),this}#y(e,t,i){e=e.toUpperCase(),t=Q(this._basePath,t);const n={basePath:this._basePath,path:t,method:e,handler:i};this.router.add(e,t,[i,n]),this.routes.push(n)}#b(e,t){if(e instanceof Error)return this.errorHandler(e,t);throw e}#v(e,t,i,n){if("HEAD"===n)return(async()=>new Response(null,await this.#v(e,t,i,"GET")))();const s=this.getPath(e,{env:i}),r=this.router.match(n,s),o=new ve(e,{path:s,matchResult:r,env:i,executionCtx:t,notFoundHandler:this.#p});if(1===r[0].length){let e;try{e=r[0][0][0][0](o,(async()=>{o.res=await this.#p(o)}))}catch(e){return this.#b(e,o)}return e instanceof Promise?e.then((e=>e||(o.finalized?o.res:this.#p(o)))).catch((e=>this.#b(e,o))):e??this.#p(o)}const a=_e(r[0],this.errorHandler,this.#p);return(async()=>{try{const e=await a(o);if(!e.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return e.res}catch(e){return this.#b(e,o)}})()}fetch=(e,...t)=>this.#v(e,t[1],t[0],e.method);request=(e,t,i,n)=>e instanceof Request?this.fetch(t?new Request(e,t):e,i,n):(e=""+e,this.fetch(new Request(/^https?:\/\//.test(e)?e:"http://localhost"+Q("/",e),t),i,n));fire=()=>{addEventListener("fetch",(e=>{e.respondWith(this.#v(e.request,e,void 0,e.request.method))}))}},Te=[];function xe(e,t){const i=this.buildAllMatchers(),n=(e,t)=>{const n=i[e]||i[Oe],s=n[2][t];if(s)return s;const r=t.match(n[0]);if(!r)return[[],Te];const o=r.indexOf("",1);return[n[1][o],r]};return this.match=n,n(e,t)}var Re="[^/]+",ke=".*",De="(?:|/.*)",Le=Symbol(),je=new Set(".\\+*[^]$()");function Fe(e,t){return 1===e.length?1===t.length?e<t?-1:1:-1:1===t.length||e===ke||e===De?1:t===ke||t===De?-1:e===Re?1:t===Re?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Ue=class e{#O;#w;#A=Object.create(null);insert(t,i,n,s,r){if(0===t.length){if(void 0!==this.#O)throw Le;if(r)return;return void(this.#O=i)}const[o,...a]=t,c="*"===o?0===a.length?["","",ke]:["","",Re]:"/*"===o?["","",De]:o.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);let u;if(c){const t=c[1];let i=c[2]||Re;if(t&&c[2]){if(".*"===i)throw Le;if(i=i.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(i))throw Le}if(u=this.#A[i],!u){if(Object.keys(this.#A).some((e=>e!==ke&&e!==De)))throw Le;if(r)return;u=this.#A[i]=new e,""!==t&&(u.#w=s.varIndex++)}r||""===t||n.push([t,u.#w])}else if(u=this.#A[o],!u){if(Object.keys(this.#A).some((e=>e.length>1&&e!==ke&&e!==De)))throw Le;if(r)return;u=this.#A[o]=new e}u.insert(a,i,n,s,r)}buildRegExpStr(){const e=Object.keys(this.#A).sort(Fe).map((e=>{const t=this.#A[e];return("number"==typeof t.#w?`(${e})@${t.#w}`:je.has(e)?"\\"+e:e)+t.buildRegExpStr()}));return"number"==typeof this.#O&&e.unshift("#"+this.#O),0===e.length?"":1===e.length?e[0]:"(?:"+e.join("|")+")"}},Pe=class{#S={varIndex:0};#I=new Ue;insert(e,t,i){const n=[],s=[];for(let t=0;;){let i=!1;if(e=e.replace(/\{[^}]+\}/g,(e=>{const n="@\\"+t;return s[t]=[n,e],t++,i=!0,n})),!i)break}const r=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let e=s.length-1;e>=0;e--){const[t]=s[e];for(let i=r.length-1;i>=0;i--)if(-1!==r[i].indexOf(t)){r[i]=r[i].replace(t,s[e][1]);break}}return this.#I.insert(r,t,n,this.#S,i),n}buildRegExp(){let e=this.#I.buildRegExpStr();if(""===e)return[/^$/,[],[]];let t=0;const i=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,((e,s,r)=>void 0!==s?(i[++t]=Number(s),"$()"):void 0!==r?(n[Number(r)]=++t,""):"")),[RegExp("^"+e),i,n]}},Me=[/^$/,[],Object.create(null)],Ze=Object.create(null);function $e(e){return Ze[e]??=RegExp("*"===e?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,((e,t)=>t?"\\"+t:"(?:|/.*)"))}$`)}function He(e,t){if(e)for(const i of Object.keys(e).sort(((e,t)=>t.length-e.length)))if($e(i).test(t))return[...e[i]]}var ze,Ge,Be=class{name="RegExpRouter";#N;#C;constructor(){this.#N={[Oe]:Object.create(null)},this.#C={[Oe]:Object.create(null)}}add(e,t,i){const n=this.#N,s=this.#C;if(!n||!s)throw Error(Ae);n[e]||[n,s].forEach((t=>{t[e]=Object.create(null),Object.keys(t[Oe]).forEach((i=>{t[e][i]=[...t[Oe][i]]}))})),"/*"===t&&(t="*");const r=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){const o=$e(t);return e===Oe?Object.keys(n).forEach((e=>{n[e][t]||=He(n[e],t)||He(n[Oe],t)||[]})):n[e][t]||=He(n[e],t)||He(n[Oe],t)||[],Object.keys(n).forEach((t=>{e!==Oe&&e!==t||Object.keys(n[t]).forEach((e=>{o.test(e)&&n[t][e].push([i,r])}))})),void Object.keys(s).forEach((t=>{e!==Oe&&e!==t||Object.keys(s[t]).forEach((e=>o.test(e)&&s[t][e].push([i,r])))}))}const o=ee(t)||[t];for(let t=0,a=o.length;t<a;t++){const c=o[t];Object.keys(s).forEach((o=>{e!==Oe&&e!==o||(s[o][c]||=[...He(n[o],c)||He(n[Oe],c)||[]],s[o][c].push([i,r-a+t+1]))}))}}match=xe;buildAllMatchers(){const e=Object.create(null);return Object.keys(this.#C).concat(Object.keys(this.#N)).forEach((t=>{e[t]||=this.#T(t)})),this.#N=this.#C=void 0,Ze=Object.create(null),e}#T(e){const t=[];let i=e===Oe;return[this.#N,this.#C].forEach((n=>{const s=n[e]?Object.keys(n[e]).map((t=>[t,n[e][t]])):[];0!==s.length?(i||=!0,t.push(...s)):e!==Oe&&t.push(...Object.keys(n[Oe]).map((e=>[e,n[Oe][e]])))})),i?function(e){const t=new Pe,i=[];if(0===e.length)return Me;const n=e.map((e=>[!/\*|\/:/.test(e[0]),...e])).sort((([e,t],[i,n])=>e?1:i?-1:t.length-n.length)),s=Object.create(null);for(let e=0,r=-1,o=n.length;e<o;e++){const[o,a,c]=n[e];let u;o?s[a]=[c.map((([e])=>[e,Object.create(null)])),Te]:r++;try{u=t.insert(a,r,o)}catch(e){throw e===Le?new Se(a):e}o||(i[r]=c.map((([e,t])=>{const i=Object.create(null);for(t-=1;t>=0;t--){const[e,n]=u[t];i[e]=n}return[e,i]})))}const[r,o,a]=t.buildRegExp();for(let e=0,t=i.length;e<t;e++)for(let t=0,n=i[e].length;t<n;t++){const n=i[e][t]?.[1];if(!n)continue;const s=Object.keys(n);for(let e=0,t=s.length;e<t;e++)n[s[e]]=a[n[s[e]]]}const c=[];for(const e in o)c[e]=i[o[e]];return[r,c,s]}(t):null}},qe=class{name="SmartRouter";#x=[];#C=[];constructor(e){this.#x=e.routers}add(e,t,i){if(!this.#C)throw Error(Ae);this.#C.push([e,t,i])}match(e,t){if(!this.#C)throw Error("Fatal error");const i=this.#x,n=this.#C,s=i.length;let r,o=0;for(;o<s;o++){const s=i[o];try{for(let e=0,t=n.length;e<t;e++)s.add(...n[e]);r=s.match(e,t)}catch(e){if(e instanceof Se)continue;throw e}this.match=s.match.bind(s),this.#x=[s],this.#C=void 0;break}if(o===s)throw Error("Fatal error");return this.name="SmartRouter + "+this.activeRouter.name,r}get activeRouter(){if(this.#C||1!==this.#x.length)throw Error("No active router has been determined yet.");return this.#x[0]}},Ke=Object.create(null),We=class e{#R;#A;#k;#D=0;#L=Ke;constructor(e,t,i){if(this.#A=i||Object.create(null),this.#R=[],e&&t){const i=Object.create(null);i[e]={handler:t,possibleKeys:[],score:0},this.#R=[i]}this.#k=[]}insert(t,i,n){this.#D=++this.#D;let s=this;const r=(e=>{const{groups:t,path:i}=(e=>{const t=[];return e=e.replace(/\{[^}]+\}/g,((e,i)=>{const n="@"+i;return t.push([n,e]),n})),{groups:t,path:e}})(e);return((e,t)=>{for(let i=t.length-1;i>=0;i--){const[n]=t[i];for(let s=e.length-1;s>=0;s--)if(e[s].includes(n)){e[s]=e[s].replace(n,t[i][1]);break}}return e})(q(i),t)})(i),o=[];for(let t=0,i=r.length;t<i;t++){const i=r[t],n=W(i,r[t+1]),a=Array.isArray(n)?n[0]:i;a in s.#A?(s=s.#A[a],n&&o.push(n[1])):(s.#A[a]=new e,n&&(s.#k.push(n),o.push(n[1])),s=s.#A[a])}return s.#R.push({[t]:{handler:n,possibleKeys:o.filter(((e,t,i)=>i.indexOf(e)===t)),score:this.#D}}),s}#j(e,t,i,n){const s=[];for(let r=0,o=e.#R.length;r<o;r++){const o=e.#R[r],a=o[t]||o[Oe],c={};if(void 0!==a&&(a.params=Object.create(null),s.push(a),i!==Ke||n&&n!==Ke))for(let e=0,t=a.possibleKeys.length;e<t;e++){const t=a.possibleKeys[e],s=c[a.score];a.params[t]=n?.[t]&&!s?n[t]:i[t]??n?.[t],c[a.score]=!0}}return s}search(e,t){const i=[];this.#L=Ke;let n=[this];const s=q(t),r=[];for(let t=0,o=s.length;t<o;t++){const a=s[t],c=t===o-1,u=[];for(let o=0,d=n.length;o<d;o++){const d=n[o],l=d.#A[a];l&&(l.#L=d.#L,c?(l.#A["*"]&&i.push(...this.#j(l.#A["*"],e,d.#L)),i.push(...this.#j(l,e,d.#L))):u.push(l));for(let n=0,o=d.#k.length;n<o;n++){const o=d.#k[n],l=d.#L===Ke?{}:{...d.#L};if("*"===o){const t=d.#A["*"];t&&(i.push(...this.#j(t,e,d.#L)),t.#L=l,u.push(t));continue}const[h,_,p]=o;if(!(a||p instanceof RegExp))continue;const f=d.#A[h],m=s.slice(t).join("/");if(p instanceof RegExp){const t=p.exec(m);if(t){if(l[_]=t[0],i.push(...this.#j(f,e,d.#L,l)),Object.keys(f.#A).length){f.#L=l;const e=t[0].match(/\//)?.length??0;(r[e]||=[]).push(f)}continue}}(!0===p||p.test(a))&&(l[_]=a,c?(i.push(...this.#j(f,e,l,d.#L)),f.#A["*"]&&i.push(...this.#j(f.#A["*"],e,l,d.#L))):(f.#L=l,u.push(f)))}}n=u.concat(r.shift()??[])}return i.length>1&&i.sort(((e,t)=>e.score-t.score)),[i.map((({handler:e,params:t})=>[e,t]))]}},Ve=class{name="TrieRouter";#F;constructor(){this.#F=new We}add(e,t,i){const n=ee(t);if(n)for(let t=0,s=n.length;t<s;t++)this.#F.insert(e,n[t],i);else this.#F.insert(e,t,i)}match(e,t){return this.#F.search(e,t)}},Xe=class extends Ce{constructor(e={}){super(e),this.router=e.router??new qe({routers:[new Be,new Ve]})}};!function(e){e.assertEqual=()=>{},e.assertIs=function(){},e.assertNever=function(){throw Error()},e.arrayToEnum=e=>{const t={};for(const i of e)t[i]=i;return t},e.getValidEnumValues=t=>{const i=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of i)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},e.find=(e,t)=>{for(const i of e)if(t(i))return i},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?""+t:t}(ze||(ze={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Ge||(Ge={}));const Ye=ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Je=e=>{switch(typeof e){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(e)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(e)?Ye.array:null===e?Ye.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Ye.promise:"undefined"!=typeof Map&&e instanceof Map?Ye.map:"undefined"!=typeof Set&&e instanceof Set?Ye.set:void 0!==Date&&e instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Qe=ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class et extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},i={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)i._errors.push(t(s));else{let e=i,n=0;for(;n<s.path.length;){const i=s.path[n];n===s.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(t(s))):e[i]=e[i]||{_errors:[]},e=e[i],n++}}};return n(this),i}static assert(e){if(!(e instanceof et))throw Error("Not a ZodError: "+e)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},i=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}et.create=e=>new et(e);const tt=(e,t)=>{let i;switch(e.code){case Qe.invalid_type:i=e.received===Ye.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Qe.invalid_literal:i="Invalid literal value, expected "+JSON.stringify(e.expected,ze.jsonStringifyReplacer);break;case Qe.unrecognized_keys:i="Unrecognized key(s) in object: "+ze.joinValues(e.keys,", ");break;case Qe.invalid_union:i="Invalid input";break;case Qe.invalid_union_discriminator:i="Invalid discriminator value. Expected "+ze.joinValues(e.options);break;case Qe.invalid_enum_value:i=`Invalid enum value. Expected ${ze.joinValues(e.options)}, received '${e.received}'`;break;case Qe.invalid_arguments:i="Invalid function arguments";break;case Qe.invalid_return_type:i="Invalid function return type";break;case Qe.invalid_date:i="Invalid date";break;case Qe.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:ze.assertNever(e.validation):i="regex"!==e.validation?"Invalid "+e.validation:"Invalid";break;case Qe.too_small:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Qe.too_big:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Qe.custom:i="Invalid input";break;case Qe.invalid_intersection_types:i="Intersection results could not be merged";break;case Qe.not_multiple_of:i="Number must be a multiple of "+e.multipleOf;break;case Qe.not_finite:i="Number must be finite";break;default:i=t.defaultError,ze.assertNever(e)}return{message:i}};let it=tt;function nt(){return it}const st=e=>{const{data:t,path:i,errorMaps:n,issueData:s}=e,r=[...i,...s.path||[]],o={...s,path:r};if(void 0!==s.message)return{...s,path:r,message:s.message};let a="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)a=e(o,{data:t,defaultError:a}).message;return{...s,path:r,message:a}};function rt(e,t){const i=nt(),n=st({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===tt?void 0:tt].filter((e=>!!e))});e.common.issues.push(n)}class ot{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const n of t){if("aborted"===n.status)return at;"dirty"===n.status&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const e of t){const t=await e.key,n=await e.value;i.push({key:t,value:n})}return ot.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return at;if("aborted"===s.status)return at;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(i[t.value]=s.value)}return{status:e.value,value:i}}}const at=Object.freeze({status:"aborted"}),ct=e=>({status:"dirty",value:e}),ut=e=>({status:"valid",value:e}),dt=e=>"aborted"===e.status,lt=e=>"dirty"===e.status,ht=e=>"valid"===e.status,_t=e=>"undefined"!=typeof Promise&&e instanceof Promise;var pt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(pt||(pt={}));class ft{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const mt=(e,t)=>{if(ht(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new et(e.common.issues);return this._error=t,this._error}}};function gt(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:n,description:s}=e;if(t&&(i||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??s.defaultError}:void 0===s.data?{message:r??n??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:r??i??s.defaultError}},description:s}}class yt{get description(){return this._def.description}_getType(e){return Je(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Je(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ot,ctx:{common:e.parent.common,data:e.data,parsedType:Je(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(_t(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){const i={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Je(e)},n=this._parseSync({data:e,path:i.path,parent:i});return mt(i,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Je(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return ht(i)?{value:i.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>ht(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Je(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(_t(n)?n:Promise.resolve(n));return mt(i,s)}refine(e,t){const i=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),r=()=>n.addIssue({code:Qe.custom,...i(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(r(),!1))):!!s||(r(),!1)}))}refinement(e,t){return this._refinement(((i,n)=>!!e(i)||(n.addIssue("function"==typeof t?t(i,n):t),!1)))}_refinement(e){return new bi({schema:this,typeName:Di.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return vi.create(this,this._def)}nullable(){return Oi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ti.create(this)}promise(){return Ei.create(this,this._def)}or(e){return si.create([this,e],this._def)}and(e){return ci.create(this,e,this._def)}transform(e){return new bi({...gt(this._def),schema:this,typeName:Di.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new wi({...gt(this._def),innerType:this,defaultValue:t,typeName:Di.ZodDefault})}brand(){return new Ni({typeName:Di.ZodBranded,type:this,...gt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ai({...gt(this._def),innerType:this,catchValue:t,typeName:Di.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ci.create(this,e)}readonly(){return Ti.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Et=/^c[^\s-]{8,}$/i,bt=/^[0-9a-z]+$/,vt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ot=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wt=/^[a-z0-9_-]{21}$/i,At=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,St=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,It=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Nt;const Ct=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Rt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Lt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",jt=RegExp(`^${Lt}$`);function Ft(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t+="(\\.\\d+)?"),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function Ut(e){return RegExp(`^${Ft(e)}$`)}function Pt(e){let t=`${Lt}T${Ft(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,RegExp(`^${t}$`)}function Mt(e,t){return!("v4"!==t&&t||!Ct.test(e))||!("v6"!==t&&t||!xt.test(e))}function Zt(e,t){if(!At.test(e))return!1;try{const[i]=e.split(".");if(!i)return!1;const n=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),s=JSON.parse(atob(n));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function $t(e,t){return!("v4"!==t&&t||!Tt.test(e))||!("v6"!==t&&t||!Rt.test(e))}class Ht extends yt{_parse(e){if(this._def.coerce&&(e.data=e.data+""),this._getType(e)!==Ye.string){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.string,received:t.parsedType}),at}const t=new ot;let i;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const s=e.data.length>n.value,r=e.data.length<n.value;(s||r)&&(i=this._getOrReturnCtx(e,i),s?rt(i,{code:Qe.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&rt(i,{code:Qe.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)It.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"email",code:Qe.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)Nt||(Nt=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Nt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"emoji",code:Qe.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)Ot.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"uuid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)wt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"nanoid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)Et.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"cuid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)bt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"cuid2",code:Qe.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)vt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"ulid",code:Qe.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),rt(i,{validation:"url",code:Qe.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"regex",code:Qe.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?Pt(n).test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?jt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?Ut(n).test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?St.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"duration",code:Qe.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?Mt(e.data,n.version)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"ip",code:Qe.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?Zt(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"jwt",code:Qe.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?$t(e.data,n.version)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"cidr",code:Qe.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?kt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"base64",code:Qe.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?Dt.test(e.data)||(i=this._getOrReturnCtx(e,i),rt(i,{validation:"base64url",code:Qe.invalid_string,message:n.message}),t.dirty()):ze.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,i){return this.refinement((t=>e.test(t)),{validation:t,code:Qe.invalid_string,...pt.errToObj(i)})}_addCheck(e){return new Ht({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...pt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...pt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...pt.errToObj(e)})}datetime(e){return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,local:!1,message:e}:{kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...pt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return this._addCheck("string"==typeof e?{kind:"time",precision:null,message:e}:{kind:"time",precision:void 0===e?.precision?null:e?.precision,...pt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...pt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...pt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...pt.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...pt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...pt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...pt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...pt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...pt.errToObj(t)})}nonempty(e){return this.min(1,pt.errToObj(e))}trim(){return new Ht({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ht({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ht({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function zt(e,t){const i=((""+e).split(".")[1]||"").length,n=((""+t).split(".")[1]||"").length,s=i>n?i:n;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}Ht.create=e=>new Ht({checks:[],typeName:Di.ZodString,coerce:e?.coerce??!1,...gt(e)});class Gt extends yt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ye.number){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.number,received:t.parsedType}),at}let t;const i=new ot;for(const n of this._def.checks)"int"===n.kind?ze.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"multipleOf"===n.kind?0!==zt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.not_finite,message:n.message}),i.dirty()):ze.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,pt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pt.toString(t))}setLimit(e,t,i,n){return new Gt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:pt.toString(n)}]})}_addCheck(e){return new Gt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:pt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&ze.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Gt.create=e=>new Gt({checks:[],typeName:Di.ZodNumber,coerce:e?.coerce||!1,...gt(e)});class Bt extends yt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ye.bigint)return this._getInvalidInput(e);let t;const i=new ot;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),rt(t,{code:Qe.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):ze.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.bigint,received:t.parsedType}),at}gte(e,t){return this.setLimit("min",e,!0,pt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,pt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,pt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,pt.toString(t))}setLimit(e,t,i,n){return new Bt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:pt.toString(n)}]})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:pt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Bt.create=e=>new Bt({checks:[],typeName:Di.ZodBigInt,coerce:e?.coerce??!1,...gt(e)});class qt extends yt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ye.boolean){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.boolean,received:t.parsedType}),at}return ut(e.data)}}qt.create=e=>new qt({typeName:Di.ZodBoolean,coerce:e?.coerce||!1,...gt(e)});class Kt extends yt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ye.date){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.date,received:t.parsedType}),at}if(Number.isNaN(e.data.getTime()))return rt(this._getOrReturnCtx(e),{code:Qe.invalid_date}),at;const t=new ot;let i;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),rt(i,{code:Qe.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):ze.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Kt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:pt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:pt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Kt.create=e=>new Kt({checks:[],coerce:e?.coerce||!1,typeName:Di.ZodDate,...gt(e)});class Wt extends yt{_parse(e){if(this._getType(e)!==Ye.symbol){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.symbol,received:t.parsedType}),at}return ut(e.data)}}Wt.create=e=>new Wt({typeName:Di.ZodSymbol,...gt(e)});class Vt extends yt{_parse(e){if(this._getType(e)!==Ye.undefined){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.undefined,received:t.parsedType}),at}return ut(e.data)}}Vt.create=e=>new Vt({typeName:Di.ZodUndefined,...gt(e)});class Xt extends yt{_parse(e){if(this._getType(e)!==Ye.null){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.null,received:t.parsedType}),at}return ut(e.data)}}Xt.create=e=>new Xt({typeName:Di.ZodNull,...gt(e)});class Yt extends yt{constructor(){super(...arguments),this._any=!0}_parse(e){return ut(e.data)}}Yt.create=e=>new Yt({typeName:Di.ZodAny,...gt(e)});class Jt extends yt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ut(e.data)}}Jt.create=e=>new Jt({typeName:Di.ZodUnknown,...gt(e)});class Qt extends yt{_parse(e){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.never,received:t.parsedType}),at}}Qt.create=e=>new Qt({typeName:Di.ZodNever,...gt(e)});class ei extends yt{_parse(e){if(this._getType(e)!==Ye.undefined){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.void,received:t.parsedType}),at}return ut(e.data)}}ei.create=e=>new ei({typeName:Di.ZodVoid,...gt(e)});class ti extends yt{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==Ye.array)return rt(t,{code:Qe.invalid_type,expected:Ye.array,received:t.parsedType}),at;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(rt(t,{code:e?Qe.too_big:Qe.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(rt(t,{code:Qe.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(rt(t,{code:Qe.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map(((e,i)=>n.type._parseAsync(new ft(t,e,t.path,i))))).then((e=>ot.mergeArray(i,e)));const s=[...t.data].map(((e,i)=>n.type._parseSync(new ft(t,e,t.path,i))));return ot.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new ti({...this._def,minLength:{value:e,message:pt.toString(t)}})}max(e,t){return new ti({...this._def,maxLength:{value:e,message:pt.toString(t)}})}length(e,t){return new ti({...this._def,exactLength:{value:e,message:pt.toString(t)}})}nonempty(e){return this.min(1,e)}}function ii(e){if(e instanceof ni){const t={};for(const i in e.shape)t[i]=vi.create(ii(e.shape[i]));return new ni({...e._def,shape:()=>t})}return e instanceof ti?new ti({...e._def,type:ii(e.element)}):e instanceof vi?vi.create(ii(e.unwrap())):e instanceof Oi?Oi.create(ii(e.unwrap())):e instanceof ui?ui.create(e.items.map((e=>ii(e)))):e}ti.create=(e,t)=>new ti({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Di.ZodArray,...gt(t)});class ni extends yt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=ze.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Ye.object){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.object,received:t.parsedType}),at}const{status:t,ctx:i}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),r=[];if(!(this._def.catchall instanceof Qt&&"strip"===this._def.unknownKeys))for(const e in i.data)s.includes(e)||r.push(e);const o=[];for(const e of s)o.push({key:{status:"valid",value:e},value:n[e]._parse(new ft(i,i.data[e],i.path,e)),alwaysSet:e in i.data});if(this._def.catchall instanceof Qt){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)o.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)r.length>0&&(rt(i,{code:Qe.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r)o.push({key:{status:"valid",value:t},value:e._parse(new ft(i,i.data[t],i.path,t)),alwaysSet:t in i.data})}return i.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const i=await t.key,n=await t.value;e.push({key:i,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>ot.mergeObjectSync(t,e))):ot.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return new ni({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{const n=this._def.errorMap?.(t,i).message??i.defaultError;return"unrecognized_keys"===t.code?{message:pt.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new ni({...this._def,unknownKeys:"strip"})}passthrough(){return new ni({...this._def,unknownKeys:"passthrough"})}extend(e){return new ni({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ni({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Di.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ni({...this._def,catchall:e})}pick(e){const t={};for(const i of ze.objectKeys(e))e[i]&&this.shape[i]&&(t[i]=this.shape[i]);return new ni({...this._def,shape:()=>t})}omit(e){const t={};for(const i of ze.objectKeys(this.shape))e[i]||(t[i]=this.shape[i]);return new ni({...this._def,shape:()=>t})}deepPartial(){return ii(this)}partial(e){const t={};for(const i of ze.objectKeys(this.shape)){const n=this.shape[i];t[i]=e&&!e[i]?n:n.optional()}return new ni({...this._def,shape:()=>t})}required(e){const t={};for(const i of ze.objectKeys(this.shape))if(e&&!e[i])t[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof vi;)e=e._def.innerType;t[i]=e}return new ni({...this._def,shape:()=>t})}keyof(){return mi(ze.objectKeys(this.shape))}}ni.create=(e,t)=>new ni({shape:()=>e,unknownKeys:"strip",catchall:Qt.create(),typeName:Di.ZodObject,...gt(t)}),ni.strictCreate=(e,t)=>new ni({shape:()=>e,unknownKeys:"strict",catchall:Qt.create(),typeName:Di.ZodObject,...gt(t)}),ni.lazycreate=(e,t)=>new ni({shape:e,unknownKeys:"strip",catchall:Qt.create(),typeName:Di.ZodObject,...gt(t)});class si extends yt{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map((async e=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;const i=e.map((e=>new et(e.ctx.common.issues)));return rt(t,{code:Qe.invalid_union,unionErrors:i}),at}));{let e;const n=[];for(const s of i){const i={...t,common:{...t.common,issues:[]},parent:null},r=s._parseSync({data:t.data,path:t.path,parent:i});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:i}),i.common.issues.length&&n.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new et(e)));return rt(t,{code:Qe.invalid_union,unionErrors:s}),at}}get options(){return this._def.options}}si.create=(e,t)=>new si({options:e,typeName:Di.ZodUnion,...gt(t)});const ri=e=>e instanceof pi?ri(e.schema):e instanceof bi?ri(e.innerType()):e instanceof fi?[e.value]:e instanceof gi?e.options:e instanceof yi?ze.objectValues(e.enum):e instanceof wi?ri(e._def.innerType):e instanceof Vt?[void 0]:e instanceof Xt?[null]:e instanceof vi?[void 0,...ri(e.unwrap())]:e instanceof Oi?[null,...ri(e.unwrap())]:e instanceof Ni||e instanceof Ti?ri(e.unwrap()):e instanceof Ai?ri(e._def.innerType):[];class oi extends yt{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ye.object)return rt(t,{code:Qe.invalid_type,expected:Ye.object,received:t.parsedType}),at;const i=this.discriminator,n=this.optionsMap.get(t.data[i]);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(rt(t,{code:Qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),at)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const n=new Map;for(const i of t){const t=ri(i.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw Error(`Discriminator property ${e+""} has duplicate value ${s+""}`);n.set(s,i)}}return new oi({typeName:Di.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...gt(i)})}}function ai(e,t){const i=Je(e),n=Je(t);if(e===t)return{valid:!0,data:e};if(i===Ye.object&&n===Ye.object){const i=ze.objectKeys(t),n=ze.objectKeys(e).filter((e=>-1!==i.indexOf(e))),s={...e,...t};for(const i of n){const n=ai(e[i],t[i]);if(!n.valid)return{valid:!1};s[i]=n.data}return{valid:!0,data:s}}if(i===Ye.array&&n===Ye.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let n=0;n<e.length;n++){const s=ai(e[n],t[n]);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}return i===Ye.date&&n===Ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ci extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=(e,n)=>{if(dt(e)||dt(n))return at;const s=ai(e.value,n.value);return s.valid?((lt(e)||lt(n))&&t.dirty(),{status:t.value,value:s.data}):(rt(i,{code:Qe.invalid_intersection_types}),at)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}ci.create=(e,t,i)=>new ci({left:e,right:t,typeName:Di.ZodIntersection,...gt(i)});class ui extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.array)return rt(i,{code:Qe.invalid_type,expected:Ye.array,received:i.parsedType}),at;if(i.data.length<this._def.items.length)return rt(i,{code:Qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),at;!this._def.rest&&i.data.length>this._def.items.length&&(rt(i,{code:Qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...i.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new ft(i,e,i.path,t)):null})).filter((e=>!!e));return i.common.async?Promise.all(n).then((e=>ot.mergeArray(t,e))):ot.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ui({...this._def,rest:e})}}ui.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ui({items:e,typeName:Di.ZodTuple,rest:null,...gt(t)})};class di extends yt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.object)return rt(i,{code:Qe.invalid_type,expected:Ye.object,received:i.parsedType}),at;const n=[],s=this._def.keyType,r=this._def.valueType;for(const e in i.data)n.push({key:s._parse(new ft(i,e,i.path,e)),value:r._parse(new ft(i,i.data[e],i.path,e)),alwaysSet:e in i.data});return i.common.async?ot.mergeObjectAsync(t,n):ot.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,i){return new di(t instanceof yt?{keyType:e,valueType:t,typeName:Di.ZodRecord,...gt(i)}:{keyType:Ht.create(),valueType:e,typeName:Di.ZodRecord,...gt(t)})}}class li extends yt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.map)return rt(i,{code:Qe.invalid_type,expected:Ye.map,received:i.parsedType}),at;const n=this._def.keyType,s=this._def.valueType,r=[...i.data.entries()].map((([e,t],r)=>({key:n._parse(new ft(i,e,i.path,[r,"key"])),value:s._parse(new ft(i,t,i.path,[r,"value"]))})));if(i.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const i of r){const n=await i.key,s=await i.value;if("aborted"===n.status||"aborted"===s.status)return at;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const i of r){const n=i.key,s=i.value;if("aborted"===n.status||"aborted"===s.status)return at;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}li.create=(e,t,i)=>new li({valueType:t,keyType:e,typeName:Di.ZodMap,...gt(i)});class hi extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Ye.set)return rt(i,{code:Qe.invalid_type,expected:Ye.set,received:i.parsedType}),at;const n=this._def;null!==n.minSize&&i.data.size<n.minSize.value&&(rt(i,{code:Qe.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&i.data.size>n.maxSize.value&&(rt(i,{code:Qe.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function r(e){const i=new Set;for(const n of e){if("aborted"===n.status)return at;"dirty"===n.status&&t.dirty(),i.add(n.value)}return{status:t.value,value:i}}const o=[...i.data.values()].map(((e,t)=>s._parse(new ft(i,e,i.path,t))));return i.common.async?Promise.all(o).then((e=>r(e))):r(o)}min(e,t){return new hi({...this._def,minSize:{value:e,message:pt.toString(t)}})}max(e,t){return new hi({...this._def,maxSize:{value:e,message:pt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}hi.create=(e,t)=>new hi({valueType:e,minSize:null,maxSize:null,typeName:Di.ZodSet,...gt(t)});class _i extends yt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ye.function)return rt(t,{code:Qe.invalid_type,expected:Ye.function,received:t.parsedType}),at;function i(e,i){return st({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nt(),tt].filter((e=>!!e)),issueData:{code:Qe.invalid_arguments,argumentsError:i}})}function n(e,i){return st({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nt(),tt].filter((e=>!!e)),issueData:{code:Qe.invalid_return_type,returnTypeError:i}})}const s={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Ei){const e=this;return ut((async function(...t){const o=new et([]),a=await e._def.args.parseAsync(t,s).catch((e=>{throw o.addIssue(i(t,e)),o})),c=await Reflect.apply(r,this,a);return await e._def.returns._def.type.parseAsync(c,s).catch((e=>{throw o.addIssue(n(c,e)),o}))}))}{const e=this;return ut((function(...t){const o=e._def.args.safeParse(t,s);if(!o.success)throw new et([i(t,o.error)]);const a=Reflect.apply(r,this,o.data),c=e._def.returns.safeParse(a,s);if(!c.success)throw new et([n(a,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new _i({...this._def,args:ui.create(e).rest(Jt.create())})}returns(e){return new _i({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new _i({args:e||ui.create([]).rest(Jt.create()),returns:t||Jt.create(),typeName:Di.ZodFunction,...gt(i)})}}class pi extends yt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}pi.create=(e,t)=>new pi({getter:e,typeName:Di.ZodLazy,...gt(t)});class fi extends yt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return rt(t,{received:t.data,code:Qe.invalid_literal,expected:this._def.value}),at}return{status:"valid",value:e.data}}get value(){return this._def.value}}function mi(e,t){return new gi({values:e,typeName:Di.ZodEnum,...gt(t)})}fi.create=(e,t)=>new fi({value:e,typeName:Di.ZodLiteral,...gt(t)});class gi extends yt{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return rt(t,{expected:ze.joinValues(this._def.values),received:t.parsedType,code:Qe.invalid_type}),at}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e);return rt(t,{received:t.data,code:Qe.invalid_enum_value,options:this._def.values}),at}return ut(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return gi.create(e,{...this._def,...t})}exclude(e,t=this._def){return gi.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}gi.create=mi;class yi extends yt{_parse(e){const t=ze.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==Ye.string&&i.parsedType!==Ye.number){const e=ze.objectValues(t);return rt(i,{expected:ze.joinValues(e),received:i.parsedType,code:Qe.invalid_type}),at}if(this._cache||(this._cache=new Set(ze.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=ze.objectValues(t);return rt(i,{received:i.data,code:Qe.invalid_enum_value,options:e}),at}return ut(e.data)}get enum(){return this._def.values}}yi.create=(e,t)=>new yi({values:e,typeName:Di.ZodNativeEnum,...gt(t)});class Ei extends yt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ye.promise&&!1===t.common.async)return rt(t,{code:Qe.invalid_type,expected:Ye.promise,received:t.parsedType}),at;const i=t.parsedType===Ye.promise?t.data:Promise.resolve(t.data);return ut(i.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ei.create=(e,t)=>new Ei({type:e,typeName:Di.ZodPromise,...gt(t)});class bi extends yt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Di.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{rt(i,e),e.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(i.data,s);if(i.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return at;const n=await this._def.schema._parseAsync({data:e,path:i.path,parent:i});return"aborted"===n.status?at:"dirty"===n.status||"dirty"===t.value?ct(n.value):n}));{if("aborted"===t.value)return at;const n=this._def.schema._parseSync({data:e,path:i.path,parent:i});return"aborted"===n.status?at:"dirty"===n.status||"dirty"===t.value?ct(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===i.common.async){const n=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===n.status?at:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((i=>"aborted"===i.status?at:("dirty"===i.status&&t.dirty(),e(i.value).then((()=>({status:t.value,value:i.value}))))))}if("transform"===n.type){if(!1===i.common.async){const e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ht(e))return at;const r=n.transform(e.value,s);if(r instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((e=>ht(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):at))}ze.assertNever(n)}}bi.create=(e,t,i)=>new bi({schema:e,typeName:Di.ZodEffects,effect:t,...gt(i)}),bi.createWithPreprocess=(e,t,i)=>new bi({schema:t,effect:{type:"preprocess",transform:e},typeName:Di.ZodEffects,...gt(i)});class vi extends yt{_parse(e){return this._getType(e)===Ye.undefined?ut(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vi.create=(e,t)=>new vi({innerType:e,typeName:Di.ZodOptional,...gt(t)});class Oi extends yt{_parse(e){return this._getType(e)===Ye.null?ut(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oi.create=(e,t)=>new Oi({innerType:e,typeName:Di.ZodNullable,...gt(t)});class wi extends yt{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===Ye.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}wi.create=(e,t)=>new wi({innerType:e,typeName:Di.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...gt(t)});class Ai extends yt{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return _t(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new et(i.common.issues)},input:i.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new et(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Ai.create=(e,t)=>new Ai({innerType:e,typeName:Di.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...gt(t)});class Si extends yt{_parse(e){if(this._getType(e)!==Ye.nan){const t=this._getOrReturnCtx(e);return rt(t,{code:Qe.invalid_type,expected:Ye.nan,received:t.parsedType}),at}return{status:"valid",value:e.data}}}Si.create=e=>new Si({typeName:Di.ZodNaN,...gt(e)});const Ii=Symbol("zod_brand");class Ni extends yt{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ci extends yt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?at:"dirty"===e.status?(t.dirty(),ct(e.value)):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})();{const e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?at:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new Ci({in:e,out:t,typeName:Di.ZodPipeline})}}class Ti extends yt{_parse(e){const t=this._def.innerType._parse(e),i=e=>(ht(e)&&(e.value=Object.freeze(e.value)),e);return _t(t)?t.then((e=>i(e))):i(t)}unwrap(){return this._def.innerType}}function xi(e,t){const i="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof i?{message:i}:i}function Ri(e,t={},i){return e?Yt.create().superRefine(((n,s)=>{const r=e(n);if(r instanceof Promise)return r.then((e=>{if(!e){const e=xi(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}}));if(!r){const e=xi(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}})):Yt.create()}Ti.create=(e,t)=>new Ti({innerType:e,typeName:Di.ZodReadonly,...gt(t)});const ki={object:ni.lazycreate};var Di;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Di||(Di={}));const Li=Ht.create,ji=Gt.create,Fi=Si.create,Ui=Bt.create,Pi=qt.create,Mi=Kt.create,Zi=Wt.create,$i=Vt.create,Hi=Xt.create,zi=Yt.create,Gi=Jt.create,Bi=Qt.create,qi=ei.create,Ki=ti.create,Wi=ni.create,Vi=ni.strictCreate,Xi=si.create,Yi=oi.create,Ji=ci.create,Qi=ui.create,en=di.create,tn=li.create,nn=hi.create,sn=_i.create,rn=pi.create,on=fi.create,an=gi.create,cn=yi.create,un=Ei.create,dn=bi.create,ln=vi.create,hn=Oi.create,_n=bi.createWithPreprocess,pn=Ci.create,fn={string:e=>Ht.create({...e,coerce:!0}),number:e=>Gt.create({...e,coerce:!0}),boolean:e=>qt.create({...e,coerce:!0}),bigint:e=>Bt.create({...e,coerce:!0}),date:e=>Kt.create({...e,coerce:!0})};var mn=Object.freeze({__proto__:null,BRAND:Ii,DIRTY:ct,EMPTY_PATH:[],INVALID:at,NEVER:at,OK:ut,ParseStatus:ot,Schema:yt,ZodAny:Yt,ZodArray:ti,ZodBigInt:Bt,ZodBoolean:qt,ZodBranded:Ni,ZodCatch:Ai,ZodDate:Kt,ZodDefault:wi,ZodDiscriminatedUnion:oi,ZodEffects:bi,ZodEnum:gi,ZodError:et,get ZodFirstPartyTypeKind(){return Di},ZodFunction:_i,ZodIntersection:ci,ZodIssueCode:Qe,ZodLazy:pi,ZodLiteral:fi,ZodMap:li,ZodNaN:Si,ZodNativeEnum:yi,ZodNever:Qt,ZodNull:Xt,ZodNullable:Oi,ZodNumber:Gt,ZodObject:ni,ZodOptional:vi,ZodParsedType:Ye,ZodPipeline:Ci,ZodPromise:Ei,ZodReadonly:Ti,ZodRecord:di,ZodSchema:yt,ZodSet:hi,ZodString:Ht,ZodSymbol:Wt,ZodTransformer:bi,ZodTuple:ui,ZodType:yt,ZodUndefined:Vt,ZodUnion:si,ZodUnknown:Jt,ZodVoid:ei,addIssueToContext:rt,any:zi,array:Ki,bigint:Ui,boolean:Pi,coerce:fn,custom:Ri,date:Mi,datetimeRegex:Pt,defaultErrorMap:tt,discriminatedUnion:Yi,effect:dn,enum:an,function:sn,getErrorMap:nt,getParsedType:Je,instanceof:(e,t={message:"Input not instance of "+e.name})=>Ri((t=>t instanceof e),t),intersection:Ji,isAborted:dt,isAsync:_t,isDirty:lt,isValid:ht,late:ki,lazy:rn,literal:on,makeIssue:st,map:tn,nan:Fi,nativeEnum:cn,never:Bi,null:Hi,nullable:hn,number:ji,object:Wi,get objectUtil(){return Ge},oboolean:()=>Pi().optional(),onumber:()=>ji().optional(),optional:ln,ostring:()=>Li().optional(),pipeline:pn,preprocess:_n,promise:un,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:en,set:nn,setErrorMap:function(e){it=e},strictObject:Vi,string:Li,symbol:Zi,transformer:dn,tuple:Qi,undefined:$i,union:Xi,unknown:Gi,get util(){return ze},void:qi});function gn(e,t){const i={};return Object.keys(e.paths).forEach((n=>{i[Q(t.replaceAll(/:([^\/]+)/g,"{$1}"),n)]=e.paths[n]})),{...e,paths:i}}function yn(e){return/^application\/([a-z-\.]+\+)?json/.test(e)}function En(e){return e.startsWith("multipart/form-data")||e.startsWith("application/x-www-form-urlencoded")}c(mn);var bn,vn=Object.freeze({__proto__:null,OpenAPIHono:class e extends Xe{openAPIRegistry;defaultHook;constructor(e){super(e),this.openAPIRegistry=new y,this.defaultHook=e?.defaultHook}openapi=({middleware:e,hide:t,...i},n,s=this.defaultHook)=>{t||this.openAPIRegistry.registerPath(i);const r=[];if(i.request?.query){const e=he("query",i.request.query,s);r.push(e)}if(i.request?.params){const e=he("param",i.request.params,s);r.push(e)}if(i.request?.headers){const e=he("header",i.request.headers,s);r.push(e)}if(i.request?.cookies){const e=he("cookie",i.request.cookies,s);r.push(e)}const o=i.request?.body?.content;if(o)for(const e of Object.keys(o)){if(!o[e])continue;const t=o[e].schema;if(t instanceof yt){if(yn(e)){const e=he("json",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&yn(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("json",{}),await i()})}if(En(e)){const e=he("form",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&En(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("form",{}),await i()})}}}const a=e?Array.isArray(e)?e:[e]:[];return this.on([i.method],i.path.replaceAll(/\/{(.+?)}/g,"/:$1"),...a,...r,n),this};getOpenAPIDocument=e=>{const t=new H(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?gn(t,this._basePath):t};getOpenAPI31Document=e=>{const t=new B(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?gn(t,this._basePath):t};doc=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPIDocument(i);return e.json(t)}catch(t){return e.json(t,500)}}));doc31=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPI31Document(i);return e.json(t)}catch(t){return e.json(t,500)}}));route(t,i){const n=t.replaceAll(/:([^\/]+)/g,"{$1}");return super.route(t,i),i instanceof e?(i.openAPIRegistry.definitions.forEach((e=>{switch(e.type){case"component":return this.openAPIRegistry.registerComponent(e.componentType,e.name,e.component);case"route":return void this.openAPIRegistry.registerPath({...e.route,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.route.path)});case"webhook":return void this.openAPIRegistry.registerWebhook({...e.webhook,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.webhook.path)});case"schema":return this.openAPIRegistry.register(e.schema._def.openapi._internal.refId,e.schema);case"parameter":return this.openAPIRegistry.registerParameter(e.schema._def.openapi._internal.refId,e.schema);default:throw Error("Unknown registry type: "+e)}})),this):this}basePath(t){return new e({...super.basePath(t),defaultHook:this.defaultHook})}},createRoute:e=>{const t={...e,getRoutingPath:()=>e.path.replaceAll(/\/{(.+?)}/g,"/:$1")};return Object.defineProperty(t,"getRoutingPath",{enumerable:!1})},extendZodWithOpenApi:c,z:mn}),On=e(vn),wn=(bn||(bn=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=On,i=t.z.object({created_at:t.z.string(),updated_at:t.z.string()}),n=t.z.enum(["AUTH0","EMAIL","REDIRECT"]),s=t.z.enum(["CREATE_USER","GET_USER","UPDATE_USER","SEND_REQUEST","SEND_EMAIL"]),r=t.z.enum(["VERIFY_EMAIL"]),o=t.z.object({require_mx_record:t.z.boolean().optional(),block_aliases:t.z.boolean().optional(),block_free_emails:t.z.boolean().optional(),block_disposable_emails:t.z.boolean().optional(),blocklist:t.z.array(t.z.string()).optional(),allowlist:t.z.array(t.z.string()).optional()}),a=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("AUTH0"),action:t.z.literal("UPDATE_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({connection_id:t.z.string().optional(),user_id:t.z.string(),changes:t.z.record(t.z.string(),t.z.any())})}),c=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("EMAIL"),action:t.z.literal("VERIFY_EMAIL"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({email:t.z.string(),rules:o.optional()})}),u=t.z.enum(["change-email","account","custom"]),d=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("REDIRECT"),action:t.z.literal("REDIRECT_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({target:u.openapi({description:"The predefined target to redirect to, or 'custom' for a custom URL"}),custom_url:t.z.string().optional().openapi({description:"Custom URL to redirect to when target is 'custom'"})})}),l=t.z.union([a,c,d]),h=t.z.object({name:t.z.string().min(1).max(150).openapi({description:"The name of the flow"}),actions:t.z.array(l).optional().default([]).openapi({description:"The list of actions to execute in sequence"})}),_=h.extend({...i.shape,id:t.z.string().openapi({description:"Unique identifier for the flow",example:"af_12tMpdJ3iek7svMyZkSh5M"})}),p=t.z.object({page:t.z.string().min(0).optional().default("0").transform((e=>parseInt(e,10))).openapi({description:"The page number where 0 is the first page"}),per_page:t.z.string().min(1).optional().default("10").transform((e=>parseInt(e,10))).openapi({description:"The number of items per page"}),include_totals:t.z.string().optional().default("false").transform((e=>"true"===e)).openapi({description:"If the total number of items should be included in the response"}),sort:t.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:"A property that should have the format 'string:-1' or 'string:1'"}),q:t.z.string().optional().openapi({description:"A lucene query string used to filter the results"})}),f=t.z.object({start:t.z.number(),limit:t.z.number(),length:t.z.number(),total:t.z.number().optional()}),m=t.z.object({email:t.z.string().optional(),email_verified:t.z.boolean().optional(),name:t.z.string().optional(),username:t.z.string().optional(),given_name:t.z.string().optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),family_name:t.z.string().optional()}).catchall(t.z.any()),g=t.z.object({connection:t.z.string(),user_id:t.z.string(),provider:t.z.string(),isSocial:t.z.boolean(),access_token:t.z.string().optional(),access_token_secret:t.z.string().optional(),refresh_token:t.z.string().optional(),profileData:m.optional()}),y=t.z.object({email:t.z.string().optional().transform((e=>e&&e.toLowerCase())),username:t.z.string().optional(),phone_number:t.z.string().optional(),given_name:t.z.string().optional(),family_name:t.z.string().optional(),nickname:t.z.string().optional(),name:t.z.string().optional(),picture:t.z.string().optional(),locale:t.z.string().optional(),linked_to:t.z.string().optional(),profileData:t.z.string().optional(),user_id:t.z.string().optional(),app_metadata:t.z.any().default({}).optional(),user_metadata:t.z.any().default({}).optional()}),E=y.extend({email_verified:t.z.boolean().default(!1),verify_email:t.z.boolean().optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string().optional(),provider:t.z.string().optional(),connection:t.z.string(),is_social:t.z.boolean().optional()}),b=t.z.object({...E.shape,...i.shape,user_id:t.z.string(),provider:t.z.string(),is_social:t.z.boolean(),email:t.z.string().optional(),login_count:t.z.number().default(0),identities:t.z.array(g).optional()}),v=b,O=y.extend({login_count:t.z.number(),multifactor:t.z.array(t.z.string()).optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string()}).catchall(t.z.any()),w=t.z.object({client_id:t.z.string().openapi({description:"ID of this client."}),name:t.z.string().min(1).openapi({description:"Name of this client (min length: 1 character, does not allow < or >)."}),description:t.z.string().max(140).optional().openapi({description:"Free text description of this client (max length: 140 characters)."}),global:t.z.boolean().default(!1).openapi({description:"Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false)."}),client_secret:t.z.string().default((()=>((e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[e]];return t})())).optional().openapi({description:"Client secret (which you must not make public)."}),app_type:t.z.enum(["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:t.z.string().url().optional().openapi({description:"URL of the logo to display for this client. Recommended size is 150x150 pixels."}),is_first_party:t.z.boolean().default(!1).openapi({description:"Whether this client a first party client (true) or not (false)."}),oidc_conformant:t.z.boolean().default(!0).openapi({description:"Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false)."}),callbacks:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication."}),allowed_origins:t.z.array(t.z.string()).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:t.z.array(t.z.string()).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:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of audiences/realms for SAML protocol. Used by the wsfed addon."}),allowed_clients:t.z.array(t.z.string()).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:t.z.array(t.z.string()).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:t.z.array(t.z.string()).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:t.z.record(t.z.any()).default({}).optional().openapi({description:"Native to Web SSO Configuration"}),oidc_logout:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration for OIDC backchannel logout"}),grant_types:t.z.array(t.z.string()).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:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration related to JWTs for the client."}),signing_keys:t.z.array(t.z.record(t.z.any())).default([]).optional().openapi({description:"Signing certificates associated with this client."}),encryption_key:t.z.record(t.z.any()).default({}).optional().openapi({description:"Encryption used for WsFed responses with this client."}),sso:t.z.boolean().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:t.z.boolean().default(!0).openapi({description:"Whether Single Sign On is disabled (true) or enabled (true). Defaults to true."}),cross_origin_authentication:t.z.boolean().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:t.z.string().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:t.z.boolean().default(!1).openapi({description:"Whether a custom login page is to be used (true) or the default provided login page (false)."}),custom_login_page:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page."}),custom_login_page_preview:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page. (Used on Previews)"}),form_template:t.z.string().optional().openapi({description:"HTML form template to be used for WS-Federation."}),addons:t.z.record(t.z.any()).default({}).optional().openapi({description:"Addons enabled for this client and their associated configurations."}),token_endpoint_auth_method:t.z.enum(["none","client_secret_post","client_secret_basic"]).default("client_secret_basic").optional().openapi({description:"Defines the requested authentication method for the token endpoint. Can be none (public client without a client secret), client_secret_post (client uses HTTP POST parameters), or client_secret_basic (client uses HTTP Basic)."}),client_metadata:t.z.record(t.z.string().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]'}),mobile:t.z.record(t.z.any()).default({}).optional().openapi({description:"Additional configuration for native mobile apps."}),initiate_login_uri:t.z.string().url().optional().openapi({description:"Initiate login uri, must be https"}),native_social_login:t.z.record(t.z.any()).default({}).optional(),refresh_token:t.z.record(t.z.any()).default({}).optional().openapi({description:"Refresh token configuration"}),default_organization:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines the default Organization ID and flows"}),organization_usage:t.z.enum(["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:t.z.enum(["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:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines client authentication methods."}),require_pushed_authorization_requests:t.z.boolean().default(!1).openapi({description:"Makes the use of Pushed Authorization Requests mandatory for this client"}),require_proof_of_possession:t.z.boolean().default(!1).openapi({description:"Makes the use of Proof-of-Possession mandatory for this client"}),signed_request_object:t.z.record(t.z.any()).default({}).optional().openapi({description:"JWT-secured Authorization Requests (JAR) settings."}),compliance_level:t.z.enum(["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:t.z.number().optional().openapi({description:"Specifies how long, in seconds, a Pushed Authorization Request URI remains valid"}),token_quota:t.z.record(t.z.any()).default({}).optional()}),A=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),...w.shape}),S=t.z.object({client_id:t.z.string().min(1).openapi({description:"ID of the client."}),audience:t.z.string().min(1).openapi({description:"The audience (API identifier) of this client grant."}),scope:t.z.array(t.z.string()).optional().openapi({description:"Scopes allowed for this client grant."}),organization_usage:t.z.enum(["deny","allow","require"]).optional().openapi({description:"Defines whether organizations can be used with client credentials exchanges for this grant."}),allow_any_organization:t.z.boolean().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:t.z.boolean().optional().openapi({description:"If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly."}),subject_type:t.z.enum(["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:t.z.array(t.z.string()).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."})}),I=t.z.object({id:t.z.string().openapi({description:"ID of the client grant."}),...S.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),N=t.z.array(I),C=t.z.object({x:t.z.number(),y:t.z.number()});var T=(e=>(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))(T||{}),x=(e=>(e.BLOCK="BLOCK",e.FIELD="FIELD",e))(x||{});const R=t.z.object({id:t.z.string(),category:t.z.nativeEnum(x),type:t.z.nativeEnum(T)}),k=R.extend({category:t.z.literal("BLOCK"),type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string()}).passthrough()}),D=R.extend({category:t.z.literal("BLOCK"),type:t.z.union([t.z.literal("NEXT_BUTTON"),t.z.literal("BACK_BUTTON"),t.z.literal("SUBMIT_BUTTON")]),config:t.z.object({text:t.z.string()}).passthrough()}),L=R.extend({category:t.z.literal("FIELD"),type:t.z.literal("LEGAL"),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({text:t.z.string()}).passthrough()}),j=R.extend({category:t.z.literal("FIELD"),type:t.z.union([t.z.literal("TEXT"),t.z.literal("EMAIL"),t.z.literal("PASSWORD"),t.z.literal("NUMBER"),t.z.literal("PHONE"),t.z.literal("DATE"),t.z.literal("CHECKBOX"),t.z.literal("RADIO"),t.z.literal("SELECT"),t.z.literal("HIDDEN")]),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({label:t.z.string().optional(),placeholder:t.z.string().optional()}).passthrough()}),F=t.z.object({id:t.z.string(),category:t.z.string(),type:t.z.string()}).passthrough(),U=t.z.union([k,D,L,j,F]);var P=(e=>(e.STEP="STEP",e.FLOW="FLOW",e.CONDITION="CONDITION",e.ACTION="ACTION",e))(P||{});const M=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:C,alias:t.z.string().optional(),config:t.z.object({components:t.z.array(U),next_node:t.z.string()}).passthrough()}),Z=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:C,alias:t.z.string().optional(),config:t.z.object({flow_id:t.z.string(),next_node:t.z.string()})}),$=t.z.object({id:t.z.string(),type:t.z.literal("ACTION"),coordinates:C,alias:t.z.string().optional(),config:t.z.object({action_type:t.z.enum(["REDIRECT"]).openapi({description:"The type of action to perform"}),target:t.z.enum(["change-email","account","custom"]).openapi({description:"The predefined target to redirect to"}),custom_url:t.z.string().optional().openapi({description:"Custom URL when target is 'custom'"}),next_node:t.z.string().openapi({description:"The next node to navigate to after action (for non-redirect actions)"})}).passthrough()}),H=t.z.object({id:t.z.string(),type:t.z.string(),coordinates:C}).passthrough(),z=t.z.union([M,Z,$,H]),G=t.z.object({next_node:t.z.string(),coordinates:C}).passthrough(),B=t.z.object({resume_flow:t.z.boolean().optional(),coordinates:C}).passthrough(),q=t.z.object({id:t.z.string(),name:t.z.string(),languages:t.z.object({primary:t.z.string()}).passthrough(),nodes:t.z.array(z),start:G,ending:B,created_at:t.z.string(),updated_at:t.z.string(),links:t.z.object({sdkSrc:t.z.string().optional(),sdk_src:t.z.string().optional()}).passthrough()}).passthrough(),K=q.omit({id:!0,created_at:!0,updated_at:!0});var W=(e=>(e.TOKEN="token",e.TOKEN_ID_TOKEN="token id_token",e.CODE="code",e))(W||{}),V=(e=>(e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post",e.WEB_MESSAGE="web_message",e.SAML_POST="saml_post",e))(V||{}),X=(e=>(e.S256="S256",e.Plain="plain",e))(X||{});const Y=t.z.object({client_id:t.z.string(),act_as:t.z.string().optional(),response_type:t.z.nativeEnum(W).optional(),response_mode:t.z.nativeEnum(V).optional(),redirect_uri:t.z.string().optional(),audience:t.z.string().optional(),organization:t.z.string().optional(),state:t.z.string().optional(),nonce:t.z.string().optional(),scope:t.z.string().optional(),prompt:t.z.string().optional(),code_challenge_method:t.z.nativeEnum(X).optional(),code_challenge:t.z.string().optional(),username:t.z.string().optional(),ui_locales:t.z.string().optional(),vendor_id:t.z.string().optional()}),J=t.z.object({colors:t.z.object({primary:t.z.string(),page_background:t.z.object({type:t.z.string().optional(),start:t.z.string().optional(),end:t.z.string().optional(),angle_deg:t.z.number().optional()}).optional()}).optional(),logo_url:t.z.string().optional(),favicon_url:t.z.string().optional(),powered_by_logo_url:t.z.string().optional(),font:t.z.object({url:t.z.string()}).optional()}),Q=t.z.object({kid:t.z.string().optional(),team_id:t.z.string().optional(),realms:t.z.string().optional(),authentication_method:t.z.string().optional(),client_id:t.z.string().optional(),client_secret:t.z.string().optional(),app_secret:t.z.string().optional(),scope:t.z.string().optional(),authorization_endpoint:t.z.string().optional(),token_endpoint:t.z.string().optional(),userinfo_endpoint:t.z.string().optional(),jwks_uri:t.z.string().optional(),discovery_url:t.z.string().optional(),issuer:t.z.string().optional(),provider:t.z.string().optional(),from:t.z.string().optional(),twilio_sid:t.z.string().optional(),twilio_token:t.z.string().optional(),icon_url:t.z.string().optional()}),ee=t.z.object({id:t.z.string().optional(),name:t.z.string(),display_name:t.z.string().optional(),strategy:t.z.string(),options:Q.default({}),enabled_clients:t.z.array(t.z.string()).default([]).optional(),response_type:t.z.custom().optional(),response_mode:t.z.custom().optional(),is_domain_connection:t.z.boolean().optional(),show_as_button:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional(),is_system:t.z.boolean().optional()}),te=t.z.object({id:t.z.string(),created_at:t.z.string().transform((e=>null===e?"":e)),updated_at:t.z.string().transform((e=>null===e?"":e))}).extend(ee.shape),ie=t.z.object({id:t.z.string().optional(),audience:t.z.string(),friendly_name:t.z.string(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sender_email:t.z.string().email(),sender_name:t.z.string(),session_lifetime:t.z.number().optional(),idle_session_lifetime:t.z.number().optional(),ephemeral_session_lifetime:t.z.number().optional(),idle_ephemeral_session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),allowed_logout_urls:t.z.array(t.z.string()).optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_changing_enable_sso:t.z.boolean().optional(),allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),change_pwd_flow_v1:t.z.boolean().optional(),custom_domains_provisioning:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),disable_impersonation:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),enable_sso:t.z.boolean().optional(),enforce_client_authentication_on_passwordless_start:t.z.boolean().optional(),genai_trial:t.z.boolean().optional(),improved_signup_bot_detection_in_classic:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional(),no_disclose_enterprise_connections:t.z.boolean().optional(),remove_alg_from_jwks:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),trust_azure_adfs_email_verified_connection_property:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),inherit_global_permissions_in_organizations:t.z.boolean().optional()}).optional(),sandbox_version:t.z.string().optional(),legacy_sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),device_flow:t.z.object({charset:t.z.enum(["base20","digits"]).optional(),mask:t.z.string().max(20).optional()}).optional(),default_token_quota:t.z.object({clients:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional(),organizations:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional(),oidc_logout:t.z.object({rp_logout_end_session_endpoint_discovery:t.z.boolean().optional()}).optional(),allow_organization_name_in_authentication_api:t.z.boolean().optional(),customize_mfa_in_postlogin_action:t.z.boolean().optional(),acr_values_supported:t.z.array(t.z.string()).optional(),mtls:t.z.object({enable_endpoint_aliases:t.z.boolean().optional()}).optional(),pushed_authorization_requests_supported:t.z.boolean().optional(),authorization_response_iss_parameter_supported:t.z.boolean().optional()}),ne=t.z.object({created_at:t.z.string().nullable().transform((e=>e??"")),updated_at:t.z.string().nullable().transform((e=>e??"")),...ie.shape,id:t.z.string()}),se=t.z.object({...A.shape,tenant:ne,connections:t.z.array(te)}),re=t.z.enum(["password_reset","email_verification","otp","authorization_code","oauth2_state","ticket"]),oe=t.z.object({code_id:t.z.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:t.z.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:t.z.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:re,code_verifier:t.z.string().optional().openapi({description:"The code verifier used in PKCE in outbound flows"}),code_challenge:t.z.string().optional().openapi({description:"The code challenge used in PKCE in outbound flows"}),code_challenge_method:t.z.enum(["plain","S256"]).optional().openapi({description:"The code challenge method used in PKCE in outbound flows"}),redirect_uri:t.z.string().optional().openapi({description:"The redirect URI associated with the code"}),nonce:t.z.string().optional().openapi({description:"The nonce value used for security in OIDC flows"}),state:t.z.string().optional().openapi({description:"The state parameter used for CSRF protection in OAuth flows"}),expires_at:t.z.string(),used_at:t.z.string().optional(),user_id:t.z.string().optional()}),ae=t.z.object({...oe.shape,created_at:t.z.string()}),ce=t.z.object({domain:t.z.string(),custom_domain_id:t.z.string().optional(),type:t.z.enum(["auth0_managed_certs","self_managed_certs"]),verification_method:t.z.enum(["txt"]).optional(),tls_policy:t.z.enum(["recommended"]).optional(),custom_client_ip_header:t.z.enum(["true-client-ip","cf-connecting-ip","x-forwarded-for","x-azure-clientip","null"]).optional(),domain_metadata:t.z.record(t.z.string().max(255)).optional()}),ue=t.z.object({name:t.z.literal("txt"),record:t.z.string(),domain:t.z.string()}),de=t.z.object({...ce.shape,custom_domain_id:t.z.string(),primary:t.z.boolean(),status:t.z.enum(["disabled","pending","pending_verification","ready"]),origin_domain_name:t.z.string().optional(),verification:t.z.object({methods:t.z.array(ue)}).optional(),tls_policy:t.z.string().optional()}),le=de.extend({tenant_id:t.z.string()}),he=t.z.object({id:t.z.string(),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0)}),_e=he.extend({category:t.z.literal("BLOCK").optional()}),pe=_e.extend({type:t.z.literal("DIVIDER"),config:t.z.object({}).optional()}),fe=_e.extend({type:t.z.literal("HTML"),config:t.z.object({content:t.z.string().optional()}).optional()}),me=_e.extend({type:t.z.literal("IMAGE"),config:t.z.object({src:t.z.string().optional(),alt:t.z.string().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional()}),ge=_e.extend({type:t.z.literal("JUMP_BUTTON"),config:t.z.object({text:t.z.string().optional(),target_step:t.z.string().optional()})}),ye=_e.extend({type:t.z.literal("RESEND_BUTTON"),config:t.z.object({text:t.z.string().optional(),resend_action:t.z.string().optional()})}),Ee=_e.extend({type:t.z.literal("NEXT_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),be=_e.extend({type:t.z.literal("PREVIOUS_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),ve=_e.extend({type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string().optional()}).optional()}),Oe=he.extend({category:t.z.literal("WIDGET").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),we=Oe.extend({type:t.z.literal("AUTH0_VERIFIABLE_CREDENTIALS"),config:t.z.object({credential_type:t.z.string().optional()})}),Ae=Oe.extend({type:t.z.literal("GMAPS_ADDRESS"),config:t.z.object({api_key:t.z.string().optional()})}),Se=Oe.extend({type:t.z.literal("RECAPTCHA"),config:t.z.object({site_key:t.z.string().optional()})}),Ie=he.extend({category:t.z.literal("FIELD").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),Ne=Ie.extend({type:t.z.literal("BOOLEAN"),config:t.z.object({default_value:t.z.boolean().optional()}).optional()}),Ce=Ie.extend({type:t.z.literal("CARDS"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string(),description:t.z.string().optional(),image:t.z.string().optional()})).optional(),multi_select:t.z.boolean().optional()}).optional()}),Te=Ie.extend({type:t.z.literal("CHOICE"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),display:t.z.enum(["radio","checkbox"]).optional()}).optional()}),xe=Ie.extend({type:t.z.literal("CUSTOM"),config:t.z.object({component:t.z.string().optional(),props:t.z.record(t.z.any()).optional()})}),Re=Ie.extend({type:t.z.literal("DATE"),config:t.z.object({format:t.z.string().optional(),min:t.z.string().optional(),max:t.z.string().optional()}).optional()}),ke=Ie.extend({type:t.z.literal("DROPDOWN"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),placeholder:t.z.string().optional(),searchable:t.z.boolean().optional()}).optional()}),De=Ie.extend({type:t.z.literal("EMAIL"),config:t.z.object({placeholder:t.z.string().optional()}).optional()}),Le=Ie.extend({type:t.z.literal("FILE"),config:t.z.object({accept:t.z.string().optional(),max_size:t.z.number().optional(),multiple:t.z.boolean().optional()}).optional()}),je=Ie.extend({type:t.z.literal("LEGAL"),config:t.z.object({text:t.z.string(),html:t.z.boolean().optional()}).optional()}),Fe=Ie.extend({type:t.z.literal("NUMBER"),config:t.z.object({placeholder:t.z.string().optional(),min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional()}).optional()}),Ue=Ie.extend({type:t.z.literal("PASSWORD"),config:t.z.object({placeholder:t.z.string().optional(),min_length:t.z.number().optional(),show_toggle:t.z.boolean().optional(),forgot_password_link:t.z.string().optional()}).optional()}),Pe=Ie.extend({type:t.z.literal("PAYMENT"),config:t.z.object({provider:t.z.string().optional(),currency:t.z.string().optional()}).optional()}),Me=Ie.extend({type:t.z.literal("SOCIAL"),config:t.z.object({providers:t.z.array(t.z.string()).optional()}).optional()}),Ze=Ie.extend({type:t.z.literal("TEL"),config:t.z.object({placeholder:t.z.string().optional(),default_country:t.z.string().optional()}).optional()}),$e=Ie.extend({type:t.z.literal("TEXT"),config:t.z.object({placeholder:t.z.string().optional(),multiline:t.z.boolean().optional(),max_length:t.z.number().optional()}).optional()}),He=Ie.extend({type:t.z.literal("URL"),config:t.z.object({placeholder:t.z.string().optional()}).optional()}),ze=t.z.discriminatedUnion("type",[pe,fe,me,ge,ye,Ee,be,ve]),Ge=t.z.discriminatedUnion("type",[we,Ae,Se]),Be=t.z.discriminatedUnion("type",[Ne,Ce,Te,xe,Re,ke,De,Le,je,Fe,Ue,Pe,Me,Ze,$e,He]),qe=t.z.union([ze,Ge,Be]),Ke=t.z.object({id:t.z.string(),type:t.z.literal("submit"),label:t.z.string(),className:t.z.string().optional(),disabled:t.z.boolean().optional().default(!1),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0),customizations:t.z.record(t.z.string(),t.z.any()).optional()}),We=t.z.object({x:t.z.number(),y:t.z.number()}),Ve=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:We,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({flow_id:t.z.string().max(30),next_node:t.z.string().optional()})}),Xe=t.z.object({id:t.z.string(),type:t.z.literal("ROUTER"),coordinates:We,alias:t.z.string().min(1).max(150),config:t.z.object({rules:t.z.array(t.z.object({id:t.z.string(),alias:t.z.string().min(1).max(150).optional(),condition:t.z.any(),next_node:t.z.string()})),fallback:t.z.string()})}),Ye=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:We,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({components:t.z.array(qe),next_node:t.z.string().optional()})}),Je=t.z.discriminatedUnion("type",[Ve,Xe,Ye]),Qe=t.z.object({name:t.z.string().openapi({description:"The name of the form"}),messages:t.z.object({errors:t.z.record(t.z.string(),t.z.any()).optional(),custom:t.z.record(t.z.string(),t.z.any()).optional()}).optional(),languages:t.z.object({primary:t.z.string().optional(),default:t.z.string().optional()}).optional(),translations:t.z.record(t.z.string(),t.z.any()).optional(),nodes:t.z.array(Je).optional(),start:t.z.object({hidden_fields:t.z.array(t.z.object({key:t.z.string(),value:t.z.string()})).optional(),next_node:t.z.string().optional(),coordinates:We.optional()}).optional(),ending:t.z.object({redirection:t.z.object({delay:t.z.number().optional(),target:t.z.string().optional()}).optional(),after_submit:t.z.object({flow_id:t.z.string().optional()}).optional(),coordinates:We.optional(),resume_flow:t.z.boolean().optional()}).optional(),style:t.z.object({css:t.z.string().optional()}).optional()}).openapi({description:"Schema for flow-based forms (matches Auth0 Forms structure)"}),et=t.z.object({...i.shape,...Qe.shape,id:t.z.string()}),tt=t.z.object({id:t.z.number().optional(),text:t.z.string(),type:t.z.enum(["info","error","success","warning"])}),it=t.z.object({id:t.z.string().optional(),text:t.z.string(),href:t.z.string(),linkText:t.z.string().optional()}),nt=t.z.object({action:t.z.string(),method:t.z.enum(["POST","GET"]),title:t.z.string().optional(),description:t.z.string().optional(),components:t.z.array(qe),messages:t.z.array(tt).optional(),links:t.z.array(it).optional()}),st=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),rt=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),ot={enabled:t.z.boolean().default(!1),synchronous:t.z.boolean().default(!1),priority:t.z.number().optional(),hook_id:t.z.string().optional()},at=t.z.object({...ot,trigger_id:st,url:t.z.string()}),ct=t.z.object({...ot,trigger_id:rt,form_id:t.z.string()}),ut=t.z.union([at,ct]),dt=t.z.object({...ot,trigger_id:st,...i.shape,hook_id:t.z.string(),url:t.z.string()}),lt=t.z.object({...ot,trigger_id:rt,...i.shape,hook_id:t.z.string(),form_id:t.z.string()}),ht=t.z.union([dt,lt]),_t=t.z.object({name:t.z.string().optional()}),pt=t.z.object({email:t.z.string().optional()}),ft=t.z.object({organization_id:t.z.string().max(50),inviter:_t,invitee:pt,invitation_url:t.z.string().url(),client_id:t.z.string(),connection_id:t.z.string().optional(),app_metadata:t.z.record(t.z.any()).default({}).optional(),user_metadata:t.z.record(t.z.any()).default({}).optional(),ttl_sec:t.z.number().int().max(2592e3).default(604800).optional(),roles:t.z.array(t.z.string()).default([]).optional(),send_invitation_email:t.z.boolean().default(!0).optional()}),mt=t.z.object({id:t.z.string(),organization_id:t.z.string().max(50),created_at:t.z.string().datetime(),expires_at:t.z.string().datetime(),ticket_id:t.z.string().optional()}).extend(ft.shape),gt=t.z.object({alg:t.z.enum(["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512"]),e:t.z.string(),kid:t.z.string(),kty:t.z.enum(["RSA","EC","oct"]),n:t.z.string(),x5t:t.z.string().optional(),x5c:t.z.array(t.z.string()).optional(),use:t.z.enum(["sig","enc"]).optional()}),yt=t.z.object({keys:t.z.array(gt)}),Et=t.z.object({issuer:t.z.string(),authorization_endpoint:t.z.string(),token_endpoint:t.z.string(),device_authorization_endpoint:t.z.string(),userinfo_endpoint:t.z.string(),mfa_challenge_endpoint:t.z.string(),jwks_uri:t.z.string(),registration_endpoint:t.z.string(),revocation_endpoint:t.z.string(),scopes_supported:t.z.array(t.z.string()),response_types_supported:t.z.array(t.z.string()),code_challenge_methods_supported:t.z.array(t.z.string()),response_modes_supported:t.z.array(t.z.string()),subject_types_supported:t.z.array(t.z.string()),id_token_signing_alg_values_supported:t.z.array(t.z.string()),token_endpoint_auth_methods_supported:t.z.array(t.z.string()),claims_supported:t.z.array(t.z.string()),request_uri_parameter_supported:t.z.boolean(),request_parameter_supported:t.z.boolean(),token_endpoint_auth_signing_alg_values_supported:t.z.array(t.z.string())});var bt=(e=>(e.PENDING="pending",e.AUTHENTICATED="authenticated",e.AWAITING_EMAIL_VERIFICATION="awaiting_email_verification",e.AWAITING_HOOK="awaiting_hook",e.AWAITING_CONTINUATION="awaiting_continuation",e.COMPLETED="completed",e.FAILED="failed",e.EXPIRED="expired",e))(bt||{});const vt=t.z.nativeEnum(bt),Ot=t.z.object({csrf_token:t.z.string(),auth0Client:t.z.string().optional(),authParams:Y,expires_at:t.z.string(),deleted_at:t.z.string().optional(),ip:t.z.string().optional(),useragent:t.z.string().optional(),session_id:t.z.string().optional(),authorization_url:t.z.string().optional(),state:vt.optional().default("pending"),state_data:t.z.string().optional(),failure_reason:t.z.string().optional(),user_id:t.z.string().optional()}).openapi({description:"This represents a login sesion"}),wt=t.z.object({...Ot.shape,id:t.z.string().openapi({description:"This is is used as the state in the universal login"}),created_at:t.z.string(),updated_at:t.z.string()}),At={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",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",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_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_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"},St=t.z.string().refine((e=>Object.values(At).includes(e)),{message:"Invalid log type"}),It=t.z.object({name:t.z.string(),version:t.z.string(),env:t.z.object({node:t.z.string().optional()}).optional()}),Nt=t.z.object({country_code:t.z.string().length(2),city_name:t.z.string(),latitude:t.z.string(),longitude:t.z.string(),time_zone:t.z.string(),continent_code:t.z.string()}),Ct=t.z.object({type:St,date:t.z.string(),description:t.z.string().optional(),ip:t.z.string().optional(),user_agent:t.z.string().optional(),details:t.z.any().optional(),isMobile:t.z.boolean(),user_id:t.z.string().optional(),user_name:t.z.string().optional(),connection:t.z.string().optional(),connection_id:t.z.string().optional(),client_id:t.z.string().optional(),client_name:t.z.string().optional(),audience:t.z.string().optional(),scope:t.z.string().optional(),strategy:t.z.string().optional(),strategy_type:t.z.string().optional(),hostname:t.z.string().optional(),auth0_client:It.optional(),log_id:t.z.string().optional(),location_info:Nt.optional()}),Tt=t.z.object({...Ct.shape,log_id:t.z.string()}),xt=t.z.object({id:t.z.string().optional(),user_id:t.z.string(),password:t.z.string(),algorithm:t.z.enum(["bcrypt","argon2id"]).default("argon2id"),is_current:t.z.boolean().default(!0)}),Rt=xt.extend({id:t.z.string(),created_at:t.z.string(),updated_at:t.z.string()}),kt=t.z.object({initial_user_agent:t.z.string().describe("First user agent of the device from which this user logged in"),initial_ip:t.z.string().describe("First IP address associated with this session"),initial_asn:t.z.string().describe("First autonomous system number associated with this session"),last_user_agent:t.z.string().describe("Last user agent of the device from which this user logged in"),last_ip:t.z.string().describe("Last IP address from which this user logged in"),last_asn:t.z.string().describe("Last autonomous system number from which this user logged in")}),Dt=t.z.object({id:t.z.string(),revoked_at:t.z.string().optional(),used_at:t.z.string().optional(),user_id:t.z.string().describe("The user ID associated with the session"),expires_at:t.z.string().optional(),login_session_id:t.z.string(),idle_expires_at:t.z.string().optional(),device:kt.describe("Metadata related to the device used in the session"),clients:t.z.array(t.z.string()).describe("List of client details for the session")}),Lt=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),authenticated_at:t.z.string(),last_interaction_at:t.z.string(),...Dt.shape}),jt=t.z.object({kid:t.z.string().openapi({description:"The key id of the signing key"}),cert:t.z.string().openapi({description:"The public certificate of the signing key"}),fingerprint:t.z.string().openapi({description:"The cert fingerprint"}),thumbprint:t.z.string().openapi({description:"The cert thumbprint"}),pkcs7:t.z.string().optional().openapi({description:"The private key in pkcs7 format"}),current:t.z.boolean().optional().openapi({description:"True if the key is the current key"}),next:t.z.boolean().optional().openapi({description:"True if the key is the next key"}),previous:t.z.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:t.z.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:t.z.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:t.z.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:t.z.string().optional().openapi({description:"The date and time when the key was revoked"}),connection:t.z.string().optional().openapi({description:"The connection identifier associated with the key"}),type:t.z.enum(["jwt_signing","saml_encryption"]).openapi({description:"The type of the signing key"})});var Ft=(e=>(e.RefreshToken="refresh_token",e.AuthorizationCode="authorization_code",e.ClientCredential="client_credentials",e.Passwordless="passwordless",e.Password="password",e.OTP="http://auth0.com/oauth/grant-type/passwordless/otp",e))(Ft||{});const Ut=t.z.object({access_token:t.z.string(),id_token:t.z.string().optional(),scope:t.z.string().optional(),state:t.z.string().optional(),refresh_token:t.z.string().optional(),token_type:t.z.string(),expires_in:t.z.number()});t.z.object({code:t.z.string(),state:t.z.string().optional()});const Pt=t.z.object({button_border_radius:t.z.number(),button_border_weight:t.z.number(),buttons_style:t.z.enum(["pill","rounded","sharp"]),input_border_radius:t.z.number(),input_border_weight:t.z.number(),inputs_style:t.z.enum(["pill","rounded","sharp"]),show_widget_shadow:t.z.boolean(),widget_border_weight:t.z.number(),widget_corner_radius:t.z.number()}),Mt=t.z.object({base_focus_color:t.z.string(),base_hover_color:t.z.string(),body_text:t.z.string(),captcha_widget_theme:t.z.enum(["auto","dark","light"]),error:t.z.string(),header:t.z.string(),icons:t.z.string(),input_background:t.z.string(),input_border:t.z.string(),input_filled_text:t.z.string(),input_labels_placeholders:t.z.string(),links_focused_components:t.z.string(),primary_button:t.z.string(),primary_button_label:t.z.string(),secondary_button_border:t.z.string(),secondary_button_label:t.z.string(),success:t.z.string(),widget_background:t.z.string(),widget_border:t.z.string()}),Zt=t.z.object({bold:t.z.boolean(),size:t.z.number()}),$t=t.z.object({body_text:Zt,buttons_text:Zt,font_url:t.z.string(),input_labels:Zt,links:Zt,links_style:t.z.enum(["normal","underlined"]),reference_text_size:t.z.number(),subtitle:Zt,title:Zt}),Ht=t.z.object({background_color:t.z.string(),background_image_url:t.z.string(),page_layout:t.z.enum(["center","left","right"])}),zt=t.z.object({header_text_alignment:t.z.enum(["center","left","right"]),logo_height:t.z.number(),logo_position:t.z.enum(["center","left","none","right"]),logo_url:t.z.string(),social_buttons_layout:t.z.enum(["bottom","top"])}),Gt=t.z.object({borders:Pt,colors:Mt,displayName:t.z.string(),fonts:$t,page_background:Ht,widget:zt}),Bt=Gt.extend({themeId:t.z.string()}),qt=t.z.object({universal_login_experience:t.z.enum(["new","classic"]).default("new"),identifier_first:t.z.boolean().default(!0),password_first:t.z.boolean().default(!1),webauthn_platform_first_factor:t.z.boolean()}),Kt=t.z.object({name:t.z.string(),enabled:t.z.boolean().optional().default(!0),default_from_address:t.z.string().optional(),credentials:t.z.union([t.z.object({accessKeyId:t.z.string(),secretAccessKey:t.z.string(),region:t.z.string()}),t.z.object({smtp_host:t.z.array(t.z.string()),smtp_port:t.z.number(),smtp_user:t.z.string(),smtp_pass:t.z.string()}),t.z.object({api_key:t.z.string(),domain:t.z.string().optional()}),t.z.object({connectionString:t.z.string()}),t.z.object({tenantId:t.z.string(),clientId:t.z.string(),clientSecret:t.z.string()})]),settings:t.z.object({}).optional()}),Wt=t.z.object({id:t.z.string(),session_id:t.z.string(),user_id:t.z.string(),client_id:t.z.string(),expires_at:t.z.string().optional(),idle_expires_at:t.z.string().optional(),last_exchanged_at:t.z.string().optional(),device:kt,resource_servers:t.z.array(t.z.object({audience:t.z.string(),scopes:t.z.string()})),rotating:t.z.boolean()}),Vt=t.z.object({created_at:t.z.string(),...Wt.shape}),Xt=t.z.object({to:t.z.string(),message:t.z.string()}),Yt=t.z.object({name:t.z.string(),options:t.z.object({})}),Jt=t.z.object({value:t.z.string(),description:t.z.string().optional()}),Qt=t.z.object({token_dialect:t.z.enum(["access_token","access_token_authz"]).optional(),enforce_policies:t.z.boolean().optional(),allow_skipping_userinfo:t.z.boolean().optional(),skip_userinfo:t.z.boolean().optional(),persist_client_authorization:t.z.boolean().optional(),enable_introspection_endpoint:t.z.boolean().optional(),mtls:t.z.object({bound_access_tokens:t.z.boolean().optional()}).optional()}),ei=t.z.object({id:t.z.string().optional(),name:t.z.string(),identifier:t.z.string(),scopes:t.z.array(Jt).optional(),signing_alg:t.z.string().optional(),signing_secret:t.z.string().optional(),token_lifetime:t.z.number().optional(),token_lifetime_for_web:t.z.number().optional(),skip_consent_for_verifiable_first_party_clients:t.z.boolean().optional(),allow_offline_access:t.z.boolean().optional(),verificationKey:t.z.string().optional(),options:Qt.optional(),is_system:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional()}),ti=t.z.object({...ei.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),ii=t.z.array(ti),ni=t.z.object({role_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string()}),si=t.z.object({...ni.shape,created_at:t.z.string()}),ri=t.z.array(si),oi=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string(),organization_id:t.z.string().optional()}),ai=t.z.object({...oi.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),ci=t.z.array(ai),ui=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),resource_server_name:t.z.string(),permission_name:t.z.string(),description:t.z.string().nullable().optional(),created_at:t.z.string().optional(),organization_id:t.z.string().optional()}),di=t.z.array(ui),li=t.z.object({user_id:t.z.string(),role_id:t.z.string(),organization_id:t.z.string().optional()}),hi=t.z.object({...li.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),_i=t.z.array(hi),pi=t.z.object({id:t.z.string().optional().openapi({description:"The unique identifier of the role. If not provided, one will be generated."}),name:t.z.string().min(1).max(50).openapi({description:"The name of the role. Cannot include '<' or '>'"}),description:t.z.string().max(255).optional().openapi({description:"The description of the role"}),is_system:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional().openapi({description:"Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios."})}),fi=pi.extend({id:t.z.string().openapi({description:"The unique identifier of the role"}),created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),mi=t.z.array(fi),gi=t.z.object({logo_url:t.z.string().optional().openapi({description:"URL of the organization's logo"}),colors:t.z.object({primary:t.z.string().optional().openapi({description:"Primary color in hex format (e.g., #FF0000)"}),page_background:t.z.string().optional().openapi({description:"Page background color in hex format (e.g., #FFFFFF)"})}).optional()}).optional(),yi=t.z.object({connection_id:t.z.string().openapi({description:"ID of the connection"}),assign_membership_on_login:t.z.boolean().default(!1).openapi({description:"Whether to assign membership to the organization on login"}),show_as_button:t.z.boolean().default(!0).openapi({description:"Whether to show this connection as a button in the login screen"}),is_signup_enabled:t.z.boolean().default(!0).openapi({description:"Whether signup is enabled for this connection"})}),Ei=t.z.object({client_credentials:t.z.object({enforce:t.z.boolean().default(!1).openapi({description:"Whether to enforce token quota limits"}),per_day:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per day (0 = unlimited)"}),per_hour:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per hour (0 = unlimited)"})}).optional()}).optional(),bi=t.z.object({id:t.z.string().optional(),name:t.z.string().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:t.z.string().optional().openapi({description:"The display name of the organization"}),branding:gi,metadata:t.z.record(t.z.any()).default({}).optional().openapi({description:"Custom metadata for the organization"}),enabled_connections:t.z.array(yi).default([]).optional().openapi({description:"List of enabled connections for the organization"}),token_quota:Ei}),vi=t.z.object({...bi.shape,...i.shape,id:t.z.string(),name:t.z.string().min(1).openapi({description:"The name of the organization"})}),Oi=t.z.object({user_id:t.z.string().openapi({description:"ID of the user"}),organization_id:t.z.string().openapi({description:"ID of the organization"})}),wi=t.z.object({...Oi.shape,...i.shape,id:t.z.string()}),Ai=t.z.object({idle_session_lifetime:t.z.number().optional(),session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),enable_client_connections:t.z.boolean().optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional()}).optional(),friendly_name:t.z.string().optional(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional()}),Si=t.z.object({date:t.z.string().openapi({description:"Date these events occurred in ISO 8601 format",example:"2025-12-19"}),logins:t.z.number().openapi({description:"Number of logins on this date",example:150}),signups:t.z.number().openapi({description:"Number of signups on this date",example:25}),leaked_passwords:t.z.number().openapi({description:"Number of breached-password detections on this date (subscription required)",example:0}),updated_at:t.z.string().openapi({description:"Date and time this stats entry was last updated in ISO 8601 format",example:"2025-12-19T10:30:00.000Z"}),created_at:t.z.string().openapi({description:"Approximate date and time the first event occurred in ISO 8601 format",example:"2025-12-19T00:00:00.000Z"})}),Ii=t.z.number().openapi({description:"Number of active users in the last 30 days",example:1234});e.Auth0ActionEnum=s,e.Auth0Client=It,e.AuthorizationResponseMode=V,e.AuthorizationResponseType=W,e.CodeChallengeMethod=X,e.ComponentCategory=x,e.ComponentType=T,e.EmailActionEnum=r,e.FlowActionTypeEnum=n,e.GrantType=Ft,e.LocationInfo=Nt,e.LogTypes=At,e.LoginSessionState=bt,e.NodeType=P,e.RedirectTargetEnum=u,e.actionNodeSchema=$,e.activeUsersResponseSchema=Ii,e.auth0FlowInsertSchema=K,e.auth0FlowSchema=q,e.auth0QuerySchema=p,e.auth0UpdateUserActionSchema=a,e.auth0UserResponseSchema=v,e.authParamsSchema=Y,e.baseUserSchema=y,e.blockComponentSchema=ze,e.bordersSchema=Pt,e.brandingSchema=J,e.buttonComponentSchema=D,e.clientGrantInsertSchema=S,e.clientGrantListSchema=N,e.clientGrantSchema=I,e.clientInsertSchema=w,e.clientSchema=A,e.codeInsertSchema=oe,e.codeSchema=ae,e.codeTypeSchema=re,e.colorsSchema=Mt,e.componentMessageSchema=tt,e.componentSchema=U,e.connectionInsertSchema=ee,e.connectionOptionsSchema=Q,e.connectionSchema=te,e.coordinatesSchema=C,e.createPassthroughAdapter=function(e){const{primary:t,secondaries:i,syncMethods:n=["create","update","remove","delete","set"]}=e,s={get(e,t){if("symbol"==typeof t)return e[t];const s=e[t];return"function"!=typeof s?s:n.includes(t)?async(...n)=>{const r=await s.apply(e,n),o=[];for(const e of i){const i=e.adapter[t];if("function"!=typeof i)continue;const s=(async()=>{try{await i.apply(e.adapter,n)}catch(i){try{e.onError?e.onError(i,t,n):console.error(`Passthrough adapter: secondary write failed for ${t}:`,i)}catch(e){console.error(`Passthrough adapter: onError handler threw for ${t}:`,e)}}})();e.blocking&&o.push(s)}return o.length>0&&await Promise.all(o),r}:s.bind(e)}};return new Proxy(t,s)},e.createWriteOnlyAdapter=function(e){return e},e.customDomainInsertSchema=ce,e.customDomainSchema=de,e.customDomainWithTenantIdSchema=le,e.dailyStatsSchema=Si,e.emailProviderSchema=Kt,e.emailVerificationRulesSchema=o,e.emailVerifyActionSchema=c,e.endingSchema=B,e.fieldComponentSchema=Be,e.flowActionStepSchema=l,e.flowInsertSchema=h,e.flowSchema=_,e.flowsFieldComponentSchema=j,e.flowsFlowNodeSchema=Z,e.flowsStepNodeSchema=M,e.fontDetailsSchema=Zt,e.fontsSchema=$t,e.formControlSchema=Ke,e.formInsertSchema=Qe,e.formNodeComponentDefinition=qe,e.formNodeSchema=Je,e.formSchema=et,e.genericComponentSchema=F,e.genericNodeSchema=H,e.hookInsertSchema=ut,e.hookSchema=ht,e.identitySchema=g,e.inviteInsertSchema=ft,e.inviteSchema=mt,e.inviteeSchema=pt,e.inviterSchema=_t,e.isBlockComponent=function(e){return"BLOCK"===e.category},e.isFieldComponent=function(e){return"FIELD"===e.category},e.isWidgetComponent=function(e){return"WIDGET"===e.category},e.jwksKeySchema=yt,e.jwksSchema=gt,e.legacyClientSchema=se,e.legalComponentSchema=L,e.logInsertSchema=Ct,e.logSchema=Tt,e.loginSessionInsertSchema=Ot,e.loginSessionSchema=wt,e.loginSessionStateSchema=vt,e.nodeSchema=z,e.openIDConfigurationSchema=Et,e.organizationBrandingSchema=gi,e.organizationEnabledConnectionSchema=yi,e.organizationInsertSchema=bi,e.organizationSchema=vi,e.organizationTokenQuotaSchema=Ei,e.pageBackgroundSchema=Ht,e.parseUserId=function(e){const[t,i]=e.split("|");if(!t||!i)throw Error("Invalid user_id: "+e);return{connection:t,id:i}},e.passwordInsertSchema=xt,e.passwordSchema=Rt,e.profileDataSchema=m,e.promptSettingSchema=qt,e.redirectActionSchema=d,e.refreshTokenInsertSchema=Wt,e.refreshTokenSchema=Vt,e.resourceServerInsertSchema=ei,e.resourceServerListSchema=ii,e.resourceServerOptionsSchema=Qt,e.resourceServerSchema=ti,e.resourceServerScopeSchema=Jt,e.richTextComponentSchema=k,e.roleInsertSchema=pi,e.roleListSchema=mi,e.rolePermissionInsertSchema=ni,e.rolePermissionListSchema=ri,e.rolePermissionSchema=si,e.roleSchema=fi,e.screenLinkSchema=it,e.sessionInsertSchema=Dt,e.sessionSchema=Lt,e.signingKeySchema=jt,e.smsProviderSchema=Yt,e.smsSendParamsSchema=Xt,e.startSchema=G,e.tenantInsertSchema=ie,e.tenantSchema=ne,e.tenantSettingsSchema=Ai,e.themeInsertSchema=Gt,e.themeSchema=Bt,e.tokenResponseSchema=Ut,e.totalsSchema=f,e.uiScreenSchema=nt,e.userInsertSchema=E,e.userOrganizationInsertSchema=Oi,e.userOrganizationSchema=wi,e.userPermissionInsertSchema=oi,e.userPermissionListSchema=ci,e.userPermissionSchema=ai,e.userPermissionWithDetailsListSchema=di,e.userPermissionWithDetailsSchema=ui,e.userResponseSchema=O,e.userRoleInsertSchema=li,e.userRoleListSchema=_i,e.userRoleSchema=hi,e.userSchema=b,e.verificationMethodsSchema=ue,e.widgetComponentSchema=Ge,e.widgetSchema=zt}(t)),t),An=wn.isBlockComponent,Sn=wn.isFieldComponent,In=wn.isWidgetComponent;export{An as isBlockComponent,Sn as isFieldComponent,In as isWidgetComponent}
|