PageSourceSearch

https://apps.awatcloud.com/assets/BamwBVMb2.js

js awatcloud.com collected 2026-10-08 08:45:57 UTC 2,715 bytes, 1 lines download raw bytes

1import{D as e,N as t}from"./Ssl5WjxV.js";import{_ as n}from"./DaNbzTdM.js";import{d as r}from"./BSRZuWhP.js";import{t as i}from"./CGQYOqtt2.js";var a=t(e()),o=t(i()),s=()=>({"string.min":n.t(`validation.string_min`),"string.max":n.t(`validation.string_max`),"string.pattern.base":n.t(`validation.string_pattern_base`),"string.alphanum":n.t(`validation.string_alphanum`),"string.email":n.t(`validation.string_email`),"string.empty":n.t(`validation.any_required`),"array.empty":`array.empty`,"object.empty":`object.empty`,"object.required":`object.required`,"array.required":`array.required`,"any.required":n.t(`validation.any_required`),"any.empty":`s`,"any.custom":``,"any.default":``,"any.failover":``,"any.invalid":``,"any.only":``,"any.ref":``,"any.unknown":``,"number.greater":`باید بزرگتر از صفر باشد`,"number.min":`{#label} نمی‌تواند کمتر از {#limit} باشد.`,"number.max":`{#label} نمی‌تواند بیشتر از {#limit} باشد.`});function c({initialState:e,schema:t,comparers:n}){let[i,c]=(0,a.useState)([]),[l,u]=(0,a.useState)({}),[d,f]=(0,a.useState)({}),p=n??{},m=e=>{let t=Object.values(e);for(let e of t)if(e&&e.length)return!0;return!1};return{touched:i,setTouched:c,validationOnChange:n=>{let a=n.target.name,m=e[a],h=i.filter(e=>e!==a),g=r(n.target.value);typeof g==`object`||typeof m==`object`?Object.keys(p).find(e=>e===a)?p[a](g,m)||h.push(a):JSON.stringify(g)!==JSON.stringify(m)&&h.push(a):g!==m&&h.push(a),c(h);let _={...l},v={...d},y=o.default.compile(t[a]?.messages(s())).validate(g,{convert:!1,abortEarly:!1}).error?.details;_[a]=g===m?[]:y?.map(e=>e.message)||[],u(_),v[a]=g===m?[]:y?.map(e=>e)||[],f(v)},validationOnChanges:n=>{let a=i,m=l,h=d;n?.forEach?.(n=>{let i=n.target.name,c=e[i],l=a.filter(e=>e!==i),u=r(n.target.value);typeof u==`object`||typeof c==`object`?Object.keys(p).find(e=>e===i)?p[i](u,c)||l.push(i):JSON.stringify(u)!==JSON.stringify(c)&&l.push(i):u!==c&&l.push(i),a=l;let d={...m},f={...h},g=o.default.compile(t[i]?.messages(s())).validate(u,{convert:!1,abortEarly:!1}).error?.details;d[i]=u===c?[]:g?.map(e=>e.message)||[],m=d,f[i]=u===c?[]:g?.map(e=>e)||[],h=f}),c(a),u(m),f(h)},validationOnSubmit:e=>{let n={...l},r=[...i],a=m(n);for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let o=i;t[o]._flags.presence===`required`&&(typeof e[o]!=`number`&&!e[o]||Array.isArray(e[o])&&e[o].length===0)&&(a=!0,n[o]=[`پر کردن این فیلد اجباری‌ست`],r.push(o))}return a?(u(n),c(r),!1):!0},resetValidation:()=>{c([]),u({}),f({})},isInvalid:e=>i.includes(e)&&!!l[e]?.length,getValidationError:e=>i.includes(e)?l[e]?.join(`, `):void 0,getValidationErrorEx:e=>i.includes(e)?d[e]:void 0}}export{c as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.