File manager - Edit - /usr/local/cpanel/share/from_npm/node_modules/@cpanel/validators/dist/bundles/cpanel-validators.min.mjs
Back
var t={79:(t,e,r)=>{var a=r(3702),n=r(80),o=r(4739),s=r(8655),i=r(1175);function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}l.prototype.clear=a,l.prototype.delete=n,l.prototype.get=o,l.prototype.has=s,l.prototype.set=i,t.exports=l},80:(t,e,r)=>{var a=r(6025),n=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=a(e,t);return!(r<0||(r==e.length-1?e.pop():n.call(e,r,1),--this.size,0))}},181:t=>{t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},289:(t,e,r)=>{var a=r(2651);t.exports=function(t){return a(this,t).get(t)}},294:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},346:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},361:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var a=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==a||"symbol"!=a&&e.test(t))&&t>-1&&t%1==0&&t<r}},392:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},659:(t,e,r)=>{var a=r(1873),n=Object.prototype,o=n.hasOwnProperty,s=n.toString,i=a?a.toStringTag:void 0;t.exports=function(t){var e=o.call(t,i),r=t[i];try{t[i]=void 0;var a=!0}catch(t){}var n=s.call(t);return a&&(e?t[i]=r:delete t[i]),n}},695:(t,e,r)=>{var a=r(8096),n=r(2428),o=r(6449),s=r(3656),i=r(361),l=r(7167),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),c=!r&&n(t),d=!r&&!c&&s(t),h=!r&&!c&&!d&&l(t),p=r||c||d||h,f=p?a(t.length,String):[],_=f.length;for(var v in t)!e&&!u.call(t,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||i(v,_))||f.push(v);return f}},930:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.cpanelUsernameValidators=void 0;const a=r(1155);class n extends a.BaseValidator{constructor(){super(...arguments),this.prefix="cpanelUsername",this.VALID_USERNAME=/^(?![-.0-9])[a-z0-9]{1,16}$/}cpanelUsername(t){const e=t||this.locale.maketext("This is not a valid username.");return t=>{let r={};return t.value&&!this.VALID_USERNAME.test(t.value)?(r=this.addError(r,"invalidUsername",e),r):null}}}e.cpanelUsernameValidators=new n},999:(t,e,r)=>{var a=r(9302),n=r(6800);t.exports=function(t){return a(function(e,r){var a=-1,o=r.length,s=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,i&&n(r[0],r[1],i)&&(s=o<3?void 0:s,o=1),e=Object(e);++a<o;){var l=r[a];l&&t(e,l,a,s)}return e})}},1033:t=>{t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},1042:(t,e,r)=>{var a=r(6110)(Object,"create");t.exports=a},1155:(t,e)=>{let r;Object.defineProperty(e,"__esModule",{value:!0}),e.BaseValidator=void 0;let a=!0;e.BaseValidator=class{constructor(){this.prefix="",r={maketext:t=>{throw"DEVELOPER: You must specify a locale engine through the static variable BaseValidator.locale = myLocaleEngine"}}}static set locale(t){r=t}get locale(){return r}_buildKey(t){return a?`cpanel.${this.prefix}.${t}`:t}static disablePrefixing(){a=!1}static enablePrefixing(){a=!0}addError(t={},e,r){return"string"==typeof r&&(r={message:r}),t[this._buildKey(e)]=r,t}}},1175:(t,e,r)=>{var a=r(6025);t.exports=function(t,e){var r=this.__data__,n=a(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}},1380:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},1413:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.characterLength=function(t,e){let s=0;for(let i=0;i<t.length;i++){s++;const l=t.charCodeAt(i);if((l&n)===r){if(i++,i===t.length)throw new Error(e.maketext("This string ends with an incomplete [asis,UTF-16] surrogate pair ([_1]).",o(l)));const r=t.charCodeAt(i);if((r&n)!==a)throw new Error(e.maketext("This string contains an invalid [asis,UTF-16] surrogate pair ([join,~, ,_1]) at position [numf,_2].",[l,r].map(o),i))}}return s};const r=55296,a=56320,n=64512;function o(t){return"0x"+t.toString(16)}},1459:t=>{t.exports=function(t){return this.__data__.has(t)}},1549:(t,e,r)=>{var a=r(2032),n=r(3862),o=r(6721),s=r(2749),i=r(5749);function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}l.prototype.clear=a,l.prototype.delete=n,l.prototype.get=o,l.prototype.has=s,l.prototype.set=i,t.exports=l},1791:(t,e,r)=>{var a=r(6547),n=r(3360);t.exports=function(t,e,r,o){var s=!r;r||(r={});for(var i=-1,l=e.length;++i<l;){var u=e[i],c=o?o(r[u],t[u],u,r,t):void 0;void 0===c&&(c=t[u]),s?n(r,u,c):a(r,u,c)}return r}},1811:t=>{var e=Date.now;t.exports=function(t){var r=0,a=0;return function(){var n=e(),o=16-(n-a);if(a=n,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}},1873:(t,e,r)=>{var a=r(9325).Symbol;t.exports=a},1882:(t,e,r)=>{var a=r(2552),n=r(3805);t.exports=function(t){if(!n(t))return!1;var e=a(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1966:function(t,e,r){var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.runValidationGroup=function(t,e){const r={};return e.forEach(e=>{(0,n.default)(r,e(t))}),Object.keys(r).length?r:null};const n=a(r(3346))},2032:(t,e,r)=>{var a=r(1042);t.exports=function(){this.__data__=a?a(null):{},this.size=0}},2428:(t,e,r)=>{var a=r(7534),n=r(346),o=Object.prototype,s=o.hasOwnProperty,i=o.propertyIsEnumerable,l=a(function(){return arguments}())?a:function(t){return n(t)&&s.call(t,"callee")&&!i.call(t,"callee")};t.exports=l},2523:t=>{t.exports=function(t,e,r,a){for(var n=t.length,o=r+(a?1:-1);a?o--:++o<n;)if(e(t[o],o,t))return o;return-1}},2552:(t,e,r)=>{var a=r(1873),n=r(659),o=r(9350),s=a?a.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?n(t):o(t)}},2651:(t,e,r)=>{var a=r(4218);t.exports=function(t,e){var r=t.__data__;return a(e)?r["string"==typeof e?"string":"hash"]:r.map}},2749:(t,e,r)=>{var a=r(1042),n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return a?void 0!==e[t]:n.call(e,t)}},2865:(t,e,r)=>{var a=r(9570),n=r(1811)(a);t.exports=n},2903:(t,e,r)=>{var a=r(3805),n=r(5527),o=r(181),s=Object.prototype.hasOwnProperty;t.exports=function(t){if(!a(t))return o(t);var e=n(t),r=[];for(var i in t)("constructor"!=i||!e&&s.call(t,i))&&r.push(i);return r}},2949:(t,e,r)=>{var a=r(2651);t.exports=function(t,e){var r=a(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}},3040:(t,e,r)=>{var a=r(1549),n=r(79),o=r(8223);t.exports=function(){this.size=0,this.__data__={hash:new a,map:new(o||n),string:new a}}},3243:(t,e,r)=>{var a=r(6110),n=function(){try{var t=a(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=n},3346:(t,e,r)=>{t.exports=r(4664)},3360:(t,e,r)=>{var a=r(3243);t.exports=function(t,e,r){"__proto__"==e&&a?a(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},3375:(t,e,r)=>{var a=r(5765);t.exports=function(t){return t&&t.length?a(t):[]}},3488:t=>{t.exports=function(t){return t}},3656:(t,e,r)=>{t=r.nmd(t);var a=r(9325),n=r(9935),o=e&&!e.nodeType&&e,s=o&&t&&!t.nodeType&&t,i=s&&s.exports===o?a.Buffer:void 0,l=(i?i.isBuffer:void 0)||n;t.exports=l},3661:(t,e,r)=>{var a=r(3040),n=r(7670),o=r(289),s=r(4509),i=r(2949);function l(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}l.prototype.clear=a,l.prototype.delete=n,l.prototype.get=o,l.prototype.has=s,l.prototype.set=i,t.exports=l},3702:t=>{t.exports=function(){this.__data__=[],this.size=0}},3805:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},3814:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.emailValidators=void 0;const a=r(1155);class n extends a.BaseValidator{constructor(){super(...arguments),this.prefix="email",this.VALID_EMAIL=/^(([^<>()\[\]\\.,;:\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,}))$/}validateEmail(t){const e=t||this.locale.maketext("Make sure to use a valid email format. For example, [asis,user@example.com].");return t=>{let r={};return t.value&&!this.VALID_EMAIL.test(t.value)?(r=this.addError(r,"invalidEmail",e),r):null}}}e.emailValidators=new n},3862:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},3896:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.equalityValidators=void 0;const a=r(1155);class n extends a.BaseValidator{constructor(){super(...arguments),this.prefix="equality"}equalTo(t,e,r){return a=>{const n=a.get(e).value;let o={};return n===a.get(r).value&&""!==n?(o=this.addError(o,"equalFields",t),o):null}}}e.equalityValidators=new n},3950:t=>{t.exports=function(){}},4218:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},4247:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}},4509:(t,e,r)=>{var a=r(2651);t.exports=function(t){return a(this,t).has(t)}},4517:(t,e,r)=>{var a=r(6545),n=r(3950),o=r(4247),s=a&&1/o(new a([,-0]))[1]==1/0?function(t){return new a(t)}:n;t.exports=s},4664:(t,e,r)=>{var a=r(1791),n=r(999),o=r(7241),s=n(function(t,e){a(e,o(e),t)});t.exports=s},4739:(t,e,r)=>{var a=r(6025);t.exports=function(t){var e=this.__data__,r=a(e,t);return r<0?void 0:e[r][1]}},4840:(t,e,r)=>{var a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=a},4894:(t,e,r)=>{var a=r(1882),n=r(294);t.exports=function(t){return null!=t&&n(t.length)&&!a(t)}},4901:(t,e,r)=>{var a=r(2552),n=r(294),o=r(346),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&n(t.length)&&!!s[a(t)]}},5083:(t,e,r)=>{var a=r(1882),n=r(7296),o=r(3805),s=r(7473),i=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||n(t))&&(a(t)?h:i).test(s(t))}},5233:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.commonValidators=void 0;const a=r(1155);class n extends a.BaseValidator{constructor(){super(...arguments),this.prefix="common",this.STARTS_WITH_LETTER=/^[a-zA-Z]/,this.CONTAINS_SPACES=/^\S*$/}required(t){const e=t||this.locale.maketext("This field is required.");return t=>{let r={},a=t.value;return a&&(a=a.toString()),a&&a.length?null:(r=this.addError(r,"required",e),r)}}requiredTrue(t){const e=t||this.locale.maketext("This control's value should be true.");return t=>{let r={};return!0!==t.value?(r=this.addError(r,"requiredTrue",e),r):null}}startsWithLetter(t){return e=>{let r={};return e.value&&!this.STARTS_WITH_LETTER.test(e.value)?(r=this.addError(r,"doesNotStartWithLetter",t),r):null}}containsSpaces(t){return e=>{let r={};return e.value&&!this.CONTAINS_SPACES.test(e.value)?(r=this.addError(r,"containsSpace",t),r):null}}minLength(t,e){return r=>{let a={};return r.value&&r.value.length<e?(a=this.addError(a,"minLength",t),a):null}}maxLength(t,e){return r=>{let a={};return r.value&&r.value.length>e?(a=this.addError(a,"maxLength",t),a):null}}min(t,e){return r=>{let a={};return r.value&&r.value<e?(a=this.addError(a,"min",t),a):null}}max(t,e){return r=>{let a={};return r.value&&r.value>e?(a=this.addError(a,"max",t),a):null}}}e.commonValidators=new n},5288:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},5325:(t,e,r)=>{var a=r(6131);t.exports=function(t,e){return!(null==t||!t.length)&&a(t,e,0)>-1}},5463:t=>{t.exports=function(t){return t!=t}},5481:(t,e,r)=>{var a=r(9325)["__core-js_shared__"];t.exports=a},5527:t=>{var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},5613:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringValidators=void 0;const a=r(1155),n=r(1413);class o extends a.BaseValidator{constructor(){super(...arguments),this.prefix="string"}validUnicode(){return t=>{try{(0,n.characterLength)(t,this.locale)}catch(t){const e={};return t instanceof Error&&this.addError(e,"unicode",t.message),e}return null}}maxCharacterLength(t){return(e,r)=>{if((0,n.characterLength)(r,this.locale)>e){const e={};return this.addError(e,"length",t),e}return null}}maxUTF8Length(t){return(e,r)=>{if(function(t){return unescape(encodeURIComponent(t)).length}(r)>e){const e={};return this.addError(e,"length",t),e}return null}}}e.stringValidators=new o},5749:(t,e,r)=>{var a=r(1042);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=a&&void 0===e?"__lodash_hash_undefined__":e,this}},5765:(t,e,r)=>{var a=r(8859),n=r(5325),o=r(9905),s=r(9219),i=r(4517),l=r(4247);t.exports=function(t,e,r){var u=-1,c=n,d=t.length,h=!0,p=[],f=p;if(r)h=!1,c=o;else if(d>=200){var _=e?null:i(t);if(_)return l(_);h=!1,c=s,f=new a}else f=e?[]:p;t:for(;++u<d;){var v=t[u],m=e?e(v):v;if(v=r||0!==v?v:0,h&&m==m){for(var b=f.length;b--;)if(f[b]===m)continue t;e&&f.push(m),p.push(v)}else c(f,m,r)||(f!==p&&f.push(m),p.push(v))}return p}},6009:(t,e,r)=>{t=r.nmd(t);var a=r(4840),n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,s=o&&o.exports===n&&a.process,i=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=i},6025:(t,e,r)=>{var a=r(5288);t.exports=function(t,e){for(var r=t.length;r--;)if(a(t[r][0],e))return r;return-1}},6110:(t,e,r)=>{var a=r(5083),n=r(392);t.exports=function(t,e){var r=n(t,e);return a(r)?r:void 0}},6131:(t,e,r)=>{var a=r(2523),n=r(5463),o=r(6959);t.exports=function(t,e,r){return e==e?o(t,e,r):a(t,n,r)}},6449:t=>{var e=Array.isArray;t.exports=e},6545:(t,e,r)=>{var a=r(6110)(r(9325),"Set");t.exports=a},6547:(t,e,r)=>{var a=r(3360),n=r(5288),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var s=t[e];o.call(t,e)&&n(s,r)&&(void 0!==r||e in t)||a(t,e,r)}},6672:function(t,e,r){var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.domainValidators=void 0;const n=r(1966),o=a(r(8379)),s=a(r(3375)),i=r(1155);class l extends i.BaseValidator{constructor(){super(...arguments),this.prefix="domains",this.VALID_TLD_REGEX=/^[.][a-zA-Z0-9]+$/,this.VALID_IDN_TLD_REGEX=/^[.]xn--[a-zA-Z0-9-]+$/,this.MAX_DOMAIN_BYTES=254,this.MAX_LABEL_BYTES=63,this.UNICODE_ASCII_CUTOFF=127,this.NONINITIAL_LABEL_REGEX=/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/,this.IPv4_REGEX=/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/,this.IPv6_REGEX=/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/}_getNonASCII(t){const e=[],r=o.default.ucs2.decode(t);for(let t=0;t<r.length;t++)r[t]>this.UNICODE_ASCII_CUTOFF&&e.push(o.default.ucs2.encode([r[t]]));return(0,s.default)(e)}_validateLabelBasics(){return t=>{let e={};if(t.value&&0!==t.value.length){if(t.value.length>this.MAX_LABEL_BYTES)e=this.addError(e,"length",{message:this.locale.maketext("A label must not exceed [quant,_1,character,characters].",this.MAX_LABEL_BYTES),MAX_LABEL_BYTES:this.MAX_LABEL_BYTES});else if("-"===t.value[0])e=this.addError(e,"charCondition",this.locale.maketext("A label must not begin with “[_1]”.","-"));else if("-"===t.value[t.value.length-1])e=this.addError(e,"charCondition",this.locale.maketext("A label must not end with “[_1]”.","-"));else if(o.default.toASCII(t.value).length>this.MAX_LABEL_BYTES){const r=this._getNonASCII(t.value);e=this.addError(e,"length",this.locale.maketext("The label’s [asis,Punycode] representation cannot exceed [quant,_1,byte,bytes]. (Non-[asis,ASCII] characters, like “[_2]”, require multiple characters to represent in [asis,Punycode].)",this.MAX_LABEL_BYTES,r[0]))}}else e=this.addError(e,"length",this.locale.maketext("A label must not be empty."));return e}}validDomainLength(){return t=>{let e={};if(t.value.length>this.MAX_DOMAIN_BYTES)return e=this.addError(e,"length",this.locale.maketext("The domain name cannot exceed [quant,_1,character,characters].",this.MAX_DOMAIN_BYTES)),e;if(o.default.toASCII(t.value).length>this.MAX_DOMAIN_BYTES){const r=this._getNonASCII(t.value);return e=this.addError(e,"length",this.locale.maketext("The domain name’s [asis,Punycode] representation cannot exceed [quant,_1,character,characters]. (Non-[asis,ASCII] characters, like “[_2]”, require multiple characters to represent in [asis,Punycode].)",this.MAX_DOMAIN_BYTES,r[0])),e}return null}}validateLabel(){return t=>(0,n.runValidationGroup)(t,[this._validateLabelBasics(),t=>{let e={};return this.NONINITIAL_LABEL_REGEX.test(t.value)||(e=this.addError(e,"charCondition",this.locale.maketext("The label must contain only the following characters: [list_and,_1].",["a-z","A-Z","0-9","-"]))),e}])}validateTLD(){return t=>{let e={};return this.VALID_TLD_REGEX.test(t.value)||this.VALID_IDN_TLD_REGEX.test(t.value)||(e=this.addError(e,"tld",this.locale.maketext("The domain name must include a valid [output,acronym,TLD,Top Level Domain]."))),e}}fqdn(){return t=>{const e=t.value.split("."),r=e[e.length-1],a=e[0],o=t.value,s=[()=>{let t={};const r=this.IPv4_REGEX.test(o),a=this.IPv6_REGEX.test(o);return r||a?this.addError(t,"ipAddr",this.locale.maketext("You [output,strong,must] enter a hostname.")):e.length<2?this.addError(t,"oneDomain",this.locale.maketext("The domain name must include at least two labels.")):null},this.validDomainLength(),this.validateLabel().bind(this,{value:a}),this.validateTLD().bind(this,{value:"."+r})];return e.forEach(t=>{s.push(this.validateLabel().bind(this,{value:t}))}),(0,n.runValidationGroup)(t,s)}}fqdnOrIP(){return t=>{const e=(0,n.runValidationGroup)(t,[this.anyIP()]),r=t.value.split("."),a=r[r.length-1],o=r[0],s=[t=>{let e={};return r.length<2&&(e=this.addError(e,"oneDomain",this.locale.maketext("The domain name must include at least two labels."))),e},this.validDomainLength(),this.validateLabel().bind(this,{value:o}),this.validateTLD().bind(this,{value:"."+a})];r.forEach(t=>{s.push(this.validateLabel().bind(this,{value:t}))});const i=(0,n.runValidationGroup)(t,s);return e&&i?{...e,...i}:null}}ipv4(){return t=>{let e={};return t.value&&!this.IPv4_REGEX.test(t.value)?(e=this.addError(e,"ipv4",this.locale.maketext("Invalid [asis,IPv4] compatible address.")),e):null}}ipv6(){return t=>{let e={};return t.value&&!this.IPv6_REGEX.test(t.value)?(e=this.addError(e,"ipv6",this.locale.maketext("Invalid [asis,IPv6] compatible address.")),e):null}}anyIP(){return t=>{let e={};return!t.value||this.IPv4_REGEX.test(t.value)||this.IPv6_REGEX.test(t.value)?null:(e=this.addError(e,"anyIP",this.locale.maketext("Invalid [asis,IPv4] or [asis,IPv6] compatible address.")),e)}}}e.domainValidators=new l},6721:(t,e,r)=>{var a=r(1042),n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(a){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return n.call(e,t)?e[t]:void 0}},6757:(t,e,r)=>{var a=r(1033),n=Math.max;t.exports=function(t,e,r){return e=n(void 0===e?t.length-1:e,0),function(){for(var o=arguments,s=-1,i=n(o.length-e,0),l=Array(i);++s<i;)l[s]=o[e+s];s=-1;for(var u=Array(e+1);++s<e;)u[s]=o[s];return u[e]=r(l),a(t,this,u)}}},6800:(t,e,r)=>{var a=r(5288),n=r(4894),o=r(361),s=r(3805);t.exports=function(t,e,r){if(!s(r))return!1;var i=typeof e;return!!("number"==i?n(r)&&o(e,r.length):"string"==i&&e in r)&&a(r[e],t)}},6959:t=>{t.exports=function(t,e,r){for(var a=r-1,n=t.length;++a<n;)if(t[a]===e)return a;return-1}},7118:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseType=void 0,function(t){t.MySQL="MySQL",t.PostgreSQL="PostgreSQL"}(r||(e.DatabaseType=r={}))},7167:(t,e,r)=>{var a=r(4901),n=r(7301),o=r(6009),s=o&&o.isTypedArray,i=s?n(s):a;t.exports=i},7241:(t,e,r)=>{var a=r(695),n=r(2903),o=r(4894);t.exports=function(t){return o(t)?a(t,!0):n(t)}},7296:(t,e,r)=>{var a,n=r(5481),o=(a=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"";t.exports=function(t){return!!o&&o in t}},7301:t=>{t.exports=function(t){return function(e){return t(e)}}},7334:t=>{t.exports=function(t){return function(){return t}}},7473:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},7534:(t,e,r)=>{var a=r(2552),n=r(346);t.exports=function(t){return n(t)&&"[object Arguments]"==a(t)}},7670:(t,e,r)=>{var a=r(2651);t.exports=function(t){var e=a(this,t).delete(t);return this.size-=e?1:0,e}},8096:t=>{t.exports=function(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}},8223:(t,e,r)=>{var a=r(6110)(r(9325),"Map");t.exports=a},8379:(t,e,r)=>{r.r(e),r.d(e,{decode:()=>b,default:()=>A,encode:()=>y,toASCII:()=>x,toUnicode:()=>g,ucs2decode:()=>p,ucs2encode:()=>f});const a=2147483647,n=36,o=/^xn--/,s=/[^\0-\x7F]/,i=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},u=Math.floor,c=String.fromCharCode;function d(t){throw new RangeError(l[t])}function h(t,e){const r=t.split("@");let a="";r.length>1&&(a=r[0]+"@",t=r[1]);const n=function(t,e){const r=[];let a=t.length;for(;a--;)r[a]=e(t[a]);return r}((t=t.replace(i,".")).split("."),e).join(".");return a+n}function p(t){const e=[];let r=0;const a=t.length;for(;r<a;){const n=t.charCodeAt(r++);if(n>=55296&&n<=56319&&r<a){const a=t.charCodeAt(r++);56320==(64512&a)?e.push(((1023&n)<<10)+(1023&a)+65536):(e.push(n),r--)}else e.push(n)}return e}const f=t=>String.fromCodePoint(...t),_=function(t){return t>=48&&t<58?t-48+26:t>=65&&t<91?t-65:t>=97&&t<123?t-97:n},v=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},m=function(t,e,r){let a=0;for(t=r?u(t/700):t>>1,t+=u(t/e);t>455;a+=n)t=u(t/35);return u(a+36*t/(t+38))},b=function(t){const e=[],r=t.length;let o=0,s=128,i=72,l=t.lastIndexOf("-");l<0&&(l=0);for(let r=0;r<l;++r)t.charCodeAt(r)>=128&&d("not-basic"),e.push(t.charCodeAt(r));for(let c=l>0?l+1:0;c<r;){const l=o;for(let e=1,s=n;;s+=n){c>=r&&d("invalid-input");const l=_(t.charCodeAt(c++));l>=n&&d("invalid-input"),l>u((a-o)/e)&&d("overflow"),o+=l*e;const h=s<=i?1:s>=i+26?26:s-i;if(l<h)break;const p=n-h;e>u(a/p)&&d("overflow"),e*=p}const h=e.length+1;i=m(o-l,h,0==l),u(o/h)>a-s&&d("overflow"),s+=u(o/h),o%=h,e.splice(o++,0,s)}return String.fromCodePoint(...e)},y=function(t){const e=[],r=(t=p(t)).length;let o=128,s=0,i=72;for(const r of t)r<128&&e.push(c(r));const l=e.length;let h=l;for(l&&e.push("-");h<r;){let r=a;for(const e of t)e>=o&&e<r&&(r=e);const p=h+1;r-o>u((a-s)/p)&&d("overflow"),s+=(r-o)*p,o=r;for(const r of t)if(r<o&&++s>a&&d("overflow"),r===o){let t=s;for(let r=n;;r+=n){const a=r<=i?1:r>=i+26?26:r-i;if(t<a)break;const o=t-a,s=n-a;e.push(c(v(a+o%s,0))),t=u(o/s)}e.push(c(v(t,0))),i=m(s,p,h===l),s=0,++h}++s,++o}return e.join("")},g=function(t){return h(t,function(t){return o.test(t)?b(t.slice(4).toLowerCase()):t})},x=function(t){return h(t,function(t){return s.test(t)?"xn--"+y(t):t})},A={version:"2.3.1",ucs2:{decode:p,encode:f},decode:b,encode:y,toASCII:x,toUnicode:g}},8655:(t,e,r)=>{var a=r(6025);t.exports=function(t){return a(this.__data__,t)>-1}},8859:(t,e,r)=>{var a=r(3661),n=r(1380),o=r(1459);function s(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new a;++e<r;)this.add(t[e])}s.prototype.add=s.prototype.push=n,s.prototype.has=o,t.exports=s},9037:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.databaseValidators=void 0;const a=r(1155),n=r(7118);class o extends a.BaseValidator{constructor(){super(...arguments),this.prefix="databases",this._dbPrefix="",this.DATABASE_NAME_LENGTH_LIMIT=64,this.ANYTHING_BUT_PRINTABLE_7_BIT_ASCII=/[^\u0020-\u007e]/,this.MYSQL_DB_NAME_INVALID_CHARACTERS=/[`'"\/\\]/,this.MYSQL_DB_NAME_INVALID_CHARACTERS_LIST=["'",'"',"`","/","\\"],this.MYSQL_DB_NAME_WILDCARDS=/(_|%|\\)/g,this.MYSQL_STARTED_ALLOWING_FILESYS_CHARACTERS=50116,this.MYSQL_STARTED_ALLOWING_LONG_USERNAMES=1e5}get dbPrefix(){return this._dbPrefix}validateDatabaseName(t,e,r){return a=>t===n.DatabaseType.MySQL?(this._dbPrefix=e||"",this.validateMySQLDatabaseName(a.value,r||"")):null}validateMySQLDatabaseName(t,e){const r=this._performMySqlDatabaseNameValidation(t,e);let a={};return r?(a=this.addError(a,"databaseName",r),a):null}_performMySqlDatabaseNameValidation(t,e){let r=null;return r=this._verifyNameLengthLimit(t),null!==r||(r=this._verifyDatabaseNameIgnoreLength(t),null!==r||(r=this._verifyDatabaseName(t,e))),r}_verifyNameLengthLimit(t){let e=null,r=this.DATABASE_NAME_LENGTH_LIMIT;this._dbPrefix&&(r-=this._dbPrefix.length+1);const a=unescape(encodeURIComponent(t)).length-r;return a>0&&(e={message:this.locale.maketext("This value is too long by [quant,_1,character,characters]. The maximum length is [quant,_2,character,characters].",a,r)}),e}_verifyDatabaseNameIgnoreLength(t){return this.ANYTHING_BUT_PRINTABLE_7_BIT_ASCII.test(t)?{message:this.locale.maketext("This system allows only printable [asis,ASCII] characters in database names.")}:this.MYSQL_DB_NAME_INVALID_CHARACTERS.test(t)?{message:this.locale.maketext("This system prohibits the following [numerate,_1,character,characters] in database names: [list_or,_2]",3,this.MYSQL_DB_NAME_INVALID_CHARACTERS_LIST)}:null}_verifyDatabaseName(t,e){if(null!==t&&t.endsWith(" "))return{message:this.locale.maketext("A [asis,MariaDB]/[asis,MySQL] database name cannot end with a space character.")};const r=this._verifySpecialWildcardsInDatabaseNames(t);return null!==r?r:e&&this._convertVersionStringToNumber(e)<this.MYSQL_STARTED_ALLOWING_FILESYS_CHARACTERS&&/\./.test(t)?{message:this.locale.maketext("This system’s [asis,MySQL] version ([_1]) prohibits the character “[_2]” in database names. Ask your administrator to upgrade to a [asis,MariaDB] or to a newer [asis,MySQL] version.",e,".")}:null}_convertVersionStringToNumber(t){return t.match(/mariadb/i)&&(t=t.replace(/^[^-]+-/,"")),parseInt(t.replace(/-.*/,"").split(/\./).map(function(t){return t.padStart(2,"0")}).join(""),10)}_verifySpecialWildcardsInDatabaseNames(t){if(null===t)return null;const e=t.replace(this.MYSQL_DB_NAME_WILDCARDS,"\\$1").length;let r=this.DATABASE_NAME_LENGTH_LIMIT;this._dbPrefix&&(r-=this._dbPrefix.length+1);const a=e-r;return a>0?{message:this.locale.maketext("This database name has too many wildcard-sensitive characters ([list_and_quoted,_1]). The system stores each of these as two characters internally, up to a limit of [quant,_2,character,characters]. This name would take up [quant,_3,character,characters] of internal storage, which is [numf,_4] too many.",["\\","_","%"],r,e,a)}:null}}e.databaseValidators=new o},9219:t=>{t.exports=function(t,e){return t.has(e)}},9302:(t,e,r)=>{var a=r(3488),n=r(6757),o=r(2865);t.exports=function(t,e){return o(n(t,e,a),t+"")}},9325:(t,e,r)=>{var a=r(4840),n="object"==typeof self&&self&&self.Object===Object&&self,o=a||n||Function("return this")();t.exports=o},9350:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},9420:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.cPUserNoteValidators=void 0;const a=r(1155),n=r(5613),o=/[^ \n\P{White_Space}]|[^ \n\P{Control}]|[^ \P{Separator}]/u;class s extends a.BaseValidator{constructor(){super(...arguments),this.prefix="note"}validate(t=250,e=""){return e=>{let r=n.stringValidators.validUnicode()(e);if(!r){const a=this.locale.maketext("This note is too long.");r=n.stringValidators.maxCharacterLength(a)(t,e)}if(!r){const t=e.match(o);if(t){r={};const e=t.index,a=t[0].codePointAt(0);this.addError(r,"character",this.locale.maketext("[asis,Unicode] character [numf,_1] (position [numf,_2]) is forbidden.",a,1+e))}}return r}}}e.cPUserNoteValidators=new s},9570:(t,e,r)=>{var a=r(7334),n=r(3243),o=r(3488),s=n?function(t,e){return n(t,"toString",{configurable:!0,enumerable:!1,value:a(e),writable:!0})}:o;t.exports=s},9905:t=>{t.exports=function(t,e,r){for(var a=-1,n=null==t?0:t.length;++a<n;)if(r(e,t[a]))return!0;return!1}},9935:t=>{t.exports=function(){return!1}}},e={};function r(a){var n=e[a];if(void 0!==n)return n.exports;var o=e[a]={id:a,loaded:!1,exports:{}};return t[a].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.d=(t,e)=>{for(var a in e)r.o(e,a)&&!r.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var a={};(()=>{var t=a;Object.defineProperty(t,"__esModule",{value:!0}),t.BaseValidator=t.DatabaseType=t.stringValidators=t.cPUserNoteValidators=t.equalityValidators=t.emailValidators=t.cpanelUsernameValidators=t.databaseValidators=t.commonValidators=t.domainValidators=void 0;const e=r(5233);Object.defineProperty(t,"commonValidators",{enumerable:!0,get:function(){return e.commonValidators}});const n=r(6672);Object.defineProperty(t,"domainValidators",{enumerable:!0,get:function(){return n.domainValidators}});const o=r(1155);Object.defineProperty(t,"BaseValidator",{enumerable:!0,get:function(){return o.BaseValidator}});const s=r(9037);Object.defineProperty(t,"databaseValidators",{enumerable:!0,get:function(){return s.databaseValidators}});const i=r(7118);Object.defineProperty(t,"DatabaseType",{enumerable:!0,get:function(){return i.DatabaseType}});const l=r(930);Object.defineProperty(t,"cpanelUsernameValidators",{enumerable:!0,get:function(){return l.cpanelUsernameValidators}});const u=r(3814);Object.defineProperty(t,"emailValidators",{enumerable:!0,get:function(){return u.emailValidators}});const c=r(3896);Object.defineProperty(t,"equalityValidators",{enumerable:!0,get:function(){return c.equalityValidators}});const d=r(9420);Object.defineProperty(t,"cPUserNoteValidators",{enumerable:!0,get:function(){return d.cPUserNoteValidators}});const h=r(5613);Object.defineProperty(t,"stringValidators",{enumerable:!0,get:function(){return h.stringValidators}})})();const n=a.BaseValidator,o=a.DatabaseType,s=a.__esModule,i=a.cPUserNoteValidators,l=a.commonValidators,u=a.cpanelUsernameValidators,c=a.databaseValidators,d=a.domainValidators,h=a.emailValidators,p=a.equalityValidators,f=a.stringValidators;export{n as BaseValidator,o as DatabaseType,s as __esModule,i as cPUserNoteValidators,l as commonValidators,u as cpanelUsernameValidators,c as databaseValidators,d as domainValidators,h as emailValidators,p as equalityValidators,f as stringValidators,a as default};
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings