UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 1.66 MB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/expression-runtime-stub-Bjes7qiW.js","assets/expression-runtime-stub-Vl5_1Jpv.js"])))=>i.map(i=>d[i]); (function(){try{var e=typeof window<`u`?window:o===void 0?typeof globalThis<`u`?globalThis:typeof self<`u`?self:{}:o;e.SENTRY_RELEASE={id:`n8n@2.16.1`}}catch{}})();try{(function(){var e=typeof window<`u`?window:o===void 0?typeof globalThis<`u`?globalThis:typeof self<`u`?self:{}:o,t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`88a86a84-d0bb-402c-99c4-e78b22f69e6f`,e._sentryDebugIdIdentifier=`sentry-dbid-88a86a84-d0bb-402c-99c4-e78b22f69e6f`)})()}catch{}import{a as e,n as t,o as n,r,t as i}from"./chunk-CACdhNlC.js";import{En as a,Tn as o}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{a as s,c,d as l,i as u,n as d,r as f,t as p,u as m}from"./get-BjzKP_3k.js";import{a as h,c as g,d as _,f as v,i as y,l as b,m as x,n as S,o as C,t as w,u as T}from"./_MapCache-CP9ToMjk.js";import{C as E,S as D,_ as O,a as k,b as A,c as ee,d as j,f as te,g as ne,h as re,i as ie,l as ae,m as oe,n as se,o as ce,r as le,s as ue,t as de,u as fe,w as pe,x as me,y as he}from"./empty-BNY-5QlZ.js";import{A as ge,C as _e,D as ve,E as ye,M as be,O as xe,S as Se,T as Ce,_ as we,a as Te,b as Ee,c as De,f as Oe,g as ke,h as Ae,i as je,j as Me,k as Ne,l as Pe,m as Fe,o as Ie,p as Le,s as Re,t as ze,v as Be,w as Ve,x as He,y as Ue}from"./merge-DFZxC2wo.js";import{a as We,i as Ge,r as Ke}from"./expression-runtime-stub-Vl5_1Jpv.js";var qe=function(e){return e.DUPLICATE=`duplicate`,e.DOWNLOAD=`download`,e.IMPORT_FROM_URL=`import-from-url`,e.IMPORT_FROM_FILE=`import-from-file`,e.PUSH=`push`,e.EDIT_DESCRIPTION=`edit-description`,e.SETTINGS=`settings`,e.DELETE=`delete`,e.ARCHIVE=`archive`,e.UNARCHIVE=`unarchive`,e.RENAME=`rename`,e.CHANGE_OWNER=`change-owner`,e.UNPUBLISH=`unpublish`,e.SHARE=`share`,e}({}),Je=12e3,Ye=`@n8n/n8n-nodes-langchain`,Xe=`authentication`,Ze={MFA_TOKEN:`MFA_TOKEN`,MFA_RECOVERY_CODE:`MFA_RECOVERY_CODE`},Qe=[`ftp`,`ftps`,`dict`,`imap`,`imaps`,`ldap`,`ldaps`,`mqtt`,`pop`,`pop3s`,`rtmp`,`rtsp`,`scp`,`sftp`,`smb`,`smbs`,`smtp`,`smtps`,`telnet`,`tftp`],$e={ftp:`FTP`,ftps:`FTP`,ldap:`LDAP`,ldaps:`LDAP`,mqtt:`MQTT`,imap:`IMAP`,imaps:`IMAP`},et=1e3,tt=15e3,nt=5e3,rt={SECOND:1e3,MINUTE:60*1e3,HOUR:3600*1e3,DAY:1440*60*1e3},it=3*rt.DAY,at=7*rt.DAY,ot=180*rt.DAY,st=1e3;function ct(e){let t=sessionStorage.getItem(`N8N_DEBOUNCE_MULTIPLIER`),n=t===null?1:parseFloat(t);return Math.round(e*(Number.isNaN(n)?1:n))}var lt={UI:{RESIZE:50,QUICK:10},INPUT:{VALIDATION:100,TEXT_CHANGE:200,SEARCH:300},API:{RESOURCE_SEARCH:500,HEAVY_OPERATION:1e3,AUTOSAVE:1500,AUTOSAVE_MAX_WAIT:5e3},TELEMETRY:{BATCH:2e3,TRACK:1e3},COLLABORATION:{ACTIVITY:100},CONNECTION:{WEBSOCKET_DISCONNECT:500}},ut={AdvancedExecutionFilters:`advancedExecutionFilters`,Sharing:`sharing`,Ldap:`ldap`,LogStreaming:`logStreaming`,Variables:`variables`,Saml:`saml`,Oidc:`oidc`,EnforceMFA:`mfaEnforcement`,SourceControl:`sourceControl`,ExternalSecrets:`externalSecrets`,AuditLogs:`auditLogs`,DebugInEditor:`debugInEditor`,WorkerView:`workerView`,AdvancedPermissions:`advancedPermissions`,NamedVersions:`namedVersions`,Provisioning:`provisioning`,PersonalSpacePolicy:`personalSpacePolicy`,CustomRoles:`customRoles`,DataRedaction:`dataRedaction`};function dt(e,t){return{name:e,...t??{control:`control`,variant:`variant`}}}var ft=dt(`canvas_zoomed_view`),pt=dt(`ndv_in_focus_panel`),mt=dt(`034_extra_template_links`),ht=dt(`035_template_onboarding`,{control:`control`,variantStarterPack:`variant-starter-pack`,variantSuggestedTemplates:`variant-suggested-templates`}),gt=dt(`37_onboarding_experiments_batch_aug11`,{control:`control`,variantReadyToRun:`variant-ready-to-run-workflows`,variantReadyToRun2:`variant-ready-to-run-workflows_v2`,variantReadyToRun3:`variant-ready-to-run-workflows_v3`}),_t=dt(`039_template_onboarding_v2`);dt(`042_ready-to-run-worfklow_v2`,{control:`control`,variant1:`variant-1-singlebox`,variant2:`variant-2-twoboxes`});var vt=dt(`059_ready-to-run-worfklow_v2-3`,{control:`control`,variant5:`variant-5`,variant6:`variant-6`}),yt=dt(`044_template_reco_v3`),bt=dt(`048_collection_overhaul`),xt=dt(`055_template_setup_experience`),St=dt(`056_ai_builder_template_examples`),Ct=dt(`073_builder_plan_mode`),wt=dt(`075_ai_builder_review_changes`),Tt=dt(`076_merge_ask_build`),Et={name:`062_execution_logic_v2`,control:`control`,variant:`variant`},Dt=dt(`065_credentials_app_selection`),Ot=dt(`063_empty_state_builder_prompt`),kt=dt(`064_focused_nodes`),At=dt(`063_resource_center_0`,{control:`control`,variantResources:`variant-resources`,variantInspiration:`variant-inspiration`}),jt=dt(`067_sidebar_expanded`),Mt=dt(`070_empty_screen_layout`,{control:`control`,variantBuilderPrompt:`variant-builder-prompt`,variantTemplates:`variant-templates`}),Nt=dt(`069_setup_panel`,{control:`control`,variant:`variant`}),Pt=dt(`071_coding_workflow_builder`,{control:`control`,codeNoPinData:`code-no-pin-data`,codePinData:`code-pin-data`}),Ft=dt(`079_ai_builder_setup_wizard`),It=dt(`078_experiment_check_aa`),Lt=dt(`077_chat_hub_semantic_search`),Rt=dt(`078_floating_chat_hub_panel`),zt=[mt.name,ht.name,gt.name,_t.name,vt.name,St.name,Ct.name,xt.name,At.name,Et.name,bt.name,Dt.name,jt.name,Mt.name,Nt.name,Pt.name,Ot.name,kt.name,wt.name,Tt.name,Ft.name,It.name,Lt.name,Rt.name],Bt=`workflowId`,Vt=`canvas`,Ht=`canvasNode`,Ut=`canvasNodeHandle`,Wt=Symbol(`PopOutWindow`),Gt=Symbol(`ExpressionLocalResolveContext`),Kt=Symbol(`TelemetryContext`),qt=Symbol(`WorkflowState`),Jt=Symbol(`WorkflowDocumentStore`),Yt=Symbol(`ChatHubToolContext`),Xt=1024*1024*16,Zt=2048,Qt=1024*1024*12,$t=1024*1024,en=1024*1024*4,tn=1024*512,nn=`N8N_HIDE_ACTIVATION_ALERT`,rn=`N8N_PIN_DATA_DISCOVERY_NDV`,an=`N8N_PIN_DATA_DISCOVERY_CANVAS`,on=`N8N_MAIN_PANEL_RELATIVE_WIDTH`,sn=`N8N_THEME`,cn=`N8N_EXPERIMENT_OVERRIDES`,ln=`N8N_HIDE_HIDE_GITHUB_STAR_BUTTON`,un=`N8N_LOGS_PANEL_OPEN`,dn=`N8N_LOGS_SYNC_SELECTION_ENABLED`,fn=`N8N_LOGS_DETAILS_PANEL`,pn=`N8N_LOGS_DETAILS_PANEL_SUB_NODE`,mn=`N8N_WORKFLOWS_LIST_PREFERENCES`,hn=`N8N_READ_WHATS_NEW_ARTICLES`,gn=`N8N_DISMISSED_WHATS_NEW_CALLOUT`,_n=`N8N_FOCUS_PANEL`,vn=`N8N_EXPERIMENTAL_DISMISSED_SUGGESTED_WORKFLOWS`,yn=`N8N_DATA_WORKER`,bn=e=>`${e}_N8N_CHAT_HUB_SELECTED_MODEL`,xn=e=>`${e}_N8N_CHAT_HUB_CREDENTIALS`,Sn=e=>`${e}_N8N_CHAT_HUB_HAD_CONVERSATION_BEFORE`,Cn=`N8N_SIDEBAR_WIDTH`,wn=`N8N_BROWSER_NOTIFICATION_METADATA`,Tn=`N8N_FLOATING_CHAT_WINDOW`,En=`cancel`,Dn=`confirm`,On=`close`,kn=`about`,An=`chatEmbed`,jn=`changePassword`,Mn=`confirmPassword`,Nn=`duplicate`,Pn=`importWorkflowUrl`,Fn=`versions`,In=`settings`,Ln=`workflowShare`,Rn=`npsSurvey`,zn=`activation`,Bn=`importCurl`,Vn=`settingsLogStream`,Hn=`mfaSetup`,Un=`promptMfaCode`,Wn=`workflowHistoryVersionRestore`,Gn=`workflowHistoryVersionUnpublish`,Kn=`workflowHistoryNameVersion`,qn=`setupCredentials`,Jn=`newAssistantSession`,Yn=`externalSecretsProvider`,Xn=`secretsProviderConnection`,Zn=`deleteSecretsProvider`,Qn=`workflowActivationConflictingWebhook`,$n=`fromAiParameters`,er=`stopManyExecutions`,tr=`workflowExtractionName`,nr=`whatsNew`,rr=`workflowDiff`,ir=`templateRecoV2`,ar=`templateRecoV3`,or=`binaryDataView`,sr=`workflowDescription`,cr=`workflowPublish`,lr=`workflowHistoryPublish`,ur=`workflowHistoryDiff`,dr=`credentialResolverEdit`,fr=`aiBuilderDiff`,pr=`instanceAiCredentialSetup`,mr=function(e){return e.HOMEPAGE=`Homepage`,e.COLLECTION=`TemplatesCollectionView`,e.EXECUTIONS=`Executions`,e.EXECUTION_PREVIEW=`ExecutionPreview`,e.EXECUTION_DEBUG=`ExecutionDebug`,e.EXECUTION_HOME=`ExecutionsLandingPage`,e.TEMPLATE=`TemplatesWorkflowView`,e.TEMPLATE_SETUP=`TemplatesWorkflowSetupView`,e.TEMPLATES=`TemplatesSearchView`,e.CREDENTIALS=`CredentialsView`,e.NEW_WORKFLOW=`NodeViewNew`,e.WORKFLOW=`NodeViewExisting`,e.DEMO=`WorkflowDemo`,e.DEMO_DIFF=`WorkflowDemoDiff`,e.TEMPLATE_IMPORT=`WorkflowTemplate`,e.WORKFLOW_ONBOARDING=`WorkflowOnboarding`,e.SIGNIN=`SigninView`,e.SIGNUP=`SignupView`,e.SIGNOUT=`SignoutView`,e.SETUP=`SetupView`,e.FORGOT_PASSWORD=`ForgotMyPasswordView`,e.CHANGE_PASSWORD=`ChangePasswordView`,e.SETTINGS=`Settings`,e.USERS_SETTINGS=`UsersSettings`,e.LDAP_SETTINGS=`LdapSettings`,e.PERSONAL_SETTINGS=`PersonalSettings`,e.SECURITY_SETTINGS=`SecuritySettings`,e.API_SETTINGS=`APISettings`,e.NOT_FOUND=`NotFoundView`,e.COMMUNITY_NODES=`CommunityNodes`,e.WORKFLOWS=`WorkflowsView`,e.WORKFLOW_EXECUTIONS=`WorkflowExecutions`,e.EVALUATION=`Evaluation`,e.EVALUATION_EDIT=`EvaluationEdit`,e.EVALUATION_RUNS_DETAIL=`EvaluationRunsDetail`,e.USAGE=`Usage`,e.LOG_STREAMING_SETTINGS=`LogStreamingSettingsView`,e.SSO_SETTINGS=`SSoSettings`,e.EXTERNAL_SECRETS_SETTINGS=`ExternalSecretsSettings`,e.SAML_ONBOARDING=`SamlOnboarding`,e.SOURCE_CONTROL=`SourceControl`,e.MFA_VIEW=`MfaView`,e.WORKFLOW_HISTORY=`WorkflowHistory`,e.WORKER_VIEW=`WorkerView`,e.PROJECTS=`Projects`,e.PROJECT_DETAILS=`ProjectDetails`,e.PROJECTS_WORKFLOWS=`ProjectsWorkflows`,e.PROJECTS_CREDENTIALS=`ProjectsCredentials`,e.PROJECT_SETTINGS=`ProjectSettings`,e.PROJECTS_EXECUTIONS=`ProjectsExecutions`,e.PROJECT_ROLES_SETTINGS=`ProjectRolesSettingsView`,e.PROJECT_ROLE_SETTINGS=`ProjectRoleSettingsView`,e.PROJECT_NEW_ROLE=`ProjectNewRoleView`,e.PROJECT_ROLE_VIEW=`ProjectRoleViewView`,e.PROJECTS_VARIABLES=`ProjectsVariables`,e.HOME_VARIABLES=`HomeVariables`,e.FOLDERS=`Folders`,e.PROJECTS_FOLDERS=`ProjectsFolders`,e.INSIGHTS=`Insights`,e.SHARED_WITH_ME=`SharedWithMe`,e.SHARED_WORKFLOWS=`SharedWorkflows`,e.SHARED_CREDENTIALS=`SharedCredentials`,e.ENTITY_NOT_FOUND=`EntityNotFound`,e.ENTITY_UNAUTHORIZED=`EntityUnAuthorized`,e.PRE_BUILT_AGENT_TEMPLATES=`PreBuiltAgentTemplates`,e.AI_SETTINGS=`AISettingsView`,e.OAUTH_CONSENT=`OAuthConsent`,e.MIGRATION_REPORT=`MigrationReport`,e.MIGRATION_RULE_REPORT=`MigrationRuleReport`,e.RESOLVERS=`Resolvers`,e.RESOURCE_CENTER=`ResourceCenter`,e.RESOURCE_CENTER_SECTION=`ResourceCenterSection`,e}({}),hr=[mr.WORKFLOW,mr.NEW_WORKFLOW,mr.EXECUTION_DEBUG],gr=function(e){return e.WORKFLOW=`workflow`,e.EXECUTIONS=`executions`,e.SETTINGS=`settings`,e.EVALUATION=`evaluation`,e}({}),_r;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(_r||={});var vr;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(vr||={});var M=_r.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),yr=e=>{switch(typeof e){case`undefined`:return M.undefined;case`string`:return M.string;case`number`:return Number.isNaN(e)?M.nan:M.number;case`boolean`:return M.boolean;case`function`:return M.function;case`bigint`:return M.bigint;case`symbol`:return M.symbol;case`object`:return Array.isArray(e)?M.array:e===null?M.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?M.promise:typeof Map<`u`&&e instanceof Map?M.map:typeof Set<`u`&&e instanceof Set?M.set:typeof Date<`u`&&e instanceof Date?M.date:M.object;default:return M.unknown}},N=_r.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`]),br=class e 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]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_r.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};br.create=e=>new br(e);var xr=(e,t)=>{let n;switch(e.code){case N.invalid_type:n=e.received===M.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case N.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_r.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:n=`Unrecognized key(s) in object: ${_r.joinValues(e.keys,`, `)}`;break;case N.invalid_union:n=`Invalid input`;break;case N.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_r.joinValues(e.options)}`;break;case N.invalid_enum_value:n=`Invalid enum value. Expected ${_r.joinValues(e.options)}, received '${e.received}'`;break;case N.invalid_arguments:n=`Invalid function arguments`;break;case N.invalid_return_type:n=`Invalid function return type`;break;case N.invalid_date:n=`Invalid date`;break;case N.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:_r.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case N.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`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 N.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case N.custom:n=`Invalid input`;break;case N.invalid_intersection_types:n=`Intersection results could not be merged`;break;case N.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case N.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,_r.assertNever(e)}return{message:n}},Sr=xr;function Cr(){return Sr}var wr=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function P(e,t){let n=Cr(),r=wr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===xr?void 0:xr].filter(e=>!!e)});e.common.issues.push(r)}var Tr=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Er;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Er;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Er=Object.freeze({status:`aborted`}),Dr=e=>({status:`dirty`,value:e}),Or=e=>({status:`valid`,value:e}),kr=e=>e.status===`aborted`,Ar=e=>e.status===`dirty`,jr=e=>e.status===`valid`,Mr=e=>typeof Promise<`u`&&e instanceof Promise,F;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(F||={});var Nr=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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}},Pr=(e,t)=>{if(jr(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(){return this._error||=new br(e.common.issues),this._error}}};function Fr(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Ir=class{get description(){return this._def.description}_getType(e){return yr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:yr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tr,ctx:{common:e.parent.common,data:e.data,parsedType:yr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Mr(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yr(e)};return Pr(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yr(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return jr(n)?{value:n.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=>jr(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yr(e)},r=this._parse({data:e,path:n.path,parent:n});return Pr(n,await(Mr(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:N.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new zi({schema:this,typeName:Xi.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 Bi.create(this,this._def)}nullable(){return Vi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bi.create(this)}promise(){return Ri.create(this,this._def)}or(e){return Ci.create([this,e],this._def)}and(e){return Di.create(this,e,this._def)}transform(e){return new zi({...Fr(this._def),schema:this,typeName:Xi.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Hi({...Fr(this._def),innerType:this,defaultValue:t,typeName:Xi.ZodDefault})}brand(){return new Gi({typeName:Xi.ZodBranded,type:this,...Fr(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Ui({...Fr(this._def),innerType:this,catchValue:t,typeName:Xi.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ki.create(this,e)}readonly(){return qi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Lr=/^c[^\s-]{8,}$/i,Rr=/^[0-9a-z]+$/,zr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Br=/^[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,Vr=/^[a-z0-9_-]{21}$/i,Hr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ur=/^[-+]?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)?)??$/,Wr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Gr=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Kr,qr=/^(?:(?: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])$/,Jr=/^(?:(?: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])$/,Yr=/^(([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]))$/,Xr=/^(([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])$/,Zr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$r=`((\\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])))`,ei=RegExp(`^${$r}$`);function ti(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function ni(e){return RegExp(`^${ti(e)}$`)}function ri(e){let t=`${$r}T${ti(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function ii(e,t){return!!((t===`v4`||!t)&&qr.test(e)||(t===`v6`||!t)&&Yr.test(e))}function ai(e,t){if(!Hr.test(e))return!1;try{let[n]=e.split(`.`),r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function oi(e,t){return!!((t===`v4`||!t)&&Jr.test(e)||(t===`v6`||!t)&&Xr.test(e))}var si=class e extends Ir{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.string,received:t.parsedType}),Er}let t=new Tr,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?P(n,{code:N.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&P(n,{code:N.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Wr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`email`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Kr||=new RegExp(Gr,`u`),Kr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`emoji`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Br.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`uuid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Vr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`nanoid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Lr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`cuid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Rr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`cuid2`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)zr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`ulid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),P(n,{validation:`url`,code:N.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`regex`,code:N.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?ri(r).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?ei.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?ni(r).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Ur.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`duration`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?ii(e.data,r.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`ip`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?ai(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`jwt`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?oi(e.data,r.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`cidr`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Zr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`base64`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Qr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`base64url`,code:N.invalid_string,message:r.message}),t.dirty()):_r.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:N.invalid_string,...F.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...F.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...F.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...F.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...F.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...F.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...F.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...F.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...F.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...F.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...F.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...F.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...F.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...F.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...F.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...F.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...F.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...F.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...F.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...F.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...F.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...F.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...F.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...F.errToObj(t)})}nonempty(e){return this.min(1,F.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};si.create=e=>new si({checks:[],typeName:Xi.ZodString,coerce:e?.coerce??!1,...Fr(e)});function ci(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var li=class e extends Ir{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)!==M.number){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.number,received:t.parsedType}),Er}let t,n=new Tr;for(let r of this._def.checks)r.kind===`int`?_r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),P(t,{code:N.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?ci(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),P(t,{code:N.not_finite,message:r.message}),n.dirty()):_r.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,F.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,F.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,F.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,F.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:F.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:F.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:F.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:F.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:F.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:F.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&_r.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};li.create=e=>new li({checks:[],typeName:Xi.ZodNumber,coerce:e?.coerce||!1,...Fr(e)});var ui=class e extends Ir{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)!==M.bigint)return this._getInvalidInput(e);let t,n=new Tr;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):_r.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.bigint,received:t.parsedType}),Er}gte(e,t){return this.setLimit(`min`,e,!0,F.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,F.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,F.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,F.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:F.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:F.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};ui.create=e=>new ui({checks:[],typeName:Xi.ZodBigInt,coerce:e?.coerce??!1,...Fr(e)});var di=class extends Ir{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.boolean,received:t.parsedType}),Er}return Or(e.data)}};di.create=e=>new di({typeName:Xi.ZodBoolean,coerce:e?.coerce||!1,...Fr(e)});var fi=class e extends Ir{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.date,received:t.parsedType}),Er}if(Number.isNaN(e.data.getTime()))return P(this._getOrReturnCtx(e),{code:N.invalid_date}),Er;let t=new Tr,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):_r.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:F.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:F.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};fi.create=e=>new fi({checks:[],coerce:e?.coerce||!1,typeName:Xi.ZodDate,...Fr(e)});var pi=class extends Ir{_parse(e){if(this._getType(e)!==M.symbol){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.symbol,received:t.parsedType}),Er}return Or(e.data)}};pi.create=e=>new pi({typeName:Xi.ZodSymbol,...Fr(e)});var mi=class extends Ir{_parse(e){if(this._getType(e)!==M.undefined){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.undefined,received:t.parsedType}),Er}return Or(e.data)}};mi.create=e=>new mi({typeName:Xi.ZodUndefined,...Fr(e)});var hi=class extends Ir{_parse(e){if(this._getType(e)!==M.null){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.null,received:t.parsedType}),Er}return Or(e.data)}};hi.create=e=>new hi({typeName:Xi.ZodNull,...Fr(e)});var gi=class extends Ir{constructor(){super(...arguments),this._any=!0}_parse(e){return Or(e.data)}};gi.create=e=>new gi({typeName:Xi.ZodAny,...Fr(e)});var _i=class extends Ir{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Or(e.data)}};_i.create=e=>new _i({typeName:Xi.ZodUnknown,...Fr(e)});var vi=class extends Ir{_parse(e){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.never,received:t.parsedType}),Er}};vi.create=e=>new vi({typeName:Xi.ZodNever,...Fr(e)});var yi=class extends Ir{_parse(e){if(this._getType(e)!==M.undefined){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.void,received:t.parsedType}),Er}return Or(e.data)}};yi.create=e=>new yi({typeName:Xi.ZodVoid,...Fr(e)});var bi=class e extends Ir{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==M.array)return P(t,{code:N.invalid_type,expected:M.array,received:t.parsedType}),Er;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(P(t,{code:e?N.too_big:N.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(P(t,{code:N.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(P(t,{code:N.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Nr(t,e,t.path,n)))).then(e=>Tr.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Nr(t,e,t.path,n)));return Tr.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:F.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:F.toString(n)}})}nonempty(e){return this.min(1,e)}};bi.create=(e,t)=>new bi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Xi.ZodArray,...Fr(t)});function xi(e){if(e instanceof Si){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Bi.create(xi(r))}return new Si({...e._def,shape:()=>t})}else if(e instanceof bi)return new bi({...e._def,type:xi(e.element)});else if(e instanceof Bi)return Bi.create(xi(e.unwrap()));else if(e instanceof Vi)return Vi.create(xi(e.unwrap()));else if(e instanceof Oi)return Oi.create(e.items.map(e=>xi(e)));else return e}var Si=class e extends Ir{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:_r.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==M.object){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.object,received:t.parsedType}),Er}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof vi&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Nr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof vi){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(P(n,{code:N.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Nr(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Tr.mergeObjectSync(t,e)):Tr.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return F.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:F.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Xi.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of _r.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of _r.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return xi(this)}partial(t){let n={};for(let e of _r.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of _r.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Bi;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Fi(_r.objectKeys(this.shape))}};Si.create=(e,t)=>new Si({shape:()=>e,unknownKeys:`strip`,catchall:vi.create(),typeName:Xi.ZodObject,...Fr(t)}),Si.strictCreate=(e,t)=>new Si({shape:()=>e,unknownKeys:`strict`,catchall:vi.create(),typeName:Xi.ZodObject,...Fr(t)}),Si.lazycreate=(e,t)=>new Si({shape:e,unknownKeys:`strip`,catchall:vi.create(),typeName:Xi.ZodObject,...Fr(t)});var Ci=class extends Ir{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new br(e.ctx.common.issues));return P(t,{code:N.invalid_union,unionErrors:n}),Er}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new br(e));return P(t,{code:N.invalid_union,unionErrors:i}),Er}}get options(){return this._def.options}};Ci.create=(e,t)=>new Ci({options:e,typeName:Xi.ZodUnion,...Fr(t)});var wi=e=>e instanceof Ni?wi(e.schema):e instanceof zi?wi(e.innerType()):e instanceof Pi?[e.v