import{j as t}from"./index-fNs72j9w.js";function u(a,e,r){return e?/^(1[3-9])\d{9}$/.test(e.toString())?r():r(new Error(t.global.t("validate.Please enter the correct mobile number"))):r()}function l(a,e,r){return e?/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(e.toString())?r():r(new Error(t.global.t("validate.Please enter the correct ID number"))):r()}function n(a,e,r){return e?/^[a-zA-Z][a-zA-Z0-9_]{2,15}$/.test(e)?r():r(new Error(t.global.t("validate.Please enter the correct account"))):r()}function d(a){return/^(?!.*[&<>"'\n\r]).{6,32}$/.test(a)}function s(a,e,r){return e?d(e)?r():r(new Error(t.global.t("validate.Please enter the correct password"))):r()}function f(a){return/^([^\x00-\xff]|[a-zA-Z_$])([^\x00-\xff]|[a-zA-Z0-9_$])*$/.test(a)}function b(a,e,r){return e?f(e)?r():r(new Error(t.global.t("validate.Please enter the correct name"))):r()}function v(a,e,r){return!e||e=="<p><br></p>"?r(new Error(t.global.t("validate.Content cannot be empty"))):r()}const c={required:t.global.t("validate.required"),mobile:t.global.t("utils.mobile"),idNumber:t.global.t("utils.Id number"),account:t.global.t("utils.account"),password:t.global.t("utils.password"),varName:t.global.t("utils.variable name"),editorRequired:t.global.t("validate.editor required"),url:"URL",email:t.global.t("utils.email"),date:t.global.t("utils.date"),number:t.global.t("validate.number"),integer:t.global.t("validate.integer"),float:t.global.t("validate.float")};function p({name:a,message:e,title:r,trigger:i="blur"}){if(a=="required")return{required:!0,message:e||t.global.t("Please input field",{field:r}),trigger:i};if(["number","integer","float","date","url","email"].includes(a))return{type:a,message:e||t.global.t("Please enter the correct field",{field:r}),trigger:i};const o={mobile:u,idNumber:l,account:n,password:s,varName:b,editorRequired:v};return o[a]?{required:a=="editorRequired",validator:o[a],trigger:i,message:e}:{}}export{f as a,p as b,c,d as r,n as v};
