reslib 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  %{failedRulesErrors}`,oneOf:`The field %{fieldName} must match at least one of the following validation rules:
3
3
  %{failedRulesErrors}`,allOf:`The field %{fieldName} must match all of the following validation rules:
4
4
  %{failedRulesErrors}`,validateNested:`The field %{fieldName} must be a valid nested object. Errors:
5
- %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var xt={auth:Ze,currencies:Je,countries:We,dates:Qe,resources:qe,validator:Xe};function Nt(r){return typeof r=="boolean"||!r||typeof r=="number"||typeof r=="string"||typeof r=="symbol"?false:Object(r).constructor===Promise||r.constructor&&(r.constructor.name==="Promise"||r.constructor.name==="AsyncFunction")||r instanceof Promise||typeof(r==null?void 0:r.then)=="function"&&typeof(r==null?void 0:r.catch)=="function"&&typeof(r==null?void 0:r.finally)=="function"?true:r&&typeof r.constructor=="function"&&Function.prototype.toString.call(r.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function Ne(r){return r&&Object.prototype.toString.call(r)==="[object Promise]"?true:Nt(r)}function _e(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var ye=()=>{var r;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((r=process==null?void 0:process.versions)!=null&&r.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},At=()=>{var r,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((r=window==null?void 0:window.process)==null?void 0:r.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Pt=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(r){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},wt=()=>typeof window=="undefined"&&typeof process!="undefined",et=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Et=()=>{if(!_e()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let r=navigator.userAgent.toLowerCase();return /android/i.test(r)},Ot=()=>{var r;return !et()||!(window!=null&&window.ReactNativeWebView)?false:typeof((r=window==null?void 0:window.ReactNativeWebView)==null?void 0:r.postMessage)=="function"},Vt=()=>ye()&&process.platform==="darwin",kt=()=>ye()&&process.platform==="win32",It=()=>ye()&&process.platform==="linux",tt={isWeb:_e,isLinux:It,isDarwin:Vt,isWin32:kt,isNode:ye,isElectron:At,isTouchDevice:Pt,isServerSide:wt,isClientSide:et,isAndroidMobileBrowser:Et,isReactNativeWebview:Ot};function u(r){return !!(r&&typeof r=="string")}var K=class r{static decycle(e,t=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(t.includes(e))return null;let a=t.concat([e]);return Array.isArray(e)?e.map(n=>r.decycle(n,a)):Object.fromEntries(Object.entries(e).map(([n,i])=>[n,r.decycle(i,a)]))}static stringify(e,t=false,a,n){return typeof e=="string"?e:JSON.stringify(t!==false?r.decycle(e):e,a,n)}static isJSON(e){if(typeof e!="string")return false;let t=e.trim();if(t.length===0)return false;let a=t[0];if(a!=="{"&&a!=="[")return false;try{let n=JSON.parse(t);return n!==null&&typeof n=="object"}catch(n){return false}}static parse(e,t){if(typeof e=="string")try{e=JSON.parse(e,t);}catch(a){return e}if(e&&typeof e=="object")for(let a in e){let n=e[a];r.isJSON(n)&&(e[a]=r.parse(n,t));}return e}};var Q=class Q{static get storage(){var t;let e=Reflect.getMetadata(Q.sessionStorageMetaData,Q);if(Ae(e)&&(this._storage=e),this._storage)return this._storage;if(tt.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.getItem))this._storage={get:a=>window.localStorage.getItem(a),set:(a,n)=>window.localStorage.setItem(a,n),remove:a=>window.localStorage.removeItem(a),removeAll:()=>window.localStorage.clear()};else {let a={};this._storage={get:n=>a[n],set:(n,i)=>a[n]=i,remove:n=>{delete a[n];},removeAll:()=>a={}};}return this._storage}static set storage(e){Ae(e)&&Reflect.defineMetadata(Q.sessionStorageMetaData,e,Q);}static get keyNamespace(){return u(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){u(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!u(e))return "";e=e.trim().replace(/\s+/g,"-");let t=this.keyNamespace;return t?`${t}-${e}`:e}};Q.sessionStorageMetaData=Symbol("sessionStorage"),Q._keyNamespace=void 0;var $=Q;function ge(r){return $.sanitizeKey(r)}var rt=(r,e)=>(r=r&&K.stringify(r,e),r==null&&(r=""),r),at=r=>{if(Ne(r))return new Promise((e,t)=>{r.then(a=>{e(K.parse(a));}).catch(a=>{t(a);});});if(r!=null)return K.parse(r)},Yt=r=>{if(r=ge(r),$.storage&&r&&typeof r=="string"){let e=$.storage.get(r);return at(e)}},Lt=r=>{if(r=ge(r),$.storage&&r&&typeof r=="string")return $.storage.remove(r)},Ft=()=>{if($.storage)return $.storage.removeAll()},Ae=r=>{if(!r)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof r[e]=="function")}catch(e){return false}},L={get:Yt,set:(r,e,t=true)=>(r=ge(r),$.storage.set(r,rt(e,t))),remove:Lt,handleGetValue:at,sanitizeKey:ge,handleSetValue:rt,isValidStorage:Ae,Manager:$,removeAll:Ft};function f(...r){for(var e in r){let t=r[e];if(u(t))return t}return ""}function q(r){return r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function ae(r){if(r instanceof RegExp)return true;if(!r||typeof r!="object"||!Object.prototype.toString.call(r).includes("RegExp"))return false;try{return new RegExp(r),!0}catch(e){return false}}function le(r){return !r||typeof r!="object"?false:r instanceof Date?true:typeof r.getTime!="function"?false:!(Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))}function Pe(r){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:r===document?true:"HTMLElement"in window?!!r&&r instanceof HTMLElement:!!r&&typeof r=="object"&&r.nodeType===1&&!!r.nodeName}function D(r){if(r===null||typeof r!="object"||Pe(r)||le(r)||ae(r)||q(r))return false;let e=Object.getPrototypeOf(r);if(e===null)return true;let t=e.constructor;if(typeof t!="function")return false;if(t===Object)return true;let a=t.prototype;return typeof a!="object"?false:a===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function we(r){if(Array.isArray(r)){let a=[];for(var e=0;e<r.length;e++)a[e]=we(r[e]);return a}else if(D(r)&&r){let a={};for(var t in r)r.hasOwnProperty(t)&&(a[t]=we(r[t]));return a}else return r}Object.getSize=function(r,e=false){if(!r||typeof r!="object")return 0;if(Array.isArray(r))return r.length;typeof e!="boolean"&&(e=false);let t=0;for(let a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&(t++,e===true))return t;return t};function ne(r,...e){let t=Array.isArray(r),a=D(r);(r==null||!t&&!a)&&(r={});for(let n=0;n<e.length;n++){let i=e[n];if(i==null)continue;let o=D(i),s=Array.isArray(i);if(!(!o&&!s)){if(t){s&&nt(r,i);continue}else if(s)continue;for(let l in i){let d=i[l];if(d==null)continue;if(d===i){r[l]=r;continue}let m=r[l],g=Array.isArray(m),y=Array.isArray(d);if(g){y?nt(r[l],d):r[l]=d;continue}else if(!D(m)){r[l]=d;continue}if(y||!D(d)){r[l]=d;continue}r[l]=ne({},m,d);}}}return r}var nt=(r,e)=>{let t=e.length,a=0;for(let n=0;n<r.length;n++){let i=r[n],o=e[n];if(n<t){let s=Array.isArray(i),l=Array.isArray(o),d=D(i),m=D(o);s&&l||d&&m?(r[a]=ne(s?[]:{},i,o),a++):o!=null?(r[a]=o,a++):i!=null&&(r[a]=i,a++);}}for(let n=r.length;n<t;n++)e[n]!==void 0&&e[n]!==null&&r.push(e[n]);return r};function be(r,e){return pe(r,"",{},e)}function pe(r,e="",t={},a){if(t=D(t)?t:{},q(r)||le(r)||ae(r)||Array.isArray(r)&&(a!=null&&a.skipArrays))return e&&(t[e]=r),t;if(typeof r=="function"||typeof r=="object"&&!D(r)&&!Bt(r))return t;if(r instanceof Map||r instanceof WeakMap)return Array.from(r.entries()).forEach(([n,i])=>{let o=e?`${e}[${String(n)}]`:String(n);pe(i,o,t,a);}),t;if(Array.isArray(r)||r instanceof Set||r instanceof WeakSet)return (Array.isArray(r)?r:Array.from(r)).forEach((i,o)=>{let s=e?`${e}[${o}]`:String(o);pe(i,s,t,a);}),t;if(D(r))for(let n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;let i=r[n],o=e?e.endsWith("]")?`${e}.${n}`:`${e}.${n}`:n;pe(i,o,t,a);}return t}function Bt(r){return Array.isArray(r)||r instanceof Set||r instanceof Map||r instanceof WeakMap||r instanceof WeakSet}function Ut(r){return Object.entries(r)}Object.typedEntries=Ut;Object.flatten=be;Object.clone=we;function ue(r,e){if(r==null)return "";if(typeof r=="string")return r;if((typeof r=="number"||typeof r=="object"&&r instanceof Number)&&typeof r.formatNumber=="function")return r.formatNumber();if(r instanceof Date||typeof r=="object"&&r!==null&&r.constructor===Date)return typeof r.toFormat=="function"?r.toFormat():r.toISOString();if(r instanceof Error)return `Error: ${r.message}`;if(ae(r))return r.toString();if(q(r))return String(r);if(Array.isArray(r))return JSON.stringify(r);if(typeof r=="object"&&r!==null){if(typeof r.toString=="function"&&r.toString!==Object.prototype.toString)return r.toString();if(typeof r.toString=="function"){let t=r.toString();if(t!=="[object Object]")return t}return JSON.stringify(r)}return typeof(r==null?void 0:r.toString)=="function"?r.toString():String(r)}function it(r,e,t){let a=(t==null?void 0:t.valueFormatter)||ue,n=f(r);if(!D(e)||!e)return n;let i=(t==null?void 0:t.tagRegex)||/%\{([^}]+)\}/g,o=new Set,s,l=f(r);for(;(s=i.exec(l))!==null;){let d=s[1];d!==void 0&&o.add(d);}return o.forEach(d=>{if(t!=null&&t.tagRegex){let C=new RegExp(t.tagRegex.source,t.tagRegex.flags);[...l.matchAll(C)].forEach(x=>{let O=x[0];if(!x[1])return;let N=x[1],T=Object.prototype.hasOwnProperty.call(e,N)?e[N]:void 0,P=T===void 0?"":(()=>{try{return a(T,N,ue)}catch(k){return ue(T)}})(),E=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(E,"g"),P);});return}let m=`%{${d}}`,g=Object.prototype.hasOwnProperty.call(e,d)?e[d]:void 0,y=g===void 0?"":(()=>{try{return a(g,d,ue)}catch(C){return ue(g)}})(),M=m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(M,"g"),y);}),n}function w(r){return typeof r=="number"&&!isNaN(r)&&isFinite(r)}var F=class F{constructor(e={},t={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;u(t.locale)&&(this.locale=t.locale),u(t.fallbackLocale)&&(this._fallbackLocale=t.fallbackLocale),typeof t.interpolate=="function"&&(this.interpolateFunc=t.interpolate),this._hasDefaultTranslations||(this.registerTranslations(xe),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!F.instance){let t=F.getLocaleFromSession(),a=Object.assign({locale:t||"en"},e);F.instance=new F({},a);}return F.instance}static createInstance(e={},t={}){return new F(e,t)}static flattenObject(e){return D(e)?be(e):e}static getLocaleFromSession(){let e=L.get("i18n.locale");return u(e)?e:void 0}static registerMomentLocale(e,t){return u(e)&&D(t)&&Array.isArray(t.months)&&(this.momentLocales[e]=ne({},this.momentLocales[e],t)),this.momentLocales}static getClassTanslationKeys(e){return fe(e,ot)}translate(e,t){var o;t=t||{};let a=f(t==null?void 0:t.locale,this.getLocale()),n=Array.isArray(e)?e:[e],i;for(let s of n){if(!u(s))continue;let l=this.lookup(s,a);if(l===void 0&&a!==this._fallbackLocale&&(l=this.lookup(s,this._fallbackLocale)),l!==void 0){i=l;break}}if(i===void 0)return t.defaultValue!==void 0?t.defaultValue:this.missingTranslation(e,t);if(typeof t.count=="number"&&D(i)){let s=t.count,l="other";s===0&&i.zero!==void 0?l="zero":s===1&&i.one!==void 0&&(l="one"),i[l]!==void 0?i=i[l]:i.other&&(i=i.other);}return typeof i=="string"&&(w(t.count)&&!t.countStr&&(t.countStr=typeof((o=t.count)==null?void 0:o.formatNumber)=="function"?t.count.formatNumber():t.count.toString()),i=this.performInterpolation(i,t)),i}t(e,t){return this.translate(e,t)}has(e,t){let a=t||this.getLocale(),n=Array.isArray(e)?e:[e];for(let i of n)if(this.lookup(i,a)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,t=false){return A(this,null,function*(){return this.locale===e&&t!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&F.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),t=Array.isArray(this._locales)?this._locales:["en"],a=[...e,...t.filter(n=>!e.includes(n))];return Array.from(new Set(a))}hasLocale(e){return u(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===F.instance}registerTranslations(e){return this._translations=ne({},this._translations,e),this._translations}getTranslations(e){return u(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,t){if(!u(e)||typeof t!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=t;}loadNamespace(e,t,a=true){return !u(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(t=f(t,this.getLocale()),u(t)?this.namespaceResolvers[e](t).then(n=>{let i={};return i[t]=Object.assign({},n),D(n)&&a!==false&&this.registerTranslations(i),i}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,t=true){return A(this,null,function*(){e=f(e,this.getLocale());let a=[],n={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&a.push(this.namespaceResolvers[o](e).then(s=>{ne(n,s);}));yield Promise.all(a);let i={};return i[e]=n,t!==false&&this.registerTranslations(i),this._namespacesLoaded[e]=true,i})}get(e,t){t=f(t,this.getLocale());let a=(u(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(u);if(!a.length)return;let n=this.getTranslations(t);for(let i of a)if(D(n))n=n[i];else return;return n}translateClass(e,t){let a=F.getClassTanslationKeys(e);for(let n in a)u(a[n])&&(a[n]=this.translate(a[n],t));return a}translateObject(e,t){if(!D(e))return {};let a={};for(let n in e){let i=e[n];u(i)&&(a[n]=this.translate(i,t));}return a}applyTranslations(e){try{let t=Object.getOwnPropertyNames(e);for(let a of t){let n=Reflect.getMetadata(ot,e,a);if(n)try{e[a]=this.translate(n);}catch(i){H.error(i," resolving translation for key : ",n," on object : ",e);}}}catch(t){H.error(t," resolving translations for object : ",e);}}missingTranslation(e,t){let a=f(Array.isArray(e)?e.filter(u)[0]:f(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,a,f(t==null?void 0:t.defaultValue),t):a}lookup(e,t){let a=this._translations[t];if(!a)return;if(Object.prototype.hasOwnProperty.call(a,e))return a[e];let n=e.split("."),i=a;for(let o of n)if(D(i)&&Object.prototype.hasOwnProperty.call(i,o))i=i[o];else return;return i}performInterpolation(e,t){let a=be(t);return this.interpolateFunc?this.interpolateFunc(this,e,t):this.defaultInterpolator(e,a)}defaultInterpolator(e,t){return it(e,t,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){L.set("i18n.locale",e);}getMomentLocale(e){return F.momentLocales[e]}setMomentLocale(e){try{return ee__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(t){console.error(t," setting moment locale : ",e);}return false}};F.momentLocales={};var X=F,he=X.getInstance();var ot=Symbol("TRANSLATION_KEY");function ie(r){return !!(r==null||typeof r=="undefined"||typeof r=="string"&&r===""||Array.isArray(r)&&!r.length)}var S=class S{static parseString(e,t){if(u(e)&&u(t))try{let a=ee__default.default(e,t,!0);if(a.isValid())return {date:a.toDate(),matchedFormat:t,isValid:!0}}catch(a){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let a of t){let n=st(e,a);if(n)return n}for(let a of S.DATE_FORMATS){let n=st(e,a);if(n)return n}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(a){return {date:null,matchedFormat:null,isValid:false,error:a instanceof Error?a.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let t=e?S.parseDate(e):new Date;return t?t.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,t){if(S.isDateObj(e))return e;if(!u(t)){let a=S.parseString(e);return a!=null&&a.isValid?a.date:null}if(ie(e))return null;try{let a=ee__default.default(e,t,!0);if(a!=null&&a.isValid())return a.toDate()}catch(a){console.error(a," parsing date with moment : ",e," format is : ",t);}return null}static toSQLDateTimeFormat(e){if(!S.isDateObj(e))return "";let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return `${t}-${a}-${n} ${i}:${o}:${s}`}static getI18n(e){return X.isI18nInstance(e)?e:X.getInstance()}static getDefaultDateTimeFormat(e){return f(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return f(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!S.isDateObj(e))return "";let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return `${t}-${a}-${n}`}static toSQLTimeFormat(e){if(!S.isDateObj(e))return "";let t=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),n=String(e.getSeconds()).padStart(2,"0");return `${t}:${a}:${n}`}static getDefaultTimeFormat(e){return f(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,t){if(e==null||typeof e=="boolean")return false;if(S.isDateObj(e))return true;if(w(e)){let n=new Date(e);return n&&!isNaN(n.getTime())}if(u(e))return !!S.parseDate(e,t);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let a=new Date(e);return S.isDateObj(a)}static addToDate(e,t,a){if(w(e)||(e=0),ie(t)&&(t=new Date),S.isValidDate(t)&&u(t)&&(t=new Date(t)),S.isValidDate(t)||(t=u(t)?new Date(t):new Date),u(a)&&typeof t["set"+a]=="function"&&typeof t["get"+a]=="function"){let n="set"+a,i="get"+a;t=new Date(t[n](t[i]()+e));}return t}static addDays(e,t){return S.addToDate(e,t,"Date")}static addMilliseconds(e,t){return w(e)||(e=0),S.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+e)}static addSeconds(e,t){return w(e)||(e=0),S.addMilliseconds(e*1e3,t)}static addMinutes(e,t){return w(e)||(e=0),S.addMilliseconds(e*6e4,t)}static addHours(e,t){return w(e)||(e=0),S.addMilliseconds(e*36e5,t)}static addMonths(e,t,a){return S.addToDate(e,t,"Month")}static addWeeks(e,t){return e=(w(e)?e:0)*7,S.addToDate(e,t,"Date")}static addYears(e,t){w(e)||(e=0);let a=new Date(S.addToDate(0,t)),n=a.getFullYear();return n+e<0?e=0:e+=n,a.setFullYear(e),new Date(a)}static formatDate(e,t){try{let a=ee__default.default(e);if(a.isValid())return a.format(f(t,S.getDefaultDateTimeFormat()))}catch(a){}return f(S.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let t=e?ee__default.default.utc(e):ee__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};S.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],S.SQL_DATE_FORMAT="YYYY-MM-DD",S.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",S.SQL_TIME_FORMAT="HH:mm:ss",S.getCurrentMonthDaysRange=e=>{let t=S.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getFullYear(),t.getMonth(),1),n=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:a,last:n}},S.getPreviousWeekDaysRange=e=>{let t=S.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getTime()-3600*24*7*1e3),n=new Date(a),i=a.getDay(),o=a.getDate()-i+(i===0?-6:1),s=new Date(a.setDate(o)),l=new Date(n.setDate(o+6));return {first:s,last:l}},S.getCurrentWeekDaysRange=e=>{let t=S.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=t.getDay(),n=t.getDate()-a+(a==0?-6:1),i=new Date(t),o=new Date(t.setDate(n));return i.setDate(i.getDate()+6),{first:o,last:i}},S.isDateObj=le;var V=S,st=(r,e)=>{let t=ee__default.default(r,e,true);try{if(t.isValid()&&t.format(e)===r||ee__default.default.utc(t,!0).format(e)===r)return {date:t.toDate(),matchedFormat:e,isValid:!0}}catch(a){}return null};Date.prototype.toSQLDateTimeFormat=function(){return V.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return V.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return V.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(r){return V.formatDate(this,r)};Date.prototype.addYears=function(r){return V.addYears(r,this)};Date.prototype.addMonths=function(r){return V.addMonths(r,this)};Date.prototype.addMinutes=function(r){return V.addMinutes(r,this)};Date.prototype.addSeconds=function(r){return V.addSeconds(r,this)};Date.prototype.addDays=function(r){return V.addDays(r,this)};Date.prototype.addWeeks=function(r){return V.addWeeks(r,this)};Date.prototype.addHours=function(r){return V.addHours(r,this)};var W=class W{static get logger(){let e=Reflect.getMetadata(W.loggerMetaData,W);return lt(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){lt(e)&&Reflect.defineMetadata(W.loggerMetaData,e,W);}static _log(e,...t){let a=W.logger;e=f(e),e&&typeof a[e]=="function"?a[e](W.getDateTimeString(),...t):console.log("Logger level not found : [",e,"]",...t);}static getDateTimeString(){let{day:e,year:t,hours:a,minutes:n,seconds:i,dayNameShort:o,monthName:s}=V.getUTCDateTimeDetails(),l=e<10?"0"+e:e,d=a<10?"0"+a:a,m=n<10?"0"+n:n,g=i<10?"0"+i:i;return "["+[o,l,s,t].join(" ")+" "+[d,m,g].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};W.loggerMetaData=Symbol("logger-meta-data");var H=W,lt=r=>{if(!r)return false;try{return ["warn","info","error"].every(e=>typeof r[e]=="function")}catch(e){return false}};var ut=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.startsWith(e)&&t>=0;)r=r.slice(e.length),--t;return r.toString()},ct=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.endsWith(e)&&t>=0;)r=r.slice(0,-e.length),--t;return r.toString()},Ht=(r,e=true)=>typeof r!="string"?false:e!==false?/^\d*\.?\d+$/.test(r):/^\d+$/.test(r);String.prototype.ltrim=function(r){return ut(this.toString(),r)};String.prototype.rtrim=function(r){return ct(this.toString(),r)};String.prototype.isNumber=function(r=true){return Ht(this.toString(),r)};String.prototype.replaceAll=function(r,e){return !u(r)||!u(e)?this.toString():this.toString().split(r).join(e)};var Gt=r=>u(r)?(r=r.trim(),r.replace(/(.)([A-Z][a-z]+)/,"$1_$2").replace(/([a-z0-9])([A-Z])/,"$1_$2").toUpperCase()):"";String.prototype.toSnakeCase=function(){return Gt(this.toString())};var $t=r=>u(r)?(r=r.trim(),r.charAt(0)+r.replace(/(_\w)/g,e=>e[1].toUpperCase()).substring(1)):"";String.prototype.toCamelCase=function(){return $t(this.toString())};var zt=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toUpperCase()+r.slice(1))};String.prototype.upperFirst=function(){return zt(this.toString())};var Ee=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toLowerCase()+r.slice(1))};String.prototype.lowerFirst=function(){return Ee(this.toString())};var j={USD:{symbol:"$",name:"US Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"USD",namePlural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbolNative:"$",decimalDigits:2,format:"%s %v",rounding:0,code:"CAD",namePlural:"Canadian dollars"},EUR:{symbol:"\u20AC",name:"Euro",symbolNative:"\u20AC",decimalDigits:2,rounding:0,code:"EUR",namePlural:"euros"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbolNative:"\u062F.\u0625.\u200F",decimalDigits:2,rounding:0,code:"AED",namePlural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbolNative:"\u060B",decimalDigits:0,rounding:0,code:"AFN",namePlural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbolNative:"Lek",decimalDigits:0,rounding:0,code:"ALL",namePlural:"Albanian lek\xEB"},AMD:{symbol:"AMD",name:"Armenian Dram",symbolNative:"\u0564\u0580.",decimalDigits:0,rounding:0,code:"AMD",namePlural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"ARS",namePlural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"AUD",namePlural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbolNative:"\u043C\u0430\u043D.",decimalDigits:2,rounding:0,code:"AZN",namePlural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbolNative:"KM",decimalDigits:2,rounding:0,code:"BAM",namePlural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbolNative:"\u09F3",decimalDigits:2,rounding:0,code:"BDT",namePlural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbolNative:"\u043B\u0432.",decimalDigits:2,rounding:0,code:"BGN",namePlural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbolNative:"\u062F.\u0628.\u200F",decimalDigits:2,rounding:0,code:"BHD",namePlural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbolNative:"FBu",decimalDigits:0,rounding:0,code:"BIF",namePlural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BND",namePlural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbolNative:"Bs",decimalDigits:2,rounding:0,code:"BOB",namePlural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbolNative:"R$",decimalDigits:2,rounding:0,code:"BRL",namePlural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbolNative:"P",decimalDigits:2,rounding:0,code:"BWP",namePlural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbolNative:"BYR",decimalDigits:0,rounding:0,code:"BYR",namePlural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BZD",namePlural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbolNative:"FrCD",decimalDigits:2,rounding:0,code:"CDF",namePlural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbolNative:"CHF",decimalDigits:2,rounding:.05,code:"CHF",namePlural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"CLP",namePlural:"Chilean pesos"},CNY:{symbol:"CN\xA5",name:"Chinese Yuan",symbolNative:"CN\xA5",decimalDigits:2,rounding:0,code:"CNY",namePlural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"COP",namePlural:"Colombian pesos"},CRC:{symbol:"\u20A1",name:"Costa Rican Col\xF3n",symbolNative:"\u20A1",decimalDigits:0,rounding:0,code:"CRC",namePlural:"Costa Rican col\xF3ns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbolNative:"CV$",decimalDigits:2,rounding:0,code:"CVE",namePlural:"Cape Verdean escudos"},CZK:{symbol:"K\u010D",name:"Czech Republic Koruna",symbolNative:"K\u010D",decimalDigits:2,rounding:0,code:"CZK",namePlural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbolNative:"Fdj",decimalDigits:0,rounding:0,code:"DJF",namePlural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"DKK",namePlural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbolNative:"RD$",decimalDigits:2,rounding:0,code:"DOP",namePlural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbolNative:"\u062F.\u062C.\u200F",decimalDigits:2,rounding:0,code:"DZD",namePlural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbolNative:"kr",decimalDigits:2,rounding:0,code:"EEK",namePlural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbolNative:"\u062C.\u0645.\u200F",decimalDigits:2,rounding:0,code:"EGP",namePlural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbolNative:"Nfk",decimalDigits:2,rounding:0,code:"ERN",namePlural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbolNative:"Br",decimalDigits:2,rounding:0,code:"ETB",namePlural:"Ethiopian birrs"},GBP:{symbol:"\xA3",name:"British Pound Sterling",symbolNative:"\xA3",decimalDigits:2,rounding:0,code:"GBP",namePlural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbolNative:"GEL",decimalDigits:2,rounding:0,code:"GEL",namePlural:"Georgian laris"},GHS:{symbol:"GH\u20B5",name:"Ghanaian Cedi",symbolNative:"GH\u20B5",decimalDigits:2,rounding:0,code:"GHS",namePlural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbolNative:"FG",decimalDigits:0,rounding:0,code:"GNF",namePlural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbolNative:"Q",decimalDigits:2,rounding:0,code:"GTQ",namePlural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"HKD",namePlural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbolNative:"L",decimalDigits:2,rounding:0,code:"HNL",namePlural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbolNative:"kn",decimalDigits:2,rounding:0,code:"HRK",namePlural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbolNative:"Ft",decimalDigits:0,rounding:0,code:"HUF",namePlural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbolNative:"Rp",decimalDigits:0,rounding:0,code:"IDR",namePlural:"Indonesian rupiahs"},ILS:{symbol:"\u20AA",name:"Israeli New Sheqel",symbolNative:"\u20AA",decimalDigits:2,rounding:0,code:"ILS",namePlural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbolNative:"\u099F\u0995\u09BE",decimalDigits:2,rounding:0,code:"INR",namePlural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbolNative:"\u062F.\u0639.\u200F",decimalDigits:0,rounding:0,code:"IQD",namePlural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbolNative:"\uFDFC",decimalDigits:0,rounding:0,code:"IRR",namePlural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Kr\xF3na",symbolNative:"kr",decimalDigits:0,rounding:0,code:"ISK",namePlural:"Icelandic kr\xF3nur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"JMD",namePlural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbolNative:"\u062F.\u0623.\u200F",decimalDigits:2,rounding:0,code:"JOD",namePlural:"Jordanian dinars"},JPY:{symbol:"\xA5",name:"Japanese Yen",symbolNative:"\uFFE5",decimalDigits:0,rounding:0,code:"JPY",namePlural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbolNative:"Ksh",decimalDigits:2,rounding:0,code:"KES",namePlural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbolNative:"\u17DB",decimalDigits:2,rounding:0,code:"KHR",namePlural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbolNative:"FC",decimalDigits:0,rounding:0,code:"KMF",namePlural:"Comorian francs"},KRW:{symbol:"\u20A9",name:"South Korean Won",symbolNative:"\u20A9",decimalDigits:0,rounding:0,code:"KRW",namePlural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbolNative:"\u062F.\u0643.\u200F",decimalDigits:2,rounding:0,code:"KWD",namePlural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbolNative:"\u0442\u04A3\u0433.",decimalDigits:2,rounding:0,code:"KZT",namePlural:"Kazakhstani tenges"},LBP:{symbol:"LB\xA3",name:"Lebanese Pound",symbolNative:"\u0644.\u0644.\u200F",decimalDigits:0,rounding:0,code:"LBP",namePlural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbolNative:"SL Re",decimalDigits:2,rounding:0,code:"LKR",namePlural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbolNative:"Lt",decimalDigits:2,rounding:0,code:"LTL",namePlural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbolNative:"Ls",decimalDigits:2,rounding:0,code:"LVL",namePlural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbolNative:"\u062F.\u0644.\u200F",decimalDigits:2,rounding:0,code:"LYD",namePlural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbolNative:"\u062F.\u0645.\u200F",decimalDigits:2,rounding:0,code:"MAD",namePlural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbolNative:"MDL",decimalDigits:2,rounding:0,code:"MDL",namePlural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbolNative:"MGA",decimalDigits:0,rounding:0,code:"MGA",namePlural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbolNative:"MKD",decimalDigits:2,rounding:0,code:"MKD",namePlural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbolNative:"K",decimalDigits:0,rounding:0,code:"MMK",namePlural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbolNative:"MOP$",decimalDigits:2,rounding:0,code:"MOP",namePlural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbolNative:"MURs",decimalDigits:0,rounding:0,code:"MUR",namePlural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"MXN",namePlural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbolNative:"RM",decimalDigits:2,rounding:0,code:"MYR",namePlural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbolNative:"MTn",decimalDigits:2,rounding:0,code:"MZN",namePlural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbolNative:"N$",decimalDigits:2,rounding:0,code:"NAD",namePlural:"Namibian dollars"},NGN:{symbol:"\u20A6",name:"Nigerian Naira",symbolNative:"\u20A6",decimalDigits:2,rounding:0,code:"NGN",namePlural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan C\xF3rdoba",symbolNative:"C$",decimalDigits:2,rounding:0,code:"NIO",namePlural:"Nicaraguan c\xF3rdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"NOK",namePlural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbolNative:"\u0928\u0947\u0930\u0942",decimalDigits:2,rounding:0,code:"NPR",namePlural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"NZD",namePlural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbolNative:"\u0631.\u0639.\u200F",decimalDigits:2,rounding:0,code:"OMR",namePlural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbolNative:"B/.",decimalDigits:2,rounding:0,code:"PAB",namePlural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbolNative:"S/.",decimalDigits:2,rounding:0,code:"PEN",namePlural:"Peruvian nuevos soles"},PHP:{symbol:"\u20B1",name:"Philippine Peso",symbolNative:"\u20B1",decimalDigits:2,rounding:0,code:"PHP",namePlural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbolNative:"\u20A8",decimalDigits:0,rounding:0,code:"PKR",namePlural:"Pakistani rupees"},PLN:{symbol:"z\u0142",name:"Polish Zloty",symbolNative:"z\u0142",decimalDigits:2,rounding:0,code:"PLN",namePlural:"Polish zlotys"},PYG:{symbol:"\u20B2",name:"Paraguayan Guarani",symbolNative:"\u20B2",decimalDigits:0,rounding:0,code:"PYG",namePlural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbolNative:"\u0631.\u0642.\u200F",decimalDigits:2,rounding:0,code:"QAR",namePlural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbolNative:"RON",decimalDigits:2,rounding:0,code:"RON",namePlural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbolNative:"\u0434\u0438\u043D.",decimalDigits:0,rounding:0,code:"RSD",namePlural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbolNative:"\u0440\u0443\u0431.",decimalDigits:2,rounding:0,code:"RUB",namePlural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbolNative:"FR",decimalDigits:0,rounding:0,code:"RWF",namePlural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbolNative:"\u0631.\u0633.\u200F",decimalDigits:2,rounding:0,code:"SAR",namePlural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbolNative:"SDG",decimalDigits:2,rounding:0,code:"SDG",namePlural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbolNative:"kr",decimalDigits:2,rounding:0,code:"SEK",namePlural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"SGD",namePlural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbolNative:"Ssh",decimalDigits:0,rounding:0,code:"SOS",namePlural:"Somali shillings"},SYP:{symbol:"SY\xA3",name:"Syrian Pound",symbolNative:"\u0644.\u0633.\u200F",decimalDigits:0,rounding:0,code:"SYP",namePlural:"Syrian pounds"},THB:{symbol:"\u0E3F",name:"Thai Baht",symbolNative:"\u0E3F",decimalDigits:2,rounding:0,code:"THB",namePlural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbolNative:"\u062F.\u062A.\u200F",decimalDigits:2,rounding:0,code:"TND",namePlural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Pa\u02BBanga",symbolNative:"T$",decimalDigits:2,rounding:0,code:"TOP",namePlural:"Tongan pa\u02BBanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbolNative:"TL",decimalDigits:2,rounding:0,code:"TRY",namePlural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"TTD",namePlural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbolNative:"NT$",decimalDigits:2,rounding:0,code:"TWD",namePlural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbolNative:"TSh",decimalDigits:0,rounding:0,code:"TZS",namePlural:"Tanzanian shillings"},UAH:{symbol:"\u20B4",name:"Ukrainian Hryvnia",symbolNative:"\u20B4",decimalDigits:2,rounding:0,code:"UAH",namePlural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbolNative:"USh",decimalDigits:0,rounding:0,code:"UGX",namePlural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"UYU",namePlural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbolNative:"UZS",decimalDigits:0,rounding:0,code:"UZS",namePlural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bol\xEDvar",symbolNative:"Bs.F.",decimalDigits:2,rounding:0,code:"VEF",namePlural:"Venezuelan bol\xEDvars"},VND:{symbol:"\u20AB",name:"Vietnamese Dong",symbolNative:"\u20AB",decimalDigits:0,rounding:0,code:"VND",namePlural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbolNative:"FCFA",decimalDigits:0,rounding:0,code:"XAF",namePlural:"francs CFA"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbolNative:"CFA",decimalDigits:0,rounding:0,code:"XOF",namePlural:"francs CFA"},YER:{symbol:"YR",name:"Yemeni Rial",symbolNative:"\u0631.\u064A.\u200F",decimalDigits:0,rounding:0,code:"YER",namePlural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbolNative:"R",decimalDigits:2,rounding:0,code:"ZAR",namePlural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbolNative:"ZK",decimalDigits:0,rounding:0,code:"ZMK",namePlural:"Zambian kwachas"}};var Z=r=>r&&typeof r=="object"&&!Array.isArray(r)&&r.name&&typeof r.name=="string"&&r.symbol&&typeof r.symbol=="string";var dt="%v %s",Oe=r=>{let e=L.get("currencyFormat");return e&&typeof e=="string"&&e.includes("%v")?e:r!==false?dt:""};function mt(r){return r=r&&typeof r=="string"?r.trim():"",L.set("currencyFormat",r)}var jt=r=>{if(!Z(r)){let t=typeof r=="object"&&r&&!Array.isArray(r)?f(r.code,r.name):typeof r=="string"?r:void 0;t&&(t=t.trim().toUpperCase()),t&&Z(j[t])?r=j[t]:typeof r=="string"&&(t=r.trim().toUpperCase(),Z(j[t])&&(r=j[t]));}let e=Object.assign({},r);if(!e.format){let t=Oe();t&&(e.format=t);}return e.format&&mt(e.format),L.set("appConfigCurrency",e),e},Wt=()=>{var n,i,o,s;let r=Object.assign({},L.get("appConfigCurrency")),e=L.get("currencyCode");if(u(e)&&Z(j[e.trim().toUpperCase()])&&(r=c(c({},j[e.trim().toUpperCase()]),r)),!u(r==null?void 0:r.format)){let l=Oe(false);u(l)&&l.includes("%v")&&(r.format=l);}let a=j["USD"];return c(c({symbol:a.symbol,format:(n=a.format)!=null?n:"%v %s",decimalSeparator:(i=a.decimalSeparator)!=null?i:".",thousandSeparator:(o=a.thousandSeparator)!=null?o:",",decimalDigits:(s=a.decimalDigits)!=null?s:0},Object.assign({},he.get("currencies"))),r)},_={getFormat:Oe,setFormat:mt,setCurrency:jt,getCurrency:Wt,defaultCurrencyFormat:dt};var Zt=r=>r&&typeof r=="object";function ke(r){let e=Object.assign({},_.getCurrency());if(r&&Zt(r))for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&r[t]!==void 0&&(e[t]=r[t]);if(u(e.format)){let t=gt(e.format);t.format&&(e.format=t.format),typeof t.decimalDigits=="number"&&(e.decimalDigits=t.decimalDigits);}return e}function Ie(r,e){return r=typeof r=="number"?r:0,e=typeof e=="number"?e:0,r=Math.round(Math.abs(r)),isNaN(r)?e:r}function Jt(r){let e=_.getCurrency(),t=(e==null?void 0:e.format).toLowerCase();return typeof r=="string"&&(r=r.toLowerCase()),(typeof r!="string"||!r.match("%v"))&&(r=t),{pos:r,neg:r.replace("-","").replace("%v","-%v"),zero:r}}var Ce=(r,e)=>{let t=_.getCurrency();if(r=r||0,typeof r=="number")return r;e=e||t.decimalSeparator;let a=new RegExp("[^0-9-"+e+"]","g"),n=parseFloat((""+r).replace(/\((?=\d+)(.*)\)/,"-$1").replace(a,"").replace(e,"."));return isNaN(n)?0:n},Ve=(r,e)=>{let t=_.getCurrency();e=Ie(e,t.decimalDigits);let n=String(r).replace(/[^\d.-]/g,"");if(n.length>15&&!n.includes("."))return n+"."+"0".repeat(e);try{let i=Number(n);if(isNaN(i))return "NaN";let o=+(i+"e"+e);return (+(Math.round(o)+"e-"+e)).toFixed(e)}catch(i){return "NaN"}},ft=(r,e,t,a)=>{var g;r=Ce(r);let n=Z(e)?e:_.getCurrency();typeof e=="number"&&(n.decimalDigits=e),typeof n.decimalDigits!="number"&&(n.decimalDigits=(g=String(r).split(".")[1])==null?void 0:g.length),t!==void 0&&(n.thousandSeparator=t),a!==void 0&&(n.decimalSeparator=a);let i=ke(n),o=Ie(i.decimalDigits),s=r<0?"-":"",l=parseInt(Ve(Math.abs(r||0),o),10)+"",d=l.length>3?l.length%3:0,m="";if(o){let y=String(parseFloat(Ve(Math.abs(r),o))||0);y.includes(".")&&(m=f(y.split(".")[1]).trim());}return s+(d?l.substring(0,d)+i.thousandSeparator:"")+l.substring(d).replace(/(\d{3})(?=\d)/g,"$1"+i.thousandSeparator)+(o&&m?i.decimalSeparator+m:"")},yt=(r,e,t,a,n,i)=>{r=Ce(r);let o=Z(e)?e:_.getCurrency();e!==void 0&&typeof e=="string"&&(o.symbol=e),t!==void 0&&(o.decimalDigits=t),a!==void 0&&(o.thousandSeparator=a),n!==void 0&&(o.decimalSeparator=n),u(i)&&(o.format=i);let s=ke(o),l=Jt(s.format),d=f(r>0?l.pos:r<0?l.neg:l.zero),m=f(s.symbol),g=d.replace(m&&"%s",m),y=ft(Math.abs(r),Ie(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),M=g.replace("%v",y);return p(c({},s),{formattedValue:g,formattedNumber:y,symbol:s.symbol,usedFormat:d,result:M})},Qt=(r,e,t,a,n,i)=>yt(r,e,t,a,n,i).result,gt=r=>{r=f(r).trim();let e={};if(r){let t=/(\.)(\#{0,9}\s*$)/,a=r.match(t);Array.isArray(a)&&a.length===3&&(e.decimalDigits=f(a[2]).trim().length),r=r.replace(t,"");}return e.format=r,e},oe={parse:Ce,session:_,formatMoney:Qt,currencies:j,isCurrency:Z,formatNumber:ft,formatMoneyAsObject:yt,unformat:Ce,toFixed:Ve,prepareOptions:ke,parseFormat:gt};var{currencies:pt}=oe;Number.prototype.countDecimals=function(){let r=String(this.toString()).match(/\.(\d+)/);return r?r[1].length:0};Number.prototype.formatNumber=function(r,e,t){return oe.formatNumber(this.valueOf(),r,e,t)};Number.prototype.formatMoney=function(r,e,t,a,n){return oe.formatMoney(this.valueOf(),r,e,t,a,n)};var qt=(r,e,t,a)=>{var x;if(r===null||typeof r!="number"||isNaN(r))return {result:"",format:"",suffix:"",formattedValue:"",minAbreviationDecimalDigits:0,value:NaN};if(!isFinite(r)){let O=r>0?"\u221E":"-\u221E";return {result:O,value:r,format:"",suffix:"",formattedValue:O,minAbreviationDecimalDigits:0}}let n=Math.abs(r)<1e3,i=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"},{value:1e3,suffix:"K"},{value:1,suffix:""}],o=r.countDecimals?r.countDecimals():Math.floor(r)===r?0:((x=r.toString().split(".")[1])==null?void 0:x.length)||0,s=i.find(O=>Math.abs(r)>=O.value)||i[i.length-1],l=n?r:r/(s.value===1?1:s.value),d=s.suffix,m=Xt(l,5);if(r===0)return {result:"0",value:0,format:"",suffix:"",formattedValue:"0",minAbreviationDecimalDigits:0};let y=w(e)&&e>0?e:s.value===1?Math.min(o,5):Math.max(m,0),M=l.toFixed(y);t=f(t),a=f(a,".");let C=M.toString().split(".");return C[0]=C[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),y>0&&C.length===1?C.push("0".repeat(y)):y>0&&C.length>1&&C[1].length<y&&(C[1]=C[1].padEnd(y,"0")),M=C.join(a),{result:M+d,value:r,format:d,suffix:d,formattedValue:M,minAbreviationDecimalDigits:m}};function Xt(r,e){let t=Math.abs(r);if(Number.isInteger(t))return 0;let a=t.toString().split(".")[1]||"",n=0;for(;n<a.length&&a[n]==="0";)n++;return t<1&&n>0?Math.min(n+e,a.length):Math.min(e,a.length)}var bt=(r,e,t,a)=>qt(r,e,t,a).result;Number.prototype.abreviate2FormatNumber=function(r,e,t){return bt(this.valueOf(),r,e,t)};var ht=(r,e,t,a,n,i)=>{if(!w(r))return "";let l=oe.formatMoneyAsObject(r,e,t,a,n,i),{formattedValue:o}=l,s=U(l,["formattedValue"]);return o.replace("%v",bt(r,s.decimalDigits,s.thousandSeparator,s.decimalSeparator))};Number.prototype.abreviate2FormatMoney=function(r,e,t,a,n){return ht(this.valueOf(),r,e,t,a,n)};function Ye(...r){for(let e of r)if(w(e)&&e!==0)return e;return 0}Object.keys(pt).forEach(r=>{let e=r,t=pt[e],a=`format${e}`,n=`abreviate2Format${e}`;Number.prototype[a]=function(i,o,s,l){return oe.formatMoney(this.valueOf(),t,i,o,s,l)},Number.prototype[n]=function(i,o,s,l){return ht(this.valueOf(),t,i,o,s,l)};});function _t(r){return f(r).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function De(r,e){var t=Object.prototype.toString.call(r);return t==="[object "+e+"]"}function J(r,e){if(["boolean","undefined"].includes(typeof r)||r===null)return String(r);if(w(r))return r.formatNumber();if(r instanceof Date)return r.toFormat();if(r instanceof Error)return r==null?void 0:r.toString();e=Object.assign({},e);let{parenthesis:t}=e,a=t?"(":"",n=t?")":"";if(typeof r=="string")return e!=null&&e.escapeString?"'"+_t(r)+"'":r;if(De(r,"RegExp")||De(r,"Number")||De(r,"Boolean"))return r.toString();if(De(r,"Date"))return "new Date("+r.getTime()+")";if(Array.isArray(r))return "["+r.map(i=>J(i,e)).join(",")+"]";if(typeof r=="object"){try{return JSON.stringify(r,null,2)}catch(i){}return a+"{"+Object.keys(r).map(i=>{var o=r[i];return J(i,e)+":"+J(o,e)}).join(",")+"}"+n}return r&&typeof(r==null?void 0:r.toString)=="function"?r==null?void 0:r.toString():String(r)}function Le(){return typeof window!="undefined"&&typeof window=="object"?window:typeof self!="undefined"&&typeof self=="object"?self:typeof global!="undefined"&&typeof global=="object"?global:typeof globalThis!="undefined"&&typeof globalThis=="object"?globalThis:{}}var se={optional:Symbol.for("validatorOptionalRuleMarker"),empty:Symbol.for("validatorEmptyRuleMarker"),nullable:Symbol.for("validatorNullableRuleMarker"),ruleName:Symbol.for("validatorRuleNameMarker")};var h=class h{static registerRule(e,t){if(!u(e))throw new Error("Rule name must be a non-empty string");if(typeof t!="function")throw new Error("Rule handler must be a function");let a=h.getRules(),n=p(c({},a),{[e]:t});Reflect.defineMetadata(h.RULES_METADATA_KEY,n,h);}static getRules(){let e=Reflect.getMetadata(h.RULES_METADATA_KEY,h);return D(e)?c({},e):{}}static getRule(e){return this.getRules()[e]}static hasRule(e){return u(e)?!!this.getRule(e):false}static getI18n(e){return X.isI18nInstance(e==null?void 0:e.i18n)?e.i18n:he}static getErrorMessageSeparators(e){let t=this.getI18n({i18n:e}),a=Object.assign({},t.get("validator.separators"));return {multiple:f(a.multiple,", "),single:f(a.single,", ")}}static parseAndValidateRules(e){let t=[],a=this.getRules(),n=[],i=Array.isArray(e)?e:[];for(let o of i)if(typeof o=="function")t.push(o);else if(u(o)){let s=this.parseStringRule(o,a);s?t.push(s):n.push(o);}else if(D(o)&&typeof o=="object"){let s=this.parseObjectRule(o,a);s.length&&t.push(...s);}return {sanitizedRules:t,invalidRules:n}}static parseStringRule(e,t){let a=String(e).trim(),n=[],i=t[a];return typeof i=="function"?{ruleName:a,params:n,ruleFunction:i}:null}static parseFunctionRule(e){var a;let t=(a=ar(e))!=null?a:e.name;return {ruleFunction:e,ruleName:t,params:[]}}static parseObjectRule(e,t){let a=[];if(!D(e))return a;if(this.isSanitizedRuleObject(e))return a.push(e),a;for(let n in e)if(Object.hasOwnProperty.call(e,n)){let i=n;if(typeof t[i]!="function")continue;let o=t[i],s=e[i];Array.isArray(s)?a.push({ruleName:i,ruleFunction:o,params:s}):D(s)&&(s!=null&&s.params)&&Array.isArray(s.params)&&a.push(p(c({},s),{ruleName:i,ruleFunction:o}));}return a}static isSanitizedRuleObject(e){if(!D(e))return false;let t=e;return typeof t.ruleFunction=="function"&&typeof t.ruleName=="string"&&Array.isArray(t.params)}static translateRuleConfigMessage({message:e,i18n:t,validateOptions:a}){if(!e)return "";if(u(e))return t.has(e)?t.t(e,a):e;if(typeof e=="function")try{return e(a)}catch(n){return H.log(h.name," Error generated when running custom translate rule message ",a.ruleName,a.ruleParams,n),""}return ""}static validate(a){return A(this,null,function*(){var n=a,{rules:e}=n,t=U(n,["rules"]);let i=this.getI18n(t),o=Date.now(),{sanitizedRules:s,invalidRules:l}=h.parseAndValidateRules(e),d=h.getErrorMessageSeparators(i),{value:m,context:g,data:y}=t,M=this.getI18nTranslateOptions(t),C=p(c({},M),{context:g,value:m,data:y});if(l.length){let v=l.map(x=>i.t("validator.invalidRule",p(c({},M),{rule:u(x)?x:"unnamed rule"}))).join(d.multiple);return h.createError(v,{value:m,startTime:o,fieldName:t.fieldName,propertyName:t.propertyName,translatedPropertyName:t.translatedPropertyName,ruleParams:[],ruleName:"N/A"})}return !s.length||this.shouldSkipValidation({value:m,rules:s})?Te(C,o):(t.fieldName=t.propertyName=f(t.fieldName,t.propertyName),new Promise(v=>{let x=-1,O=s.length,N=function(){return A(this,null,function*(){if(x++,x>=O)return v(Te(C,o));let T=s[x],P,E=[],k,Y=typeof T=="function"?T:void 0;if(h.isSanitizedRuleObject(T))Y=T.ruleFunction,E=Array.isArray(T.params)?T.params:[],P=T.ruleName,k=T.message;else if(typeof T=="function"){let R=h.parseFunctionRule(T);R?P=R.ruleName:P=T.name;}let G=p(c({value:m,rules:e},M),{rule:f(P),ruleName:P,ruleParams:E}),z={value:m,startTime:o,fieldName:t.fieldName,propertyName:t.propertyName,translatedPropertyName:t.translatedPropertyName,ruleParams:E,ruleName:f(P)},B=p(c(p(c({},t),{data:y!=null?y:Object.assign({},y),startTime:o}),G),{ruleName:f(P),value:m,i18n:i}),re=R=>{if(h.isError(R))return v(R);let Se="";if(R!==true&&k&&(Se=h.translateRuleConfigMessage({message:k,i18n:i,validateOptions:B})),u(Se))return v(h.createError(Se,z));if(R=typeof R=="string"?u(R)?R:i.t("validator.invalidMessage",G):R,R===false){let Me=i.t("validator.invalidMessage",G);return v(h.createError(Me,z))}else {if(u(R))return v(h.createError(R,z));if(R instanceof Error||u(R==null?void 0:R.message)||u(R)){let Me=J(R,{escapeString:false});return v(h.createError(Me,z))}}return N()};if(typeof Y!="function"){let R=i.t("validator.invalidRule",G);return v(h.createError(R,z))}try{let R=yield Y(B);return re(R)}catch(R){return re(typeof R=="string"?R:(R==null?void 0:R.message)||(R==null?void 0:R.toString())||J(R,{escapeString:false}))}})};return N()}))})}static shouldSkipValidation({value:e,rules:t}){if(ie(e)){let a={IsEmpty:{validate:n=>n==="",symbol:se.empty},Nullable:{validate:n=>n==null,symbol:se.nullable},Optional:{validate:n=>n===void 0,symbol:se.optional}};for(let n of t){let i=typeof n=="object"&&n?n.ruleFunction:typeof n=="function"?n:void 0;if(typeof i=="function")for(let o in a){let s=a[o];if(tr(i,s.symbol)&&s.validate(e))return true}}}return false}static validateOneOfRule(e){return this.validateMultiRule("OneOf",e)}static validateAllOfRule(e){return this.validateMultiRule("AllOf",e)}static validateArrayOfRule(e){return A(this,null,function*(){let N=e,{value:t,ruleParams:a,startTime:n,message:i}=N,o=U(N,["value","ruleParams","startTime","message"]);n=w(n)?n:Date.now();let s=Array.isArray(a)?a:[],l=this.getI18n(o);if(!Array.isArray(t))return l.t("validator.array",p(c({field:o.translatedPropertyName||o.fieldName,value:t},o),{context:void 0}));if(s.length===0||t.length===0)return true;let{multiple:d,single:m}=this.getErrorMessageSeparators(l),g=[];for(let T=0;T<t.length;T++){let P=t[T],E=yield h.validateMultiRule("AllOf",c({value:P,ruleParams:s,startTime:n},o));E!==true&&g.push({index:T,message:String(E)});}if(g.length===0)return true;let y=g.map(T=>T.index),M=g.length,C,v=l.t("validator.separators.multiple");if(M<=3)C=y.join(v);else {let T=y.slice(0,3),P=M-3,E=l.t("validator.itemListOverflow",{count:P});C=`${T.join(v)}${v}${E}`;}if(i){let T=this.getI18nTranslateOptions(o),P=h.translateRuleConfigMessage({message:i,i18n:l,validateOptions:p(c(c({},o),T),{context:o.context,value:t,ruleName:"ArrayOf",ruleParams:a!=null?a:[],i18n:l,failures:g,failedIndices:y,itemCount:M,itemList:C,totalCount:t.length})});if(u(P))return P}let x=l.t("validator.arrayValidationFailed",{count:g.length,itemCount:M,items:C,totalCount:t.length}),O=g.map(T=>l.t("validator.arrayItemError",{index:T.index,message:T.message})).join(d);return `${x}${m}${O}`})}static validateIfRule(e){return A(this,null,function*(){var N;let O=e,{resolver:t,startTime:a,message:n}=O,i=U(O,["resolver","startTime","message"]),{value:o,data:s,context:l,fieldName:d,propertyName:m,translatedPropertyName:g}=i,y=this.getI18n(i),M=yield t({value:o,data:s,context:l,fieldName:d,propertyName:m,translatedPropertyName:g,i18n:y});if(!M)return true;let C,v;if(Array.isArray(M)){if(M.length===0)return true;C=M,v=n;}else {if(C=M.rules,!C||C.length===0)return true;v=(N=M.message)!=null?N:n;}let x=yield h.validate(p(c({},i),{value:o,rules:C,i18n:y}));if(x.success)return true;if(v){let T=this.getI18nTranslateOptions(i),P=h.translateRuleConfigMessage({message:v,i18n:y,validateOptions:p(c(c({},i),T),{value:o,ruleName:"If",ruleParams:[],i18n:y})});if(u(P))return P}return x.message})}static getI18nTranslateOptions(s){var l=s,{fieldName:e,propertyName:t,fieldLabel:a,translatedPropertyName:n,context:i}=l,o=U(l,["fieldName","propertyName","fieldLabel","translatedPropertyName","context"]);e=f(e,t),a=f(a,n,e);let d={fieldLabel:a,translatedPropertyName:f(n,a),propertyName:f(t,e),fieldName:e};return "value"in o&&(d.value=o.value),d}static validateNestedRule(a){return A(this,null,function*(){var n=a,{ruleParams:e}=n,t=U(n,["ruleParams"]);let C=t,{startTime:i,value:o}=C,s=U(C,["startTime","value"]);i=w(i)?i:Date.now();let l=this.getI18n(s),m=(Array.isArray(e)?e:[])[0],g=p(c({rule:"ValidateNested"},this.getI18nTranslateOptions(s)),{startTime:i,value:o});if(!m)return l.t("validator.invalidRule",g);if(typeof o!="object"||o===null||Array.isArray(o)){let v=Array.isArray(o)?"array":o===void 0?"undefined":o===null?"null":typeof o;return l.t("validator.validateNestedInvalidType",p(c({},g),{receivedType:v}))}let y=yield this.validateClass(m,p(c({},t),{data:o,parentData:s.data,startTime:i}));if(y.success)return true;let M=this.translateNestedErrorResult(y,l);if(t.message){let v=h.translateRuleConfigMessage({message:t.message,i18n:l,validateOptions:p(c(c({},s),g),{value:o,ruleName:"ValidateNested",ruleParams:e!=null?e:[],i18n:l,nestedErrors:M})});if(u(v))return v}return l.t("validator.validateNested",c({nestedErrors:M},g))})}static translateNestedErrorResult(e,t){let a=e.errors||[],n=this.getI18n({i18n:t}),i=Object.assign({separator:"; ",prefix:"",suffix:""},n.get("validator.nestedErrors")),o=f(i.separator,"; "),s=f(i.prefix,""),l=f(i.suffix,"");return `${s}${a.map(d=>{var m;return `[${(m=d.translatedPropertyName)!=null?m:d.propertyName}]: ${d.message}`}).join(o)}${l}`}static validateMultiRule(e,s){return A(this,null,function*(){var l=s,{value:t,ruleParams:a,startTime:n,message:i}=l,o=U(l,["value","ruleParams","startTime","message"]);n=w(n)?n:Date.now();let d=Array.isArray(a)?a:[],m=this.getI18n(o),g=e==="AllOf";if(d.length===0)return true;let y=[],M=[],C=null;for(let v of d){let x=yield h.validate(p(c({value:t},o),{rules:[v],i18n:m}));if(x.success){if(!g)return true;C!=null||(C=x);}else M.push(x),u(x.message)&&y.push(x.message);}if(!g&&C||M.length===0)return true;if(i){let v=this.getI18nTranslateOptions(o),x=h.translateRuleConfigMessage({message:i,i18n:m,validateOptions:p(c(c({},o),v),{value:t,ruleName:e,ruleParams:a!=null?a:[],i18n:m})});if(u(x))return x}return m.t(`validator.${Ee(e)}`,p(c({},this.getI18nTranslateOptions(o)),{value:t,ruleName:e,rules:[e],rule:e,ruleParams:[],failedRulesErrors:y.join("; ")}))})}static oneOf(e){return function(a){return h.validateOneOfRule(p(c({},a),{ruleParams:e}))}}static allOf(e){return function(a){return h.validateAllOfRule(p(c({},a),{ruleParams:e}))}}static arrayOf(e){return function(a){return h.validateArrayOfRule(p(c({},a),{ruleParams:e}))}}static if(e){return function(a){return h.validateIfRule(p(c({},a),{resolver:e}))}}static validateNested(e){return function(a){return h.validateNestedRule(p(c({},a),{ruleParams:[e]}))}}static validateClass(e,t){return A(this,null,function*(){let a=Date.now(),n=h.getClassRules(e),O=Object.assign({},h.getValidatorClassOptions(e),t),{context:i,errorMessageBuilder:o}=O,s=U(O,["context","errorMessageBuilder"]),l=Object.assign({},t.data),d=this.getI18n(t),m=h.getErrorMessageSeparators(d),g=typeof o=="function"?o:(N,T)=>`[${String(N)}] : ${T}`,y=[],M={},C=[],x=d.translateClass(e,{data:l});for(let N in n){let T=n[N],{sanitizedRules:P}=this.parseAndValidateRules(T),E=Object.prototype.hasOwnProperty.call(l,N)?l[N]:void 0;if(this.shouldSkipValidation({value:E,rules:P}))continue;let k=f(x[N],N);C.push(h.validate(p(c({context:i},s),{i18n:d,value:E,data:l,translatedPropertyName:k,fieldName:N,propertyName:N,rules:P,fieldLabel:k})).then(Y=>{if(Y.success);else {let G=f(Y.message),z=h.createError(G,{propertyName:N,translatedPropertyName:k,ruleParams:[],ruleName:"validateClass",startTime:a,value:E}),B=g(k,G,p(c({},z),{propertyName:String(N),separators:m,data:l,translatedPropertyName:k,i18n:d,cause:Y}));M[N]=B,y.push(p(c({},z),{cause:Y}));}return Y}));}return new Promise(N=>Promise.all(C).then(()=>{if(!y.length)N(p(c({},Te({data:l,value:void 0,context:i},a)),{message:void 0,status:"success",data:l}));else {let P=new Map;y.forEach(B=>{let re=B.translatedPropertyName||B.fieldName||B.propertyName||"unknown";P.set(B.propertyName||B.fieldName||"unknown",re);});let E=Array.from(P.values()),k=E.length,Y,G=d.t("validator.separators.multiple");if(k<=3)Y=E.join(G);else {let B=E.slice(0,3),re=k-3,R=d.t("validator.fieldListOverflow",{count:re});Y=`${B.join(G)}${G}${R}`;}let z=d.translate("validator.classValidationFailed",{count:y.length,fieldCount:k,fields:Y});N(h.createClassError(z,{startTime:a,errors:y,fieldErrors:M,failureCount:y.length,duration:Date.now()-a,data:l}));}}))})}static validateObject(e,t,a){return A(this,null,function*(){let n={};Reflect.defineMetadata(ce,t,n);let i=yield this.validateClass(n,p(c({},a),{data:e}));return p(c({},i),{data:e})})}static object(e){let t={};return Reflect.defineMetadata(ce,e,t),{schema:t,validate:(a,n)=>this.validateObject(a,e,n)}}static validateBulk(e,i){return A(this,null,function*(){var o=i,{data:t,startTime:a}=o,n=U(o,["data","startTime"]);let s=this.getI18n(n);a=w(a)?a:Date.now();let l=[];if(!Array.isArray(t))return this.createBulkError(s.t("validator.invalidBulkData"),{startTime:a,failures:l,totalCount:0});let d=t.map((m,g)=>A(this,null,function*(){let y=yield h.validateClass(e,p(c({},n),{data:m,startTime:a}));return y.success!==true&&l.push(p(c({},y),{index:g+1})),y}));if(yield Promise.all(d),l.length>0){let m=l.length,g=t.length,y=m===g?"validator.bulkValidationAllFailed":"validator.bulkValidationFailed";return h.createBulkError(s.t(y,{count:m,failureCount:m,totalCount:g}),{failures:l,startTime:a,totalCount:g})}return {name:"ValidatorSuccessResult",duration:Date.now()-a,validatedAt:new Date,data:t,status:"success",success:true}})}static getClassRules(e){return typeof e=="function"?fe(e,ce):Object.assign({},Reflect.getMetadata(ce,e))}static getValidatorClassOptions(e){return Object.assign({},Reflect.getMetadata(er,e)||{})}static buildRuleDecorator(e,t,a){return t&&this._prepareRuleDecorator(e,t,a),(...n)=>this.createPropertyDecoratorFromRule(n,e,t,a)}static buildRuleArrayDecorator(e,t,a){return t&&this._prepareRuleDecorator(e,t,a),n=>this.createPropertyDecoratorFromRule(n,e,t,a)}static isSuccess(e){return D(e)&&e.success===true&&e.status=="success"&&e.name=="ValidatorSuccessResult"}static getBaseError({startTime:e}){return {__validatorBaseName:"ValidatorBaseError",failedAt:new Date,startTime:e,duration:Date.now()-e,success:false,status:"error",statusCode:400,errorCode:"ERR_VALIDATION_FAILED"}}static isBaseError(e){return D(e)?e.__validatorBaseName==="ValidatorBaseError"&&e.success===false&&e.failedAt&&e.statusCode===400&&e.errorCode==="ERR_VALIDATION_FAILED":false}static createError(e,t){return p(c(c({},this.getBaseError(t)),t),{failedAt:new Date,message:e,name:"ValidatorError"})}static createClassError(e,t){return p(c(c({},this.getBaseError(t)),t),{message:e,name:"ValidatorClassError",failedAt:new Date})}static createBulkError(e,t){let a=Array.isArray(t.failures)?t.failures:[];return p(c(c({},this.getBaseError(t)),t),{failures:a,failureCount:a.length,message:e,name:"ValidatorBulkError",failedAt:new Date})}static isError(e){return this.isBaseError(e)&&e.name=="ValidatorError"}static isClassError(e){return this.isBaseError(e)&&e.name=="ValidatorClassError"}static isBulkError(e){return this.isBaseError(e)&&e.name=="ValidatorBulkError"}static isAnyError(e){return this.isError(e)||this.isClassError(e)||this.isBulkError(e)}static _prepareRuleDecorator(e,t,a){return u(t)&&(h.registerRule(t,e),Ct(e,t)),a&&nr(e,a,{ruleName:t}),e}static createPropertyDecoratorFromRule(e,t,a,n){var i;return this._prepareRuleDecorator(t,a,n),a=f(a,n==null?void 0:n.toString(),t.name,(i=t.constructor)==null?void 0:i.name),Ct(t,a),h.buildPropertyDecorator({ruleName:a,ruleFunction:t,params:e})}static buildClassRuleDecorator(e,t){return this.buildRuleDecorator(e,void 0,t)}static buildMultiRuleDecorator(e,t){return a=>this.createPropertyDecoratorFromRule(a,e,void 0,t)}static buildIfRuleDecorator(e,t){return a=>this.createPropertyDecoratorFromRule([a],e,void 0,t)}static buildPropertyDecorator(e){return ve(ce,t=>[...Array.isArray(t)?t:[],...Array.isArray(e)?e:[e]])}};h.RULES_METADATA_KEY=Symbol.for("validationRules");var te=h;function Te(r,e){return p(c({},r),{status:"success",name:"ValidatorSuccessResult",success:true,validatedAt:new Date,duration:Date.now()-e})}var ce=Symbol.for("validatorClassRules"),er=Symbol.for("validatorClassOptions");function tr(r,e){if(typeof r!="function")return false;let t=rr(r,e);return !!(t!=null&&t.validatorRuleFuncMarked)}function rr(r,e){return typeof r!="function"?null:Object.assign({},r[e])}function Ct(r,e){typeof r=="function"&&(r[se.ruleName]=e);}function ar(r){if(typeof r=="function"){let e=r[se.ruleName];return u(e)?e:void 0}}function nr(r,e,t){var a;typeof r=="function"&&(r[e]=p(c({},t),{validatorRuleFuncMarked:true,ruleName:(a=t==null?void 0:t.ruleName)!=null?a:e}));}var I=class I extends Error{constructor(t,a){var n;super(t);this.__isBaseException=true;this.success=false;Object.setPrototypeOf(this,new.target.prototype),new.target===I?this.name=I.NAME:this.name=new.target.name||I.NAME,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.code=a==null?void 0:a.code,this.statusCode=a==null?void 0:a.statusCode,this.details=a==null?void 0:a.details,this.timestamp=(n=a==null?void 0:a.timestamp)!=null?n:new Date,this.cause=this.normalizeCause(a==null?void 0:a.cause),this.success=false;}toJSON(t){var o,s;let a=(o=t==null?void 0:t.stack)!=null?o:!ir()&&!!this.stack,n=(s=t==null?void 0:t.cause)!=null?s:true,i=Ye(t==null?void 0:t.maxCauseDepth,10);return p(c(c(p(c(c(c({__isBaseException:true,__baseExceptionName:I.NAME,name:this.name,message:this.message},this.code&&{code:this.code}),this.statusCode&&{statusCode:this.statusCode}),this.details&&{details:this.details}),{timestamp:this.timestamp.toISOString()}),a?{stack:this.stack}:{}),n&&this.cause?{cause:this.serializeCause(this.cause,i)}:{}),{success:false})}normalizeCause(t){return I.is(t)?this.normalizeCause(t.cause):t}serializeCause(t,a){if(a<=0)return "[Max Depth Reached]";if(t=this.normalizeCause(t),t instanceof Error){let n=t;return c(c(c(c({name:n.name,message:n.message},n.code?{code:n.code}:{}),n.statusCode?{statusCode:n.statusCode}:{}),n.timestamp?{timestamp:n.timestamp}:{}),n.cause?{cause:this.serializeCause(n.cause,a-1)}:{})}try{return K.stringify(t,!0,void 0,2)}catch(n){return J(t)}}toString(){let t=this.code?` [${this.code}]`:"";return `${this.name}${t}: ${this.message}`}static is(t){try{return t instanceof I||D(t)&&t.__isBaseException===!0&&typeof t.message=="string"&&t.success===!1&&t.__baseExceptionName===I.NAME}catch(a){return false}}static create(t,a){return new this(t,a)}static from(t,a){if(t instanceof this||t instanceof I)return this.withOptions(t,a);if(K.isJSON(t)){let n=K.parse(t);return this.from(n,a)}return this.createFromError(t,a)}static createFromError(t,a){var d;let n=this.parseErrorMessage(t,a),i=this.parseErrorDetails(t,a),o=f(a==null?void 0:a.code,i.code,i.errorCode),s=Ye(a==null?void 0:a.statusCode,i.statusCode,500);return this.create(n,p(c({},a),{details:i,code:o,statusCode:s,cause:(d=a==null?void 0:a.cause)!=null?d:t}))}static isValidatorClassError(t){return te.isClassError(t)}static isValidatorBulkError(t){return te.isBulkError(t)}static isValidatorError(t){return te.isError(t)}static isAnyValidatorError(t){return te.isAnyError(t)}static getValidatorError(t){return this.isAnyValidatorError(t)?t:this.is(t)&&this.isAnyValidatorError(t.cause)?t.cause:null}static parseErrorMessage(t,a){let n="";return D(t)?typeof t.message=="string"&&(n=t.message):typeof t=="string"&&(n=t),!n&&t instanceof Error&&(n=t.message),!n&&(a!=null&&a.fallbackMessage)&&(n=a.fallbackMessage),u(n)||(n=f(n,"Unknown Error")),n.trim().toLowerCase()==="undefined"&&(n="Unknown Error"),n}static parseErrorDetails(t,a){var n;return c(c({},D(t)?t:void 0),(n=a==null?void 0:a.details)!=null?n:{})}static withOptions(t,a){var n;return a!=null&&a.code&&(t.code=a.code),a!=null&&a.statusCode&&(t.statusCode=a.statusCode),a!=null&&a.details&&(t.details=c(c({},(n=t.details)!=null?n:{}),a.details)),t}static wrap(t,a){return A(this,null,function*(){try{return yield t()}catch(n){return I.throw(n,a)}})}static throw(t,a){throw I.from(t,a)}static tryCatchSync(t,a){try{return [null,t()]}catch(n){return [this.from(n,a),null]}}static tryCatch(t,a){return A(this,null,function*(){try{return [null,yield t()]}catch(n){return [this.from(n,a),null]}})}};I.NAME="BaseException",I.hooks=[];var Re=I,ir=()=>{var r;try{let t=Le().process;return ((r=t==null?void 0:t.env)==null?void 0:r.NODE_ENV)==="production"}catch(e){return false}};var de=class extends Re{constructor(){super(...arguments);this.name="AuthError";}};var Fe="user-session",Dt=1440*60*1e3,Be={get:r=>A(null,null,function*(){return L.get(r)}),set:(r,e)=>A(null,null,function*(){yield L.set(r,e);}),remove:r=>A(null,null,function*(){yield L.remove(r);})},b=class b{static configure(e){e.sessionTTL!==void 0&&(b.config.sessionTTL=e.sessionTTL),e.storage&&(b.config.storage=e.storage),e.masterAdminCheck&&(b.isMasterAdmin=e.masterAdminCheck);}static _isMasterAdmin(e){return A(this,null,function*(){var t;return e=this.isValidUser(e)?e:(t=yield b.getSignedUser())!=null?t:void 0,typeof b.isMasterAdmin=="function"?yield b.isMasterAdmin(e):false})}static isSessionValid(e){return e?Date.now()-e<=(b.config.sessionTTL||Dt):true}static getSignedUser(){return A(this,null,function*(){if(this.isValidUser(b.localUserRef.current))return b.isSessionValid(b.localUserRef.current.sessionCreatedAt)||(b.localUserRef.current=null),b.localUserRef.current;try{let e=yield this.secureStorage.get(Fe);if(!e)return null;let t=K.parse(e);return this.isValidUser(t)?(b.isSessionValid(t.sessionCreatedAt)||(b.localUserRef.current=null),b.localUserRef.current=t,t):(H.log("Invalid user structure in storage"),null)}catch(e){throw H.log(b.name,"Error getting signed user:",e),de.from(e)}})}static refreshSignedUser(){return A(this,null,function*(){return b.localUserRef.current=null,yield b.getSignedUser()})}static setSignedUser(e,t){return A(this,null,function*(){try{let a=e;if(this.isValidUser(e)&&(a=p(c({},e),{sessionCreatedAt:new Date().getTime()})),a){let n=JSON.stringify(a);yield this.secureStorage.set(Fe,n);}else yield this.secureStorage.remove(Fe);if(b.localUserRef.current=a,t){let n=a?"SIGN_IN":"SIGN_OUT";b.events.trigger(n,a);}return a}catch(a){throw H.log("Error setting signed user:",a),new de("Failed to store user session")}})}static signIn(e,t=true){return A(this,null,function*(){return yield b.setSignedUser(e,t)})}static signOut(e=true){return A(this,null,function*(){yield b.setSignedUser(null,e);})}static isResourceActionTupleArray(e){return Array.isArray(e)&&e.length===2&&u(e[0])&&u(e[1])}static isResourceActionTupleObject(e){return !Array.isArray(e)&&typeof e=="object"&&D(e)&&u(e.resourceName)&&u(e.action)}static isValidUser(e){return !(!e||typeof e!="object"||Array.isArray(e)||q(e))}static isAllowed(e,t){return A(this,null,function*(){if(typeof e=="boolean")return e;if(t=this.isValidUser(t)?t:yield this.getSignedUser(),!this.isValidUser(t))return false;if((yield this._isMasterAdmin(t))||!e)return true;if(typeof e=="function")return !!e(t);if(b.isResourceActionTupleObject(e)){if(b.checkUserPermission(t,e.resourceName,e.action))return true}else if(b.isResourceActionTupleArray(e)){if(b.checkUserPermission(t,e[0],e[1]))return true}else if(Array.isArray(e)){for(let n of e)if(b.isResourceActionTupleArray(n)){if(b.checkUserPermission(t,n[0],n[1]))return true}else if(b.isResourceActionTupleObject(n)&&b.checkUserPermission(t,n.resourceName,n.action))return true}return false})}static checkUserPermission(e,t,a="read"){if(!this.isValidUser(e))return false;if(D(e.perms)&&e.perms&&b.checkPermission(e.perms,t,a))return true;if(Array.isArray(e==null?void 0:e.roles)){for(let n of e.roles)if(D(n)&&D(n.perms)&&b.checkPermission(n.perms,t,a))return true;return false}return false}static checkPermission(e,t,a="read"){if(t=u(t)?t:"",!D(e)||!t)return false;let n=String(t).trim().toLowerCase();a=u(a)?a:"read";let i=[],o=Object.entries(e).find(([s])=>String(s).toLowerCase().trim()===n);if(o&&Array.isArray(o[1])&&(i=o[1]),!Array.isArray(i)||!i.length)return false;if(i.includes("all"))return true;for(let s of i)if(b.isAllowedForAction(s,a))return true;return false}static isAllowedForAction(e,t){return !u(t)||!u(e)?false:String(t).trim().toLowerCase()===String(e).trim().toLowerCase()}static get secureStorage(){let e=Reflect.getMetadata(b.authStorageMetaData,b);return Ke(e)&&(this._secureStorage=e),this._secureStorage?this._secureStorage:Be}static set secureStorage(e){Ke(e)&&Reflect.defineMetadata(b.authStorageMetaData,e,b);}};b.events=je({}),b.localUserRef={current:null},b.config={sessionTTL:Dt,storage:Be},b._secureStorage=Be,b.authStorageMetaData=Symbol("auth:storage:meta");var Ue=b;function Zi(){return function(r){try{let e=new r;if(!Ke(e))return;Ue.secureStorage=e;}catch(e){H.error(e," registering secure storage");}}}var Ke=r=>{if(!r)return false;try{return ["get","set","remove"].every(e=>typeof r[e]=="function")}catch(e){return false}};exports.AttachAuthSecureStorage=Zi;exports.Auth=Ue;exports.AuthError=de;
5
+ %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var xt={auth:Ze,currencies:Je,countries:We,dates:Qe,resources:qe,validator:Xe};function Nt(r){return typeof r=="boolean"||!r||typeof r=="number"||typeof r=="string"||typeof r=="symbol"?false:Object(r).constructor===Promise||r.constructor&&(r.constructor.name==="Promise"||r.constructor.name==="AsyncFunction")||r instanceof Promise||typeof(r==null?void 0:r.then)=="function"&&typeof(r==null?void 0:r.catch)=="function"&&typeof(r==null?void 0:r.finally)=="function"?true:r&&typeof r.constructor=="function"&&Function.prototype.toString.call(r.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function Ne(r){return r&&Object.prototype.toString.call(r)==="[object Promise]"?true:Nt(r)}function _e(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var ye=()=>{var r;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((r=process==null?void 0:process.versions)!=null&&r.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},At=()=>{var r,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((r=window==null?void 0:window.process)==null?void 0:r.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},Pt=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(r){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},wt=()=>typeof window=="undefined"&&typeof process!="undefined",et=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Et=()=>{if(!_e()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let r=navigator.userAgent.toLowerCase();return /android/i.test(r)},Ot=()=>{var r;return !et()||!(window!=null&&window.ReactNativeWebView)?false:typeof((r=window==null?void 0:window.ReactNativeWebView)==null?void 0:r.postMessage)=="function"},Vt=()=>ye()&&process.platform==="darwin",kt=()=>ye()&&process.platform==="win32",It=()=>ye()&&process.platform==="linux",tt={isWeb:_e,isLinux:It,isDarwin:Vt,isWin32:kt,isNode:ye,isElectron:At,isTouchDevice:Pt,isServerSide:wt,isClientSide:et,isAndroidMobileBrowser:Et,isReactNativeWebview:Ot};function u(r){return !!(r&&typeof r=="string")}var K=class r{static decycle(e,t=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(t.includes(e))return null;let a=t.concat([e]);return Array.isArray(e)?e.map(n=>r.decycle(n,a)):Object.fromEntries(Object.entries(e).map(([n,i])=>[n,r.decycle(i,a)]))}static stringify(e,t=false,a,n){return typeof e=="string"?e:JSON.stringify(t!==false?r.decycle(e):e,a,n)}static isJSON(e){if(typeof e!="string")return false;let t=e.trim();if(t.length===0)return false;try{let a=JSON.parse(t);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(e,t){if(typeof e=="string")try{e=JSON.parse(e,t);}catch(a){return e}if(e&&typeof e=="object")for(let a in e){let n=e[a];r.isJSON(n)&&(e[a]=r.parse(n,t));}return e}};var Q=class Q{static get storage(){var t;let e=Reflect.getMetadata(Q.sessionStorageMetaData,Q);if(Ae(e)&&(this._storage=e),this._storage)return this._storage;if(tt.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((t=window.localStorage)!=null&&t.getItem))this._storage={get:a=>window.localStorage.getItem(a),set:(a,n)=>window.localStorage.setItem(a,n),remove:a=>window.localStorage.removeItem(a),removeAll:()=>window.localStorage.clear()};else {let a={};this._storage={get:n=>a[n],set:(n,i)=>a[n]=i,remove:n=>{delete a[n];},removeAll:()=>a={}};}return this._storage}static set storage(e){Ae(e)&&Reflect.defineMetadata(Q.sessionStorageMetaData,e,Q);}static get keyNamespace(){return u(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){u(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!u(e))return "";e=e.trim().replace(/\s+/g,"-");let t=this.keyNamespace;return t?`${t}-${e}`:e}};Q.sessionStorageMetaData=Symbol("sessionStorage"),Q._keyNamespace=void 0;var $=Q;function ge(r){return $.sanitizeKey(r)}var rt=(r,e)=>(r=r&&K.stringify(r,e),r==null&&(r=""),r),at=r=>{if(Ne(r))return new Promise((e,t)=>{r.then(a=>{e(K.parse(a));}).catch(a=>{t(a);});});if(r!=null)return K.parse(r)},Yt=r=>{if(r=ge(r),$.storage&&r&&typeof r=="string"){let e=$.storage.get(r);return at(e)}},Lt=r=>{if(r=ge(r),$.storage&&r&&typeof r=="string")return $.storage.remove(r)},Ft=()=>{if($.storage)return $.storage.removeAll()},Ae=r=>{if(!r)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof r[e]=="function")}catch(e){return false}},L={get:Yt,set:(r,e,t=true)=>(r=ge(r),$.storage.set(r,rt(e,t))),remove:Lt,handleGetValue:at,sanitizeKey:ge,handleSetValue:rt,isValidStorage:Ae,Manager:$,removeAll:Ft};function f(...r){for(var e in r){let t=r[e];if(u(t))return t}return ""}function q(r){return r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"}function ae(r){if(r instanceof RegExp)return true;if(!r||typeof r!="object"||!Object.prototype.toString.call(r).includes("RegExp"))return false;try{return new RegExp(r),!0}catch(e){return false}}function le(r){return !r||typeof r!="object"?false:r instanceof Date?true:typeof r.getTime!="function"?false:!(Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))}function Pe(r){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:r===document?true:"HTMLElement"in window?!!r&&r instanceof HTMLElement:!!r&&typeof r=="object"&&r.nodeType===1&&!!r.nodeName}function D(r){if(r===null||typeof r!="object"||Pe(r)||le(r)||ae(r)||q(r))return false;let e=Object.getPrototypeOf(r);if(e===null)return true;let t=e.constructor;if(typeof t!="function")return false;if(t===Object)return true;let a=t.prototype;return typeof a!="object"?false:a===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function we(r){if(Array.isArray(r)){let a=[];for(var e=0;e<r.length;e++)a[e]=we(r[e]);return a}else if(D(r)&&r){let a={};for(var t in r)r.hasOwnProperty(t)&&(a[t]=we(r[t]));return a}else return r}Object.getSize=function(r,e=false){if(!r||typeof r!="object")return 0;if(Array.isArray(r))return r.length;typeof e!="boolean"&&(e=false);let t=0;for(let a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&(t++,e===true))return t;return t};function ne(r,...e){let t=Array.isArray(r),a=D(r);(r==null||!t&&!a)&&(r={});for(let n=0;n<e.length;n++){let i=e[n];if(i==null)continue;let o=D(i),s=Array.isArray(i);if(!(!o&&!s)){if(t){s&&nt(r,i);continue}else if(s)continue;for(let l in i){let d=i[l];if(d==null)continue;if(d===i){r[l]=r;continue}let m=r[l],g=Array.isArray(m),y=Array.isArray(d);if(g){y?nt(r[l],d):r[l]=d;continue}else if(!D(m)){r[l]=d;continue}if(y||!D(d)){r[l]=d;continue}r[l]=ne({},m,d);}}}return r}var nt=(r,e)=>{let t=e.length,a=0;for(let n=0;n<r.length;n++){let i=r[n],o=e[n];if(n<t){let s=Array.isArray(i),l=Array.isArray(o),d=D(i),m=D(o);s&&l||d&&m?(r[a]=ne(s?[]:{},i,o),a++):o!=null?(r[a]=o,a++):i!=null&&(r[a]=i,a++);}}for(let n=r.length;n<t;n++)e[n]!==void 0&&e[n]!==null&&r.push(e[n]);return r};function be(r,e){return pe(r,"",{},e)}function pe(r,e="",t={},a){if(t=D(t)?t:{},q(r)||le(r)||ae(r)||Array.isArray(r)&&(a!=null&&a.skipArrays))return e&&(t[e]=r),t;if(typeof r=="function"||typeof r=="object"&&!D(r)&&!Bt(r))return t;if(r instanceof Map||r instanceof WeakMap)return Array.from(r.entries()).forEach(([n,i])=>{let o=e?`${e}[${String(n)}]`:String(n);pe(i,o,t,a);}),t;if(Array.isArray(r)||r instanceof Set||r instanceof WeakSet)return (Array.isArray(r)?r:Array.from(r)).forEach((i,o)=>{let s=e?`${e}[${o}]`:String(o);pe(i,s,t,a);}),t;if(D(r))for(let n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;let i=r[n],o=e?e.endsWith("]")?`${e}.${n}`:`${e}.${n}`:n;pe(i,o,t,a);}return t}function Bt(r){return Array.isArray(r)||r instanceof Set||r instanceof Map||r instanceof WeakMap||r instanceof WeakSet}function Ut(r){return Object.entries(r)}Object.typedEntries=Ut;Object.flatten=be;Object.clone=we;function ue(r,e){if(r==null)return "";if(typeof r=="string")return r;if((typeof r=="number"||typeof r=="object"&&r instanceof Number)&&typeof r.formatNumber=="function")return r.formatNumber();if(r instanceof Date||typeof r=="object"&&r!==null&&r.constructor===Date)return typeof r.toFormat=="function"?r.toFormat():r.toISOString();if(r instanceof Error)return `Error: ${r.message}`;if(ae(r))return r.toString();if(q(r))return String(r);if(Array.isArray(r))return JSON.stringify(r);if(typeof r=="object"&&r!==null){if(typeof r.toString=="function"&&r.toString!==Object.prototype.toString)return r.toString();if(typeof r.toString=="function"){let t=r.toString();if(t!=="[object Object]")return t}return JSON.stringify(r)}return typeof(r==null?void 0:r.toString)=="function"?r.toString():String(r)}function it(r,e,t){let a=(t==null?void 0:t.valueFormatter)||ue,n=f(r);if(!D(e)||!e)return n;let i=(t==null?void 0:t.tagRegex)||/%\{([^}]+)\}/g,o=new Set,s,l=f(r);for(;(s=i.exec(l))!==null;){let d=s[1];d!==void 0&&o.add(d);}return o.forEach(d=>{if(t!=null&&t.tagRegex){let C=new RegExp(t.tagRegex.source,t.tagRegex.flags);[...l.matchAll(C)].forEach(x=>{let O=x[0];if(!x[1])return;let N=x[1],T=Object.prototype.hasOwnProperty.call(e,N)?e[N]:void 0,P=T===void 0?"":(()=>{try{return a(T,N,ue)}catch(k){return ue(T)}})(),E=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(E,"g"),P);});return}let m=`%{${d}}`,g=Object.prototype.hasOwnProperty.call(e,d)?e[d]:void 0,y=g===void 0?"":(()=>{try{return a(g,d,ue)}catch(C){return ue(g)}})(),M=m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(M,"g"),y);}),n}function w(r){return typeof r=="number"&&!isNaN(r)&&isFinite(r)}var F=class F{constructor(e={},t={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;u(t.locale)&&(this.locale=t.locale),u(t.fallbackLocale)&&(this._fallbackLocale=t.fallbackLocale),typeof t.interpolate=="function"&&(this.interpolateFunc=t.interpolate),this._hasDefaultTranslations||(this.registerTranslations(xe),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!F.instance){let t=F.getLocaleFromSession(),a=Object.assign({locale:t||"en"},e);F.instance=new F({},a);}return F.instance}static createInstance(e={},t={}){return new F(e,t)}static flattenObject(e){return D(e)?be(e):e}static getLocaleFromSession(){let e=L.get("i18n.locale");return u(e)?e:void 0}static registerMomentLocale(e,t){return u(e)&&D(t)&&Array.isArray(t.months)&&(this.momentLocales[e]=ne({},this.momentLocales[e],t)),this.momentLocales}static getClassTanslationKeys(e){return fe(e,ot)}translate(e,t){var o;t=t||{};let a=f(t==null?void 0:t.locale,this.getLocale()),n=Array.isArray(e)?e:[e],i;for(let s of n){if(!u(s))continue;let l=this.lookup(s,a);if(l===void 0&&a!==this._fallbackLocale&&(l=this.lookup(s,this._fallbackLocale)),l!==void 0){i=l;break}}if(i===void 0)return t.defaultValue!==void 0?t.defaultValue:this.missingTranslation(e,t);if(typeof t.count=="number"&&D(i)){let s=t.count,l="other";s===0&&i.zero!==void 0?l="zero":s===1&&i.one!==void 0&&(l="one"),i[l]!==void 0?i=i[l]:i.other&&(i=i.other);}return typeof i=="string"&&(w(t.count)&&!t.countStr&&(t.countStr=typeof((o=t.count)==null?void 0:o.formatNumber)=="function"?t.count.formatNumber():t.count.toString()),i=this.performInterpolation(i,t)),i}t(e,t){return this.translate(e,t)}has(e,t){let a=t||this.getLocale(),n=Array.isArray(e)?e:[e];for(let i of n)if(this.lookup(i,a)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,t=false){return A(this,null,function*(){return this.locale===e&&t!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&F.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),t=Array.isArray(this._locales)?this._locales:["en"],a=[...e,...t.filter(n=>!e.includes(n))];return Array.from(new Set(a))}hasLocale(e){return u(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===F.instance}registerTranslations(e){return this._translations=ne({},this._translations,e),this._translations}getTranslations(e){return u(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,t){if(!u(e)||typeof t!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=t;}loadNamespace(e,t,a=true){return !u(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(t=f(t,this.getLocale()),u(t)?this.namespaceResolvers[e](t).then(n=>{let i={};return i[t]=Object.assign({},n),D(n)&&a!==false&&this.registerTranslations(i),i}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,t=true){return A(this,null,function*(){e=f(e,this.getLocale());let a=[],n={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&a.push(this.namespaceResolvers[o](e).then(s=>{ne(n,s);}));yield Promise.all(a);let i={};return i[e]=n,t!==false&&this.registerTranslations(i),this._namespacesLoaded[e]=true,i})}get(e,t){t=f(t,this.getLocale());let a=(u(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(u);if(!a.length)return;let n=this.getTranslations(t);for(let i of a)if(D(n))n=n[i];else return;return n}translateClass(e,t){let a=F.getClassTanslationKeys(e);for(let n in a)u(a[n])&&(a[n]=this.translate(a[n],t));return a}translateObject(e,t){if(!D(e))return {};let a={};for(let n in e){let i=e[n];u(i)&&(a[n]=this.translate(i,t));}return a}applyTranslations(e){try{let t=Object.getOwnPropertyNames(e);for(let a of t){let n=Reflect.getMetadata(ot,e,a);if(n)try{e[a]=this.translate(n);}catch(i){H.error(i," resolving translation for key : ",n," on object : ",e);}}}catch(t){H.error(t," resolving translations for object : ",e);}}missingTranslation(e,t){let a=f(Array.isArray(e)?e.filter(u)[0]:f(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,a,f(t==null?void 0:t.defaultValue),t):a}lookup(e,t){let a=this._translations[t];if(!a)return;if(Object.prototype.hasOwnProperty.call(a,e))return a[e];let n=e.split("."),i=a;for(let o of n)if(D(i)&&Object.prototype.hasOwnProperty.call(i,o))i=i[o];else return;return i}performInterpolation(e,t){let a=be(t);return this.interpolateFunc?this.interpolateFunc(this,e,t):this.defaultInterpolator(e,a)}defaultInterpolator(e,t){return it(e,t,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){L.set("i18n.locale",e);}getMomentLocale(e){return F.momentLocales[e]}setMomentLocale(e){try{return ee__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(t){console.error(t," setting moment locale : ",e);}return false}};F.momentLocales={};var X=F,he=X.getInstance();var ot=Symbol("TRANSLATION_KEY");function ie(r){return !!(r==null||typeof r=="undefined"||typeof r=="string"&&r===""||Array.isArray(r)&&!r.length)}var S=class S{static parseString(e,t){if(u(e)&&u(t))try{let a=ee__default.default(e,t,!0);if(a.isValid())return {date:a.toDate(),matchedFormat:t,isValid:!0}}catch(a){}try{if(Array.isArray(t)&&(t!=null&&t.length))for(let a of t){let n=st(e,a);if(n)return n}for(let a of S.DATE_FORMATS){let n=st(e,a);if(n)return n}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(a){return {date:null,matchedFormat:null,isValid:false,error:a instanceof Error?a.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let t=e?S.parseDate(e):new Date;return t?t.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,t){if(S.isDateObj(e))return e;if(!u(t)){let a=S.parseString(e);return a!=null&&a.isValid?a.date:null}if(ie(e))return null;try{let a=ee__default.default(e,t,!0);if(a!=null&&a.isValid())return a.toDate()}catch(a){console.error(a," parsing date with moment : ",e," format is : ",t);}return null}static toSQLDateTimeFormat(e){if(!S.isDateObj(e))return "";let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return `${t}-${a}-${n} ${i}:${o}:${s}`}static getI18n(e){return X.isI18nInstance(e)?e:X.getInstance()}static getDefaultDateTimeFormat(e){return f(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return f(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!S.isDateObj(e))return "";let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return `${t}-${a}-${n}`}static toSQLTimeFormat(e){if(!S.isDateObj(e))return "";let t=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),n=String(e.getSeconds()).padStart(2,"0");return `${t}:${a}:${n}`}static getDefaultTimeFormat(e){return f(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,t){if(e==null||typeof e=="boolean")return false;if(S.isDateObj(e))return true;if(w(e)){let n=new Date(e);return n&&!isNaN(n.getTime())}if(u(e))return !!S.parseDate(e,t);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let a=new Date(e);return S.isDateObj(a)}static addToDate(e,t,a){if(w(e)||(e=0),ie(t)&&(t=new Date),S.isValidDate(t)&&u(t)&&(t=new Date(t)),S.isValidDate(t)||(t=u(t)?new Date(t):new Date),u(a)&&typeof t["set"+a]=="function"&&typeof t["get"+a]=="function"){let n="set"+a,i="get"+a;t=new Date(t[n](t[i]()+e));}return t}static addDays(e,t){return S.addToDate(e,t,"Date")}static addMilliseconds(e,t){return w(e)||(e=0),S.isDateObj(t)||(t=new Date),t=t||new Date,new Date(t.getTime()+e)}static addSeconds(e,t){return w(e)||(e=0),S.addMilliseconds(e*1e3,t)}static addMinutes(e,t){return w(e)||(e=0),S.addMilliseconds(e*6e4,t)}static addHours(e,t){return w(e)||(e=0),S.addMilliseconds(e*36e5,t)}static addMonths(e,t,a){return S.addToDate(e,t,"Month")}static addWeeks(e,t){return e=(w(e)?e:0)*7,S.addToDate(e,t,"Date")}static addYears(e,t){w(e)||(e=0);let a=new Date(S.addToDate(0,t)),n=a.getFullYear();return n+e<0?e=0:e+=n,a.setFullYear(e),new Date(a)}static formatDate(e,t){try{let a=ee__default.default(e);if(a.isValid())return a.format(f(t,S.getDefaultDateTimeFormat()))}catch(a){}return f(S.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let t=e?ee__default.default.utc(e):ee__default.default.utc();return {year:t.year(),day:t.day(),month:t.month(),monthString:t.format("MM"),hours:t.hours(),date:t.date(),minutes:t.minutes(),seconds:t.seconds(),monthName:t.format("MMMM"),dayName:t.format("dddd"),dayNameShort:t.format("ddd")}}};S.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],S.SQL_DATE_FORMAT="YYYY-MM-DD",S.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",S.SQL_TIME_FORMAT="HH:mm:ss",S.getCurrentMonthDaysRange=e=>{let t=S.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getFullYear(),t.getMonth(),1),n=new Date(t.getFullYear(),t.getMonth()+1,0);return {first:a,last:n}},S.getPreviousWeekDaysRange=e=>{let t=S.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=new Date(t.getTime()-3600*24*7*1e3),n=new Date(a),i=a.getDay(),o=a.getDate()-i+(i===0?-6:1),s=new Date(a.setDate(o)),l=new Date(n.setDate(o+6));return {first:s,last:l}},S.getCurrentWeekDaysRange=e=>{let t=S.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),a=t.getDay(),n=t.getDate()-a+(a==0?-6:1),i=new Date(t),o=new Date(t.setDate(n));return i.setDate(i.getDate()+6),{first:o,last:i}},S.isDateObj=le;var V=S,st=(r,e)=>{let t=ee__default.default(r,e,true);try{if(t.isValid()&&t.format(e)===r||ee__default.default.utc(t,!0).format(e)===r)return {date:t.toDate(),matchedFormat:e,isValid:!0}}catch(a){}return null};Date.prototype.toSQLDateTimeFormat=function(){return V.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return V.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return V.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(r){return V.formatDate(this,r)};Date.prototype.addYears=function(r){return V.addYears(r,this)};Date.prototype.addMonths=function(r){return V.addMonths(r,this)};Date.prototype.addMinutes=function(r){return V.addMinutes(r,this)};Date.prototype.addSeconds=function(r){return V.addSeconds(r,this)};Date.prototype.addDays=function(r){return V.addDays(r,this)};Date.prototype.addWeeks=function(r){return V.addWeeks(r,this)};Date.prototype.addHours=function(r){return V.addHours(r,this)};var W=class W{static get logger(){let e=Reflect.getMetadata(W.loggerMetaData,W);return lt(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){lt(e)&&Reflect.defineMetadata(W.loggerMetaData,e,W);}static _log(e,...t){let a=W.logger;e=f(e),e&&typeof a[e]=="function"?a[e](W.getDateTimeString(),...t):console.log("Logger level not found : [",e,"]",...t);}static getDateTimeString(){let{day:e,year:t,hours:a,minutes:n,seconds:i,dayNameShort:o,monthName:s}=V.getUTCDateTimeDetails(),l=e<10?"0"+e:e,d=a<10?"0"+a:a,m=n<10?"0"+n:n,g=i<10?"0"+i:i;return "["+[o,l,s,t].join(" ")+" "+[d,m,g].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};W.loggerMetaData=Symbol("logger-meta-data");var H=W,lt=r=>{if(!r)return false;try{return ["warn","info","error"].every(e=>typeof r[e]=="function")}catch(e){return false}};var ut=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.startsWith(e)&&t>=0;)r=r.slice(e.length),--t;return r.toString()},ct=function(r,e=""){if(!r||typeof r!="string")return "";if(!e||typeof e!="string")return r.trim();let t=r.length;for(;r.endsWith(e)&&t>=0;)r=r.slice(0,-e.length),--t;return r.toString()},Ht=(r,e=true)=>typeof r!="string"?false:e!==false?/^\d*\.?\d+$/.test(r):/^\d+$/.test(r);String.prototype.ltrim=function(r){return ut(this.toString(),r)};String.prototype.rtrim=function(r){return ct(this.toString(),r)};String.prototype.isNumber=function(r=true){return Ht(this.toString(),r)};String.prototype.replaceAll=function(r,e){return !u(r)||!u(e)?this.toString():this.toString().split(r).join(e)};var Gt=r=>u(r)?(r=r.trim(),r.replace(/(.)([A-Z][a-z]+)/,"$1_$2").replace(/([a-z0-9])([A-Z])/,"$1_$2").toUpperCase()):"";String.prototype.toSnakeCase=function(){return Gt(this.toString())};var $t=r=>u(r)?(r=r.trim(),r.charAt(0)+r.replace(/(_\w)/g,e=>e[1].toUpperCase()).substring(1)):"";String.prototype.toCamelCase=function(){return $t(this.toString())};var zt=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toUpperCase()+r.slice(1))};String.prototype.upperFirst=function(){return zt(this.toString())};var Ee=function(r){return !r||typeof r!="string"?"":(r=r.trim(),r.charAt(0).toLowerCase()+r.slice(1))};String.prototype.lowerFirst=function(){return Ee(this.toString())};var j={USD:{symbol:"$",name:"US Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"USD",namePlural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbolNative:"$",decimalDigits:2,format:"%s %v",rounding:0,code:"CAD",namePlural:"Canadian dollars"},EUR:{symbol:"\u20AC",name:"Euro",symbolNative:"\u20AC",decimalDigits:2,rounding:0,code:"EUR",namePlural:"euros"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbolNative:"\u062F.\u0625.\u200F",decimalDigits:2,rounding:0,code:"AED",namePlural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbolNative:"\u060B",decimalDigits:0,rounding:0,code:"AFN",namePlural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbolNative:"Lek",decimalDigits:0,rounding:0,code:"ALL",namePlural:"Albanian lek\xEB"},AMD:{symbol:"AMD",name:"Armenian Dram",symbolNative:"\u0564\u0580.",decimalDigits:0,rounding:0,code:"AMD",namePlural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"ARS",namePlural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"AUD",namePlural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbolNative:"\u043C\u0430\u043D.",decimalDigits:2,rounding:0,code:"AZN",namePlural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbolNative:"KM",decimalDigits:2,rounding:0,code:"BAM",namePlural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbolNative:"\u09F3",decimalDigits:2,rounding:0,code:"BDT",namePlural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbolNative:"\u043B\u0432.",decimalDigits:2,rounding:0,code:"BGN",namePlural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbolNative:"\u062F.\u0628.\u200F",decimalDigits:2,rounding:0,code:"BHD",namePlural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbolNative:"FBu",decimalDigits:0,rounding:0,code:"BIF",namePlural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BND",namePlural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbolNative:"Bs",decimalDigits:2,rounding:0,code:"BOB",namePlural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbolNative:"R$",decimalDigits:2,rounding:0,code:"BRL",namePlural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbolNative:"P",decimalDigits:2,rounding:0,code:"BWP",namePlural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbolNative:"BYR",decimalDigits:0,rounding:0,code:"BYR",namePlural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"BZD",namePlural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbolNative:"FrCD",decimalDigits:2,rounding:0,code:"CDF",namePlural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbolNative:"CHF",decimalDigits:2,rounding:.05,code:"CHF",namePlural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"CLP",namePlural:"Chilean pesos"},CNY:{symbol:"CN\xA5",name:"Chinese Yuan",symbolNative:"CN\xA5",decimalDigits:2,rounding:0,code:"CNY",namePlural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbolNative:"$",decimalDigits:0,rounding:0,code:"COP",namePlural:"Colombian pesos"},CRC:{symbol:"\u20A1",name:"Costa Rican Col\xF3n",symbolNative:"\u20A1",decimalDigits:0,rounding:0,code:"CRC",namePlural:"Costa Rican col\xF3ns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbolNative:"CV$",decimalDigits:2,rounding:0,code:"CVE",namePlural:"Cape Verdean escudos"},CZK:{symbol:"K\u010D",name:"Czech Republic Koruna",symbolNative:"K\u010D",decimalDigits:2,rounding:0,code:"CZK",namePlural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbolNative:"Fdj",decimalDigits:0,rounding:0,code:"DJF",namePlural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"DKK",namePlural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbolNative:"RD$",decimalDigits:2,rounding:0,code:"DOP",namePlural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbolNative:"\u062F.\u062C.\u200F",decimalDigits:2,rounding:0,code:"DZD",namePlural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbolNative:"kr",decimalDigits:2,rounding:0,code:"EEK",namePlural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbolNative:"\u062C.\u0645.\u200F",decimalDigits:2,rounding:0,code:"EGP",namePlural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbolNative:"Nfk",decimalDigits:2,rounding:0,code:"ERN",namePlural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbolNative:"Br",decimalDigits:2,rounding:0,code:"ETB",namePlural:"Ethiopian birrs"},GBP:{symbol:"\xA3",name:"British Pound Sterling",symbolNative:"\xA3",decimalDigits:2,rounding:0,code:"GBP",namePlural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbolNative:"GEL",decimalDigits:2,rounding:0,code:"GEL",namePlural:"Georgian laris"},GHS:{symbol:"GH\u20B5",name:"Ghanaian Cedi",symbolNative:"GH\u20B5",decimalDigits:2,rounding:0,code:"GHS",namePlural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbolNative:"FG",decimalDigits:0,rounding:0,code:"GNF",namePlural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbolNative:"Q",decimalDigits:2,rounding:0,code:"GTQ",namePlural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"HKD",namePlural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbolNative:"L",decimalDigits:2,rounding:0,code:"HNL",namePlural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbolNative:"kn",decimalDigits:2,rounding:0,code:"HRK",namePlural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbolNative:"Ft",decimalDigits:0,rounding:0,code:"HUF",namePlural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbolNative:"Rp",decimalDigits:0,rounding:0,code:"IDR",namePlural:"Indonesian rupiahs"},ILS:{symbol:"\u20AA",name:"Israeli New Sheqel",symbolNative:"\u20AA",decimalDigits:2,rounding:0,code:"ILS",namePlural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbolNative:"\u099F\u0995\u09BE",decimalDigits:2,rounding:0,code:"INR",namePlural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbolNative:"\u062F.\u0639.\u200F",decimalDigits:0,rounding:0,code:"IQD",namePlural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbolNative:"\uFDFC",decimalDigits:0,rounding:0,code:"IRR",namePlural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Kr\xF3na",symbolNative:"kr",decimalDigits:0,rounding:0,code:"ISK",namePlural:"Icelandic kr\xF3nur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"JMD",namePlural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbolNative:"\u062F.\u0623.\u200F",decimalDigits:2,rounding:0,code:"JOD",namePlural:"Jordanian dinars"},JPY:{symbol:"\xA5",name:"Japanese Yen",symbolNative:"\uFFE5",decimalDigits:0,rounding:0,code:"JPY",namePlural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbolNative:"Ksh",decimalDigits:2,rounding:0,code:"KES",namePlural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbolNative:"\u17DB",decimalDigits:2,rounding:0,code:"KHR",namePlural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbolNative:"FC",decimalDigits:0,rounding:0,code:"KMF",namePlural:"Comorian francs"},KRW:{symbol:"\u20A9",name:"South Korean Won",symbolNative:"\u20A9",decimalDigits:0,rounding:0,code:"KRW",namePlural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbolNative:"\u062F.\u0643.\u200F",decimalDigits:2,rounding:0,code:"KWD",namePlural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbolNative:"\u0442\u04A3\u0433.",decimalDigits:2,rounding:0,code:"KZT",namePlural:"Kazakhstani tenges"},LBP:{symbol:"LB\xA3",name:"Lebanese Pound",symbolNative:"\u0644.\u0644.\u200F",decimalDigits:0,rounding:0,code:"LBP",namePlural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbolNative:"SL Re",decimalDigits:2,rounding:0,code:"LKR",namePlural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbolNative:"Lt",decimalDigits:2,rounding:0,code:"LTL",namePlural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbolNative:"Ls",decimalDigits:2,rounding:0,code:"LVL",namePlural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbolNative:"\u062F.\u0644.\u200F",decimalDigits:2,rounding:0,code:"LYD",namePlural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbolNative:"\u062F.\u0645.\u200F",decimalDigits:2,rounding:0,code:"MAD",namePlural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbolNative:"MDL",decimalDigits:2,rounding:0,code:"MDL",namePlural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbolNative:"MGA",decimalDigits:0,rounding:0,code:"MGA",namePlural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbolNative:"MKD",decimalDigits:2,rounding:0,code:"MKD",namePlural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbolNative:"K",decimalDigits:0,rounding:0,code:"MMK",namePlural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbolNative:"MOP$",decimalDigits:2,rounding:0,code:"MOP",namePlural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbolNative:"MURs",decimalDigits:0,rounding:0,code:"MUR",namePlural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"MXN",namePlural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbolNative:"RM",decimalDigits:2,rounding:0,code:"MYR",namePlural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbolNative:"MTn",decimalDigits:2,rounding:0,code:"MZN",namePlural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbolNative:"N$",decimalDigits:2,rounding:0,code:"NAD",namePlural:"Namibian dollars"},NGN:{symbol:"\u20A6",name:"Nigerian Naira",symbolNative:"\u20A6",decimalDigits:2,rounding:0,code:"NGN",namePlural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan C\xF3rdoba",symbolNative:"C$",decimalDigits:2,rounding:0,code:"NIO",namePlural:"Nicaraguan c\xF3rdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbolNative:"kr",decimalDigits:2,rounding:0,code:"NOK",namePlural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbolNative:"\u0928\u0947\u0930\u0942",decimalDigits:2,rounding:0,code:"NPR",namePlural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"NZD",namePlural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbolNative:"\u0631.\u0639.\u200F",decimalDigits:2,rounding:0,code:"OMR",namePlural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbolNative:"B/.",decimalDigits:2,rounding:0,code:"PAB",namePlural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbolNative:"S/.",decimalDigits:2,rounding:0,code:"PEN",namePlural:"Peruvian nuevos soles"},PHP:{symbol:"\u20B1",name:"Philippine Peso",symbolNative:"\u20B1",decimalDigits:2,rounding:0,code:"PHP",namePlural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbolNative:"\u20A8",decimalDigits:0,rounding:0,code:"PKR",namePlural:"Pakistani rupees"},PLN:{symbol:"z\u0142",name:"Polish Zloty",symbolNative:"z\u0142",decimalDigits:2,rounding:0,code:"PLN",namePlural:"Polish zlotys"},PYG:{symbol:"\u20B2",name:"Paraguayan Guarani",symbolNative:"\u20B2",decimalDigits:0,rounding:0,code:"PYG",namePlural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbolNative:"\u0631.\u0642.\u200F",decimalDigits:2,rounding:0,code:"QAR",namePlural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbolNative:"RON",decimalDigits:2,rounding:0,code:"RON",namePlural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbolNative:"\u0434\u0438\u043D.",decimalDigits:0,rounding:0,code:"RSD",namePlural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbolNative:"\u0440\u0443\u0431.",decimalDigits:2,rounding:0,code:"RUB",namePlural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbolNative:"FR",decimalDigits:0,rounding:0,code:"RWF",namePlural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbolNative:"\u0631.\u0633.\u200F",decimalDigits:2,rounding:0,code:"SAR",namePlural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbolNative:"SDG",decimalDigits:2,rounding:0,code:"SDG",namePlural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbolNative:"kr",decimalDigits:2,rounding:0,code:"SEK",namePlural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"SGD",namePlural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbolNative:"Ssh",decimalDigits:0,rounding:0,code:"SOS",namePlural:"Somali shillings"},SYP:{symbol:"SY\xA3",name:"Syrian Pound",symbolNative:"\u0644.\u0633.\u200F",decimalDigits:0,rounding:0,code:"SYP",namePlural:"Syrian pounds"},THB:{symbol:"\u0E3F",name:"Thai Baht",symbolNative:"\u0E3F",decimalDigits:2,rounding:0,code:"THB",namePlural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbolNative:"\u062F.\u062A.\u200F",decimalDigits:2,rounding:0,code:"TND",namePlural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Pa\u02BBanga",symbolNative:"T$",decimalDigits:2,rounding:0,code:"TOP",namePlural:"Tongan pa\u02BBanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbolNative:"TL",decimalDigits:2,rounding:0,code:"TRY",namePlural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbolNative:"$",decimalDigits:2,rounding:0,code:"TTD",namePlural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbolNative:"NT$",decimalDigits:2,rounding:0,code:"TWD",namePlural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbolNative:"TSh",decimalDigits:0,rounding:0,code:"TZS",namePlural:"Tanzanian shillings"},UAH:{symbol:"\u20B4",name:"Ukrainian Hryvnia",symbolNative:"\u20B4",decimalDigits:2,rounding:0,code:"UAH",namePlural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbolNative:"USh",decimalDigits:0,rounding:0,code:"UGX",namePlural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbolNative:"$",decimalDigits:2,rounding:0,code:"UYU",namePlural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbolNative:"UZS",decimalDigits:0,rounding:0,code:"UZS",namePlural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bol\xEDvar",symbolNative:"Bs.F.",decimalDigits:2,rounding:0,code:"VEF",namePlural:"Venezuelan bol\xEDvars"},VND:{symbol:"\u20AB",name:"Vietnamese Dong",symbolNative:"\u20AB",decimalDigits:0,rounding:0,code:"VND",namePlural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbolNative:"FCFA",decimalDigits:0,rounding:0,code:"XAF",namePlural:"francs CFA"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbolNative:"CFA",decimalDigits:0,rounding:0,code:"XOF",namePlural:"francs CFA"},YER:{symbol:"YR",name:"Yemeni Rial",symbolNative:"\u0631.\u064A.\u200F",decimalDigits:0,rounding:0,code:"YER",namePlural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbolNative:"R",decimalDigits:2,rounding:0,code:"ZAR",namePlural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbolNative:"ZK",decimalDigits:0,rounding:0,code:"ZMK",namePlural:"Zambian kwachas"}};var Z=r=>r&&typeof r=="object"&&!Array.isArray(r)&&r.name&&typeof r.name=="string"&&r.symbol&&typeof r.symbol=="string";var dt="%v %s",Oe=r=>{let e=L.get("currencyFormat");return e&&typeof e=="string"&&e.includes("%v")?e:r!==false?dt:""};function mt(r){return r=r&&typeof r=="string"?r.trim():"",L.set("currencyFormat",r)}var jt=r=>{if(!Z(r)){let t=typeof r=="object"&&r&&!Array.isArray(r)?f(r.code,r.name):typeof r=="string"?r:void 0;t&&(t=t.trim().toUpperCase()),t&&Z(j[t])?r=j[t]:typeof r=="string"&&(t=r.trim().toUpperCase(),Z(j[t])&&(r=j[t]));}let e=Object.assign({},r);if(!e.format){let t=Oe();t&&(e.format=t);}return e.format&&mt(e.format),L.set("appConfigCurrency",e),e},Wt=()=>{var n,i,o,s;let r=Object.assign({},L.get("appConfigCurrency")),e=L.get("currencyCode");if(u(e)&&Z(j[e.trim().toUpperCase()])&&(r=c(c({},j[e.trim().toUpperCase()]),r)),!u(r==null?void 0:r.format)){let l=Oe(false);u(l)&&l.includes("%v")&&(r.format=l);}let a=j["USD"];return c(c({symbol:a.symbol,format:(n=a.format)!=null?n:"%v %s",decimalSeparator:(i=a.decimalSeparator)!=null?i:".",thousandSeparator:(o=a.thousandSeparator)!=null?o:",",decimalDigits:(s=a.decimalDigits)!=null?s:0},Object.assign({},he.get("currencies"))),r)},_={getFormat:Oe,setFormat:mt,setCurrency:jt,getCurrency:Wt,defaultCurrencyFormat:dt};var Zt=r=>r&&typeof r=="object";function ke(r){let e=Object.assign({},_.getCurrency());if(r&&Zt(r))for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&r[t]!==void 0&&(e[t]=r[t]);if(u(e.format)){let t=gt(e.format);t.format&&(e.format=t.format),typeof t.decimalDigits=="number"&&(e.decimalDigits=t.decimalDigits);}return e}function Ie(r,e){return r=typeof r=="number"?r:0,e=typeof e=="number"?e:0,r=Math.round(Math.abs(r)),isNaN(r)?e:r}function Jt(r){let e=_.getCurrency(),t=(e==null?void 0:e.format).toLowerCase();return typeof r=="string"&&(r=r.toLowerCase()),(typeof r!="string"||!r.match("%v"))&&(r=t),{pos:r,neg:r.replace("-","").replace("%v","-%v"),zero:r}}var Ce=(r,e)=>{let t=_.getCurrency();if(r=r||0,typeof r=="number")return r;e=e||t.decimalSeparator;let a=new RegExp("[^0-9-"+e+"]","g"),n=parseFloat((""+r).replace(/\((?=\d+)(.*)\)/,"-$1").replace(a,"").replace(e,"."));return isNaN(n)?0:n},Ve=(r,e)=>{let t=_.getCurrency();e=Ie(e,t.decimalDigits);let n=String(r).replace(/[^\d.-]/g,"");if(n.length>15&&!n.includes("."))return n+"."+"0".repeat(e);try{let i=Number(n);if(isNaN(i))return "NaN";let o=+(i+"e"+e);return (+(Math.round(o)+"e-"+e)).toFixed(e)}catch(i){return "NaN"}},ft=(r,e,t,a)=>{var g;r=Ce(r);let n=Z(e)?e:_.getCurrency();typeof e=="number"&&(n.decimalDigits=e),typeof n.decimalDigits!="number"&&(n.decimalDigits=(g=String(r).split(".")[1])==null?void 0:g.length),t!==void 0&&(n.thousandSeparator=t),a!==void 0&&(n.decimalSeparator=a);let i=ke(n),o=Ie(i.decimalDigits),s=r<0?"-":"",l=parseInt(Ve(Math.abs(r||0),o),10)+"",d=l.length>3?l.length%3:0,m="";if(o){let y=String(parseFloat(Ve(Math.abs(r),o))||0);y.includes(".")&&(m=f(y.split(".")[1]).trim());}return s+(d?l.substring(0,d)+i.thousandSeparator:"")+l.substring(d).replace(/(\d{3})(?=\d)/g,"$1"+i.thousandSeparator)+(o&&m?i.decimalSeparator+m:"")},yt=(r,e,t,a,n,i)=>{r=Ce(r);let o=Z(e)?e:_.getCurrency();e!==void 0&&typeof e=="string"&&(o.symbol=e),t!==void 0&&(o.decimalDigits=t),a!==void 0&&(o.thousandSeparator=a),n!==void 0&&(o.decimalSeparator=n),u(i)&&(o.format=i);let s=ke(o),l=Jt(s.format),d=f(r>0?l.pos:r<0?l.neg:l.zero),m=f(s.symbol),g=d.replace(m&&"%s",m),y=ft(Math.abs(r),Ie(s.decimalDigits),s.thousandSeparator,s.decimalSeparator),M=g.replace("%v",y);return p(c({},s),{formattedValue:g,formattedNumber:y,symbol:s.symbol,usedFormat:d,result:M})},Qt=(r,e,t,a,n,i)=>yt(r,e,t,a,n,i).result,gt=r=>{r=f(r).trim();let e={};if(r){let t=/(\.)(\#{0,9}\s*$)/,a=r.match(t);Array.isArray(a)&&a.length===3&&(e.decimalDigits=f(a[2]).trim().length),r=r.replace(t,"");}return e.format=r,e},oe={parse:Ce,session:_,formatMoney:Qt,currencies:j,isCurrency:Z,formatNumber:ft,formatMoneyAsObject:yt,unformat:Ce,toFixed:Ve,prepareOptions:ke,parseFormat:gt};var{currencies:pt}=oe;Number.prototype.countDecimals=function(){let r=String(this.toString()).match(/\.(\d+)/);return r?r[1].length:0};Number.prototype.formatNumber=function(r,e,t){return oe.formatNumber(this.valueOf(),r,e,t)};Number.prototype.formatMoney=function(r,e,t,a,n){return oe.formatMoney(this.valueOf(),r,e,t,a,n)};var qt=(r,e,t,a)=>{var x;if(r===null||typeof r!="number"||isNaN(r))return {result:"",format:"",suffix:"",formattedValue:"",minAbreviationDecimalDigits:0,value:NaN};if(!isFinite(r)){let O=r>0?"\u221E":"-\u221E";return {result:O,value:r,format:"",suffix:"",formattedValue:O,minAbreviationDecimalDigits:0}}let n=Math.abs(r)<1e3,i=[{value:1e12,suffix:"T"},{value:1e9,suffix:"B"},{value:1e6,suffix:"M"},{value:1e3,suffix:"K"},{value:1,suffix:""}],o=r.countDecimals?r.countDecimals():Math.floor(r)===r?0:((x=r.toString().split(".")[1])==null?void 0:x.length)||0,s=i.find(O=>Math.abs(r)>=O.value)||i[i.length-1],l=n?r:r/(s.value===1?1:s.value),d=s.suffix,m=Xt(l,5);if(r===0)return {result:"0",value:0,format:"",suffix:"",formattedValue:"0",minAbreviationDecimalDigits:0};let y=w(e)&&e>0?e:s.value===1?Math.min(o,5):Math.max(m,0),M=l.toFixed(y);t=f(t),a=f(a,".");let C=M.toString().split(".");return C[0]=C[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),y>0&&C.length===1?C.push("0".repeat(y)):y>0&&C.length>1&&C[1].length<y&&(C[1]=C[1].padEnd(y,"0")),M=C.join(a),{result:M+d,value:r,format:d,suffix:d,formattedValue:M,minAbreviationDecimalDigits:m}};function Xt(r,e){let t=Math.abs(r);if(Number.isInteger(t))return 0;let a=t.toString().split(".")[1]||"",n=0;for(;n<a.length&&a[n]==="0";)n++;return t<1&&n>0?Math.min(n+e,a.length):Math.min(e,a.length)}var bt=(r,e,t,a)=>qt(r,e,t,a).result;Number.prototype.abreviate2FormatNumber=function(r,e,t){return bt(this.valueOf(),r,e,t)};var ht=(r,e,t,a,n,i)=>{if(!w(r))return "";let l=oe.formatMoneyAsObject(r,e,t,a,n,i),{formattedValue:o}=l,s=U(l,["formattedValue"]);return o.replace("%v",bt(r,s.decimalDigits,s.thousandSeparator,s.decimalSeparator))};Number.prototype.abreviate2FormatMoney=function(r,e,t,a,n){return ht(this.valueOf(),r,e,t,a,n)};function Ye(...r){for(let e of r)if(w(e)&&e!==0)return e;return 0}Object.keys(pt).forEach(r=>{let e=r,t=pt[e],a=`format${e}`,n=`abreviate2Format${e}`;Number.prototype[a]=function(i,o,s,l){return oe.formatMoney(this.valueOf(),t,i,o,s,l)},Number.prototype[n]=function(i,o,s,l){return ht(this.valueOf(),t,i,o,s,l)};});function _t(r){return f(r).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f")}function De(r,e){var t=Object.prototype.toString.call(r);return t==="[object "+e+"]"}function J(r,e){if(["boolean","undefined"].includes(typeof r)||r===null)return String(r);if(w(r))return r.formatNumber();if(r instanceof Date)return r.toFormat();if(r instanceof Error)return r==null?void 0:r.toString();e=Object.assign({},e);let{parenthesis:t}=e,a=t?"(":"",n=t?")":"";if(typeof r=="string")return e!=null&&e.escapeString?"'"+_t(r)+"'":r;if(De(r,"RegExp")||De(r,"Number")||De(r,"Boolean"))return r.toString();if(De(r,"Date"))return "new Date("+r.getTime()+")";if(Array.isArray(r))return "["+r.map(i=>J(i,e)).join(",")+"]";if(typeof r=="object"){try{return JSON.stringify(r,null,2)}catch(i){}return a+"{"+Object.keys(r).map(i=>{var o=r[i];return J(i,e)+":"+J(o,e)}).join(",")+"}"+n}return r&&typeof(r==null?void 0:r.toString)=="function"?r==null?void 0:r.toString():String(r)}function Le(){return typeof window!="undefined"&&typeof window=="object"?window:typeof self!="undefined"&&typeof self=="object"?self:typeof global!="undefined"&&typeof global=="object"?global:typeof globalThis!="undefined"&&typeof globalThis=="object"?globalThis:{}}var se={optional:Symbol.for("validatorOptionalRuleMarker"),empty:Symbol.for("validatorEmptyRuleMarker"),nullable:Symbol.for("validatorNullableRuleMarker"),ruleName:Symbol.for("validatorRuleNameMarker")};var h=class h{static registerRule(e,t){if(!u(e))throw new Error("Rule name must be a non-empty string");if(typeof t!="function")throw new Error("Rule handler must be a function");let a=h.getRules(),n=p(c({},a),{[e]:t});Reflect.defineMetadata(h.RULES_METADATA_KEY,n,h);}static getRules(){let e=Reflect.getMetadata(h.RULES_METADATA_KEY,h);return D(e)?c({},e):{}}static getRule(e){return this.getRules()[e]}static hasRule(e){return u(e)?!!this.getRule(e):false}static getI18n(e){return X.isI18nInstance(e==null?void 0:e.i18n)?e.i18n:he}static getErrorMessageSeparators(e){let t=this.getI18n({i18n:e}),a=Object.assign({},t.get("validator.separators"));return {multiple:f(a.multiple,", "),single:f(a.single,", ")}}static parseAndValidateRules(e){let t=[],a=this.getRules(),n=[],i=Array.isArray(e)?e:[];for(let o of i)if(typeof o=="function")t.push(o);else if(u(o)){let s=this.parseStringRule(o,a);s?t.push(s):n.push(o);}else if(D(o)&&typeof o=="object"){let s=this.parseObjectRule(o,a);s.length&&t.push(...s);}return {sanitizedRules:t,invalidRules:n}}static parseStringRule(e,t){let a=String(e).trim(),n=[],i=t[a];return typeof i=="function"?{ruleName:a,params:n,ruleFunction:i}:null}static parseFunctionRule(e){var a;let t=(a=ar(e))!=null?a:e.name;return {ruleFunction:e,ruleName:t,params:[]}}static parseObjectRule(e,t){let a=[];if(!D(e))return a;if(this.isSanitizedRuleObject(e))return a.push(e),a;for(let n in e)if(Object.hasOwnProperty.call(e,n)){let i=n;if(typeof t[i]!="function")continue;let o=t[i],s=e[i];Array.isArray(s)?a.push({ruleName:i,ruleFunction:o,params:s}):D(s)&&(s!=null&&s.params)&&Array.isArray(s.params)&&a.push(p(c({},s),{ruleName:i,ruleFunction:o}));}return a}static isSanitizedRuleObject(e){if(!D(e))return false;let t=e;return typeof t.ruleFunction=="function"&&typeof t.ruleName=="string"&&Array.isArray(t.params)}static translateRuleConfigMessage({message:e,i18n:t,validateOptions:a}){if(!e)return "";if(u(e))return t.has(e)?t.t(e,a):e;if(typeof e=="function")try{return e(a)}catch(n){return H.log(h.name," Error generated when running custom translate rule message ",a.ruleName,a.ruleParams,n),""}return ""}static validate(a){return A(this,null,function*(){var n=a,{rules:e}=n,t=U(n,["rules"]);let i=this.getI18n(t),o=Date.now(),{sanitizedRules:s,invalidRules:l}=h.parseAndValidateRules(e),d=h.getErrorMessageSeparators(i),{value:m,context:g,data:y}=t,M=this.getI18nTranslateOptions(t),C=p(c({},M),{context:g,value:m,data:y});if(l.length){let v=l.map(x=>i.t("validator.invalidRule",p(c({},M),{rule:u(x)?x:"unnamed rule"}))).join(d.multiple);return h.createError(v,{value:m,startTime:o,fieldName:t.fieldName,propertyName:t.propertyName,translatedPropertyName:t.translatedPropertyName,ruleParams:[],ruleName:"N/A"})}return !s.length||this.shouldSkipValidation({value:m,rules:s})?Te(C,o):(t.fieldName=t.propertyName=f(t.fieldName,t.propertyName),new Promise(v=>{let x=-1,O=s.length,N=function(){return A(this,null,function*(){if(x++,x>=O)return v(Te(C,o));let T=s[x],P,E=[],k,Y=typeof T=="function"?T:void 0;if(h.isSanitizedRuleObject(T))Y=T.ruleFunction,E=Array.isArray(T.params)?T.params:[],P=T.ruleName,k=T.message;else if(typeof T=="function"){let R=h.parseFunctionRule(T);R?P=R.ruleName:P=T.name;}let G=p(c({value:m,rules:e},M),{rule:f(P),ruleName:P,ruleParams:E}),z={value:m,startTime:o,fieldName:t.fieldName,propertyName:t.propertyName,translatedPropertyName:t.translatedPropertyName,ruleParams:E,ruleName:f(P)},B=p(c(p(c({},t),{data:y!=null?y:Object.assign({},y),startTime:o}),G),{ruleName:f(P),value:m,i18n:i}),re=R=>{if(h.isError(R))return v(R);let Se="";if(R!==true&&k&&(Se=h.translateRuleConfigMessage({message:k,i18n:i,validateOptions:B})),u(Se))return v(h.createError(Se,z));if(R=typeof R=="string"?u(R)?R:i.t("validator.invalidMessage",G):R,R===false){let Me=i.t("validator.invalidMessage",G);return v(h.createError(Me,z))}else {if(u(R))return v(h.createError(R,z));if(R instanceof Error||u(R==null?void 0:R.message)||u(R)){let Me=J(R,{escapeString:false});return v(h.createError(Me,z))}}return N()};if(typeof Y!="function"){let R=i.t("validator.invalidRule",G);return v(h.createError(R,z))}try{let R=yield Y(B);return re(R)}catch(R){return re(typeof R=="string"?R:(R==null?void 0:R.message)||(R==null?void 0:R.toString())||J(R,{escapeString:false}))}})};return N()}))})}static shouldSkipValidation({value:e,rules:t}){if(ie(e)){let a={IsEmpty:{validate:n=>n==="",symbol:se.empty},Nullable:{validate:n=>n==null,symbol:se.nullable},Optional:{validate:n=>n===void 0,symbol:se.optional}};for(let n of t){let i=typeof n=="object"&&n?n.ruleFunction:typeof n=="function"?n:void 0;if(typeof i=="function")for(let o in a){let s=a[o];if(tr(i,s.symbol)&&s.validate(e))return true}}}return false}static validateOneOfRule(e){return this.validateMultiRule("OneOf",e)}static validateAllOfRule(e){return this.validateMultiRule("AllOf",e)}static validateArrayOfRule(e){return A(this,null,function*(){let N=e,{value:t,ruleParams:a,startTime:n,message:i}=N,o=U(N,["value","ruleParams","startTime","message"]);n=w(n)?n:Date.now();let s=Array.isArray(a)?a:[],l=this.getI18n(o);if(!Array.isArray(t))return l.t("validator.array",p(c({field:o.translatedPropertyName||o.fieldName,value:t},o),{context:void 0}));if(s.length===0||t.length===0)return true;let{multiple:d,single:m}=this.getErrorMessageSeparators(l),g=[];for(let T=0;T<t.length;T++){let P=t[T],E=yield h.validateMultiRule("AllOf",c({value:P,ruleParams:s,startTime:n},o));E!==true&&g.push({index:T,message:String(E)});}if(g.length===0)return true;let y=g.map(T=>T.index),M=g.length,C,v=l.t("validator.separators.multiple");if(M<=3)C=y.join(v);else {let T=y.slice(0,3),P=M-3,E=l.t("validator.itemListOverflow",{count:P});C=`${T.join(v)}${v}${E}`;}if(i){let T=this.getI18nTranslateOptions(o),P=h.translateRuleConfigMessage({message:i,i18n:l,validateOptions:p(c(c({},o),T),{context:o.context,value:t,ruleName:"ArrayOf",ruleParams:a!=null?a:[],i18n:l,failures:g,failedIndices:y,itemCount:M,itemList:C,totalCount:t.length})});if(u(P))return P}let x=l.t("validator.arrayValidationFailed",{count:g.length,itemCount:M,items:C,totalCount:t.length}),O=g.map(T=>l.t("validator.arrayItemError",{index:T.index,message:T.message})).join(d);return `${x}${m}${O}`})}static validateIfRule(e){return A(this,null,function*(){var N;let O=e,{resolver:t,startTime:a,message:n}=O,i=U(O,["resolver","startTime","message"]),{value:o,data:s,context:l,fieldName:d,propertyName:m,translatedPropertyName:g}=i,y=this.getI18n(i),M=yield t({value:o,data:s,context:l,fieldName:d,propertyName:m,translatedPropertyName:g,i18n:y});if(!M)return true;let C,v;if(Array.isArray(M)){if(M.length===0)return true;C=M,v=n;}else {if(C=M.rules,!C||C.length===0)return true;v=(N=M.message)!=null?N:n;}let x=yield h.validate(p(c({},i),{value:o,rules:C,i18n:y}));if(x.success)return true;if(v){let T=this.getI18nTranslateOptions(i),P=h.translateRuleConfigMessage({message:v,i18n:y,validateOptions:p(c(c({},i),T),{value:o,ruleName:"If",ruleParams:[],i18n:y})});if(u(P))return P}return x.message})}static getI18nTranslateOptions(s){var l=s,{fieldName:e,propertyName:t,fieldLabel:a,translatedPropertyName:n,context:i}=l,o=U(l,["fieldName","propertyName","fieldLabel","translatedPropertyName","context"]);e=f(e,t),a=f(a,n,e);let d={fieldLabel:a,translatedPropertyName:f(n,a),propertyName:f(t,e),fieldName:e};return "value"in o&&(d.value=o.value),d}static validateNestedRule(a){return A(this,null,function*(){var n=a,{ruleParams:e}=n,t=U(n,["ruleParams"]);let C=t,{startTime:i,value:o}=C,s=U(C,["startTime","value"]);i=w(i)?i:Date.now();let l=this.getI18n(s),m=(Array.isArray(e)?e:[])[0],g=p(c({rule:"ValidateNested"},this.getI18nTranslateOptions(s)),{startTime:i,value:o});if(!m)return l.t("validator.invalidRule",g);if(typeof o!="object"||o===null||Array.isArray(o)){let v=Array.isArray(o)?"array":o===void 0?"undefined":o===null?"null":typeof o;return l.t("validator.validateNestedInvalidType",p(c({},g),{receivedType:v}))}let y=yield this.validateClass(m,p(c({},t),{data:o,parentData:s.data,startTime:i}));if(y.success)return true;let M=this.translateNestedErrorResult(y,l);if(t.message){let v=h.translateRuleConfigMessage({message:t.message,i18n:l,validateOptions:p(c(c({},s),g),{value:o,ruleName:"ValidateNested",ruleParams:e!=null?e:[],i18n:l,nestedErrors:M})});if(u(v))return v}return l.t("validator.validateNested",c({nestedErrors:M},g))})}static translateNestedErrorResult(e,t){let a=e.errors||[],n=this.getI18n({i18n:t}),i=Object.assign({separator:"; ",prefix:"",suffix:""},n.get("validator.nestedErrors")),o=f(i.separator,"; "),s=f(i.prefix,""),l=f(i.suffix,"");return `${s}${a.map(d=>{var m;return `[${(m=d.translatedPropertyName)!=null?m:d.propertyName}]: ${d.message}`}).join(o)}${l}`}static validateMultiRule(e,s){return A(this,null,function*(){var l=s,{value:t,ruleParams:a,startTime:n,message:i}=l,o=U(l,["value","ruleParams","startTime","message"]);n=w(n)?n:Date.now();let d=Array.isArray(a)?a:[],m=this.getI18n(o),g=e==="AllOf";if(d.length===0)return true;let y=[],M=[],C=null;for(let v of d){let x=yield h.validate(p(c({value:t},o),{rules:[v],i18n:m}));if(x.success){if(!g)return true;C!=null||(C=x);}else M.push(x),u(x.message)&&y.push(x.message);}if(!g&&C||M.length===0)return true;if(i){let v=this.getI18nTranslateOptions(o),x=h.translateRuleConfigMessage({message:i,i18n:m,validateOptions:p(c(c({},o),v),{value:t,ruleName:e,ruleParams:a!=null?a:[],i18n:m})});if(u(x))return x}return m.t(`validator.${Ee(e)}`,p(c({},this.getI18nTranslateOptions(o)),{value:t,ruleName:e,rules:[e],rule:e,ruleParams:[],failedRulesErrors:y.join("; ")}))})}static oneOf(e){return function(a){return h.validateOneOfRule(p(c({},a),{ruleParams:e}))}}static allOf(e){return function(a){return h.validateAllOfRule(p(c({},a),{ruleParams:e}))}}static arrayOf(e){return function(a){return h.validateArrayOfRule(p(c({},a),{ruleParams:e}))}}static if(e){return function(a){return h.validateIfRule(p(c({},a),{resolver:e}))}}static validateNested(e){return function(a){return h.validateNestedRule(p(c({},a),{ruleParams:[e]}))}}static validateClass(e,t){return A(this,null,function*(){let a=Date.now(),n=h.getClassRules(e),O=Object.assign({},h.getValidatorClassOptions(e),t),{context:i,errorMessageBuilder:o}=O,s=U(O,["context","errorMessageBuilder"]),l=Object.assign({},t.data),d=this.getI18n(t),m=h.getErrorMessageSeparators(d),g=typeof o=="function"?o:(N,T)=>`[${String(N)}] : ${T}`,y=[],M={},C=[],x=d.translateClass(e,{data:l});for(let N in n){let T=n[N],{sanitizedRules:P}=this.parseAndValidateRules(T),E=Object.prototype.hasOwnProperty.call(l,N)?l[N]:void 0;if(this.shouldSkipValidation({value:E,rules:P}))continue;let k=f(x[N],N);C.push(h.validate(p(c({context:i},s),{i18n:d,value:E,data:l,translatedPropertyName:k,fieldName:N,propertyName:N,rules:P,fieldLabel:k})).then(Y=>{if(Y.success);else {let G=f(Y.message),z=h.createError(G,{propertyName:N,translatedPropertyName:k,ruleParams:[],ruleName:"validateClass",startTime:a,value:E}),B=g(k,G,p(c({},z),{propertyName:String(N),separators:m,data:l,translatedPropertyName:k,i18n:d,cause:Y}));M[N]=B,y.push(p(c({},z),{cause:Y}));}return Y}));}return new Promise(N=>Promise.all(C).then(()=>{if(!y.length)N(p(c({},Te({data:l,value:void 0,context:i},a)),{message:void 0,status:"success",data:l}));else {let P=new Map;y.forEach(B=>{let re=B.translatedPropertyName||B.fieldName||B.propertyName||"unknown";P.set(B.propertyName||B.fieldName||"unknown",re);});let E=Array.from(P.values()),k=E.length,Y,G=d.t("validator.separators.multiple");if(k<=3)Y=E.join(G);else {let B=E.slice(0,3),re=k-3,R=d.t("validator.fieldListOverflow",{count:re});Y=`${B.join(G)}${G}${R}`;}let z=d.translate("validator.classValidationFailed",{count:y.length,fieldCount:k,fields:Y});N(h.createClassError(z,{startTime:a,errors:y,fieldErrors:M,failureCount:y.length,duration:Date.now()-a,data:l}));}}))})}static validateObject(e,t,a){return A(this,null,function*(){let n={};Reflect.defineMetadata(ce,t,n);let i=yield this.validateClass(n,p(c({},a),{data:e}));return p(c({},i),{data:e})})}static object(e){let t={};return Reflect.defineMetadata(ce,e,t),{schema:t,validate:(a,n)=>this.validateObject(a,e,n)}}static validateBulk(e,i){return A(this,null,function*(){var o=i,{data:t,startTime:a}=o,n=U(o,["data","startTime"]);let s=this.getI18n(n);a=w(a)?a:Date.now();let l=[];if(!Array.isArray(t))return this.createBulkError(s.t("validator.invalidBulkData"),{startTime:a,failures:l,totalCount:0});let d=t.map((m,g)=>A(this,null,function*(){let y=yield h.validateClass(e,p(c({},n),{data:m,startTime:a}));return y.success!==true&&l.push(p(c({},y),{index:g+1})),y}));if(yield Promise.all(d),l.length>0){let m=l.length,g=t.length,y=m===g?"validator.bulkValidationAllFailed":"validator.bulkValidationFailed";return h.createBulkError(s.t(y,{count:m,failureCount:m,totalCount:g}),{failures:l,startTime:a,totalCount:g})}return {name:"ValidatorSuccessResult",duration:Date.now()-a,validatedAt:new Date,data:t,status:"success",success:true}})}static getClassRules(e){return typeof e=="function"?fe(e,ce):Object.assign({},Reflect.getMetadata(ce,e))}static getValidatorClassOptions(e){return Object.assign({},Reflect.getMetadata(er,e)||{})}static buildRuleDecorator(e,t,a){return t&&this._prepareRuleDecorator(e,t,a),(...n)=>this.createPropertyDecoratorFromRule(n,e,t,a)}static buildRuleArrayDecorator(e,t,a){return t&&this._prepareRuleDecorator(e,t,a),n=>this.createPropertyDecoratorFromRule(n,e,t,a)}static isSuccess(e){return D(e)&&e.success===true&&e.status=="success"&&e.name=="ValidatorSuccessResult"}static getBaseError({startTime:e}){return {__validatorBaseName:"ValidatorBaseError",failedAt:new Date,startTime:e,duration:Date.now()-e,success:false,status:"error",statusCode:400,errorCode:"ERR_VALIDATION_FAILED"}}static isBaseError(e){return D(e)?e.__validatorBaseName==="ValidatorBaseError"&&e.success===false&&e.failedAt&&e.statusCode===400&&e.errorCode==="ERR_VALIDATION_FAILED":false}static createError(e,t){return p(c(c({},this.getBaseError(t)),t),{failedAt:new Date,message:e,name:"ValidatorError"})}static createClassError(e,t){return p(c(c({},this.getBaseError(t)),t),{message:e,name:"ValidatorClassError",failedAt:new Date})}static createBulkError(e,t){let a=Array.isArray(t.failures)?t.failures:[];return p(c(c({},this.getBaseError(t)),t),{failures:a,failureCount:a.length,message:e,name:"ValidatorBulkError",failedAt:new Date})}static isError(e){return this.isBaseError(e)&&e.name=="ValidatorError"}static isClassError(e){return this.isBaseError(e)&&e.name=="ValidatorClassError"}static isBulkError(e){return this.isBaseError(e)&&e.name=="ValidatorBulkError"}static isAnyError(e){return this.isError(e)||this.isClassError(e)||this.isBulkError(e)}static _prepareRuleDecorator(e,t,a){return u(t)&&(h.registerRule(t,e),Ct(e,t)),a&&nr(e,a,{ruleName:t}),e}static createPropertyDecoratorFromRule(e,t,a,n){var i;return this._prepareRuleDecorator(t,a,n),a=f(a,n==null?void 0:n.toString(),t.name,(i=t.constructor)==null?void 0:i.name),Ct(t,a),h.buildPropertyDecorator({ruleName:a,ruleFunction:t,params:e})}static buildClassRuleDecorator(e,t){return this.buildRuleDecorator(e,void 0,t)}static buildMultiRuleDecorator(e,t){return a=>this.createPropertyDecoratorFromRule(a,e,void 0,t)}static buildIfRuleDecorator(e,t){return a=>this.createPropertyDecoratorFromRule([a],e,void 0,t)}static buildPropertyDecorator(e){return ve(ce,t=>[...Array.isArray(t)?t:[],...Array.isArray(e)?e:[e]])}};h.RULES_METADATA_KEY=Symbol.for("validationRules");var te=h;function Te(r,e){return p(c({},r),{status:"success",name:"ValidatorSuccessResult",success:true,validatedAt:new Date,duration:Date.now()-e})}var ce=Symbol.for("validatorClassRules"),er=Symbol.for("validatorClassOptions");function tr(r,e){if(typeof r!="function")return false;let t=rr(r,e);return !!(t!=null&&t.validatorRuleFuncMarked)}function rr(r,e){return typeof r!="function"?null:Object.assign({},r[e])}function Ct(r,e){typeof r=="function"&&(r[se.ruleName]=e);}function ar(r){if(typeof r=="function"){let e=r[se.ruleName];return u(e)?e:void 0}}function nr(r,e,t){var a;typeof r=="function"&&(r[e]=p(c({},t),{validatorRuleFuncMarked:true,ruleName:(a=t==null?void 0:t.ruleName)!=null?a:e}));}var I=class I extends Error{constructor(t,a){var n;super(t);this.__isBaseException=true;this.success=false;Object.setPrototypeOf(this,new.target.prototype),new.target===I?this.name=I.NAME:this.name=new.target.name||I.NAME,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.code=a==null?void 0:a.code,this.statusCode=a==null?void 0:a.statusCode,this.details=a==null?void 0:a.details,this.timestamp=(n=a==null?void 0:a.timestamp)!=null?n:new Date,this.cause=this.normalizeCause(a==null?void 0:a.cause),this.success=false;}toJSON(t){var o,s;let a=(o=t==null?void 0:t.stack)!=null?o:!ir()&&!!this.stack,n=(s=t==null?void 0:t.cause)!=null?s:true,i=Ye(t==null?void 0:t.maxCauseDepth,10);return p(c(c(p(c(c(c({__isBaseException:true,__baseExceptionName:I.NAME,name:this.name,message:this.message},this.code&&{code:this.code}),this.statusCode&&{statusCode:this.statusCode}),this.details&&{details:this.details}),{timestamp:this.timestamp.toISOString()}),a?{stack:this.stack}:{}),n&&this.cause?{cause:this.serializeCause(this.cause,i)}:{}),{success:false})}normalizeCause(t){return I.is(t)?this.normalizeCause(t.cause):t}serializeCause(t,a){if(a<=0)return "[Max Depth Reached]";if(t=this.normalizeCause(t),t instanceof Error){let n=t;return c(c(c(c({name:n.name,message:n.message},n.code?{code:n.code}:{}),n.statusCode?{statusCode:n.statusCode}:{}),n.timestamp?{timestamp:n.timestamp}:{}),n.cause?{cause:this.serializeCause(n.cause,a-1)}:{})}try{return K.stringify(t,!0,void 0,2)}catch(n){return J(t)}}toString(){let t=this.code?` [${this.code}]`:"";return `${this.name}${t}: ${this.message}`}static is(t){try{return t instanceof I||D(t)&&t.__isBaseException===!0&&typeof t.message=="string"&&t.success===!1&&t.__baseExceptionName===I.NAME}catch(a){return false}}static create(t,a){return new this(t,a)}static from(t,a){if(t instanceof this||t instanceof I)return this.withOptions(t,a);if(K.isJSON(t)){let n=K.parse(t);return this.from(n,a)}return this.createFromError(t,a)}static createFromError(t,a){var d;let n=this.parseErrorMessage(t,a),i=this.parseErrorDetails(t,a),o=f(a==null?void 0:a.code,i.code,i.errorCode),s=Ye(a==null?void 0:a.statusCode,i.statusCode,500);return this.create(n,p(c({},a),{details:i,code:o,statusCode:s,cause:(d=a==null?void 0:a.cause)!=null?d:t}))}static isValidatorClassError(t){return te.isClassError(t)}static isValidatorBulkError(t){return te.isBulkError(t)}static isValidatorError(t){return te.isError(t)}static isAnyValidatorError(t){return te.isAnyError(t)}static getValidatorError(t){return this.isAnyValidatorError(t)?t:this.is(t)&&this.isAnyValidatorError(t.cause)?t.cause:null}static parseErrorMessage(t,a){let n="";return D(t)?typeof t.message=="string"&&(n=t.message):typeof t=="string"&&(n=t),!n&&t instanceof Error&&(n=t.message),!n&&(a!=null&&a.fallbackMessage)&&(n=a.fallbackMessage),u(n)||(n=f(n,"Unknown Error")),n.trim().toLowerCase()==="undefined"&&(n="Unknown Error"),n}static parseErrorDetails(t,a){var n;return c(c({},D(t)?t:void 0),(n=a==null?void 0:a.details)!=null?n:{})}static withOptions(t,a){var n;return a!=null&&a.code&&(t.code=a.code),a!=null&&a.statusCode&&(t.statusCode=a.statusCode),a!=null&&a.details&&(t.details=c(c({},(n=t.details)!=null?n:{}),a.details)),t}static wrap(t,a){return A(this,null,function*(){try{return yield t()}catch(n){return I.throw(n,a)}})}static throw(t,a){throw I.from(t,a)}static tryCatchSync(t,a){try{return [null,t()]}catch(n){return [this.from(n,a),null]}}static tryCatch(t,a){return A(this,null,function*(){try{return [null,yield t()]}catch(n){return [this.from(n,a),null]}})}};I.NAME="BaseException",I.hooks=[];var Re=I,ir=()=>{var r;try{let t=Le().process;return ((r=t==null?void 0:t.env)==null?void 0:r.NODE_ENV)==="production"}catch(e){return false}};var de=class extends Re{constructor(){super(...arguments);this.name="AuthError";}};var Fe="user-session",Dt=1440*60*1e3,Be={get:r=>A(null,null,function*(){return L.get(r)}),set:(r,e)=>A(null,null,function*(){yield L.set(r,e);}),remove:r=>A(null,null,function*(){yield L.remove(r);})},b=class b{static configure(e){e.sessionTTL!==void 0&&(b.config.sessionTTL=e.sessionTTL),e.storage&&(b.config.storage=e.storage),e.masterAdminCheck&&(b.isMasterAdmin=e.masterAdminCheck);}static _isMasterAdmin(e){return A(this,null,function*(){var t;return e=this.isValidUser(e)?e:(t=yield b.getSignedUser())!=null?t:void 0,typeof b.isMasterAdmin=="function"?yield b.isMasterAdmin(e):false})}static isSessionValid(e){return e?Date.now()-e<=(b.config.sessionTTL||Dt):true}static getSignedUser(){return A(this,null,function*(){if(this.isValidUser(b.localUserRef.current))return b.isSessionValid(b.localUserRef.current.sessionCreatedAt)||(b.localUserRef.current=null),b.localUserRef.current;try{let e=yield this.secureStorage.get(Fe);if(!e)return null;let t=K.parse(e);return this.isValidUser(t)?(b.isSessionValid(t.sessionCreatedAt)||(b.localUserRef.current=null),b.localUserRef.current=t,t):(H.log("Invalid user structure in storage"),null)}catch(e){throw H.log(b.name,"Error getting signed user:",e),de.from(e)}})}static refreshSignedUser(){return A(this,null,function*(){return b.localUserRef.current=null,yield b.getSignedUser()})}static setSignedUser(e,t){return A(this,null,function*(){try{let a=e;if(this.isValidUser(e)&&(a=p(c({},e),{sessionCreatedAt:new Date().getTime()})),a){let n=JSON.stringify(a);yield this.secureStorage.set(Fe,n);}else yield this.secureStorage.remove(Fe);if(b.localUserRef.current=a,t){let n=a?"SIGN_IN":"SIGN_OUT";b.events.trigger(n,a);}return a}catch(a){throw H.log("Error setting signed user:",a),new de("Failed to store user session")}})}static signIn(e,t=true){return A(this,null,function*(){return yield b.setSignedUser(e,t)})}static signOut(e=true){return A(this,null,function*(){yield b.setSignedUser(null,e);})}static isResourceActionTupleArray(e){return Array.isArray(e)&&e.length===2&&u(e[0])&&u(e[1])}static isResourceActionTupleObject(e){return !Array.isArray(e)&&typeof e=="object"&&D(e)&&u(e.resourceName)&&u(e.action)}static isValidUser(e){return !(!e||typeof e!="object"||Array.isArray(e)||q(e))}static isAllowed(e,t){return A(this,null,function*(){if(typeof e=="boolean")return e;if(t=this.isValidUser(t)?t:yield this.getSignedUser(),!this.isValidUser(t))return false;if((yield this._isMasterAdmin(t))||!e)return true;if(typeof e=="function")return !!e(t);if(b.isResourceActionTupleObject(e)){if(b.checkUserPermission(t,e.resourceName,e.action))return true}else if(b.isResourceActionTupleArray(e)){if(b.checkUserPermission(t,e[0],e[1]))return true}else if(Array.isArray(e)){for(let n of e)if(b.isResourceActionTupleArray(n)){if(b.checkUserPermission(t,n[0],n[1]))return true}else if(b.isResourceActionTupleObject(n)&&b.checkUserPermission(t,n.resourceName,n.action))return true}return false})}static checkUserPermission(e,t,a="read"){if(!this.isValidUser(e))return false;if(D(e.perms)&&e.perms&&b.checkPermission(e.perms,t,a))return true;if(Array.isArray(e==null?void 0:e.roles)){for(let n of e.roles)if(D(n)&&D(n.perms)&&b.checkPermission(n.perms,t,a))return true;return false}return false}static checkPermission(e,t,a="read"){if(t=u(t)?t:"",!D(e)||!t)return false;let n=String(t).trim().toLowerCase();a=u(a)?a:"read";let i=[],o=Object.entries(e).find(([s])=>String(s).toLowerCase().trim()===n);if(o&&Array.isArray(o[1])&&(i=o[1]),!Array.isArray(i)||!i.length)return false;if(i.includes("all"))return true;for(let s of i)if(b.isAllowedForAction(s,a))return true;return false}static isAllowedForAction(e,t){return !u(t)||!u(e)?false:String(t).trim().toLowerCase()===String(e).trim().toLowerCase()}static get secureStorage(){let e=Reflect.getMetadata(b.authStorageMetaData,b);return Ke(e)&&(this._secureStorage=e),this._secureStorage?this._secureStorage:Be}static set secureStorage(e){Ke(e)&&Reflect.defineMetadata(b.authStorageMetaData,e,b);}};b.events=je({}),b.localUserRef={current:null},b.config={sessionTTL:Dt,storage:Be},b._secureStorage=Be,b.authStorageMetaData=Symbol("auth:storage:meta");var Ue=b;function Zi(){return function(r){try{let e=new r;if(!Ke(e))return;Ue.secureStorage=e;}catch(e){H.error(e," registering secure storage");}}}var Ke=r=>{if(!r)return false;try{return ["get","set","remove"].every(e=>typeof r[e]=="function")}catch(e){return false}};exports.AttachAuthSecureStorage=Zi;exports.Auth=Ue;exports.AuthError=de;
@@ -2,4 +2,4 @@
2
2
  %{failedRulesErrors}`,oneOf:`The field %{fieldName} must match at least one of the following validation rules:
3
3
  %{failedRulesErrors}`,allOf:`The field %{fieldName} must match all of the following validation rules:
4
4
  %{failedRulesErrors}`,validateNested:`The field %{fieldName} must be a valid nested object. Errors:
5
- %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var De={auth:q,currencies:X,countries:Y,dates:_,resources:ee,validator:te};function l(t){return !!(t&&typeof t=="string")}function f(...t){for(var e in t){let r=t[e];if(l(r))return r}return ""}function V(t){return !!(t==null||typeof t=="undefined"||typeof t=="string"&&t===""||Array.isArray(t)&&!t.length)}function g(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function N(t){return !t||typeof t!="object"?false:t instanceof Date?true:typeof t.getTime!="function"?false:!(Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))}var d=class d{static parseString(e,r){if(l(e)&&l(r))try{let i=S__default.default(e,r,!0);if(i.isValid())return {date:i.toDate(),matchedFormat:r,isValid:!0}}catch(i){}try{if(Array.isArray(r)&&(r!=null&&r.length))for(let i of r){let a=re(e,i);if(a)return a}for(let i of d.DATE_FORMATS){let a=re(e,i);if(a)return a}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(i){return {date:null,matchedFormat:null,isValid:false,error:i instanceof Error?i.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let r=e?d.parseDate(e):new Date;return r?r.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,r){if(d.isDateObj(e))return e;if(!l(r)){let i=d.parseString(e);return i!=null&&i.isValid?i.date:null}if(V(e))return null;try{let i=S__default.default(e,r,!0);if(i!=null&&i.isValid())return i.toDate()}catch(i){console.error(i," parsing date with moment : ",e," format is : ",r);}return null}static toSQLDateTimeFormat(e){if(!d.isDateObj(e))return "";let r=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return `${r}-${i}-${a} ${n}:${o}:${c}`}static getI18n(e){return w.isI18nInstance(e)?e:w.getInstance()}static getDefaultDateTimeFormat(e){return f(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return f(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!d.isDateObj(e))return "";let r=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${r}-${i}-${a}`}static toSQLTimeFormat(e){if(!d.isDateObj(e))return "";let r=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return `${r}:${i}:${a}`}static getDefaultTimeFormat(e){return f(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,r){if(e==null||typeof e=="boolean")return false;if(d.isDateObj(e))return true;if(g(e)){let a=new Date(e);return a&&!isNaN(a.getTime())}if(l(e))return !!d.parseDate(e,r);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let i=new Date(e);return d.isDateObj(i)}static addToDate(e,r,i){if(g(e)||(e=0),V(r)&&(r=new Date),d.isValidDate(r)&&l(r)&&(r=new Date(r)),d.isValidDate(r)||(r=l(r)?new Date(r):new Date),l(i)&&typeof r["set"+i]=="function"&&typeof r["get"+i]=="function"){let a="set"+i,n="get"+i;r=new Date(r[a](r[n]()+e));}return r}static addDays(e,r){return d.addToDate(e,r,"Date")}static addMilliseconds(e,r){return g(e)||(e=0),d.isDateObj(r)||(r=new Date),r=r||new Date,new Date(r.getTime()+e)}static addSeconds(e,r){return g(e)||(e=0),d.addMilliseconds(e*1e3,r)}static addMinutes(e,r){return g(e)||(e=0),d.addMilliseconds(e*6e4,r)}static addHours(e,r){return g(e)||(e=0),d.addMilliseconds(e*36e5,r)}static addMonths(e,r,i){return d.addToDate(e,r,"Month")}static addWeeks(e,r){return e=(g(e)?e:0)*7,d.addToDate(e,r,"Date")}static addYears(e,r){g(e)||(e=0);let i=new Date(d.addToDate(0,r)),a=i.getFullYear();return a+e<0?e=0:e+=a,i.setFullYear(e),new Date(i)}static formatDate(e,r){try{let i=S__default.default(e);if(i.isValid())return i.format(f(r,d.getDefaultDateTimeFormat()))}catch(i){}return f(d.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let r=e?S__default.default.utc(e):S__default.default.utc();return {year:r.year(),day:r.day(),month:r.month(),monthString:r.format("MM"),hours:r.hours(),date:r.date(),minutes:r.minutes(),seconds:r.seconds(),monthName:r.format("MMMM"),dayName:r.format("dddd"),dayNameShort:r.format("ddd")}}};d.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],d.SQL_DATE_FORMAT="YYYY-MM-DD",d.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",d.SQL_TIME_FORMAT="HH:mm:ss",d.getCurrentMonthDaysRange=e=>{let r=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),i=new Date(r.getFullYear(),r.getMonth(),1),a=new Date(r.getFullYear(),r.getMonth()+1,0);return {first:i,last:a}},d.getPreviousWeekDaysRange=e=>{let r=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),i=new Date(r.getTime()-3600*24*7*1e3),a=new Date(i),n=i.getDay(),o=i.getDate()-n+(n===0?-6:1),c=new Date(i.setDate(o)),s=new Date(a.setDate(o+6));return {first:c,last:s}},d.getCurrentWeekDaysRange=e=>{let r=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),i=r.getDay(),a=r.getDate()-i+(i==0?-6:1),n=new Date(r),o=new Date(r.setDate(a));return n.setDate(n.getDate()+6),{first:o,last:n}},d.isDateObj=N;var y=d,re=(t,e)=>{let r=S__default.default(t,e,true);try{if(r.isValid()&&r.format(e)===t||S__default.default.utc(r,!0).format(e)===t)return {date:r.toDate(),matchedFormat:e,isValid:!0}}catch(i){}return null};Date.prototype.toSQLDateTimeFormat=function(){return y.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return y.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return y.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(t){return y.formatDate(this,t)};Date.prototype.addYears=function(t){return y.addYears(t,this)};Date.prototype.addMonths=function(t){return y.addMonths(t,this)};Date.prototype.addMinutes=function(t){return y.addMinutes(t,this)};Date.prototype.addSeconds=function(t){return y.addSeconds(t,this)};Date.prototype.addDays=function(t){return y.addDays(t,this)};Date.prototype.addWeeks=function(t){return y.addWeeks(t,this)};Date.prototype.addHours=function(t){return y.addHours(t,this)};var M=class M{static get logger(){let e=Reflect.getMetadata(M.loggerMetaData,M);return ie(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){ie(e)&&Reflect.defineMetadata(M.loggerMetaData,e,M);}static _log(e,...r){let i=M.logger;e=f(e),e&&typeof i[e]=="function"?i[e](M.getDateTimeString(),...r):console.log("Logger level not found : [",e,"]",...r);}static getDateTimeString(){let{day:e,year:r,hours:i,minutes:a,seconds:n,dayNameShort:o,monthName:c}=y.getUTCDateTimeDetails(),s=e<10?"0"+e:e,u=i<10?"0"+i:i,D=a<10?"0"+a:a,b=n<10?"0"+n:n;return "["+[o,s,c,r].join(" ")+" "+[u,D,b].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};M.loggerMetaData=Symbol("logger-meta-data");var I=M,ie=t=>{if(!t)return false;try{return ["warn","info","error"].every(e=>typeof t[e]=="function")}catch(e){return false}};function Me(t){return typeof t=="boolean"||!t||typeof t=="number"||typeof t=="string"||typeof t=="symbol"?false:Object(t).constructor===Promise||t.constructor&&(t.constructor.name==="Promise"||t.constructor.name==="AsyncFunction")||t instanceof Promise||typeof(t==null?void 0:t.then)=="function"&&typeof(t==null?void 0:t.catch)=="function"&&typeof(t==null?void 0:t.finally)=="function"?true:t&&typeof t.constructor=="function"&&Function.prototype.toString.call(t.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ae(t){return t&&Object.prototype.toString.call(t)==="[object Promise]"?true:Me(t)}function ne(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var x=()=>{var t;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((t=process==null?void 0:process.versions)!=null&&t.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},Te=()=>{var t,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((t=window==null?void 0:window.process)==null?void 0:t.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},be=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(t){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},Se=()=>typeof window=="undefined"&&typeof process!="undefined",oe=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Ye=()=>{if(!ne()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let t=navigator.userAgent.toLowerCase();return /android/i.test(t)},we=()=>{var t;return !oe()||!(window!=null&&window.ReactNativeWebView)?false:typeof((t=window==null?void 0:window.ReactNativeWebView)==null?void 0:t.postMessage)=="function"},Ae=()=>x()&&process.platform==="darwin",Ne=()=>x()&&process.platform==="win32",Ie=()=>x()&&process.platform==="linux",se={isWeb:ne,isLinux:Ie,isDarwin:Ae,isWin32:Ne,isNode:x,isElectron:Te,isTouchDevice:be,isServerSide:Se,isClientSide:oe,isAndroidMobileBrowser:Ye,isReactNativeWebview:we};var A=class t{static decycle(e,r=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(r.includes(e))return null;let i=r.concat([e]);return Array.isArray(e)?e.map(a=>t.decycle(a,i)):Object.fromEntries(Object.entries(e).map(([a,n])=>[a,t.decycle(n,i)]))}static stringify(e,r=false,i,a){return typeof e=="string"?e:JSON.stringify(r!==false?t.decycle(e):e,i,a)}static isJSON(e){if(typeof e!="string")return false;let r=e.trim();if(r.length===0)return false;let i=r[0];if(i!=="{"&&i!=="[")return false;try{let a=JSON.parse(r);return a!==null&&typeof a=="object"}catch(a){return false}}static parse(e,r){if(typeof e=="string")try{e=JSON.parse(e,r);}catch(i){return e}if(e&&typeof e=="object")for(let i in e){let a=e[i];t.isJSON(a)&&(e[i]=t.parse(a,r));}return e}};var T=class T{static get storage(){var r;let e=Reflect.getMetadata(T.sessionStorageMetaData,T);if(W(e)&&(this._storage=e),this._storage)return this._storage;if(se.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((r=window.localStorage)!=null&&r.getItem))this._storage={get:i=>window.localStorage.getItem(i),set:(i,a)=>window.localStorage.setItem(i,a),remove:i=>window.localStorage.removeItem(i),removeAll:()=>window.localStorage.clear()};else {let i={};this._storage={get:a=>i[a],set:(a,n)=>i[a]=n,remove:a=>{delete i[a];},removeAll:()=>i={}};}return this._storage}static set storage(e){W(e)&&Reflect.defineMetadata(T.sessionStorageMetaData,e,T);}static get keyNamespace(){return l(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){l(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!l(e))return "";e=e.trim().replace(/\s+/g,"-");let r=this.keyNamespace;return r?`${r}-${e}`:e}};T.sessionStorageMetaData=Symbol("sessionStorage"),T._keyNamespace=void 0;var h=T;function E(t){return h.sanitizeKey(t)}var de=(t,e)=>(t=t&&A.stringify(t,e),t==null&&(t=""),t),le=t=>{if(ae(t))return new Promise((e,r)=>{t.then(i=>{e(A.parse(i));}).catch(i=>{r(i);});});if(t!=null)return A.parse(t)},ve=t=>{if(t=E(t),h.storage&&t&&typeof t=="string"){let e=h.storage.get(t);return le(e)}},Le=t=>{if(t=E(t),h.storage&&t&&typeof t=="string")return h.storage.remove(t)},Oe=()=>{if(h.storage)return h.storage.removeAll()},W=t=>{if(!t)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof t[e]=="function")}catch(e){return false}},j={get:ve,set:(t,e,r=true)=>(t=E(t),h.storage.set(t,de(e,r))),remove:Le,handleGetValue:le,sanitizeKey:E,handleSetValue:de,isValidStorage:W,Manager:h,removeAll:Oe};function v(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function L(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}function U(t){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:t===document?true:"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&typeof t=="object"&&t.nodeType===1&&!!t.nodeName}function m(t){if(t===null||typeof t!="object"||U(t)||N(t)||L(t)||v(t))return false;let e=Object.getPrototypeOf(t);if(e===null)return true;let r=e.constructor;if(typeof r!="function")return false;if(r===Object)return true;let i=r.prototype;return typeof i!="object"?false:i===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function Z(t){if(Array.isArray(t)){let i=[];for(var e=0;e<t.length;e++)i[e]=Z(t[e]);return i}else if(m(t)&&t){let i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]=Z(t[r]));return i}else return t}Object.getSize=function(t,e=false){if(!t||typeof t!="object")return 0;if(Array.isArray(t))return t.length;typeof e!="boolean"&&(e=false);let r=0;for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&(r++,e===true))return r;return r};function C(t,...e){let r=Array.isArray(t),i=m(t);(t==null||!r&&!i)&&(t={});for(let a=0;a<e.length;a++){let n=e[a];if(n==null)continue;let o=m(n),c=Array.isArray(n);if(!(!o&&!c)){if(r){c&&ce(t,n);continue}else if(c)continue;for(let s in n){let u=n[s];if(u==null)continue;if(u===n){t[s]=t;continue}let D=t[s],b=Array.isArray(D),R=Array.isArray(u);if(b){R?ce(t[s],u):t[s]=u;continue}else if(!m(D)){t[s]=u;continue}if(R||!m(u)){t[s]=u;continue}t[s]=C({},D,u);}}}return t}var ce=(t,e)=>{let r=e.length,i=0;for(let a=0;a<t.length;a++){let n=t[a],o=e[a];if(a<r){let c=Array.isArray(n),s=Array.isArray(o),u=m(n),D=m(o);c&&s||u&&D?(t[i]=C(c?[]:{},n,o),i++):o!=null?(t[i]=o,i++):n!=null&&(t[i]=n,i++);}}for(let a=t.length;a<r;a++)e[a]!==void 0&&e[a]!==null&&t.push(e[a]);return t};function F(t,e){return H(t,"",{},e)}function H(t,e="",r={},i){if(r=m(r)?r:{},v(t)||N(t)||L(t)||Array.isArray(t)&&(i!=null&&i.skipArrays))return e&&(r[e]=t),r;if(typeof t=="function"||typeof t=="object"&&!m(t)&&!Re(t))return r;if(t instanceof Map||t instanceof WeakMap)return Array.from(t.entries()).forEach(([a,n])=>{let o=e?`${e}[${String(a)}]`:String(a);H(n,o,r,i);}),r;if(Array.isArray(t)||t instanceof Set||t instanceof WeakSet)return (Array.isArray(t)?t:Array.from(t)).forEach((n,o)=>{let c=e?`${e}[${o}]`:String(o);H(n,c,r,i);}),r;if(m(t))for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let n=t[a],o=e?e.endsWith("]")?`${e}.${a}`:`${e}.${a}`:a;H(n,o,r,i);}return r}function Re(t){return Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof WeakMap||t instanceof WeakSet}function Pe(t){return Object.entries(t)}Object.typedEntries=Pe;Object.flatten=F;Object.clone=Z;function O(t,e){if(t==null)return "";if(typeof t=="string")return t;if((typeof t=="number"||typeof t=="object"&&t instanceof Number)&&typeof t.formatNumber=="function")return t.formatNumber();if(t instanceof Date||typeof t=="object"&&t!==null&&t.constructor===Date)return typeof t.toFormat=="function"?t.toFormat():t.toISOString();if(t instanceof Error)return `Error: ${t.message}`;if(L(t))return t.toString();if(v(t))return String(t);if(Array.isArray(t))return JSON.stringify(t);if(typeof t=="object"&&t!==null){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();if(typeof t.toString=="function"){let r=t.toString();if(r!=="[object Object]")return r}return JSON.stringify(t)}return typeof(t==null?void 0:t.toString)=="function"?t.toString():String(t)}function ue(t,e,r){let i=(r==null?void 0:r.valueFormatter)||O,a=f(t);if(!m(e)||!e)return a;let n=(r==null?void 0:r.tagRegex)||/%\{([^}]+)\}/g,o=new Set,c,s=f(t);for(;(c=n.exec(s))!==null;){let u=c[1];u!==void 0&&o.add(u);}return o.forEach(u=>{if(r!=null&&r.tagRegex){let $=new RegExp(r.tagRegex.source,r.tagRegex.flags);[...s.matchAll($)].forEach(k=>{let ye=k[0];if(!k[1])return;let P=k[1],G=Object.prototype.hasOwnProperty.call(e,P)?e[P]:void 0,pe=G===void 0?"":(()=>{try{return i(G,P,O)}catch(Fe){return O(G)}})(),ge=ye.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(ge,"g"),pe);});return}let D=`%{${u}}`,b=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,R=b===void 0?"":(()=>{try{return i(b,u,O)}catch($){return O(b)}})(),fe=D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(fe,"g"),R);}),a}var p=class p{constructor(e={},r={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;l(r.locale)&&(this.locale=r.locale),l(r.fallbackLocale)&&(this._fallbackLocale=r.fallbackLocale),typeof r.interpolate=="function"&&(this.interpolateFunc=r.interpolate),this._hasDefaultTranslations||(this.registerTranslations(K),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!p.instance){let r=p.getLocaleFromSession(),i=Object.assign({locale:r||"en"},e);p.instance=new p({},i);}return p.instance}static createInstance(e={},r={}){return new p(e,r)}static flattenObject(e){return m(e)?F(e):e}static getLocaleFromSession(){let e=j.get("i18n.locale");return l(e)?e:void 0}static registerMomentLocale(e,r){return l(e)&&m(r)&&Array.isArray(r.months)&&(this.momentLocales[e]=C({},this.momentLocales[e],r)),this.momentLocales}static getClassTanslationKeys(e){return Q(e,me)}translate(e,r){var o;r=r||{};let i=f(r==null?void 0:r.locale,this.getLocale()),a=Array.isArray(e)?e:[e],n;for(let c of a){if(!l(c))continue;let s=this.lookup(c,i);if(s===void 0&&i!==this._fallbackLocale&&(s=this.lookup(c,this._fallbackLocale)),s!==void 0){n=s;break}}if(n===void 0)return r.defaultValue!==void 0?r.defaultValue:this.missingTranslation(e,r);if(typeof r.count=="number"&&m(n)){let c=r.count,s="other";c===0&&n.zero!==void 0?s="zero":c===1&&n.one!==void 0&&(s="one"),n[s]!==void 0?n=n[s]:n.other&&(n=n.other);}return typeof n=="string"&&(g(r.count)&&!r.countStr&&(r.countStr=typeof((o=r.count)==null?void 0:o.formatNumber)=="function"?r.count.formatNumber():r.count.toString()),n=this.performInterpolation(n,r)),n}t(e,r){return this.translate(e,r)}has(e,r){let i=r||this.getLocale(),a=Array.isArray(e)?e:[e];for(let n of a)if(this.lookup(n,i)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,r=false){return B(this,null,function*(){return this.locale===e&&r!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&p.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),r=Array.isArray(this._locales)?this._locales:["en"],i=[...e,...r.filter(a=>!e.includes(a))];return Array.from(new Set(i))}hasLocale(e){return l(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===p.instance}registerTranslations(e){return this._translations=C({},this._translations,e),this._translations}getTranslations(e){return l(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,r){if(!l(e)||typeof r!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=r;}loadNamespace(e,r,i=true){return !l(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(r=f(r,this.getLocale()),l(r)?this.namespaceResolvers[e](r).then(a=>{let n={};return n[r]=Object.assign({},a),m(a)&&i!==false&&this.registerTranslations(n),n}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,r=true){return B(this,null,function*(){e=f(e,this.getLocale());let i=[],a={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&i.push(this.namespaceResolvers[o](e).then(c=>{C(a,c);}));yield Promise.all(i);let n={};return n[e]=a,r!==false&&this.registerTranslations(n),this._namespacesLoaded[e]=true,n})}get(e,r){r=f(r,this.getLocale());let i=(l(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(l);if(!i.length)return;let a=this.getTranslations(r);for(let n of i)if(m(a))a=a[n];else return;return a}translateClass(e,r){let i=p.getClassTanslationKeys(e);for(let a in i)l(i[a])&&(i[a]=this.translate(i[a],r));return i}translateObject(e,r){if(!m(e))return {};let i={};for(let a in e){let n=e[a];l(n)&&(i[a]=this.translate(n,r));}return i}applyTranslations(e){try{let r=Object.getOwnPropertyNames(e);for(let i of r){let a=Reflect.getMetadata(me,e,i);if(a)try{e[i]=this.translate(a);}catch(n){I.error(n," resolving translation for key : ",a," on object : ",e);}}}catch(r){I.error(r," resolving translations for object : ",e);}}missingTranslation(e,r){let i=f(Array.isArray(e)?e.filter(l)[0]:f(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,i,f(r==null?void 0:r.defaultValue),r):i}lookup(e,r){let i=this._translations[r];if(!i)return;if(Object.prototype.hasOwnProperty.call(i,e))return i[e];let a=e.split("."),n=i;for(let o of a)if(m(n)&&Object.prototype.hasOwnProperty.call(n,o))n=n[o];else return;return n}performInterpolation(e,r){let i=F(r);return this.interpolateFunc?this.interpolateFunc(this,e,r):this.defaultInterpolator(e,i)}defaultInterpolator(e,r){return ue(e,r,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){j.set("i18n.locale",e);}getMomentLocale(e){return p.momentLocales[e]}setMomentLocale(e){try{return S__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(r){console.error(r," setting moment locale : ",e);}return false}};p.momentLocales={};var w=p,z=w.getInstance();var me=Symbol("TRANSLATION_KEY");var Ee={};Object.keys(Y).map(t=>{let e=Y[t];Ee[e.dialCode]=e.code;});var J=class{static isValid(e){return m(e)&&l(e.code)}static getPhoneNumberExample(e){var r;return f((r=this.getCountry(e))==null?void 0:r.phoneNumberExample)}static getFlag(e){var r;return f((r=this.getCountry(e))==null?void 0:r.flag)}static getCurrency(e){var r;return (r=this.getCountry(e))==null?void 0:r.currency}static setCountry(e){this.isValid(e)&&(this.countries[e.code]=e);}static getCountry(e){if(l(e))return C({},z.t(`countries.${e}`),this.countries[e])}static getCountries(){let e=z.t("countries");return m(e)?C({},e,this.countries):this.countries}static setCountries(e){if(!m(e))return this.countries;for(let r in e){let i=e[r];this.isValid(i)&&(this.countries[r]=C({},this.countries[r],i));}return this.countries}};J.countries=Y;exports.CountriesManager=J;
5
+ %{nestedErrors}`,validateNestedInvalidType:"The field %{fieldName} must be an object, but received %{receivedType}",dateAfter:"This field must be after %{date}",dateBefore:"This field must be before %{date}",dateBetween:"This field must be between %{startDate} and %{endDate}",dateEquals:"This field must be equal to %{date}",futureDate:"This field must be a date in the future",pastDate:"This field must be a date in the past",file:"This field must be a valid file",fileSize:"This field must not exceed %{maxSize} bytes",fileType:"This field must be one of the following types: %{allowedTypes}",image:"This field must be a valid image file",fileExtension:"This field must have one of the following extensions: %{allowedExtensions}",minFileSize:"This field must be at least %{minSize} bytes",uuid:"This field must be a valid UUID",json:"This field must be valid JSON",base64:"This field must be valid Base64 encoded data",hexColor:"This field must be a valid hexadecimal color code",creditCard:"This field must be a valid credit card number",ip:"This field must be a valid IP address (version %{version})",macAddress:"This field must be a valid MAC address",matches:"This field must match the pattern %{pattern}",mongoId:"This field must be a valid MongoDB ObjectId",hexadecimal:"This field must be a valid hexadecimal value",object:"This field must be an object",isObject:"This field must be an object",invalidBulkData:"Invalid bulk data: an array is required",bulkValidationFailed:{one:"Bulk validation failed: 1 of %{totalCount} items failed",other:"Bulk validation failed: %{failureCount} of %{totalCount} items failed"},bulkValidationAllFailed:{one:"Validation failed for the single item",other:"All %{totalCount} items failed validation"},bulkValidationPartialFailure:"%{failureCount} items failed validation",separators:{multiple:", ",single:", "},nestedErrors:{separator:"; ",prefix:"",suffix:""},tests:{entity:{name:"Name",id:"Id",email:"Email",aString:"A String",url:"Url",note:"Note",createdAt:"Created At",updatedAt:"Updated At"}}};var De={auth:q,currencies:X,countries:Y,dates:_,resources:ee,validator:te};function l(t){return !!(t&&typeof t=="string")}function f(...t){for(var e in t){let r=t[e];if(l(r))return r}return ""}function V(t){return !!(t==null||typeof t=="undefined"||typeof t=="string"&&t===""||Array.isArray(t)&&!t.length)}function g(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function N(t){return !t||typeof t!="object"?false:t instanceof Date?true:typeof t.getTime!="function"?false:!(Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))}var d=class d{static parseString(e,r){if(l(e)&&l(r))try{let i=S__default.default(e,r,!0);if(i.isValid())return {date:i.toDate(),matchedFormat:r,isValid:!0}}catch(i){}try{if(Array.isArray(r)&&(r!=null&&r.length))for(let i of r){let a=re(e,i);if(a)return a}for(let i of d.DATE_FORMATS){let a=re(e,i);if(a)return a}return {date:null,matchedFormat:null,isValid:!1,error:"Unable to parse date string with any known format"}}catch(i){return {date:null,matchedFormat:null,isValid:false,error:i instanceof Error?i.message:"Unknown error occurred while parsing date"}}}static toIsoString(e){let r=e?d.parseDate(e):new Date;return r?r.toISOString():""}static isoStringToDate(e){return new Date(e)}static parseDate(e,r){if(d.isDateObj(e))return e;if(!l(r)){let i=d.parseString(e);return i!=null&&i.isValid?i.date:null}if(V(e))return null;try{let i=S__default.default(e,r,!0);if(i!=null&&i.isValid())return i.toDate()}catch(i){console.error(i," parsing date with moment : ",e," format is : ",r);}return null}static toSQLDateTimeFormat(e){if(!d.isDateObj(e))return "";let r=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),n=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return `${r}-${i}-${a} ${n}:${o}:${c}`}static getI18n(e){return w.isI18nInstance(e)?e:w.getInstance()}static getDefaultDateTimeFormat(e){return f(this.getI18n(e).get("dates.defaultDateTimeFormat"),"YYYY-MM-DD HH:mm")}static getDefaultDateFormat(e){return f(this.getI18n(e).get("dates.defaultDateFormat"),"YYYY-MM-DD")}static toSQLDateFormat(e){if(!d.isDateObj(e))return "";let r=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${r}-${i}-${a}`}static toSQLTimeFormat(e){if(!d.isDateObj(e))return "";let r=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return `${r}:${i}:${a}`}static getDefaultTimeFormat(e){return f(this.getI18n(e).get("dates.defaultTimeFormat"),"HH:mm")}static isValidDate(e,r){if(e==null||typeof e=="boolean")return false;if(d.isDateObj(e))return true;if(g(e)){let a=new Date(e);return a&&!isNaN(a.getTime())}if(l(e))return !!d.parseDate(e,r);if(e!=null&&e.toString&&(e==null?void 0:e.toString())==parseInt(e).toString())return false;let i=new Date(e);return d.isDateObj(i)}static addToDate(e,r,i){if(g(e)||(e=0),V(r)&&(r=new Date),d.isValidDate(r)&&l(r)&&(r=new Date(r)),d.isValidDate(r)||(r=l(r)?new Date(r):new Date),l(i)&&typeof r["set"+i]=="function"&&typeof r["get"+i]=="function"){let a="set"+i,n="get"+i;r=new Date(r[a](r[n]()+e));}return r}static addDays(e,r){return d.addToDate(e,r,"Date")}static addMilliseconds(e,r){return g(e)||(e=0),d.isDateObj(r)||(r=new Date),r=r||new Date,new Date(r.getTime()+e)}static addSeconds(e,r){return g(e)||(e=0),d.addMilliseconds(e*1e3,r)}static addMinutes(e,r){return g(e)||(e=0),d.addMilliseconds(e*6e4,r)}static addHours(e,r){return g(e)||(e=0),d.addMilliseconds(e*36e5,r)}static addMonths(e,r,i){return d.addToDate(e,r,"Month")}static addWeeks(e,r){return e=(g(e)?e:0)*7,d.addToDate(e,r,"Date")}static addYears(e,r){g(e)||(e=0);let i=new Date(d.addToDate(0,r)),a=i.getFullYear();return a+e<0?e=0:e+=a,i.setFullYear(e),new Date(i)}static formatDate(e,r){try{let i=S__default.default(e);if(i.isValid())return i.format(f(r,d.getDefaultDateTimeFormat()))}catch(i){}return f(d.isValidDate(e)?e==null?void 0:e.toString():"")}static getUTCDateTimeDetails(e){let r=e?S__default.default.utc(e):S__default.default.utc();return {year:r.year(),day:r.day(),month:r.month(),monthString:r.format("MM"),hours:r.hours(),date:r.date(),minutes:r.minutes(),seconds:r.seconds(),monthName:r.format("MMMM"),dayName:r.format("dddd"),dayNameShort:r.format("ddd")}}};d.DATE_FORMATS=["YYYY-MM-DD","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ssZ","YYYY-MM-DDTHH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss[Z]","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DDTHH:mm:ss.SSSZ ","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD HH:mm:ss","YYYY-MM-DD HH:mm:ss.SSSZ","YYYY-MM-DDTHH:mm:ss.SSS[Z]","YYYY-MM-DD HH:mm:ssZ","YYYY-MM-DD HH:mmZ","MM/DD/YYYY","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YY","MMMM DD, YYYY","MMM DD, YYYY","DD/MM/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YY","DD MMMM YYYY","DD MMM YYYY","HH:mm:ss.SSSZ","HH:mm:ssZ","HH:mmZ","YYYYMMDD","YYYYMMDDTHHMM","YYYYMMDDTHHMMSS","HH:mm:ss","HH:mm","hh:mm A","h:mm A","HH:mm:ss.SSS","YYYY-DDD","YYYY-Www","YYYY-Www-D","YYYY/MM/DD","YYYY.MM.DD","MMM D, YYYY","MMMM D, YYYY","D MMM YYYY","D MMMM YYYY","MMM D YYYY","ddd, DD MMM YYYY HH:mm:ss ZZ","ddd, DD MMM YYYY HH:mm:ss","dddd, MMMM D, YYYY","dddd, D MMMM YYYY","hh:mm:ss A","H:mm:ss","YYYY-[W]WW","YYYY-[W]WW-E","YYYY-MM-DDTHH:mm:ss.SSS","DD-MM-YYYY HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MMM D YYYY, h:mm a","MMMM D YYYY, h:mm a","h:mm A MMM D, YYYY","MMMM D, YYYY","YY-MM-DD","DD-MM-YY","MM/DD/YY","MMM DD, YY","D MMM YY","D MMMM YY","YYYY MMM D","YYYY-MM-DD HH:mm","YYYY-MM-DD HH:mm:ss.SSS"],d.SQL_DATE_FORMAT="YYYY-MM-DD",d.SQL_DATE_TIME_FORMAT="YYYY-MM-DD HH:mm:ss",d.SQL_TIME_FORMAT="HH:mm:ss",d.getCurrentMonthDaysRange=e=>{let r=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),i=new Date(r.getFullYear(),r.getMonth(),1),a=new Date(r.getFullYear(),r.getMonth()+1,0);return {first:i,last:a}},d.getPreviousWeekDaysRange=e=>{let r=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),i=new Date(r.getTime()-3600*24*7*1e3),a=new Date(i),n=i.getDay(),o=i.getDate()-n+(n===0?-6:1),c=new Date(i.setDate(o)),s=new Date(a.setDate(o+6));return {first:c,last:s}},d.getCurrentWeekDaysRange=e=>{let r=d.isValidDate(e)?new Date(e):new Date().resetHours2Minutes2Seconds(),i=r.getDay(),a=r.getDate()-i+(i==0?-6:1),n=new Date(r),o=new Date(r.setDate(a));return n.setDate(n.getDate()+6),{first:o,last:n}},d.isDateObj=N;var y=d,re=(t,e)=>{let r=S__default.default(t,e,true);try{if(r.isValid()&&r.format(e)===t||S__default.default.utc(r,!0).format(e)===t)return {date:r.toDate(),matchedFormat:e,isValid:!0}}catch(i){}return null};Date.prototype.toSQLDateTimeFormat=function(){return y.toSQLDateTimeFormat(this)};Date.prototype.toSQLDateFormat=function(){return y.toSQLDateFormat(this)};Date.prototype.toSQLTimeFormat=function(){return y.toSQLTimeFormat(this)};Date.prototype.resetHours=function(){return this.setHours(0),this};Date.prototype.resetMinutes=function(){return this.setMinutes(0),this};Date.prototype.resetSeconds=function(){return this.setSeconds(0),this};Date.prototype.resetMilliseconds=function(){return this.setMilliseconds(0),this};Date.prototype.resetHours2Minutes2Seconds=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.toFormat=function(t){return y.formatDate(this,t)};Date.prototype.addYears=function(t){return y.addYears(t,this)};Date.prototype.addMonths=function(t){return y.addMonths(t,this)};Date.prototype.addMinutes=function(t){return y.addMinutes(t,this)};Date.prototype.addSeconds=function(t){return y.addSeconds(t,this)};Date.prototype.addDays=function(t){return y.addDays(t,this)};Date.prototype.addWeeks=function(t){return y.addWeeks(t,this)};Date.prototype.addHours=function(t){return y.addHours(t,this)};var M=class M{static get logger(){let e=Reflect.getMetadata(M.loggerMetaData,M);return ie(e)&&(this._logger=e),this._logger?this._logger:console}static set logger(e){ie(e)&&Reflect.defineMetadata(M.loggerMetaData,e,M);}static _log(e,...r){let i=M.logger;e=f(e),e&&typeof i[e]=="function"?i[e](M.getDateTimeString(),...r):console.log("Logger level not found : [",e,"]",...r);}static getDateTimeString(){let{day:e,year:r,hours:i,minutes:a,seconds:n,dayNameShort:o,monthName:c}=y.getUTCDateTimeDetails(),s=e<10?"0"+e:e,u=i<10?"0"+i:i,D=a<10?"0"+a:a,b=n<10?"0"+n:n;return "["+[o,s,c,r].join(" ")+" "+[u,D,b].join(":")+"]"}static log(...e){this._log("log",...e);}static info(...e){this._log("info",...e);}static debug(...e){this._log("debug",...e);}static warn(...e){this._log("warn",...e);}static error(...e){this._log("error",...e);}};M.loggerMetaData=Symbol("logger-meta-data");var I=M,ie=t=>{if(!t)return false;try{return ["warn","info","error"].every(e=>typeof t[e]=="function")}catch(e){return false}};function Me(t){return typeof t=="boolean"||!t||typeof t=="number"||typeof t=="string"||typeof t=="symbol"?false:Object(t).constructor===Promise||t.constructor&&(t.constructor.name==="Promise"||t.constructor.name==="AsyncFunction")||t instanceof Promise||typeof(t==null?void 0:t.then)=="function"&&typeof(t==null?void 0:t.catch)=="function"&&typeof(t==null?void 0:t.finally)=="function"?true:t&&typeof t.constructor=="function"&&Function.prototype.toString.call(t.constructor).replace(/\(.*\)/,"()")===Function.prototype.toString.call(Function).replace("Function","Promise").replace(/\(.*\)/,"()")}function ae(t){return t&&Object.prototype.toString.call(t)==="[object Promise]"?true:Me(t)}function ne(){return typeof window!="undefined"&&(window==null?void 0:window.document)!==void 0&&typeof document!="undefined"&&typeof navigator!="undefined"}var x=()=>{var t;try{if(typeof process!="undefined"&&(process!=null&&process.versions)&&((t=process==null?void 0:process.versions)!=null&&t.node)||typeof global=="object"&&(global==null?void 0:global.toString.call(global))==="[object global]")return !0}catch(e){}return false},Te=()=>{var t,e;return !!(typeof window!="undefined"&&window&&typeof(window==null?void 0:window.process)=="object"&&((t=window==null?void 0:window.process)==null?void 0:t.type)==="renderer"||typeof process!="undefined"&&typeof(process==null?void 0:process.versions)=="object"&&((e=process.versions)!=null&&e.electron)||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&String(navigator==null?void 0:navigator.userAgent).toLowerCase().indexOf("electron")>=0)},be=()=>{if(typeof document!="undefined"&&document)try{return document.createEvent("TouchEvent"),!0}catch(t){try{return "ontouchstart"in window||"onmsgesturechange"in window}catch(e){}}return false},Se=()=>typeof window=="undefined"&&typeof process!="undefined",oe=()=>!!(typeof window!="undefined"&&typeof window=="object"&&window),Ye=()=>{if(!ne()||typeof navigator!="object"||!navigator||typeof navigator.userAgent!="string")return false;let t=navigator.userAgent.toLowerCase();return /android/i.test(t)},we=()=>{var t;return !oe()||!(window!=null&&window.ReactNativeWebView)?false:typeof((t=window==null?void 0:window.ReactNativeWebView)==null?void 0:t.postMessage)=="function"},Ae=()=>x()&&process.platform==="darwin",Ne=()=>x()&&process.platform==="win32",Ie=()=>x()&&process.platform==="linux",se={isWeb:ne,isLinux:Ie,isDarwin:Ae,isWin32:Ne,isNode:x,isElectron:Te,isTouchDevice:be,isServerSide:Se,isClientSide:oe,isAndroidMobileBrowser:Ye,isReactNativeWebview:we};var A=class t{static decycle(e,r=[]){if(typeof e=="function")return;if(!e||typeof e!="object")return e;if(r.includes(e))return null;let i=r.concat([e]);return Array.isArray(e)?e.map(a=>t.decycle(a,i)):Object.fromEntries(Object.entries(e).map(([a,n])=>[a,t.decycle(n,i)]))}static stringify(e,r=false,i,a){return typeof e=="string"?e:JSON.stringify(r!==false?t.decycle(e):e,i,a)}static isJSON(e){if(typeof e!="string")return false;let r=e.trim();if(r.length===0)return false;try{let i=JSON.parse(r);return i!==null&&typeof i=="object"}catch(i){return false}}static parse(e,r){if(typeof e=="string")try{e=JSON.parse(e,r);}catch(i){return e}if(e&&typeof e=="object")for(let i in e){let a=e[i];t.isJSON(a)&&(e[i]=t.parse(a,r));}return e}};var T=class T{static get storage(){var r;let e=Reflect.getMetadata(T.sessionStorageMetaData,T);if(W(e)&&(this._storage=e),this._storage)return this._storage;if(se.isClientSide()&&typeof window!="undefined"&&window.localStorage&&((r=window.localStorage)!=null&&r.getItem))this._storage={get:i=>window.localStorage.getItem(i),set:(i,a)=>window.localStorage.setItem(i,a),remove:i=>window.localStorage.removeItem(i),removeAll:()=>window.localStorage.clear()};else {let i={};this._storage={get:a=>i[a],set:(a,n)=>i[a]=n,remove:a=>{delete i[a];},removeAll:()=>i={}};}return this._storage}static set storage(e){W(e)&&Reflect.defineMetadata(T.sessionStorageMetaData,e,T);}static get keyNamespace(){return l(this._keyNamespace)?this._keyNamespace:""}static set keyNamespace(e){l(e)&&(this._keyNamespace=e.trim().replace(/\s+/g,"-"));}static sanitizeKey(e){if(!e||!l(e))return "";e=e.trim().replace(/\s+/g,"-");let r=this.keyNamespace;return r?`${r}-${e}`:e}};T.sessionStorageMetaData=Symbol("sessionStorage"),T._keyNamespace=void 0;var h=T;function E(t){return h.sanitizeKey(t)}var de=(t,e)=>(t=t&&A.stringify(t,e),t==null&&(t=""),t),le=t=>{if(ae(t))return new Promise((e,r)=>{t.then(i=>{e(A.parse(i));}).catch(i=>{r(i);});});if(t!=null)return A.parse(t)},ve=t=>{if(t=E(t),h.storage&&t&&typeof t=="string"){let e=h.storage.get(t);return le(e)}},Le=t=>{if(t=E(t),h.storage&&t&&typeof t=="string")return h.storage.remove(t)},Oe=()=>{if(h.storage)return h.storage.removeAll()},W=t=>{if(!t)return false;try{return ["get","set","remove","removeAll"].every(e=>typeof t[e]=="function")}catch(e){return false}},j={get:ve,set:(t,e,r=true)=>(t=E(t),h.storage.set(t,de(e,r))),remove:Le,handleGetValue:le,sanitizeKey:E,handleSetValue:de,isValidStorage:W,Manager:h,removeAll:Oe};function v(t){return t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function L(t){if(t instanceof RegExp)return true;if(!t||typeof t!="object"||!Object.prototype.toString.call(t).includes("RegExp"))return false;try{return new RegExp(t),!0}catch(e){return false}}function U(t){return typeof window!="object"||!window||typeof document=="undefined"||typeof HTMLElement=="undefined"||!HTMLElement?false:t===document?true:"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&typeof t=="object"&&t.nodeType===1&&!!t.nodeName}function m(t){if(t===null||typeof t!="object"||U(t)||N(t)||L(t)||v(t))return false;let e=Object.getPrototypeOf(t);if(e===null)return true;let r=e.constructor;if(typeof r!="function")return false;if(r===Object)return true;let i=r.prototype;return typeof i!="object"?false:i===Object.prototype?true:typeof e.hasOwnProperty=="function"&&Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")&&typeof e.isPrototypeOf=="function"}function Z(t){if(Array.isArray(t)){let i=[];for(var e=0;e<t.length;e++)i[e]=Z(t[e]);return i}else if(m(t)&&t){let i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]=Z(t[r]));return i}else return t}Object.getSize=function(t,e=false){if(!t||typeof t!="object")return 0;if(Array.isArray(t))return t.length;typeof e!="boolean"&&(e=false);let r=0;for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&(r++,e===true))return r;return r};function C(t,...e){let r=Array.isArray(t),i=m(t);(t==null||!r&&!i)&&(t={});for(let a=0;a<e.length;a++){let n=e[a];if(n==null)continue;let o=m(n),c=Array.isArray(n);if(!(!o&&!c)){if(r){c&&ce(t,n);continue}else if(c)continue;for(let s in n){let u=n[s];if(u==null)continue;if(u===n){t[s]=t;continue}let D=t[s],b=Array.isArray(D),R=Array.isArray(u);if(b){R?ce(t[s],u):t[s]=u;continue}else if(!m(D)){t[s]=u;continue}if(R||!m(u)){t[s]=u;continue}t[s]=C({},D,u);}}}return t}var ce=(t,e)=>{let r=e.length,i=0;for(let a=0;a<t.length;a++){let n=t[a],o=e[a];if(a<r){let c=Array.isArray(n),s=Array.isArray(o),u=m(n),D=m(o);c&&s||u&&D?(t[i]=C(c?[]:{},n,o),i++):o!=null?(t[i]=o,i++):n!=null&&(t[i]=n,i++);}}for(let a=t.length;a<r;a++)e[a]!==void 0&&e[a]!==null&&t.push(e[a]);return t};function F(t,e){return H(t,"",{},e)}function H(t,e="",r={},i){if(r=m(r)?r:{},v(t)||N(t)||L(t)||Array.isArray(t)&&(i!=null&&i.skipArrays))return e&&(r[e]=t),r;if(typeof t=="function"||typeof t=="object"&&!m(t)&&!Re(t))return r;if(t instanceof Map||t instanceof WeakMap)return Array.from(t.entries()).forEach(([a,n])=>{let o=e?`${e}[${String(a)}]`:String(a);H(n,o,r,i);}),r;if(Array.isArray(t)||t instanceof Set||t instanceof WeakSet)return (Array.isArray(t)?t:Array.from(t)).forEach((n,o)=>{let c=e?`${e}[${o}]`:String(o);H(n,c,r,i);}),r;if(m(t))for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let n=t[a],o=e?e.endsWith("]")?`${e}.${a}`:`${e}.${a}`:a;H(n,o,r,i);}return r}function Re(t){return Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof WeakMap||t instanceof WeakSet}function Pe(t){return Object.entries(t)}Object.typedEntries=Pe;Object.flatten=F;Object.clone=Z;function O(t,e){if(t==null)return "";if(typeof t=="string")return t;if((typeof t=="number"||typeof t=="object"&&t instanceof Number)&&typeof t.formatNumber=="function")return t.formatNumber();if(t instanceof Date||typeof t=="object"&&t!==null&&t.constructor===Date)return typeof t.toFormat=="function"?t.toFormat():t.toISOString();if(t instanceof Error)return `Error: ${t.message}`;if(L(t))return t.toString();if(v(t))return String(t);if(Array.isArray(t))return JSON.stringify(t);if(typeof t=="object"&&t!==null){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();if(typeof t.toString=="function"){let r=t.toString();if(r!=="[object Object]")return r}return JSON.stringify(t)}return typeof(t==null?void 0:t.toString)=="function"?t.toString():String(t)}function ue(t,e,r){let i=(r==null?void 0:r.valueFormatter)||O,a=f(t);if(!m(e)||!e)return a;let n=(r==null?void 0:r.tagRegex)||/%\{([^}]+)\}/g,o=new Set,c,s=f(t);for(;(c=n.exec(s))!==null;){let u=c[1];u!==void 0&&o.add(u);}return o.forEach(u=>{if(r!=null&&r.tagRegex){let $=new RegExp(r.tagRegex.source,r.tagRegex.flags);[...s.matchAll($)].forEach(k=>{let ye=k[0];if(!k[1])return;let P=k[1],G=Object.prototype.hasOwnProperty.call(e,P)?e[P]:void 0,pe=G===void 0?"":(()=>{try{return i(G,P,O)}catch(Fe){return O(G)}})(),ge=ye.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(ge,"g"),pe);});return}let D=`%{${u}}`,b=Object.prototype.hasOwnProperty.call(e,u)?e[u]:void 0,R=b===void 0?"":(()=>{try{return i(b,u,O)}catch($){return O(b)}})(),fe=D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a.replace(new RegExp(fe,"g"),R);}),a}var p=class p{constructor(e={},r={}){this.locale="en";this._locales=["en"];this._fallbackLocale="en";this._translations={};this.namespaceResolvers={};this._namespacesLoaded={};this._hasDefaultTranslations=false;l(r.locale)&&(this.locale=r.locale),l(r.fallbackLocale)&&(this._fallbackLocale=r.fallbackLocale),typeof r.interpolate=="function"&&(this.interpolateFunc=r.interpolate),this._hasDefaultTranslations||(this.registerTranslations(K),this._hasDefaultTranslations=true),e&&this.registerTranslations(e),this.loadNamespaces();}static[Symbol.hasInstance](e){return this.isI18nInstance(e)}static isI18nInstance(e){return !e||typeof e!="object"?false:e.constructor&&e.constructor.name==="I18n"?true:typeof e.getLocale=="function"&&typeof e.translate=="function"&&typeof e.translateClass=="function"&&typeof e.registerTranslations=="function"&&typeof e.loadNamespace=="function"&&typeof e.registerNamespaceResolver=="function"}static getInstance(e){if(!p.instance){let r=p.getLocaleFromSession(),i=Object.assign({locale:r||"en"},e);p.instance=new p({},i);}return p.instance}static createInstance(e={},r={}){return new p(e,r)}static flattenObject(e){return m(e)?F(e):e}static getLocaleFromSession(){let e=j.get("i18n.locale");return l(e)?e:void 0}static registerMomentLocale(e,r){return l(e)&&m(r)&&Array.isArray(r.months)&&(this.momentLocales[e]=C({},this.momentLocales[e],r)),this.momentLocales}static getClassTanslationKeys(e){return Q(e,me)}translate(e,r){var o;r=r||{};let i=f(r==null?void 0:r.locale,this.getLocale()),a=Array.isArray(e)?e:[e],n;for(let c of a){if(!l(c))continue;let s=this.lookup(c,i);if(s===void 0&&i!==this._fallbackLocale&&(s=this.lookup(c,this._fallbackLocale)),s!==void 0){n=s;break}}if(n===void 0)return r.defaultValue!==void 0?r.defaultValue:this.missingTranslation(e,r);if(typeof r.count=="number"&&m(n)){let c=r.count,s="other";c===0&&n.zero!==void 0?s="zero":c===1&&n.one!==void 0&&(s="one"),n[s]!==void 0?n=n[s]:n.other&&(n=n.other);}return typeof n=="string"&&(g(r.count)&&!r.countStr&&(r.countStr=typeof((o=r.count)==null?void 0:o.formatNumber)=="function"?r.count.formatNumber():r.count.toString()),n=this.performInterpolation(n,r)),n}t(e,r){return this.translate(e,r)}has(e,r){let i=r||this.getLocale(),a=Array.isArray(e)?e:[e];for(let n of a)if(this.lookup(n,i)!==void 0)return true;return false}getLocale(){return this.locale}setLocale(e,r=false){return B(this,null,function*(){return this.locale===e&&r!==true&&this._namespacesLoaded[e]?this.locale:(yield this.loadNamespaces(e),this.locale=e,this.isDefaultInstance()&&p.setLocaleToSession(e),this.setMomentLocale(e),this.locale)})}setLocales(e){return this._locales=Array.isArray(e)?e:["en"],this._locales.includes("en")||this._locales.push("en"),this.getLocales()}getLocales(){let e=Object.keys(this._translations),r=Array.isArray(this._locales)?this._locales:["en"],i=[...e,...r.filter(a=>!e.includes(a))];return Array.from(new Set(i))}hasLocale(e){return l(e)&&this.getLocales().includes(e)}isDefaultInstance(){return this===p.instance}registerTranslations(e){return this._translations=C({},this._translations,e),this._translations}getTranslations(e){return l(e)?this._translations[e]||{}:this._translations}registerNamespaceResolver(e,r){if(!l(e)||typeof r!="function"){console.warn("Invalid arguments for registerNamespaceResolver.");return}this.namespaceResolvers[e]=r;}loadNamespace(e,r,i=true){return !l(e)||!this.namespaceResolvers[e]?Promise.reject(new Error(`Invalid namespace or resolver for namespace "${e}".`)):(r=f(r,this.getLocale()),l(r)?this.namespaceResolvers[e](r).then(a=>{let n={};return n[r]=Object.assign({},a),m(a)&&i!==false&&this.registerTranslations(n),n}):Promise.reject(new Error(`Locale is not set. Cannot load namespace "${e}".`)))}loadNamespaces(e,r=true){return B(this,null,function*(){e=f(e,this.getLocale());let i=[],a={};for(let o in this.namespaceResolvers)Object.prototype.hasOwnProperty.call(this.namespaceResolvers,o)&&i.push(this.namespaceResolvers[o](e).then(c=>{C(a,c);}));yield Promise.all(i);let n={};return n[e]=a,r!==false&&this.registerTranslations(n),this._namespacesLoaded[e]=true,n})}get(e,r){r=f(r,this.getLocale());let i=(l(e)?e.trim().split("."):Array.isArray(e)?e:[]).filter(l);if(!i.length)return;let a=this.getTranslations(r);for(let n of i)if(m(a))a=a[n];else return;return a}translateClass(e,r){let i=p.getClassTanslationKeys(e);for(let a in i)l(i[a])&&(i[a]=this.translate(i[a],r));return i}translateObject(e,r){if(!m(e))return {};let i={};for(let a in e){let n=e[a];l(n)&&(i[a]=this.translate(n,r));}return i}applyTranslations(e){try{let r=Object.getOwnPropertyNames(e);for(let i of r){let a=Reflect.getMetadata(me,e,i);if(a)try{e[i]=this.translate(a);}catch(n){I.error(n," resolving translation for key : ",a," on object : ",e);}}}catch(r){I.error(r," resolving translations for object : ",e);}}missingTranslation(e,r){let i=f(Array.isArray(e)?e.filter(l)[0]:f(e));return typeof this.missingPlaceholder=="function"?this.missingPlaceholder(this,i,f(r==null?void 0:r.defaultValue),r):i}lookup(e,r){let i=this._translations[r];if(!i)return;if(Object.prototype.hasOwnProperty.call(i,e))return i[e];let a=e.split("."),n=i;for(let o of a)if(m(n)&&Object.prototype.hasOwnProperty.call(n,o))n=n[o];else return;return n}performInterpolation(e,r){let i=F(r);return this.interpolateFunc?this.interpolateFunc(this,e,r):this.defaultInterpolator(e,i)}defaultInterpolator(e,r){return ue(e,r,{tagRegex:/%\{([^}]+)\}/g})}static setLocaleToSession(e){j.set("i18n.locale",e);}getMomentLocale(e){return p.momentLocales[e]}setMomentLocale(e){try{return S__default.default.updateLocale(e,this.getMomentLocale(e)),!0}catch(r){console.error(r," setting moment locale : ",e);}return false}};p.momentLocales={};var w=p,z=w.getInstance();var me=Symbol("TRANSLATION_KEY");var Ee={};Object.keys(Y).map(t=>{let e=Y[t];Ee[e.dialCode]=e.code;});var J=class{static isValid(e){return m(e)&&l(e.code)}static getPhoneNumberExample(e){var r;return f((r=this.getCountry(e))==null?void 0:r.phoneNumberExample)}static getFlag(e){var r;return f((r=this.getCountry(e))==null?void 0:r.flag)}static getCurrency(e){var r;return (r=this.getCountry(e))==null?void 0:r.currency}static setCountry(e){this.isValid(e)&&(this.countries[e.code]=e);}static getCountry(e){if(l(e))return C({},z.t(`countries.${e}`),this.countries[e])}static getCountries(){let e=z.t("countries");return m(e)?C({},e,this.countries):this.countries}static setCountries(e){if(!m(e))return this.countries;for(let r in e){let i=e[r];this.isValid(i)&&(this.countries[r]=C({},this.countries[r],i));}return this.countries}};J.countries=Y;exports.CountriesManager=J;