1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="d7e23a8f-4c9c-4b69-8709-1b4584617afb",e._sentryDebugIdIdentifier="sentry-dbid-d7e23a8f-4c9c-4b69-8709-1b4584617afb")}catch(e){}}();import"./_sentry-release-injection-file-BIxAPxRH.js";import{a as e}from"./rolldown-runtime-CynJssAt.js";import{t as a}from"./react-C9jbeexS.js";import{K as s,at as t}from"./index-eSpJ4TSf.js";a();var r=t(),n="INVALID",i="MAX_LENGTH_EXCEEDED",o=s(),m={required:e=>e?void 0:(0,o.jsx)(r.T,{message:"This field is required."}),email:e=>e&&!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i.test(e)?(0,o.jsx)(r.T,{message:"Please enter a valid email address."}):void 0,yearRange(e){const a=(new Date).getFullYear();return e<1112||e>(new Date).getFullYear()?(0,o.jsx)(r.T,{message:"Please enter a year between 1112 and {{ currentYear }}",currentYear:a}):void 0},yearMinMax(e,a){const s=a.year_min,t=a.year_max;return s&&t&&parseInt(s,10)>parseInt(t,10)?(0,o.jsx)(r.T,{message:"Year maximum must be greater than minimum."}):void 0},priceRange:e=>e<=0?(0,o.jsx)(r.T,{message:"Please enter a price greater than 0"}):void 0,priceMinMax:(e,{price_max:a,price_min:s})=>s&&a&&Number(s)>Number(a)?(0,o.jsx)(r.T,{message:"Price maximum must be greater than or equal to minimum."}):void 0,dateMinMax:(e,a)=>function(s,t){if(t[e.field]&&t[a.field]&&new Date(t[e.field])>new Date(t[a.field]))return(0,o.jsx)(r.T,{message:`${e.label} should be before ${a.label}`})},checkFirstLastName(e,a){const{first_name:s,last_name:t}=a;return s&&t&&s===t?(0,o.jsx)(r.T,{message:"First name and last name should be different"}):void 0},passwordLength:e=>e&&e.length<8?(0,o.jsx)(r.T,{message:"Must be at least 8 characters."}):void 0,passwordMatch(e,a){const{password1:s,password2:t}=a;return s&&t&&s!==t?(0,o.jsx)(r.T,{message:"Your passwords did not match."}):void 0},username:e=>e&&/[^\w\d _.@|#&-]/iu.test(e)?(0,o.jsx)(r.T,{message:"Usernames can only contain letters, numbers or these punctuation characters: _.@|#&-"}):void 0,url:(e=void 0)=>a=>{if(a){const s=((e,a)=>{const s="(?![a-z]*:\\/\\/)",t=(e=!1)=>`[a-zA-Z0-9${e?"&":""}./?:@\\-_=#]`;if(!new RegExp(`^((http|https):\\/\\/)?${s}${t()}${s}${t()}*\\.(${t(!0)})+$`,"g").test(e))return{valid:!1,reason:n};if(a){let s=e;if(e.startsWith("http://")||e.startsWith("https://")||(s="http://"+e),s.length>a)return{valid:!1,reason:i}}return{valid:!0,reason:null}})(a,e);return s.valid?void 0:s.reason===i?(0,o.jsx)(r.T,{message:'The maximum length of the URL is {{ maxLength }} characters, including the "http://" protocol prefix.',maxLength:e}):(0,o.jsx)(r.T,{message:'Please enter a valid URL. For example: "https://www.example.com".'})}},catalogueItemsLength:e=>e&&parseInt(e,10)>2e3?(0,o.jsx)(r.T,{message:"Maximum of 2000 items."}):void 0,oneOf:e=>function(a){return e.includes(a)?void 0:(0,o.jsx)(r.T,{message:"Wrong value selected."})},minLength:e=>function(a){return a.length<e?(0,o.jsx)(r.T,{message:`Please select at least ${e} value${e>1?"s":""}`}):void 0},maxStrLength:e=>function(a){return a&&a.length>e?(0,o.jsx)(r.T,{message:"Maximum of {{ count }} character.",messagePlural:"Maximum of {{ count }} characters.",count:e}):void 0}};export{m as t}; 2//# sourceMappingURL=commonValidators-BuDNBY0d.js.map
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.