PageSourceSearch

https://boghrat.com/chunk-7RLPLJW5.js

js boghrat.com collected 2026-10-08 12:25:39 UTC 5,906 bytes, 5 lines download raw bytes

1import{h as g}from"./chunk-COYXNZ6O.js";var h=(()=>{let l=class l{static createSlug(e){return e?e.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\p{L}\p{N}]+/gu,"-").replace(/[^\w\u0600-\u06FF\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,""):""}static fixNumbers(e){let t=[/Û°/g,/Û±/g,/Û²/g,/Û³/g,/Û´/g,/Ûµ/g,/Û¶/g,/Û·/g,/Û¸/g,/Û¹/g],a=[/Ù /g,/Ù¡/g,/Ù¢/g,/Ù£/g,/Ù¤/g,/Ù¥/g,/Ù¦/g,/Ù§/g,/Ù¨/g,/Ù©/g];if(typeof e=="string")for(let r=0;r<10;r++)e=e.replace(t[r],r).replace(a[r],r);return e}static shallowEqual(e,t){if(e===t)return!0;if(!e||!t)return!1;let a=Object.keys(e),r=Object.keys(t);return a.length!==r.length?!1:a.every(s=>e[s]===t[s])}static getRandomString(e=32){let t="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=Date.now().toString();for(let s=0;s<e-r.length;s++)t+=a.charAt(Math.floor(Math.random()*a.length));return t+=r,t}static trim(e,t=[]){return e?(e=l.leftTrim(e,t),e=l.rightTrim(e,t),e):""}static leftTrim(e,t=[]){if(!e)return"";for(t.push(" "),t.push("\r"),t.push(`
2`),t.push("	");e.length>0&&t.indexOf(e[0])!==-1;)e=e.slice(1);return e}static rightTrim(e,t=[]){if(!e)return"";for(t.push(" "),t.push("\r"),t.push(`
3`),t.push("	");e.length>0&&t.indexOf(e[e.length-1])!==-1;)e=e.slice(0,-1);return e}static pureHtmlText(e){return e=e.replace("&nbsp;"," "),e=e.replace("<br>",`
4`),e=e.replace("</br>",`
5`),e=e.replace(/<[^>]*>/g,""),e.replace(" ( )*","")}static isEmail(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(e)}static isPasswordStrength(e){return this.validPasswordRegex().test(e)}static isValidCharacter(e){return this.nationalCodeRegex().test(e)}static isNationalCode(e){return this.nationalCodeRegex().test(e)}static isMobile(e){return this.mobileRegex().test(e)}static isPhone(e){return this.phoneRegex().test(e)}static isPhoneBoghratVersion(e){return this.boghratPhoneRegex().test(e)}static isGUID(e){return this.GUIDRegex().test(e)}static isGUIDValid(e){let t=e.replace("-","");return this.isGUID(e)&&t.match(/0/g)?.length!=32}static validCharsRegex(){return/^[a-zA-Z0-9!@#$%^&*]+$/g}static validPasswordRegex(){return/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]+$/gm}static nationalCodeRegex(){return/^[0-9]{10}$/g}static mobileRegex(){return/^(\+98|0098|0)9\d{9}$/g}static phoneRegex(){return/^0[1-8]{2}[0-9]{8}$/g}static boghratPhoneRegex(){return/^(09|۰۹)[0-9۰-۹]{9}$/g}static uppercaseRegex(){return/[A-Z]/}static lowercaseRegex(){return/[a-z]/}static specialCharRegex(){return/[!@#$%^&*]/}static numberRegex(){return/^\d+$/}static hasNumberRegex(){return/\d/}static min8CharsRegex(){return/^.{8,}$/}static exact6CharsRegex(){return/^.{6}$/}static userNameRegex(){return/^[a-zA-Z0-9]([._](?![._])|[a-zA-Z0-9]){1,18}[a-zA-Z0-9]$/}static phoneNumberRegex(){return/^(\+[0-9]|\+98|0098|0)\d{5,}$/}static zipCodeRegex(){return/^[0-9]{10}$/}static checkLatinCharacterRegex(){return/\d|\w|[\.\$@\*\\\/\+\-\^\!\(\)\[\]\~\%\#\&\=\?\>\<\{\}\"\'\,\:\;\_]/g}static GUIDRegex(){return/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/}static isEmpty(e){for(let t in e)if(Object.hasOwn(e,t))return!1;return!0}static isPersian(e){return/^['+_, ۰-۹0-9!@#$%^&*--")(|/;=،؟.«»؛ء-ی]+$/i.test(e)}static isEnglish(e){return/^[a-zA-Z0-9]*$/i.test(e)}static isNationalCodeV2(e){let t=e,a=!0,r=["0000000000","1111111111","2222222222","3333333333","4444444444","5555555555","6666666666","7777777777","8888888888","9999999999"];if(t===null||t==="")return!1;if((!t||r.some(s=>s==t))&&(a=!1),(t.length!==10||/(\d)(\1){9}/.test(t))&&(a=!1),a){let s=0,i=t.split(""),n,u;for(let c=0;c<9;c++)s+=+i[c]*(10-c);u=s%11,n=u<2?u:11-u,+i[9]===n?a=!0:a=!1}return a}static fileToBase64(e){return g(this,null,function*(){return new Promise((t,a)=>{let r=new FileReader;r.onloadend=()=>{t(r.result)},r.onerror=()=>{a("Error reading file")},r.readAsDataURL(e)})})}static base64ToFile(e,t=this.getRandomString(20)){let a=e.split(","),r=a[0].match(/:(.*?);/)[1],s=atob(a[a.length-1]),i=s.length,n=new Uint8Array(i);for(;i--;)n[i]=s.charCodeAt(i);return new File([n],t,{type:r})}static base64ToBlob(e){let t;e.split(",")[0].indexOf("base64")>=0?t=atob(e.split(",")[1]):t=decodeURIComponent(e.split(",")[1]);let a=e.split(",")[0].split(":")[1].split(";
5")[0],r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return new Blob([r],{type:a})}static latitudeRegex(){return/^-?([0-8]?[0-9]|90)(\.[0-9]{1,10})$/}static longitudeRegex(){return/^-?([0-9]{1,2}|1[0-7][0-9]|180)(\.[0-9]{1,10})$/}static websiteUrlRegex(){return/(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?/g}static isWebsiteValid(e){return this.websiteUrlRegex().test(e)}static isNumberValid(e){return this.numberRegex().test(e)}static getTime(e){return e.split(":")?.length==3?e?.substring(0,e.lastIndexOf(":")):e}static toLowerCaseKeys(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t={};return Object.keys(e).forEach(a=>{let r=a.toLowerCase();t[r]=this.toLowerCaseKeys(e[a])}),t}static IPRegex(){return/(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/}static isIP(e){return this.IPRegex().test(e)}};l.blobToBase64=e=>new Promise((t,a)=>{let r=new FileReader;r.onerror=a,r.onload=()=>{t(r.result)},r.readAsDataURL(e)}),l.uniqueArray=(e,t,a=!0)=>Array.from(e.reduce((r,s)=>{let i=t.map(n=>[s[n],typeof s[n]]).flat().join("-");return a&&r.has(i)?r:r.set(i,s)},new Map).values());let o=l;return o})();export{h as a};

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.